Dashboard Card Types

Alloy supports 18 different card types that can be rendered in your dashboard. Each card type has a specific structure in the spec and data_preview fields that you can use to render them on your own platform.

Card Type Overview

The following card types are available:

  • bar - Bar Chart

  • line - Line Chart

  • area - Area Chart

  • pie - Pie Chart

  • donut - Donut Chart

  • table - Data Table

  • kpi - KPI Card

  • insight - AI Insight (textual insights)

  • heatmap - Heatmap

  • scatter - Scatter Plot

  • bubble - Bubble Chart

  • histogram - Histogram

  • boxplot - Box Plot

  • radar - Radar Chart

  • funnel - Funnel Chart

  • gauge - Gauge

  • geomap - Geo Map

  • choropleth - Choropleth Map

Common Structure

All card types share the same base structure:

Card Type Specifications

Bar Chart (bar)

Spec Fields:

  • x (string, required): Field name for x-axis/categories

  • y (string, required): Field name for y-axis/values

  • aggregation (string, optional): Aggregation function (sum, avg, count, min, max)

  • grouping (string, optional): Field name for grouping/series

  • color (string, optional): Field name for color encoding

Example:

Line Chart (line)

Spec Fields:

  • x (string, required): Field name for x-axis (typically time)

  • y (string, required): Field name for y-axis/values

  • aggregation (string, optional): Aggregation function

  • grouping (string, optional): Field name for multiple series

Example:

Area Chart (area)

Spec Fields:

  • x (string, required): Field name for x-axis

  • y (string, required): Field name for y-axis/values

  • aggregation (string, optional): Aggregation function

  • stacked (boolean, optional): Whether to stack areas

Example:

Pie Chart (pie)

Spec Fields:

  • values (string, required): Field name for values

  • grouping (string, required): Field name for categories

  • aggregation (string, optional): Aggregation function

Example:

Donut Chart (donut)

Spec Fields:

  • values (string, required): Field name for values

  • grouping (string, required): Field name for categories

  • aggregation (string, optional): Aggregation function

  • inner_radius (number, optional): Inner radius ratio (0-1)

Example:

Table (table)

Spec Fields:

  • columns (array, required): Array of column definitions

    • Each column: {"key": "field_name", "label": "Display Label"}

  • sorted_by (string, optional): Field name to sort by

  • sort_direction (string, optional): asc or desc

  • limit (number, optional): Maximum rows to display

Example:

KPI Card (kpi)

Spec Fields:

  • value (number, required): The KPI value

  • value_from_column (string, optional): Source column name

  • operation (string, optional): Operation used (sum, mean, count, min, max)

  • unit (string, optional): Unit of measurement (e.g., "$", "%", "hrs")

  • trend (string, optional): Trend indicator (e.g., "+12% vs last month")

  • target (number, optional): Target value

Example:

AI Insight (insight)

Spec Fields:

  • Empty object {} (no spec fields)

Description Field:

  • Contains the AI-generated insight text

Example:

Heatmap (heatmap)

Spec Fields:

  • x (string, required): Field name for x-axis

  • y (string, required): Field name for y-axis

  • color (string, required): Field name for color intensity

  • aggregation (string, optional): Aggregation function

Example:

Scatter Plot (scatter)

Spec Fields:

  • x (string, required): Field name for x-axis

  • y (string, required): Field name for y-axis

  • color (string, optional): Field name for color encoding

  • size_by (string, optional): Field name for point size

Example:

Bubble Chart (bubble)

Spec Fields:

  • x (string, required): Field name for x-axis

  • y (string, required): Field name for y-axis

  • size_by (string, required): Field name for bubble size

  • color (string, optional): Field name for color encoding

Example:

Histogram (histogram)

Spec Fields:

  • x (string, required): Field name for x-axis (numeric field)

  • aggregation (string, optional): Usually count

  • bin_size (number, optional): Size of bins

Example:

Box Plot (boxplot)

Spec Fields:

  • grouping (string, required): Field name for groups

  • values (string, required): Field name for values

Example:

Radar Chart (radar)

Spec Fields:

  • axes (array, required): Array of axis names

Example:

Funnel Chart (funnel)

Spec Fields:

  • steps (array, required): Array of step objects

    • Each step: {"label": "Step Name", "value": number}

Example:

Gauge (gauge)

Spec Fields:

  • value (number, required): Current value

  • min (number, optional): Minimum value

  • max (number, optional): Maximum value

  • target (number, optional): Target value

  • units (string, optional): Unit of measurement

Example:

Geo Map (geomap)

Spec Fields:

  • region_field (string, required): Field name containing region codes (e.g., country codes)

  • value_field (string, required): Field name for values

  • geo_scope (string, optional): Geographic scope (world, country, etc.)

Example:

Choropleth Map (choropleth)

Spec Fields:

  • region_field (string, required): Field name containing region codes

  • value_field (string, required): Field name for values

  • geo_scope (string, optional): Geographic scope (e.g., nigeria, usa, world)

  • color_scale (string, optional): Color scale name (e.g., Blues, Reds)

Example:

Rendering Guidelines

General Approach

1

Sort by Position

Always render chart_blocks in order of their position field.

2

Use Data Preview

The data_preview field contains the processed data ready for rendering — use it as the source for visuals.

3

Respect Spec

The spec field contains configuration that should guide your rendering (axes, aggregations, grouping, etc.).

4

Handle Missing Data

Some fields may be optional — handle missing/optional fields gracefully in your UI (fallbacks, defaults, or hiding unsupported options).

  • Charts: Chart.js, D3.js, Recharts, Plotly.js, Apache ECharts

  • Tables: Built-in HTML tables, DataTables, AG Grid

  • Maps: Leaflet, Mapbox, Google Maps API

  • KPIs: Custom components or libraries like react-gauge-chart

Example Rendering Flow

If you want, I can:

  • Convert each card type section into reusable snippets (for quick copy/paste).

  • Provide example React/Chart.js or D3 renderers for one or more card types.