Skip to content

Instantly share code, notes, and snippets.

View yutannihilation's full-sized avatar
🍣
Nobody loves you

Hiroaki Yutani yutannihilation

🍣
Nobody loves you
View GitHub Profile
library(ggplot2)
library(grid)
size <- unit(70, "points")
x_orig <- unit(0.5, "npc")
y_orig <- unit(0.5, "npc")
gp1 <- gpar(col = "white", fill = "#CEF09D", lwd = 3.3)
gp2 <- gpar(col = "white", fill = "#1C646D", lwd = 3.3)
library(grid)
rect <- function(size, rot_deg) {
theta <- (c(1 / 4, 3 / 4, 5 / 4, 7 / 4) - rot_deg / 360) * pi
rectGrob(x = size * sqrt(2) * sin(theta),
y = size * sqrt(2) * cos(theta))
}
size <- unit(100, "points")
x_orig <- unit(0.5, "npc")
#| dev: ragg_png
library(grid)
library(ggplot2)
# gpar everywhere to rule out an "invisible lines" issue
gp <- gpar(col = "black", fill = "transparent", lwd = 2, lty = "solid")
mm_rel <- function(...) {
unit(0.5, "npc") + unit((base::c(...) - 0.5) * 10, "mm")
deps <- pkgdepends::new_pkg_installation_proposal(".", config = list(sysreqs = TRUE, sysreqs_lookup_system = FALSE))
deps$solve()
any(vapply(deps$get_sysreqs(), \(x) "cargo" %in% names(x), logical(1L)))

1. List up non-APIs

$ Rscript -e 'cat(tools:::nonAPI, sep = "\n")' | sort -u > nonAPI.txt
$ cat nonAPI.txt
AllDevicesKilled
Brent_fmin
OutDec
PRIMOFFSET
RC_fopen
library(ggplot2)
library(patchwork)
library(dplyr, warn.conflicts = FALSE)
d <- string2path::string2path("R", "Arial")
max_dist <- 0.003
d2 <- d |>
group_by(glyph_id, path_id) |>
library(ggplot2)
f <- systemfonts::system_fonts() |>
dplyr::filter(family == "Iosevka", style == "Heavy") |>
dplyr::pull(path)
d_pkg <- string2path::string2fill("arrow", f[1], tolerance = 0.01) |>
dplyr::mutate(
fill = as.integer(triangle_id + 50 * runif(dplyr::n()))
library(ggplot2)
library(string2path)
library(dplyr, warn.conflicts = FALSE)
library(gganimate)
f <- systemfonts::system_fonts()
# This is reproducible but only on my laptop, sorry for my laziness...
set.seed(100)
some_fonts <- sample(f$path[tools::file_ext(f$path) %in% c("ttf", "otf")], 30)
library(string2path)
library(ggplot2)
d <- string2path("?", "/usr/share/fonts/truetype/roboto/unhinted/RobotoTTF/Roboto-BoldItalic.ttf")
f <- function(d, theta) {
d <- dplyr::mutate(d, x = x + 0.02 * cos(theta * 3.2), y = y + 0.02 * sin(theta * 2.1))
d2 <- dplyr::bind_rows(
@yutannihilation
yutannihilation / current.md
Last active September 20, 2021 00:48
Check the behaviours around manual scales (current.md: the current dev version, pr4619.md: https://github.com/tidyverse/ggplot2/pull/4619)