Deploying an interactive WGLMakie.jl example on the internet

I have a simple code (see OptimalFlightPaths.jl) that displays a plot with some sliders, and you can change the plot using the sliders. How can I display this on the internet in a safe way?

1 Like

I’d go for a containerized Bonito deploy!
See: Deployment · Bonito
The exact server setup isn’t explained, since that really depends on where you’re hosting!

So you suggest to get a virtual server, an SSL certificate and then install Bonito and WGLMakie ?

Can such an interactive example be embedded in a Documenter.jl docu that is hosted on GitHub?

Are there any examples for publicly reachable web sites that use WGLMakie in an interactive way?

You don’t necessarily need an ssh certificate, that’s often handled behind the scene by your server provider. The only real constraint is that you need a sever that can run Julia to get the full interactivity. Besides that it’s like setting up any other server to host a website.
The bonito docs have WGLMakie plots included in the plot section, but only LScene keeps an interactive camera, since that has a JavaScript fallback - any other plot will stay static unless you implement interactions explicitly in JavaScript like it’s explained in the WGLMakie docs WGLMakie | Makie (sadly the outputs are currently broken since the switch to vite press. But in documenter it still works this way).

Another static example is www.makie.org, which uses only Bonito.

JuliaHub should also quite easily support hosting bonito apps, but I would need to look into how that would work exactly.

1 Like

I am also quite interested in getting an interactive version of a Bonito/WGLMakie scene into an html version, ideally static.

I tried the example you mention with the interactions explicitly in JS, but sadly did not manage to get it working on a static version (sliders and plots were there, but changing them didn’t update the plot). What I did was essentially adapting the other example about export in the documentation, so that the App loop was enclosed as:

Page(exportable=true, offline=true)

# App loop

show(io, MIME"text/html"(), app)  # save to static html

I’ve seen other examples making use of JSServe.record_states, but I read your reply to an earlier question that this is essentially dead.

Are there any recent examples on how to use WGLMakie and Bonito to produce some static html (even at the expense at recording all possible states)? Or if not completely static, maybe an example on how to embed it on Documenter.jl?