Skip to content

Time Filter

deckgl_marimo.compute_time_domain

compute_time_domain(data, accessor)

Compute [t_min, t_max] over data using accessor.

Parameters:

Name Type Description Default
data Any

A list of records (dicts or objects), a GeoJSON FeatureCollection, or any tabular data the library accepts (DataFrame, DuckDB, ...).

required
accessor TimeAccessor

A dict key, a dotted path (e.g. "properties.t"), or a callable mapping each item to its numeric time value.

required

Returns:

Type Description
list[float]

[t_min, t_max].

Raises:

Type Description
ValueError

If no numeric time values are found.

deckgl_marimo.build_time_filter

build_time_filter(domain, window, *, current=None, playing=False, speed=None, loop=True, soft_edge=None, layer_ids=None, nonce=None)

Assemble a time_filter dict for Map(time_filter=...).

Parameters:

Name Type Description Default
domain Sequence[float]

[t_min, t_max] full time extent (e.g. from :func:compute_time_domain).

required
window float

Sliding-window width; visible data is [current - window, current].

required
current float | None

Initial head time. Defaults to domain[0] + window (first full window).

None
playing bool

Start the animation immediately.

False
speed float | None

Time units advanced per wall-clock second. Defaults to a full sweep in ~20s.

None
loop bool

Wrap the head back to domain[0] + window at the end.

True
soft_edge float | None

Optional fade width mapped to filterSoftRange for fade in/out.

None
layer_ids Sequence[str] | None

Explicit target layer IDs. Defaults to auto-detecting any layer with a DataFilterExtension (i.e. any layer given get_filter_value).

None
nonce int | None

Bump to force the frontend to re-sync an unchanged current.

None

Returns:

Type Description
dict

Suitable for Map(time_filter=...) or assignment to the time_filter traitlet. Keys with None values are omitted.