Presets Module

The presets module contains pre-built blocks for common data analysis and visualization tasks.

Base Preset

Abstract base class for all TypedChartBlock presets with standardized control configuration.

Base preset class for TypedChartBlock with flexible control configuration.

Abstract base class providing standardized control configuration pattern for all TypedChartBlock presets.

hierarchy:

[Presets | Base | BasePreset]

relates-to:
  • motivated_by: “Standardized preset development pattern for consistency and maintainability”

  • implements: “abstract class: ‘BasePreset’”

  • uses: [“block: ‘TypedChartBlock’”]

contract:
  • pre: “Subclass must implement default_controls property and plot_type”

  • post: “Provides flexible control configuration via controls parameter”

  • controls_logic: “controls=False: no controls, controls=True: default controls, controls=dict: custom control config”

complexity:

5

decision_cache:

“Abstract base class pattern for consistent preset development”

class dashboard_lego.presets.base_preset.BasePreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Preset Chart', controls: bool | Dict[str, bool | Control] = False, **kwargs)[source]

Bases: TypedChartBlock, ABC

Abstract base class for TypedChartBlock presets with flexible control configuration.

Hierarchy:

[Presets | Base | BasePreset]

Relates-to:
  • motivated_by: “Standardized preset development pattern for consistency and maintainability”

  • implements: “abstract class: ‘BasePreset’”

  • uses: [“block: ‘TypedChartBlock’”]

Contract:
  • pre: “Subclass must implement default_controls property and plot_type”

  • post: “Provides flexible control configuration via controls parameter”

  • controls_logic: “controls=False: no controls, controls=True: default controls, controls=dict: custom control config”

Complexity:

5

Decision_cache:

“Abstract base class pattern for consistent preset development”

This class provides a standardized pattern for creating TypedChartBlock presets with flexible control configuration. Subclasses must implement:

  1. default_controls property: Dict of default Control objects

  2. plot_type property: String plot type from registry

  3. _build_plot_params() method: Build plot_params based on available controls

  4. _build_plot_kwargs() method: Build plot_kwargs based on available controls

  5. _get_plot_title() method: Return dynamic plot title or None

Usage:

```python class MyPreset(BasePreset):

@abstractproperty def default_controls(self) -> Dict[str, Control]:

return {

“param1”: Control(component=dcc.Dropdown, props={…}), “param2”: Control(component=dbc.Switch, props={…}),

}

@abstractproperty def plot_type(self) -> str:

return “my_plot_type”

def _build_plot_params(self, final_controls: Dict[str, Control], kwargs: Dict[str, Any]) -> Dict[str, Any]:

plot_params = {} if “param1” in final_controls:

plot_params[“param1”] = “{{param1}}”

else:

plot_params[“param1”] = kwargs.get(“param1”, “default_value”)

return plot_params

def _build_plot_kwargs(self, final_controls: Dict[str, Control], kwargs: Dict[str, Any]) -> Dict[str, Any]:

plot_kwargs = {} if “param2” in final_controls:

plot_kwargs[“param2”] = “{{param2}}”

else:

plot_kwargs[“param2”] = kwargs.get(“param2”, False)

return plot_kwargs

def _get_plot_title(self, final_controls: Dict[str, Control]) -> Optional[str]:
if “param1” in final_controls:

return “My Plot: {{param1}}”

return None

```

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Preset Chart', controls: bool | Dict[str, bool | Control] = False, **kwargs)[source]

Initialize preset with flexible control configuration.

Hierarchy:

[Presets | Base | BasePreset | Initialization]

Relates-to:
  • motivated_by: “Flexible preset initialization with configurable controls”

  • implements: “method: ‘__init__’”

Contract:
  • pre: “datasource meets requirements, subclass implements required properties/methods”

  • post: “Preset ready with configured controls or no controls”

  • controls_logic: “controls=False: no controls, controls=True: default controls, controls=dict: custom control config”

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls

    Control configuration: - False (default): No controls, expects values in kwargs - True: Create default controls for all parameters - Dict[str, bool|Control]: Custom control configuration:

    • bool: Enable/disable default control

    • Control: Replace with custom control

  • **kwargs – Additional styling parameters and control values

abstract property default_controls: Dict[str, Control]

Default control definitions for this preset.

Hierarchy:

[Presets | Base | BasePreset | DefaultControls]

Relates-to:
  • motivated_by: “Subclass must define available controls”

  • implements: “abstract property: ‘default_controls’”

Contract:
  • pre: “Subclass implementation”

  • post: “Returns dict of Control objects with default configurations”

Returns:

Dictionary mapping control names to Control objects

Base Preset Class

class dashboard_lego.presets.base_preset.BasePreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Preset Chart', controls: bool | Dict[str, bool | Control] = False, **kwargs)[source]

Bases: TypedChartBlock, ABC

Abstract base class for TypedChartBlock presets with flexible control configuration.

Hierarchy:

[Presets | Base | BasePreset]

Relates-to:
  • motivated_by: “Standardized preset development pattern for consistency and maintainability”

  • implements: “abstract class: ‘BasePreset’”

  • uses: [“block: ‘TypedChartBlock’”]

Contract:
  • pre: “Subclass must implement default_controls property and plot_type”

  • post: “Provides flexible control configuration via controls parameter”

  • controls_logic: “controls=False: no controls, controls=True: default controls, controls=dict: custom control config”

