I’d like to make a very basic WebApp running locally where the user can see some basic text/graphics, select various options, toggles, items from a list, input text, select files, set parameters, etc. Underneath (the guts) would be a bunch of calculation based on user input input and then a display (text, tables, graphics).
I’ve never made a WebApp before. I’d like to use Julia for the calculation guts. Which packages do you recommend? What should my workflow be? Is there a tutorial that will take me from zero to useful?
The documentation said it could be used on other places, I have never tried that though.
Interact allows to create small GUIs in Julia based on web technology. These GUIs can be deployed in jupyter notebooks, in the Juno IDE plot pane, in an Electron window or in the browser.
Yes. If you use it from a Jupyter notebook it makes it in the notebook, but if you use it outside a Jupyter notebook then it makes a standard web interface. This makes it really easy to create and debug from standard Julia development tools!
If you run into the limitations of what Interact can do on the front end, you can always build that side using traditional (read: javascript) tools and then do the calculations with a Julia API.
You really want Interact.jl to make the interface and Blink.jl for a standalone browser window. I’m using this combo right now, doing quite a few of the things you mention and plotting the output live.
You can also serve the same Interact ui on the web using Mux.jl and an extra two or three lines of code.
It actually is quite simple. Let’s say you create an Interact app with either custom widgets or using the @manipulate macro (which is just a shortcut for a specific case of custom widget). For example:
ui = @manipulate for i = 1:10, j = "test"
j^i
end
If you are in the notebook, this appears inline already and you are good to go. If you are doing this from the REPL, you can serve it via Blink:
That’s also an interesting approach. In principle Interact allows more or less arbitrary HTML + JavaScript using WebIO (you can construct arbitrary DOM nodes with say node(:div, ...) and run javascript with onimport) but at some point it may be simpler to do it in HTML + javascript directly. Do you have a writeup of how to make a javascript+julia webapp like this? I also wonder whether that could benefit from some of the Interact stack, for example Knockout allows two-way binding between javascript-knockout observables and julia observables, so maybe one could code the whole thing in javascript and share the data with Julia via these observables.
I’m writing Julia-based APIs with Joseki.jl and this project is an example of a front end written in Angular (my personal favorite, but Vue and React are also both options) and two different APIs written in Julia. DiffEqOnline is another older example of a traditional front end sitting on top of a Julia API.
Hi Raf! I’m also trying to develop some web app with julia. Do you have any examples or projects on GitHub I could checkout to see how you’re using Interact and Blink? I would really really appreciate it.
Were you can manually fit models to maps or plotted curves.
The thing you may find confusing is that everything is general - there are no specific sliders being generated in these packages, instead the interfaces are for arbitrary composed models. We use Flatten.jl and FieldMetadata.jl to flatten composite objects down to tuples that you can make sliders from.