I’m trying to build an app with 2 graphs that will draw after the user clicks a button in Julia.
The problem is the model takes several seconds to run so I want a loading spinner over each graph.
I managed to make it work with a single graph, but when I enter the second output it only shows the spinner on one of them:
using Dash, DashHtmlComponents, DashCoreComponents using PlotlyJS app = dash() app.layout = html_div() do html_button(id = "button1", children = "send1",), html_div( dcc_loading(dcc_graph(id = "graph1"),), style = (width = "20%", display = "inline-block"),), html_div( dcc_loading(dcc_graph(id = "graph2"),), style = (width = "20%", display = "inline-block"),) end callback!(app, Output("graph1", "figure"), Output("graph2", "figure"), Input("button1", "n_clicks"), ) do clicks return ( Plot([1,2,3],[1,2,3]), Plot([1,2,3],[2,2,2]),) end run_server(app, "0.0.0.0", debug=true)
How can make the spinner show on both graphs with a single multiple output callback?