Skip to main content

Math Parameters

A math parameter is a parameter on a Definition whose value is computed by a math expression rather than entered by the user.

See Math Expressions for the language reference and Definitions Editor for the authoring UI.

How to author one

In Admin → Definitions, pick a definition and open the Math Parameters tab. Click + Add math parameter and fill in:

FieldExample
NamePaceToLeader
LabelPace To Leader
ExpressionLapTimeMs - Session.BestLapTimeMs
Dimensiontime
Sample scope{ "LapTimeMs": 92345, "Session": { "BestLapTimeMs": 91980 } }

Click Evaluate to preview the result against your sample scope.

Where math parameter values show up

Wherever a regular parameter value would — in tables, CID cells, exports, other math expressions, plugin contexts. The renderer doesn't distinguish between user-entered and computed parameters at read time.

Reactivity

A math parameter is re-evaluated on every read. We don't currently cache the result. This is fine in v0.1.0 — laps are small and there aren't many of them per session — but the plan is to introduce a memoised computation cache keyed by the input scope's hash once we hit telemetry-scale workloads.

Plugin functions

A math parameter can call any function exposed by a loaded plugin. The seeded rolling-avg-rpm plugin contributes rollingAvgRpm(samples, windowSec). Your math expression doesn't need to know whether a function is built-in or plugin-supplied — the resolution happens in the runtime.

What you can do today

  • Author math parameters in the Definitions editor
  • Reference other parameters on the same definition or on related entities (scope traversal)
  • Call any of the ~30 built-in functions plus any function registered by a loaded plugin
  • Validate via the Evaluate button against a sample scope

What's coming

  • Cached evaluation for hot loops (lap KPIs, large pivot grids)
  • Scoped autocomplete for the expression field
  • Inline parse errors instead of dialog-only validation
  • Dependency tracking — when an upstream parameter changes, invalidate the cached result automatically