plotly / dash-labs

Work-in-progress technical previews of potential future Dash features.
MIT License
139 stars 39 forks source link

long_callback: Make `set_progress` arguments more flexible #27

Closed jonmmease closed 3 years ago

jonmmease commented 3 years ago

See https://community.plotly.com/t/dash-labs-0-3-0-app-long-callback-support/53719/4?u=jmmease.

Support workflows like:

@app.long_callback(
    ...,
    progress=dict(
        progress1=dl.Output("component1", "attribute1"),
        progress2=dl.Output("component2", ("attribute1", "attribute2"))
    )
)
def my_function(set_progress, *args, **kwargs):
    # Do something
    set_progress({"progress1": ..., "progress2": ...})
    # Do some more stuff
    set_progress({"progress1": ..., "progress2": ...})
   # And some more
    return ...