I have some code with WGLMakie and Bonito for interactive visualisations. This used to work with Jupyter, but now any plot or figure shows nothing. The same code works fine with CairoMakie
, GLMakie
, or with WGLMakie
inside VSCode or Pluto. The problem seems to be Jupyter (tried jupyter notebook and jupyter lab, both fail).
Here’s a minimal working example:
using WGLMakie
scatter(1:4, color=1:4)
It just shows empty space in Jupyter. I’ve tried with multiple options that made it work previously:
Page(listen_url="localhost")
WGLMakie.activate!()
But it still does not work.
For Bonito
, I tried following the documentation for deployment, but the “hello world” example also fails to display:
using JSServe
example_app = App(DOM.div("hello world"), title="hello world")
Jupyter lab displays:
App(JSServe.var"#12#18"{Hyperscript.Node{Hyperscript.HTMLSVG}}(<div>hello world</div>), Base.RefValue{Union{Nothing, Session}}(nothing), "hello world", false)
I am teaching a course this fall that makes heavy use of Jupyter. Most of the time, I can get away with static plots with CairoMakie
, but in a few cases I really need interaction. Does anyone have recommendations on how to do this with Julia packages? Students will mostly run it from Windows and Mac laptops, so ideally something that runs on a wide variety of machines with as little installation effort as possible.
Ideally, a static HTML+JS would be ideal (no need to change source code for interactive plots). I’ve tried the example plot from the docs (under Execute Javascript directly), but although a plot was produced, it did not change when moving the sliders.
I am using Julia 1.11.5, Makie 0.24.2, WGLMakie 0.13.2, Bonito 4.0.9, and Jupyter lab 4.4.4.