microsoft / datamations

https://microsoft.github.io/datamations/
Other
67 stars 14 forks source link

Export vega specs for all frames from R to json using vegawidget #20

Closed jhofman closed 3 years ago

jhofman commented 3 years ago

@sharlagelfand, can you add each of the frames in vegawidget_exploration.R to a json file in that same directory for @giorgi-ghviniashvili to use, and number them sequentially?

Note, #21 depends on this.

sharlagelfand commented 3 years ago

@jhofman @giorgi-ghviniashvili The specs are in that directory now: 01-initial, 02-intermediate, 03-final. Thanks!

jhofman commented 3 years ago

thanks @sharlagelfand, closing!

jhofman commented 3 years ago

@sharlagelfand can you add the scatter plot stuff that follows for the rest of the animation for @giorgi-ghviniashvili, so he can complete #21?

importantly, vegalite doesn't have a jitter so we'll need the actual jittered coordinates passed in the json.

jhofman commented 3 years ago

Btw, @sharlagelfand, just curious how you solved the stringification of json from R issue to get rid of the [" ... ]"?

jhofman commented 3 years ago

@giorgi-ghviniashvili, sounds like you modified some parts of the specs. can you list the modifications here and we can see if it makes sense for @sharlagelfand to do those on the R side instead?

giorgi-ghviniashvili commented 3 years ago

@jhofman modifications:

jhofman commented 3 years ago

seems like width and height might be specific to the device that things are rendered on (e.g., large desktop browser vs. small mobile browser), so maybe that shouldn't be set by the base language but instead should be dynamically done in the rendering languge?

sharlagelfand commented 3 years ago

@jhofman @giorgi-ghviniashvili just because I finished them before this conversation popped up - here are the specs for the summarise operation (jitter plot and final point plot): 04-jitter_coords, 05-final_mean_coords. Both cases have a numeric x-axis (definitely needed in the jitter case in order to jitter horizontally) but probably will be more desirable to show the actual values (masters/phd) on the x-axis in the final frame.

I'll look into the spec modification and doing that on the R end now! Especially re: the scale.domain for these final two frames, since it shows from 0 on the y-axis.

Jake, I used plain ol' write() instead of jsonlite::write_json() and it solved the [" ... ]" issue!

jhofman commented 3 years ago

great, thanks @sharlagelfand. it looks like there's some hope of jitter happening on the vegalite end, see #23.

sharlagelfand commented 3 years ago

All of the coords here now have the scales' domain set and axis hid in the infogrid cases - I haven't set the width/height yet but hope this is closer to what you had, @giorgi-ghviniashvili!

jhofman commented 3 years ago

thanks @sharlagelfand, i think you don't need to worry about width and height, we can push that to the rendering end since it might depend on the device, etc.

jhofman commented 3 years ago

@sharlagelfand can you repeat what you did for the animation that had group_by(degree) only for the group_by(degree, work) one pictured here?

@giorgi-ghviniashvili is going to check that his current code can animation that in a plug-and-play type fashion.

i suspect we'll have some questions about how the annotations / lines / etc should be exported in json. let's do something simple for now and we can miss the lines or annotations, but when we get #25 sorted we can fix things up.

sharlagelfand commented 3 years ago

@jhofman @giorgi-ghviniashvili specs for the group_by(degree, work) case are here

I didn't include the lines/annotations and the x axes show numbers for the distributions/means rather than the underlying groups, but hopefully good enough to check that the animation works.

Giorgi let me know if I missed anything in the specs - the limits are all specified, axes removed when relevant, and each spec has the IDs so hopefully no issues 🤞 thanks!

jhofman commented 3 years ago

think we're good on this one!