Open mhkeller opened 4 years ago
Thanks for the PR!
This is a great feature idea. We already do something similar for column-pivots on treemap
and sunburst
charts, and the new @finos/perspective-viewer-datagrid
module can easily provide virtual grid layouts for simple chart types.
The main blocker is the UX. I think the next step would be to solicit some ideas on what this could look like in the perspective-viewer
web component. One possibility we've discussed is providing "context dropdowns" for the row-pivots
and column-pivots
controls, so that visualizations/plugins could assign their own plugin-specific interpretation for these data group modes - e.g., for a line chart, options for column-pivots
may be "Split to Series" or "Split to Chart". Another option may be to put these control in the plugin render surface itself, as the Y-axis selector currently works, and utilize the plugin_config
to persist and model this selection.
Could you point to an example or the source for how the Y-axis selector currently works with plugin_config
so I can familiarize myself with that.
For the UX, I think having a draggable field just like the Group by
and Split by
fields would be good as opposed to having it be an option under the Split by
aka column-pivots
. The reason for this is I could imagine scenarios where you want to column-pivot by one field and facet into chart groups by another.
For example, you have a multi-series line chart that column-pivots
on salesperson but facets these series of salespeople into geographical regions of a country.
I could see this type of pivot being useful event for @finos/perspective-viewer-datagrid
if you wanted to view a pivot as distinct table views.
Putting the logic in the plugin seems to make sense. Thinking out loud, for the treemap and sunburst example, then, would this type of pivot would replace the Split by
operation since those chart forms can't display aggregates in one view and must split them into small multiples?
On the two other options I mentioned, for the sorting, if this faceting is enabled, you would have another draggable field appear that allows the user to select the column to order facets by and this would allow for the same dropdown menu to choose the same options you get with aggregate functions:
To handle the scale question, I think a checkbox saying [ ] Shared scale
next to this field would be enough.
Feature Request
Description of Problem:
I am splitting by one column column and grouping by a shared time field along the x-axis to create a multi-series line chart. I have so many series that it's currently a bit hard to disentangle them. Toggling certain series on and off isn't really a solution because it's slow and I'm guessing which series I want to hide and show.
Potential Solutions:
I would like to see this as separate line charts in a grid layout showing one line chart per-series. It would be nice to be able to sort these small multiple charts by an attribute of each series such as starting value, ending value, or difference between the two, min, max, average etc. It would also be nice to be able to choose whether the extents of the chart scales are shared between all series or specific to each one.
If this already exist and I've missed it, please let me know!