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
72
73
74
75
76
77
78
//! Layout and styling constants for the Gantt chart renderer.
// ---------------------------------------------------------------------------
// SVG canvas
// ---------------------------------------------------------------------------
/// Total SVG width (Mermaid default, px).
pub const SVG_WIDTH: f64 = 1984.0;
/// Space reserved on the left for section labels (px).
pub const LEFT_PAD: f64 = 75.0;
/// Right margin (px).
pub const RIGHT_PAD: f64 = 75.0;
/// Drawable chart width = SVG_WIDTH − LEFT_PAD − RIGHT_PAD (px).
pub const DRAW_WIDTH: f64 = SVG_WIDTH - LEFT_PAD - RIGHT_PAD; // = 1834.0
// ---------------------------------------------------------------------------
// Chart geometry
// ---------------------------------------------------------------------------
/// Y position of the diagram title text (px).
pub const TITLE_TOP: f64 = 25.0;
/// Y where the first task band starts, after title + axis label area (px).
pub const CHART_TOP: f64 = 48.0;
/// Height of each task row (px).
pub const ROW_HEIGHT: f64 = 24.0;
/// Height of the task bar rectangle within each row (px).
pub const BAR_HEIGHT: f64 = 20.0;
/// Top offset of the bar within its row — centres the bar vertically (px).
pub const BAR_OFFSET: f64 = 2.0;
// ---------------------------------------------------------------------------
// Typography
// ---------------------------------------------------------------------------
/// Font size for task bar label text (px).
pub const FONT_SIZE: f64 = 11.0;
/// Font size for section title labels (px).
pub const SECTION_FONT_SIZE: f64 = 11.0;
/// Font size for the diagram title (px).
pub const TITLE_FONT_SIZE: f64 = 18.0;
/// Font size for the x-axis tick labels (px).
pub const AXIS_FONT_SIZE: f64 = 10.0;
// ---------------------------------------------------------------------------
// Grid
// ---------------------------------------------------------------------------
/// Space below the grid baseline for axis tick labels (px).
pub const GRID_BOTTOM_PAD: f64 = 25.0;
/// D3 axis adds 2px padding before the tick domain line (px).
pub const GRID_AXIS_OFFSET: f64 = 2.0;
// ---------------------------------------------------------------------------
// Exclude-range shading
// ---------------------------------------------------------------------------
/// Y position where weekend/exclusion shading starts (= TITLE_TOP + 10, px).
pub const EXCL_TOP: f64 = TITLE_TOP + 10.0; // = 35.0
// ---------------------------------------------------------------------------
// Band width
// ---------------------------------------------------------------------------
/// Width of section background bands = SVG_WIDTH − RIGHT_PAD / 2 (px).
pub const BAND_WIDTH: f64 = SVG_WIDTH - RIGHT_PAD / 2.0; // = 1946.5