In PlotlyJS, I can update a trace in-place using react!()
as mentioned in the docs:
tr = scatter(;y=rand(5))
p = plot(tr)
tr[:y] .= rand(5)
react!(p,[tr],Layout())
However, I don’t see any information on how to do in-place updating of subplot data. For example:
p = make_subplots(rows=2, cols=1, shared_xaxes=true, vertical_spacing=0.02)
tr1 = scatter(;y=rand(5))
tr2 = scatter(;y=rand(10))
add_trace!(p, tr1, row=1, col=1)
add_trace!(p, tr2, row=2, col=1)
p
The goal is then to do something like
tr1[:y] .= rand(5)
react!(p,[tr1],row=1,col=1)
but react!
doesn’t take row/col keywords. I’d like to avoid redrawing the whole plot.
Any help is greatly appreciated!