Skip to content

Widgets#

Widgets are the fundamental building blocks for creating interactive dashboards in the Engine AI Platform. They transform data into visual components that users can interact with, enabling dynamic and data-driven visualizations.

Widget Types#

The Platform SDK provides two main categories of widgets:

Display Widgets#

These widgets visualize data in various formats:

  • Cartesian - 2D coordinate system plots for X/Y data relationships
  • Categorical - Category-based data visualization with various series types
  • Content - Displays rich text content using markdown formatting
  • Maps - Geographical data visualization with spatial context
  • Pie - Circular charts showing proportional data
  • Sankey - Flow diagrams showing data movement between categories
  • Table - Tabular data display with customizable columns, pagination, and formatting
  • Tile - Compact data cards displaying key metrics
  • Tile Matrix - Grid layout of multiple data tiles
  • Timeseries - Time-based data visualization with charts, legends, and navigation

Selectable Widgets#

These widgets allow user selection and drive interactivity:

  • Search - Text-based search with dropdown selection
  • Select - Dropdown menu for option selection
  • Toggle - Switch-style option selection
  • Table - Can also function as selectable when rows are clickable

Basic Usage#

All widgets follow a consistent pattern where they have a data property to specify the underlying data, followed by multiple properties to configure and style the widget, such as tooltips, chart series, colors, and other customization options.

For more details and examples on each widget, refer to the API Reference.

import pandas as pd
from engineai.sdk.dashboard.dashboard import Dashboard
from engineai.sdk.dashboard.widgets import table

# Prepare your data
data = pd.DataFrame({
    "name": ["Person A", "Person B", "Person C"],
    "age": [29, 35, 30]
})

# Create the widget
table_widget = table.Table(
    data=data
    columns=["name", "age"],
)

# Add to dashboard
Dashboard(
    workspace_slug="my-workspace",
    app_slug="my-app",
    slug="my-dashboard",
    content=table_widget
)

Getting Data#

Widgets can display both static and live data depending on your dashboard requirements:

  • Static Data - Use pandas DataFrames created from lists, dictionaries, or files (CSV, JSON, etc.) for fixed datasets
  • Live Data - Connect to external data sources like HTTP APIs, DuckDB for cloud storage, or Snowflake data warehouses for real-time updates

The Platform SDK provides various data dependencies to power your widgets with different data sources and enable interactive behaviors. For comprehensive details on all available data options including data frames, data connectors, widget linking, and page-level dependencies, see the Dependencies Overview.

Widget Linking#

Widgets can be linked together to create user driven interactions. For example, a selectable widget can filter data displayed in a table or chart based on user selection. For more details, see the Widget Linking guide.