Skip to main content

progress_tracker

ProgressTracker

from dara.core.visual.components.progress_tracker import ProgressTracker

class ProgressTracker(ComponentInstance)

ProgressTracker component can be used a a placeholder component for @py_components. The component will automatically pick up updates from the component's input derived variables which are running as tasks and display a progress bar.

Note: the task needs to be wrapped with @track_progress and provide updates via the injected ProgressUpdater instance.

Example setup:


from dara.core.components import ProgressTracker
from dara.core.definitions import DerivedVariable, Variable

from project_module.tasks import task_function

var = Variable(5)
dv = DerivedVariable(func=task_function, variables=[var], run_as_task=True)

@py_component(placeholder=ProgressTracker())
def test_component(some_value):
return Text(some_value)