Skip to content
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
Format with ruff.
  • Loading branch information
ayjayt committed Aug 14, 2025
commit bcdccf4bcac57d0d4919be9d1a2f0f737191d62a
11 changes: 8 additions & 3 deletions plotly/io/_kaleido.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,22 @@ def to_image(
if defaults.mathjax:
kopts["mathjax"] = defaults.mathjax


width = (
width
or fig_dict.get("layout", {}).get("width")
or fig_dict.get("layout", {}).get("template", {}).get("layout", {}).get("width")
or fig_dict.get("layout", {})
.get("template", {})
.get("layout", {})
.get("width")
or defaults.default_width
)
height = (
height
or fig_dict.get("layout", {}).get("height")
or fig_dict.get("layout", {}).get("template", {}).get("layout", {}).get("height")
or fig_dict.get("layout", {})
.get("template", {})
.get("layout", {})
.get("height")
or defaults.default_height
)

Expand Down