Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Copy width/height calculating logic from kaleido #5325

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

Merged
emilykl merged 10 commits into plotly:main from geopozo:andrew/better-kaleido-defaults
Aug 19, 2025

Conversation

@ayjayt
Copy link
Contributor

@ayjayt ayjayt commented Aug 13, 2025
edited
Loading

Code PR

  • I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of plotly.graph_objects, my modifications concern the code generator and not the generated files.
  • I have added tests or modified existing tests.
  • For a new feature, I have added documentation examples (please see the doc checklist as well).
  • I have added a CHANGELOG entry if changing anything substantial.
  • For a new feature or a change in behavior, I have updated the relevant docstrings in the code.

plotly/Kaleido#378

janosh reacted with thumbs up emoji
Copy link
Contributor Author

ayjayt commented Aug 13, 2025
edited by emilykl
Loading

Copy link
Contributor

emilykl commented Aug 14, 2025

Looks good @ayjayt ! Just run ruff format on plotly/io/_kaleido.py so the CI will pass.

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.

@ayjayt ayjayt marked this pull request as ready for review August 14, 2025 21:04
@ayjayt ayjayt requested a review from emilykl August 14, 2025 21:04
mock_get_chrome.assert_called_once()


def create_figure(width=None, height=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could you move these two utility functions to the top of the file so they're not mixed in with the test functions?

ayjayt reacted with thumbs up emoji
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, (
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to import pio.defaults here and check that the dimensions equal the defaults

ayjayt reacted with thumbs up emoji
Copy link
Contributor

@emilykl emilykl left a comment

Choose a reason for hiding this comment

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

Thanks @ayjayt ! 🚀

@ayjayt ayjayt requested a review from emilykl August 18, 2025 20:28
Copy link
Contributor

emilykl commented Aug 19, 2025

@ayjayt Looks good to me -- may I merge?

@emilykl emilykl merged commit 7639653 into plotly:main Aug 19, 2025
8 checks passed
@ayjayt ayjayt deleted the andrew/better-kaleido-defaults branch August 19, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@emilykl emilykl Awaiting requested review from emilykl

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /