Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Little fixes to threejs scripts handling
Browse files Browse the repository at this point in the history
  • Loading branch information
novoselt committed Apr 3, 2017
1 parent e81038e commit 8d1b155
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/sage/plot/plot3d/base.pyx
Expand Up @@ -419,9 +419,9 @@ cdef class Graphics3d(SageObject):
html = f.read()

html = html.replace('SAGE_SCRIPTS', scripts)
options = dict((key, options[key]) for key in
js_options = dict((key, options[key]) for key in
['aspect_ratio', 'axes', 'axes_labels', 'decimals', 'frame'])
html = html.replace('SAGE_OPTIONS', json.dumps(options))
html = html.replace('SAGE_OPTIONS', json.dumps(js_options))
html = html.replace('SAGE_BOUNDS', bounds)
html = html.replace('SAGE_LIGHTS', lights)
html = html.replace('SAGE_AMBIENT', ambient)
Expand Down
4 changes: 2 additions & 2 deletions src/sage/repl/rich_output/backend_ipython.py
Expand Up @@ -588,7 +588,7 @@ def threejs_offline_scripts(self):
sage: from sage.repl.rich_output.backend_ipython import BackendIPythonNotebook
sage: backend = BackendIPythonNotebook()
sage: backend.threejs_offline_scripts()
'\n<script src="/nbextensions/threejs/three.min.js"></script>...'
'\n<script src="/nbextensions/threejs/three.min...<\\/script>...'
"""
from sage.repl.rich_output import get_display_manager
CDN_scripts = get_display_manager().threejs_scripts(online=True)
Expand All @@ -598,4 +598,4 @@ def threejs_offline_scripts(self):
<script>
if ( !window.THREE ) document.write('{}');
</script>
""".format(CDN_scripts)
""".format(CDN_scripts.replace('</script>', r'<\/script>'))
4 changes: 2 additions & 2 deletions src/sage/repl/rich_output/display_manager.py
Expand Up @@ -715,7 +715,7 @@ def graphics_from_save(self, save_function, save_kwds,

def threejs_scripts(self, online):
"""
Return three.js script tags for the current backend.
Return Three.js script tags for the current backend.
INPUT:
Expand All @@ -728,7 +728,7 @@ def threejs_scripts(self, online):
.. NOTE::
This base method handles ``online=True`` case only, serving CDN
script tags. Location of scripts for off-line usage is
script tags. Location of scripts for offline usage is
backend-specific.
EXAMPLES::
Expand Down

0 comments on commit 8d1b155

Please sign in to comment.