瀏覽代碼

allow for 'go.Figure | None' annotation in State (#4426)

Thomas Brandého 5 月之前
父節點
當前提交
51ca89bc5c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      reflex/components/plotly/plotly.py

+ 1 - 1
reflex/components/plotly/plotly.py

@@ -255,7 +255,7 @@ const extractPoints = (points) => {
 
     def _render(self):
         tag = super()._render()
-        figure = self.data.to(dict)
+        figure = self.data.to(dict) if self.data is not None else {}
         merge_dicts = []  # Data will be merged and spread from these dict Vars
         if self.layout is not None:
             # Why is this not a literal dict? Great question... it didn't work