@knowvah/dot-engine 2.12.0 → 2.12.2
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/dist/api/builder.d.ts +7 -1
- package/dist/api/builder.d.ts.map +1 -1
- package/dist/api.js +14 -7
- package/dist/api.js.map +2 -2
- package/dist/common/edge-in-box.d.ts +6 -20
- package/dist/common/edge-in-box.d.ts.map +1 -1
- package/dist/common/edge-label-init.d.ts +26 -1
- package/dist/common/edge-label-init.d.ts.map +1 -1
- package/dist/common/emit-bb.d.ts +36 -0
- package/dist/common/emit-bb.d.ts.map +1 -0
- package/dist/common/nodeinit.d.ts +16 -2
- package/dist/common/nodeinit.d.ts.map +1 -1
- package/dist/common/splines-path-begin.d.ts.map +1 -1
- package/dist/common/splines-path-end.d.ts.map +1 -1
- package/dist/gvc/__fixtures__/subg-renders/subg-renders.d.ts +10 -0
- package/dist/gvc/__fixtures__/subg-renders/subg-renders.d.ts.map +1 -0
- package/dist/gvc/context.d.ts +8 -0
- package/dist/gvc/context.d.ts.map +1 -1
- package/dist/gvc/device.d.ts.map +1 -1
- package/dist/gvc/emit-gates.d.ts +5 -10
- package/dist/gvc/emit-gates.d.ts.map +1 -1
- package/dist/gvc/emit-xdot.d.ts +10 -0
- package/dist/gvc/emit-xdot.d.ts.map +1 -1
- package/dist/gvc/job.d.ts +5 -2
- package/dist/gvc/job.d.ts.map +1 -1
- package/dist/gvc/viewport.d.ts +10 -5
- package/dist/gvc/viewport.d.ts.map +1 -1
- package/dist/index.js +7617 -7334
- package/dist/index.js.map +4 -4
- package/dist/layout/dot/decomp.d.ts.map +1 -1
- package/dist/layout/dot/edge-route.d.ts +10 -11
- package/dist/layout/dot/edge-route.d.ts.map +1 -1
- package/dist/layout/dot/fastgr.d.ts +5 -3
- package/dist/layout/dot/fastgr.d.ts.map +1 -1
- package/dist/layout/dot/flat-adj-record.d.ts +22 -0
- package/dist/layout/dot/flat-adj-record.d.ts.map +1 -0
- package/dist/layout/dot/init.d.ts +65 -4
- package/dist/layout/dot/init.d.ts.map +1 -1
- package/dist/layout/dot/mincross-build.d.ts +6 -0
- package/dist/layout/dot/mincross-build.d.ts.map +1 -1
- package/dist/layout/dot/position-aux.d.ts +7 -1
- package/dist/layout/dot/position-aux.d.ts.map +1 -1
- package/dist/layout/dot/splines-clone.d.ts +2 -1
- package/dist/layout/dot/splines-clone.d.ts.map +1 -1
- package/dist/layout/dot/splines-flat-labeled.d.ts.map +1 -1
- package/dist/layout/dot/splines-flat.d.ts +18 -0
- package/dist/layout/dot/splines-flat.d.ts.map +1 -1
- package/dist/layout/dot/splines-groups.d.ts.map +1 -1
- package/dist/layout/dot/splines.d.ts +5 -3
- package/dist/layout/dot/splines.d.ts.map +1 -1
- package/dist/layout/fdp/ports.d.ts.map +1 -1
- package/dist/layout/neato/conjgrad-mkernel.d.ts.map +1 -1
- package/dist/layout/neato/fdp-adjust.d.ts.map +1 -1
- package/dist/layout/neato/sgd.d.ts.map +1 -1
- package/dist/layout/sfdp/spring-electrical.d.ts.map +1 -1
- package/dist/model/cgraph-ops.d.ts +10 -2
- package/dist/model/cgraph-ops.d.ts.map +1 -1
- package/dist/model/edge.d.ts +7 -2
- package/dist/model/edge.d.ts.map +1 -1
- package/dist/model/edgeInfo.d.ts +17 -2
- package/dist/model/edgeInfo.d.ts.map +1 -1
- package/dist/model/graph.d.ts +4 -3
- package/dist/model/graph.d.ts.map +1 -1
- package/dist/model/lazy-attrs.d.ts.map +1 -1
- package/dist/parser/builder.d.ts.map +1 -1
- package/dist/render/dot/agwrite-linelength.d.ts +25 -0
- package/dist/render/dot/agwrite-linelength.d.ts.map +1 -0
- package/dist/render/dot/agwrite.d.ts +9 -8
- package/dist/render/dot/agwrite.d.ts.map +1 -1
- package/dist/render/dot/attrs.d.ts +15 -4
- package/dist/render/dot/attrs.d.ts.map +1 -1
- package/dist/render/dot/write-back.d.ts +24 -0
- package/dist/render/dot/write-back.d.ts.map +1 -1
- package/dist/render/dot/xdot-ops.d.ts +20 -29
- package/dist/render/dot/xdot-ops.d.ts.map +1 -1
- package/dist/render/dot.d.ts +5 -4
- package/dist/render/dot.d.ts.map +1 -1
- package/dist/render/json-cluster-edge.d.ts +35 -0
- package/dist/render/json-cluster-edge.d.ts.map +1 -0
- package/dist/render/json-nonfinite.d.ts +17 -0
- package/dist/render/json-nonfinite.d.ts.map +1 -0
- package/dist/render/json.d.ts +4 -0
- package/dist/render/json.d.ts.map +1 -1
- package/dist/render/map.d.ts +3 -0
- package/dist/render/map.d.ts.map +1 -1
- package/dist/render/svg-graph.d.ts.map +1 -1
- package/dist/render/svg-id.d.ts +10 -1
- package/dist/render/svg-id.d.ts.map +1 -1
- package/dist/render/svg.d.ts +3 -1
- package/dist/render/svg.d.ts.map +1 -1
- package/dist/render.js +7657 -7374
- package/dist/render.js.map +4 -4
- package/dist/util/bsd-qsort.d.ts.map +1 -1
- package/dist/util/printf-round.d.ts.map +1 -1
- package/dist/xdot/parse.d.ts.map +1 -1
- package/dist/xdot/strtod.d.ts +23 -0
- package/dist/xdot/strtod.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/api/builder.ts +8 -2
- package/src/common/edge-in-box.ts +9 -24
- package/src/common/edge-label-init.ts +43 -17
- package/src/common/emit-bb.ts +128 -0
- package/src/common/nodeinit.ts +28 -8
- package/src/common/splines-path-begin.ts +4 -3
- package/src/common/splines-path-end.ts +4 -3
- package/src/gvc/__fixtures__/rerender/nestedclust.dot.dot.nofree.1 +45 -0
- package/src/gvc/__fixtures__/rerender/nestedclust.dot.dot.nofree.2 +45 -0
- package/src/gvc/__fixtures__/rerender/nestedclust.dot.dot.nofree.3 +45 -0
- package/src/gvc/__fixtures__/rerender/nestedclust.dot.xdot.nofree.1 +74 -0
- package/src/gvc/__fixtures__/rerender/nestedclust.dot.xdot.nofree.2 +74 -0
- package/src/gvc/__fixtures__/rerender/nestedclust.dot.xdot.nofree.3 +76 -0
- package/src/gvc/__fixtures__/rerender/nestedclust.gv +4 -0
- package/src/gvc/__fixtures__/rerender/regen.sh +5 -0
- package/src/gvc/__fixtures__/subg-renders/subg-renders.ts +48 -0
- package/src/gvc/context.ts +8 -0
- package/src/gvc/device.ts +28 -29
- package/src/gvc/emit-gates.ts +7 -16
- package/src/gvc/emit-xdot.ts +10 -12
- package/src/gvc/job.ts +5 -2
- package/src/gvc/viewport.ts +13 -7
- package/src/layout/dot/__fixtures__/flat-adj-aux-syms.native-16.1.json +1210 -0
- package/src/layout/dot/decomp.ts +23 -2
- package/src/layout/dot/edge-route.ts +52 -86
- package/src/layout/dot/fastgr.ts +9 -3
- package/src/layout/dot/flat-adj-record.ts +68 -0
- package/src/layout/dot/init.ts +84 -13
- package/src/layout/dot/mincross-build.ts +14 -1
- package/src/layout/dot/position-aux.ts +10 -3
- package/src/layout/dot/splines-clone.ts +8 -2
- package/src/layout/dot/splines-flat-labeled.ts +3 -2
- package/src/layout/dot/splines-flat.ts +11 -21
- package/src/layout/dot/splines-groups.ts +7 -5
- package/src/layout/dot/splines-route.ts +2 -2
- package/src/layout/dot/splines.ts +8 -8
- package/src/layout/fdp/ports.ts +6 -2
- package/src/layout/neato/conjgrad-mkernel.ts +6 -2
- package/src/layout/neato/conjgrad.ts +2 -2
- package/src/layout/neato/fdp-adjust.ts +1 -16
- package/src/layout/neato/sgd.ts +2 -1
- package/src/layout/sfdp/spring-electrical.ts +5 -3
- package/src/model/cgraph-ops.ts +4 -3
- package/src/model/edge.ts +11 -4
- package/src/model/edgeInfo.ts +18 -2
- package/src/model/graph.ts +4 -3
- package/src/model/lazy-attrs.ts +3 -1
- package/src/parser/builder.ts +12 -3
- package/src/render/dot/agwrite-linelength.ts +58 -0
- package/src/render/dot/agwrite.ts +23 -16
- package/src/render/dot/attrs.ts +45 -8
- package/src/render/dot/write-back.ts +48 -3
- package/src/render/dot/xdot-ops.ts +26 -57
- package/src/render/dot.ts +16 -20
- package/src/render/json-cluster-edge.ts +87 -0
- package/src/render/json-nonfinite.ts +51 -0
- package/src/render/json.ts +36 -42
- package/src/render/map.ts +6 -7
- package/src/render/svg-graph.ts +9 -8
- package/src/render/svg-id.ts +11 -2
- package/src/render/svg.ts +7 -4
- package/src/util/bsd-qsort.ts +2 -1
- package/src/util/printf-round.ts +16 -10
- package/src/xdot/parse.ts +9 -19
- package/src/xdot/strtod.ts +167 -0
- package/dist/layout/dot/edge-order.d.ts +0 -27
- package/dist/layout/dot/edge-order.d.ts.map +0 -1
- package/src/layout/dot/edge-order.ts +0 -62
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Edge routing order for dot, matching C `dot_splines_`.
|
|
3
|
-
*
|
|
4
|
-
* C routes edges from a list built rank-major (`GD_rank[i].v[j]` out-edges of
|
|
5
|
-
* NORMAL / splineMerge nodes) then `qsort`-ed by `edgecmp`. Because
|
|
6
|
-
* `recover_slack` re-centres shared virtual nodes that other edges read as
|
|
7
|
-
* `maximal_bbox` neighbours, corridor geometry is routing-order-dependent — so
|
|
8
|
-
* the port must route in C's order, not `g.nodes.values()` insertion order.
|
|
9
|
-
*
|
|
10
|
-
* The port iterates the ORIGINAL edges directly (real tails), so `edgecmp`'s
|
|
11
|
-
* `getmainedge` mapping is the identity here and the rank/coord keys read the
|
|
12
|
-
* original endpoints. `AGSEQ` (the port's `Edge.seq`) is unique, making the
|
|
13
|
-
* comparator a total order — a stable `Array.sort` over any collection order
|
|
14
|
-
* reproduces C's `qsort` result (edgecmp-equal originals never occur, and C
|
|
15
|
-
* batches genuinely-equivalent edges via the cnt-loop, so their relative
|
|
16
|
-
* routing order is immaterial).
|
|
17
|
-
*
|
|
18
|
-
* @see lib/dotgen/dotsplines.c:dot_splines_ (edges list build + sort)
|
|
19
|
-
* @see lib/dotgen/dotsplines.c:edgecmp
|
|
20
|
-
*/
|
|
21
|
-
import type { Edge } from '../../model/edge.js';
|
|
22
|
-
/**
|
|
23
|
-
* Compare two original edges in C `dot_splines_` routing order via their
|
|
24
|
-
* lexicographic `edgecmp` keys. @see lib/dotgen/dotsplines.c:edgecmp
|
|
25
|
-
*/
|
|
26
|
-
export declare function edgeRouteCmp(a: Edge, b: Edge): number;
|
|
27
|
-
//# sourceMappingURL=edge-order.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edge-order.d.ts","sourceRoot":"","sources":["../../../src/layout/dot/edge-order.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AA2BhD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAOrD"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: EPL-2.0
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Edge routing order for dot, matching C `dot_splines_`.
|
|
5
|
-
*
|
|
6
|
-
* C routes edges from a list built rank-major (`GD_rank[i].v[j]` out-edges of
|
|
7
|
-
* NORMAL / splineMerge nodes) then `qsort`-ed by `edgecmp`. Because
|
|
8
|
-
* `recover_slack` re-centres shared virtual nodes that other edges read as
|
|
9
|
-
* `maximal_bbox` neighbours, corridor geometry is routing-order-dependent — so
|
|
10
|
-
* the port must route in C's order, not `g.nodes.values()` insertion order.
|
|
11
|
-
*
|
|
12
|
-
* The port iterates the ORIGINAL edges directly (real tails), so `edgecmp`'s
|
|
13
|
-
* `getmainedge` mapping is the identity here and the rank/coord keys read the
|
|
14
|
-
* original endpoints. `AGSEQ` (the port's `Edge.seq`) is unique, making the
|
|
15
|
-
* comparator a total order — a stable `Array.sort` over any collection order
|
|
16
|
-
* reproduces C's `qsort` result (edgecmp-equal originals never occur, and C
|
|
17
|
-
* batches genuinely-equivalent edges via the cnt-loop, so their relative
|
|
18
|
-
* routing order is immaterial).
|
|
19
|
-
*
|
|
20
|
-
* @see lib/dotgen/dotsplines.c:dot_splines_ (edges list build + sort)
|
|
21
|
-
* @see lib/dotgen/dotsplines.c:edgecmp
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
import type { Edge } from '../../model/edge.js';
|
|
25
|
-
import { FLATEDGE, REGULAREDGE } from '../../common/splines-constants.js';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Edge-type key: same-rank ⇒ FLATEDGE, else REGULAREDGE — mirrors C `setflags`
|
|
29
|
-
* (regular out-edges REGULAREDGE, flat_out FLATEDGE).
|
|
30
|
-
* @see lib/dotgen/dotsplines.c:dot_splines_ (setflags REGULAREDGE/FLATEDGE)
|
|
31
|
-
*/
|
|
32
|
-
function edgeTypeKey(e: Edge): number {
|
|
33
|
-
return e.tail.info.rank === e.head.info.rank ? FLATEDGE : REGULAREDGE;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Lexicographic sort key for one edge, mirroring `edgecmp`. Each entry is
|
|
38
|
-
* compared ascending, so the edge-type term is negated (C orders type
|
|
39
|
-
* descending: FLATEDGE before REGULAREDGE). `AGSEQ` (`Edge.seq`) is unique, so
|
|
40
|
-
* the key tuple is a total order. @see lib/dotgen/dotsplines.c:edgecmp
|
|
41
|
-
*/
|
|
42
|
-
function edgeRouteKey(e: Edge): number[] {
|
|
43
|
-
return [
|
|
44
|
-
-edgeTypeKey(e),
|
|
45
|
-
Math.abs((e.tail.info.rank ?? 0) - (e.head.info.rank ?? 0)),
|
|
46
|
-
Math.abs((e.tail.info.coord?.x ?? 0) - (e.head.info.coord?.x ?? 0)),
|
|
47
|
-
e.seq,
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Compare two original edges in C `dot_splines_` routing order via their
|
|
53
|
-
* lexicographic `edgecmp` keys. @see lib/dotgen/dotsplines.c:edgecmp
|
|
54
|
-
*/
|
|
55
|
-
export function edgeRouteCmp(a: Edge, b: Edge): number {
|
|
56
|
-
const ka = edgeRouteKey(a);
|
|
57
|
-
const kb = edgeRouteKey(b);
|
|
58
|
-
for (let i = 0; i < ka.length; i++) {
|
|
59
|
-
if (ka[i] !== kb[i]) return ka[i] - kb[i];
|
|
60
|
-
}
|
|
61
|
-
return 0;
|
|
62
|
-
}
|