-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix responsive figures with WebGL #3486
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -105,7 +105,8 @@ exports.plot = function(gd, data, layout, config) { | |||||||
|
||||||||
// hook class for plots main container (in case of plotly.js | ||||||||
// this won't be #embedded-graph or .js-tab-contents) | ||||||||
d3.select(gd).classed('js-plotly-plot', true); | ||||||||
d3.select(gd).classed('js-plotly-plot', true) | ||||||||
.style('position', 'relative'); | ||||||||
|
||||||||
// off-screen getBoundingClientRect testing space, | ||||||||
// in #js-plotly-tester (and stored as Drawing.tester) | ||||||||
|
@@ -244,8 +245,6 @@ exports.plot = function(gd, data, layout, config) { | |||||||
'position': 'absolute', | ||||||||
'top': 0, | ||||||||
'left': 0, | ||||||||
'width': '100%', | ||||||||
'height': '100%', | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think those two lines were ever needed since a few lines later we set the size of the canvas via its attributes anyway: plotly.js/src/plot_api/plot_api.js Lines 253 to 255 in f8c959d
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice find! |
||||||||
'overflow': 'visible', | ||||||||
'pointer-events': 'none' | ||||||||
}); | ||||||||
|
@@ -538,8 +537,7 @@ function plotLegacyPolar(gd, data, layout) { | |||||||
var paperDiv = plotContainer.selectAll('.svg-container') | ||||||||
.data([0]); | ||||||||
paperDiv.enter().append('div') | ||||||||
.classed('svg-container', true) | ||||||||
.style('position', 'relative'); | ||||||||
.classed('svg-container', true); | ||||||||
|
||||||||
// empty it everytime for now | ||||||||
paperDiv.html(''); | ||||||||
|
@@ -3744,8 +3742,7 @@ function makePlotFramework(gd) { | |||||||
// Make the svg container | ||||||||
fullLayout._paperdiv = fullLayout._container.selectAll('.svg-container').data([0]); | ||||||||
fullLayout._paperdiv.enter().append('div') | ||||||||
.classed('svg-container', true) | ||||||||
.style('position', 'relative'); | ||||||||
.classed('svg-container', true); | ||||||||
|
||||||||
// Make the graph containers | ||||||||
// start fresh each time we get here, so we know the order comes out | ||||||||
|
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.
Hmm. I'll call that a breaking change.
We could turn this on just when
responsive
is set totrue
. But then again, are there any other solutions?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, that's certainly a breaking change and it breaks a lot of tests anyway.
I have another branch in which I fix the responsive issues for both WebGL #3485 and the modebar #3499 that doesn't rely on modifying the parent. I will submit a new separate PR with a cleaner commit history and I will close the current one.