Comments (5)
Doing a detach fixes the plot, and after reattach the plot is fine in the notebook too.
from k3d-jupyter.
There's a (huge) branch of pythreejs which contains (besides basically a full rewrite) an approach to dealing with context loss, see this code:
jupyter-widgets/pythreejs@738f719#diff-2f0672887a2753687848ddc32e14306a
from k3d-jupyter.
It's very probably that in the latest version problem is solved. @martinal could you try to reproduce the issue ?
from k3d-jupyter.
Issue is still there. To reproduce, create a new notebook, first cell:
import k3d
then N cells just displaying a plot each (for me N=17 triggered context loss):
k3d.plot()
Then when the browser console shows
WARNING: Too many active WebGL contexts. Oldest context will be lost.
scroll up to the top and the first plot looks like the attached picture.
from k3d-jupyter.
The pythreeJS solution to this is to keep N canvases around for rendering. Anything that tries to render something requests one of these, also supplying a callback for when it has to give it up. When it has to give it up, it replaces the canvas element with a PNG image of the last drawn frame.
Links to the latest code:
- The canvas manager is here: https://github.com/vidartf/pythreejs/blob/8c38c276bc4822e2f1dbb921ffd1ebc0b0a40d64/js/src/_base/RendererPool.js
- The code line to replace the current canvas with an image is here: https://github.com/vidartf/pythreejs/blob/23cad6ebdf297c4a58b888d54674b040814eb97d/js/src/_base/Renderable.js#L165
from k3d-jupyter.
Related Issues (20)
- Any way to constrain the width of a plot? HOT 4
- Is there a way to include mutliple colour arrays for Points (or any other) drawables? HOT 3
- compatibility with jlab4 ? HOT 2
- "Uncaught ReferenceError: intersect is not defined" when using Callback function (k3d>=2.15.3) HOT 6
- How to add label and ticklabel for colorbar in Points? HOT 2
- demo for OffScreen rendering? HOT 5
- Does k3d-jupyter support to render a time series of 3D volume? HOT 4
- removing a plot does not update the kpanel HOT 1
- 'Turntable' option for camera_mode? HOT 1
- How could one integrate k3d with pyviz panels? HOT 1
- Expose material property 'shininess' for objects
- Website is down HOT 2
- Snapshot HTML produces invalid html file with Jupyter Notebook version 7
- dict-based animations won't update when headless
- Missing part on 3D plot HOT 4
- voxel alignment should be user-controllable HOT 2
- Text elements should not be selectable while manipulating the plot HOT 1
- Issue with TransferFunctionModel Instantiation HOT 4
- Widget crashes when updating voxels multiple times HOT 1
- Possible improvements related to animations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k3d-jupyter.