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): AGPProfileResultBuilds the AGP time-of-day percentile-band series from glucose readings.
| Parameter | Description |
|---|---|
readings | Glucose readings with ISO 8601 timestamps |
options | Bin 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): AGPMetricsResultCalculates 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.
| Parameter | Description |
|---|---|
readings | Array of GlucoseReading objects with timestamps |
options | Optional configuration for individual metrics |
Returns — Comprehensive AGP metrics result
Throws — If readings array is empty