Complexity:

5

Decision_cache:

“Abstract base class pattern for consistent preset development”

This class provides a standardized pattern for creating TypedChartBlock presets with flexible control configuration. Subclasses must implement:

  1. default_controls property: Dict of default Control objects

  2. plot_type property: String plot type from registry

  3. _build_plot_params() method: Build plot_params based on available controls

  4. _build_plot_kwargs() method: Build plot_kwargs based on available controls

  5. _get_plot_title() method: Return dynamic plot title or None

Usage:

```python class MyPreset(BasePreset):

@abstractproperty def default_controls(self) -> Dict[str, Control]:

return {

“param1”: Control(component=dcc.Dropdown, props={…}), “param2”: Control(component=dbc.Switch, props={…}),

}

@abstractproperty def plot_type(self) -> str:

return “my_plot_type”

def _build_plot_params(self, final_controls: Dict[str, Control], kwargs: Dict[str, Any]) -> Dict[str, Any]:

plot_params = {} if “param1” in final_controls:

plot_params[“param1”] = “{{param1}}”

else:

plot_params[“param1”] = kwargs.get(“param1”, “default_value”)

return plot_params

def _build_plot_kwargs(self, final_controls: Dict[str, Control], kwargs: Dict[str, Any]) -> Dict[str, Any]:

plot_kwargs = {} if “param2” in final_controls:

plot_kwargs[“param2”] = “{{param2}}”

else:

plot_kwargs[“param2”] = kwargs.get(“param2”, False)

return plot_kwargs

def _get_plot_title(self, final_controls: Dict[str, Control]) -> Optional[str]:
if “param1” in final_controls:

return “My Plot: {{param1}}”

return None

```

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Preset Chart', controls: bool | Dict[str, bool | Control] = False, **kwargs)[source]

Initialize preset with flexible control configuration.

Hierarchy:

[Presets | Base | BasePreset | Initialization]

Relates-to:
  • motivated_by: “Flexible preset initialization with configurable controls”

  • implements: “method: ‘__init__’”

Contract:
  • pre: “datasource meets requirements, subclass implements required properties/methods”

  • post: “Preset ready with configured controls or no controls”

  • controls_logic: “controls=False: no controls, controls=True: default controls, controls=dict: custom control config”

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls

    Control configuration: - False (default): No controls, expects values in kwargs - True: Create default controls for all parameters - Dict[str, bool|Control]: Custom control configuration:

    • bool: Enable/disable default control

    • Control: Replace with custom control

  • **kwargs – Additional styling parameters and control values

abstract property default_controls: Dict[str, Control]

Default control definitions for this preset.

Hierarchy:

[Presets | Base | BasePreset | DefaultControls]

Relates-to:
  • motivated_by: “Subclass must define available controls”

  • implements: “abstract property: ‘default_controls’”

Contract:
  • pre: “Subclass implementation”

  • post: “Returns dict of Control objects with default configurations”

Returns:

Dictionary mapping control names to Control objects

EDA Presets

Exploratory Data Analysis presets for common data visualization patterns.

Pre-built EDA blocks using TypedChartBlock and plot registry.

v0.15.0: Refactored to use TypedChartBlock instead of deprecated StaticChartBlock/InteractiveChartBlock.

hierarchy:

[Presets | EDA]

relates-to:
  • motivated_by: “v0.15.0: Use TypedChartBlock with plot registry”

  • implements: “EDA presets with zero chart_generator code”

complexity:

4

dashboard_lego.presets.eda_presets.plot_correlation_heatmap(df: DataFrame, **kwargs) Figure[source]

Plot correlation matrix heatmap for numerical columns.

Hierarchy:

[Presets | EDA | Plots | CorrelationHeatmap]

Contract:
  • pre: “DataFrame contains numerical columns”

  • post: “Returns heatmap figure or empty figure”

Parameters:
  • df – Input DataFrame

  • **kwargs – Additional plotly kwargs (title, etc.)

Returns:

Plotly Figure with correlation heatmap

dashboard_lego.presets.eda_presets.plot_missing_values(df: DataFrame, **kwargs) Figure[source]

Plot percentage of missing values per column.

Hierarchy:

[Presets | EDA | Plots | MissingValues]

Contract:
  • pre: “DataFrame provided”

  • post: “Returns bar chart or empty figure”

Parameters:
  • df – Input DataFrame

  • **kwargs – Additional plotly kwargs (title, etc.)

Returns:

Plotly Figure with missing values bar chart

dashboard_lego.presets.eda_presets.plot_grouped_histogram(df, x, color=None, **kwargs)[source]

Plot histogram with optional grouping.

Hierarchy:

[Presets | EDA | Plots | GroupedHistogram]

Contract:
  • pre: “x column exists in df”

  • post: “Returns histogram with optional color grouping”

Parameters:
  • df – Input DataFrame

  • x – Column name for x-axis

  • color – Optional column for grouping (None or “None” = no grouping)

  • **kwargs – Additional plotly kwargs

Returns:

Plotly Figure with histogram

dashboard_lego.presets.eda_presets.plot_box_by_category(df, x, y, color=None, **kwargs)[source]

Plot box plot comparing distributions across categories.

Hierarchy:

[Presets | EDA | Plots | BoxPlot]

