[Lens] Expose active data in some places#79851
Merged
flash1293 merged 13 commits intoelastic:masterfrom Nov 6, 2020
Merged
Conversation
Contributor
Author
|
Jenkins, test this. |
Contributor
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
Contributor
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
Contributor
💚 Build SucceededMetrics [docs]async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
flash1293
added a commit
to flash1293/kibana
that referenced
this pull request
Nov 6, 2020
# 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
flash1293
added a commit
that referenced
this pull request
Nov 9, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
expressionsThe
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 contentslensmerge_tablesexpression function to record all tables in thetablesinspector adapterx-pack/plugins/lens/public/editor_frame_service/merge_tables.tsactiveData?: 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.tsonData$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.tsxgetDatasourceSuggestionsFromCurrentState(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.