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

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

Closed
jhofman opened this issue Apr 12, 2021 · 14 comments
Closed

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

jhofman opened this issue Apr 12, 2021 · 14 comments
Assignees
Labels
priority next action r

Comments

@jhofman
Copy link
Contributor

jhofman commented Apr 12, 2021

@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
Copy link
Collaborator

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

@jhofman jhofman added the r label Apr 13, 2021
@jhofman
Copy link
Contributor Author

jhofman commented Apr 13, 2021

thanks @sharlagelfand, closing!

@jhofman jhofman closed this as completed Apr 13, 2021
@jhofman
Copy link
Contributor Author

jhofman commented Apr 14, 2021

@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 jhofman reopened this Apr 14, 2021
@jhofman jhofman added the priority next action label Apr 14, 2021
@jhofman
Copy link
Contributor Author

jhofman commented Apr 14, 2021

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

@jhofman
Copy link
Contributor Author

jhofman commented Apr 14, 2021

@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
Copy link
Collaborator

@jhofman modifications:

  • added width and height
  • added scale.domain for some padding around grid
  • hid axes

@jhofman
Copy link
Contributor Author

jhofman commented Apr 14, 2021

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
Copy link
Collaborator

@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
Copy link
Contributor Author

jhofman commented Apr 14, 2021

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

@sharlagelfand
Copy link
Collaborator

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
Copy link
Contributor Author

jhofman commented Apr 14, 2021

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
Copy link
Contributor Author

jhofman commented Apr 16, 2021

@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
Copy link
Collaborator

@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
Copy link
Contributor Author

jhofman commented Apr 26, 2021

think we're good on this one!

@jhofman jhofman closed this as completed Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority next action r
Projects
None yet
Development

No branches or pull requests

3 participants