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): stringRenders an Ambulatory Glucose Profile chart as an SVG string.
| Parameter | Description |
|---|---|
readings | Glucose readings with ISO 8601 timestamps (mg/dL or mmol/L) |
options | Dimensions, 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 PDFtirBarToSVG
tirBarToSVG(readings: GlucoseReading[], options?: TIRBarOptions): stringRenders a Time-in-Range stacked bar as an SVG string.
| Parameter | Description |
|---|---|
readings | Glucose readings (mg/dL or mmol/L) |
options | Dimensions and theme |
Returns — A self-contained SVG document string
const svg = tirBarToSVG(readings)trendTileToSVG
trendTileToSVG(readings: GlucoseReading[], options?: TrendTileOptions): stringRenders a current-glucose trend tile as an SVG string.
| Parameter | Description |
|---|---|
readings | Glucose readings with ISO 8601 timestamps |
options | Dimensions and theme |
Returns — A self-contained SVG document string
const svg = trendTileToSVG(readings) // 120 → IN RANGE