Skip to content

Commit 60bb748

Browse files
committed
simplify to_image
1 parent 2e9c8af commit 60bb748

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

plotly/io/_kaleido.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,15 @@ def to_image(
107107
# Request image bytes
108108
if kaleido_major > 0:
109109
# Kaleido v1
110-
opts = {
111-
k: v
112-
for k, v in dict(
110+
img_bytes = kaleido.calc_fig_sync(
111+
fig_dict,
112+
path=None,
113+
opts=dict(
113114
format=format,
114115
width=width,
115116
height=height,
116117
scale=scale,
117-
).items()
118-
if v is not None
119-
}
120-
img_bytes = kaleido.calc_fig_sync(
121-
fig_dict,
122-
path=None,
123-
opts=opts,
118+
),
124119
)
125120
else:
126121
# Kaleido v0

0 commit comments

Comments
 (0)