I hope someone can provide guidance or point me to Jupyter documentation
that I can't seem to find. For Jupyter VPython (vpython.org;
github.com/BruceSherwood/vpython-jupyter), the Python module "vpython"
includes a jquery library and the WebGL 3D graphics library from GlowScript
VPython (glowscript.org).
There are "notebook.nbextensions.install_nbextension()" statements in the
Python portion of the vpython module to load the JavaScript files, and the
statement "display(Javascript("""require(["nbextensions/glowcomm"],
function(){console.log("glowcomm loaded");})"""))", where glowcomm.js is a
JavaScript program that calls the GlowScript graphics library. At the start
of glowcomm.js is this:
define(["nbextensions/jquery-ui.custom.min","nbextensions/glow.2.1.min"],
function() {
/*jslint plusplus: true */
I was unable to find any Jupyter documentation on this define operation --
perhaps it is related to requirejs?
As I described in a recent post, this structure has basically worked up
till now, but I'm now unable to use the latest GlowScript library that has
important new features, as the larger library often fails to load, as
though size is an issue (the size limit seems to be about 500 MB, if that
is indeed the problem). Moreover, I'm beginning to think that I'm not using
the right architecture, and I've been unable to find any documentation that
addresses my kind of application.
Specifically, nbextensions seem aimed at modifying the behavior of the
notebook, and are apparently thought of as modules one installs that apply
to all notebook operations. But in the vpython module the JavaScript files
are an essential component of vpython, not an extension to alter notebook
behavior. Moreover, the new GlowScript features I want to exploit include
not only require a larger GlowScript library but also some data files used
by this library, including font files used for producing 3D text, files
that the GlowScript library expects to find in a neighboring folder, not
the nbextensions folder.
Documentation on nbextensions seemed to imply that I could add a
specfication of nbextensions_dir, so that I could make JavaScript file stay
where it was rather than being copied to the standard nbextensions folder:
package_dir = os.path.dirname(__file__)
notebook.nbextensions.install_nbextension(path =
package_dir+"/data/jquery-ui.custom.min.js",
nbextensions_dir=package_dir+"/data/",
overwrite = True,verbose = 0)
However, this gives the following error, despite the fact that the
displayed file path and name is correct, and it removes the file (!), which
I can't find anywhere (which is presumably due to it having been removed):
FileNotFoundError: [Errno 2] No such file or directory:
'C:\\Anaconda3\\lib\\site-packages\\vpython/data/jquery-ui.custom.min.js'
I would be very grateful to be pointed to documentation I've missed, or to
a project like mine in which JavaScript files and data files to be read by
JavaScript can be used in place, in site-packages/vpython and its
subfolders. Thanks.
--
You received this message because you are subscribed to the Google Groups
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/891b5d00-721b-49dd-bde3-2ac25d877705%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.