-
Notifications
You must be signed in to change notification settings - Fork 40
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
Kaleido ignores width/height from Plotly figure #12
Comments
Hi @kvanderwijst, thanks for the encouraging words and for giving Kaleido a try! I can confirm what you're seeing and this is definitely an oversight. Until we get a fix out, you can work around this by setting the default width/height to import plotly.io as pio
pio.kaleido.scope.default_width = None
pio.kaleido.scope.default_height = None Technical details: The culprits are these lines: Kaleido/repos/kaleido/py/kaleido/scopes/plotly.py Lines 71 to 72 in 798fa98
For In the meantime, this can be worked around this by setting the default width/height to import plotly.io as pio
pio.kaleido.scope.default_width = None
pio.kaleido.scope.default_height = None In this case, the figure's width and height will be used if they are available, otherwise the are chosen using the defaults defined in the JavaScript layer here: Kaleido/repos/kaleido/js/src/plotly/constants.js Lines 22 to 27 in 798fa98
Note: This issue only affects the Python Plotly scope, other wrappers of the Kaleido C++ core do not have this problem. |
Interestingly, Orca also ignores the built-in height and width when using it with |
(both renderers and writers I mean... fixing Orca in post-4.9 doesn't make much sense) |
This is probably a change we'll need to make in the plotly.py renderer code since they also have default width/height logic. |
OK, let's pursue here: plotly/plotly.py#2651 |
First of all, thanks for the great work on the Kaleido package -- great improvement over Orca architecture!
However, the width and height attributes as set in a Figure layout are ignored: you have to specify them explicitly in the write_image command. This is not required when using Orca. It would be very nice to have this feature also for Kaleido.
Thanks!
The text was updated successfully, but these errors were encountered: