From 20ac5279a84f0f79ad9c14e867bfab5966c9df6d Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sun, 16 Aug 2026 15:03:48 -0700 Subject: [PATCH 1/3] fix(vignettes): set explicit user-agent for FRED download in tips.qmd FRED's edge now rejects R's default HTTP user-agent, resetting the HTTP/2 stream with INTERNAL_ERROR. libcurl surfaces this as an opaque "Stream error in the HTTP/2 framing layer" warning, so read.csv() on the fredgraph.csv URL fails while the same URL loads in a browser. Not an R or libcurl issue: R and the curl CLI share the same libcurl (8.21.0) and nghttp2 (1.69.0), and the CLI reproduces the failure when given R's user-agent. Other HTTP/2 hosts (CRAN, GitHub) are unaffected. Pass headers= to url() so the override is scoped to this one call and does not touch the session's HTTPUserAgent option, which some repos (e.g. P3M) rely on to serve the correct precompiled binaries. --- vignettes/tips.qmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/tips.qmd b/vignettes/tips.qmd index c7e1fdd2..9ba990d4 100644 --- a/vignettes/tips.qmd +++ b/vignettes/tips.qmd @@ -68,8 +68,8 @@ consecutive quarters of negative growth. ```{r} # get 1980+ US GDP data from FRED -url = "https://fred.stlouisfed.org/graph/fredgraph.csv?id=GDPC1&cosd=1980-01-01" -gdp = read.csv(url) |> +fred_url = "https://fred.stlouisfed.org/graph/fredgraph.csv?id=GDPC1&cosd=1980-01-01" +gdp = read.csv(url(fred_url, headers = c("User-Agent" = "curl"))) |> setNames(c("date", "gdp")) |> transform(date = as.Date(date)) From b65f64efbd1f17557e8756eb027ccae7e155864b Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sun, 16 Aug 2026 15:28:06 -0700 Subject: [PATCH 2/3] heatmap and hexbin gallery example --- altdoc/pkgdown.yml | 4 ++-- vignettes/gallery.qmd | 21 ++++++++++++++++++--- vignettes/gallery_figs/heatmap-mtcars.R | 12 ++++++++++++ vignettes/gallery_figs/hexbin.R | 10 ++++++++++ vignettes/gallery_figs/ridge-aq.R | 5 +++-- 5 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 vignettes/gallery_figs/heatmap-mtcars.R create mode 100644 vignettes/gallery_figs/hexbin.R diff --git a/altdoc/pkgdown.yml b/altdoc/pkgdown.yml index 8d478515..cb1e81c0 100644 --- a/altdoc/pkgdown.yml +++ b/altdoc/pkgdown.yml @@ -1,8 +1,8 @@ altdoc: 0.7.3 -pandoc: 3.10.1 +pandoc: '0' pkgdown: 2.1.3 pkgdown_sha: ~ -last_built: 2026-08-15T02:19:49+0000 +last_built: 2026-08-16T22:17:10+0000 urls: reference: https://grantmcdermott.com/tinyplot/man article: https://grantmcdermott.com/tinyplot/vignettes diff --git a/vignettes/gallery.qmd b/vignettes/gallery.qmd index f1113852..c3058f4d 100644 --- a/vignettes/gallery.qmd +++ b/vignettes/gallery.qmd @@ -7,11 +7,12 @@ execute: ```{css} .gslide-desc { - text-align: center; + text-align: center; font-size: 1.1rem !important; } -div.gslide-description, .gslide-desc { - background-color: #e0e0e0 !important; +div.gslide-description, +.gslide-desc { + background-color: #e0e0e0 !important; } ``` @@ -104,6 +105,20 @@ Click on a plot to get the link to its code. #| file: "gallery_figs/ridge-aq.R" ``` +```{r} +#| lightbox: +#| group: r-graph +#| description: "[Code](https://github.com/grantmcdermott/tinyplot/blob/main/vignettes/gallery_figs/heatmap-mtcars.R){target='_blank'}" +#| file: "gallery_figs/heatmap-mtcars.R" +``` + +```{r} +#| lightbox: +#| group: r-graph +#| description: "[Code](https://github.com/grantmcdermott/tinyplot/blob/main/vignettes/gallery_figs/hexbin.R){target='_blank'}" +#| file: "gallery_figs/hexbin.R" +``` + ```{r} #| lightbox: #| group: r-graph diff --git a/vignettes/gallery_figs/heatmap-mtcars.R b/vignettes/gallery_figs/heatmap-mtcars.R new file mode 100644 index 00000000..8e4ef684 --- /dev/null +++ b/vignettes/gallery_figs/heatmap-mtcars.R @@ -0,0 +1,12 @@ +library(tinyplot) + +m = as.matrix(mtcars) + +plt( + m, + type = type_heatmap(scale = "x"), + main = "mtcars heatmap", + cap = "Note: Values are normalised within each x-axis category", + col = "white", + theme = list("heatmap", cex.yaxs = 0.5, cex.xaxs = 1.5) +) diff --git a/vignettes/gallery_figs/hexbin.R b/vignettes/gallery_figs/hexbin.R new file mode 100644 index 00000000..0c32cf08 --- /dev/null +++ b/vignettes/gallery_figs/hexbin.R @@ -0,0 +1,10 @@ +library(tinyplot) + +set.seed(1234) +dat = data.frame(x = rnorm(2e4), y = rnorm(2e4)) + +plt( + y ~ x, data = dat, type = "hexbin", + palette = hcl.colors(100, palette = "agSunset", rev = TRUE), + theme = "clean2" +) diff --git a/vignettes/gallery_figs/ridge-aq.R b/vignettes/gallery_figs/ridge-aq.R index 83f411ce..352ad34e 100644 --- a/vignettes/gallery_figs/ridge-aq.R +++ b/vignettes/gallery_figs/ridge-aq.R @@ -7,8 +7,9 @@ aq = transform( Late = ifelse(Day > 15, "Late", "Early") ) -tinyplot(Month ~ Temp | Temp, +tinyplot( + Month ~ Temp, data = aq, - type = type_ridge(col = "white"), + type = type_ridge(col = "white", gradient = TRUE), theme = "ridge2" ) From 83bbb93e228ebbbeb2e1e2fd74f6b0ec348e1fa5 Mon Sep 17 00:00:00 2001 From: Grant McDermott Date: Sun, 16 Aug 2026 15:37:15 -0700 Subject: [PATCH 3/3] move gallery to top nav menu --- altdoc/pkgdown.yml | 2 +- altdoc/quarto_website.yml | 190 +++++++++++++++++++------------------- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/altdoc/pkgdown.yml b/altdoc/pkgdown.yml index cb1e81c0..2e57b93e 100644 --- a/altdoc/pkgdown.yml +++ b/altdoc/pkgdown.yml @@ -2,7 +2,7 @@ altdoc: 0.7.3 pandoc: '0' pkgdown: 2.1.3 pkgdown_sha: ~ -last_built: 2026-08-16T22:17:10+0000 +last_built: 2026-08-16T22:34:16+0000 urls: reference: https://grantmcdermott.com/tinyplot/man article: https://grantmcdermott.com/tinyplot/vignettes diff --git a/altdoc/quarto_website.yml b/altdoc/quarto_website.yml index ef9a346d..cc640d11 100644 --- a/altdoc/quarto_website.yml +++ b/altdoc/quarto_website.yml @@ -17,24 +17,24 @@ website: file: vignettes/introduction.qmd - text: Articles menu: - - text: Types - file: vignettes/types.qmd - - text: Themes - file: vignettes/themes.qmd - - text: Gallery - file: vignettes/gallery.qmd - - text: Tips & tricks - file: vignettes/tips.qmd - - text: useR! 2025 - file: vignettes/useR2025/useR2025.qmd + - text: Types + file: vignettes/types.qmd + - text: Themes + file: vignettes/themes.qmd + - text: Tips & tricks + file: vignettes/tips.qmd + - text: useR! 2025 + file: vignettes/useR2025/useR2025.qmd + - text: Gallery + file: vignettes/gallery.qmd - text: About menu: - - text: News - file: $ALTDOC_NEWS - - text: Citation - file: $ALTDOC_CITATION - - text: License - file: $ALTDOC_LICENSE + - text: News + file: $ALTDOC_NEWS + - text: Citation + file: $ALTDOC_CITATION + - text: License + file: $ALTDOC_LICENSE - text: Reference file: man/tinyplot.qmd right: @@ -64,84 +64,84 @@ website: file: man/tinyplot_add.qmd - section: "Types" contents: - - section: Shapes - contents: - - text: type_area - file: man/type_ribbon.qmd - - text: type_errorbar - file: man/type_errorbar.qmd - - text: type_jitter - file: man/type_jitter.qmd - - text: type_lines - file: man/type_lines.qmd - - text: type_pointrange - file: man/type_errorbar.qmd - - text: type_points - file: man/type_points.qmd - - text: type_polygon - file: man/type_polygon.qmd - - text: type_polypath - file: man/type_polypath.qmd - - text: type_rect - file: man/type_rect.qmd - - text: type_ribbon - file: man/type_ribbon.qmd - - text: type_rug - file: man/type_rug.qmd - - text: type_segments - file: man/type_segments.qmd - - text: type_text - file: man/type_text.qmd - - text: type_tile - file: man/type_tile.qmd - - section: "Visualizations" - contents: - - text: type_barplot - file: man/type_barplot.qmd - - text: type_boxplot - file: man/type_boxplot.qmd - - text: type_chull - file: man/type_chull.qmd - - text: type_density - file: man/type_density.qmd - - text: type_ellipse - file: man/type_ellipse.qmd - - text: type_heatmap - file: man/type_tile.qmd - - text: type_hexbin - file: man/type_hexbin.qmd - - text: type_histogram - file: man/type_histogram.qmd - - text: type_qq - file: man/type_qq.qmd - - text: type_ridge - file: man/type_ridge.qmd - - text: type_spineplot - file: man/type_spineplot.qmd - - text: type_violin - file: man/type_violin.qmd - - section: "Models" - contents: - - text: type_glm - file: man/type_glm.qmd - - text: type_lm - file: man/type_lm.qmd - - text: type_loess - file: man/type_loess.qmd - - text: type_spline - file: man/type_spline.qmd - - section: "Functions" - contents: - - text: type_abline - file: man/type_abline.qmd - - text: type_function - file: man/type_function.qmd - - text: type_hline - file: man/type_abline.qmd - - text: type_summary - file: man/type_summary.qmd - - text: type_vline - file: man/type_abline.qmd + - section: Shapes + contents: + - text: type_area + file: man/type_ribbon.qmd + - text: type_errorbar + file: man/type_errorbar.qmd + - text: type_jitter + file: man/type_jitter.qmd + - text: type_lines + file: man/type_lines.qmd + - text: type_pointrange + file: man/type_errorbar.qmd + - text: type_points + file: man/type_points.qmd + - text: type_polygon + file: man/type_polygon.qmd + - text: type_polypath + file: man/type_polypath.qmd + - text: type_rect + file: man/type_rect.qmd + - text: type_ribbon + file: man/type_ribbon.qmd + - text: type_rug + file: man/type_rug.qmd + - text: type_segments + file: man/type_segments.qmd + - text: type_text + file: man/type_text.qmd + - text: type_tile + file: man/type_tile.qmd + - section: "Visualizations" + contents: + - text: type_barplot + file: man/type_barplot.qmd + - text: type_boxplot + file: man/type_boxplot.qmd + - text: type_chull + file: man/type_chull.qmd + - text: type_density + file: man/type_density.qmd + - text: type_ellipse + file: man/type_ellipse.qmd + - text: type_heatmap + file: man/type_tile.qmd + - text: type_hexbin + file: man/type_hexbin.qmd + - text: type_histogram + file: man/type_histogram.qmd + - text: type_qq + file: man/type_qq.qmd + - text: type_ridge + file: man/type_ridge.qmd + - text: type_spineplot + file: man/type_spineplot.qmd + - text: type_violin + file: man/type_violin.qmd + - section: "Models" + contents: + - text: type_glm + file: man/type_glm.qmd + - text: type_lm + file: man/type_lm.qmd + - text: type_loess + file: man/type_loess.qmd + - text: type_spline + file: man/type_spline.qmd + - section: "Functions" + contents: + - text: type_abline + file: man/type_abline.qmd + - text: type_function + file: man/type_function.qmd + - text: type_hline + file: man/type_abline.qmd + - text: type_summary + file: man/type_summary.qmd + - text: type_vline + file: man/type_abline.qmd - section: "Themes" contents: - text: tinytheme @@ -177,6 +177,6 @@ format: theme: - cosmo - custom.scss - fontsize: '110%' + fontsize: "110%" fontcolor: "#000022" linkcolor: "#f51459"