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
//! Layout and styling constants for the treemap renderer.
// ---------------------------------------------------------------------------
// Canvas geometry
// ---------------------------------------------------------------------------
/// Canvas width (nodeWidth × SECTION_INNER_PADDING = 100 × 10, px).
pub const CANVAS_W: f64 = 1000.0;
/// Canvas height (nodeHeight × SECTION_INNER_PADDING = 40 × 10, px).
pub const CANVAS_H: f64 = 400.0;
// ---------------------------------------------------------------------------
// Padding / layout
// ---------------------------------------------------------------------------
/// Inner padding between leaf tiles (config.padding / paddingInner, px).
pub const INNER_PADDING: f64 = 10.0;
/// Padding at the top of branch (non-leaf) nodes for the section header (paddingTop, px).
pub const SECTION_HEADER_HEIGHT: f64 = 25.0;
/// Padding on left, right, and bottom of branch nodes (paddingLeft/Right/Bottom, px).
pub const SECTION_INNER_PADDING: f64 = 10.0;
/// Height reserved for the diagram title (px).
pub const TITLE_HEIGHT: f64 = 30.0;
/// Padding added around the content bounding box for the SVG viewBox (px).
pub const DIAGRAM_PADDING: f64 = 8.0;
// ---------------------------------------------------------------------------
// Squarify layout
// ---------------------------------------------------------------------------
/// Golden-ratio constant used by the D3 squarify algorithm (φ = (1+√5)/2).
pub const PHI: f64 = 1.618_033_988_749_895;
// ---------------------------------------------------------------------------
// Label colours (cScaleLabel from default Mermaid theme)
// ---------------------------------------------------------------------------
/// Ordinal label-colour palette (cScaleLabel0..11 from Mermaid's default theme).
/// Index 0 maps to white (dark tile), all others map to black.
pub const C_SCALE_LABEL: & = &;