ggsvelte is a fast, agent-native implementation of the layered grammar of graphics

Bar chart of cold-mount time for a 3-series by 1,000-point area chart: ggsvelte 8 ms, ECharts 15.2 ms, LayerCake 10.9 ms, TanStack 18.1 ms, Unovis 84.1 ms, SveltePlot 272.1 ms. Lower is better. Bar chart of cold-mount time for a 3-series by 1,000-point area chart: ggsvelte 8 ms, ECharts 15.2 ms, LayerCake 10.9 ms, TanStack 18.1 ms, Unovis 84.1 ms, SveltePlot 272.1 ms. Lower is better.

Why ggsvelte?

CapabilityggsvelteTanStackSveltePlotUnovisLayerCake
Bundle size Min+gzip, 1k scatter apppartial 103 KByes 57 KBpartial 109 KByes 80 KByes 41 KB
API stability Pre-1.0: minors can still breakpartial v0.41.0partial v0.14.0partial v0.14.2yes v1.6.7yes v10.0.3
Headless server-side SVG data → SVG string, no DOMyes yes no no partial opt-in
Portable JSON spec + schema yes no no no no
CLI validator + renderer yes no no no no
Agent skill yes yes no no no
Automatic temporal detection yes no partial Someno no
Built-in interactions Tooltip, select, zoom, linkyes yes partial Somepartial Someno bring your own
ggplot2 API yes no no no no
Scale, axis & coord control yes yes yes yes partial d3
Plot of Body mass g by Flipper length mm170170180180190190200200210210220220230230250025003000300035003500400040004500450050005000550055006000600065006500Flipper length mmBody mass gspeciesAdelieGentooChinstrap
Plot of Body mass g by Flipper length mm170170180180190190200200210210220220230230250025003000300035003500400040004500450050005000550055006000600065006500Flipper length mmBody mass gspeciesAdelieGentooChinstrap

Svelte for builders, JSON for embedded agents.

Human-agent pairs get Svelte components for clarity. Embedded agents can use JSON specs for interactive charts on demand.

<script lang="ts">
  import { GeomJitter, GeomSmooth, GGPlot, GuideLegend, Inspect, Labs } from "@ggsvelte/svelte";
  import { palmerPenguins } from "@ggsvelte/svelte/data";
</script>

<GGPlot
  data={palmerPenguins}
  aes={{ x: "flipperLengthMm", y: "bodyMassG", color: "species" }}
  width={640}
  height={400}
>
  <GeomJitter alpha={0.88} />
  <GeomSmooth method="loess" span={0.75} degree={1} se={false} />
  <GuideLegend channel="color" focus />
  <Labs x="Flipper length mm" y="Body mass g" color="species" />
  <Inspect mode="xy" pin maxDistance={24} />
</GGPlot>

Docs