diff --git a/Cargo.lock b/Cargo.lock
index 29f8c42a..57b681de 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3602,6 +3602,7 @@ dependencies = [
"blake3",
"bytes",
"chrono",
+ "chrono-tz",
"fast-float2",
"fs4",
"futures",
@@ -3640,6 +3641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dd2126daebf58da564fc5840cd55eb8eb2479d24dfced0a1aea2178a9b33b12"
dependencies = [
"chrono",
+ "chrono-tz",
"fallible-streaming-iterator",
"hashbrown 0.16.1",
"indexmap",
diff --git a/doc/syntax/scale/aesthetic/generate_examples.R b/doc/syntax/scale/aesthetic/generate_examples.R
index 4498ad90..9ab782b8 100644
--- a/doc/syntax/scale/aesthetic/generate_examples.R
+++ b/doc/syntax/scale/aesthetic/generate_examples.R
@@ -9,25 +9,84 @@ CONTINUOUS_PALETTES <- c(
# ggsql default
"sequential",
# Crameri Sequential
- "navia", "batlow", "batlowk", "batloww", "hawaii", "lajolla", "tokyo",
- "turku", "acton", "bamako", "bilbao", "buda", "davos", "devon", "glasgow",
- "grayc", "imola", "lapaz", "lipari", "nuuk", "oslo",
+ "navia",
+ "batlow",
+ "batlowk",
+ "batloww",
+ "hawaii",
+ "lajolla",
+ "tokyo",
+ "turku",
+ "acton",
+ "bamako",
+ "bilbao",
+ "buda",
+ "davos",
+ "devon",
+ "glasgow",
+ "grayc",
+ "imola",
+ "lapaz",
+ "lipari",
+ "nuuk",
+ "oslo",
# Crameri Multi-Sequential
- "bukavu", "fes", "oleron",
+ "bukavu",
+ "fes",
+ "oleron",
# Crameri Diverging
- "vik", "berlin", "roma", "bam", "broc", "cork", "lisbon", "managua",
- "tofino", "vanimo",
+ "vik",
+ "berlin",
+ "roma",
+ "bam",
+ "broc",
+ "cork",
+ "lisbon",
+ "managua",
+ "tofino",
+ "vanimo",
# Crameri Cyclic
- "romao", "bamo", "broco", "corko", "viko",
+ "romao",
+ "bamo",
+ "broco",
+ "corko",
+ "viko",
# ColorBrewer Single-hue
- "blues", "greens", "oranges", "reds", "purples", "greys",
+ "blues",
+ "greens",
+ "oranges",
+ "reds",
+ "purples",
+ "greys",
# ColorBrewer Multi-hue
- "ylorbr", "ylorrd", "ylgn", "ylgnbu", "gnbu", "bugn", "bupu", "pubu",
- "pubugn", "purd", "rdpu", "orrd",
+ "ylorbr",
+ "ylorrd",
+ "ylgn",
+ "ylgnbu",
+ "gnbu",
+ "bugn",
+ "bupu",
+ "pubu",
+ "pubugn",
+ "purd",
+ "rdpu",
+ "orrd",
# ColorBrewer Diverging
- "rdbu", "rdylbu", "rdylgn", "spectral", "brbg", "prgn", "piyg", "rdgy", "puor",
+ "rdbu",
+ "rdylbu",
+ "rdylgn",
+ "spectral",
+ "brbg",
+ "prgn",
+ "piyg",
+ "rdgy",
+ "puor",
# Matplotlib
- "viridis", "plasma", "magma", "inferno", "cividis"
+ "viridis",
+ "plasma",
+ "magma",
+ "inferno",
+ "cividis"
)
# Discrete palettes referenced in color_disc.qmd
@@ -39,8 +98,11 @@ DISCRETE_PALETTES <- c(
# D3
"category10",
# ColorBrewer qualitative
- "set1", "set2", "set3",
- "pastel1", "pastel2",
+ "set1",
+ "set2",
+ "set3",
+ "pastel1",
+ "pastel2",
"dark2",
"paired",
"accent",
@@ -52,18 +114,27 @@ DISCRETE_PALETTES <- c(
# Format: name = c(dash, gap, dash, gap, ...)
# Empty vector means solid line
NAMED_LINETYPES <- list(
- solid = c(),
- dashed = c(6, 4),
- dotted = c(1, 2),
- dotdash = c(1, 2, 6, 2),
+ solid = c(),
+ dashed = c(6, 4),
+ dotted = c(1, 2),
+ dotdash = c(1, 2, 6, 2),
longdash = c(10, 4),
- twodash = c(6, 2, 2, 2)
+ twodash = c(6, 2, 2, 2)
)
# Shape definitions
# Closed shapes (filled)
-SHAPES_CLOSED <- c("circle", "square", "diamond", "triangle-up", "triangle-down",
- "star", "square-cross", "circle-plus", "square-plus")
+SHAPES_CLOSED <- c(
+ "circle",
+ "square",
+ "diamond",
+ "triangle-up",
+ "triangle-down",
+ "star",
+ "square-cross",
+ "circle-plus",
+ "square-plus"
+)
# Open shapes (stroke only)
SHAPES_OPEN <- c("cross", "plus", "asterisk", "bowtie", "hline", "vline")
# All shapes
@@ -78,7 +149,6 @@ parse_palettes <- function(rust_file) {
palettes <- list()
-
# Pattern to match: pub const NAME: &[&str] = &[ ... ];
# We need to find each palette definition
pattern <- 'pub const ([A-Z_0-9]+): &\\[&str\\] = &\\[([^;]+)\\];'
@@ -89,14 +159,23 @@ parse_palettes <- function(rust_file) {
for (match in all_matches) {
# Extract name
- name_match <- regmatches(match, regexec('pub const ([A-Z_0-9]+):', match, perl = TRUE))[[1]]
- if (length(name_match) < 2) next
+ name_match <- regmatches(
+ match,
+ regexec('pub const ([A-Z_0-9]+):', match, perl = TRUE)
+ )[[1]]
+ if (length(name_match) < 2) {
+ next
+ }
name <- tolower(name_match[2])
# Extract colors
colors_section <- sub('.*&\\[', '', match)
colors_section <- sub('\\];.*', '', colors_section)
- color_matches <- gregexpr('"(#[0-9A-Fa-f]{6})"', colors_section, perl = TRUE)
+ color_matches <- gregexpr(
+ '"(#[0-9A-Fa-f]{6})"',
+ colors_section,
+ perl = TRUE
+ )
colors <- regmatches(colors_section, color_matches)[[1]]
colors <- gsub('"', '', colors)
@@ -124,15 +203,23 @@ generate_gradient_svg <- function(colors, width = 600, height = 60) {
}
# Build gradient stops
- stops <- vapply(seq_along(sampled), function(i) {
- offset <- (i - 1) / (length(sampled) - 1) * 100
- sprintf(' ', offset, sampled[i])
- }, character(1))
+ stops <- vapply(
+ seq_along(sampled),
+ function(i) {
+ offset <- (i - 1) / (length(sampled) - 1) * 100
+ sprintf(
+ ' ',
+ offset,
+ sampled[i]
+ )
+ },
+ character(1)
+ )
stops_str <- paste(stops, collapse = "\n")
svg <- sprintf(
-'