1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! # bonbon
//!
//! `bonbon` is a high-performance glucose data visualization library designed for
//! rendering clear, informative blood glucose charts. It focuses on efficiency and
//! visual clarity, making it suitable for both web backends and embedded systems.
//!
//! ## Features
//!
//! * **High Performance**: Leverages `rayon` for parallel data processing and optimized sprite-based rendering.
//! * **Dynamic Scaling**: Automatically adjusts Y-axis bounds based on data range.
//! * **Flexible Unit Support**: Native support for mg/dL and mmol/L, including dual-unit display modes.
//! * **Treatment Visualization**: Render insulin boluses, carbohydrate intake, and manual fingerstick calibrations.
//! * **Theming**: Fully customizable color palettes.
//!
//! ## Architecture
//!
//! The crate is organized into several modules:
//! * [`models`]: Data structures for glucose readings, treatments, and axis configurations.
//! * [`charts`]: The primary plotting logic, including [`charts::glucose::GlucoseGraphBuilder`] and [`charts::bg_card::BgCardBuilder`].
//! * [`theme`]: Styling and color management.
//! * [`prelude`]: A convenient module to import common traits and structures.