Something went wrong

Thank you for being patient! We're working hard on resolving the issue

Data - Lona Docs Log in

Data Template

The data template wraps any canonical data lookup key (Garmin metrics, Whoop recovery, custom user series) into a row tree with the right preset renderers — bar charts, regression bands, point plots, h-rules — picked from a registered DATA_PRESETS table by lookup key.

It's the catch-all template for "expose this provider series as a row" — the others are specializations of this idea with hard-coded shapes.

Wire shape

{
  "type": "alias",
  "label": "Sleep",
  "attributes": {
    "template": "data",
    "props": { "lookupKey": ":~garmin:sleep" }
  }
}
PropTypeRequiredMeaning
lookupKeystringyesCanonical data series lookup key

Expanded shape

For a series with a registered preset (here Garmin sleep — points + h-rule):

alias                             template=data
│                                 props.lookupKey=:~garmin:sleep
├─ data-json                      lookupKey=:~garmin:sleep    ← raw JSON cells
├─ data-renderer                  type=points
└─ data-renderer                  type=hrule

For a series with no registered preset, only the data-json row is emitted:

alias                             template=data
│                                 props.lookupKey=:~custom:my-series
└─ data-json                      lookupKey=:~custom:my-series

The renderer set comes from DATA_PRESETS.get(lookupKey):

Preset key fragmentRenderer types added
pointsscatter point plot
barbar chart
regressionregression band + points
hrulehorizontal reference rule

Lookup keys without a preset entry get only the data-json row — useful for raw inspection of an unfamiliar series.

Renderer canonicalization (data template only)

A few legacy renderer types are normalized at child-spec time so older preset entries keep working without table edits. This pass runs inside the data template's dataChildren() expansion (tento/tento-lona-js/sheets/src/builtin-alias-factories.ts); other templates and hand-built rows do not see it.

Wire typeCanonical type
hrule-allhrule
regression-fillregression-band
regression-pointspoints
bar-chart-with-width, bucketsbar

This is purely a name-mapping pass; no behavior changes.

When to use data vs a specialized template

Use data when:

  • The series is already keyed (:~garmin:..., :~whoop:..., :~custom:...).
  • You want the standard preset renderers without picking them by hand.

Use a specialized template (weather, task, calendar) when:

  • The row needs more than renderers — a logs row, nested aliases, layout switching, dynamic tail, etc.
  • The lookup key is derived from props rather than supplied directly.

See also