-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Upgrade Plotly #4752
Upgrade Plotly #4752
Conversation
b9a25ae
to
efce18f
Compare
df07124
to
b6cbdd1
Compare
b6cbdd1
to
1a94b1d
Compare
5fff5e0
to
7a89541
Compare
7a89541
to
14df2b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference in legend style is its width/where the scroll is?
@@ -118,10 +118,10 @@ function prepareBoxLayout(layout, options, data) { | |||
|
|||
export default function prepareLayout(element, options, data) { | |||
const layout = { | |||
margin: { l: 10, r: 10, b: 10, t: 25, pad: 4 }, | |||
margin: { l: 10, r: 10, b: 5, t: 20, pad: 4 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this change there are just bigger margins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and for me it looked too large; left/right paddings also changed a little bit, but in all cases it depends on axis labels (seems Plotly changed an algorithm that measures labels and now it preserves few more pixels for labels). Also seems that extra space also depends on chart size, therefore I was unable to fit margins perfectly, just as close as possible
width: Math.floor(element.offsetWidth), | ||
height: Math.floor(element.offsetHeight), | ||
autosize: true, | ||
autosize: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we lose by disabling autosize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built-in autosize feature is based on window.onresize
, and since we have implemented this feature on our own (via resizeObserver
service which is even more powerful) - we don't really need it. So turned it off just to save some resources.
Yes, and there is no any setting to control it. I tried to fix it with CSS, but it has some internal state and after any user interaction it returns to its default look. |
What type of PR is this? (check all applicable)
Description
Upgrade Plotly to latest version to use new features (like
offsetgroup
needed for #4150) also for smoother upgrades in future.I tested Chart visualization a lot after upgrade and didn't notice anything critical. Seems Plotly now computes auto-margins in a different way - I adjusted margins on our side to keep it as close as possible to previous version. Also, it changed legend styles a bit (see screenshots before/after) - unfortunately, I didn't find a good fix:
Related Tickets & Documents
#4150