K3D-tools / K3D-jupyter

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy for use as stand alone package like matplotlib, but also to allow interoperation with existing libraries as VTK.
MIT License
921 stars 123 forks source link

Best practice for adding a js callback feature #331

Closed syoels closed 2 years ago

syoels commented 2 years ago

Hi K3D Folks! I was wondering how can one add a JS callback to K3D. I noticed that when working from Jupyter lab, the k3d js code isn't taken directly from the repository but rather downloaded and obfuscated via the widgets framework.

If I want to add a js callback, and write it by myself as a merge-request, How would I go about doing that? How can I make sure that jupyter serves the modified js code written by me, and not some SVN hosted latest version?

Thanks a lot in advance!

artur-trzesiok commented 2 years ago

Hi @syoels!

That depends on what that callback will do. If callbacks are independence from jupyter lab you can use:

cd js
npm i
grunt serve

that will open k3d standalone widget with livereload

artur-trzesiok commented 2 years ago

@syoels any news? :)