Skip to content
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] Remove multi table #116736

Closed
Tracked by #75030
flash1293 opened this issue Oct 29, 2021 · 1 comment
Closed
Tracked by #75030

[Lens] Remove multi table #116736

flash1293 opened this issue Oct 29, 2021 · 1 comment
Labels
Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure technical debt Improvement of the software architecture and operational architecture

Comments

@flash1293
Copy link
Contributor

Currently Lens uses the multi_table data structure to pass data from the datasource to the visualization. We decided to get rid of this additional context type and use multiple individual datatable contexts instead which are passed over as variables.

Datasource side

Currently, the expression created by the datasource looks like this:

lens_merge_tables layerIds="layer1" tables={esaggs...} layerIds="layer2" tables={esaggs...}

This should be changed to

var_set name="layer1" value={esaggs...}  name="layer2" value={esaggs...}

The variable names are the layer ids, the values the datatables of the individual layers

Visualization - Single table cases (everything except for xy chart)

Currently, it works like this (receving a multi table as input):

lens_merge_tables layerIds="layer1" tables={esaggs...} | pie_chart

This should be changed to

var_set name="layer1" value={esaggs...} | var "layer1" | pie_chart

Use the var function to read the only layer, then pass it to the existing chart function. The chart function has to be changed to receive a regular datatable instead of multi_table.

Visualization - Multi table cases (xy chart)

Currently, it works like this (receving a multi table as input):

lens_merge_tables layerIds="layer1" tables={esaggs...} layerIds="layer2" tables={esaggs...} | xy_chart

This should be changed to

var_set name="layer1" value={esaggs...}  name="layer2" value={esaggs...} | xy_chart layerId="layer1" table={var "layer1"} layerId="layer2" table={var "layer2"} context={kibana}

The individual layers are passed in via array arguments (basically moving the multi table concept into the chart function).

The multi table also transports an additional information about the current time range - this can be done via the kibana function which should be passed in as a separate argument as well (the passed in kibana_context input contains the time range as well)

@flash1293 flash1293 added technical debt Improvement of the software architecture and operational architecture Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Oct 29, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors (Team:VisEditors)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

2 participants