Contract:
  • pre: “x and y columns exist in df”

  • post: “Returns box plot figure”

Parameters:
  • df – Input DataFrame

  • x – Categorical column for x-axis

  • y – Numerical column for y-axis

  • color – Optional column for color grouping

  • **kwargs – Additional plotly kwargs

Returns:

Plotly Figure with box plot

class dashboard_lego.presets.eda_presets.CorrelationHeatmapPreset(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Correlation Heatmap', controls: bool = False, **kwargs)[source]

Bases: BasePreset

Correlation matrix heatmap preset using BasePreset.

Hierarchy:

[Presets | EDA | CorrelationHeatmapPreset]

Relates-to:
  • motivated_by: “v0.15.0: EDA preset using BasePreset”

  • implements: “preset: ‘CorrelationHeatmapPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame contains numerical columns”

  • post: “Renders correlation heatmap”

Complexity:

2

__init__(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Correlation Heatmap', controls: bool = False, **kwargs)[source]

Initialize correlation heatmap preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for correlation heatmap preset.

Returns:

Empty dict - no controls needed for correlation heatmap

class dashboard_lego.presets.eda_presets.MissingValuesPreset(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Missing Values Analysis', controls: bool = False, **kwargs)[source]

Bases: BasePreset

Missing values analysis preset using BasePreset.

Hierarchy:

[Presets | EDA | MissingValuesPreset]

Relates-to:
  • motivated_by: “v0.15.0: EDA preset using BasePreset”

  • implements: “preset: ‘MissingValuesPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame provided”

  • post: “Renders missing values bar chart”

Complexity:

2

__init__(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Missing Values Analysis', controls: bool = False, **kwargs)[source]

Initialize missing values preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for missing values preset.

Returns:

Empty dict - no controls needed for missing values analysis

class dashboard_lego.presets.eda_presets.GroupedHistogramPreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Analysis', controls: bool = True, **kwargs)[source]

Bases: BasePreset

Interactive histogram with grouping using BasePreset.

Hierarchy:

[Presets | EDA | GroupedHistogramPreset]

Relates-to:
  • motivated_by: “v0.15.0: Interactive histogram with controls using BasePreset”

  • implements: “preset: ‘GroupedHistogramPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame contains numerical and categorical columns”

  • post: “Renders histogram with column/group controls”

Complexity:

3

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Analysis', controls: bool = True, **kwargs)[source]

Initialize grouped histogram preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters and control values

property default_controls: Dict[str, Control]

Default control definitions for grouped histogram preset.

Returns:

Dictionary mapping control names to Control objects

class dashboard_lego.presets.eda_presets.BoxPlotPreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Comparison (Box Plot)', controls: bool = True, **kwargs)[source]

Bases: BasePreset

Interactive box plot preset using BasePreset.

Hierarchy:

[Presets | EDA | BoxPlotPreset]

Relates-to:
  • motivated_by: “v0.15.0: Box plot with controls using BasePreset”

  • implements: “preset: ‘BoxPlotPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame has numerical and categorical columns”

  • post: “Renders box plot with column selection”

Complexity:

3

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Comparison (Box Plot)', controls: bool = True, **kwargs)[source]

Initialize box plot preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters and control values

property default_controls: Dict[str, Control]

Default control definitions for box plot preset.

Returns:

Dictionary mapping control names to Control objects

class dashboard_lego.presets.eda_presets.KneePlotPreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Knee Plot Analysis', controls: bool = False, **kwargs)[source]

Bases: BasePreset

Interactive knee/elbow plot preset using BasePreset.

Hierarchy:

[Presets | EDA | KneePlotPreset]

Relates-to:
  • motivated_by: “v0.15.0: Knee/elbow plots for optimization analysis and cluster validation”

  • implements: “preset: ‘KneePlotPreset’”

  • uses: [“class: ‘BasePreset’”, “plot_type: ‘knee_plot’”]

Contract:
  • pre: “DataFrame has numerical columns for x and y axes”

  • post: “Renders knee plot with optional automatic knee detection”

  • dependency: “Automatic knee detection requires ‘kneed’ package (uv pip install kneed)”

  • controls: “Flexible control configuration via controls parameter”

Complexity:

3

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Knee Plot Analysis', controls: bool = False, **kwargs)[source]

Initialize knee plot preset.

Hierarchy:

[Presets | EDA | KneePlotPreset | Initialization]

Relates-to:
  • motivated_by: “Flexible knee plot with configurable controls using BasePreset”

  • implements: “method: ‘__init__’”

Contract:
  • pre: “datasource contains numerical columns”

  • post: “Preset ready with configured controls or no controls”

  • controls_logic: “controls=False: no controls, controls=True: default controls, controls=dict: custom control config”

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls

    Control configuration: - False (default): No controls, expects values in kwargs - True: Create default controls for all parameters - Dict[str, bool|Control]: Custom control configuration:

    • bool: Enable/disable default control

    • Control: Replace with custom control

  • **kwargs – Additional styling parameters and control values

property default_controls: Dict[str, Control]

Default control definitions for knee plot preset.

Hierarchy:

[Presets | EDA | KneePlotPreset | DefaultControls]

Relates-to:
  • motivated_by: “Define available controls for knee plot”

  • implements: “property: ‘default_controls’”

Contract:
  • pre: “datasource contains numerical columns”

  • post: “Returns dict of Control objects for knee plot parameters”

Returns:

Dictionary mapping control names to Control objects

Correlation Heatmap Preset

class dashboard_lego.presets.eda_presets.CorrelationHeatmapPreset(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Correlation Heatmap', controls: bool = False, **kwargs)[source]

Bases: BasePreset

Correlation matrix heatmap preset using BasePreset.

Hierarchy:

[Presets | EDA | CorrelationHeatmapPreset]

Relates-to:
  • motivated_by: “v0.15.0: EDA preset using BasePreset”

  • implements: “preset: ‘CorrelationHeatmapPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame contains numerical columns”

  • post: “Renders correlation heatmap”

Complexity:

2

__init__(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Correlation Heatmap', controls: bool = False, **kwargs)[source]

Initialize correlation heatmap preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for correlation heatmap preset.

Returns:

Empty dict - no controls needed for correlation heatmap

Grouped Histogram Preset

class dashboard_lego.presets.eda_presets.GroupedHistogramPreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Analysis', controls: bool = True, **kwargs)[source]

Bases: BasePreset

Interactive histogram with grouping using BasePreset.

Hierarchy:

[Presets | EDA | GroupedHistogramPreset]

Relates-to:
  • motivated_by: “v0.15.0: Interactive histogram with controls using BasePreset”

  • implements: “preset: ‘GroupedHistogramPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame contains numerical and categorical columns”

  • post: “Renders histogram with column/group controls”

Complexity:

3

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Analysis', controls: bool = True, **kwargs)[source]

Initialize grouped histogram preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters and control values

property default_controls: Dict[str, Control]

Default control definitions for grouped histogram preset.

Returns:

Dictionary mapping control names to Control objects

Missing Values Preset

class dashboard_lego.presets.eda_presets.MissingValuesPreset(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Missing Values Analysis', controls: bool = False, **kwargs)[source]

Bases: BasePreset

Missing values analysis preset using BasePreset.

Hierarchy:

[Presets | EDA | MissingValuesPreset]

Relates-to:
  • motivated_by: “v0.15.0: EDA preset using BasePreset”

  • implements: “preset: ‘MissingValuesPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame provided”

  • post: “Renders missing values bar chart”

Complexity:

2

__init__(block_id: str, datasource: DataSource, subscribes_to: str, title: str = 'Missing Values Analysis', controls: bool = False, **kwargs)[source]

Initialize missing values preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for missing values preset.

Returns:

Empty dict - no controls needed for missing values analysis

Box Plot Preset

class dashboard_lego.presets.eda_presets.BoxPlotPreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Comparison (Box Plot)', controls: bool = True, **kwargs)[source]

Bases: BasePreset

Interactive box plot preset using BasePreset.

Hierarchy:

[Presets | EDA | BoxPlotPreset]

Relates-to:
  • motivated_by: “v0.15.0: Box plot with controls using BasePreset”

  • implements: “preset: ‘BoxPlotPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “DataFrame has numerical and categorical columns”

  • post: “Renders box plot with column selection”

Complexity:

3

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Distribution Comparison (Box Plot)', controls: bool = True, **kwargs)[source]

Initialize box plot preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters and control values

property default_controls: Dict[str, Control]

Default control definitions for box plot preset.

Returns:

Dictionary mapping control names to Control objects

Knee Plot Preset

class dashboard_lego.presets.eda_presets.KneePlotPreset(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Knee Plot Analysis', controls: bool = False, **kwargs)[source]

Bases: BasePreset

Interactive knee/elbow plot preset using BasePreset.

Hierarchy:

[Presets | EDA | KneePlotPreset]

Relates-to:
  • motivated_by: “v0.15.0: Knee/elbow plots for optimization analysis and cluster validation”

  • implements: “preset: ‘KneePlotPreset’”

  • uses: [“class: ‘BasePreset’”, “plot_type: ‘knee_plot’”]

Contract:
  • pre: “DataFrame has numerical columns for x and y axes”

  • post: “Renders knee plot with optional automatic knee detection”

  • dependency: “Automatic knee detection requires ‘kneed’ package (uv pip install kneed)”

  • controls: “Flexible control configuration via controls parameter”

Complexity:

3

__init__(block_id: str, datasource: DataSource, subscribes_to=None, title: str = 'Knee Plot Analysis', controls: bool = False, **kwargs)[source]

Initialize knee plot preset.

Hierarchy:

[Presets | EDA | KneePlotPreset | Initialization]

Relates-to:
  • motivated_by: “Flexible knee plot with configurable controls using BasePreset”

  • implements: “method: ‘__init__’”

Contract:
  • pre: “datasource contains numerical columns”

  • post: “Preset ready with configured controls or no controls”

  • controls_logic: “controls=False: no controls, controls=True: default controls, controls=dict: custom control config”

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • subscribes_to – State ID(s) to subscribe to

  • title – Chart title

  • controls

    Control configuration: - False (default): No controls, expects values in kwargs - True: Create default controls for all parameters - Dict[str, bool|Control]: Custom control configuration:

    • bool: Enable/disable default control

    • Control: Replace with custom control

  • **kwargs – Additional styling parameters and control values

property default_controls: Dict[str, Control]

Default control definitions for knee plot preset.

Hierarchy:

[Presets | EDA | KneePlotPreset | DefaultControls]

Relates-to:
  • motivated_by: “Define available controls for knee plot”

  • implements: “property: ‘default_controls’”

Contract:
  • pre: “datasource contains numerical columns”

  • post: “Returns dict of Control objects for knee plot parameters”

Returns:

Dictionary mapping control names to Control objects

ML Presets

Machine Learning visualization presets for common ML workflows.

This module provides preset blocks for machine learning visualization.

class dashboard_lego.presets.ml_presets.ModelSummaryBlock(block_id: str, datasource: DataSource, title: str = 'Model Summary', card_style: Dict[str, Any] | None = None, card_className: str | None = None, title_style: Dict[str, Any] | None = None, title_className: str | None = None, content_style: Dict[str, Any] | None = None, content_className: str | None = None, loading_type: str = 'default', **kwargs)[source]

Bases: BaseBlock

A block for displaying a summary of model hyperparameters.

hierarchy:

[Presets | ML | ModelSummaryBlock]

relates-to:
  • motivated_by: “Architectural Conclusion: Model summary blocks are essential for displaying comprehensive model information and statistics”

  • implements: “block: ‘ModelSummaryBlock’”

  • uses: [“block: ‘BaseBlock’”]

rationale:

“Implemented as a custom block inheriting from BaseBlock to provide a flexible layout for displaying key-value data.”

contract:
  • pre: “Datasource must implement get_summary_data() returning a dict.”

  • post: “The block renders a card with the model’s summary data.”

__init__(block_id: str, datasource: DataSource, title: str = 'Model Summary', card_style: Dict[str, Any] | None = None, card_className: str | None = None, title_style: Dict[str, Any] | None = None, title_className: str | None = None, content_style: Dict[str, Any] | None = None, content_className: str | None = None, loading_type: str = 'default', **kwargs)[source]

Initializes the BaseBlock.

Parameters:
  • block_id – A unique identifier for this block instance.

  • datasource – An instance of DataSource or AsyncDataSource that implements the DataSource interface.

  • allow_duplicate_output – If True, allows this block to share output targets with other blocks (useful for overlay scenarios).

layout() Div[source]

Returns the Dash component layout for the block.

dashboard_lego.presets.ml_presets.plot_confusion_matrix(df: DataFrame, y_true_col: str, y_pred_col: str, **kwargs) Figure[source]

Confusion matrix heatmap.

class dashboard_lego.presets.ml_presets.ConfusionMatrixPreset(block_id: str, datasource: DataSource, y_true_col: str, y_pred_col: str, title: str = 'Confusion Matrix', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Bases: BasePreset

Confusion matrix preset using BasePreset.

Refactored from StaticChartBlock in v0.15.

Hierarchy:

[Presets | ML | ConfusionMatrixPreset]

Relates-to:
  • motivated_by: “v0.15.0: ML preset using BasePreset”

  • implements: “preset: ‘ConfusionMatrixPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “Datasource has y_true_col and y_pred_col columns”

  • post: “Renders confusion matrix heatmap”

Complexity:

2

__init__(block_id: str, datasource: DataSource, y_true_col: str, y_pred_col: str, title: str = 'Confusion Matrix', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Initialize confusion matrix preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • y_true_col – Column name for true labels

  • y_pred_col – Column name for predicted labels

  • title – Chart title

  • subscribes_to – State ID(s) to subscribe to

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for confusion matrix preset.

Returns:

Dictionary mapping control names to Control objects

property plot_type: str

Plot type identifier for confusion matrix.

dashboard_lego.presets.ml_presets.plot_roc_curve(df: DataFrame, y_true_col: str, y_score_cols: list, **kwargs) Figure[source]

ROC curve plot (binary or multi-class).

class dashboard_lego.presets.ml_presets.RocAucCurvePreset(block_id: str, datasource: DataSource, y_true_col: str, y_score_cols: list[str], title: str = 'ROC Curve', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Bases: BasePreset

ROC curve preset using BasePreset.

Refactored from StaticChartBlock in v0.15.

Hierarchy:

[Presets | ML | RocAucCurvePreset]

Relates-to:
  • motivated_by: “v0.15.0: ML preset using BasePreset”

  • implements: “preset: ‘RocAucCurvePreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “Datasource has y_true_col and y_score_cols”

  • post: “Renders ROC curve (binary or multi-class)”

Complexity:

3

__init__(block_id: str, datasource: DataSource, y_true_col: str, y_score_cols: list[str], title: str = 'ROC Curve', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Initialize ROC curve preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • y_true_col – Column name for true labels

  • y_score_cols – List of column names for prediction scores

  • title – Chart title

  • subscribes_to – State ID(s) to subscribe to

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for ROC curve preset.

Returns:

Dictionary mapping control names to Control objects

property plot_type: str

Plot type identifier for ROC curve.

dashboard_lego.presets.ml_presets.plot_feature_importance_horizontal(df: DataFrame, x: str, y: str, **kwargs) Figure[source]

Horizontal bar chart for feature importance.

Hierarchy:

[Presets | ML | Plots | FeatureImportance]

Contract:
  • pre: “df has x (importance) and y (feature) columns”

  • post: “Returns sorted horizontal bar chart”

class dashboard_lego.presets.ml_presets.FeatureImportancePreset(block_id: str, datasource: DataSource, feature_col: str, importance_col: str, title: str = 'Feature Importance', subscribes_to: str | List[str] | None = None, controls: bool = True, **kwargs)[source]

Bases: BasePreset

Feature importance preset using BasePreset.

Refactored from StaticChartBlock in v0.15.

Hierarchy:

[Presets | ML | FeatureImportancePreset]

Relates-to:
  • motivated_by: “v0.15: Use BasePreset with plot_registry”

  • implements: “preset: ‘FeatureImportancePreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “Datasource returns df with feature_col and importance_col”

  • post: “Renders sorted horizontal bar chart”

Complexity:

2

__init__(block_id: str, datasource: DataSource, feature_col: str, importance_col: str, title: str = 'Feature Importance', subscribes_to: str | List[str] | None = None, controls: bool = True, **kwargs)[source]

Initialize feature importance preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • feature_col – Column name for feature names

  • importance_col – Column name for importance values

  • title – Chart title

  • subscribes_to – State ID(s) to subscribe to

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for feature importance preset.

Returns:

Dictionary mapping control names to Control objects

property plot_type: str

Plot type identifier for feature importance.

Confusion Matrix Preset

class dashboard_lego.presets.ml_presets.ConfusionMatrixPreset(block_id: str, datasource: DataSource, y_true_col: str, y_pred_col: str, title: str = 'Confusion Matrix', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Bases: BasePreset

Confusion matrix preset using BasePreset.

Refactored from StaticChartBlock in v0.15.

Hierarchy:

[Presets | ML | ConfusionMatrixPreset]

Relates-to:
  • motivated_by: “v0.15.0: ML preset using BasePreset”

  • implements: “preset: ‘ConfusionMatrixPreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “Datasource has y_true_col and y_pred_col columns”

  • post: “Renders confusion matrix heatmap”

Complexity:

2

__init__(block_id: str, datasource: DataSource, y_true_col: str, y_pred_col: str, title: str = 'Confusion Matrix', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Initialize confusion matrix preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • y_true_col – Column name for true labels

  • y_pred_col – Column name for predicted labels

  • title – Chart title

  • subscribes_to – State ID(s) to subscribe to

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for confusion matrix preset.

Returns:

Dictionary mapping control names to Control objects

property plot_type: str

Plot type identifier for confusion matrix.

Feature Importance Preset

class dashboard_lego.presets.ml_presets.FeatureImportancePreset(block_id: str, datasource: DataSource, feature_col: str, importance_col: str, title: str = 'Feature Importance', subscribes_to: str | List[str] | None = None, controls: bool = True, **kwargs)[source]

Bases: BasePreset

Feature importance preset using BasePreset.

Refactored from StaticChartBlock in v0.15.

Hierarchy:

[Presets | ML | FeatureImportancePreset]

Relates-to:
  • motivated_by: “v0.15: Use BasePreset with plot_registry”

  • implements: “preset: ‘FeatureImportancePreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “Datasource returns df with feature_col and importance_col”

  • post: “Renders sorted horizontal bar chart”

Complexity:

2

__init__(block_id: str, datasource: DataSource, feature_col: str, importance_col: str, title: str = 'Feature Importance', subscribes_to: str | List[str] | None = None, controls: bool = True, **kwargs)[source]

Initialize feature importance preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • feature_col – Column name for feature names

  • importance_col – Column name for importance values

  • title – Chart title

  • subscribes_to – State ID(s) to subscribe to

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for feature importance preset.

Returns:

Dictionary mapping control names to Control objects

property plot_type: str

Plot type identifier for feature importance.

ROC AUC Curve Preset

class dashboard_lego.presets.ml_presets.RocAucCurvePreset(block_id: str, datasource: DataSource, y_true_col: str, y_score_cols: list[str], title: str = 'ROC Curve', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Bases: BasePreset

ROC curve preset using BasePreset.

Refactored from StaticChartBlock in v0.15.

Hierarchy:

[Presets | ML | RocAucCurvePreset]

Relates-to:
  • motivated_by: “v0.15.0: ML preset using BasePreset”

  • implements: “preset: ‘RocAucCurvePreset’”

  • uses: [“class: ‘BasePreset’”]

Contract:
  • pre: “Datasource has y_true_col and y_score_cols”

  • post: “Renders ROC curve (binary or multi-class)”

Complexity:

3

__init__(block_id: str, datasource: DataSource, y_true_col: str, y_score_cols: list[str], title: str = 'ROC Curve', subscribes_to: str | List[str] | None = None, controls: bool = False, **kwargs)[source]

Initialize ROC curve preset.

Parameters:
  • block_id – Unique identifier

  • datasource – Data source instance

  • y_true_col – Column name for true labels

  • y_score_cols – List of column names for prediction scores

  • title – Chart title

  • subscribes_to – State ID(s) to subscribe to

  • controls – Control configuration (False=no controls, True=default controls)

  • **kwargs – Additional styling parameters

property default_controls: Dict[str, Control]

Default control definitions for ROC curve preset.

Returns:

Dictionary mapping control names to Control objects

property plot_type: str

Plot type identifier for ROC curve.

Layout Presets

Pre-built layout patterns for common dashboard arrangements.

Layout presets for DashboardPage using the extended layout API.

hierarchy:

[Feature | Layout System | Presets]

relates-to:
  • motivated_by: “Provide reusable, ergonomic layouts for common dashboard patterns”

  • implements: [“module: ‘presets.layouts’”]

  • uses: [“class: ‘BaseBlock’”, “class: ‘DashboardPage’”]

rationale:

“Encapsulate frequently used grid structures to speed up page assembly.”

contract:
  • pre: “Functions receive blocks (BaseBlock instances)”

  • post: “Functions return a list-of-rows compatible with DashboardPage layout API”

dashboard_lego.presets.layouts.one_column(blocks: Sequence[BaseBlock], *, block_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Single full-width column per row with customizable options.

hierarchy:

[Feature | Layout System | Presets | one_column]

relates-to:
  • motivated_by: “Common pattern for stacked content with customization”

  • implements: “function: ‘one_column’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Keeps content vertically stacked with consistent spacing and customizable styling options.”

contract:
  • pre: “blocks is a non-empty sequence of BaseBlock”

  • post: “Returns rows where each row contains a single full-width column with applied options”

Parameters:
  • blocks – Sequence of BaseBlock instances to display

  • block_options – Optional options to apply to each block (style, className, etc.)

  • row_options – Optional options to apply to each row (g, align, justify, etc.)

dashboard_lego.presets.layouts.two_column_6_6(left: BaseBlock, right: BaseBlock, *, left_options: Dict[str, Any] | None = None, right_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Two equal columns on medium+ screens with customizable options.

hierarchy:

[Feature | Layout System | Presets | two_column_6_6]

relates-to:
  • motivated_by: “Balanced two-column layouts with customization”

  • implements: “function: ‘two_column_6_6’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Even split for symmetric content presentation with customizable styling options.”

contract:
  • pre: “left and right are BaseBlock”

  • post: “Returns a single row with two 6-unit columns with applied options”

Parameters:
  • left – Left column block

  • right – Right column block

  • left_options – Optional options for left column (style, className, etc.)

  • right_options – Optional options for right column (style, className, etc.)

  • row_options – Optional options for the row (g, align, justify, etc.)

dashboard_lego.presets.layouts.two_column_8_4(main: BaseBlock, side: BaseBlock, *, main_options: Dict[str, Any] | None = None, side_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Main content with a narrower sidebar with customizable options.

hierarchy:

[Feature | Layout System | Presets | two_column_8_4]

relates-to:
  • motivated_by: “Content-first pages with secondary sidebar and customization”

  • implements: “function: ‘two_column_8_4’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Allocates more space to primary content with customizable styling options.”

contract:
  • pre: “main and side are BaseBlock”

  • post: “Returns a single row with 8/4 split with applied options”

Parameters:
  • main – Main content block

  • side – Sidebar block

  • main_options – Optional options for main column (style, className, etc.)

  • side_options – Optional options for side column (style, className, etc.)

  • row_options – Optional options for the row (g, align, justify, etc.)

dashboard_lego.presets.layouts.three_column_4_4_4(a: BaseBlock, b: BaseBlock, c: BaseBlock, *, a_options: Dict[str, Any] | None = None, b_options: Dict[str, Any] | None = None, c_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Three equal columns on medium+ screens with customizable options.

hierarchy:

[Feature | Layout System | Presets | three_column_4_4_4]

relates-to:
  • motivated_by: “Cards in a 3-up grid with customization”

  • implements: “function: ‘three_column_4_4_4’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Common gallery and card layout with customizable styling options.”

contract:
  • pre: “a, b, c are BaseBlock”

  • post: “Returns a single row with 4/4/4 split with applied options”

Parameters:
  • a – First column block

  • b – Second column block

  • c – Third column block

  • a_options – Optional options for first column (style, className, etc.)

  • b_options – Optional options for second column (style, className, etc.)

  • c_options – Optional options for third column (style, className, etc.)

  • row_options – Optional options for the row (g, align, justify, etc.)

dashboard_lego.presets.layouts.sidebar_main_3_9(side: BaseBlock, main: BaseBlock, *, side_options: Dict[str, Any] | None = None, main_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Narrow sidebar with wide main area with customizable options.

hierarchy:

[Feature | Layout System | Presets | sidebar_main_3_9]

relates-to:
  • motivated_by: “Classic dashboard layout with customization”

  • implements: “function: ‘sidebar_main_3_9’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Emphasizes content while providing space for filters or summaries with customizable styling options.”

contract:
  • pre: “side and main are BaseBlock”

  • post: “Returns a single row with 3/9 split with applied options”

Parameters:
  • side – Sidebar block

  • main – Main content block

  • side_options – Optional options for sidebar column (style, className, etc.)

  • main_options – Optional options for main column (style, className, etc.)

  • row_options – Optional options for the row (g, align, justify, etc.)

dashboard_lego.presets.layouts.kpi_row_top(kpi_blocks: Sequence[BaseBlock], content_rows: List[List[BaseBlock]], *, kpi_options: Dict[str, Any] | None = None, kpi_row_options: Dict[str, Any] | None = None, content_row_options: Dict[str, Any] | None = None)[source]

KPIs in a tight top row, with content rows below with customizable options.

hierarchy:

[Feature | Layout System | Presets | kpi_row_top]

relates-to:
  • motivated_by: “Dashboards commonly present KPIs on top with customization”

  • implements: “function: ‘kpi_row_top’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Provides a compact summary before detailed content with customizable styling options.”

contract:
  • pre: “kpi_blocks is a sequence, content_rows is a list of rows”

  • post: “Returns a layout with KPI row and appended content rows with applied options”

Parameters:
  • kpi_blocks – Sequence of KPI blocks to display in the top row

  • content_rows – List of content rows to display below KPIs

  • kpi_options – Optional options to apply to each KPI block (style, className, etc.)

  • kpi_row_options – Optional options for the KPI row (g, align, justify, etc.)

  • content_row_options – Optional options for content rows (g, align, justify, etc.)

Layout Functions

dashboard_lego.presets.layouts.one_column(blocks: Sequence[BaseBlock], *, block_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Single full-width column per row with customizable options.

hierarchy:

[Feature | Layout System | Presets | one_column]

relates-to:
  • motivated_by: “Common pattern for stacked content with customization”

  • implements: “function: ‘one_column’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Keeps content vertically stacked with consistent spacing and customizable styling options.”

contract:
  • pre: “blocks is a non-empty sequence of BaseBlock”

  • post: “Returns rows where each row contains a single full-width column with applied options”

Parameters:
  • blocks – Sequence of BaseBlock instances to display

  • block_options – Optional options to apply to each block (style, className, etc.)

  • row_options – Optional options to apply to each row (g, align, justify, etc.)

dashboard_lego.presets.layouts.two_column_6_6(left: BaseBlock, right: BaseBlock, *, left_options: Dict[str, Any] | None = None, right_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Two equal columns on medium+ screens with customizable options.

hierarchy:

[Feature | Layout System | Presets | two_column_6_6]

relates-to:
  • motivated_by: “Balanced two-column layouts with customization”

  • implements: “function: ‘two_column_6_6’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Even split for symmetric content presentation with customizable styling options.”

contract:
  • pre: “left and right are BaseBlock”

  • post: “Returns a single row with two 6-unit columns with applied options”

Parameters:
  • left – Left column block

  • right – Right column block

  • left_options – Optional options for left column (style, className, etc.)

  • right_options – Optional options for right column (style, className, etc.)

  • row_options – Optional options for the row (g, align, justify, etc.)

dashboard_lego.presets.layouts.two_column_8_4(main: BaseBlock, side: BaseBlock, *, main_options: Dict[str, Any] | None = None, side_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Main content with a narrower sidebar with customizable options.

hierarchy:

[Feature | Layout System | Presets | two_column_8_4]

relates-to:
  • motivated_by: “Content-first pages with secondary sidebar and customization”

  • implements: “function: ‘two_column_8_4’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Allocates more space to primary content with customizable styling options.”

contract:
  • pre: “main and side are BaseBlock”

  • post: “Returns a single row with 8/4 split with applied options”

Parameters:
  • main – Main content block

  • side – Sidebar block

  • main_options – Optional options for main column (style, className, etc.)

  • side_options – Optional options for side column (style, className, etc.)

  • row_options – Optional options for the row (g, align, justify, etc.)

dashboard_lego.presets.layouts.three_column_4_4_4(a: BaseBlock, b: BaseBlock, c: BaseBlock, *, a_options: Dict[str, Any] | None = None, b_options: Dict[str, Any] | None = None, c_options: Dict[str, Any] | None = None, row_options: Dict[str, Any] | None = None)[source]

Three equal columns on medium+ screens with customizable options.

hierarchy:

[Feature | Layout System | Presets | three_column_4_4_4]

relates-to:
  • motivated_by: “Cards in a 3-up grid with customization”

  • implements: “function: ‘three_column_4_4_4’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Common gallery and card layout with customizable styling options.”

contract:
  • pre: “a, b, c are BaseBlock”

  • post: “Returns a single row with 4/4/4 split with applied options”

Parameters:
  • a – First column block

  • b – Second column block

  • c – Third column block

  • a_options – Optional options for first column (style, className, etc.)

  • b_options – Optional options for second column (style, className, etc.)

  • c_options – Optional options for third column (style, className, etc.)

  • row_options – Optional options for the row (g, align, justify, etc.)

dashboard_lego.presets.layouts.kpi_row_top(kpi_blocks: Sequence[BaseBlock], content_rows: List[List[BaseBlock]], *, kpi_options: Dict[str, Any] | None = None, kpi_row_options: Dict[str, Any] | None = None, content_row_options: Dict[str, Any] | None = None)[source]

KPIs in a tight top row, with content rows below with customizable options.

hierarchy:

[Feature | Layout System | Presets | kpi_row_top]

relates-to:
  • motivated_by: “Dashboards commonly present KPIs on top with customization”

  • implements: “function: ‘kpi_row_top’ with options”

  • uses: [“interface: ‘BaseBlock’”]

rationale:

“Provides a compact summary before detailed content with customizable styling options.”

contract:
  • pre: “kpi_blocks is a sequence, content_rows is a list of rows”

  • post: “Returns a layout with KPI row and appended content rows with applied options”

Parameters:
  • kpi_blocks – Sequence of KPI blocks to display in the top row

  • content_rows – List of content rows to display below KPIs

  • kpi_options – Optional options to apply to each KPI block (style, className, etc.)

  • kpi_row_options – Optional options for the KPI row (g, align, justify, etc.)

  • content_row_options – Optional options for content rows (g, align, justify, etc.)