elastic / elastic-charts

https://elastic.github.io/elastic-charts/storybook
Other
370 stars 120 forks source link

[Goal] Resizing limitations. #1599

Closed Kuznietsov closed 2 years ago

Kuznietsov commented 2 years ago

Problem description

While trying to replace the vislib gauge with the goal from the elastic-charts, it has been found the further issue.

The goal chart has limitations on its maximum size.

Current behavior

https://user-images.githubusercontent.com/22456368/154481512-ea9daa67-f9e3-477a-a60a-be0712f85e8d.mov

Expected behavior

After the resizing of the container, the goal chart should be resized without any limitations.

https://user-images.githubusercontent.com/22456368/154482261-dc2641a1-58b0-44bb-bf4f-08ed9f210998.mov


Version (please complete the following information):


Kibana Cross Issues:

Kuznietsov commented 2 years ago

@markov00, sure, I can do that.

markov00 commented 2 years ago

I've double checked internally and we have an internal limiter on the size:

const referenceCircularSizeCap = 360; // goal/gauge won't be bigger even if there's ample room: it'd be a waste of space
const referenceBulletSizeCap = 500; // goal/gauge won't be bigger even if there's ample room: it'd be a waste of space

I think we can remove that limit, or configure them in the theme. As written in the comment, having such big charts is actually a waste of space and the sizing should be limited on the canvas/lens/visualize/dashboard side or at least the user should be educated with good practices

markov00 commented 2 years ago

@Kunzetsov (cc @flash1293) We are going to expose these limit parameters in the theme but we highly discourage changing them to something more extreme. Due to the two little pieces of information rendered on the goal chart and its circular nature, increasing its size above the suggested params will become a big waste of space and a disproportioned chart in your dashboard.

flash1293 commented 2 years ago

Makes sense @markov00 - we can make sure to only use it for the legacy charts (not for Lens).