Skip to content

TileMatrix#

TileMatrix #

TileMatrix(
    data: Union[DataType, DataFrame],
    *,
    widget_id: Optional[str] = None,
    max_columns: Optional[int] = None,
    item: Optional[Union[TileMatrixItem, str]] = None
)

Spec for Tile Matrix Widget.

Construct spec for the Tile Matrix Widget.

Parameters:

Name Type Description Default
data Union[DataType, DataFrame]

data to be used by widget. Accepts Storages as well as raw data.

required
widget_id Optional[str]

unique widget id in a dashboard.

None
max_columns Optional[int]

maximum number of columns to be displayed.

None
item Optional[Union[TileMatrixItem, str]]

Tile Matrix item. If not provided, it will look into the first column of the data and decide the item type.

None

Examples:#

Create a minimal Tile Matrix Widget
1
2
3
4
5
6
7
8
9
import pandas as pd
from engineai.sdk.dashboard.dashboard import Dashboard
from engineai.sdk.dashboard.widgets import tile_matrix

data = pd.DataFrame([{"number": i} for i in range(1, 5)])

tile_widget = tile_matrix.TileMatrix(data=data)

Dashboard(content=tile_widget)
Create a Tile Matrix Widget with item as string
1
2
3
4
5
6
7
8
9
import pandas as pd
from engineai.sdk.dashboard.dashboard import Dashboard
from engineai.sdk.dashboard.widgets import tile_matrix

data = pd.DataFrame([{"number": i} for i in range(1, 5)])

tile_widget = tile_matrix.TileMatrix(data=data, item="number")

Dashboard(content=tile_widget)

Items#

Chart#

Create a Tile Matrix Widget with Chart Item
import pandas as pd
from engineai.sdk.dashboard.dashboard import Dashboard
from engineai.sdk.dashboard.widgets import tile_matrix

data = pd.DataFrame([{"chart": [1, 2, 3, 4, 5]} for _ in range(1, 5)])

tile_widget = tile_matrix.TileMatrix(
    data=data, item=tile_matrix.LineChartItem(data_column="chart")
)

Dashboard(content=tile_widget)

AreaChartItem #

AreaChartItem(
    *,
    data_column: TemplatedStringItem,
    label: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    icon: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    link: Optional[Actions] = None,
    formatting: Optional[NumberFormatting] = None,
    styling: Optional[
        Union[Palette, AreaChartItemStyling]
    ] = None,
    reference_line: Optional[
        Union[int, float, DataField]
    ] = None
)

Spec for Tile Matrix Area Chart Item.

Construct spec for the TileMatrixAreaChartItem class.

Parameters:

Name Type Description Default
data_column TemplatedStringItem

column that has the value to be represented.

required
label Optional[Union[TemplatedStringItem, DataField]]

Label text to be displayed.

None
icon Optional[Union[TemplatedStringItem, DataField]]

icon to be displayed.

None
link Optional[Actions]

link or action to be executed in the URL Icon.

None
formatting Optional[NumberFormatting]

formatting spec.

None
styling Optional[Union[Palette, AreaChartItemStyling]]

styling spec.

None
reference_line Optional[Union[int, float, DataField]]

spec for a fixed reference line.

None

ColumnChartItem #

ColumnChartItem(
    *,
    data_column: TemplatedStringItem,
    label: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    icon: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    link: Optional[Actions] = None,
    formatting: Optional[NumberFormatting] = None,
    styling: Optional[
        Union[Palette, ColumnChartItemStyling]
    ] = None,
    reference_line: Optional[
        Union[int, float, DataField]
    ] = None
)

Spec for Tile Matrix Column Chart Item.

Construct spec for the TileMatrixColumnChartItem class.

Parameters:

Name Type Description Default
data_column TemplatedStringItem

column that has the value to be represented.

required
label Optional[Union[TemplatedStringItem, DataField]]

Label text to be displayed.

None
icon Optional[Union[TemplatedStringItem, DataField]]

icon to be displayed.

None
link

link or action to be executed in the URL Icon.

None
formatting Optional[NumberFormatting]

formatting spec.

None
styling Optional[Union[Palette, ColumnChartItemStyling]]

styling spec.

None
reference_line Optional[Union[int, float, DataField]]

spec for a fixed reference line.

None

LineChartItem #

LineChartItem(
    *,
    data_column: TemplatedStringItem,
    label: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    icon: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    link: Optional[Actions] = None,
    formatting: Optional[NumberFormatting] = None,
    styling: Optional[
        Union[Palette, LineChartItemStyling]
    ] = None,
    reference_line: Optional[
        Union[int, float, DataField]
    ] = None
)

