Post

Last week I had the pleasure of finally releasing the #SveltePlot alpha version during my talk at the #SvelteSummit in Barcelona. It's a new visualization framework for @svelte.dev that I've been working on for the past 18 months, so it's about time for a 🧵

35 reposts165 likes

it's interesting we are arriving to similar conclusions for svelte charts i've been building a prototype kind of thing here, but would be much more opinionated and less based on plot and just relying on d3 itself hope your project really takes off! excited to try it!! bsky.app/profile/jesi...

jesi@jesirgb.com

introducing Uncharted: a new natively reactive, composable and typesafe chart library + tooling for #svelte 5.

I think I'd like to have all features from Obs Plot in SveltePlot and keep their APIs closely aligned. There are already some minor differences and SveltePlot introduced some features not yet available in Obs Plot (e.g. brushing). But I would like the grammar to be almost interchangeable, ideally

Like the fantastic Observable Plot -- which served as huge inspiration! -- SveltePlot was born out of the need for a plotting framework that is both flexible and concise. It comes with smart, data-driven defaults that make it easy to start coding graphics from scratch, without chart templates.

But unlike Observable Plot, SveltePlot is written as pure Svelte components and is fully reactive. When your data or plot state changes, the DOM gets updated instead of replaced, allowing for tweens and transitions in between states. Needless to say that it's powered under the hood by D3.js!

There are other great Svelte-based visualization frameworks around, each comes with its own advantages and use cases, such as LayerCake or LayerChart. SveltePlot doesn't want to be "better" but I think it's different in some regards.

Unlike LayerCake, SveltePlot comes with "all batteries included", featuring a rich set of data transforms and marks to shape and display your data. Helper components make it easier to add interactivity to your plot, such as tooltips or brushing.

You can also use Tween from svelte/animate to transition the data and domain. But I’m still waiting for a replacement for the in: out: syntax using @attach to support passing svelte transitions through the mark components.