Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 813dbbb

Browse filesBrowse files
committed
make iplot() work in http://cloud.sagemath.com
1 parent eefa824 commit 813dbbb
Copy full SHA for 813dbbb

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

‎plotly/plotly.py

Copy file name to clipboardExpand all lines: plotly/plotly.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ def iplot(self, *args, **kwargs):
4141
res = self.__callplot(*args, **kwargs)
4242
width = kwargs.get('width', 600)
4343
height = kwargs.get('height', 600)
44-
s = '<iframe height="'+str(height+50)+'" id="igraph" scrolling="no" seamless="seamless" src="'+res['url']+'/'+str(width)+'/'+str(height)+'" width="'+str(width+50)+'"></iframe>'
44+
s = '<iframe height="%s" id="igraph" scrolling="no" seamless="seamless" src="%s" width="%s"></iframe>' %\
45+
(height+50, "/".join(map(str, [res['url'], width, height])), width+50)
46+
try:
47+
# see, if we are in the SageMath Cloud
48+
from sage_salvus import html
49+
return html(s, hide=False)
50+
except:
51+
pass
4552
try:
4653
from IPython.display import HTML
4754
return HTML(s)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.