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] Custom Breakdown Presentation Order #191988

Open
MichaelMarcialis opened this issue Sep 3, 2024 · 9 comments
Open

[Lens] Custom Breakdown Presentation Order #191988

MichaelMarcialis opened this issue Sep 3, 2024 · 9 comments
Labels
discuss Feature:ElasticCharts Issues related to the elastic-charts library Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@MichaelMarcialis
Copy link
Contributor

As part of the One Discover contextual logs effort, we would like to present a histogram of documents broken down by the log.level field. To make this information easier to interpret, it would be ideal if we could have greater control over the breakdown presentation order, allowing us to order the legend and breakdown stacking by log.level severity (see example in mockup below). As I understand it, this is currently not possible on either the Lens and Elastic Charts side.

Image

Related issue: #86184

CCing @stratoula, @teresaalvarezsoler, @nickofthyme.

@MichaelMarcialis MichaelMarcialis added Feature:ElasticCharts Issues related to the elastic-charts library Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Sep 3, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@teresaalvarezsoler
Copy link

@stratoula is this chart only for ES|QL or also for the dataview mode?

@stratoula
Copy link
Contributor

stratoula commented Sep 4, 2024

Both! right @davismcphee ?

@teresaalvarezsoler teresaalvarezsoler changed the title [Lens] [Elastic Charts] Custom Breakdown Presentation Order [Spike] [Lens] [Elastic Charts] Custom Breakdown Presentation Order Sep 4, 2024
@teresaalvarezsoler
Copy link

Scope for this issue: we need a bit more investigation to figure out how to solve this problem so we are repurposing this as a spike and time-boxing it to < 1 week

@davismcphee
Copy link
Contributor

@stratoula correct! This is needed for both data view and ES|QL mode.

@nickofthyme nickofthyme self-assigned this Sep 12, 2024
@nickofthyme nickofthyme changed the title [Spike] [Lens] [Elastic Charts] Custom Breakdown Presentation Order [Lens] Custom Breakdown Presentation Order Oct 8, 2024
@nickofthyme
Copy link
Contributor

This functionality will be available in kibana when #195447 is merged.

@nickofthyme nickofthyme removed their assignment Oct 13, 2024
@markov00
Copy link
Member

#195447 is merged but this can be achieved today only through Lens override functions, that are not persisted into Lens nor into a Dashboard.
I'd like to propose adding this feature in Lens by reusing the sorting order of the color mapping for rendering purposes too.
The sorting order of the data is inherently connected to the breakdown. This should be part of the breakdown configuration, where you can specify the data sorting (not the ranking): usually you can specify it with asc/desc/numerical/alphabetical but you can also specify it via in a list/index of terms/values to follow.
For now, we can probably also consider using the color mapping for that functionality, because it aligns with that concept.
This can be applied on a request basis via a switch in the color mapping like the following example:

In the long run, probably these operations should be described in the "data processing" part of Lens and not connected to the data styling.

@MichaelMarcialis
Copy link
Contributor Author

MichaelMarcialis commented Oct 15, 2024

I'd like to propose adding this feature in Lens by reusing the sorting order of the color mapping for rendering purposes too.

@markov00: I agree that we should provide configuration controls for users to apply a custom order to their visualization breakdowns. However, I do have a few concerns about relegating that control to the color mapping interface:

  1. I fear it will have very low discoverability there. What if a user doesn't wish to change their breakdown colors (which I believe is a majority of users)? Would they know to find such sorting controls there?
  2. Using a breakdown dimension isn't the only way for users to stack bar or area charts. For example, what if a user has multiple stacked bar layers with no breakdowns? Would we need to accommodate for adjusting the sort order in such a scenario? If so, I don't think the color mapping interface would be viable, as it is attributed to a single layer.
  3. The current color mapping interface has no drag-and-drop support for the reordering of terms. We can of course add drag-and-drop to it, but I fear that it would make an already complex UI even more complex.

Also, this related issue from Wylie seemed to indicate that there were use cases beyond just breakdowns.

Personally, my initial instinct is to add any sort of sorting controls at the global visualization level (i.e. toolbar menus), if we need to account for that multi-layer example I describe above. If we don't have to account for the multi-layer example, then at the root-level of the appropriate layer dimension's configuration flyout (i.e. not within the deeper color mapping configuration) would be my preference. Thoughts?

@markov00
Copy link
Member

@MichaelMarcialis let's discuss this offline and understand what/where we can go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Feature:ElasticCharts Issues related to the elastic-charts library Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

7 participants