-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Per-group names in groupby transform #1893
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
Comments
I like @alexcjohnson's suggestion: |
My first reaction would be to do something analogous to "type": "groupby",
"target": ["morning", "morning", "evening", "evening"],
"groupvals": ["morning", "evening"],
"groupnames": ["kale - morning", "kale - evening"] A more concise but restricted way would be a custom string substitution: "type": "groupby",
"target": ["morning", "morning", "evening", "evening"],
"nameformat": "kale - %t" 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 |
Agreed, but to clarify, I'd favor just converting the one that was edited into |
That could work. I wonder if there's some smart way we could figure out to have the first edit set |
did the financial types (ohlc and candlestick) have a similar problem? |
@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. |
The 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.: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:
This solution resolves the UX issue but not the nowhere-for-editmode-input-to-go issue.
/cc @chriddyp @alexcjohnson @etpinard @bpostlethwaite @cldougl for thoughts.
The text was updated successfully, but these errors were encountered: