reladraw 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/reladraw/SKILL.md +7 -5
- package/.claude/skills/reladraw/reference/syntax.md +44 -5
- package/README.md +2 -2
- package/SYNTAX.md +44 -5
- package/dist/cli.js +15 -1
- package/dist/examples.d.ts +26 -0
- package/dist/examples.js +56 -0
- package/dist/page-data.d.ts +130 -0
- package/dist/page-data.js +226 -0
- package/dist/page.d.ts +46 -2
- package/dist/page.js +1239 -241
- package/dist/serve.d.ts +18 -0
- package/dist/serve.js +544 -0
- package/examples/arch.reladraw +95 -0
- package/examples/around.reladraw +101 -0
- package/examples/borders.reladraw +28 -0
- package/examples/bundles.reladraw +49 -0
- package/examples/circles.reladraw +37 -0
- package/examples/coincident.reladraw +66 -0
- package/examples/contents.reladraw +52 -0
- package/examples/corridors.reladraw +48 -0
- package/examples/deck.reladraw +26 -0
- package/examples/flowchart.reladraw +23 -0
- package/examples/frames.reladraw +79 -0
- package/examples/gap.reladraw +21 -0
- package/examples/gaps.reladraw +25 -0
- package/examples/icons.reladraw +35 -0
- package/examples/lanes.reladraw +54 -0
- package/examples/lines.reladraw +73 -0
- package/examples/linetexts.reladraw +48 -0
- package/examples/marks.reladraw +39 -0
- package/examples/names.reladraw +23 -0
- package/examples/outlines.reladraw +56 -0
- package/examples/overhang.reladraw +24 -0
- package/examples/overlays.reladraw +75 -0
- package/examples/parts.reladraw +31 -0
- package/examples/passes.reladraw +56 -0
- package/examples/points.reladraw +28 -0
- package/examples/regions.reladraw +14 -0
- package/examples/routing.reladraw +88 -0
- package/examples/shapes.reladraw +38 -0
- package/examples/snug.reladraw +8 -0
- package/examples/text.reladraw +69 -0
- package/examples/themes.reladraw +16 -0
- package/examples/urls.reladraw +35 -0
- package/examples/venn.reladraw +15 -0
- package/package.json +2 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Edges whose two ends face away from each other. Each has to turn back on
|
|
2
|
+
// itself, and over and under are both reasonable, so each line says which way
|
|
3
|
+
// round it goes with via:, naming each box it passes on the way. Between the
|
|
4
|
+
// boxes it names, a curved line takes one sweep.
|
|
5
|
+
|
|
6
|
+
// Drawn curved, as 0.16.0 drew every line, so the route is what changed.
|
|
7
|
+
default edge line: (path: curved)
|
|
8
|
+
|
|
9
|
+
// The case that found it: level, with a node in the middle, and a text that
|
|
10
|
+
// used to land on that node.
|
|
11
|
+
node parser "Parser"
|
|
12
|
+
node resolver "Resolver" 10 right of parser
|
|
13
|
+
node renderer "Renderer" 8 right of resolver
|
|
14
|
+
|
|
15
|
+
edge parser -> resolver "statements" from: right to: left
|
|
16
|
+
edge resolver -> renderer "layout" from: right to: left
|
|
17
|
+
edge parser -> renderer "test edge" from: left to: right via: parser top, renderer top
|
|
18
|
+
|
|
19
|
+
// Two nodes side by side. The text goes over the top and the gap stays as it
|
|
20
|
+
// was, since no text rides in it.
|
|
21
|
+
node a "A" below parser (gap: wide)
|
|
22
|
+
node b "B" right of a
|
|
23
|
+
|
|
24
|
+
edge a -> b "adjacent" from: left to: right via: a top, b top
|
|
25
|
+
|
|
26
|
+
// A taller node in the way lifts the whole run over it.
|
|
27
|
+
node c "C" right of b (gap: wide)
|
|
28
|
+
node tall "Tall / middle / node" right of c
|
|
29
|
+
node d "D" right of tall
|
|
30
|
+
|
|
31
|
+
edge c -> d "over the tall one" from: left to: right via: tall top
|
|
32
|
+
|
|
33
|
+
// Stepped down, with a gap wide enough: the line turns back under E and over
|
|
34
|
+
// F, through the gap between them. A normal gap is twice the distance a line
|
|
35
|
+
// keeps from a side it runs along, so the two runs meet in one level line.
|
|
36
|
+
node e "E" below a (gap: wide)
|
|
37
|
+
node f "F" right of e (gap: wide) below e (gap: normal)
|
|
38
|
+
|
|
39
|
+
edge e -> f "through the gap" from: left to: right via: e bottom, f top
|
|
40
|
+
|
|
41
|
+
// Stepped down with too little room between them: over the top of G, then
|
|
42
|
+
// one sweep down round H's right.
|
|
43
|
+
node g "G" right of f (gap: wide) even with e
|
|
44
|
+
node h "H" right of g (gap: wide) below g (gap: tight)
|
|
45
|
+
|
|
46
|
+
edge g -> h "no room below" from: left to: right via: g top
|
|
47
|
+
|
|
48
|
+
// A column goes round the right: along the right side of a region round
|
|
49
|
+
// both, so the run down is straight past the narrower box.
|
|
50
|
+
node top "Top" right of d (gap: wide)
|
|
51
|
+
node bottom "Bottom" below top
|
|
52
|
+
|
|
53
|
+
guide region column top top-left to bottom bottom-right
|
|
54
|
+
edge top -> bottom "column" from: top to: bottom via: column right
|
|
55
|
+
|
|
56
|
+
// And an edge from a node back to itself.
|
|
57
|
+
node self "Self" below bottom (gap: wide)
|
|
58
|
+
|
|
59
|
+
edge self -> self "itself" from: left to: right via: self top
|
|
60
|
+
|
|
61
|
+
// Two lines out of one side, each the shorter way round. They share J's left
|
|
62
|
+
// side, so the one leaving lower down has the shorter way underneath.
|
|
63
|
+
node j "J" below e (gap: 17)
|
|
64
|
+
node k "K" right of j
|
|
65
|
+
node l "L" right of k
|
|
66
|
+
|
|
67
|
+
edge j -> l "outer" from: left to: right via: j top, l top
|
|
68
|
+
edge j -> k "inner" from: left to: right via: j bottom, k bottom
|
|
69
|
+
|
|
70
|
+
// Sides at right angles, one facing away: out of the left, up over the row,
|
|
71
|
+
// and down into the top. The side the far end names says which way round.
|
|
72
|
+
node m "M" right of l (gap: wide)
|
|
73
|
+
node n "N" right of m
|
|
74
|
+
node o "O" right of n
|
|
75
|
+
|
|
76
|
+
edge m -> o "into the top" from: left to: top via: m top, n top
|
|
77
|
+
edge m -> o "into the bottom" from: left to: bottom via: m bottom, n bottom
|
|
78
|
+
|
|
79
|
+
// Stacked, sides at right angles (GitHub issue #2). Coming straight in would
|
|
80
|
+
// pass through the lower node, so the line steps out beside it and comes in
|
|
81
|
+
// to the side named. The turn is stated, so the curve passes the middle of
|
|
82
|
+
// the gap heading across it, and comes round in a hook rather than a kink.
|
|
83
|
+
node p "P" below j (gap: 12)
|
|
84
|
+
node q "Q" below p
|
|
85
|
+
edge p -> q "curve" from: bottom to: left line: (turn: 1/2)
|
|
86
|
+
|
|
87
|
+
// Both ends facing the same way, one node behind the other: the line has to
|
|
88
|
+
// get round the node behind, so it goes over the top, as a loop does. A wide
|
|
89
|
+
// gap between them gives the line room to come down into it.
|
|
90
|
+
node r "R" right of p (gap: wide)
|
|
91
|
+
node s "S" right of r (gap: wide)
|
|
92
|
+
edge r -> s "left to left" from: left to: left via: r top
|
|
93
|
+
|
|
94
|
+
node t "T" right of s (gap: wide)
|
|
95
|
+
node u "U" right of t (gap: wide)
|
|
96
|
+
edge t -> u "right to right" from: right to: right via: u top
|
|
97
|
+
|
|
98
|
+
// In a column, round the right.
|
|
99
|
+
node v "V" right of u (gap: wide)
|
|
100
|
+
node w "W" below v
|
|
101
|
+
edge v -> w from: bottom to: bottom via: w right
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// A border's thickness. It is drawn inside the box's outline, and the box
|
|
2
|
+
// grows by the extra, so the padding round what it holds stays what it says
|
|
3
|
+
// and a gap is still measured from the outside of the stroke.
|
|
4
|
+
|
|
5
|
+
style hot border: (color: #d2904e, thickness: 4)
|
|
6
|
+
|
|
7
|
+
node host "Host"
|
|
8
|
+
node host.app "App"
|
|
9
|
+
node db "DB" right of host
|
|
10
|
+
edge host -> db
|
|
11
|
+
|
|
12
|
+
node thick "Host" below host style: hot
|
|
13
|
+
node thick.app "App"
|
|
14
|
+
node db2 "DB" right of thick
|
|
15
|
+
edge thick -> db2
|
|
16
|
+
|
|
17
|
+
node thin "thin" below thick border: (thickness: thin)
|
|
18
|
+
node normal "normal" right of thin (gap: tight)
|
|
19
|
+
node bold "thick" right of normal (gap: tight) border: (thickness: thick)
|
|
20
|
+
node px "6px" right of bold (gap: tight) border: (thickness: 6px)
|
|
21
|
+
|
|
22
|
+
node ring "ring" below thin shape: circle style: hot
|
|
23
|
+
node gem "gem" right of ring (gap: tight) shape: diamond style: hot
|
|
24
|
+
node hex "hex" right of gem (gap: tight) shape: hexagon style: hot
|
|
25
|
+
node can "can" right of hex (gap: tight) shape: cylinder style: hot
|
|
26
|
+
node doc "doc" right of can (gap: tight) shape: document style: hot
|
|
27
|
+
node legend "Legend" (on top) right of doc (gap: tight) style: hot
|
|
28
|
+
node legend.item "item"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Lines that travel together. A bundle is a path with no ends of its own;
|
|
2
|
+
// each line joins it with `via:` and runs its whole length in a lane of its
|
|
3
|
+
// own. The lanes are in one order across the bundle, so the lines cross
|
|
4
|
+
// before they reach it or not at all, never inside it.
|
|
5
|
+
|
|
6
|
+
style plain fill: theme-fill border: theme-border
|
|
7
|
+
|
|
8
|
+
// Three lines through one gap. They are written c's first, so in written
|
|
9
|
+
// order c's line would take the top lane and cross the other two on the way
|
|
10
|
+
// in and on the way out; the bundle's order puts them as the columns are.
|
|
11
|
+
node from "Senders" layout: column style: plain
|
|
12
|
+
node from.a "a"
|
|
13
|
+
node from.b "b"
|
|
14
|
+
node from.c "c"
|
|
15
|
+
node upper "Upper" right of from (gap: wide) 6 above from style: plain
|
|
16
|
+
node lower "Lower" below upper (gap: wide) style: plain
|
|
17
|
+
region slot between upper and lower
|
|
18
|
+
node to "Receivers" right of upper (gap: wide) 6 below upper layout: column style: plain
|
|
19
|
+
node to.x "x"
|
|
20
|
+
node to.y "y"
|
|
21
|
+
node to.z "z"
|
|
22
|
+
bundle trunk via: through slot horizontal order: one, two, three
|
|
23
|
+
edge three from.c -> to.z via: trunk
|
|
24
|
+
edge one from.a -> to.x via: trunk
|
|
25
|
+
edge two from.b -> to.y via: trunk
|
|
26
|
+
|
|
27
|
+
// A bus: a collapsed bundle is one thick line, drawn once. Each host taps it
|
|
28
|
+
// with a line straight down or up to it, and one line rides it end to end.
|
|
29
|
+
node h1 "Host 1" below from (gap: wide) left even with from style: plain
|
|
30
|
+
node h2 "Host 2" right of h1 (gap: wide) style: plain
|
|
31
|
+
node h3 "Host 3" right of h2 (gap: wide) style: plain
|
|
32
|
+
node s1 "Store 1" 6 below h1 style: plain
|
|
33
|
+
node s2 "Store 2" 6 below h2 style: plain
|
|
34
|
+
node s3 "Store 3" 6 below h3 style: plain
|
|
35
|
+
point west between h1 and s1
|
|
36
|
+
point east between h3 and s3
|
|
37
|
+
bundle bus via: west, east layout: collapsed line: (thickness: thick) from-mark: dot to-mark: dot
|
|
38
|
+
edge h2 -- bus straight down to-mark: dot
|
|
39
|
+
edge s2 -- bus straight up to-mark: dot
|
|
40
|
+
edge h1 -> s3 from: bottom to: top via: bus line: (path: square)
|
|
41
|
+
|
|
42
|
+
// One line from each child, which stays true as children are added. They
|
|
43
|
+
// meet at one point on Queue, so its side never runs out of room for them.
|
|
44
|
+
node pool "Workers" below s1 (gap: wide) layout: column style: plain
|
|
45
|
+
node pool.w1 "w1"
|
|
46
|
+
node pool.w2 "w2"
|
|
47
|
+
node pool.w3 "w3"
|
|
48
|
+
node queue "Queue" right of pool (gap: wide) style: plain
|
|
49
|
+
edge each child of pool -> queue to: left-center
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// `shape: circle`. A circle is as big as it needs to be to hold its text, and
|
|
2
|
+
// always round.
|
|
3
|
+
|
|
4
|
+
style state shape: circle border: #5cf05c
|
|
5
|
+
style step border: #ff6666
|
|
6
|
+
|
|
7
|
+
// A small picture from a TikZ tutorial, which asked for circles.
|
|
8
|
+
node 1 style: state
|
|
9
|
+
node 2 below 1 style: step
|
|
10
|
+
node 3 right of 2 style: step
|
|
11
|
+
node 4 below 2 style: state
|
|
12
|
+
|
|
13
|
+
edge 1 -> 2
|
|
14
|
+
edge 2 -> 3
|
|
15
|
+
edge 3 -> 4 from: bottom to: right
|
|
16
|
+
|
|
17
|
+
// A circle sizes from its text like any box, so a longer text makes a bigger
|
|
18
|
+
// circle rather than an oval.
|
|
19
|
+
node idle "idle" right of 3 (gap: wide) style: state
|
|
20
|
+
node working "working on it / slowly" below idle (gap: wide) style: state
|
|
21
|
+
|
|
22
|
+
// Several edges on one side of a circle fan out round its quarter, each
|
|
23
|
+
// meeting it square on.
|
|
24
|
+
node a "a" right of working (gap: wide) style: step
|
|
25
|
+
node b "b" below a style: step
|
|
26
|
+
node c "c" below b style: step
|
|
27
|
+
edge a -> working from: left to: right
|
|
28
|
+
edge b -> working from: left to: right
|
|
29
|
+
edge c -> working from: left to: right
|
|
30
|
+
|
|
31
|
+
// An edge naming no side meets the circle where the line to the far end
|
|
32
|
+
// crosses it.
|
|
33
|
+
edge idle -> 3
|
|
34
|
+
|
|
35
|
+
// A corner of a circle is the point on it halfway round, not the corner of
|
|
36
|
+
// the square around it.
|
|
37
|
+
node dot "" on idle top-right shape: circle
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Several edges between the same two nodes. Left alone they are copies, and
|
|
2
|
+
// run side by side a gap apart, straight from box to box, each end landing
|
|
3
|
+
// where its own line meets the border. A bundle between the two nodes says
|
|
4
|
+
// how they share the way instead: layout: fan bows them apart to a gap at
|
|
5
|
+
// the middle while their ends stay close on a small side.
|
|
6
|
+
|
|
7
|
+
style plain fill: theme-fill border: theme-border
|
|
8
|
+
|
|
9
|
+
// Level nodes, fanned: the ends crowd one side, and the lines bow out so each
|
|
10
|
+
// text has a lane of its own. The middle line stays straight.
|
|
11
|
+
node a "A" style: plain
|
|
12
|
+
node b "B" 10 right of a style: plain
|
|
13
|
+
bundle ab a -> b layout: fan
|
|
14
|
+
edge a -> b "first" via: ab
|
|
15
|
+
edge a -> b "second" via: ab
|
|
16
|
+
edge a -> b "third" via: ab
|
|
17
|
+
|
|
18
|
+
// A perfect diagonal, where the single line would leave through the corner
|
|
19
|
+
// exactly. The two copies run either side of it, one end on each of the
|
|
20
|
+
// sides meeting there, written in either direction. Copies a gap apart have
|
|
21
|
+
// no room for a text between them, so each text sits beside its own line.
|
|
22
|
+
node low "Low" 16 below a left of a style: plain
|
|
23
|
+
node high "High" above low (gap: wide) right of low (gap: wide) style: plain
|
|
24
|
+
edge low -> high "up" (left of edge)
|
|
25
|
+
edge high -> low "down" (right of edge)
|
|
26
|
+
|
|
27
|
+
// A near diagonal, where the lines cross the border on one side, close to
|
|
28
|
+
// the corner.
|
|
29
|
+
node near "Near" below low (gap: wide) style: plain
|
|
30
|
+
node far "Far" right of near (gap: wide) above near (gap: wide) style: plain
|
|
31
|
+
edge near -> far "one" (left of edge)
|
|
32
|
+
edge near -> far "two" (right of edge)
|
|
33
|
+
|
|
34
|
+
// A lone edge has nothing to share the way with, and runs center to center.
|
|
35
|
+
node solo "Solo" below near (gap: wide) style: plain
|
|
36
|
+
node alone "Alone" 12 right of solo style: plain
|
|
37
|
+
edge solo -> alone "by itself"
|
|
38
|
+
|
|
39
|
+
// Naming a side takes an edge out of the copies. Two ends on top, curved, so
|
|
40
|
+
// the line leaves upward and comes back down rather than running along the
|
|
41
|
+
// tops.
|
|
42
|
+
node named "Named" below solo (gap: wide) style: plain
|
|
43
|
+
node other "Other" 11 right of named style: plain
|
|
44
|
+
edge named -> other "free"
|
|
45
|
+
edge named -> other "free too"
|
|
46
|
+
edge named -> other "top" from: top to: top line: (path: curved)
|
|
47
|
+
|
|
48
|
+
// More than the side can hold at a gap. The ends squeeze together and each
|
|
49
|
+
// line bows out to its lane at the middle.
|
|
50
|
+
node many "Many" below named (gap: wide) style: plain
|
|
51
|
+
node one "One" 10 right of many style: plain
|
|
52
|
+
bundle five many -> one layout: fan
|
|
53
|
+
edge many -> one "first" via: five
|
|
54
|
+
edge many -> one "second" via: five
|
|
55
|
+
edge many -> one "third" via: five
|
|
56
|
+
edge many -> one "fourth" via: five
|
|
57
|
+
edge many -> one "fifth" via: five
|
|
58
|
+
|
|
59
|
+
// The same on an upright way, where the texts sit side by side, so the gap
|
|
60
|
+
// the bundle states is a whole text wide.
|
|
61
|
+
node top "Top" below many (gap: wide) style: plain
|
|
62
|
+
node bottom "Bottom" below top (gap: wide) style: plain
|
|
63
|
+
bundle abc top -> bottom layout: fan (gap: 5)
|
|
64
|
+
edge top -> bottom "alpha" via: abc
|
|
65
|
+
edge top -> bottom "beta" via: abc
|
|
66
|
+
edge top -> bottom "gamma" via: abc
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// How a container's contents sit inside it, when the container is wider than
|
|
2
|
+
// they are. A container is as wide as the wider of its title and its contents,
|
|
3
|
+
// so a long title leaves spare room. Two words say two different things:
|
|
4
|
+
//
|
|
5
|
+
// `align-children:`, in the layout's bracket, lines the children up with each
|
|
6
|
+
// other: their left edges even, their middles, or their right edges.
|
|
7
|
+
// `gather-children:`, on the box, says where the group of them sits in the
|
|
8
|
+
// spare room: against a side, or in the middle.
|
|
9
|
+
//
|
|
10
|
+
// Both default to the middle. Neither moves what the other says.
|
|
11
|
+
|
|
12
|
+
style plain fill: theme-fill border: theme-border
|
|
13
|
+
|
|
14
|
+
// Nothing said: the children centered on each other, in the middle of the room.
|
|
15
|
+
node ragged "Ingestion and enrichment pipeline" layout: column
|
|
16
|
+
node ragged.one "parse" style: plain
|
|
17
|
+
node ragged.two "resolve and lay out" style: plain
|
|
18
|
+
node ragged.three "draw" style: plain
|
|
19
|
+
|
|
20
|
+
// Their left edges even, the group still in the middle.
|
|
21
|
+
node lined "Ingestion and enrichment pipeline" right of ragged layout: column (align-children: left)
|
|
22
|
+
node lined.one "parse" style: plain
|
|
23
|
+
node lined.two "resolve and lay out" style: plain
|
|
24
|
+
node lined.three "draw" style: plain
|
|
25
|
+
|
|
26
|
+
// The same column against the left of the room.
|
|
27
|
+
node left "Ingestion and enrichment pipeline" right of lined gather-children: left layout: column (align-children: left)
|
|
28
|
+
node left.one "parse" style: plain
|
|
29
|
+
node left.two "resolve and lay out" style: plain
|
|
30
|
+
node left.three "draw" style: plain
|
|
31
|
+
|
|
32
|
+
// `widths: fill` takes the whole band, so there is no spare room left for
|
|
33
|
+
// gather-children: to say anything about. Under a title this long that is
|
|
34
|
+
// what `match` could not do.
|
|
35
|
+
node full "Ingestion and enrichment pipeline" right of left layout: column (widths: fill)
|
|
36
|
+
node full.one "parse" style: plain
|
|
37
|
+
node full.two "resolve and lay out" style: plain
|
|
38
|
+
node full.three "draw" style: plain
|
|
39
|
+
|
|
40
|
+
// Every child as wide as the widest, against the right of the room.
|
|
41
|
+
node block "Ingestion and enrichment pipeline" below ragged gather-children: right layout: column (widths: match)
|
|
42
|
+
node block.one "parse" style: plain
|
|
43
|
+
node block.two "resolve and lay out" style: plain
|
|
44
|
+
node block.three "draw" style: plain
|
|
45
|
+
|
|
46
|
+
// A style may carry the layout and where the children gather.
|
|
47
|
+
style boxed gather-children: left layout: column (widths: match)
|
|
48
|
+
|
|
49
|
+
node carried "Ingestion and enrichment pipeline" right of block style: boxed
|
|
50
|
+
node carried.one "parse" style: plain
|
|
51
|
+
node carried.two "resolve and lay out" style: plain
|
|
52
|
+
node carried.three "draw" style: plain
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// `between a and b` is a point: the middle of the space between two things.
|
|
2
|
+
// A line passes it with `via:`, and before and after goes wherever its ends
|
|
3
|
+
// take it. `at 1/3` moves the point a third of the way across, measured from
|
|
4
|
+
// the first thing named.
|
|
5
|
+
|
|
6
|
+
default edge line: (path: curved)
|
|
7
|
+
|
|
8
|
+
style channel fill: theme-page border: theme-fill
|
|
9
|
+
|
|
10
|
+
// North and South are apart vertically, so the point lies in the gap between
|
|
11
|
+
// them. Both lines start to the left, pass through the gap and leave for East.
|
|
12
|
+
// Two lines through one point would pinch there, so each passes its own:
|
|
13
|
+
// a third and two thirds of the way down.
|
|
14
|
+
|
|
15
|
+
node west "West"
|
|
16
|
+
node lower "Lower" below west (gap: tight)
|
|
17
|
+
node north "North" right of west (gap: wide) style: channel
|
|
18
|
+
node south "South" below north (gap: wide) style: channel
|
|
19
|
+
node east "East" right of north and south (gap: wide) even with west
|
|
20
|
+
|
|
21
|
+
edge west -> east "over" from: right to: left via: between north and south at 1/3
|
|
22
|
+
edge lower -> east "under" from: right to: left via: between north and south at 2/3
|
|
23
|
+
|
|
24
|
+
// Port and Starboard are apart horizontally, so here the line runs down the
|
|
25
|
+
// gap instead. This line names no sides, so it leaves Bow's bottom, the side
|
|
26
|
+
// facing Stern.
|
|
27
|
+
|
|
28
|
+
node bow "Bow" below lower (gap: wide)
|
|
29
|
+
node port "Port" below bow (gap: wide) style: channel
|
|
30
|
+
node starboard "Starboard" right of port (gap: wide) style: channel
|
|
31
|
+
node stern "Stern" below port (gap: wide)
|
|
32
|
+
|
|
33
|
+
edge bow -> stern "down" via: between port and starboard at 1/3
|
|
34
|
+
|
|
35
|
+
// The same gap travelled the other way, through its own point.
|
|
36
|
+
|
|
37
|
+
edge stern -> bow from: top to: bottom via: between port and starboard at 2/3
|
|
38
|
+
|
|
39
|
+
// High and Low sit diagonally, so the space between them is the rectangle
|
|
40
|
+
// between their nearest corners, and the point is its middle: under High and
|
|
41
|
+
// over Low at once.
|
|
42
|
+
|
|
43
|
+
node far "Far" below stern (gap: wide)
|
|
44
|
+
node high "High" right of far (gap: wide) style: channel
|
|
45
|
+
node low "Low" below-right of high (gap: wide) style: channel
|
|
46
|
+
node near "Near" right of low (gap: wide) even with high
|
|
47
|
+
|
|
48
|
+
edge far -> near "threaded" via: between high and low
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// A deck is a stack of cards, to say "there are several of these and they are
|
|
2
|
+
// the same". The first card is in front, each next one a step up and to the
|
|
3
|
+
// left behind it, and every card is as big as the biggest.
|
|
4
|
+
|
|
5
|
+
style plain fill: theme-fill border: theme-border
|
|
6
|
+
|
|
7
|
+
// The usual case: a front card with rows, and two more like it behind. A card
|
|
8
|
+
// that holds things is written as a child, and then every card is.
|
|
9
|
+
node drives "" layout: deck
|
|
10
|
+
node drives.1 "Drive 1" (inside top, align: left) badge: disk layout: column (widths: match)
|
|
11
|
+
node drives.1.backup "shared folder / backup" style: plain
|
|
12
|
+
node drives.1.archive "archive" style: plain
|
|
13
|
+
node drives.2 "Drive 2"
|
|
14
|
+
node drives.3 "Drive 3"
|
|
15
|
+
|
|
16
|
+
// Cards that are only texts are listed with cards:, front first. They are
|
|
17
|
+
// named workers.1 and workers.2, so a line can end on one.
|
|
18
|
+
node workers "" right of drives (gap: wide) layout: deck cards: "worker" "worker"
|
|
19
|
+
|
|
20
|
+
// The deck is the whole stack. Something placed above or left of it clears
|
|
21
|
+
// every card, so this sits a gap away from the back card, not the front one.
|
|
22
|
+
node source "source" above drives style: plain
|
|
23
|
+
|
|
24
|
+
// An annotation may overlap the blank area of the trailing cards, as one
|
|
25
|
+
// beside a row does in a drawing, by saying so.
|
|
26
|
+
node rotated "swapped weekly" left of drives.1.backup (gap: tight) overlap: allow shape: none
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// An agent's work loop as a flowchart, from GitHub issue #18. A decision is a
|
|
2
|
+
// diamond, the ends are pills, a step drawn as its own chart is a subprocess,
|
|
3
|
+
// and a wait is the standard's delay, so the chart reads with no legend.
|
|
4
|
+
|
|
5
|
+
node start "start" shape: pill
|
|
6
|
+
node read "read the request" below start
|
|
7
|
+
node valid "valid?" below read shape: diamond
|
|
8
|
+
node handle "handle the request" below valid (gap: wide) shape: flow-subprocess
|
|
9
|
+
node review "wait for review" below handle shape: flow-delay
|
|
10
|
+
node report "report" left of review (gap: wide) shape: flow-document
|
|
11
|
+
node reject "reject / with a reason" right of valid (gap: wide)
|
|
12
|
+
node done "end" below review (gap: wide) shape: pill
|
|
13
|
+
|
|
14
|
+
edge start -> read
|
|
15
|
+
edge read -> valid
|
|
16
|
+
// Out of the diamond's points: a side of a shape is the stretch of its
|
|
17
|
+
// outline between the lines from its middle to two corners of its box.
|
|
18
|
+
edge valid -> handle "yes"
|
|
19
|
+
edge valid -> reject "no" from: right to: left
|
|
20
|
+
edge handle -> review
|
|
21
|
+
edge review -> report from: left to: right
|
|
22
|
+
edge review -> done
|
|
23
|
+
edge reject -> done from: bottom to: right line: (path: square)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// A child may be placed against its parent's text, or against a side or corner
|
|
2
|
+
// of its parent, with the same words used against anything else. Placed against
|
|
3
|
+
// the text, it is content: the parent is the outline of its text and children,
|
|
4
|
+
// and grows to hold it. Placed against a side or corner, it is put on the
|
|
5
|
+
// finished box and never grows it.
|
|
6
|
+
|
|
7
|
+
style mark fill: #cdb96f border: #8f7a3a text: (color: #111111)
|
|
8
|
+
|
|
9
|
+
// Four children in two rows, the title between the columns: placed right of
|
|
10
|
+
// the left column and centered on its two rows, with the right column placed
|
|
11
|
+
// right of the title, so the columns sit as far apart as the title needs.
|
|
12
|
+
node corners "Deployment" (right of corners.a (gap: 1), even with corners.a and corners.c)
|
|
13
|
+
node corners.a "north-west"
|
|
14
|
+
node corners.b "north-east" right of corners text (gap: 1) top even with corners.a
|
|
15
|
+
node corners.c "south-west" below corners.a (gap: 1)
|
|
16
|
+
node corners.d "south-east" below corners.b (gap: 1)
|
|
17
|
+
|
|
18
|
+
// A title in the top-left corner over two rows, packed a unit apart.
|
|
19
|
+
node band "Deployment" (inside top, align: left) right of corners (gap: wide)
|
|
20
|
+
node band.a "north-west"
|
|
21
|
+
node band.b "north-east" right of band.a (gap: 1)
|
|
22
|
+
node band.c "south-west" below band.a (gap: 1)
|
|
23
|
+
node band.d "south-east" below band.b (gap: 1)
|
|
24
|
+
|
|
25
|
+
// A title may be placed against the box's own children, with the words any
|
|
26
|
+
// child uses: here in the top-right corner, beside north-west, with no row of
|
|
27
|
+
// its own.
|
|
28
|
+
node ranged "Deployment" (right even with ranged.d, top even with ranged.a) right of band (gap: wide)
|
|
29
|
+
node ranged.a "north-west"
|
|
30
|
+
node ranged.c "south-west" below ranged.a (gap: 1)
|
|
31
|
+
node ranged.d "south-east" right of ranged.c (gap: 1)
|
|
32
|
+
|
|
33
|
+
// A list is a container: three marks in a column in the order written, beside
|
|
34
|
+
// the title and the ordinary contents, its top even with the title's.
|
|
35
|
+
node column "Payments service" (inside top, align: left) below corners (gap: wide)
|
|
36
|
+
node column.api "api" below column text (gap: 1) left even with column text
|
|
37
|
+
node column.db "database" below column.api (gap: 1) left even with column.api
|
|
38
|
+
node column.marks "" right of column text and column.api and column.db (gap: 1) top even with column text shape: none layout: column (gap: 1)
|
|
39
|
+
node column.marks.one "one" style: mark
|
|
40
|
+
node column.marks.two "two" style: mark
|
|
41
|
+
node column.marks.three "three" style: mark
|
|
42
|
+
|
|
43
|
+
// A child above the title, and the contents below it, their left sides even
|
|
44
|
+
// with the title's.
|
|
45
|
+
node paused "Queue worker" right of column (gap: wide)
|
|
46
|
+
node paused.flag "PAUSED" above paused text (gap: 1) style: mark
|
|
47
|
+
node paused.jobs "jobs" below paused text (gap: 1) left even with paused text
|
|
48
|
+
node paused.retry "retries" below paused.jobs (gap: 1) left even with paused.jobs
|
|
49
|
+
|
|
50
|
+
// Beside one child, even with it.
|
|
51
|
+
node server "Server" (inside top, align: left) right of paused (gap: wide)
|
|
52
|
+
node server.web "web"
|
|
53
|
+
node server.db "database" below server.web (gap: 1) left even with server.web
|
|
54
|
+
node server.cache "cache" below server.db (gap: 1) left even with server.db
|
|
55
|
+
node server.hot "hot" right of server.db (gap: 1) style: mark
|
|
56
|
+
|
|
57
|
+
// Beside the text and joined to it, so the text and the mark are centered in
|
|
58
|
+
// the box together.
|
|
59
|
+
node fresh "Release notes" below column (gap: wide)
|
|
60
|
+
node fresh.tag "new" right of fresh text (gap: 1) join-with: fresh text style: mark
|
|
61
|
+
|
|
62
|
+
// On a corner rather than inside it: centered on the point, so it straddles
|
|
63
|
+
// the edge. It takes no room in the box, so the box is stated wider, with the
|
|
64
|
+
// text along its left, to keep the text clear of it.
|
|
65
|
+
node dot "Inbox" (inside left) right of fresh (gap: wide) width: 7
|
|
66
|
+
node dot.count "3" on dot top-right style: mark
|
|
67
|
+
|
|
68
|
+
// Beyond the frame. The note is placed on the router's finished box and is no
|
|
69
|
+
// part of its size, so the switch is placed right of the note, not the router.
|
|
70
|
+
node router "Router" right of dot (gap: wide)
|
|
71
|
+
node router.note "note" outside router right (gap: tight) style: mark
|
|
72
|
+
node switch "Switch" right of router.note
|
|
73
|
+
|
|
74
|
+
// An edge between two children. Its text takes no room of its own, so the
|
|
75
|
+
// gap is stated wide enough to hold it.
|
|
76
|
+
node pipe "Pipeline" (inside top, align: left) below fresh (gap: wide)
|
|
77
|
+
node pipe.src "source"
|
|
78
|
+
node pipe.out "artifact" 15 right of pipe.src
|
|
79
|
+
edge pipe.src -> pipe.out "build and test" from: right to: left
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// The picture from the README: where reladraw sits between auto-layout and
|
|
2
|
+
// pixel-pushing, the middle node a gap from each end.
|
|
3
|
+
|
|
4
|
+
style tool fill: theme-fill border: theme-border
|
|
5
|
+
style here fill: theme-primary-subtle border: theme-primary
|
|
6
|
+
style dim text: (color: theme-muted)
|
|
7
|
+
|
|
8
|
+
node auto "Auto-layout / [dim]placement is / an output[/dim]" layout: column (gap: tight, widths: match)
|
|
9
|
+
node auto.mermaid "Mermaid.js" style: tool
|
|
10
|
+
node auto.graphviz "Graphviz" style: tool
|
|
11
|
+
node auto.d2 "D2" style: tool
|
|
12
|
+
|
|
13
|
+
node here "reladraw / [dim]placement is / stated[/dim]" right of auto style: here
|
|
14
|
+
|
|
15
|
+
node manual "Absolute / [dim]placement is / pixels[/dim]" right of here even with auto layout: column (gap: tight, widths: match)
|
|
16
|
+
node manual.drawio "draw.io" style: tool
|
|
17
|
+
node manual.excalidraw "Excalidraw" style: tool
|
|
18
|
+
node manual.figma "Figma" style: tool
|
|
19
|
+
|
|
20
|
+
edge auto -> here from: right to: left
|
|
21
|
+
edge here -> manual from: right to: left
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Gaps belong to placements. Each says exactly how far, and a node has none of
|
|
2
|
+
// its own.
|
|
3
|
+
|
|
4
|
+
style plain fill: theme-fill border: theme-border
|
|
5
|
+
|
|
6
|
+
node left_wall "Left wall" style: plain
|
|
7
|
+
|
|
8
|
+
// Different distances on each side, each on its own placement.
|
|
9
|
+
node wedge "Tight left, wide right" right of left_wall (gap: tight) style: plain
|
|
10
|
+
node right_wall "Right wall" right of wedge (gap: wide) style: plain
|
|
11
|
+
|
|
12
|
+
// Two placements, two gaps: wide below, tight from the wall.
|
|
13
|
+
node stack "Wide below the wedge" below wedge (gap: wide) right of left_wall (gap: tight) style: plain
|
|
14
|
+
|
|
15
|
+
// `none` is contact, and the other placement still keeps its distance.
|
|
16
|
+
node shelf "Flat on the stack" below stack (gap: none) right of left_wall (gap: tight) style: plain
|
|
17
|
+
|
|
18
|
+
edge left_wall -> wedge from: right to: left
|
|
19
|
+
edge wedge -> right_wall from: right to: left
|
|
20
|
+
|
|
21
|
+
// A gap is written where the relationship is: each neighbor says how far it
|
|
22
|
+
// sits from the island, and the island says nothing about them.
|
|
23
|
+
node island "Says nothing about its neighbors" below shelf style: plain
|
|
24
|
+
node east "Wide from the island" right of island (gap: wide) style: plain
|
|
25
|
+
node west "Tight from the island" left of island (gap: tight) style: plain
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// The seven icons, and the two ways to use one: badge: puts the picture beside
|
|
2
|
+
// a node's text, and icon: draws the node as the picture, with no box.
|
|
3
|
+
|
|
4
|
+
// A style can carry a badge, so every store in a diagram looks alike without
|
|
5
|
+
// anyone typing the word twice.
|
|
6
|
+
style store fill: theme-primary-subtle border: theme-primary badge: database
|
|
7
|
+
|
|
8
|
+
// badge: makes the picture part of the label, and is shorthand for a heading.
|
|
9
|
+
// row1.disk below is the same as writing
|
|
10
|
+
// node row1.disk heading: row1.disk.head
|
|
11
|
+
// node row1.disk.head "" shape: none
|
|
12
|
+
// node row1.disk.head.text "Spinning disk" (size: normal) shape: none
|
|
13
|
+
// node row1.disk.head.badge icon: disk 1 right of row1.disk.head.text
|
|
14
|
+
node row1 "" shape: none
|
|
15
|
+
node row1.disk "Spinning disk" badge: disk
|
|
16
|
+
node row1.desktop "Workstation" right of row1.disk (gap: tight) badge: desktop
|
|
17
|
+
node row1.laptop "Portable" right of row1.desktop (gap: tight) badge: laptop
|
|
18
|
+
|
|
19
|
+
node row2 "" below row1 (gap: tight) shape: none
|
|
20
|
+
node row2.package "Archive" badge: package
|
|
21
|
+
node row2.cubes "Service instances" right of row2.package (gap: tight) badge: cubes
|
|
22
|
+
node row2.db "Records" right of row2.cubes (gap: tight) style: store
|
|
23
|
+
|
|
24
|
+
// icon: the node is the picture itself, and has no text unless you give it one.
|
|
25
|
+
node row3 "" below row2 (gap: tight) shape: none
|
|
26
|
+
node row3.cube icon: cube
|
|
27
|
+
node row3.db icon: database right of row3.cube (gap: tight)
|
|
28
|
+
node row3.laptop "Portable" icon: laptop right of row3.db (gap: tight)
|
|
29
|
+
|
|
30
|
+
// No text, so the node is just the badge and its padding.
|
|
31
|
+
node bare "" below row3 (gap: tight) badge: disk
|
|
32
|
+
|
|
33
|
+
// A badge is two lines tall, so it shrinks and grows with the text beside it.
|
|
34
|
+
node small "Small text / and a small badge" (size: small) right of bare (gap: tight) badge: laptop
|
|
35
|
+
node large "Large text / and a large badge" (size: large) right of small (gap: tight) badge: laptop
|