Skip to main content
{% heat_grid
  data="appointments"
  dimension="province"
  value="avg(wait_time)"
  thresholds=[60, 90]
  units="MIN"
  lower_is_better=true
/%}

Examples

Basic Usage

{% heat_grid
  data="appointments"
  dimension="province"
  value="avg(wait_time)"
  thresholds=[60, 90]
  units="MIN"
  lower_is_better=true
/%}

Attributes

data
string
required
Table or view to query
dimension
string
required
Column for cell labels (e.g., province)
value
string
required
SQL aggregation expression for the metric (e.g., avg(wait_time))
thresholds
array
required
Two numeric thresholds creating 3 color zones: [low, high]. Values below low are zone 1, between low and high are zone 2, at or above high are zone 3.
units
string
Units label shown below the value in each cell (e.g., “MIN”)
fmt
string
Format code for the metric value. See Value Formatting for available formats.
title
string
Component title
lower_is_better
boolean
If true, low values are green and high values are red. Default (false) means high values are green.
compact
boolean
If true, removes gaps and borders between cells and applies a single border radius to the outer grid.
filters
array
IDs of filters to apply to the query
where
string
Custom SQL WHERE condition to apply to the query. For date filters, use date_range instead.
having
string
Custom SQL HAVING condition to apply to the query after GROUP BY
limit
number
Maximum number of rows to return from the query. Note: When used with tables, limit will disable subtotals to prevent incomplete subtotal rows.
order
string
Column name(s) with optional direction (e.g. “column_name”, “column_name desc”)
qualify
string
Custom SQL QUALIFY condition to filter windowed results
width
number
Set the width of this component (in percent) relative to the page width