JSServe Slider to Vary Number of Points

Hi. I’m working with Makie and Pluto. To demonstrate how a plot varies as a parameter is changed, I originally used Pluto’s Slider to modify the parameter. This was fine but wasn’t snappy as Pluto generated each plot from scratch. Taking advice from WGLMakie support · Issue #155 · fonsp/Pluto.jl · GitHub, I tried the following:

App() do session
    slider = JSServe.Slider(1:5)
    n = slider.value.val
    fig = scatter(rand(n))
    return DOM.div(slider.value, slider, fig)

Unfortunately, this does not modify the number of points. Any suggestions?