Skip to content

Commit 415f8b5

Browse files
committed
Better fix for plotly_domain. (more)
Now each `graph` remembers the domain it was created with.
1 parent 695dd28 commit 415f8b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plotly/widgets/graph_widget.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class Graph(widgets.DOMWidget):
1818
_view_name = Unicode('GraphView', sync=True)
1919
_message = Unicode(sync=True)
2020
_graph_url = Unicode(sync=True)
21+
plotly_domain = Unicode(
22+
sync=True, default_value=plotly.plotly.get_config()['plotly_domain']
23+
)
2124

2225
def __init__(self, graph_url, **kwargs):
2326
"""Initialize a plotly graph object.
@@ -87,7 +90,7 @@ def _handle_registration(self, event_type, callback, remove):
8790
self._handle_outgoing_message(message)
8891

8992
def _handle_outgoing_message(self, message):
90-
message['plotlyDomain'] = plotly.plotly.get_config()['plotly_domain']
93+
message['plotlyDomain'] = self.plotly_domain
9194
if self._graphId == '':
9295
self._clientMessages.append(message)
9396
else:

0 commit comments

Comments
 (0)