Closed rohitvarkey closed 5 years ago
Why can't you just emit the HTML directly into the notebook, e.g. with display("text/html", ".....")
?
@stevengj the problem is importing the same web component declaration twice is a fatal error. So if you restart the kernel and run using Compose3D
again (which loads the dependency through display(...)), your notebook won't work.
This is also one of the reasons stopping Escher from being used inside IJulia.
@shashi, maybe IJulia should export a display_once
function or similar to import web components? Oh, no, that won't work if you restart the kernel.
It seems like this is something that you should report upstream to Jupyter.
Opened an issue on the jupyter notebook repo https://github.com/jupyter/notebook/issues/319
Oh, also, there is another problem I forgot about which Rohit mentions above:
If you are using HTML imports, a file x.html can import y.html so reading in x.html using display
will not be sufficient (it will lead to a 404 when it tries to load y.html). One could use a tool to concatenate all of them together though but that is not so ideal when you want to import things as you need them interactively. It would be nice to have them served from disk and loaded as and when required by display
ing some Javascript for it.
I think a proper solution to this would involve some way for notebook code to register a directory to be served in a static URL location - again this seems like a feature that Jupyter will need to make possible.
Closing as a Jupyter/notebook issue, not IJulia.
Hi,
I've been working on Compose3D and I've kind of run into a roadblock that I'd like your advice on.
The ThreeJS-WebGL backend that I'm using for Compose3D emits custom web component tags that are then use to draw the 3D images. For this to work, I need to do a HTML import and as a result I need to be serving the static files somewhere.
I wrote a build script that would just copy the files to
profile_julia/static/components/compose3d/
and this works pretty okay when the user was doingipython notebook --profile=julia
.But now that just
ipython notebook
works, should I copy the files to the default profile? This doesn't work on places like JuliaBox, where a different profile is used by default. Should I have to copy the files to every profile or is there a better way of handling this?Thanks, Rohit.