# Interactive web app with Bonito and WGLMakie

**URL:** <https://discourse.julialang.org/t/interactive-web-app-with-bonito-and-wglmakie/116348>\
**Category:** General Usage\
**Tags:** question, wglmakie, bonito\
**Created:** [June 28, 2024, 10:12am UTC](https://discourse.julialang.org/t/interactive-web-app-with-bonito-and-wglmakie/116348 "2024-06-28T10:12:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [June 28, 2024, 10:12am UTC](https://discourse.julialang.org/t/interactive-web-app-with-bonito-and-wglmakie/116348/1 "2024-06-28T10:12:45Z")

</div>

I am trying to build an interactive app with WGLMakie und Bonito and just cannot figure it out. I got as far as the following code that works sometimes:

```julia
using Bonito
using WGLMakie

app = App() do
    slider = Bonito.Slider(1:100)
    fig = Observable(scatter(1:slider.value[], 1:slider.value[]))
    on(slider) do s
        fig[] = scatter(1:s, 1:s)
    end
    page = DOM.div(
        Labeled(slider, slider.value),
        fig,
        js"""console.log($(slider.value))"""
    )
    return page
end

```

it works sometimes because the app “resets” quite frequently and the browser console shows an error (among others)

```julia
removing WGL context, canvas is not in the DOM anymore!

```

and Julia prints out a JavaScript error

```julia
An exception was thrown in JS: TypeError: canvas is null

```

also the `js"""console.log(...)"""` simply does nothing.
