Skip to content
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

Allow users to specify label->color mapping #3879

Merged
merged 1 commit into from
Nov 17, 2017

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Nov 16, 2017

Users can define label_colors in a dashboard's JSON metadata that enforces a label to color mapping.

It's common for user to want certain series to be a specific color ('forecast' should be a blue line, 'actual' is green), or to want consistency across dashboard refreshes (which we don't provide at the moment)

This also makes the function that maps labels to colors case insensitive.

@michellethomas @graceguo-supercat @williaster @john-bodley

BTW it could be nice to allow global settings (apply to all dashboards) for this somewhere.

screen shot 2017-11-15 at 9 37 30 pm

@fabianmenges
Copy link
Contributor

This is out of scope of this change, but I feel like we should have a UI to do this and not just manually writing json into this metadata field.

Apart from that I find it extremely difficult to find documentation (e.g. why is a very specific dashboard feature mentioned in a FAQ) for these kinds of features, we should probably reorganize our docs by functionality. Have a single doc for all the things you can specify on dashboard.

@mistercrunch
Copy link
Member Author

Totally agree about the docs, I think about this every time I add an FAQ entry. It's just always out-of-scope for the particular thing I work on to reorg the docs. Let's talk about this item briefly at the meeting tomorrow.

@mistercrunch
Copy link
Member Author

Also agree about having this in the UI and that's true of most of the things in "Metadata JSON".

I think it's a good pattern to have a way to add features for power users that are scaffolding for future UX components. This allows us to roll out key features with a fraction of the dev time, and we can always finish up the work later based on usage/popularity. This is especially good for uncommon-but-required features.

I wonder if there was a halfway between free-form JSON, and the UX features, say a little JSON editor that forces certain shapes and types.

@mistercrunch
Copy link
Member Author

Waiting for #3887 to rebase against

Users can define `label_colors` in a dashboard's JSON metadata that
enforces a label to color mapping.

This also makes the function that maps labels to colors case insensitive.
@williaster
Copy link
Contributor

@mistercrunch @fabianmenges we have been discussing adding global time + global color controls to dashboards in our dashboard re-design talks, can discuss more tomorrow?

If we're going to do a decent amount of work on the dashboards I don't think we should have a partial UI for it, we should just do it properly :) this is great for the logic component.

@mistercrunch mistercrunch merged commit a82bb58 into apache:master Nov 17, 2017
@mistercrunch mistercrunch deleted the force_colors branch November 17, 2017 23:56
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Nov 18, 2017
Users can define `label_colors` in a dashboard's JSON metadata that
enforces a label to color mapping.

This also makes the function that maps labels to colors case insensitive.

(cherry picked from commit a82bb58)
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
Users can define `label_colors` in a dashboard's JSON metadata that
enforces a label to color mapping.

This also makes the function that maps labels to colors case insensitive.
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
Users can define `label_colors` in a dashboard's JSON metadata that
enforces a label to color mapping.

This also makes the function that maps labels to colors case insensitive.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants