Skip to main content

AML DateDrillBlock

DateDrillBlock lets viewers switch the time granularity of mapped visualization blocks without editing the underlying report. It is connected to visualization blocks via a DateDrillInteraction.

Syntax

block <name>: DateDrillBlock {
label: 'Control Label'
default: 'month' // optional
}

Parameters

ParameterDescription
labelDisplay name shown on the control.
defaultDefault time granularity on load. Accepted values: 'year', 'quarter', 'month', 'week', 'day'.

Connecting to visualization blocks

A DateDrillBlock alone does nothing. It must be wired to visualization blocks using a DateDrillInteraction in the dashboard's interactions list. Each CustomMapping specifies which block responds and which date field gets transformed.

Dashboard sales {
block d1: DateDrillBlock {
label: 'Drill by'
default: 'month'
}

block v1: VizBlock {
label: 'Revenue Over Time'
viz: LineChart {
dataset: ecommerce
}
}

interactions: [
DateDrillInteraction {
from: 'd1'
to: [
CustomMapping {
block: 'v1'
field: r(orders.created_at)
}
]
}
]
}

See also


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