Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How could one integrate k3d with pyviz panels? #447

Open
ea42gh opened this issue Jan 29, 2024 · 1 comment
Open

How could one integrate k3d with pyviz panels? #447

ea42gh opened this issue Jan 29, 2024 · 1 comment

Comments

@ea42gh
Copy link

ea42gh commented Jan 29, 2024

Description

panel used to have a pane that would display k3d plots.
That pane is no longer available due to code refactoring.

I suspect using one of the current panes might work easily,
but do not know how to integrate the two?

@ichko
Copy link

ichko commented Mar 12, 2024

Hey, I also stumbled upon this issue.

Minimal code example to reproduce in a notebook environment:

import k3d
plot = k3d.Plot()
plot += k3d.points([0, 0, 0])

pn.Column("a", pn.panel(plot), "b")

and the generated plot is empty.

Going to the console you get this error message:

TypeError: world.cleanup is not a function
    at K3D.disable (Core.js:1217:1)
    at refresh (Canvas.js:211:1)
    at module.exports (Canvas.js:281:1)
    at new K3D (Core.js:1234:1)
    at PlotView._init (k3d.js:323:1)
    at f (backbone.js:335:57)
    at g (backbone.js:322:19)
    at d (backbone.js:110:16)
    at a.trigger (backbone.js:312:5)
    at r.render (panel.min.js:120:1118)

and this comes from a part of the code responsible for k3d teardown... maybe..
image

going up a stack frame:

image

It is interesting that the error occurs whilst teardown, which I suppose is not what we want while trying to show a plot.

There is also an unresolved discussion about this in the holoviz forum - https://discourse.holoviz.org/t/panel-meets-k3d-jupyter/1604/17

I would love to be able to show a k3d plot in a panel application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants