As inspired by a question from @mattijn. Could VlConvert export videos or GIFs of charts?
Here's an idea:
Input:
- Vega(-Lite) spec
- signal/param name
- start value, stop value, step
VlConvert would render the spec, then sweep through the signal values, exporting each frame to an SVG, then use resvg to convert each frame to a PNG, then convert these PNG frames to GIF / MP4.
The Rust image crate supports a GIF encoder (https://docs.rs/image/latest/image/codecs/gif/struct.GifEncoder.html). And it looks like there is an mp4 crate as well: https://github.com/alfg/mp4-rust
As inspired by a question from @mattijn. Could VlConvert export videos or GIFs of charts?
Here's an idea:
Input:
VlConvert would render the spec, then sweep through the signal values, exporting each frame to an SVG, then use resvg to convert each frame to a PNG, then convert these PNG frames to GIF / MP4.
The Rust
imagecrate supports a GIF encoder (https://docs.rs/image/latest/image/codecs/gif/struct.GifEncoder.html). And it looks like there is an mp4 crate as well: https://github.com/alfg/mp4-rust