GithubHelp home page GithubHelp logo

Comments (5)

martinal avatar martinal commented on September 4, 2024

Doing a detach fixes the plot, and after reattach the plot is fine in the notebook too.

from k3d-jupyter.

martinal avatar martinal commented on September 4, 2024

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.

artur-trzesiok avatar artur-trzesiok commented on September 4, 2024

It's very probably that in the latest version problem is solved. @martinal could you try to reproduce the issue ?

from k3d-jupyter.

martinal avatar martinal commented on September 4, 2024

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.
k3d-context-loss

from k3d-jupyter.

vidartf avatar vidartf commented on September 4, 2024

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:

from k3d-jupyter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.