Symphony State#
All components have access to the same, shared state.
Name  | 
Description  | 
Type  | 
|---|---|---|
  | 
The active filter that is applied to the backing metadata.  | 
  | 
  | 
The current error that the filter throws upon filtering. Empty if no error.  | 
  | 
  | 
The raw backing metadata table.  | 
  | 
  | 
The specification holding the file paths and other general information.  | 
  | 
  | 
Columns by which the metadata is grouped.  | 
  | 
  | 
Names of all the groups. Result of a Cartesian product between all group names.  | 
  | 
  | 
The grouped metadata tables (filters applied).  | 
  | 
  | 
The filtered metadata table.  | 
  | 
  | 
A list of all selected data samples.  | 
  | 
  | 
Specification of the position and content of the tooltip.  | 
  | 
  | 
Whether to show the unfiltered data alongside the filtered data (mostly used for charts).  | 
  | 
If your component has additional requirements, the WidgetSpec needs to be changed.
For that, [your_widget_name]/widget.py needs to be modified to take additional parameters, for example:
def __init__(self,
                 width: str = 'XXL',
                 height: str = 'M',
                 page: str = 'Binary Confusion Matrix',
                 label_column: str = '',
                 prediction_column: str = '',
                 **kwargs
                 ):
        """A simple binary confusion matrix extension that takes into account grouping.
        Parameters
        ----------
        width : str, optional
            By default "XXL".
        height : str, optional
            By default "M".
        page : str, optional
            Which page of the dashboard to show the widget on, by default "SymphonyBinaryConfusionMatrix".
        label_column: str, optional
            The column with the instance label. By default empty.
        prediction_column: str, optional
            The column with the model's prediction. By default empty.
        Returns
        -------
        SymphonyBinaryConfusionMatrix
        """
        super().__init__(**kwargs)
        self.width: str = width
        self.height: str = height
        self.page: str = page
        self.spec = symphony_ui.ClassificationSpec(
            width=width,
            height=height,
            page=page,
            label_column=label_column,
            prediction_column=prediction_column,
            name=self.name,
            description=self.description
        )
This component takes 2 additional parameters, namely label_column and prediction_column.
To support typing for this new spec, both the main Symphony _specs.py and Symphony Lib’s types.ts need to be augmented.