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
79
80
81
82
83
84
85
86
//! Layout and styling constants for the sequence diagram renderer.
// ---------------------------------------------------------------------------
// Actor geometry
// ---------------------------------------------------------------------------
/// Default horizontal margin between adjacent actors (conf.actorMargin, px).
pub const ACTOR_MARGIN: f64 = 50.0;
/// Default actor box width (conf.width, px).
pub const ACTOR_WIDTH: f64 = 150.0;
/// Default actor box height for layout purposes (conf.height, px).
/// Used for spacing regardless of participant type.
pub const ACTOR_HEIGHT: f64 = 65.0;
/// Visual height of the actor-man (stick-figure) participant type (px).
pub const ACTOR_MAN_HEIGHT: f64 = 80.0;
// ---------------------------------------------------------------------------
// Box / control structure margins
// ---------------------------------------------------------------------------
/// Outer box margin around loop/alt/opt/par control structures (conf.boxMargin, px).
pub const BOX_MARGIN: f64 = 10.0;
/// Inner text margin inside control-structure label boxes (conf.boxTextMargin, px).
pub const BOX_TEXT_MARGIN: f64 = 5.0;
// ---------------------------------------------------------------------------
// Note geometry
// ---------------------------------------------------------------------------
/// Margin around note text (conf.noteMargin, px).
pub const NOTE_MARGIN: f64 = 10.0;
// ---------------------------------------------------------------------------
// Control-structure label box
// ---------------------------------------------------------------------------
/// Width of the label-badge pentagon on loop/alt/opt/par boxes (conf.labelBoxWidth, px).
pub const LABEL_BOX_WIDTH: f64 = 50.0;
/// Height of the label-badge pentagon on loop/alt/opt/par boxes (conf.labelBoxHeight, px).
pub const LABEL_BOX_HEIGHT: f64 = 20.0;
// ---------------------------------------------------------------------------
// Text / wrapping
// ---------------------------------------------------------------------------
/// Wrap-padding added on each side of a message text measurement (conf.wrapPadding, px).
pub const WRAP_PADDING: f64 = 10.0;
// ---------------------------------------------------------------------------
// Diagram margins
// ---------------------------------------------------------------------------
/// Horizontal margin on each side of the diagram viewBox (px).
pub const DIAGRAM_MARGIN_X: f64 = 50.0;
/// Vertical margin on each side of the diagram viewBox (px).
pub const DIAGRAM_MARGIN_Y: f64 = 10.0;
// ---------------------------------------------------------------------------
// Typography
// ---------------------------------------------------------------------------
/// Default font size used for all text in sequence diagrams (px).
pub const FONT_SIZE: f64 = 16.0;
/// Browser renders Arial ~11.7% wider than ab_glyph raw metrics.
pub const TEXT_SCALE: f64 = 1.117;
// ---------------------------------------------------------------------------
// Activation boxes
// ---------------------------------------------------------------------------
/// Width of an activation bar on a participant lifeline (conf.activationWidth, px).
pub const ACTIVATION_WIDTH: f64 = 10.0;
// ---------------------------------------------------------------------------
// SVG identifiers
// ---------------------------------------------------------------------------
/// Fixed id attribute for the sequence diagram SVG root element.
pub const DIAGRAM_ID: &str = "mermaid-seq";