By mcanouil
Author, edit, and debug grammar-of-graphics plots in Typst documents using the Gribouille library
Create elegant graphics with the Grammar of Graphics for Typst.
Gribouille is French for "scribble".
The library implements Wilkinson's Grammar of Graphics in a declarative API for Typst documents, inspired by ggplot2 (R) and plotnine (Python).
Documentation: https://m.canouil.dev/gribouille.
[!WARNING] Gribouille is in active development.
#import "@preview/gribouille:0.5.0": *
#let species-colours = (
Adelie: rgb("#ff8c00"),
Chinstrap: rgb("#008B8B"),
Gentoo: rgb("#800080"),
)
#plot(
data: penguins,
mapping: aes(
x: "flipper-len",
y: "body-mass",
colour: "species",
fill: "species",
shape: "species",
),
layers: (
geom-point(size: 2pt, alpha: 0.25, stroke: 0.5pt, colour: rgb("#ffffff")),
geom-smooth(method: "lm", se: true, alpha: 0.2),
geom-mark(method: "hull", expand: 5pt, alpha: 0.25),
geom-errorbar(stat: stat-summary(fun: "mean-sd"), width: 5pt),
geom-errorbarh(stat: stat-summary(fun: "mean-sd"), height: 5pt),
geom-label(
stat: stat-summary(fun: "mean"),
mapping: aes(label: "species"),
colour: rgb("#ffffff"),
size: 8pt,
),
),
scales: scales(
x: scale-continuous(),
y: scale-continuous(labels: format-comma()),
colour: scale-discrete(
limits: species-colours.keys(),
palette: species-colours.values(),
),
fill: scale-discrete(
limits: species-colours.keys(),
palette: species-colours.values(),
),
),
labels: labels(
title: typst("Penguins *Dataset*"),
subtitle: typst({
[Flipper length vs body mass by species: ]
species-colours
.pairs()
.map(p => text(fill: p.at(1), weight: "bold")[#p.at(0)])
.join(", ")
}),
caption: "Data from Palmer Archipelago (Antarctica) penguin dataset.",
colour: "Species",
fill: "Species",
shape: "Species",
x: "Flipper Length (mm)",
y: "Body Mass (g)",
),
theme: theme-minimal(),
width: 12cm,
height: 9cm,
)
The documentation ships a machine-readable copy for large language models at https://m.canouil.dev/gribouille/llms.txt, and every page has a .llms.md companion.
An installable skill teaches coding agents to author Gribouille plots against that reference.
Install it with the agent-neutral skills CLI:
npx skills add mcanouil/gribouille
The repository also doubles as a plugin marketplace:
/plugin marketplace add mcanouil/gribouille
/plugin install gribouille@gribouille
See the AI Assistants guide for details.
See typst.toml and src/deps.typ for the authoritative Typst compiler and CeTZ versions.
[!NOTE] Gribouille is an unfunded spare-time project, and the API is still settling. Bug reports and ideas are very welcome on the issue tracker.
Pull requests are not being accepted for now: the internals shift between releases, every review costs time I have to take from the work that moves the library forward, and I am being especially careful in the current climate of unreviewed LLM-authored patches. Once the surface is stable I will revisit and open the door.
Thanks in advance for your patience and your understanding.
Contributions are welcome.
See CONTRIBUTING.md for bug reporting, development setup, and commit conventions.
Short identifiers used across the source tree (ctx, spec, mapping, cx, cy, lo, hi, …) are catalogued in GLOSSARY.md.
If you use Gribouille in your work, please cite it.
Citation metadata is provided in CITATION.cff.
GitHub renders it via the "Cite this repository" widget on the repository sidebar.
This project is licensed under the MIT License. See the LICENSE file for details.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub mcanouil/gribouille --plugin gribouilleGenerate publication-quality academic diagrams, statistical plots, and presentation slides using PaperBanana multi-agent framework
Edward Tufte's Visual Display of Quantitative Information — three executable skills (route, assess, render) backed by a VDQI-sourced principles reference. Scores graphics against Tufte's nine criteria with named chartjunk species and a 13-entry catalogue of dissected failures, and renders per-genre charts (time-series, small multiples, quartile plot, range-frame scatter) plus a tufte-css HTML wrapper.
Publication-quality matplotlib/seaborn charts with opinionated aesthetics
AntV visualization skills for transforming data into clear, interactive charts and graphs for data-driven insights.
An Infographic Generation and Rendering Framework, bring words to life!
Create data visualizations and plots