microsoft / datamations

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

Investigate faceting in vegalite and gemini #28

Closed jhofman closed 3 years ago

jhofman commented 3 years ago

For #25, we're looking at possibly using faceting to break up multi-variable groupings into rows / columns / subplots.

If we go this route, we'll need to know how well faceting works in vegalite and if we can animate between facets in gemini.

To investigate this:

  1. Try converting the existing group_by(degree, workplace) dot plot into a faceted plot where the degree is the row, workplace is the column for a 2-by-2 faceted plot. SEe here for vegalite facet spec. You probably want the equivalent of a "free scale" within each facet so that it automatically sizes to the range of the data. There might be something in vegalite to specify this.
  2. See if we can animate between facets. You could start with the first dot plot that has no facets and try to transition to the second with facets.

Hopefully these facets show annotations to label the rows and columns, but if not we'll have to think about how to do this ourselves.

giorgi-ghviniashvili commented 3 years ago

Could not animate faceted vegalite spec. Seems like it is not supported now.

image

giorgi-ghviniashvili commented 3 years ago

image

giorgi-ghviniashvili commented 3 years ago

Just drawing with vega: image

jhofman commented 3 years ago

Could not animate faceted vegalite spec. Seems like it is not supported now.

image

cc @sharlagelfand

jhofman commented 3 years ago

Too bad about no faceted animations with gemini.

Does drawing with vega (instead of vega lite) buy us any additional functionality?

giorgi-ghviniashvili commented 3 years ago

@jhofman There is no difference if you use vega or vega lite -- gemini does not support this kind of animation.

jhofman commented 3 years ago

got it.

so we need to decide if we solve the problem of determining coordinates for group_by frames on the base language (e.g., R) or rendering language (e.g., javascript) side.

here's another question on this, which is related to this comment from @sharlagelfand on #25: even though gemini doesn't support faceting, could you make a faceted plot with vegalite, then read off the pixel coordinates of the points, and "fake" the facets yourself by creating a non-faceted vegalite spec with points in the same place?

jhofman commented 3 years ago

closing this in favor of the new #32 to hack faceting in a gemini-compatible way.