@knowvah/dot-engine 2.11.0 → 2.12.1

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.
Files changed (88) hide show
  1. package/dist/common/agerr.d.ts +12 -0
  2. package/dist/common/agerr.d.ts.map +1 -1
  3. package/dist/common/edge-in-box.d.ts +6 -20
  4. package/dist/common/edge-in-box.d.ts.map +1 -1
  5. package/dist/common/emit-bb.d.ts +36 -0
  6. package/dist/common/emit-bb.d.ts.map +1 -0
  7. package/dist/gvc/__fixtures__/subg-renders/subg-renders.d.ts +10 -0
  8. package/dist/gvc/__fixtures__/subg-renders/subg-renders.d.ts.map +1 -0
  9. package/dist/gvc/device.d.ts.map +1 -1
  10. package/dist/gvc/emit-xdot.d.ts +9 -0
  11. package/dist/gvc/emit-xdot.d.ts.map +1 -1
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +7357 -7187
  15. package/dist/index.js.map +4 -4
  16. package/dist/layout/dot/decomp.d.ts.map +1 -1
  17. package/dist/layout/dot/edge-route-chain.d.ts.map +1 -1
  18. package/dist/layout/dot/edge-route.d.ts +3 -8
  19. package/dist/layout/dot/edge-route.d.ts.map +1 -1
  20. package/dist/layout/dot/init.d.ts +25 -4
  21. package/dist/layout/dot/init.d.ts.map +1 -1
  22. package/dist/layout/dot/splines.d.ts +5 -3
  23. package/dist/layout/dot/splines.d.ts.map +1 -1
  24. package/dist/layout/neato/fdp-adjust.d.ts.map +1 -1
  25. package/dist/layout/neato/sgd.d.ts.map +1 -1
  26. package/dist/layout/sfdp/spring-electrical.d.ts.map +1 -1
  27. package/dist/render/dot/agwrite-linelength.d.ts +25 -0
  28. package/dist/render/dot/agwrite-linelength.d.ts.map +1 -0
  29. package/dist/render/dot/agwrite.d.ts +4 -7
  30. package/dist/render/dot/agwrite.d.ts.map +1 -1
  31. package/dist/render/dot/attrs.d.ts.map +1 -1
  32. package/dist/render/dot/write-back.d.ts +10 -0
  33. package/dist/render/dot/write-back.d.ts.map +1 -1
  34. package/dist/render/dot.d.ts +1 -2
  35. package/dist/render/dot.d.ts.map +1 -1
  36. package/dist/render/json-cluster-edge.d.ts +22 -0
  37. package/dist/render/json-cluster-edge.d.ts.map +1 -0
  38. package/dist/render/json.d.ts.map +1 -1
  39. package/dist/render/map.d.ts.map +1 -1
  40. package/dist/render/svg-graph.d.ts.map +1 -1
  41. package/dist/render.js +7360 -7196
  42. package/dist/render.js.map +4 -4
  43. package/dist/util/printf-round.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/src/common/agerr.ts +49 -1
  46. package/src/common/edge-in-box.ts +9 -24
  47. package/src/common/emit-bb.ts +128 -0
  48. package/src/gvc/__fixtures__/rerender/nestedclust.dot.dot.nofree.1 +45 -0
  49. package/src/gvc/__fixtures__/rerender/nestedclust.dot.dot.nofree.2 +45 -0
  50. package/src/gvc/__fixtures__/rerender/nestedclust.dot.dot.nofree.3 +45 -0
  51. package/src/gvc/__fixtures__/rerender/nestedclust.dot.xdot.nofree.1 +74 -0
  52. package/src/gvc/__fixtures__/rerender/nestedclust.dot.xdot.nofree.2 +74 -0
  53. package/src/gvc/__fixtures__/rerender/nestedclust.dot.xdot.nofree.3 +76 -0
  54. package/src/gvc/__fixtures__/rerender/nestedclust.gv +4 -0
  55. package/src/gvc/__fixtures__/rerender/regen.sh +5 -0
  56. package/src/gvc/__fixtures__/subg-renders/subg-renders.ts +48 -0
  57. package/src/gvc/device.ts +26 -27
  58. package/src/gvc/emit-gates.ts +1 -1
  59. package/src/gvc/emit-xdot.ts +5 -6
  60. package/src/index.ts +4 -0
  61. package/src/layout/dot/decomp.ts +23 -2
  62. package/src/layout/dot/edge-route-chain.ts +79 -7
  63. package/src/layout/dot/edge-route.ts +8 -37
  64. package/src/layout/dot/init.ts +36 -11
  65. package/src/layout/dot/splines-flat.ts +2 -2
  66. package/src/layout/dot/splines-groups.ts +2 -2
  67. package/src/layout/dot/splines-route.ts +2 -2
  68. package/src/layout/dot/splines.ts +10 -10
  69. package/src/layout/fdp/index.ts +2 -2
  70. package/src/layout/neato/conjgrad.ts +2 -2
  71. package/src/layout/neato/fdp-adjust.ts +1 -16
  72. package/src/layout/neato/sgd.ts +3 -9
  73. package/src/layout/sfdp/spring-electrical.ts +5 -3
  74. package/src/render/dot/agwrite-linelength.ts +58 -0
  75. package/src/render/dot/agwrite.ts +13 -13
  76. package/src/render/dot/attrs.ts +27 -1
  77. package/src/render/dot/write-back.ts +21 -0
  78. package/src/render/dot/xdot-ops.ts +1 -1
  79. package/src/render/dot.ts +11 -17
  80. package/src/render/json-cluster-edge.ts +50 -0
  81. package/src/render/json.ts +16 -19
  82. package/src/render/map.ts +3 -7
  83. package/src/render/svg-graph.ts +22 -9
  84. package/src/render/svg.ts +3 -3
  85. package/src/util/printf-round.ts +16 -10
  86. package/dist/layout/dot/edge-order.d.ts +0 -27
  87. package/dist/layout/dot/edge-order.d.ts.map +0 -1
  88. package/src/layout/dot/edge-order.ts +0 -62
