GlucoseIQ

Rendering (SVG)

Zero-dependency SVG-string renderers for any surface.

3 functions

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

agpChartToSVG

agpChartToSVG(readings: GlucoseReading[], options?: AGPChartOptions): string

Renders an Ambulatory Glucose Profile chart as an SVG string.

ParameterDescription
readingsGlucose readings with ISO 8601 timestamps (mg/dL or mmol/L)
optionsDimensions, theme, time zone, and title

Returns — A complete, self-contained SVG document string

const svg = agpChartToSVG(readings, { theme: 'dark' })
// <svg ...>…</svg> — drop into HTML, a README, an email, or a PDF

tirBarToSVG

tirBarToSVG(readings: GlucoseReading[], options?: TIRBarOptions): string

Renders a Time-in-Range stacked bar as an SVG string.

ParameterDescription
readingsGlucose readings (mg/dL or mmol/L)
optionsDimensions and theme

Returns — A self-contained SVG document string

const svg = tirBarToSVG(readings)

trendTileToSVG

trendTileToSVG(readings: GlucoseReading[], options?: TrendTileOptions): string

Renders a current-glucose trend tile as an SVG string.

ParameterDescription
readingsGlucose readings with ISO 8601 timestamps
optionsDimensions and theme

Returns — A self-contained SVG document string

const svg = trendTileToSVG(readings) // 120 → IN RANGE

On this page