-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Gradient colors for numeric table cells based on palette #68428
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
I think I will rename this issue to "Gradient colors in table" representing its first implementation. This issue already describes the most common user need, and is what @flash1293 has proposed we implement first. A later step is to implement custom stops for gradient in a table. |
I agree tables are the most important use case, but we probably want to reuse this logic for metric and gauge charts as well. |
Discussed offline: To make the feature easier to manage, there will be two phases implemented separately:
|
Fixed by #95217 |
This issue describes how Lens should support gradient colors, which some visualizations will use instead of or in addition to categorical color functions. The main use cases for this type of coloring is conditional styling of table columns, but should also be supported by the pie/treemap charts.
Example of a "blues" gradient which shows CPU usage linearly from the lowest recorded value to the highest recorded value:
The simplest gradient color function takes a number from 0 to 1 and returns a color definition. This gives users two choices: defining the colors and converting to a value from 0 to 1
Defining the colors
To choose colors, users will either use a predefined gradient or choose their own color stops.
For any predefined gradient, such as these EUI gradients, users should also be provided with extra form options for:
For defining a custom gradient, users will use the EUI color stops component.
When using custom gradients, users should also have a switch between "continuous" and "fixed steps".
Finally, an important toggle in the custom color gradient is to switch between "percentage" and "absolute" mode: this will make it easier in some use cases to define non-linear color gradients. For example, this would make sense when showing response times in MS.
Converting to a percentage
To calculate the color, we convert the raw value to a percentage. Imagine that all of our numbers represent the response time in MS. There are still multiple ways of converting this to a percent:
This leads to three types of conversion:
Putting it all together
I like the way the Infrastructure monitoring app in Kibana has put it together, so I'm going to leave this as inspiration. It includes many of the elements that I've described above.
The biggest missing feature in the infrastructure monitoring app is the ability to define a custom gradient.
The text was updated successfully, but these errors were encountered: