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/categoriesy(string, required): Field name for y-axis/valuesaggregation(string, optional): Aggregation function (sum,avg,count,min,max)grouping(string, optional): Field name for grouping/seriescolor(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/valuesaggregation(string, optional): Aggregation functiongrouping(string, optional): Field name for multiple series
Example:
Area Chart (area)
Spec Fields:
x(string, required): Field name for x-axisy(string, required): Field name for y-axis/valuesaggregation(string, optional): Aggregation functionstacked(boolean, optional): Whether to stack areas
Example:
Pie Chart (pie)
Spec Fields:
values(string, required): Field name for valuesgrouping(string, required): Field name for categoriesaggregation(string, optional): Aggregation function
Example:
Donut Chart (donut)
Spec Fields:
values(string, required): Field name for valuesgrouping(string, required): Field name for categoriesaggregation(string, optional): Aggregation functioninner_radius(number, optional): Inner radius ratio (0-1)
Example:
Table (table)
Spec Fields:
columns(array, required): Array of column definitionsEach column:
{"key": "field_name", "label": "Display Label"}
sorted_by(string, optional): Field name to sort bysort_direction(string, optional):ascordesclimit(number, optional): Maximum rows to display
Example:
KPI Card (kpi)
Spec Fields:
value(number, required): The KPI valuevalue_from_column(string, optional): Source column nameoperation(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-axisy(string, required): Field name for y-axiscolor(string, required): Field name for color intensityaggregation(string, optional): Aggregation function
Example:
Scatter Plot (scatter)
Spec Fields:
x(string, required): Field name for x-axisy(string, required): Field name for y-axiscolor(string, optional): Field name for color encodingsize_by(string, optional): Field name for point size
Example:
Bubble Chart (bubble)
Spec Fields:
x(string, required): Field name for x-axisy(string, required): Field name for y-axissize_by(string, required): Field name for bubble sizecolor(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): Usuallycountbin_size(number, optional): Size of bins
Example:
Box Plot (boxplot)
Spec Fields:
grouping(string, required): Field name for groupsvalues(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 objectsEach step:
{"label": "Step Name", "value": number}
Example:
Gauge (gauge)
Spec Fields:
value(number, required): Current valuemin(number, optional): Minimum valuemax(number, optional): Maximum valuetarget(number, optional): Target valueunits(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 valuesgeo_scope(string, optional): Geographic scope (world,country, etc.)
Example:
Choropleth Map (choropleth)
Spec Fields:
region_field(string, required): Field name containing region codesvalue_field(string, required): Field name for valuesgeo_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
Recommended Libraries
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.