We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d36c65 commit df823b4Copy full SHA for df823b4
plotly/io/_kaleido.py
@@ -376,13 +376,26 @@ def to_image(
376
if defaults.mathjax:
377
kopts["mathjax"] = defaults.mathjax
378
379
- # TODO: Refactor to make it possible to use a shared Kaleido instance here
+
380
+ width = (
381
+ width
382
+ or fig_dict.get("layout").get("width")
383
+ or fig_dict.get("layout").get("template", {}).get("layout", {}).get("width")
384
+ or defaults.default_width
385
+ )
386
+ height = (
387
+ height
388
+ or fig_dict.get("layout").get("height")
389
+ or fig_dict.get("layout").get("template", {}).get("layout", {}).get("height")
390
+ or defaults.default_height
391
392
393
img_bytes = kaleido.calc_fig_sync(
394
fig_dict,
395
opts=dict(
396
format=format or defaults.default_format,
- width=widthordefaults.default_width,
- height=heightordefaults.default_height,
397
+ width=width,
398
+ height=height,
399
scale=scale or defaults.default_scale,
400
),
401
topojson=defaults.topojson,
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments