glyph-package: glyph: A Grammar of Interactive Graphics

glyph-packageR Documentation

glyph: A Grammar of Interactive Graphics

Description

Builds interactive graphics from a declarative specification. Marks, scales, tooltips, hover and click events, zoom, brushing, linked selections, animated transitions and multi-plot layouts are declared in one pipeline and stored as a plain R list that can be inspected, saved as 'JSON' or converted to 'Vega-Lite'. Themes are set from a small set of design tokens. Plots are drawn in the browser as 'htmlwidgets' using 'D3.js'.

Acknowledgements

glyph's design draws directly on the ideas and prior art of others:

  • Leland Wilkinson's The Grammar of Graphics — the layered data/mark/scale vocabulary that glyph's spec is structured around.

  • ggplot2 — the aesthetic-mapping model (aes(), here bare names instead) and the pipeline style of building a plot up in layers.

  • Vega-Lite — the idea of a declarative, serializable JSON spec that compiles to a render tree, and treating interactions as selections.

  • ggvis — an earlier reactive, D3-backed grammar of graphics for R; glyph's D3-via-htmlwidgets rendering follows the same path.

  • ggiraph — ggplot2 output with D3-powered tooltips, hover, and selection; a direct influence on glyph's own tooltip/hover/brush model.

  • plotly — the baseline for what an "interactive R plot" should offer (zoom, pan, tooltips), which glyph aims to provide natively.

  • patchwork — the model for glyph's compose() multi-plot layout API.

  • gganimate — the transition_states()-style keyframe grammar behind animate(by = ..., transition = "morph").

  • ggExtra — the marginal histogram/density/boxplot pattern behind marginals().

  • ggrepel — the inspiration for mark_text(smart_repel = TRUE)'s label decluttering (glyph uses a simpler iterative pairwise-nudge approach rather than ggrepel's force simulation — see mark_text()).

This package also bundles D3.js (Copyright Mike Bostock, ISC License); see inst/COPYRIGHTS for the full notice.

Author(s)

Maintainer: Joash Joshua Ayo joashjoshua789@gmail.com

Authors:

Other contributors:

  • Mike Bostock (Author of the bundled D3.js library) [contributor, copyright holder]

See Also

Useful links:


glyph documentation built on Oct. 21, 2026, 5:12 p.m.