diff options
| author | hrbrmstr <bob@rud.is> | 2026-05-17 08:18:36 -0400 |
|---|---|---|
| committer | hrbrmstr <bob@rud.is> | 2026-05-17 08:18:36 -0400 |
| commit | f2de050587efc8a182a7423282f6dae7b3bf3d19 (patch) | |
| tree | 029b80bf517a4e8f33f5b3aeefc6f47350060520 /2026/2026-05-17-gribouille/README.md | |
| parent | 8b196fab92d098824a147a8c7f3bba45b970fb07 (diff) | |
add: gribouille
Diffstat (limited to '2026/2026-05-17-gribouille/README.md')
| -rw-r--r-- | 2026/2026-05-17-gribouille/README.md | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/2026/2026-05-17-gribouille/README.md b/2026/2026-05-17-gribouille/README.md new file mode 100644 index 0000000..7d2c829 --- /dev/null +++ b/2026/2026-05-17-gribouille/README.md @@ -0,0 +1,69 @@ +# gribouille-skill + +A Claude Code / OpenCode skill for generating [gribouille](https://m.canouil.dev/gribouille) charts in [Typst](https://typst.app), plus a working example. + +## What's here + +| File | Purpose | +|------|---------| +| `drop.typ` | Standalone example — a scatter plot of sensor fleet activity (log-log scales, annotations, size encoding) | +| `gribouille-skill/SKILL.md` | The agent skill definition with idiomatic gribouille patterns, anti-patterns, and a quick-reference | +| `gribouille-skill/references/geom-table.md` | Full parameter reference for geoms | +| `gribouille-skill/references/scale-table.md` | Full parameter reference for scales | + +## Using the skill + +The skill implements Wilkinson's Grammar of Graphics (same mental model as ggplot2 / plotnine) compiled natively in Typst. + +### Quick start + +1. Install gribouille from Typst Universe or clone it locally. +2. Clone `https://github.com/mcanouil/gribouille` into the directory where your doc is (until it's in the Universe) +3. Import the library: + ```typst + #import "./gribouille/lib.typ":* + ``` +4. Build a plot: + ```typst + #plot( + data: penguins, + mapping: aes(x: "flipper-len", y: "body-mass", colour: "species"), + layers: (geom-point(size: 2pt),), + theme: theme-minimal(), + width: 12cm, height: 9cm, + ) + ``` + +### Supported chart types + +Scatter, line, area, bar, histogram, boxplot, heatmap, faceted small-multiples, multi-panel compositions, and more. See `gribouille-skill/SKILL.md` for the full chart-type decision table. + +### Key conventions + +- Column names in `aes()` must be **quoted strings**: `aes(x: "flipper-len")`. +- Always include `width:` and `height:` — gribouille has no default size. +- Use `as-factor("col")` for numeric-looking categorical strings. +- Use `typst("markup")` inside `labs()` when you need rich text. + +## Example: `drop.typ` + +`drop.typ` reads `src_ip_last1h.csv` and renders a log-log scatter of source-IP activity: + +- **x**: total sessions (`scale-x-log10`) +- **y**: unique destination ports (`scale-y-log10`) +- **size**: number of unique sensors (`scale-size-area`) +- **annotation**: callout label for the dominant IP + +Compile with: +```bash +typst compile drop.typ +``` + +## Resources + +- [gribouille docs](https://m.canouil.dev/gribouille) +- [Typst docs](https://typst.app/docs) + +## License + +MIT |