Spec for Tile Matrix Line Chart Item.

Construct spec for the TileMatrixLineChartItem class.

Parameters:

Name Type Description Default
data_column TemplatedStringItem

column that has the value to be represented.

required
label Optional[Union[TemplatedStringItem, DataField]]

Label text to be displayed.

None
icon Optional[Union[TemplatedStringItem, DataField]]

icon to be displayed.

None
link Optional[Actions]

link or action to be executed in the URL Icon.

None
formatting Optional[NumberFormatting]

formatting spec.

None
styling Optional[Union[Palette, LineChartItemStyling]]

styling spec.

None
reference_line Optional[Union[int, float, DataField]]

spec for a fixed reference line.

None

StackedBarChartItem #

StackedBarChartItem(
    *,
    data_column: TemplatedStringItem,
    label: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    icon: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    bar_label_column: Optional[TemplatedStringItem] = None,
    link: Optional[Actions] = None,
    formatting: Optional[NumberFormatting] = None,
    styling: Optional[
        Union[Palette, StackedBarChartItemStyling]
    ] = None
)

Spec for Tile Matrix Stacked Bar Chart Item.

Construct spec for the TileMatrixStackedBarChartItem class.

Parameters:

Name Type Description Default
data_column TemplatedStringItem

column that has the value to be represented.

required
label Optional[Union[TemplatedStringItem, DataField]]

Label text to be displayed.

None
icon Optional[Union[TemplatedStringItem, DataField]]

icon to be displayed.

None
bar_label_column Optional[TemplatedStringItem]

column in data that will have the labels used by each bar.

None
link Optional[Actions]

link or action to be executed in the URL Icon.

None
formatting Optional[NumberFormatting]

formatting spec.

None
styling Optional[Union[Palette, StackedBarChartItemStyling]]

styling spec.

None

Styling#

AreaChartItemStyling #

AreaChartItemStyling(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for styling used by Spark Area Chart Item.

Construct for BaseItemStyling class.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec]

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key.

None

ColumnChartItemStyling #

ColumnChartItemStyling(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for styling used by Spark Column Chart Item.

Construct for BaseItemStyling class.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec]

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key.

None

LineChartItemStyling #

LineChartItemStyling(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for styling used by Spark Line Chart Item.

Construct for BaseItemStyling class.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec]

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key.

None

StackedBarChartItemStyling #

StackedBarChartItemStyling(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for styling used by Stacked Bar Chart Item.

Construct for BaseItemStyling class.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec]

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key.

None

Number#

Create a Tile Matrix Widget with Number Item
import pandas as pd
from engineai.sdk.dashboard.dashboard import Dashboard
from engineai.sdk.dashboard.widgets import tile_matrix

data = pd.DataFrame([{"number": i} for i in range(1, 5)])

tile_widget = tile_matrix.TileMatrix(
    data=data, item=tile_matrix.NumberItem(data_column="number")
)

Dashboard(content=tile_widget)

NumberItem #

NumberItem(
    *,
    data_column: TemplatedStringItem,
    label: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    icon: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    link: Optional[Actions] = None,
    formatting: Optional[NumberFormatting] = None,
    styling: Optional[TileMatrixNumberItemStyling] = None,
    required: bool = True
)

Spec for Tile Matrix Number Item.

Construct spec for the TileMatrixNumberItem class.

Parameters:

Name Type Description Default
data_column TemplatedStringItem

column that has the value to be represented.

required
label Optional[Union[TemplatedStringItem, DataField]]

Label text to be displayed.

None
icon Optional[Union[TemplatedStringItem, DataField]]

icon to be displayed.

None
link Optional[Actions]

link or action to be executed in the URL Icon.

None
formatting Optional[NumberFormatting]

formatting spec.

None
styling Optional[TileMatrixNumberItemStyling]

styling spec.

None
required bool

Flag to make Number item mandatory.

True

Styling#

NumberStylingArrow #

NumberStylingArrow(
    *,
    data_column: Optional[TemplatedStringItem] = None,
    color_divergent: Divergent
)

Spec for Number Arrow Styling class.

Construct spec Number Arrow Styling.

Parameters:

Name Type Description Default
color_divergent ColorDivergent

specs for color.

required
data_column TemplatedStringItem

styling value key.

None

NumberStylingChip #

