question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTML component showing running status

See original GitHub issue

Hi, dash users and developers,

I have a program that takes some time to run upon update with callback. I want to have a html component showing it is “Running” or “Completed”.

I was trying to do as following:

@app.callback(
    dash.dependencies.Output('Output', 'value'),
    [dash.dependencies.Input('Input', 'value')])
def slow_function(input_value):
  (some code running slow)
   return(output_value)

@app.callback(
    dash.dependencies.Output('update-indicator', 'children'),
    [dash.dependencies.Input('Input', 'value')])
def show_running(input_value):
   return("Running")

@app.callback(
    dash.dependencies.Output('update-indicator', 'children'),
    [dash.dependencies.Input('Output', 'value')])
def show_running(output_value):
   return("Completed")

However, it suffers from two problems:

  1. Currently one object (“output”) can only have one callback. so it will give an error.
  2. Even if point 1 is not a problem, in cases where different inputs result in the same output, I guess it will still showing “Running” even if a different run has happened and completed. Am I correct?

Please help me out either with the two problems or the original goal.

Thanks!!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ned2commented, Jul 21, 2017

A progress spinner component for the entire app and/or individual elements would be great. I was just starting to think about the need for precisely this in the app I’m building.

0reactions
chriddypcommented, Jun 8, 2018

Closing in favor of https://github.com/plotly/dash/issues/267, a proposal for adding loading states to the underlying component framework.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Progress Indicator element - HTML - MDN Web Docs
The HTML element displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
Read more >
HTML progress Tag - W3Schools
Definition and Usage. The <progress> tag represents the completion progress of a task. Tip: Always add the <label> tag for best accessibility practices!...
Read more >
Lesson 5: Using Javascript to Hide and Show Content
Lesson 5: Using Javascript to Hide and Show Content. Overview. One way that JavaScript is commonly used is to hide or display content...
Read more >
App Building Components - MATLAB & Simulink - MathWorks
For more information about how to call graphics functions in App Designer, see Display ... An image component showing the MathWorks L-shaped Membrane...
Read more >
How To Create An HTML Report With PowerShell
Let's apply the class attribute in the Service information table. Using CSS change the color of the text to green **when the value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found