Closed jhofman closed 3 years ago
If this is successful in "vanilla" Vega, then let's see if we can generate the same from R using one of these:
Hi @jhofman ,
I managed to draw the two frames using vega-lite.
And also updating between these two frames. Here is the video:
https://user-images.githubusercontent.com/6615532/114000075-b3c6b980-986b-11eb-8542-3db75eaaa1e4.mov
My thoughts about vega,
Reading around a bit about animation with Vega (seems like a popular request!) (side note - someone linked SandDance which I didn't know about, so now I "get" the datamation_sanddance()
name 😄)
One thing that was linked is gemini, which is a grammar for animating between vega/vega-lite charts. Seems like it may still be in the prototype stage, but has a paper to accompany it.
On the R side, vegawidget looks like the best option to explore - I'll dig into it today.
@sharlagelfand, excellent sleuthing, and sorry to have not explained the sanddance connection before! sounds good on exploring vegawidget. would also be curious to know if ggvis outputs vega(lite) specs.
turns out we got the same lead on gemini from talk to a friend yesterday afternoon. and the same authors have a nice paper on creating animations to show different types of animations (mean, max, sd, etc.). (see #18.)
so the plan is that @giorgi-ghviniashvili is going to:
Some initial exploration of vegawidget: https://github.com/jhofman/datamations/blob/vegawidget-exploration/sandbox/vegawidget/vegawidget_exploration.R, looking at how to create a spec in R (+ how to visualize it in R or export it to JSON) and where the spec could come in based on existing coordinates data that is calculated by datamations already
Hi @jhofman.
I managed to animate with gemini.
https://user-images.githubusercontent.com/6615532/114171559-7df60380-9945-11eb-9f59-7e1bf1df07a5.mov
It looks like Vega (or Vega-lite) might be a good "exchange format" for passing plot specifications between a base language (like R) and a rendering language (like d3).
For now, let's try to just make plots of two key frames from the salary datamation using it and see if we can link them with a transition. Specifically:
Frame 1: Scatter plot of x = degree, y = salary, color = degree Frame 2: Plot of average salary by degree, x = degree, y = mean_salary, color = degree