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
87
//! Flow direction for graph layout: which way the tree "grows" from root to
//! children, and (independently) whether the main axis is mirrored so the root
//! ends up at the far edge.
//!
//! ## Coordinate model
//!
//! All layout and routing happens in a single off-screen **canvas** coordinate
//! space with origin at the top-left, `x` growing right, `y` growing down.
//! `place_node` always advances the **main axis** (the flow axis) away from the
//! root and stacks siblings along the **cross axis**; a final mirror step flips
//! the main axis onto the screen so the root lands at the configured edge.
//!
//! | Direction | main axis | cross axis | root lands at | mirror main axis? |
//! |-----------|-----------|------------|--------------|-------------------|
//! | `Rtl` (default) | x (horizontal) | y | right edge | yes |
//! | `Ltr` | x (horizontal) | y | left edge | no |
//! | `Ttb` | y (vertical) | x | top edge | no |
//! | `Btt` | y (vertical) | x | bottom edge | yes |
//!
//! `Rtl` (the default) is byte-for-byte identical to the pre-parameterization
//! hard-coded layout — `FlowDirection::default() == FlowDirection::Rtl`.
use crateDirection;
/// Which way a [`crate::NodeGraph`] flows: the main axis along which children
/// are laid out away from the root, and which screen edge the root anchors to.
///
/// See the [module docs][self] for the full coordinate model. The default
/// (`Rtl`) preserves the original hard-coded behavior exactly — roots on the
/// right, children flowing leftward.