Dash clientside callbacks

Is there an example of clientside callbacks for Dash? I only found this, hidden in a closed github issue: Clientside callbacks by waralex · Pull Request #30 · plotly/Dash.jl · GitHub

I tried with this code, but it doesn’t work:

using Dash, DashHtmlComponents, DashCoreComponents

app = dash()
app.layout = html_div() do
       dcc_input(id = "my-id", value="initial value", type = "text"),
       html_div(id = "my-div", dcc_input(id = "disp", value=0))
   end

callback!(
   """
   function(input_value) {
       return (
           input_value
       );
   }
   """
   , app,
   Output("disp", "value"),
   Input("my-id", "value")
   )

run_server(app, "0.0.0.0", 8080)

EDIT: The code above works, it was just me not knowing Javascript.

@Iulian.Cioarca
Here http://dash.plotly.com/clientside-callbacks you can find examples.

Thank you, but I am looking for Julia examples and don’t understand why the code above doesn’t work…

Unfortunately not all Python Dash examples have Julia versions. Maybe on Plotly forum https://community.plotly.com/ you have the chance to get an answer.

1 Like