Current, Maintained interactive Julia gui system? (mid 2024)

I am working with a collaborator on a statistical model. Part of the process at the moment is to find an initial condition for optimization or sampling. The model is complicated but there are a number of plots that we can make which make it clear how well we’re fitting certain aspects of the model.

I created a gui with Interact.jl which let you adjust parameters and then see the updated plots interactively, but immediately hit the problem that more recent versions of Jupyterlab don’t show the sliders… Last version of Jupyterlab that worked was released like May 2023.

I asked on Discourse if there was any resolution how to deal with this Slider does not show after upgrade Jupyter - #4 by dlakelan

but got no response, which makes me think maybe Interact.jl etc are abandoned? There have been no releases for almost 2 years:

image

So what is the status of Interact.jl and/or what other interactive systems are in active development for Julia?

I’m aware of GenieBuilder, but I use VSCodium to avoid microsoft telemetry etc and the plugin in that ecosystem is way out of date… 0.4.12 from 12 months ago is the lastest available.

I’m not sure if that’s an oversight or because the Genie people don’t want to support codium for a relatively small group of codium users in a relatively small ecosystem of Julia programmers in the first place.

Anyway, any thoughts on interactive guis as of mid 2024 would be appreciated.

4 Likes

I know almost nothing about Interact nor any of its alternatives, but I happen to remember seeing a discourse post earlier this year recommending Bonito.jl as a full Interact replacement:

2 Likes

Great will take a look. Does it have a similar simple entry level like

@interact for I = 1:.01:2

#dostuff
end

?

In any case I will take a look and report back what I found.

Wow, no, Bonito seems cool, but is very definitely a library for web devs at some level. Like, the abstraction is an HTML document… with DIVs and CSS and WebSocketConnections and evaljs functions to force some javascript to run on the browser.

This seems like it’s extremely nice for someone who’s a web dev who wants to do stuff from Julia, but not really ideal for someone who’s a physicist or a demographer who wants to create sliders to investigate the effect of input variables on the output of a simulator or point cloud transform or something.

Although I’m sure I could learn enough about it to make a nice GUI with a couple tens of hours of reading examples and editing them, what I really want is a quick and dirty thing where I can make something in 5 minutes more like the

@interact for a = 1:0.1:2, b = 0:5:100
#..do some stuff
end

That is, I don’t care how it looks or how its laid out, I just want to manipulate some sliders and show a graph changing so that my collaborator can by-hand find some good starting points for an optimizer run.

Even an hour making the GUI is wasted time here because he could just type numbers in by hand for less than an hour and find a decent starting point.

Similarly, for teaching students about say math or physics, having them build a GUI for 2 hours is 2 hours they’re not learning math or physics and are probably frustrated, but if in 5 mins they can have sliders and checkboxes and then investigate the different options and see how the simulator behaves then they’re spending their time on the right component… the understanding and exploration of their topic of interest.

However, my guess is someone with sufficient web dev ability could build an @interact type macro on top of Bonita.jl pretty easily. I wonder if someone’s working on such a thing.

2 Likes
7 Likes

If you want sliders you could use a Pluto notebook

6 Likes

not sure what the current status is :thinking:

4 Likes

Bonito.jl is part of the underlying engine for WGLMakie.jl:

You could do something like this with PlutoUI.jl:

The technology on the horizon is doing this all with webassembly in the browser:

I guess the old thing that makes this difficult to answer directly might be Jupyter. I have not tried to do interactive sliders in Jupyter for years…

4 Likes

Any particular reason for not using Pluto?

2 Likes

Thanks all, the Makie and webgl and compiling to webassembly stuff all seems really interesting I’ll remember to look in on that through time.

For now I think Pluto is probably the way to go.

So I did in fact go with Pluto.jl and was able to convert my Jupyter notebook by copying and pasting most of the code. The UI was the part that required adjustment, but it was relatively easy after reading some examples. It helped that I tried out Pluto back in 2020 when it first came out and had seen some JuliaCon videos at some point.

Here’s a screenshot using simulated data, the game is “adjust the sliders until the points are a cloud around y=0 for all x and all colors (age groups)”

From this starting point then, we can start optimization and expect it to come to a reasonable and meaningful optimum without being stuck in some strange corner of parameter space (where for example the point cloud looks like a V around 0 instead of a flat blob but any adjustment to any parameter makes the fit worse so the optimizer is stuck).

Thanks again ! and thanks to @fonsp and friends for all the great work on Pluto.

18 Likes

Pluto is probably a better fit for what you’re doing, but another option would be CImGui.jl (disclaimer: I’m one of the maintainers).

7 Likes

I agree In my opinion Pluto is not the way to go. :sunglasses:

This GUI looks really cool! Your screenshot inspired me to make a new feature to PlutoUI! New macro `@bindname` to display variable name before bond by fonsp · Pull Request #305 · JuliaPluto/PlutoUI.jl · GitHub

3 Likes

For a UI to edit arbitrary objects in Pluto, simple or complex, check out PlutoTables.jl and examples in its docs.
Easy to specify parts to edit, and assign widgets to each:
image

Btw, you can use almost the same syntax to optimize parameter values with AccessibleOptimization.jl – just provide intervals instead of PlutoUI widgets.

3 Likes

Wow, love it. Now if only there were a way to get the value printed to a few sig figs on the right of the slider. Sometimes you want to see numerically where a behavioral transition occurs or where an otherwise special value is.

1 Like

I don’t think you can specifically control the number of significant digits displayed, but if you call the Slider with show_value = true as kwarg (and have floating point values) they do show with full precision:
image

2 Likes

Oh cool, good to know, and I love step = rand() :joy:

2 Likes