-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add custom aggregation animations #18
Comments
@jhofman Have read the papers. Just forked this repo and created a demo of These examples of transitions are great. With this kind of transitions, it really makes more sense than just linear interpolation from point A to B. I don't think that |
Take a look at this one as well: demo |
@giorgi-ghviniashvili: these are great. you commented that gemini won't support these. do you think we can do them with d3 on top of vegalite plots, or do the plots themselves have to be entirely done in d3? @dggoldst, take a look at these two demos for different ways to visualize different types of aggregation functions used to summarize data: https://giorgi-ghviniashvili.github.io/aggregate-animation-data/designs/apps |
These demos are done with d3 because it is more flexible (low level access of transitions, scales, drawing part) than vega. But after a bit playing with vega, I think we can do the same with vega, but we will need multiple vega specs: a single one for each simple step. For example, for arithmetic mean, we have multiple steps and each step introduces new elements or instructions: an area or lines, circle transforms. All these will need new vega specs. With gemini To sum up, I am not sure how smooth the animation will be with gemini and vega and how easy it will be to generate all the specs, but think that it is possible. |
After playing with Sharla's specs and drawing grid, I think it is easy to customize each frame as we want: hide axes, change domain, scale, axis types.. |
Got it. So seems like going with gemini and vega wouldn't make it impossible to implement these transitions down the line if we wanted to later, but it might be a lot of work. Do you think it's worth trying this approach for just one aggregation operation like count or median to see how it goes? |
Yes it is not impossible, but lots of work. Agree.
Yes, I think it worths trying. |
Snoozing this, but when we do get to it, we'll try Gemini2 as per #69. |
@sharlagelfand will explore doing a custom animation for mean, which requires parsing the summarize function a bit more closely, then @giorgi-ghviniashvili can prototype it. |
I've updated the summary function parsing so that if the summary function is mean or median, the first spec produced by fyi @chisingh this is something that should be added on the python side as well, to ensure consistency between the specs |
@giorgi-ghviniashvili will implement custom versions of the first mean and median animations listed here: https://giorgi-ghviniashvili.github.io/aggregate-animation-data/designs/ |
@jhofman median animation is there 🔥 median-animation.movP.S. there is a difference between count and median: median needs to have some initial |
@jhofman mean animation is there 🔥 mean-animation.mov |
the mean animation looks great! two small tweaks:
median is also really cool. tweaks:
|
after that, min and max would be the next obvious custom animations to implement. |
I added count, min, max, median, and mean example specs. I believe these count specs are what youa re expecting, i.e. data.values gives a key value pair of n and a count, but let me know if I am off base. Quantile is a bit tricky and will need some updates to prep_specs_summarize.R. datamations_sanddance() actually breaks with quantile passed as a summary function. It breaks on this call. While I have code in place to pass the custom animation meta specs, I need to make amends to the mappings passed to this function for the data to even generate for quantile. I'll work on this tomorrow so we can get this running for quantile. |
@willdebras Title should not be an array: [], either string or should not be present at all. Please do not include color as encoding if field is null: For min, max and median, I think we don't need last spec because custom-animation already does that , plots min, max and median zoomed in as last step. Other than that, they look good. Please let me know when these are fixed and I will re-test. |
Sounds good. Updates here.
For the min, max, and median I still have the data states for the summary function in the end (i.e. the final spec). Should I just remove these entirely then? It will take some additional handling to not generate the summarize specs (i.e. the final summary function specs) for only specific summary functions. I can bake this in this week as well as the quantile updates. |
@jhofman custom animations with facets are now possible. Did an example for facet-mean.movBut there is a issue when next spec is with error bars.. Will further debug and find out how to solve it. @willdebras yes, please just remove summarized specs for now and let's test. (comment it out, we may need it later) |
Looks like between 14 seconds and 19 seconds in there's a shift of all points to the left. Next steps will be to get the error bars and zoom steps working. |
@giorgi-ghviniashvili made some good progress on this, the shifting to the left is fixed but there are still some details to work out in the final frames of the custom animation. also, there's an interesting thing that happens when we have overlapping values on the quantile (or median) custom animations---it becomes difficult to see the overlap and then it sort of visually looks like you're cutting the data at a different point than is specified in the quantile function. (it's actually doing the right thing, it just looks funky.) i wonder if doing something more like mean where things are diagonal so that all points can be seen would be useful? then we could move the sliding bar up from the bottom to the appropriate percentile? let's work on this the week after next. |
Updates on faceted custom animations: mean: mean_facets.movMax: facet_max.movMin: facet_min.movMedian and quantile: for some reason, Count: @willdebras please provide faceted view for count. And also in general, please add facets + custom_animation specs to |
@willdebras can you push R generated |
Update: made faceted custom animations work with median and quantile. (I needed to make some tricks!) median-facets.movIn summary, I think we are good with custom animations, let's invest some time to test all custom animations using R generated specs and then merge it 🤞🤞 |
Awesome!! R generated specs here for custom animations if you still need them: Sounds good on testing then merge! |
this looks terrific. now that we have colors to denote groups, it's a bit jarring to see the green and yellow come in on the median step in this video. let's simplify things and just keep the group colors and forget the gray/green/yellow. so in this case, female points stay all orange, male points stay red, and NA stay blue. probably a good idea to propagate this to other custom animations. if it's possible to keep the colors on the bars for mean, then great. but if complicated we can skip it. |
@willdebras I tested all the specs and they work great, except the |
So right now it is usually in the set of specs directly after the jitter spec, right? The jitter spec is generated in the group_by state. Currently the custom animation is always getting applied in the first summarize spec. This binary file doesn't produce any jittered specs because the binary variables I believe are always depicted in a grid. Do we need to add a jitter spec anywhere? |
Ah yes, you are right. So to make mean work after grid spec, we need to sort it first and then translate. Will try to fix that on my side. |
@willdebras all custom animations (except count) should always be after a spec where each datapoint has y value. That's needed because first step is to animate points to slash shape (/): --- then draw bars with mean lines and then collapse. In case of binary variables, we only have grid, we don't have y values for each datapoints. Instead a player has a batting average in the year. I think that we need to show jittered spec after I tried to stack the circles to get the transform like that, but because we have so many points, they overlap and not really clear what's going on. |
i agree, i don't think custom animations for binary variables make sense, at least not for mean. @giorgi-ghviniashvili can you work on the color issues above for next meeting? |
@jhofman fixed color issue: mean-color.movmedian-colors.movmax-colors.mov |
@giorgi-ghviniashvili The binary specs have been updated to remove custom animations meta spec. All binary specs now exclude this meta spec: |
the mean animation looks great. the median animation has a jump after the medians are calculated from 7 to 8 seconds. maybe this is just a problem w/ the spec? the max animation looks good until the very end when some ghost points appear below the correct points. |
@jhofman median fixed: median-fixed-2.movmedian-updated.movAbout the max animation, the issue is with the faceted spec, which is not R generated. Here is max using r generated without facets: max-fixed.mov |
these look good w/ the removal of the ghosted final points, which @giorgi-ghviniashvili seems to have fixed locally but not pushed. so we're almost all set. one small point would be to remove a delay in median-updated.mov above, between 19 and about 22.5 seconds, when the "median" gets added to the y axis label. maybe it's just an extra spec in there? if it's easy to fix, great. if not we can backlog it. |
@jhofman Looks better, doesn't it? removed-delay.mov |
just under the 1 year mark! :) |
@willdebras can you merge the doc updates for custom animations? |
Right now
mean
shows points collapsing. Here are suggestions for how other aggregation operations can be animated: https://idl.cs.washington.edu/files/2019-AnimatedAggregates-EuroVis.pdfThe text was updated successfully, but these errors were encountered: