News for hackers. Stuff that matters.
Re:Observable Plot: The JavaScript library for exploratory d... by xrd on Friday April 28, 2023 @03:55AM (#35738678)
This looks fantastic and is as close as an imperative API gets to being declarative.

I dug into the documentation a little bit and didn't see much regarding animation. It looks like the word transitions is used as a data transform in the plot API and not as a CSS transition? I'm unsure if there is another keyword to use when searching. I didn't find much about doing any kind of animations with this library, other than that you need to start customizating using D3 API inside the plot calls.

I'm interested in simple animations like "when this chart displays for the first time, start with data at zero, then animate to the final state." Is that possible with plot? I'm not looking for animation across different sets or shapes of data.

Re:Observable Plot: The JavaScript library for exploratory d... by tophtucker on Friday April 28, 2023 @01:52PM (#35744732)
There’s no animation built-in currently. But it’s fast enough that you can often just throw away and re-render the Plot (i.e. handle the animation externally).

Mike Freeman made a helper function that adds that sort of animation (data gradually coming in) using D3 atop Plot: https://observablehq.com/@mkfreeman/plot-animation

You could upvote this incremental rendering issue: https://github.com/observablehq/plot/issues/328

Or this one for adding a “time channel” to do data-driven animation (for which there’s an old draft PR): https://github.com/observablehq/plot/issues/166