Skip to content

Support setting plotly.js path for Kaleido v1 image export #5207

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
merged 5 commits into from
Jun 3, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add actual image generation step in test
  • Loading branch information
emilykl committed Jun 3, 2025
commit 2e66fb08f7ef6f36ac044139f7467d788bce85c0
7 changes: 7 additions & 0 deletions tests/test_optional/test_kaleido/test_kaleido.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ def test_defaults():
assert pio._kaleido.scope.topojson == "path/to/topojson/files/"
assert pio._kaleido.scope.plotlyjs == "https://cdn.plot.ly/plotly-3.0.0.js"

# Set topojson default back to None
# (otherwise image generation will fail)
pio.defaults.topojson = None
# Generate image for real and make sure it's an SVG
result = test_fig.to_image(format="svg", validate=False)
assert result.startswith(b"<svg")

finally:
# Reset defaults to original values and check that they are restored
pio.defaults.default_format = "png"
Expand Down