I knew that I could use observables from Makie to update plots without redrawing them. But I just discovered that when using WGLMakie, this also works in pluto notebooks. Sweet!
So I want to use this functionality to plot some sensor-reading in real-time. Ideally, I would love to be able to use a PlutoUI GUI element to toggle the data-stream on, and to have the plot refresh indefinitely until the GUI element was toggled off. However, once I start a
while my_toggle_value loop in one cell, it looks like I am unable to update
my_toggle_value until it finnishes, which is never when it is set to true. So I am unable to update variables during the loop, which means that I am unable to break out of it.
I also gave
@goto a shot, and I was able to hack together something that is really close to what I want. The only issue is that I need to uncheck the box, AND interrupt the cell. Also, cell interruption feels somewhat hacky, and there might be an end-user involved, so things should look and feel propper.
Is it technically possible to update a variable outside a running loop in Pluto? If not, are there better ways to achieve what I want than the hacky example above?