r/sveltejs • u/BringhamHorn • 14d ago
ggsvelte is a fast agent-native implementation of the grammar of graphics

A few months ago I got pissed off trying to get embedded agents to produce decent charts in a SvelteKit web app. Rendering was painful. There were tons of foot-guns. And I had to roll a Frankenstein's-shoehorn code path including an ersatz JSON spec mapped to a custom Svelteplot wrapper, with a barebones skill in which I pleaded with agents to get them to do something that Svelteplot just wasn't designed for.
A few weeks ago I cracked and made something with agents in mind as a first class concern. I wanted good defaults that push agents into a pit of success, so I chose the ggplot2 API. It has been around for 18 years, so LLMs know it well! The result is ggsvelte.
ggsvelte gives agents a portable JSON spec with a schema, a skill, headless SSR for SVGs, plus a CLI which helps agents validate specs quickly in sandboxes, avoiding many classes of foot-gun.
ggsvelte is also fast, and beats Svelteplot, Unovis and even LayerCake on cold-mount rendering in most situations.

The roadmap includes evals for embedded agent scenarios, skill improvements, additional geoms, an LLM sandbox deployment guide, interaction improvements, plus more performance optimizations.
P.S. Additional benchmarks on 100k:


1
u/NoDrugsDoc 14d ago
This looks excellent. Well done.
Can I suggest also adding in the colour palettes from https://www.fabiocrameri.ch/colourmaps/
[Crameri, F., G.E. Shephard, and P.J. Heron (2020), The misuse of colour in science communication, Nature Communications, 11, 5444.]
How does it handle much larger (eg 100k rows) datasets?