Which library for a Monte Carlo web app?

Let me preface this by saying that I’m a Julia novice, and I have never done any web dev or serious plotting. So, a quick pointer to the right packages for my needs should suffice as an answer.

In a nutshell: I want to write a website that uses Julia to provide an interactive real-time simulation of the Ising model similar to this one done in Mathematica. What packages are best suited to this purpose?

Key features I would like: sliders and buttons that control parameters of the simulation, aesthetically pleasing graphics, and the ability to embed auxiliary graphs of various parameters of the simulation (all updated in real time). I’d also like the ability to do 3D graphics, in order to simulate the 3D Ising model.

Some Googling suggests that Makie for visualization and Genie for the web stuff is one solution. Is it the best? It seems that maybe generating javascript directly with something like VegaLite.jl might be easier, but that this comes at the cost of less control/power for the visuals.

I see that InteractiveDynamics.jl has an interactive orbit diagram using Makie that’s pretty close to what I’m looking for (though not real-time): https://juliadynamics.github.io/InteractiveDynamics.jl/dev/od/.

Any advice is greatly appreciated.

If this is just for yourself to run locally, you could make a Pluto notebook and use the PlutoUI package for the interface.

If you want to make something that be more easily accessed by someone over the internet, you can look at dashboard packages like Dash.jl and Stipple.jl. Dash relies on Plotly’s tools, while Stipple is uses the Genie framework.

1 Like

You can also use Pluto in non-local environments:

which is used for example in this class:
https://computationalthinking.mit.edu/Spring21/simulating_component_failure/

it is even getting a serverless version soon:

Thanks for the replies.

Pluto is not really suitable for my needs, since I don’t want to expose the underlying code, only the widget. (Not that I’m trying to hide anything, just that it’s messy.)

Indeed, I’m trying to make something that could be hosted online. Do Dash or Stipple have any particular advantages relative to Mackie? Are they capable of visualizing real-time simulations? All the examples I could find looked like static graphs that were updated in response to user input.

I think you should be able to make animations in plotly, which means you should be able to embed animations of a simulation in either Dash.jl or Stipple (via the StipplePlotly package)

It looks like there might be a way to create a web page using the WGLMakie package, but that looks like it would involve more JavaScript know-how.

http://juliaplots.org/WGLMakie.jl/stable/