Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support video / GIF export #111

Open
jonmmease opened this issue Sep 19, 2023 · 1 comment
Open

Support video / GIF export #111

jonmmease opened this issue Sep 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jonmmease
Copy link
Collaborator

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

@jonmmease jonmmease added the enhancement New feature or request label Sep 19, 2023
@jonmmease
Copy link
Collaborator Author

Question for @jonathanzong or @joshpoll. For the Vega specs that will be produced by Vega-Lite with animation support in the future, will there be a top-level time signal that can be advanced programmatically like view.signal('time', 0.0), view.signal('time', 0.1), etc.? Will it be possible to look at a Vega spec and automatically determine the appropriate start, stop, and step time values?

I want to make sure than any approach we come up with for exporting Vega charts to videos works well with the future Vega-Lite architecture.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant