File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 8
8
from IPython .display import Javascript , display
9
9
10
10
from plotly import utils , tools
11
+ from plotly .graph_objs import Figure
11
12
from pkg_resources import resource_string
12
13
13
14
# Load JS widget code
@@ -249,10 +250,14 @@ def message_handler(widget, ranges):
249
250
def plot (self , figure_or_data , validate = True ):
250
251
"""Plot figure_or_data in the Plotly graph.
251
252
"""
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 )
253
258
message = {
254
259
'task' : 'newPlot' ,
255
- 'data' : figure [ 'data' ] ,
260
+ 'data' : figure . get ( 'data' , []) ,
256
261
'layout' : figure .get ('layout' , {}),
257
262
'graphId' : self ._graphId
258
263
}
You can’t perform that action at this time.
0 commit comments