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] New legend inside chart can be more smart in terms of layout #106372

Open
dej611 opened this issue Jul 21, 2021 · 3 comments
Open

[Lens] New legend inside chart can be more smart in terms of layout #106372

dej611 opened this issue Jul 21, 2021 · 3 comments
Labels
enhancement New value added to drive a business result Feature:Lens impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@dej611
Copy link
Contributor

dej611 commented Jul 21, 2021

Describe the feature:

The new Legend "inside chart" option in Lens ( #105571 ) offers a new Number of columns control which has been currently limited to 5 columns, preventing the user to create legends overflow for their values.

Screenshot 2021-07-21 at 11 50 35

While the current feature works, it strongly depends on the width of the category label, which can be relatively long, and the user has to manually check what is the best number to fit in there.

For instance in this case of IP values 5 columns is too much:

Screenshot 2021-07-21 at 11 49 00

I would propose a "smart" option for this case, where instead of Number of columns, the user can decide whether the legend should better use either the "Vertical space", or the "Horizontal space": this means that the chart library has to workout the best number of columns in order to display the values and make it harder to have it overflow, even for resized panels.

For instance in the case above with the IP addresses adopting the Horizontal space option should lead to a 4 column in that particular panel size. Resizing the panel should adjust it and probably reduce the columns to 3 and increase the number of rows to 3 as well.

What do you think @stratoula ? cc @markov00 @monfera

@dej611 dej611 added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Jul 21, 2021
@elasticmachine
Copy link
Contributor

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

@monfera
Copy link
Contributor

monfera commented Jul 26, 2021

We've already got a couple of very simple solvers in Charts, eg. a mixed integer, constrained gradient descent function, which could be used for identifying the minimal or maximal value for an acceptable column count; it demands a monotonic cost function (ie. it'll get stuck in a local optimum, if any). There's also a grid search function, though not yet in a PR, which would help with local optima here, and suitable in runtime, as the dimension count is low (1: column count) and the possible values are few (1, 2, 3, ... , approx. 10).

We are also contemplating a simple stochastic optimizer for eventual placement of annotations, eg. whether the chart has an empty, data ink free corner to put a legend of some aspect ratio, and where to put non-overlapping point annotations. But there are still many questions around anything stochastic, glad to chat about it.

Finally, we're on a long term thread of Charts disaggregation, @nickofthyme has made the first giant technical step, which is, conversion of the Charts repo into a monorepo that has charts but also, independently usable components. The solvers should, over time, migrate into the toolbox area so they can be used directly, so a client like Lens, Canvas and Dashboard could also derive optimal inputs to charts (or Vega or whatever) based on its own goals

@stratoula stratoula added the impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. label Jan 30, 2023
@markov00
Copy link
Member

markov00 commented Sep 6, 2023

related to legend redesign elastic/elastic-charts#2096

@timductive timductive added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Sep 6, 2023
@jb1b84 jb1b84 removed the vis:legend label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

7 participants