gglite: Lightweight Data Visualization via the Grammar of Graphics

2026-06-07

Title Lightweight Data Visualization via the Grammar of Graphics
Version 0.0.32
Description A lightweight R interface to the AntV G2 JavaScript visualization library with a ggplot2-style API. Supports rendering in litedown, R Markdown, Quarto, Jupyter notebooks (via the R kernel), Shiny, and standalone HTML previews.
Depends R (>= 4.1.0)
Imports xfun (>= 0.57)
Suggests htmltools, litedown, knitr, repr, shiny, testit
License MIT + file LICENSE
URL https://github.com/yihui/gglite
BugReports https://github.com/yihui/gglite/issues
VignetteBuilder litedown
Author Yihui Xie ORCID iD [aut, cre]

R-CMD-check gglite on r-universe

Experimental — this package is still under active development. The API may change and it has been hurting my brain badly. Feedback welcome!

An R package for interactive data visualization using the AntV G2 JavaScript library, with a Grammar of Graphics-style API inspired by ggplot2. The goal is to have Grammar of Graphics and interactivity and keep everything lightweight ({gglite} has only one R package dependency).

1 Install

Not on CRAN yet, but r-universe.dev is an awesome service in many ways:

install.packages('gglite', repos = 'https://yihui.r-universe.dev')

You can also try the package without installing in the package playground: https://pkg.yihui.org/gglite/playground/ (it also works on your mobile devices, thanks to webR). See the package site (https://pkg.yihui.org/gglite/) for examples and documentation.

R Markdown, litedown, Quarto, Jupyter, Shiny, and standalone HTML previews (in the browser) are all supported.

Appendix

To cite the package gglite in publications, please use:

Xie Y (2026). gglite: Lightweight Data Visualization via the Grammar of Graphics. R package version 0.0.32, https://github.com/yihui/gglite.

@Manual{,
  title = {gglite: Lightweight Data Visualization via the Grammar of Graphics},
  author = {Yihui Xie},
  year = {2026},
  note = {R package version 0.0.32},
  url = {https://github.com/yihui/gglite},
}