Skip to content

GeoPlayback#

GeoPlayback #

GeoPlayback(
    data: Union[DataType, T],
    *,
    playback: Playback,
    series: Optional[MapSeries] = None,
    region_column: str = "region",
    color_axis: Optional[ColorAxis] = None,
    widget_id: Optional[str] = None,
    title: Optional[WidgetTitleType] = None,
    legend_position: LegendPosition = LegendPosition.BOTTOM,
    styling: Optional[MapStyling] = None,
    region: Region = Region.WORLD,
    tooltips: Optional[TooltipItems] = None
)

Widget for tailored geographic data visualization.

Allows the construction of a widget specifically tailored for geographical data visualization.

Constructor for Map Geo widget.

Parameters:

Name Type Description Default
data Union[DataType, T]

data source for the widget.

required
series Optional[MapSeries]

Series to be added to y axis.

None
region_column str

key to match region code in DS.

'region'
widget_id Optional[str]

unique widget id in a dashboard.

None
color_axis Optional[ColorAxis]

color axis spec.

None
title Optional[WidgetTitleType]

title of widget can be either a string (fixed value) or determined by a value from another widget using a WidgetField.

None
legend_position LegendPosition

location of position relative to data, maps.

BOTTOM
styling Optional[MapStyling]

styling for the map.

None
region Region

sets the region os the Map.

WORLD
tooltips Optional[TooltipItems]

tooltip items to be displayed at Chart level.

None
playback Playback

playback spec for the map.

required

Examples:#

Create a minimal Geo Playback widget
import pandas as pd
from engineai.sdk.dashboard.dashboard import Dashboard
from engineai.sdk.dashboard.widgets import maps

map_data = {}
frames = []
data = [[76, 24], [23, 53], [13, 11]]

for month, values in zip(["Jan", "Feb", "Mar"], data):
    map_data[month] = pd.DataFrame(
        {
            "region": ["PT", "GB"],
            "value": values,
        }
    )
    frames.append({"id": month})

Dashboard(
    app_slug="engineai-docs-steps",
    workspace_slug="engineai-docs-steps",
    content=maps.GeoPlayback(
        data=map_data,
        playback=maps.Playback(
            data=pd.DataFrame(frames),
        ),
    ),
)

Playback#

Playback #

Playback(
    *,
    id_column: str = "id",
    data: Union[DataType, DataFrame],
    label_column: Optional[str] = None,
    label_formatting: Optional[FormattingType] = None,
    update_interval: int = 1,
    loop: bool = False,
    auto_play: bool = False,
    initial_state: Optional[InitialState] = None
)

Spec for Playback widget.

Construct spec for Playback widget.

Parameters:

Name Type Description Default
id_column str

Id Column to match the field in the Data for the Frame.

'id'
data Union[DataType, DataFrame]

data for the widget. Can be a pandas dataframe or Storage object if the data is to be retrieved from a storage.

required
label_column Optional[str]

Label Column to match the field in the Data for the Frame Label.

None
label_formatting Optional[FormattingType]

Class to modify the Frame Label Formatting.

None
update_interval int

Configuration for update interval.

1
loop bool

Configuration for Loop.

False
auto_play bool

Configuration for Auto Play.

False
initial_state Optional[InitialState]

Class to add an initial state.

None

InitialState #

InitialState(
    *,
    start_frame_id: Optional[str] = None,
    end_frame_id: Optional[str] = None
)

Spec for InitialState widget.

Construct spec for Playback Initial State widget.

Parameters:

Name Type Description Default
start_frame_id Optional[str]

column in Pandas DataFrame to define the starting frame.

None
end_frame_id Optional[str]

column in Pandas DataFrame to define the ending frame.

None