plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
21.16k stars 2.04k forks source link

Clientside callbacks stop working if server is shut down #830

Open deluksic opened 5 years ago

deluksic commented 5 years ago

app.clientside_callback() will not trigger if the server is not running. One would expect it to keep working since server is not needed for it to work.

dash==0.43.0 dash-core-components==0.48.0 dash-html-components==0.16.0 dash-renderer==0.24.0

deluksic commented 5 years ago

Upon further testing, it seems that pure clientside callbacks work, but callbacks that contain inputs dependent on serverside callbacks (even though the callback would function without it) don't. The use case example would be:

@app.callback(Output('store-data', 'data'),
              [Input('interval', 'n_intervals')])
def update_graph(interval_n):
    return <data>

app.clientside_callback(
    ClientsideFunction('amplifier', 'updateGraph'),
    Output('store-noop', 'data'),
    [Input('store-data', 'data'),
     Input('some-slider', 'value')]
)

The slider could be used to move/stretch/modify the incoming data in some way. But if there's no new data, old data is displayed normally from the store.