Simple example of Interactive + Dynamically Updating (VegaLite) graph with Julia backend

I’m sure there are many ways this can be done in Julia but if anyone has seen very simple examples of how to produce interactive graphs that can be dynamically updated from (backend) Julia code that would be great?

My starting point is to use something like Interact.jl and VegaLite.jl and then export as a stand-alone html page which the backend can then dynamically stream data to.

Main use case is for interactive control of optimization runs in Optim.jl and BlackBoxOptim.jl. If someone has concrete examples or pointers that would be super-useful. Thanks!

There is
https://covid19.opensourc.es which has functionality similar to what you want.
May be @Wikunia can give some advices.

Also, there was an announcement [ANN] Matte.jl - interactive dashboards written in Julia it’s somewhat different, cause it doesn’t use interact.jl, but it can possibly solve your original problem.

1 Like

I’m not using VegaLite.jl for that but maybe I can give you some help with Vega in general. The documentation is sometimes not the best but I found out some stuff after hours of searching.

1 Like

Thanks, Vega is also fine. Is the source for the covid19 site available or do you have other example code to share?

This is my current version: https://gist.github.com/Wikunia/427c8d1421ac4370d1e4304a9cca2d34
If you are in the slack community you can ask me there if you have questions.

I couldn’t really find an example for what I was looking for but thanks to this VegaLite with WebSockets example:

I managed to put together a single Julia file that uses HTTP to serve a frontend html page with a VegaLite graph and then pushes data updates from Julia over a WebSocket to the frontend which then updates the VegaLite graph. Sharing in a single file gist here since it might be useful for others to build on: