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] Allow a single operation to create multiple user-facing operations #77949

Closed
Tracked by #184459
wylieconlon opened this issue Sep 18, 2020 · 2 comments
Closed
Tracked by #184459
Labels
Feature:Lens 🧊 iceboxed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure technical debt Improvement of the software architecture and operational architecture

Comments

@wylieconlon
Copy link
Contributor

This is an issue describing a current limitation of the Lens architecture and outlining some approaches to fixing it.

Example use case

There are some types of functions that create key/value pairs, or that produce multiple columns of output instead of multiple rows. For example:

As a user, I would expect that I could follow the following user flow:

  1. On the X axis of my chart, I can choose the "Percentiles" function on a field like bytes. This will set the X axis to the key, for example 99%.
  2. The Y axis is updated automatically with the value, which in this case is the value of the bytes field.
  3. The X and Y configurations are linked: if I change one, they both change. If I delete one, they are both deleted.

The end result of this configuration is that I only created the X axis manually, and the Y axis was assigned automatically.

Screen Shot 2020-09-18 at 3 57 40 PM

Why is this currently not supported?

Because datasources can't unilaterally generate new columns and assign them to visual dimensions. The closest behavior that we have is when the user drops a field into the Lens editor, and then a suggestion is generated and applied.

Datasources can unilaterally generate columns, but because the IDs aren't known by the visualization, it won't be editable by the user. So the only requirements here are:

  1. The datasource must be able to generate IDs in a way that visualizations can use internally
  2. The datasource must be able to remove IDs that the visualization was previously using

Implementation plan

Because the closest behavior is happening with suggestions, I propose that we create a new function that allows the Lens datasource to "push" suggestions, as opposed to having suggestions "pulled" from the datasource. Suggestions will be allowed to be pushed from the Dimension Editor, which is the component in the UI that manages operations. In this case, the expected flow is:

  1. The user starts configuring a more complicated function that has multiple output columns
  2. The editor component will save the state of the datasource
  3. The editor component will push the suggestion

Essentially, this changes the interface of the dimension editor by adding a new pushSuggestion function:

export type DatasourceDimensionEditorProps<T = unknown> = DatasourceDimensionProps<T> & {
  setState: StateSetter<T>;
  pushSuggestion: (suggestion: DatasourceSuggestion<T>) => boolean;
  core: Pick<CoreSetup, 'http' | 'notifications' | 'uiSettings'>;
  dateRange: DateRange;
}

The suggestion will be taken by the editor frame, and gets applied to the state.

@wylieconlon wylieconlon added technical debt Improvement of the software architecture and operational architecture Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Sep 18, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@stratoula stratoula added the impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. label Sep 6, 2023
@markov00
Copy link
Member

In order to provide better transparency of priorities, issues that will not be prioritized within the next 24 months are being closed.

Tracking request in Lens general improvements ice box #184459

@markov00 markov00 closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens 🧊 iceboxed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. 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

4 participants