NumberStylingChip(
    *,
    color_spec: ColorSpec,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Number Chip Styling class.

Construct spec for Number Chip Styling.

Parameters:

Name Type Description Default
color_spec ColorSpec

specs for color.

required
data_column Optional[TemplatedStringItem]

styling value key. Defaults to None.

None

NumberStylingDot #

NumberStylingDot(
    *,
    color_spec: ColorSpec,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Number Dot Styling class.

Construct spec for Number Dot Styling.

Parameters:

Name Type Description Default
color_spec ColorSpec

specs for color.

required
data_column Optional[TemplatedStringItem]

styling value key.

None

NumberStylingFont #

NumberStylingFont(
    *,
    color_spec: ColorSpec,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Number Font Styling class.

Construct spec for Number Font Styling.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec

specs for color.

required
data_column Optional[TemplatedStringItem]

styling value key. Defaults to None.

None

NumberStylingBackgroundArrow #

NumberStylingBackgroundArrow(
    *,
    color_divergent: Divergent,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Tile Matrix Styling Background Arrow class.

Construct spec for TileMatrixStylingBackgroundArrow class.

Parameters:

Name Type Description Default
color_divergent Divergent

specs for color.

required
data_column Optional[TemplatedStringItem]

styling value key.

None

NumberStylingBackground #

NumberStylingBackground(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Tile Matrix Styling Background class.

Construct spec for TileMatrixStylingBackground class.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec]

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key.

None

Text#

Create a Tile Matrix Widget with Text Item
import pandas as pd
from engineai.sdk.dashboard.dashboard import Dashboard
from engineai.sdk.dashboard.widgets import tile_matrix

data = pd.DataFrame([{"text": ["a", "b", "c", "d", "e"]}])

tile_widget = tile_matrix.TileMatrix(
    data=data, item=tile_matrix.TextItem(data_column="text")
)

Dashboard(content=tile_widget)

TextItem #

TextItem(
    *,
    data_column: TemplatedStringItem,
    label: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    icon: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    link: Optional[Actions] = None,
    formatting: Optional[TextFormatting] = None,
    styling: Optional[TileMatrixTextItemStyling] = None
)

Spec for Tile Matrix Text Item.

Construct spec for the TileMatrixTextItem class.

Parameters:

Name Type Description Default
data_column TemplatedStringItem

column that has the value to be represented.

required
label Optional[Union[TemplatedStringItem, DataField]]

Label text to be displayed.

None
icon Optional[Union[TemplatedStringItem, DataField]]

icon to be displayed.

None
link Optional[Actions]

link or action to be executed in the URL Icon.

None
formatting Optional[TextFormatting]

formatting spec.

None
styling Optional[TileMatrixTextItemStyling]

styling spec.

None

Styling#

TextStylingDot #

TextStylingDot(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Text Dot Styling Class.

Construct spec for Text Dot Styling.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key. Defaults to None.

None

TextStylingFont #

TextStylingFont(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Text Font Styling Class.

Construct spec for Text Font Styling.

Parameters:

Name Type Description Default
color_spec ColorSpec

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key. Defaults to None.

None

TextStylingBackground #

TextStylingBackground(
    *,
    color_spec: Optional[ColorSpec] = None,
    data_column: Optional[TemplatedStringItem] = None
)

Spec for Tile Matrix Text Background Styling class.

Construct spec for Tile Matrix Number Chip Styling.

Parameters:

Name Type Description Default
color_spec Optional[ColorSpec]

specs for color.

None
data_column Optional[TemplatedStringItem]

styling value key.

None

Types#

TileMatrixItem module-attribute #

TileMatrixItem = Union[
    NumberItem, TextItem, BaseTileMatrixChartItem
]

TileMatrixChartStyling module-attribute #

TileMatrixNumberItemStyling module-attribute #

TileMatrixTextItemStyling module-attribute #

TileMatrixTextItemStyling = Union[
    TextStylingDot, TextStylingFont, TextStylingBackground
]

Actions module-attribute #

Actions = Union[UrlLink, ExternalEvent]

BaseTileMatrixChartItem #

BaseTileMatrixChartItem(
    *,
    data_column: TemplatedStringItem,
    label: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    icon: Optional[
        Union[TemplatedStringItem, DataField]
    ] = None,
    link: Optional[Actions] = None,
    formatting: Optional[ItemFormatting] = None,
    styling: Optional[Styling] = None,
    required: bool = True
)

Spec for Base Tile Matrix Chart Items.

Construct spec for the BaseTileMatrixItem class.

Parameters:

Name Type Description Default
data_column TemplatedStringItem

column that has the value to be represented.

required
label Optional[Union[TemplatedStringItem, DataField]]

Label text to be displayed.

None
icon Optional[Union[TemplatedStringItem, DataField]]

icon to be displayed.

None
link Optional[Actions]

link or action to be executed in the URL Icon.

None
formatting Optional[ItemFormatting]

formatting spec.

None
styling Optional[Styling]

styling spec.

None
required bool

Flag to make Number item mandatory.

True