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

Take manual control over Plotly sizing #7483

Merged
merged 2 commits into from
Nov 12, 2024
Merged

Take manual control over Plotly sizing #7483

merged 2 commits into from
Nov 12, 2024

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Nov 12, 2024

The sizing behavior of the Plotly pane has been quite annoying since we first created it. The problem being that Plotly does not seem to correctly determine the size of its container on the initial render so what the user saw when using a responsive sizing mode was an initial render, followed by a visible resize event, i.e. noticeable flicker.

Rather than letting Plotly handle the sizing behavior itself I've decided that we are now going to simply take control of the sizing behavior ourselves by computing the sizes of the container and then applying those using a relayout call. This appears to work very well, particularly when throttled, since resizing is a relatively expensive operation (~25 ms for an ordinary plot).

Fixes #7445
Fixes #6173
Fixes #5970

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.36%. Comparing base (ce938bf) to head (13a6e3e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7483      +/-   ##
==========================================
- Coverage   82.38%   82.36%   -0.02%     
==========================================
  Files         339      339              
  Lines       50980    50980              
==========================================
- Hits        42000    41992       -8     
- Misses       8980     8988       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr philippjfr added this to the v1.5.4 milestone Nov 12, 2024
@philippjfr philippjfr merged commit f08c876 into main Nov 12, 2024
17 checks passed
@philippjfr philippjfr deleted the plotly_resize branch November 12, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant