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

Sanitize margin after 'autosize' relayouts #2758

Merged
merged 1 commit into from
Jun 27, 2018

Conversation

etpinard
Copy link
Contributor

fixes #2663 (aka the react-plotly.js issue that resulted in negative svg mesures)

There's probably a better fix out there, but our autosize logic is such a mess that I was happy with this here. I hope @alexcjohnson will agree.

@etpinard etpinard added bug something broken status: reviewable labels Jun 27, 2018
@@ -357,7 +358,7 @@ plots.supplyDefaults = function(gd, opts) {
initialAutoSize = missingWidthOrHeight && (autosize || autosizable);

if(initialAutoSize) plots.plotAutoSize(gd, newLayout, newFullLayout);
else if(missingWidthOrHeight) plots.sanitizeMargins(gd);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️

@alexcjohnson
Copy link
Collaborator

a mess indeed. This looks good to me! 💃

@etpinard etpinard merged commit bcab36e into master Jun 27, 2018
@etpinard etpinard deleted the plots-resize-sanitize-margins branch June 27, 2018 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling Plots.resize on a (very) small <div> leads to SVG errors
2 participants