-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Expose active data in some places #79851
Conversation
Jenkins, test this. |
Pinging @elastic/kibana-app-arch (Team:AppArch) |
Pinging @elastic/kibana-app (Team:KibanaApp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apparch changes LGTM
💚 Build SucceededMetrics [docs]async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Conflicts: # x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx # x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
Fixes #79194
Pull the current data table into the Lens editor state and pass it to visualizations and datasources.
This is a prerequisite for #74509 and #68405
Changes breakdown
expressions
The
data$
observable of the underlying loader is exposed in the react component using a callback (onData$
). If set, it's called every time the data observable is emitting a new value with the this value and current inspector adapter contentslens
merge_tables
expression function to record all tables in thetables
inspector adapterx-pack/plugins/lens/public/editor_frame_service/merge_tables.ts
activeData?: Record<string, Datatable>
, containing the last rendered data table per layer. This information might be outdated or not available, all consumers have to make sure to check before actually using it.x-pack/plugins/lens/public/editor_frame_service/editor_frame/state_management.ts
onData$
callback to get notified about arrived data and putting it into the state using dispatchx-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
getDatasourceSuggestionsFromCurrentState
(to suggest different tables based on current data, e.g. by looking at cardinality)DatasourceDimensionProps
(to use this information in the dimension editor or dimension trigger, e.g. for visual indication of empty data, high cardinality, ...)DatasourceLayerPanelProps
(to use this information in the layer panel, e.g. for visual indication of empty data, high cardinality, ...)There are a bunch of other places where we could pass this information but I don't see a good use case yet. If we ever decide to use it there as well, it shouldn't be hard to wire it up in the same way.