-
Notifications
You must be signed in to change notification settings - Fork 121
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
Metric text bounces when container size changed #2238
Comments
Both the data and the container dimensions are needed to compute the correct text size. It seems like this bug is due to the calculation being run with up-to-date data and out-of-date container dimensions. The following console statements illustrate this. The first two lines are logged from the first parent render. You can see that a grid of width The second two are from the second parent render. Now we have a grid of width The third pair (highlighted) are from the first chart render. Here we have a grid of width Then, the fourth pair are from the second chart render. It is triggered when the container width catches up to the data and the text size is corrected. |
@nickofthyme any insights into why this might be happening? |
What is going on?@nickofthyme and I did some investigating. Here is what is roughly happening First React render
Second React render
RecapSo, the problem is essentially that new data is being received a render cycle before new container dimensions. Computing correct text size
If the new data is held back until the new container dimensions are received, the text size issue isn't present, however a distorted visualization is shown when the container dimensions have been updated, but React hasn't had a chance to render yet: Screen.Recording.2023-11-10.at.11.04.34.AM.mp4Possible solutions
|
## Summary Close #136993 All charts remain the same except the following ## Metric Each tile gets `200px` if there are multiple and `300px` if it's a single. The default background is EUI empty. <img width="600" alt="Screenshot 2023-10-30 at 3 55 33 PM" src="https://github.com/elastic/kibana/assets/315764/74d7e6dc-c90a-4f60-bf56-94ab1556ad42"> <img width="600" alt="Screenshot 2023-10-30 at 3 56 36 PM" src="https://github.com/elastic/kibana/assets/315764/3254160a-b18a-4c04-b059-f20b8f1f246a"> ## XY Vertical time-series charts have `16:9` ratio but will stretch to any available width and won't shrink below 300px height. https://github.com/elastic/kibana/assets/315764/3e056ae8-bc65-4851-9ad9-6c8a81bdf58a ## Gauge Gauge gets `600px` for the long side, `300px` for the short side. <img width="600" alt="Screenshot 2023-11-28 at 11 22 20 AM" src="https://github.com/elastic/kibana/assets/315764/2b774515-f060-4c26-a0aa-efdeebfff0e5"> <img width="600" alt="Screenshot 2023-11-28 at 11 22 33 AM" src="https://github.com/elastic/kibana/assets/315764/62181021-d88a-4cb6-862b-42768a2df13e"> ## Known issues - [ ] text resizing on the metric elastic/elastic-charts#2238 https://github.com/elastic/kibana/assets/315764/0162f461-b544-44a9-971c-b2a0265d7d3a - [x] gauge isn't showing veil on willRender ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4755 --------- Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: nickofthyme <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Marta Bondyra <[email protected]>
Describe the issue
When the container size is updated along with the layout of the tiles, the text of the metric briefly changes size before adjusting itself.
To Reproduce
Steps to reproduce the behavior:
Expected behaviour
The text shouldn't resize.
Screenshots
Screen.Recording.2023-11-09.at.6.22.20.AM.mov
Kibana Cross Issues
Blocking elastic/kibana#136993
Checklist
:xy
,:partition
):interactions
,:axis
)Kibana Cross Issues
list and thekibana cross issue
tag is appliedThe text was updated successfully, but these errors were encountered: