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

Skip to content

Commit d3e400c

Browse files
committed
updated graph_widgets.py
1 parent 3153237 commit d3e400c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plotly/widgets/graph_widget.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99

1010

1111
# TODO: protected imports?
12-
import ipywidgets as widgets
13-
from traitlets import Unicode
12+
import Ipython
1413
from IPython.display import Javascript, display
1514

1615
import plotly.plotly.plotly as py
1716
from plotly import utils, tools
1817
from plotly.graph_objs import Figure
1918

19+
if Ipython.version_info[0] > 3:
20+
import ipywidgets as widgets
21+
from traitlets import Unicode
22+
else:
23+
import IPython.widgets as widgets
24+
from IPython.trailets import Unicode
25+
2026
# Load JS widget code
2127
# No officially recommended way to do this in any other way
2228
# http://mail.scipy.org/pipermail/ipython-dev/2014-April/013835.html

0 commit comments

Comments
 (0)