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

Skip to content

Commit 0c70300

Browse files
committed
Un-protect the graph_objs imports.
1 parent 81fd207 commit 0c70300

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

plotly/graph_objs/figure_factory.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from collections import OrderedDict
77

88
from plotly import exceptions
9+
from plotly.graph_objs import graph_objs
910
from plotly.tools import (_numpy_imported, _scipy_imported,
1011
_scipy__spatial_imported,
1112
_scipy__cluster__hierarchy_imported)
@@ -274,8 +275,6 @@ def create_quiver(x, y, u, v, scale=.1, arrow_scale=.3,
274275
py.plot(fig, filename='quiver')
275276
```
276277
"""
277-
# TODO: protected until #282
278-
from plotly.graph_objs import graph_objs
279278
FigureFactory._validate_equal_length(x, y, u, v)
280279
FigureFactory._validate_positive_scalars(arrow_scale=arrow_scale,
281280
scale=scale)
@@ -377,8 +376,6 @@ def create_streamline(x, y, u, v,
377376
py.plot(fig, filename='streamline')
378377
```
379378
"""
380-
# TODO: protected until #282
381-
from plotly.graph_objs import graph_objs
382379
FigureFactory._validate_equal_length(x, y)
383380
FigureFactory._validate_equal_length(u, v)
384381
FigureFactory._validate_streamline(x, y)
@@ -605,8 +602,6 @@ def create_ohlc(open, high, low, close,
605602
py.iplot(fig, filename='finance/simple-ohlc', validate=False)
606603
```
607604
"""
608-
# TODO: protected until #282
609-
from plotly.graph_objs import graph_objs
610605
if dates is not None:
611606
FigureFactory._validate_equal_length(open, high, low, close, dates)
612607
else:
@@ -837,8 +832,6 @@ def create_candlestick(open, high, low, close,
837832
py.iplot(fig, filename='finance/simple-candlestick', validate=False)
838833
```
839834
"""
840-
# TODO: protected until #282
841-
from plotly.graph_objs import graph_objs
842835
if dates is not None:
843836
FigureFactory._validate_equal_length(open, high, low, close, dates)
844837
else:
@@ -982,8 +975,6 @@ def create_distplot(hist_data, group_labels,
982975
validate=False)
983976
```
984977
"""
985-
# TODO: protected until #282
986-
from plotly.graph_objs import graph_objs
987978
FigureFactory._validate_distplot(hist_data, curve_type)
988979
FigureFactory._validate_equal_length(hist_data, group_labels)
989980

@@ -1831,8 +1822,6 @@ class _Dendrogram(FigureFactory):
18311822

18321823
def __init__(self, X, orientation='bottom', labels=None, colorscale=None,
18331824
width="100%", height="100%", xaxis='xaxis', yaxis='yaxis'):
1834-
# TODO: protected until #282
1835-
from plotly.graph_objs import graph_objs
18361825
self.orientation = orientation
18371826
self.labels = labels
18381827
self.xaxis = xaxis
@@ -1979,8 +1968,6 @@ def get_dendrogram_traces(self, X, colorscale):
19791968
(e) P['leaves']: left-to-right traversal of the leaves
19801969
19811970
"""
1982-
# TODO: protected until #282
1983-
from plotly.graph_objs import graph_objs
19841971
d = scs.distance.pdist(X)
19851972
Z = sch.linkage(d, method='complete')
19861973
P = sch.dendrogram(Z, orientation=self.orientation,
@@ -1993,7 +1980,6 @@ def get_dendrogram_traces(self, X, colorscale):
19931980
colors = self.get_color_dict(colorscale)
19941981

19951982
trace_list = []
1996-
19971983
for i in range(len(icoord)):
19981984
# xs and ys are arrays of 4 points that make up the '∩' shapes
19991985
# of the dendrogram tree

0 commit comments

Comments
 (0)