class documentation

class ProgressView(View): (source)

Constructor: ProgressView(**kwargs)

View In Hierarchy

Displays a progress bar.

Examples:

import fiftyone.operators as foo
import fiftyone.operators.types as types

class ExampleProgress(foo.Operator):
    @property
    def config(self):
        return foo.OperatorConfig(
            name="example_progress",
            label="Examples: Progress",
            execute_as_generator=True,
        )

    async def execute(self, ctx):
        outputs = types.Object()
        schema = types.Property(outputs)
        n = 100
        for i in range(n):
            label = f"Loading {i} of {n}"
            progress_view = types.ProgressView(label=label)
            loading_schema = types.Object()
            loading_schema.int("percent_complete", view=progress_view)
            show_output_params = {
                "outputs": types.Property(loading_schema).to_json(),
                "results": {"percent_complete": i / n}
            }
            yield ctx.trigger("show_output", show_output_params)

            # Simulate computation
            await asyncio.sleep(0.5)
Parameters
labelthe label to display under the progress bar
variantbar variant. Supported values are "linear" and "circular"
Method __init__ Undocumented
Method to_json Undocumented
Instance Variable variant Undocumented

Inherited from View:

Method clone Undocumented
Method kwargs_to_json Undocumented
Instance Variable caption Undocumented
Instance Variable component Undocumented
Instance Variable componentsProps Undocumented
Instance Variable container Undocumented
Instance Variable description Undocumented
Instance Variable placeholder Undocumented
Instance Variable read_only Undocumented
Instance Variable space Undocumented
Instance Variable _kwargs Undocumented
def __init__(self, **kwargs): (source)
def to_json(self): (source)

Undocumented

Undocumented