GlucoseIQ

AGP & Metrics Aggregate

The Ambulatory Glucose Profile series and the all-in-one metrics call.

2 functions

Generated from the source TSDoc — every signature, parameter, and example is the real thing.

buildAGPProfile

buildAGPProfile(readings: GlucoseReading[], options?: AGPProfileOptions): AGPProfileResult

Builds the AGP time-of-day percentile-band series from glucose readings.

ParameterDescription
readingsGlucose readings with ISO 8601 timestamps
optionsBin width, percentiles, time zone, output unit, and method

Returns — Render-ready AGP profile (full-day bin grid + per-bin percentiles)

Throws — If binMinutes is not an integer in [1, 1440]

Throws — If timeZone is not a valid IANA time zone

const profile = buildAGPProfile(readings, { timeZone: 'America/New_York' })
// profile.bins[i] = { minuteOfDay, percentiles: { 5, 25, 50, 75, 95 }, n }

calculateAGPMetrics

calculateAGPMetrics(readings: GlucoseReading[], options?: AGPMetricsOptions): AGPMetricsResult

Calculates a comprehensive set of AGP metrics from glucose readings.

This is a convenience function that computes all Tier 1 metrics in a single call. Individual metric functions are also available for selective computation.

ParameterDescription
readingsArray of GlucoseReading objects with timestamps
optionsOptional configuration for individual metrics

Returns — Comprehensive AGP metrics result

Throws — If readings array is empty

On this page