Skip to main content
Platform widgets are specialized components that allow you to pull in and interact with other parts of the Latch platform directly within your plots and analysis workflows. These widgets serve as bridges between your visualizations and the broader platform ecosystem, enabling dynamic data integration and interactive workflows.

Platform Integration Widgets

Below is a comprehensive list of platform widgets that enable integration with different parts of the Latch platform.
The Registry Table output widget allows you to display and interact with registry tables in your notebook interface.
  from lplots.widgets.registry import w_registry_table_picker, w_registry_table

  registry_table_picker = w_registry_table_picker(
  label="Select table"
  )

  if (registry_table_picker.value is not None):
    table_id = registry_table_picker.value

    # Display a registry table
    table = w_registry_table(
        label="Sample Registry Table",
        table_id=table_id
    )
You can also use the w_registry_table_picker widget to select a table from the registry, or supply a table id directly.

Widget Parameters

label: string required label displayed above the tabletable_id: string required identifier for the registry table to displayreadonly: bool optional, defaults to False. When True, the table is read-onlydefault: string | None optional default table idappearance: FormInputAppearance | None optional appearance configurationkey: string optional unique identifier for the widget

Value

The widget value returns a RegistryTableValue object with the following structure:
class RegistryTableValue(TypedDict):
    table: Table
    selected_rows: list[Record]
Attributes:
  • table: Table - The registry table object containing the data and metadata.
  • selected_rows: list[Record] - A list of selected row records from the table. Returns an empty list if no rows are selected.
The Table object provides access to the table’s data, schema, and metadata, while Record objects represent individual rows with their field values and metadata. Learn more about the Table API and Record API.

Usage Notes

  • The registry table widget provides an interactive interface to view and interact with registry data
  • The widget returns a RegistryTableValue containing the table object
  • The table object can be accessed via the value property
The Workflow output widget allows you to launch and execute workflows directly from your notebook interface.
from lplots.widgets.workflow import w_workflow

# Launch a workflow with parameters
workflow = w_workflow(
    label="Run Analysis",
    wf_name="my_analysis_workflow",
    params={
        "input_file": "latch://workspace/data/sample.fastq",
        "output_dir": "latch://workspace/results/"
    },
    version="v1.0"
)

execution = w.value

if execution is not None:
    res = await execution.wait()

Widget Parameters

label: string required label for the workflow buttonwf_name: string required name of the workflow to executeparams: dict required dictionary of parameters to pass to the workflow.version: string | None optional version of the workflow to use, defaults to the latest versionreadonly: bool optional, defaults to False. When True, the workflow button is disabledkey: string optional unique identifier for the widget

Class CompletedExecution

The CompletedExecution dataclass represents the final state of an execution, whether it succeeded, failed, or was aborted.Attributes id (str): A unique identifier for the execution.output (dict[str, Any]): A dictionary containing the processed output of the execution. This will be populated if the execution succeeded.ingress_data (list[LPath]): A list of LPath objects, representing data that was written to LData during the execution.status (ExecutionStatus): The final status of the execution

Class Execution

The Execution class represents an running or completed execution. It provides methods to poll the status of an execution and wait for its completion.Attributes id (str): A unique identifier for the execution.python_outputs (dict[str, type]): A dictionary mapping output names to their expected Python types. This is used when processing the execution’s output.status (ExecutionStatus): The current status of the execution. Defaults to “UNDEFINED”.outputs_url (Union[str, None]): The URL where the execution’s outputs can be found, if available. Defaults to None.flytedb_id (Union[str, None]): The FlyteDB ID associated with the execution, if available. Defaults to None. This attribute is updated during polling.Methods poll(self) -> Generator[None, Any, None] This is a generator method that continuously polls the status of the execution.wait(self) -> Union[CompletedExecution, None] Asynchronous method that waits for the execution to complete and returns the execution outputsIf the execution status is “FAILED” or “ABORTED”, it retrieves the ingress_data and returns a CompletedExecution object with an empty output dictionary.

Usage Notes

  • The workflow widget creates a button that, when clicked, launches the specified workflow
  • The widget’s value() method returns either an Execution object containing information about the launched workflow or None if no executions have been launched.
  • To retrieve the outputs of the execution, call the Execution object’s asynchronous wait method which returns a CompletedExecution object.
The LData Browser widget enables you to pull in and interact with files and directories from your Latch workspace directly within your plots. This widget creates a connection to the platform’s file system, allowing users to browse and upload files.
from lplots.widgets.ldata import w_ldata_browser

# Pull in data from your workspace for analysis
browser = w_ldata_browser(
    label="Browse Data Directory",
    dir="latch:///data/"
)

ldata_path = browser.value

Widget Parameters

label: string required label displayed above the browserdir: string | LPath required path to the directory to browse. Can be a string or LPath object “latch://<workspace_id>.account/<path>” will only work for the corresponding workspace_id, but “latch:///<path>” will work for any workspace that has that path.readonly: bool optional, defaults to False. When True, the browser is read-onlyappearance: FormInputAppearance | None optional appearance configurationkey: string optional unique identifier for the widget

Value

The widget value returns an LPath object representing the selected directory that can be integrated with your analysis. Learn more about the LPath API.

Usage Notes

  • The Latch Data Browser widget provides an interactive interface to browse directory structures and pull in files from the platform
  • The widget automatically validates that the provided path is a valid directory

Platform Widget Reactivity

Output widgets are reactive to changes in their source data. When the source plot or data is updated, the widget display will automatically update to reflect the changes.
I