File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 88from IPython .display import Javascript , display
99
1010from plotly import utils , tools
11+ from plotly .graph_objs import Figure
1112from pkg_resources import resource_string
1213
1314# Load JS widget code
@@ -249,10 +250,14 @@ def message_handler(widget, ranges):
249250 def plot (self , figure_or_data , validate = True ):
250251 """Plot figure_or_data in the Plotly graph.
251252 """
252- figure = tools .return_figure_from_figure_or_data (figure_or_data , validate )
253+ if figure_or_data == {} or figure_or_data == Figure ():
254+ validate = False
255+
256+ figure = tools .return_figure_from_figure_or_data (figure_or_data ,
257+ validate )
253258 message = {
254259 'task' : 'newPlot' ,
255- 'data' : figure [ 'data' ] ,
260+ 'data' : figure . get ( 'data' , []) ,
256261 'layout' : figure .get ('layout' , {}),
257262 'graphId' : self ._graphId
258263 }
You can’t perform that action at this time.
0 commit comments