Skip to content

Subplots for all trace types #580

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

Closed
nicolaskruchten opened this issue Jul 13, 2018 · 13 comments · Fixed by #650
Closed

Subplots for all trace types #580

nicolaskruchten opened this issue Jul 13, 2018 · 13 comments · Fixed by #650
Assignees

Comments

@nicolaskruchten
Copy link
Contributor

In an ideal world, users should be able to create and manipulate all subplot variants that plotly.js can create. Certainly it should be possible to create multiple pie subplots for example.

@nicolaskruchten
Copy link
Contributor Author

Types of subplots:

  • 2d
  • 3d
  • geo
  • pie
  • polar
  • ternary
  • table/parcoords/splom??

Examples of how to subplot various combos of these:

@nicolaskruchten
Copy link
Contributor Author

Should we consider a new "Subplots" panel which somehow figures out all the subplots and allows us to position them with vertical/horizontal sliders?

@nicolaskruchten
Copy link
Contributor Author

Step 1: let's collect in a comment in this issue information about where in the figure the subplot domain information lives for all the different types of subplots listed above :)

@dmt0
Copy link
Contributor

dmt0 commented Jul 19, 2018

So it seems domain can be either in layout or in data and it can be either an array of two values or an object:

layout.axisname.domain = [0.65, 0.95]
xaxis, yaxis

layout.axisname.domain = {“y”: [0, 0.9], "x": [0, 0.55]}
geo, mapbox, polar, scene, ternary

data[x].domain = {"x": [0, 0.48]}
parcoords, pie, table

@dmt0
Copy link
Contributor

dmt0 commented Jul 19, 2018

Having an extra panel for this would allow us to do things without magic and keep things close to ploty.js.

But with a bit of magic... we could make a radio button in the GraphCreatePanel with choices like "Merged" | "Separate subplot" | "Move to the side within same subplot" (with better wording of course), and once that radio is selected, the new axes are created automatically as needed and sliders appear that allow to move your subplot around. That would replace current AxesSelector.

@nicolaskruchten
Copy link
Contributor Author

OK, so here's the spec for how to handle this issue:

  • We add a new Style/Subplots panel, which renders as a Subplot Accordion, which has a fold per subplot.
  • The list of subplots is defined to be the union of all (xaxis-yaxis pairs which share a trace, scenes, polars, ternarys, geos, pie-traces, table-traces).
  • Each fold in this accordion has (minimally) 4 sliders: horizontal/vertical min/max domain. (we can turn these into two-knob sliders later)
  • The x-y folds will need to handle the 'overlaying' thing, and the overlaying/domain stuff will be removed from the Layout fold of the Style/Axes panel
  • The Create/Traces folds for 3d/geo/polar/ternary will need a new custom widget to set which scene/geo/polar/ternary they are attached to, similar to the current way we deal with xy axes in scatter

Once this is done, there will be a (long!) series of clicks whereby it will be possible to create and position a figure which can contain arbitrary combinations of subplots of any currently-supported type! (i.e. not parcoords, splom, sankey... yet :)

@nicolaskruchten
Copy link
Contributor Author

Finally:

  • Any attr that lives in layout.(scene*|geo*|polar*|ternary*) needs to be moved/added to the corresponding subplot fold. So stuff like aspectratio and so on. This alone justifies the addition of this panel: the fact that these attributes otherwise have no home or can only apply to the first subplot :)

@dmt0
Copy link
Contributor

dmt0 commented Jul 25, 2018

If I create a choropleth trace and an atlas map trace, they reuse the same layout.geo object, so domain is shared

@nicolaskruchten
Copy link
Contributor Author

right, but we can change one of them to use a second geo right? geo2 or something, just like we can have multiple scenes and so on?

@nicolaskruchten
Copy link
Contributor Author

This mock just blows my mind: https://rreusser.github.io/plotly-mock-viewer/#grid_subplot_types

So much easier to use grids instead of percentage layouts. We should about how this feature (which I only just learned about!) impacts this design...

/cc @VeraZab check out that mock!

@nicolaskruchten
Copy link
Contributor Author

Subsumes #440

@dmt0
Copy link
Contributor

dmt0 commented Aug 6, 2018

Once #610 is merged, the only thing left here is to move geo., scene. stuff into subplot panel OR create some SubpotConnectedSections in GraphCreatePanel

@nicolaskruchten
Copy link
Contributor Author

OK, so let's move all the polar.<>, geo.<>, ternary.<> and scene.<> into the corresponding subplot folds in Graph/Subplots in an "Options" section. While we're in there let's make sure the bgcolor option is there where supported :)

Note that this means that the "Geo Layout" fold will disappear and thus make the geo subplot folds huge, and we'll also have to lightly adapt the shamefullyAdjustGeo stuff to work with e.g. geo2 and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants