Copy width/height calculating logic from kaleido#5325
Merged
emilykl merged 10 commits intoplotly:mainfrom Aug 19, 2025
Merged
Conversation
Contributor
Author
|
closes plotly/Kaleido#378 |
emilykl
reviewed
Aug 14, 2025
emilykl
reviewed
Aug 14, 2025
Contributor
|
Looks good @ayjayt ! Just run Let's add a test for this one. I'm happy to do that if you don't have the bandwidth, just let me know. |
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
emilykl
reviewed
Aug 15, 2025
| mock_get_chrome.assert_called_once() | ||
|
|
||
|
|
||
| def create_figure(width=None, height=None): |
Contributor
There was a problem hiding this comment.
nit: could you move these two utility functions to the top of the file so they're not mixed in with the test functions?
emilykl
reviewed
Aug 15, 2025
| fig = create_figure() | ||
| svg_bytes = pio.to_image(fig, format="svg") | ||
| width, height = parse_svg_dimensions(svg_bytes) | ||
| assert width is not None and height is not None, ( |
Contributor
There was a problem hiding this comment.
You should be able to import pio.defaults here and check that the dimensions equal the defaults
emilykl
approved these changes
Aug 15, 2025
Contributor
|
@ayjayt Looks good to me -- may I merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code PR
plotly.graph_objects, my modifications concern the code generator and not the generated files.plotly/Kaleido#378