Skip to main content

AML VizBlock

VizBlock wraps a visualization (chart, table, KPI) with a label and optional styling. The viz parameter specifies the chart type and its configuration.

Syntax

block <name>: VizBlock {
label: 'Block Title'
viz: <ChartType> {
dataset: <dataset_name>
// chart-specific parameters
}
theme: BlockTheme { ... } // optional
}

Parameters

ParameterDescription
labelDisplay name shown as the block title.
vizThe visualization object. See chart types below.
themeOptional BlockTheme override for visual styling.

Chart types

The viz parameter accepts any of the following chart types:

Chart typeDescription
DataTableEvery row of your query result, sortable and formatted
PivotTableCross-tabulate values across rows and columns to compare groups
RetentionHeatmapTrack how groups of users behave over time after a starting event
ConversionFunnelVisualize drop-off across the steps of a multi-stage process
MetricSheetA spreadsheet-style grid for laying out metrics side by side
MetricKpiShow one headline number, with optional comparison and trend
GaugeChartPlot a value against a range to show progress toward a target
LineChartShow how values change over a continuous dimension like time
AreaChartA line chart with the area below filled in to emphasize volume
BarChartCompare values across categories with horizontal bars
ColumnChartCompare values across categories with vertical columns
CombinationChartLayer columns and lines together to plot two related measures
PieChartShow how parts make up a whole as proportional slices
ScatterChartPlot two measures against each other to spot correlation
BubbleChartA scatter chart with a third measure mapped to bubble size
FunnelChartShow staged values as tapering segments
PyramidChartShow ranked values as tapering segments
RadarChartCompare several measures across categories on a circular axis
WordCloudSize words by frequency to highlight prominent terms
HeatmapShade cells by value to reveal concentration
PointMapDrop a marker at each location to show individual data points
FilledMapColor regions by value for choropleth-style comparisons
CustomChartRender a CustomChartDef template with your own Vega-Lite spec
MarkdownVizRender data-driven content with your own Markdown template

Example

block revenue_chart: VizBlock {
label: 'Revenue Over Time'
viz: CombinationChart {
dataset: ecommerce
settings {
row_limit: 5000
legend_label: 'top'
}
}
}
block order_count: VizBlock {
label: 'Total Orders'
viz: SingleValue {
dataset: ecommerce
series {
field {
ref: r(orders.id)
aggregation: 'count'
}
}
}
}

For per-chart-type parameters, the AML editor shows accepted values on hover. You can also apply a VizTheme inside the viz object to override table styling.

See also


Open Markdown
Let us know what you think about this document :)