Skip to main content
{% heatmap_layer
    data="events"
    lat="latitude"
    lng="longitude"
/%}

Examples

Weighted Heatmap

{% heatmap_layer
    data="sales"
    lat="latitude"
    lng="longitude"
    weight="sum(revenue)"
/%}

Custom Color Palette

{% heatmap_layer
    data="incidents"
    lat="latitude"
    lng="longitude"
    color_palette=["#ffffb2", "#fecc5c", "#fd8d3c", "#f03b20", "#bd0026"]
/%}

Adjusted Radius and Intensity

{% heatmap_layer
    data="visits"
    lat="latitude"
    lng="longitude"
    weight="visit_count"
    radius=50
    intensity=2
/%}

Attributes

data
String
required
Name of the table to query
filters
Array
default:"[]"
Array of filter IDs to apply
lat
String
required
Column name for latitude values
lng
String
required
Column name for longitude values
weight
String
Column or expression for weighting points in the heatmap (e.g., “sum(sales)”). Higher values create more intense heat
radius
Number
default:"30"
Base radius of influence for each point in pixels (adjusts with zoom)
intensity
Number
default:"1"
Intensity multiplier for the heatmap. Higher values create more pronounced heat
opacity
Number
default:"0.8"
Opacity of the heatmap layer (0-1)
color_palette
Array of colors for the heatmap gradient, from lowest to highest density. Defaults to theme color scale
zoom_threshold
Zoom range [min, max] where this layer is visible (e.g., [0, 8] shows layer from zoom 0 to 8)
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
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

Allowed Parents