-
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] Allow users to select chart level categorical color palette #68404
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
I don't think we should focus on gradient colors in the first milestone, but it might help to be aware of the similarities and differences in the two types while implementing: #68428 |
For users who create a chart without a
Based on this will they only be able to choose color palette? won't it change every series instead of choosing specific y-axis series? |
@AlonaNadler This issue is just about choosing a palette without the ability of changing the colors of specific y-axis series. This will be implemented in a separate step - #53660 is the right issue for this. |
@wylieconlon Do you have an idea already how to set up the editor level state for the chosen palette? Is it just a string selecting one of multiple possible palettes or is there a better way? |
Talked offline about this, but I tried to outline some of the requirements in the parent issue #68330 the one thing that isn't described is the editor state. We definitely need a registry of color functions. We definitely need visualizations to call the color functions with the arguments that I defined in that issue. The main question is: other than the name of the color function, are there other options for how to configure the color function? I think there should be, making the color registry look like this: // Example of getting the color for the second layer of a pie chart:
// { name: "US", depth: 2, rankAtDepth: 2, totalSeriesAtDepth: 5, totalSeries: 40 }
interface SeriesLayer {
name: string;
rankAtDepth: number;
totalSeriesAtDepth: number;
totalSeries: number;
}
interface ColorFunctionDefinition<T = unknown> {
id: string;
title: string;
getColor: (series: SeriesLayer[]) => string | null;
state: T;
renderEditor: (domElement: Element, state: T, setState: (newState: T) => void) => void;
} I propose that there is a subset of color functions that are stateful, and that each of those stateful color functions should provide an editor component. This makes the following examples possible:
One question I don't know about is whether it should be up to the visualization or the color function to decide how to handle |
Based on the most recent discussion we decided to not take this approach but expose all coloring logic inside of the dimension configuration. This doesn't change except for how the user interacts with the setting (all of the low level decisions stay the same) |
Similar to #53661 , but as a chart level setting.
This is the first part of #68330
To give users more control over the appearance of their chart it should be possible to pick a color scheme which is applied to all parts of the chart (individual series as well as "break down by" splits).
Depends on #67384
The text was updated successfully, but these errors were encountered: