MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.38k stars 302 forks source link

2D plots are not interactive in Jupyter notebooks #2687

Closed EdsterG closed 1 month ago

EdsterG commented 1 year ago

The 2D plots aren't interactive, nor are the widgets. The 3D plots do work and are interactive. How do I make the 2D plots interactive? Is this just a configuration setting I missed?

asinghvi17 commented 1 year ago

Is this using WGLMakie? If so, only the most recent plot is interactive AFAIK. It should theoretically be possible to have all plots be interactive during a Julia session though. CC @SimonDanisch

SimonDanisch commented 1 year ago

Is this running on a headless server?

EdsterG commented 1 year ago

Yes, this is running on a headless server.

SimonDanisch commented 1 year ago

Then I think the proxy configuration isn't setup correctly and WGLMakie can't connect to the julia process. If you can share more about your setup, we can likely help.

EdsterG commented 1 month ago

What information would be helpful for you?

EdsterG commented 1 month ago

Ok, I figured out how to make 2D plots work. I needed to forward the local Bonito port to the remote machine. ssh -L 7778:localhost:7778 ... and run Page(listen_url="localhost", listen_port=7778) in the notebook.

So the following snippet now works and gives me an interactive 2D plot:

using WGLMakie, Bonito

Page(listen_url="localhost", listen_port=7778)
scatter(1:4, color=1:4)

However, right after the plot is displayed I get the following error log:

An exception was thrown in JS: TypeError: canvas.getContext is not a function
Additional message: error initializing scene
Stack trace:
    TypeError: canvas.getContext is not a function
        at threejs_module (data:application/javascript;base64,Ly8gZGV... Excessive output truncated after 590102 bytes.
EdsterG commented 1 month ago

The error log went away after upgrading to JupyterLab 4.2.4