Skip to content

Commit 7c87736

Browse files
committed
fix plotly
1 parent 7e7fad9 commit 7c87736

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

reflex/components/plotly/plotly.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,24 @@ def _render(self):
245245
template_dict = LiteralVar.create({"layout": {"template": self.template}})
246246
merge_dicts.append(template_dict._without_data())
247247
if merge_dicts:
248-
tag.special_props.append(
249-
# Merge all dictionaries and spread the result over props.
250-
Var(
251-
_js_expr=f"{{...mergician({figure!s},"
252-
f"{','.join(str(md) for md in merge_dicts)})}}",
253-
),
248+
tag = tag.set(
249+
special_props=[
250+
*tag.special_props,
251+
# Merge all dictionaries and spread the result over props.
252+
Var(
253+
_js_expr=f"{{...mergician({figure!s},"
254+
f"{','.join(str(md) for md in merge_dicts)})}}",
255+
),
256+
]
254257
)
255258
else:
256-
# Spread the figure dict over props, nothing to merge.
257-
tag.special_props.append(Var(_js_expr=f"{figure!s}"))
259+
tag = tag.set(
260+
special_props=[
261+
*tag.special_props,
262+
# Spread the figure dict over props, nothing to merge.
263+
Var(_js_expr=str(figure)),
264+
]
265+
)
258266
return tag
259267

260268

0 commit comments

Comments
 (0)