-
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] Architectural requirement: Visualizations can provide chart-level configurator #67384
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
Pinging @elastic/kibana-design (Team:Design) |
👍 I have this on my todo of mocks in the next couple weeks. |
@cchaos Thanks! My main ask is to get some kind of rough sketch of where you think things should go, with the least fidelity, because this affects our architecture. |
That is definitely possible. Are you expecting that we would combine both of the categories mentioned here into the popover? For example, the popover would include shared style that affects all visualizations, as well as style that affects just the current visualization? |
My guess is that there is sort of some hierarchy:
We have to support coloring all at all levels for fine-tuned customization so it makes it hard to always be shifting where this exists. Therefore, the above proposal is more of a "customize at the top level" or "if you need to, find the config you want to change and change it there." |
Also that button is a simplistic version. We may not be able to put all the options in a single popover and would want to consider creating a "toolbar" of sorts. |
From a technical perspective: We have chart-level settings which partially transfer from one chart type to the other. For the transferable settings the frame has to own the state. But the UI (the popover in the button) should be owned by the visualization to display global things which do not transfer and also display UI controls for the Lens global settings (which are transfered) in a way which makes sense for the current chart type). Steps:
The API should look similar to |
Moving this to the top:
Decision
Visualizations should be able to provide a chart-level component (similar to #67225 for dimension editors) to provide a UI for chart-level settings.
Implementation
From a technical perspective:
We have chart-level settings which partially transfer from one chart type to the other. For the transferable settings the frame has to own the state. But the UI (the popover in the button) should be owned by the visualization to display global things which do not transfer and also display UI controls for the Lens global settings (which are transfered) in a way which makes sense for the current chart type).
Steps:
The API should look similar to renderDimensionEditor (but without a columnId prop). If it is set for the current visualization, the "Chart options" button is clickable and opens a popover which contains a NativeRenderer for the new visualization API. If it's not set, the button is disabled. The editor frame manages the transferable state (in the beginning just color scheme) which is exposed (setter/getter) via the frame api and the open/close state of the chart options popover. Everything else is up to the visualization.
Discussion
We are finding a need to add extra panels to the right side editor to support different types of customization. There are two specific types of customization that are not part of the original designs for Lens.
Chart level settings:
Any setting that affects the entire chart, without being restricted to a single layer. This primarily affects the XY charts because we support multiple layers. The first setting that we want to add here is hide/show legend.
We have a fake version of this already in use for pie charts, because pie charts are restricted to a single layer:
Lens-level settings:
Some settings need to be shared even when Lens is switching chart types, most notably color palettes and other visual styling information. In my proof of concept for implemented color palettes in Lens, I placed an extra gear icon next to the chart type switcher to indicate that there are settings that affect every visualization:
cc @cchaos
The text was updated successfully, but these errors were encountered: