Skip to content

Widgets

Widgets are the visual building blocks of a dashboard. Each widget occupies a number of columns in a 12-column grid.

Common Fields

FieldTypeRequiredDescription
namestringYesDisplay name
typestringYesmetric, chart, table, text, image, or divider
colintegerNoColumn span from 1 to 12
descriptionstringNoOptional tooltip or subtitle

Metric

Metric widgets display a single value.

yaml
- name: Total Revenue
  type: metric
  sql: SELECT SUM(amount) AS value FROM sales
  column: value
  prefix: "$"
  format: number
  col: 3

Metric widgets can also use semantic models:

yaml
- name: Total Revenue
  type: metric
  model: sales
  metric: revenue
  filters:
    - dimension: created_at
      operator: between
      value:
        start: "{{ filters.date_range.start }}"
        end: "{{ filters.date_range.end }}"
  prefix: "$"
  format: number
  col: 3

Semantic metric widgets inherit the dashboard-level model when model is omitted. See Semantic Layer for model files, filters, segments, and aliases.

Metric-specific fields:

FieldTypeDescription
columnstringResult column to display for SQL-backed metrics
metricstringSemantic metric name
prefixstringText before the value
suffixstringText after the value
formatstringnumber, currency, or percent

Chart

Charts visualize one or more series. DAC supports line, bar, area, pie, scatter, bubble, combo, histogram, boxplot, funnel, sankey, heatmap, calendar, sparkline, waterfall, XMR, and dumbbell charts.

SQL-backed example:

yaml
- name: Revenue Trend
  type: chart
  chart: area
  sql: |
    SELECT month, revenue
    FROM monthly_revenue
    ORDER BY month
  x: month
  y: [revenue]
  col: 8

Semantic example:

yaml
- name: Revenue Trend
  type: chart
  chart: area
  model: sales
  dimension: created_at
  granularity: month
  metrics: [revenue]
  sort:
    - name: created_at
      direction: asc
  col: 8

Common chart fields:

FieldTypeDescription
chartstringChart type
xstringX-axis column for SQL-backed charts
ystring[]Y-axis columns for SQL-backed charts
labelstringLabel column for pie and funnel charts
valuestringValue column for pie, funnel, heatmap, and calendar charts
dimensionstringSemantic dimension name
granularitystringSemantic time grain for dimension
metricsstring[]Semantic metric names
filtersarraySemantic filters
segmentsstring[]Semantic segments
sortarraySort instructions
limitintegerRow limit

Charts using dimension, metrics, segments, or semantic filters are compiled through the backend semantic layer instead of requiring hand-written SQL.

Table

Tables display query results in a scrollable grid.

SQL-backed example:

yaml
- name: Recent Orders
  type: table
  sql: |
    SELECT id, customer_name, amount, status, created_at
    FROM orders
    ORDER BY created_at DESC
    LIMIT 20
  columns:
    - name: id
      label: Order ID
    - name: amount
      label: Amount
      format: currency

Semantic example:

yaml
- name: Sales Breakdown
  type: table
  model: sales
  dimensions:
    - name: region
    - name: channel
  metrics: [revenue, sales_count]
  sort:
    - name: revenue
      direction: desc
  columns:
    - name: region
      label: Region
    - name: revenue
      label: Revenue
      format: currency

Tables can mix semantic dimensions and metrics with explicit columns metadata for display labels and formatting.

Text

Text widgets render Markdown content.

yaml
- name: Notes
  type: text
  col: 6
  content: |
    **Important:** Data refreshes daily at 06:00 UTC.

Image

Image widgets render an image from a URL.

yaml
- name: Logo
  type: image
  col: 3
  src: https://example.com/logo.png
  alt: Company Logo

Divider

Divider widgets add visual separation between sections.

yaml
- name: Section Break
  type: divider
  col: 12