4 ms·
I added jupyter notebook support to my nsi[1] crate via evcxr. It allows you to do a 3D (offline) render with 3Delight (on AWS, if you want) – directly into a
by virtualritz 6y ago
I added jupyter notebook support to my nsi[1] crate via evcxr.
It allows you to do a 3D (offline) render with 3Delight (on AWS, if you want) – directly into a notebook.
Here is an example notebook[2].
I haven't managed to update the image dynamically while it's rendering (there's no support for that in evcxr). If anyone knows how to do this, I'd be keen to add that too.
[1] https://crates.io/crates/nsi https://crates.io/crates/nsi
[2] https://github.com/virtualritz/nsi/blob/master/examples/jupyter/jupyter.ipynb https://github.com/virtualritz/nsi/blob/master/examples/jupy...
- sitkack 6y agoAre you talking about streaming data from a thread on the backend to say a canvas or image element in the browser? If you streaming in blocks on the server side and compositing them into a final render, in this case there are a couple hacks. 1) just use a timer and reload the image every x seconds 2) do a hanging read on and endpoint, return updated image. This has the nice quality of the server being able to decide the framerate.
- virtualritz 6y agoYes, I am streaming buckets/blocks. That would be both on the evcxr side, right? I was wondering if sending it as an MNG with loop=1 would work.
- sitkack 6y agoRich display handles sending html/svg/etc back to the UI layer. https://ipython.readthedocs.io/en/stable/config/integrating.html#rich-display https://ipython.readthedocs.io/en/stable/config/integrating.... You might be able to do everything in there with a little JS.