-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: offline=True kwarg in embed_html was failing to save dependency jupyter-threejs.js #198
base: master
Are you sure you want to change the base?
BUGFIX: offline=True kwarg in embed_html was failing to save dependency jupyter-threejs.js #198
Conversation
…lume in a html file.
…saving functions - currently all require you to be online when you save to html.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, indeed, this was missing. I need to talk to @vidartf about how to get the right threejs version, so I'll get back to you. Many thanks already!
ipyvolume/_version.py
Outdated
__version_threejs__ = '2.0.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
threejs is at version 98 btw: https://threejs.org/
pythreejs is what you meant, I know, it is confusing.
I'll talk with @vidartf about it, how we can get the right threejs version that matches the pythreejs one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I've updated the variable name to be clearer: __version_pythreejs__
. The actual __version_threejs__
never got used (the master branch has some stuff commented out) so I haven't included that in _version.py
Yes, it would be good to know what you and @vidartf decide is the best way to keep threejs/pythreejs in sync.
As it is now, threejs is embeded in jupyter-threejs's embed.js, although it shouldn't, and it is actually configured using require's path in https://github.com/jupyter-widgets/pythreejs/blob/master/js/src/embed.js @GenevieveBuckley it might be that the PR as it is now is working, can you confirm that? ipyvolume and jupyter-threejs have their own version of threejs, which is non-ideal, but if it works, it works. |
Yes, I can confirm that it works for these circumstances: python version 3.6.6 I tested using this code while connected to the internet (writing to file won't work if you're not connected): import numpy as np
import ipyvolume as ipv
y = np.random.randn(1000)
x = np.random.randn(1000)
z = np.random.randn(1000)
fig = ipv.figure()
ipv.scatter(x, y, z)
ipv.embed.embed_html('offline_test.html', fig, offline=True, devmode=True) Once offline, reading the file is successful across all browsers I have available:
|
e861e87
to
6dead3f
Compare
This PR adds a function
save_jupyterthreejs
toembed.py
to download and save thejupyter-threejs.js
dependency required for offline viewing of ipyvolume html files.Closes #192