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.
Currently, K3D listens for browser window resize events. This causes issues when the DOM element into which K3D renders is resized for some reason while the browser window does not change its size. In particular, this often seems to be the case when when a K3D plot is placed into an ipywidgets container. By using a ResizeObserver on the targetDOMNode, this issue is avoided.
Currently, K3D listens for browser window resize events. This causes issues when the DOM element into which K3D renders is resized for some reason while the browser window does not change its size. In particular, this often seems to be the case when when a K3D plot is placed into an ipywidgets container. By using a ResizeObserver on the
targetDOMNode
, this issue is avoided.For example, on k3d-2.15.3 with
I see the following issue:
With the proposed changes, the plot is correctly displayed.