i’m trying to save an interactive Makie plot to share with a colleague who doesn’t use julia, but i can’t even get this example in the docs to work.
specifically, at the REPL i enter:
julia> using Bonito, WGLMakie
julia> App() do session::Session
           n = 10
           index_slider = Slider(1:n)
           volume = rand(n, n, n)
           slice = map(index_slider) do idx
               return volume[:, :, idx]
           end
           fig = Figure()
           ax, cplot = contour(fig[1, 1], volume)
           rectplot = linesegments!(ax, Rect(-1, -1, 12, 12), linewidth=2, color=:red)
           on(index_slider) do idx
               translate!(rectplot, 0,0,idx)
           end
           heatmap(fig[1, 2], slice)
           slider = DOM.div("z-index: ", index_slider, index_slider.value)
           return Bonito.record_states(session, DOM.div(slider, fig))
       end
julia> export_static("example.html", ans)
it opens up a new tab in my browser and i can move the slider and see things move. but if i open “example.html” in another tab, nothing moves.
isn’t that the whole point of this example? that “There are a couple of ways to keep interacting with Plots in a static export”, and that “Record a statemap” is one of them?
what am i doing wrong?
worth noting too that while the slider appears in the hosted docs online, neither of the two plots below it does.