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

[Lens] Custom gradient colors for numeric table cells #66192

Closed
bradquarry opened this issue May 12, 2020 · 4 comments · Fixed by #95217
Closed

[Lens] Custom gradient colors for numeric table cells #66192

bradquarry opened this issue May 12, 2020 · 4 comments · Fixed by #95217
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@bradquarry
Copy link

Describe the feature:
Specify colors associated with fixed value ranges to set the 'cell' and 'text' color for a reverse sorted aggregate column. <=10 GREEN, <=25 YELLOW, <=50 RED.

Describe a specific use case for the feature:
When creating Observability dashboards for troubleshooting it is helpful to be able to quickly indicate what you need to look at in reverse sorted lists. Especially if you have to look at a number of dashboards at once.

@wylieconlon wylieconlon added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label May 15, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@wylieconlon
Copy link
Contributor

This is a good feature request, and I think we can solve this as part of our general work on color assignment. Specifically, I think this is a type of color gradient with fixed steps, and is highly related to this other issue: #68428

The reason I'm linking to that other issue is that this request is not enough by itself. We already let users use exact values for the Goal and Gauge colors, but these values can never be dynamic based on the actual data. The form we use in the goal and gauge charts is not sufficient for table coloring because of its lack of a dynamic option:

Screenshot 2020-06-04 17 59 20

@flash1293 flash1293 added the enhancement New value added to drive a business result label Aug 6, 2020
This was referenced Aug 6, 2020
@flash1293 flash1293 changed the title [lens] Color groups based on a range of values for Table charts in Lens [Lens] Custom gradient colors for numeric table cells Mar 11, 2021
@flash1293
Copy link
Contributor

Adding mockups here for reference:

No coloring
Screenshot 2021-03-11 at 14 56 59

Enabling coloring
Screenshot 2021-03-11 at 14 57 31

Settings flyout
Screenshot 2021-03-11 at 14 59 04

Stepped/Fixed:
Screenshot 2021-03-11 at 15 01 04
Screenshot 2021-03-11 at 15 01 11

There's no mockup for this case, but there are three color progression options for the custom palette:
gradient, stepped and fixed

Stepped should also show a step slider below. Fixed is the mode shown in the picker right now (giving the user full control over which color is shown when)

@flash1293
Copy link
Contributor

Implementation notes:

Coloring

!! All of this is just handling categorical palettes so far !!

Suggested extension for coloring based on value

  • Introduce a flag on the palette whether dynamic coloring is supported (e.g. "positive" palette can be used, default palette doesn't make sense)
  • Extend the state of the gradient eligible system palettes and the custom palette by the customization settings we talked about:
  • Extend the expression function definitions to be able to handle these settings
  • Add a new getGradientColor method to the palette instance - it takes current value, series min, series max and state of the palette
  • Implement getGradientColor for the palettes where it makes sense
  • Implement the UI in Lens as a shared UI component
  • Implement usage in the data table component
  • In the expression serialization of these palettes, do not use the "theme" wrapper (doesn't really make sense to overwrite this from the outside IMHO)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants