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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! Layout and styling constants for the pie renderer.
// ---------------------------------------------------------------------------
// Chart geometry
// ---------------------------------------------------------------------------
/// Margin between the SVG edge and the chart area (px). Matches Mermaid default.
pub const MARGIN: f64 = 40.0;
/// Side length of legend colour swatches (px).
pub const LEGEND_RECT_SIZE: f64 = 18.0;
/// Vertical gap between a legend swatch and the text beside it (px).
pub const LEGEND_SPACING: f64 = 4.0;
/// SVG height (square chart canvas, px).
pub const HEIGHT: f64 = 450.0;
/// SVG width (equals HEIGHT — square canvas, px).
pub const PIE_WIDTH: f64 = HEIGHT;
/// Fractional distance from the pie centre to the percentage label position.
/// Matches `pieConfig.textPosition` default of 0.75.
pub const TEXT_POSITION: f64 = 0.75;
/// Stroke width drawn on the outer pie circle border (px).
pub const OUTER_STROKE_WIDTH: f64 = 2.0;
/// Font size used for legend text labels (px).
pub const LEGEND_FONT_SIZE: f64 = 17.0;
/// Font size used for the diagram title (px).
pub const TITLE_FONT_SIZE: f64 = 25.0;
/// Horizontal distance from the pie centre to the legend column start (px).
/// Equals 12 × LEGEND_RECT_SIZE = 216.
pub const LEGEND_HORIZONTAL_OFFSET: f64 = 12.0 * LEGEND_RECT_SIZE; // 216.0
// ---------------------------------------------------------------------------
// Colour palette
// ---------------------------------------------------------------------------
/// The 10 theme-independent pie colors (indices 2–11 in Mermaid's palette).
///
/// Indices 0 and 1 (pie1/pie2) are theme-dependent: they map to
/// `vars.primary_color` and `vars.secondary_color` respectively and are
/// supplied by the renderer at runtime.
///
/// HSL values from Mermaid khroma-adjusted default theme (adjusted from #ECECFF):
/// pie3 = hsl(80, 100%, 56.27%) → khroma tertiary adjusted
/// pie4 = hsl(240, 100%, 86.27%) → primary+l-10
/// pie5 = hsl(60, 100%, 63.53%) → secondary+l-30
/// pie6 = hsl(80, 100%, 76.27%) → tertiary+l-20
/// pie7 = hsl(300, 100%, 76.27%) → primary+h+60+l-20
/// pie8 = hsl(180, 100%, 56.27%) → primary+h-60+l-40
/// pie9 = hsl(0, 100%, 56.27%) → primary+h+120+l-40
/// pie10 = hsl(300, 100%, 56.27%) → primary+h+60+l-40
/// pie11 = hsl(150, 100%, 56.27%) → primary+h-90+l-40
/// pie12 = hsl(0, 100%, 66.27%) → primary+h+120+l-30
pub const PIE_COLORS_STATIC: = ;