Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b4542b

Browse files
committed
update docstrings to GraphWidget
1 parent d6a00d7 commit 9b4542b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

plotly/widgets/graph_widget.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class GraphWidget(widgets.DOMWidget):
3131
_message = Unicode(sync=True)
3232
_graph_url = Unicode(sync=True)
3333

34-
def __init__(self, graph_url, **kwargs):
34+
# TODO: URL for offline enterprise
35+
def __init__(self, graph_url='https://plot.ly/~playground/7', **kwargs):
3536
"""Initialize a plotly graph widget
3637
3738
Args:
@@ -147,7 +148,7 @@ def message_handler(widget, msg):
147148
display(widget._graph_url)
148149
display(msg)
149150
150-
g = Graph('https://plot.ly/~chris/3375')
151+
g = GraphWidget('https://plot.ly/~chris/3375')
151152
display(g)
152153
153154
g.on_click(message_handler)
@@ -195,7 +196,7 @@ def message_handler(widget, hover_msg):
195196
display(widget._graph_url)
196197
display(hover_msg)
197198
198-
g = Graph('https://plot.ly/~chris/3375')
199+
g = GraphWidget('https://plot.ly/~chris/3375')
199200
display(g)
200201
201202
g.on_hover(message_handler)
@@ -239,7 +240,7 @@ def message_handler(widget, ranges):
239240
display(widget._graph_url)
240241
display(ranges)
241242
242-
g = Graph('https://plot.ly/~chris/3375')
243+
g = GraphWidget('https://plot.ly/~chris/3375')
243244
display(g)
244245
245246
g.on_zoom(message_handler)
@@ -288,7 +289,7 @@ def restyle(self, data, indices=None):
288289
from plotly.widgets import Graph
289290
from IPython.display import display
290291
291-
graph = Graph('https://plot.ly/~chris/3979')
292+
graph = GraphWidget('https://plot.ly/~chris/3979')
292293
display(graph)
293294
```
294295
@@ -377,7 +378,7 @@ def relayout(self, layout):
377378
from plotly.widgets import Graph
378379
from IPython.display import display
379380
380-
graph = Graph('https://plot.ly/~chris/3979')
381+
graph = GraphWidget('https://plot.ly/~chris/3979')
381382
display(graph)
382383
```
383384
@@ -460,7 +461,7 @@ def hover(self, *hover_objs):
460461
from plotly.widgets import Graph
461462
from IPython.display import display
462463
463-
graph = Graph('https://plot.ly/~chris/3979')
464+
graph = GraphWidget('https://plot.ly/~chris/3979')
464465
display(graph)
465466
```
466467
@@ -509,7 +510,7 @@ def add_traces(self, traces, new_indices=None):
509510
from plotly.graph_objs import Scatter
510511
from IPython.display import display
511512
512-
graph = Graph('https://plot.ly/~chris/3979')
513+
graph = GraphWidget('https://plot.ly/~chris/3979')
513514
display(graph)
514515
```
515516
@@ -553,7 +554,7 @@ def delete_traces(self, indices):
553554
from plotly.widgets import Graph
554555
from IPython.display import display
555556
556-
graph = Graph('https://plot.ly/~chris/3979')
557+
graph = GraphWidget('https://plot.ly/~chris/3979')
557558
display(graph)
558559
559560

0 commit comments

Comments
 (0)