plotly / dash

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

A Flexible "Loading Status" API for Component Authors #267

Closed chriddyp closed 5 years ago

chriddyp commented 6 years ago

This issue pertains to adding a flexible "loading" UI for component authors and therefore, dash developers.

This work item has been sponsored by an organization. Big thanks! If your company or organization would like to prioritize features by sponsoring dash development, please reach out

The loading experience will be customizable by the component authors on a per-component basis. This might involve:

In addition to creating the framework for introducing loading screens into components, we will introduce our own loading designs into our set of component libraries (dash-html-components, dash-core-components). Our implementation should set the design and API standard for other component authors.

slishak commented 6 years ago

Out of interest, will this feature support logging status messages from a long-running callback to the loading screen? At the moment I print the status of long running callbacks to stdout, but it would be nice to be able to view these in the browser instead of in the console window.

chriddyp commented 6 years ago

Out of interest, will this feature support logging status messages from a long-running callback to the loading screen? At the moment I print the status of long running callbacks to stdout, but it would be nice to be able to view these in the browser instead of in the console window.

It will in a sense. You won't be able to send the messages to the loading components during the callback but you will be able to customize the loading messages at the start of the callbacks. I'm imagining that the API will be something like:

dcc.Graph(loading_text='Please wait')
chriddyp commented 6 years ago

Some additional feedback on suppressing loading spinners for particular callbacks: https://community.plot.ly/t/can-i-skip-activating-the-dash-loading-callback-div-for-some-callbacks/10951

chriddyp commented 6 years ago

For folks that stumble upon this issue, note that global, app-level loading states are currently possible through the method described here: https://community.plot.ly/t/mega-dash-loading-states/5687

chriddyp commented 6 years ago

There is a very interesting solution to this problem done in pure-dash right now, no changes to the framework necessary: https://community.plot.ly/t/in-a-plotly-dash-app-how-to-show-a-default-text-value-upon-each-click-in-a-div-until-the-div-is-populated/14588/5?u=chriddyp

chriddyp commented 5 years ago

This item was sponsored by one of our partners (https://plot.ly/products/consulting-and-oem/) and completed in https://github.com/plotly/dash-renderer/pull/93 🎉