@@ -1 +1 @@
1
- {"version":3,"file":"printf-round.d.ts","sourceRoot":"","sources":["../../src/util/printf-round.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA4DH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAqB/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAqCxD"}
1
+ {"version":3,"file":"printf-round.d.ts","sourceRoot":"","sources":["../../src/util/printf-round.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAuEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAkB/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmCxD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowvah/dot-engine",
3
- "version": "2.11.0",
3
+ "version": "2.12.1",
4
4
  "description": "Faithful TypeScript port of Graphviz (dot, neato, fdp, sfdp, circo, twopi, osage, patchwork) — no C: no native binary, no WASM. Oracle-verified against the C implementation, runs in the browser.",
5
5
  "keywords": [
6
6
  "graphviz",
@@ -13,6 +13,10 @@
13
13
  * joined line printed on the held line's channel. A held line is flushed on
14
14
  * its own by {@link agerrLineOn}/{@link agerrFinished} and by render-state
15
15
  * reset.
16
+ *
17
+ * A caller-set {@link agseterrf} function replaces the console as C's
18
+ * `usererrf` replaces `default_usererrf`: it receives the raw pieces `out`
19
+ * writes, and no line is held.
16
20
  */
17
21
 
18
22
  import { registerRenderState } from './render-state.js';
@@ -45,6 +49,31 @@ let lastLevel: 'error' | 'warning' = 'warning';
45
49
  */
46
50
  const pending: { line: string | null; channel: AgerrChannel } = { line: null, channel: 'warn' };
47
51
 
52
+ /**
53
+ * C's `agusererrf`: called with each piece of a message as `out` writes it.
54
+ * The return value is ignored, as C ignores it.
55
+ * @see lib/cgraph/cgraph.h:agusererrf
56
+ */
57
+ export type AgUserErrF = (message: string) => number | void;
58
+
59
+ /**
60
+ * The user-set error function, or null for the console. Process-wide and not
61
+ * reset per render, as C's `usererrf` static is not.
62
+ * @see lib/cgraph/agerror.c:usererrf
63
+ */
64
+ let usererrf: AgUserErrF | null = null;
65
+
66
+ /**
67
+ * Set the function that receives engine messages in place of the console;
68
+ * null restores the console. Returns the previous function.
69
+ * @see lib/cgraph/agerror.c:agseterrf
70
+ */
71
+ export function agseterrf(newf: AgUserErrF | null): AgUserErrF | null {
72
+ const oldf = usererrf;
73
+ usererrf = newf;
74
+ return oldf;
75
+ }
76
+
48
77
  registerRenderState(() => {
49
78
  flushPending();
50
79
  lastLevel = 'warning';
@@ -84,7 +113,8 @@ function flushPending(): void {
84
113
  }
85
114
 
86
115
  function writeLine(channel: AgerrChannel, line: string): void {
87
- if (channel === 'warn') console.warn(escapeControl(line));
116
+ if (usererrf !== null) usererrf(`${line}\n`);
117
+ else if (channel === 'warn') console.warn(escapeControl(line));
88
118
  else console.error(escapeControl(line));
89
119
  }
90
120
 
@@ -95,6 +125,19 @@ function assemble(level: AgerrLevel, msg: string): string {
95
125
  return `${prefix}${PREFIX_SEP}${msg}`;
96
126
  }
97
127
 
128
+ /**
129
+ * `out` with a user function: the prefix and `": "` (none for AGPREV), then
130
+ * the message, each as its own call.
131
+ * @see lib/cgraph/agerror.c:out
132
+ */
133
+ function outToUser(errf: AgUserErrF, level: AgerrLevel, msg: string): void {
134
+ if (level !== 'prev') {
135
+ errf(level === 'error' ? PREFIX_ERROR : PREFIX_WARNING);
136
+ errf(PREFIX_SEP);
137
+ }
138
+ errf(msg);
139
+ }
140
+
98
141
  /** Console channel of a message; AGPREV continues the previous level's. */
99
142
  function channelOf(level: AgerrLevel): AgerrChannel {
100
143
  const eff = level === 'prev' ? lastLevel : level;
@@ -108,6 +151,11 @@ function channelOf(level: AgerrLevel): AgerrChannel {
108
151
  function emit(level: AgerrLevel, msg: string, channel: AgerrChannel | undefined, hold: boolean): void {
109
152
  const target = channel ?? channelOf(level);
110
153
  if (level !== 'prev') lastLevel = level;
154
+ if (usererrf !== null) {
155
+ flushPending();
156
+ outToUser(usererrf, level, hold ? msg : `${msg}\n`);
157
+ return;
158
+ }
111
159
  const text = assemble(level, msg);
112
160
  if (pending.line === null) {
113
161
  pending.channel = target;
@@ -2,8 +2,7 @@
2
2
 
3
3
  /**
4
4
  * emit_edge's edge_in_box gate, shared by the device walk (edge comments) and
5
- * the SVG / xdot renderers (edge group and draw ops). Moved out of
6
- * render/svg.ts unchanged.
5
+ * the SVG / xdot renderers (edge group and draw ops).
7
6
  *
8
7
  * @see lib/common/emit.c:edge_in_box, lib/common/utils.c:overlap_label
9
8
  */
@@ -26,29 +25,15 @@ function overlapLabel(lp: TextlabelT, b: Box): boolean {
26
25
  }
27
26
 
28
27
  /**
29
- * Faithful-to-outcome `edge_in_box`: true when the edge has something to draw.
30
- * C's gvrender defers the `<g>` until a draw op, so an edge whose content falls
31
- * entirely outside the clip emits no group (emit.c:edge_in_box tests each piece
32
- * vs job->clip via boxf_overlap/overlap_label).
33
- *
34
- * The only piece that can legitimately fall OUTSIDE the clip on this corpus is a
35
- * degenerate labeled-flat label: it is spline-less, so map_edge leaves it at its
36
- * internal (un-normalized) x-frame position while the clip is the final frame.
37
- * The `overlapLabel` test on the main label reproduces C's draw-iff-overlap for
38
- * exactly that case — on-canvas (2368) → drawn; off-canvas (2368_1, negative
39
- * un-normalized x) → suppressed. A present spline always lies within the clip
40
- * (GD_bb contains it), and head/tail/xlabels are positioned at on-canvas
41
- * endpoints, so those keep their existing unconditional triggers — adding an
42
- * overlap test there only risks suppressing legitimately-drawn content (it
43
- * regressed neato/circo edges whose spl.bb is computed differently). The `set`
44
- * guard on the main label is kept: the port retains an unplaced (`pos=0,0`,
45
- * `set=false`) label on merged back-edges where C has none.
46
- * @see lib/common/emit.c:edge_in_box, lib/common/utils.c:overlap_label
28
+ * `edge_in_box`: whether any piece of the edge overlaps the page clip — the
29
+ * spline's box (`spl->bb`, which init_bb computes before every render; see
30
+ * emit-bb.ts), the label, or a placed xlabel. emit_edge draws nothing, not even
31
+ * the edge's group, when this fails. Head and tail labels are not tested.
32
+ * @see lib/common/emit.c:2686 edge_in_box, lib/common/utils.c:overlap_label
47
33
  */
48
34
  export function edgeHasDrawableContent(e: Edge, clip: Box): boolean {
49
35
  const i = e.info;
50
- return i.spl !== undefined
51
- || (i.label !== undefined && i.label.set && overlapLabel(i.label, clip))
52
- || i.xlabel !== undefined
53
- || i.head_label !== undefined || i.tail_label !== undefined;
36
+ if (i.spl !== undefined && boxOverlap(i.spl.bb, clip)) return true;
37
+ if (i.label !== undefined && overlapLabel(i.label, clip)) return true;
38
+ return i.xlabel !== undefined && i.xlabel.set && overlapLabel(i.xlabel, clip);
54
39
  }
@@ -0,0 +1,128 @@
1
+ // SPDX-License-Identifier: EPL-2.0
2
+
3
+ /**
4
+ * The bounding boxes gvRenderJobs computes before every render: each node's
5
+ * `ND_bb` and each out-edge's `spl->bb`, which `edge_in_box` tests against the
6
+ * page clip. The node half is not stored: `nodeInBox` derives `ND_bb` from the
7
+ * same fields at the test, and nothing between here and that test moves a node.
8
+ *
9
+ * @see lib/common/emit.c:4076 bezier_bb, :4101 init_splines_bb, :4157 init_bb
10
+ * @see lib/common/arrows.c:1107 arrow_bb
11
+ */
12
+
13
+ import type { Bezier, Box, Point, Spline } from '../model/geom.js';
14
+ import type { Graph } from '../model/graph.js';
15
+ import { buildOutEdgeIndex } from '../model/node.js';
16
+ import { ARROW_LENGTH, EPSILON } from './arrows-constants.js';
17
+ import { libmHypot } from './libm-hypot.js';
18
+
19
+ /** C `fmax`: a NaN operand yields the other operand. */
20
+ function fmax(a: number, b: number): number {
21
+ if (Number.isNaN(a)) return b;
22
+ if (Number.isNaN(b)) return a;
23
+ return a > b ? a : b;
24
+ }
25
+
26
+ /** C `fmin`: a NaN operand yields the other operand. */
27
+ function fmin(a: number, b: number): number {
28
+ if (Number.isNaN(a)) return b;
29
+ if (Number.isNaN(b)) return a;
30
+ return a < b ? a : b;
31
+ }
32
+
33
+ /**
34
+ * The box of an arrowhead of length `ARROW_LENGTH * arrowsize` at `p`, aimed
35
+ * along `u - p`: the four corners of the rotated head's bounding square.
36
+ * @see lib/common/arrows.c:1107 arrow_bb
37
+ */
38
+ export function arrowBb(p: Point, u0: Point, arrowsize: number): Box {
39
+ const u = { x: u0.x - p.x, y: u0.y - p.y };
40
+ // the EPSILONs are to keep this stable as length of u approaches 0.0
41
+ const s = (ARROW_LENGTH * arrowsize) / (libmHypot(u.x, u.y) + EPSILON);
42
+ u.x += u.x >= 0.0 ? EPSILON : -EPSILON;
43
+ u.y += u.y >= 0.0 ? EPSILON : -EPSILON;
44
+ u.x *= s;
45
+ u.y *= s;
46
+ const ux2 = u.x / 2;
47
+ const uy2 = u.y / 2;
48
+ const ax = p.x - uy2;
49
+ const ay = p.y - ux2;
50
+ const bx = p.x + uy2;
51
+ const by = p.y + ux2;
52
+ const cx = ax + u.x;
53
+ const cy = ay + u.y;
54
+ const dx = bx + u.x;
55
+ const dy = by + u.y;
56
+ return {
57
+ ur: { x: fmax(ax, fmax(bx, fmax(cx, dx))), y: fmax(ay, fmax(by, fmax(cy, dy))) },
58
+ ll: { x: fmin(ax, fmin(bx, fmin(cx, dx))), y: fmin(ay, fmin(by, fmin(cy, dy))) },
59
+ };
60
+ }
61
+
62
+ /** expandbp: grow `bb` to hold `p`. @see lib/common/geom.h:expandbp */
63
+ function expandbp(bb: Box, p: Point): void {
64
+ bb.ll.x = fmin(bb.ll.x, p.x);
65
+ bb.ll.y = fmin(bb.ll.y, p.y);
66
+ bb.ur.x = fmax(bb.ur.x, p.x);
67
+ bb.ur.y = fmax(bb.ur.y, p.y);
68
+ }
69
+
70
+ /** EXPANDBB: grow `bb` to hold `b`. @see lib/common/geom.h:EXPANDBB */
71
+ function expandBb(bb: Box, b: Box): void {
72
+ bb.ll.x = fmin(bb.ll.x, b.ll.x);
73
+ bb.ll.y = fmin(bb.ll.y, b.ll.y);
74
+ bb.ur.x = fmax(bb.ur.x, b.ur.x);
75
+ bb.ur.y = fmax(bb.ur.y, b.ur.y);
76
+ }
77
+
78
+ /**
79
+ * A bezier's box: its first point, then per segment the midpoint of the two
80
+ * control points and the segment's end point.
81
+ * @see lib/common/emit.c:4076 bezier_bb
82
+ */
83
+ export function bezierBb(bz: Bezier): Box {
84
+ const p0 = bz.list[0]!;
85
+ const bb: Box = { ll: { x: p0.x, y: p0.y }, ur: { x: p0.x, y: p0.y } };
86
+ for (let i = 1; i < bz.size;) {
87
+ // take mid-point between two control points for bb calculation
88
+ const p1 = bz.list[i++]!;
89
+ const p2 = bz.list[i++]!;
90
+ expandbp(bb, { x: (p1.x + p2.x) / 2, y: (p1.y + p2.y) / 2 });
91
+ expandbp(bb, bz.list[i++]!);
92
+ }
93
+ return bb;
94
+ }
95
+
96
+ /**
97
+ * `spl->bb`: the union of every bezier's box and, for each flagged end, the
98
+ * box of a unit-size arrowhead there.
99
+ * @see lib/common/emit.c:4101 init_splines_bb
100
+ */
101
+ export function initSplinesBb(spl: Spline): void {
102
+ let bz = spl.list[0]!;
103
+ const bb = bezierBb(bz);
104
+ for (let i = 0; i < spl.size; i++) {
105
+ if (i > 0) {
106
+ bz = spl.list[i]!;
107
+ expandBb(bb, bezierBb(bz));
108
+ }
109
+ if (bz.sflag) expandBb(bb, arrowBb(bz.sp, bz.list[0]!, 1));
110
+ if (bz.eflag) expandBb(bb, arrowBb(bz.ep, bz.list[bz.size - 1]!, 1));
111
+ }
112
+ spl.bb = bb;
113
+ }
114
+
115
+ /**
116
+ * Before each render: `spl->bb` of every out-edge of every node of `g`, the
117
+ * graph being rendered (a subgraph render leaves other edges' boxes alone).
118
+ * @see lib/common/emit.c:4127 init_bb_edge, :4136 init_bb_node, :4157 init_bb
119
+ */
120
+ export function initBb(g: Graph): void {
121
+ const out = buildOutEdgeIndex(g);
122
+ for (const n of g.nodes.values()) {
123
+ for (const e of out.get(n) ?? []) {
124
+ const spl = e.info.spl;
125
+ if (spl) initSplinesBb(spl);
126
+ }
127
+ }
128
+ }
@@ -0,0 +1,45 @@
1
+ digraph G {
2
+ graph [bb="0,0,300,220"];
3
+ node [color="#00ff005f",
4
+ fillcolor="#00ff005f",
5
+ label="\N",
6
+ style=filled
7
+ ];
8
+ {
9
+ subgraph cluster_ss81 {
10
+ graph [bb="64,8,134,204"];
11
+ a [height=0.5,
12
+ pos="99,178",
13
+ width=0.75];
14
+ b [height=0.5,
15
+ pos="99,106",
16
+ width=0.75];
17
+ a -> b [pos="e,99,124.1 99,159.7 99,152.41 99,143.73 99,135.54"];
18
+ c [height=0.5,
19
+ pos="99,34",
20
+ width=0.75];
21
+ b -> c [pos="e,99,52.104 99,87.697 99,80.407 99,71.726 99,63.536"];
22
+ }
23
+ e [height=0.5,
24
+ pos="27,178",
25
+ width=0.75];
26
+ f [height=0.5,
27
+ pos="27,106",
28
+ width=0.75];
29
+ e -> f [pos="e,27,124.1 27,159.7 27,152.41 27,143.73 27,135.54"];
30
+ }
31
+ {
32
+ subgraph cluster_x {
33
+ graph [bb="142,144,292,212"];
34
+ subgraph cluster_y {
35
+ graph [bb="150,152,220,204"];
36
+ y [height=0.5,
37
+ pos="185,178",
38
+ width=0.75];
39
+ }
40
+ x [height=0.5,
41
+ pos="257,178",
42
+ width=0.75];
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,45 @@
1
+ digraph G {
2
+ graph [bb="0,0,300,220"];
3
+ node [color="#00ff005f",
4
+ fillcolor="#00ff005f",
5
+ label="\N",
6
+ style=filled
7
+ ];
8
+ {
9
+ subgraph cluster_ss81 {
10
+ graph [bb="64,8,134,204"];
11
+ a [height=0.5,
12
+ pos="0,178",
13
+ width=0.75];
14
+ b [height=0.5,
15
+ pos="0,106",
16
+ width=0.75];
17
+ a -> b [pos="e,99,124.1 99,159.7 99,152.41 99,143.73 99,135.54"];
18
+ c [height=0.5,
19
+ pos="0,34",
20
+ width=0.75];
21
+ b -> c [pos="e,99,52.104 99,87.697 99,80.407 99,71.726 99,63.536"];
22
+ }
23
+ e [height=0.5,
24
+ pos="0,178",
25
+ width=0.75];
26
+ f [height=0.5,
27
+ pos="1,106",
28
+ width=0.75];
29
+ e -> f [pos="e,27,124.1 27,159.7 27,152.41 27,143.73 27,135.54"];
30
+ }
31
+ {
32
+ subgraph cluster_x {
33
+ graph [bb="142,144,292,212"];
34
+ subgraph cluster_y {
35
+ graph [bb="150,152,220,204"];
36
+ y [height=0.5,
37
+ pos="0,178",
38
+ width=0.75];
39
+ }
40
+ x [height=0.5,
41
+ pos="0,178",
42
+ width=0.75];
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,45 @@
1
+ digraph G {
2
+ graph [bb="0,0,300,220"];
3
+ node [color="#00ff005f",
4
+ fillcolor="#00ff005f",
5
+ label="\N",
6
+ style=filled
7
+ ];
8
+ {
9
+ subgraph cluster_ss81 {
10
+ graph [bb="64,8,134,204"];
11
+ a [height=0.5,
12
+ pos="0,178",
13
+ width=0.75];
14
+ b [height=0.5,
15
+ pos="0,106",
16
+ width=0.75];
17
+ a -> b [pos="e,99,124.1 99,159.7 99,152.41 99,143.73 99,135.54"];
18
+ c [height=0.5,
19
+ pos="0,34",
20
+ width=0.75];
21
+ b -> c [pos="e,99,52.104 99,87.697 99,80.407 99,71.726 99,63.536;e,0,52.104 0,87.697 0,80.407 0,71.726 0,63.536"];
22
+ }
23
+ e [height=0.5,
24
+ pos="0,178",
25
+ width=0.75];
26
+ f [height=0.5,
27
+ pos="0,106",
28
+ width=0.75];
29
+ e -> f [pos="e,27,124.1 27,159.7 27,152.41 27,143.73 27,135.54"];
30
+ }
31
+ {
32
+ subgraph cluster_x {
33
+ graph [bb="142,144,292,212"];
34
+ subgraph cluster_y {
35
+ graph [bb="150,152,220,204"];
36
+ y [height=0.5,
37
+ pos="0,178",
38
+ width=0.75];
39
+ }
40
+ x [height=0.5,
41
+ pos="0,178",
42
+ width=0.75];
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,74 @@
1
+ digraph G {
2
+ graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 220 300 220 300 0 ",
3
+ bb="0,0,300,220",
4
+ xdotversion=1.7
5
+ ];
6
+ node [color="#00ff005f",
7
+ fillcolor="#00ff005f",
8
+ label="\N",
9
+ style=filled
10
+ ];
11
+ {
12
+ subgraph cluster_ss81 {
13
+ graph [_draw_="c 7 -#000000 p 4 64 8 64 204 134 204 134 8 ",
14
+ bb="64,8,134,204"
15
+ ];
16
+ a [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 99 178 27 18 ",
17
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 99 173.8 0 6.21 1 -a ",
18
+ height=0.5,
19
+ pos="99,178",
20
+ width=0.75];
21
+ b [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 99 106 27 18 ",
22
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 99 101.8 0 7 1 -b ",
23
+ height=0.5,
24
+ pos="99,106",
25
+ width=0.75];
26
+ a -> b [_draw_="c 7 -#000000 B 4 99 159.7 99 152.41 99 143.73 99 135.54 ",
27
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 102.5 135.62 99 125.62 95.5 135.62 ",
28
+ pos="e,99,124.1 99,159.7 99,152.41 99,143.73 99,135.54"];
29
+ c [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 99 34 27 18 ",
30
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 99 29.8 0 6.21 1 -c ",
31
+ height=0.5,
32
+ pos="99,34",
33
+ width=0.75];
34
+ b -> c [_draw_="c 7 -#000000 B 4 99 87.7 99 80.41 99 71.73 99 63.54 ",
35
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 102.5 63.62 99 53.62 95.5 63.62 ",
36
+ pos="e,99,52.104 99,87.697 99,80.407 99,71.726 99,63.536"];
37
+ }
38
+ e [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 27 178 27 18 ",
39
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 27 173.8 0 6.21 1 -e ",
40
+ height=0.5,
41
+ pos="27,178",
42
+ width=0.75];
43
+ f [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 27 106 27 18 ",
44
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 27 101.8 0 4.66 1 -f ",
45
+ height=0.5,
46
+ pos="27,106",
47
+ width=0.75];
48
+ e -> f [_draw_="c 7 -#000000 B 4 27 159.7 27 152.41 27 143.73 27 135.54 ",
49
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 30.5 135.62 27 125.62 23.5 135.62 ",
50
+ pos="e,27,124.1 27,159.7 27,152.41 27,143.73 27,135.54"];
51
+ }
52
+ {
53
+ subgraph cluster_x {
54
+ graph [_draw_="c 7 -#000000 p 4 142 144 142 212 292 212 292 144 ",
55
+ bb="142,144,292,212"
56
+ ];
57
+ subgraph cluster_y {
58
+ graph [_draw_="c 7 -#000000 p 4 150 152 150 204 220 204 220 152 ",
59
+ bb="150,152,220,204"
60
+ ];
61
+ y [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 185 178 27 18 ",
62
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 185 173.8 0 7 1 -y ",
63
+ height=0.5,
64
+ pos="185,178",
65
+ width=0.75];
66
+ }
67
+ x [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 257 178 27 18 ",
68
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 257 173.8 0 7 1 -x ",
69
+ height=0.5,
70
+ pos="257,178",
71
+ width=0.75];
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,74 @@
1
+ digraph G {
2
+ graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 220 300 220 300 0 c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 220 300 220 300 0 ",
3
+ bb="0,0,300,220",
4
+ xdotversion=1.7
5
+ ];
6
+ node [color="#00ff005f",
7
+ fillcolor="#00ff005f",
8
+ label="\N",
9
+ style=filled
10
+ ];
11
+ {
12
+ subgraph cluster_ss81 {
13
+ graph [_draw_="c 7 -#000000 p 4 64 8 64 204 134 204 134 8 ",
14
+ bb="64,8,134,204"
15
+ ];
16
+ a [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
17
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 6.21 1 -a ",
18
+ height=0.5,
19
+ pos="0,178",
20
+ width=0.75];
21
+ b [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 106 27 18 ",
22
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 101.8 0 7 1 -b ",
23
+ height=0.5,
24
+ pos="0,106",
25
+ width=0.75];
26
+ a -> b [_draw_="c 7 -#000000 B 4 99 159.7 99 152.41 99 143.73 99 135.54 ",
27
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 102.5 135.62 99 125.62 95.5 135.62 ",
28
+ pos="e,99,124.1 99,159.7 99,152.41 99,143.73 99,135.54"];
29
+ c [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 34 27 18 ",
30
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 29.8 0 6.21 1 -c ",
31
+ height=0.5,
32
+ pos="0,34",
33
+ width=0.75];
34
+ b -> c [_draw_="c 7 -#000000 B 4 99 87.7 99 80.41 99 71.73 99 63.54 ",
35
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 102.5 63.62 99 53.62 95.5 63.62 ",
36
+ pos="e,99,52.104 99,87.697 99,80.407 99,71.726 99,63.536"];
37
+ }
38
+ e [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
39
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 6.21 1 -e ",
40
+ height=0.5,
41
+ pos="0,178",
42
+ width=0.75];
43
+ f [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 1 106 27 18 ",
44
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 1 101.8 0 4.66 1 -f ",
45
+ height=0.5,
46
+ pos="1,106",
47
+ width=0.75];
48
+ e -> f [_draw_="c 7 -#000000 B 4 27 159.7 27 152.41 27 143.73 27 135.54 ",
49
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 30.5 135.62 27 125.62 23.5 135.62 ",
50
+ pos="e,27,124.1 27,159.7 27,152.41 27,143.73 27,135.54"];
51
+ }
52
+ {
53
+ subgraph cluster_x {
54
+ graph [_draw_="c 7 -#000000 p 4 142 144 142 212 292 212 292 144 ",
55
+ bb="142,144,292,212"
56
+ ];
57
+ subgraph cluster_y {
58
+ graph [_draw_="c 7 -#000000 p 4 150 152 150 204 220 204 220 152 ",
59
+ bb="150,152,220,204"
60
+ ];
61
+ y [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
62
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 7 1 -y ",
63
+ height=0.5,
64
+ pos="0,178",
65
+ width=0.75];
66
+ }
67
+ x [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
68
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 7 1 -x ",
69
+ height=0.5,
70
+ pos="0,178",
71
+ width=0.75];
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,76 @@
1
+ digraph G {
2
+ graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 220 300 220 300 0 c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 220 300 220 300 0 c 9 -#fffffe00 C \
3
+ 7 -#ffffff P 4 0 0 0 220 300 220 300 0 ",
4
+ bb="0,0,300,220",
5
+ xdotversion=1.7
6
+ ];
7
+ node [color="#00ff005f",
8
+ fillcolor="#00ff005f",
9
+ label="\N",
10
+ style=filled
11
+ ];
12
+ {
13
+ subgraph cluster_ss81 {
14
+ graph [_draw_="c 7 -#000000 p 4 64 8 64 204 134 204 134 8 ",
15
+ bb="64,8,134,204"
16
+ ];
17
+ a [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
18
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 6.21 1 -a ",
19
+ height=0.5,
20
+ pos="0,178",
21
+ width=0.75];
22
+ b [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 106 27 18 ",
23
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 101.8 0 7 1 -b ",
24
+ height=0.5,
25
+ pos="0,106",
26
+ width=0.75];
27
+ a -> b [_draw_="c 7 -#000000 B 4 99 159.7 99 152.41 99 143.73 99 135.54 ",
28
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 102.5 135.62 99 125.62 95.5 135.62 ",
29
+ pos="e,99,124.1 99,159.7 99,152.41 99,143.73 99,135.54"];
30
+ c [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 34 27 18 ",
31
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 29.8 0 6.21 1 -c ",
32
+ height=0.5,
33
+ pos="0,34",
34
+ width=0.75];
35
+ b -> c [_draw_="c 7 -#000000 B 4 99 87.7 99 80.41 99 71.73 99 63.54 S 5 -solid c 7 -#000000 B 4 0 87.7 0 80.41 0 71.73 0 63.54 ",
36
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 102.5 63.62 99 53.62 95.5 63.62 S 5 -solid c 7 -#000000 C 7 -#000000 P 3 3.5 63.62 0 53.62 \
37
+ -3.5 63.62 ",
38
+ pos="e,99,52.104 99,87.697 99,80.407 99,71.726 99,63.536;e,0,52.104 0,87.697 0,80.407 0,71.726 0,63.536"];
39
+ }
40
+ e [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
41
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 6.21 1 -e ",
42
+ height=0.5,
43
+ pos="0,178",
44
+ width=0.75];
45
+ f [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 106 27 18 ",
46
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 101.8 0 4.66 1 -f ",
47
+ height=0.5,
48
+ pos="0,106",
49
+ width=0.75];
50
+ e -> f [_draw_="c 7 -#000000 B 4 27 159.7 27 152.41 27 143.73 27 135.54 ",
51
+ _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 30.5 135.62 27 125.62 23.5 135.62 ",
52
+ pos="e,27,124.1 27,159.7 27,152.41 27,143.73 27,135.54"];
53
+ }
54
+ {
55
+ subgraph cluster_x {
56
+ graph [_draw_="c 7 -#000000 p 4 142 144 142 212 292 212 292 144 ",
57
+ bb="142,144,292,212"
58
+ ];
59
+ subgraph cluster_y {
60
+ graph [_draw_="c 7 -#000000 p 4 150 152 150 204 220 204 220 152 ",
61
+ bb="150,152,220,204"
62
+ ];
63
+ y [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
64
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 7 1 -y ",
65
+ height=0.5,
66
+ pos="0,178",
67
+ width=0.75];
68
+ }
69
+ x [_draw_="c 9 -#00ff005f C 9 -#00ff005f E 0 178 27 18 ",
70
+ _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 0 173.8 0 7 1 -x ",
71
+ height=0.5,
72
+ pos="0,178",
73
+ width=0.75];
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,4 @@
1
+ digraph G { node[style=filled fillcolor="#00ff005f" color="#00ff005f"]
2
+ subgraph {e->f subgraph cluster_ss81 {a->b->c}};
3
+ subgraph { subgraph { subgraph { subgraph cluster_x { x; subgraph cluster_y {y }}}}}
4
+ }
@@ -58,6 +58,11 @@ for c in abom-shift abom-shift-parity abom-shift-pack; do
58
58
  done
59
59
  # tests/2368.dot: its third layout merges an edge flagged adjacent into a new reversed flat edge.
60
60
  run flat-rev-stale dot plain nofree flat-rev-stale.dot.plain.nofree
61
+ # Part 11 T8: tests/graphs/nestedclust.gv. Layout 3 continues decompose's Cmark past layout 2's ND_mark, and
62
+ # dot_splines_ routes only the edges in the rank arrays.
63
+ for f in dot xdot; do
64
+ run nestedclust dot "$f" nofree "nestedclust.dot.$f.nofree"
65
+ done
61
66
  for e in neato fdp circo; do
62
67
  run filing dot plain "then:$e" "filing.dot.plain.then-$e"
63
68
  rm -f "filing.dot.plain.then-$e.1"