@ggsvelte/compose
v0.41.0
Published
Framework-free plot composition: assemble PortableSpec from props and grammar layers.
Maintainers
Readme
@ggsvelte/compose
Framework-free PortableSpec assembly: fold grammar layers, merge plot props,
and produce the same spec the gg() builder emits. No DOM. Pre-1.0.
bun add @ggsvelte/compose # or: npm install @ggsvelte/composeHosts (@ggsvelte/svelte, @ggsvelte/react) import this package so
children and props assemble through one implementation.
Quick example
import { assemblePortableSpec } from "@ggsvelte/compose";
const spec = assemblePortableSpec({
data: [
{ year: "1835", value: 12 },
{ year: "2026", value: 31 },
],
aes: { x: "year", y: "value" },
layers: [{ geom: "line" }],
});Use @ggsvelte/spec to
validate or lint the result, then render with
@ggsvelte/core.
