File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,8 @@ def __repr__(self):
28
28
else :
29
29
return 'Lightning server at host: %s' % self .host
30
30
31
-
32
31
def get_ipython_markup_link (self ):
33
- return '%s/js/ipython-comm.js' % (self .host )
34
-
32
+ return '%s/js/ipython-comm.js' % self .host
35
33
36
34
def enable_ipython (self , ** kwargs ):
37
35
"""
@@ -46,18 +44,16 @@ def enable_ipython(self, **kwargs):
46
44
# https://github.com/jakevdp/mpld3/blob/master/mpld3/_display.py#L357
47
45
48
46
from IPython .core .getipython import get_ipython
49
- from IPython .display import display , HTML
47
+ from IPython .display import display , Javascript
50
48
51
49
self .ipython_enabled = True
52
50
ip = get_ipython ()
53
51
formatter = ip .display_formatter .formatters ['text/html' ]
54
52
formatter .for_type (Visualization , lambda viz , kwds = kwargs : viz .get_html ())
55
53
56
54
r = requests .get (self .get_ipython_markup_link (), auth = self .auth )
57
- ipython_comm_markup = '<script>' + r .text + '</script>'
58
-
59
- display (HTML (ipython_comm_markup ))
60
55
56
+ display (Javascript (r .text ))
61
57
62
58
def disable_ipython (self ):
63
59
"""
You can’t perform that action at this time.
0 commit comments