-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
newPlot doesn't respect layout.height unless layout.autosize is explicitly true #537
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
Comments
I would definitively call this a bug. Thanks for bringing this up. The root of the problem is in this block where layouts with incomplete size specifications (denoted by I believe the aforementioned block should instead be: computedStyle = window.getComputedStyle(gd);
newHeight = fullLayout.height || parseFloat(computedStyle.height);
newWidth = fullLayout.width || parseFloat(computedStyle.width); |
I've also found that
In the PR I'm preparing, I'm planning to ensure that:
|
* Moved initial call to `plotAutoSize` into `Plots.supplyDefaults(gd)`. * Replaced `{ autosize: 'initial' }` with the flag `gd._fullLayout._initialAutoSizeIsDone`. * `{ autosize: false }` the values of width and height undefined in `gd.layout` will be autosized only once. * `{ autosize: true }` only autosizes the values of width and height undefined in `gd.layout`. Fixes plotly#537
* Added test to check `Plotly.newPlot` respects `layout.width` and `layout.height`.
* Moved initial call to `plotAutoSize` into `Plots.supplyDefaults(gd)`. * Replaced `{ autosize: 'initial' }` with the flag `gd._fullLayout._initialAutoSizeIsDone`. * `{ autosize: false }` the values of width and height undefined in `gd.layout` will be autosized only once. * `{ autosize: true }` only autosizes the values of width and height undefined in `gd.layout`. Fixes plotly#537
* Added test to check `Plotly.newPlot` respects `layout.width` and `layout.height`.
Remove internal option layout.autosize='initial' (Fixes #537)
Revert "Remove internal option layout.autosize='initial' (Fixes #537)"
It looks like the issue I originally reported still persists? |
Correct. Will be done in #635 |
I know this should really be done with relayout, but nevertheless, I found the behavior surprising.
http://codepen.io/cpsievert/pen/yOrQya
The text was updated successfully, but these errors were encountered: