Per-group names in groupby transform
See original GitHub issueThe problem: When you group more than once trace, the legend is confusing. It shows repeated groups without a good indication of which trace they belong to:
More buggily, as @chriddyp points out, if you change trace group names in the legend while in edit mode, they revert because there’s nowhere in the schema for the input to go. One solution would be to add a names
field for custom group names, e.g.:
"type": "groupby",
"target": ["morning", "morning", "evening", "evening"],
"names": [
{
"value": "morning",
"name": "kale - morning"
},
{
"value": "evening",
"name": "kale - evening"
}
]
That at least makes room for the input and seems much less corner-case bound than combining the names into a single string automatically.
On a more UX level, it would be possible to show the legend group name (i.e. parent trace name) and group the traces visually, as in:
+- radishes ---+
| o morning |
| x evening |
+--------------+
+- carrots ----+
| o morning |
| x evening |
+--------------+
+- kale -------+
| o morning |
| x evening |
+--------------+
This solution resolves the UX issue but not the nowhere-for-editmode-input-to-go issue.
/cc @chriddyp @alexcjohnson @etpinard @bpostlethwaite @cldougl for thoughts.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top GitHub Comments
My first reaction would be to do something analogous to
tickvals
/ticktext
:A more concise but restricted way would be a custom string substitution:
But yeah, that wouldn’t allow editing via the legend, that would have to break out of the substitution format and convert it to the
groupvals
/groupnames
version.@cldougl I think perhaps they did. I’m not too familiar with them, but the legend naming code explicitly checks for and handles ohlc/candlestick plots.