K3D-jupyter
K3D-jupyter copied to clipboard
Controls -> Mode -> Manipulate doesn't work and shows a crash in the console log
Using JupyterLab and the latest Google Chrome, I ran this:
import k3d
from k3d.platonic import Icosahedron
plot = k3d.plot(camera_auto_fit=False)
plot += Icosahedron().mesh
plot.display()
Then in the menu on the right, I selected "Controls -> Mode -> Manipulate ", and nothing appears to happen.
In the console.log, I see this:

This probably isn't much of a bug to most K3D users, since it is just a silent failure of a presumably undocumented mysterious menu option. I hit this when porting the extension to https://CoCalc.com, where we surface all uncaught exceptions in the console to users, and automate creating a support ticket from them. Thus for me this is a slightly more serious issue.
One fix would be to remove the menu item. The K3D documentation doesn't contain the word "manipulate" once, so the only way for a user to guess even know what this does would be to read the source code...
Manipulate is a feature in k3d but probably not well tested - that I didn't put it to documentation. I will look at this.
I updated TransformControls to recent version from three.js. It is working.
Please download new version of [email protected]:
- https://pypi.org/project/k3d/
- https://anaconda.org/conda-forge/k3d
It should be there :)
@artur-trzesiok thanks! I can confirm that you've fixed the bug and manipulate now works.
I'm working on integrated k3d directly into cocalc.com so it is available to all of our users. We install the k3d pypi library on our standard backend image and the k3d npmjs.com package on the frontend (it then gets built as a chunk by webpack that is loaded on demand). I updated cocalc to use the newest k3d npm package, and immediately the Manipulate functionality started working.
Regarding architecture, I ended up rewriting the ipywidgets integration part of k3d, mainly because Cocalc has its own implementation of widgets with full realtime collaboration support, as explained here, and I needed to make some small tweaks to ensure everything works (e.g., especially to how serialize works). I've put the relevant code here, along with I hope a clear statement regarding code attribution: https://github.com/sagemathinc/cocalc/tree/master/src/packages/frontend/jupyter/widgets/k3d