Interface AnalyticsMeasureExperimental

Unit and formatting metadata for a measure. unit is a free-form display unit ("count", "km", "USD", "°C"); unitSystem classifies it so a host can localize without parsing the string.

interface AnalyticsMeasure {
    alias?: string;
    field: string;
    fn: AggregationFn;
    label?: string;
    precision?: number;
    unit?: string;
    unitSystem?:
        | "length"
        | "count"
        | "currency"
        | "other"
        | "duration"
        | "area"
        | "temperature"
        | "ratio";
}

Properties

alias?: string

Alias the aggregate row uses for this measure.

field: string

Field the measure aggregates. "*" for a plain row count.

label?: string

Display label. Falls back to alias ?? field when omitted.

precision?: number

Decimal places a presentation should render by default.

unit?: string
unitSystem?:
    | "length"
    | "count"
    | "currency"
    | "other"
    | "duration"
    | "area"
    | "temperature"
    | "ratio"