-
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
Make expression renderer aware of current context #77161
Comments
Pinging @elastic/kibana-app (Team:KibanaApp) |
Pinging @elastic/kibana-app-arch (Team:AppArch) |
I like that idea a lot. I wonder if we should still add a |
No strong opinion on the actual modes yet. I wonder whether we should have a map of settings instead of a single-dimension "mode". |
@ppisljar FYI, I'm starting to work on this. |
When rendering the result of an expression in an expression renderer, it is sometimes important to have some information about the context the result is rendered in because it can influence different aspects. In the case of Lens, there are several real world use cases for this:
noInteractivity
: When a Lens visualization is embedded in a Canvas workpad, filter actions can't be dispatched. But the chart renderer doesn't know about this and is still appearing interactive (e.g. changing the cursor when hovering over bars and letting the user brush to select a range on the x axis which doesn't have any effect). [Lens] Option to disable interactions #65630edit
: In Lens there a features planned that would require to offer some chart interactivity only when within the Lens editor, not on dashboards. [Lens] Client side table sorting #76962preview
: Lens is rendering visualizations in a "preview" mode in suggestions. This is currently done using a special separate expression, but could be solved more easily using a mode passed directly to the rendererProposal
This can be done by adding a
mode
option to the expression runner / component wrapper as part of theIExpressionLoaderParams
:This mode which is restricted by an enum (
'noInteractivity' | 'edit' | 'preview' | 'display'
with defaulting to'display'
) is exposed to the renderer as part of the handlers:As the possible modes are defined in a central place, this becomes a part of the generic contract of expression renderers. When implementing a renderer, it should respect the current mode as well as it can.
The text was updated successfully, but these errors were encountered: