@knowvah/dot-engine 1.9.0 → 2.0.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/README.md +232 -30
- package/dist/api/builder.d.ts +3 -0
- package/dist/api/builder.d.ts.map +1 -1
- package/dist/api/edge-ops.d.ts +7 -0
- package/dist/api/edge-ops.d.ts.map +1 -1
- package/dist/api/geometry.d.ts +5 -2
- package/dist/api/geometry.d.ts.map +1 -1
- package/dist/api.js +159 -31
- package/dist/api.js.map +3 -3
- package/dist/async/collect.d.ts +49 -0
- package/dist/async/collect.d.ts.map +1 -0
- package/dist/async/fonts.d.ts +20 -0
- package/dist/async/fonts.d.ts.map +1 -0
- package/dist/async/render-async.d.ts +91 -0
- package/dist/async/render-async.d.ts.map +1 -0
- package/dist/async/render-into.d.ts +38 -0
- package/dist/async/render-into.d.ts.map +1 -0
- package/dist/async/sanitize.d.ts +28 -0
- package/dist/async/sanitize.d.ts.map +1 -0
- package/dist/common/htmltable-types.d.ts +3 -3
- package/dist/common/htmltable-types.d.ts.map +1 -1
- package/dist/common/make-label.d.ts.map +1 -1
- package/dist/common/poly-shapes.d.ts.map +1 -1
- package/dist/common/textmeasure-factory.d.ts +2 -0
- package/dist/common/textmeasure-factory.d.ts.map +1 -1
- package/dist/common/utils-inputscale.d.ts +19 -0
- package/dist/common/utils-inputscale.d.ts.map +1 -0
- package/dist/errors.d.ts +61 -5
- package/dist/errors.d.ts.map +1 -1
- package/dist/gvc/context.d.ts +36 -4
- package/dist/gvc/context.d.ts.map +1 -1
- package/dist/gvc/device.d.ts +5 -2
- package/dist/gvc/device.d.ts.map +1 -1
- package/dist/gvc/image-resolver.d.ts +16 -16
- package/dist/gvc/image-resolver.d.ts.map +1 -1
- package/dist/gvc/job.d.ts +1 -9
- package/dist/gvc/job.d.ts.map +1 -1
- package/dist/gvc/usershape.d.ts +2 -12
- package/dist/gvc/usershape.d.ts.map +1 -1
- package/dist/index.d.ts +27 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7560 -5446
- package/dist/index.js.map +4 -4
- package/dist/label/index.d.ts.map +1 -1
- package/dist/label/node.d.ts +0 -6
- package/dist/label/node.d.ts.map +1 -1
- package/dist/label/rectangle.d.ts +1 -7
- package/dist/label/rectangle.d.ts.map +1 -1
- package/dist/layout/circo/circular.d.ts +8 -5
- package/dist/layout/circo/circular.d.ts.map +1 -1
- package/dist/layout/dot/pack-components.d.ts +0 -19
- package/dist/layout/dot/pack-components.d.ts.map +1 -1
- package/dist/layout/dot/position.d.ts +7 -2
- package/dist/layout/dot/position.d.ts.map +1 -1
- package/dist/layout/fdp/derive.d.ts.map +1 -1
- package/dist/layout/fdp/index.d.ts.map +1 -1
- package/dist/layout/fdp/init.d.ts.map +1 -1
- package/dist/layout/fdp/layout.d.ts.map +1 -1
- package/dist/layout/fdp/ports.d.ts +0 -10
- package/dist/layout/fdp/ports.d.ts.map +1 -1
- package/dist/layout/fdp/xlayout.d.ts +0 -16
- package/dist/layout/fdp/xlayout.d.ts.map +1 -1
- package/dist/layout/neato/adjust-info.d.ts +117 -0
- package/dist/layout/neato/adjust-info.d.ts.map +1 -0
- package/dist/layout/neato/cdt-surface.d.ts.map +1 -1
- package/dist/layout/neato/constraint-adjust.d.ts +40 -0
- package/dist/layout/neato/constraint-adjust.d.ts.map +1 -0
- package/dist/layout/neato/edge-len.d.ts +20 -0
- package/dist/layout/neato/edge-len.d.ts.map +1 -0
- package/dist/layout/neato/fdp-adjust.d.ts +32 -4
- package/dist/layout/neato/fdp-adjust.d.ts.map +1 -1
- package/dist/layout/neato/index.d.ts +9 -6
- package/dist/layout/neato/index.d.ts.map +1 -1
- package/dist/layout/neato/init.d.ts +4 -11
- package/dist/layout/neato/init.d.ts.map +1 -1
- package/dist/layout/neato/kk-paths.d.ts +50 -0
- package/dist/layout/neato/kk-paths.d.ts.map +1 -0
- package/dist/layout/neato/kk-solve.d.ts +14 -0
- package/dist/layout/neato/kk-solve.d.ts.map +1 -0
- package/dist/layout/neato/kk.d.ts +44 -0
- package/dist/layout/neato/kk.d.ts.map +1 -0
- package/dist/layout/neato/multispline-router.d.ts.map +1 -1
- package/dist/layout/neato/poly.d.ts +50 -0
- package/dist/layout/neato/poly.d.ts.map +1 -0
- package/dist/layout/neato/sgd-dijkstra.d.ts +20 -0
- package/dist/layout/neato/sgd-dijkstra.d.ts.map +1 -0
- package/dist/layout/neato/sgd.d.ts +14 -9
- package/dist/layout/neato/sgd.d.ts.map +1 -1
- package/dist/layout/neato/start.d.ts +51 -0
- package/dist/layout/neato/start.d.ts.map +1 -0
- package/dist/layout/neato/vpsc-adjust.d.ts +21 -0
- package/dist/layout/neato/vpsc-adjust.d.ts.map +1 -0
- package/dist/layout/sfdp/index.d.ts.map +1 -1
- package/dist/layout/sfdp/init.d.ts +0 -9
- package/dist/layout/sfdp/init.d.ts.map +1 -1
- package/dist/layout/sfdp/spring-driver.d.ts.map +1 -1
- package/dist/layout/twopi/circle.d.ts +0 -7
- package/dist/layout/twopi/circle.d.ts.map +1 -1
- package/dist/ortho/ortho-parallel.d.ts.map +1 -1
- package/dist/ortho/trap-query.d.ts.map +1 -1
- package/dist/parser/index.d.ts +9 -5
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/render/index.d.ts +2 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/public.d.ts +9 -3
- package/dist/render/public.d.ts.map +1 -1
- package/dist/render/xdot-public.d.ts +7 -2
- package/dist/render/xdot-public.d.ts.map +1 -1
- package/dist/render.js +7355 -5476
- package/dist/render.js.map +4 -4
- package/dist/util/xml.d.ts.map +1 -1
- package/dist/vpsc/Solver.d.ts +1 -0
- package/dist/vpsc/Solver.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/builder.ts +73 -5
- package/src/api/edge-ops.ts +19 -0
- package/src/api/geometry.ts +22 -5
- package/src/async/collect.ts +204 -0
- package/src/async/fonts.ts +61 -0
- package/src/async/render-async.ts +205 -0
- package/src/async/render-into.ts +115 -0
- package/src/async/sanitize.ts +150 -0
- package/src/common/htmltable-types.ts +4 -5
- package/src/common/make-label.ts +10 -1
- package/src/common/poly-shapes.ts +4 -1
- package/src/common/textmeasure-factory.ts +11 -0
- package/src/common/utils-inputscale.ts +31 -0
- package/src/errors.ts +188 -5
- package/src/gvc/context.ts +96 -17
- package/src/gvc/device.ts +11 -6
- package/src/gvc/image-resolver.ts +25 -2
- package/src/gvc/job.ts +3 -1
- package/src/gvc/usershape.ts +6 -0
- package/src/index.ts +59 -43
- package/src/label/index.ts +6 -2
- package/src/label/node.ts +2 -1
- package/src/label/rectangle.ts +4 -2
- package/src/layout/circo/circular.ts +9 -6
- package/src/layout/dot/pack-components.ts +6 -2
- package/src/layout/dot/position.ts +21 -3
- package/src/layout/fdp/derive.ts +7 -6
- package/src/layout/fdp/index.ts +45 -5
- package/src/layout/fdp/init.ts +7 -6
- package/src/layout/fdp/layout.ts +2 -1
- package/src/layout/fdp/ports.ts +3 -2
- package/src/layout/fdp/xlayout.ts +3 -1
- package/src/layout/neato/adjust-info.ts +332 -0
- package/src/layout/neato/cdt-surface.ts +50 -30
- package/src/layout/neato/constraint-adjust.ts +466 -0
- package/src/layout/neato/edge-len.ts +36 -0
- package/src/layout/neato/fdp-adjust.ts +117 -12
- package/src/layout/neato/index.ts +36 -54
- package/src/layout/neato/init.ts +21 -36
- package/src/layout/neato/kk-paths.ts +146 -0
- package/src/layout/neato/kk-solve.ts +64 -0
- package/src/layout/neato/kk.ts +322 -0
- package/src/layout/neato/multispline-router.ts +4 -3
- package/src/layout/neato/poly.ts +493 -0
- package/src/layout/neato/sgd-dijkstra.ts +125 -0
- package/src/layout/neato/sgd.ts +63 -40
- package/src/layout/neato/start.ts +222 -0
- package/src/layout/neato/vpsc-adjust.ts +93 -0
- package/src/layout/sfdp/index.ts +4 -5
- package/src/layout/sfdp/init.ts +40 -4
- package/src/layout/sfdp/spring-driver.ts +30 -1
- package/src/layout/twopi/circle.ts +2 -1
- package/src/ortho/ortho-parallel.ts +2 -1
- package/src/ortho/trap-query.ts +2 -1
- package/src/parser/index.ts +11 -11
- package/src/render/index.ts +5 -0
- package/src/render/public.ts +24 -24
- package/src/render/svg.ts +1 -1
- package/src/render/xdot-public.ts +19 -18
- package/src/util/xml.ts +24 -30
- package/src/vpsc/Solver.ts +5 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kamada-Kawai ideal-distance setup: Dijkstra over edge lengths with C's
|
|
3
|
+
* binary heap (`neato_enqueue`/`neato_dequeue`, `shortest_path`, `s1`,
|
|
4
|
+
* `make_spring`) and `mds_model`.
|
|
5
|
+
*
|
|
6
|
+
* The C keeps the heap, its size and the source node in file-statics and the
|
|
7
|
+
* per-node `ND_dist`/`ND_hops`/`ND_heapindex` in node records; here they live
|
|
8
|
+
* in one {@link PathState} per run (no module state), indexed by `ND_id`.
|
|
9
|
+
*
|
|
10
|
+
* @see lib/neatogen/stuff.c
|
|
11
|
+
*/
|
|
12
|
+
/** One neighbour of a node: its id and the edge's `ED_dist`. */
|
|
13
|
+
export interface Neighbour {
|
|
14
|
+
readonly id: number;
|
|
15
|
+
readonly len: number;
|
|
16
|
+
}
|
|
17
|
+
/** Heap + per-node Dijkstra state. @see lib/neatogen/stuff.c (Heap, Heapsize) */
|
|
18
|
+
export interface PathState {
|
|
19
|
+
readonly n: number;
|
|
20
|
+
/** `GD_dist` as a flat n*n matrix. */
|
|
21
|
+
readonly dist: Float64Array;
|
|
22
|
+
/** `agfstedge` neighbours of each node, in C's iteration order. */
|
|
23
|
+
readonly adj: readonly (readonly Neighbour[])[];
|
|
24
|
+
/** `Initial_dist`. */
|
|
25
|
+
readonly initialDist: number;
|
|
26
|
+
readonly heap: Int32Array;
|
|
27
|
+
heapSize: number;
|
|
28
|
+
/** `ND_heapindex` (-1 = not queued). */
|
|
29
|
+
readonly heapIndex: Int32Array;
|
|
30
|
+
/** `ND_dist`. */
|
|
31
|
+
readonly nd: Float64Array;
|
|
32
|
+
/** `ND_hops`. */
|
|
33
|
+
readonly hops: Int32Array;
|
|
34
|
+
}
|
|
35
|
+
/** Fresh path state for `n` nodes. @see lib/neatogen/stuff.c:shortest_path */
|
|
36
|
+
export declare function newPathState(n: number, dist: Float64Array, adj: readonly (readonly Neighbour[])[], initialDist: number): PathState;
|
|
37
|
+
/** All-pairs shortest paths into `GD_dist`. @see lib/neatogen/stuff.c:shortest_path */
|
|
38
|
+
export declare function shortestPath(s: PathState): void;
|
|
39
|
+
/**
|
|
40
|
+
* Overwrite `GD_dist` with edge lengths. C indexes the matrix with `AGSEQ`
|
|
41
|
+
* (1-based), so the last node's row falls outside the n*n allocation (heap
|
|
42
|
+
* overflow in C); out-of-range writes are dropped here.
|
|
43
|
+
* @see lib/neatogen/neatoinit.c:mds_model
|
|
44
|
+
*/
|
|
45
|
+
export declare function mdsModel(dist: Float64Array, n: number, edges: readonly {
|
|
46
|
+
tailSeq: number;
|
|
47
|
+
headSeq: number;
|
|
48
|
+
len: number;
|
|
49
|
+
}[]): void;
|
|
50
|
+
//# sourceMappingURL=kk-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kk-paths.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/kk-paths.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AAEH,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,SAAS,SAAS,EAAE,CAAC,EAAE,CAAC;IAChD,sBAAsB;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,iBAAiB;IACjB,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC;IAC1B,iBAAiB;IACjB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAC1B,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,CAAC,SAAS,SAAS,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,GACzF,SAAS,CAOX;AA+ED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GACjG,IAAI,CAKN"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gaussian elimination with partial pivoting for the small Newton systems of
|
|
3
|
+
* Kamada-Kawai (`move_node`).
|
|
4
|
+
*
|
|
5
|
+
* @see lib/neatogen/solve.c
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Solve a*b = c (a is n*n row-major). On success `a` and `c` are restored and
|
|
9
|
+
* `b` holds the solution; when ill-conditioned `b` is untouched. C prints
|
|
10
|
+
* "ill-conditioned" to stdout; a library has no stdout, so it is a warning.
|
|
11
|
+
* @see lib/neatogen/solve.c:solve
|
|
12
|
+
*/
|
|
13
|
+
export declare function solve(a: Float64Array, b: Float64Array, c: Float64Array, n: number): void;
|
|
14
|
+
//# sourceMappingURL=kk-solve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kk-solve.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/kk-solve.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAiCH;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAkBxF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kamada-Kawai layout (`mode=KK`): the gradient-descent solver of
|
|
3
|
+
* `kkNeato` and the `stuff.c` code it drives — `scan_graph_mode` (KK
|
|
4
|
+
* branch), `initial_positions`, `diffeq_model`, `solve_model`,
|
|
5
|
+
* `choose_node`, `move_node`, `update_arrays`, `D2E` and `solve`.
|
|
6
|
+
*
|
|
7
|
+
* C's `GD_dist`/`GD_spring`/`GD_sum_t`/`GD_t` (arrays of row pointers) are flat
|
|
8
|
+
* typed arrays here; the file-statics (`Epsilon`, `Damping`, `MaxIter`,
|
|
9
|
+
* `Initial_dist`) are fields of one {@link KkState} per run.
|
|
10
|
+
*
|
|
11
|
+
* Not ported: `Verbose` output (`total_e`, timers), `test_toggle` tracing,
|
|
12
|
+
* and `Reduce` (`-x`, a command-line flag this library has no counterpart for).
|
|
13
|
+
*
|
|
14
|
+
* @see lib/neatogen/neatoinit.c:kkNeato
|
|
15
|
+
* @see lib/neatogen/stuff.c
|
|
16
|
+
*/
|
|
17
|
+
import type { Graph } from '../../model/graph.js';
|
|
18
|
+
import type { Node } from '../../model/node.js';
|
|
19
|
+
/** Per-run solver state. @see lib/neatogen/stuff.c (GD_*, Epsilon2, Damping) */
|
|
20
|
+
export interface KkState {
|
|
21
|
+
readonly n: number;
|
|
22
|
+
readonly nodes: readonly Node[];
|
|
23
|
+
/** `GD_dist`, n*n. */
|
|
24
|
+
readonly dist: Float64Array;
|
|
25
|
+
/** `GD_spring`, n*n. */
|
|
26
|
+
readonly spring: Float64Array;
|
|
27
|
+
/** `GD_sum_t`, n*NDIM. */
|
|
28
|
+
readonly sumT: Float64Array;
|
|
29
|
+
/** `GD_t`, n*n*NDIM. */
|
|
30
|
+
readonly t: Float64Array;
|
|
31
|
+
readonly damping: number;
|
|
32
|
+
readonly epsilon: number;
|
|
33
|
+
readonly maxIter: number;
|
|
34
|
+
/** `GD_move`. */
|
|
35
|
+
move: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Solve the layout with Kamada-Kawai gradient descent. The subset and (connected)
|
|
39
|
+
* circuit distance models stay loud in `start.ts:assertSupported`; a
|
|
40
|
+
* disconnected circuit falls back to shortest paths there too.
|
|
41
|
+
* @see lib/neatogen/neatoinit.c:kkNeato
|
|
42
|
+
*/
|
|
43
|
+
export declare function kkNeato(g: Graph, nG: number, model: number): void;
|
|
44
|
+
//# sourceMappingURL=kk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kk.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/kk.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAsBhD,gFAAgF;AAChF,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IAChC,sBAAsB;IACtB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,wBAAwB;IACxB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,wBAAwB;IACxB,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAuPD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAUjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multispline-router.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/multispline-router.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"multispline-router.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/multispline-router.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAK3D,2CAA2C;AAC3C,MAAM,WAAW,KAAK;IAAG,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE;AAE/C,+BAA+B;AAC/B,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,EAAE,KAAK,CAAC;CACZ;AAED,+BAA+B;AAC/B,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,KAAK,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gCAAgC;AAChC,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,KAAK,EAAE,KAAK,EAAE,CAAC;CAChB;AAED,kCAAkC;AAClC,MAAM,W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AAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CA8BrF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node polygons for neato's overlap counting (`countOverlap` -> `polyOverlap`).
|
|
3
|
+
* A faithful port of lib/neatogen/poly.c. Units are inches, as in C.
|
|
4
|
+
*
|
|
5
|
+
* C's `makePoly` / `makeAddPoly` fill a caller-owned `Poly` and return a
|
|
6
|
+
* non-zero status on failure; here they return the `Poly`, or `null` where C
|
|
7
|
+
* returns 1. `breakPoly` only frees `verts` (garbage collected here), so it
|
|
8
|
+
* is not ported. The C functions are split only where the repo's complexity
|
|
9
|
+
* limits force it (per-shape vertex builders, `edgesIntersect` advance rule,
|
|
10
|
+
* `inPoly` per-edge crossing); evaluation order is unchanged.
|
|
11
|
+
*
|
|
12
|
+
* @see lib/neatogen/poly.c
|
|
13
|
+
* @see lib/neatogen/poly.h
|
|
14
|
+
*/
|
|
15
|
+
import type { Node } from '../../model/node.js';
|
|
16
|
+
import type { Point } from '../../model/geom.js';
|
|
17
|
+
/** @see lib/neatogen/poly.c:BOX */
|
|
18
|
+
export declare const POLY_BOX = 1;
|
|
19
|
+
/** @see lib/neatogen/poly.c:CIRCLE */
|
|
20
|
+
export declare const POLY_CIRCLE = 2;
|
|
21
|
+
/**
|
|
22
|
+
* Polygon of a node, relative to the node centre. `nverts` is `verts.length`.
|
|
23
|
+
* @see lib/neatogen/poly.h:Poly
|
|
24
|
+
*/
|
|
25
|
+
export interface Poly {
|
|
26
|
+
origin: Point;
|
|
27
|
+
corner: Point;
|
|
28
|
+
verts: Point[];
|
|
29
|
+
kind: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Polygon of node `n` with an additive margin (inches) on each side.
|
|
33
|
+
* Returns null (C returns 1) for an unsupported shape type.
|
|
34
|
+
* @see lib/neatogen/poly.c:makeAddPoly
|
|
35
|
+
*/
|
|
36
|
+
export declare function makeAddPoly(n: Node, xmargin: number, ymargin: number): Poly | null;
|
|
37
|
+
/**
|
|
38
|
+
* Polygon of node `n` scaled by (xmargin, ymargin) about the node centre.
|
|
39
|
+
* Returns null (C returns 1) for an unsupported shape type.
|
|
40
|
+
* @see lib/neatogen/poly.c:makePoly
|
|
41
|
+
*/
|
|
42
|
+
export declare function makePoly(n: Node, xmargin: number, ymargin: number): Poly | null;
|
|
43
|
+
/**
|
|
44
|
+
* True when polygon `pp` placed at `p` overlaps `qp` placed at `q`.
|
|
45
|
+
* Bounding boxes first, then the BOX/CIRCLE shortcuts, then the exact
|
|
46
|
+
* polygon test.
|
|
47
|
+
* @see lib/neatogen/poly.c:polyOverlap
|
|
48
|
+
*/
|
|
49
|
+
export declare function polyOverlap(p: Point, pp: Poly, q: Point, qp: Poly): boolean;
|
|
50
|
+
//# sourceMappingURL=poly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poly.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/poly.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAO,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAItD,mCAAmC;AACnC,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,sCAAsC;AACtC,eAAO,MAAM,WAAW,IAAI,CAAC;AAS7B;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,KAAK,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAsMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAiBlF;AAwCD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAO/E;AAkJD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,GAAG,OAAO,CAyB3E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-source shortest paths for the SGD engine, ported with C's indexed
|
|
3
|
+
* binary heap. The heap's tie-breaking order decides the order terms are
|
|
4
|
+
* emitted, and sgd's Fisher-Yates shuffle consumes that order, so the heap
|
|
5
|
+
* (including its 1-based left/right/parent arithmetic over a 0-based array)
|
|
6
|
+
* is reproduced exactly rather than replaced by a lazy-deletion heap.
|
|
7
|
+
*
|
|
8
|
+
* @see lib/neatogen/dijkstra.c
|
|
9
|
+
*/
|
|
10
|
+
import type { TermSgd } from './dijkstra.js';
|
|
11
|
+
import type { GraphSgd } from './sgd.js';
|
|
12
|
+
/**
|
|
13
|
+
* Single-source shortest paths that also builds terms as it goes. Writes
|
|
14
|
+
* terms for reachable pinned nodes and nodes below `source`; returns how many.
|
|
15
|
+
* `terms` is appended to from index 0 (the caller passes a fresh chunk).
|
|
16
|
+
*
|
|
17
|
+
* @see lib/neatogen/dijkstra.c:dijkstra_sgd
|
|
18
|
+
*/
|
|
19
|
+
export declare function dijkstraSgd(graph: GraphSgd, source: number, terms: TermSgd[]): number;
|
|
20
|
+
//# sourceMappingURL=sgd-dijkstra.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sgd-dijkstra.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/sgd-dijkstra.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAsFzC;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAmBrF"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @see lib/neatogen/sgd.h
|
|
7
7
|
*/
|
|
8
8
|
import type { Graph } from '../../model/graph.js';
|
|
9
|
+
import type { Node } from '../../model/node.js';
|
|
9
10
|
import type { TermSgd } from './dijkstra.js';
|
|
10
11
|
import type { RkState } from '../../util/mt19937.js';
|
|
11
12
|
/** Shortest-path distance model. @see lib/neatogen/defs.h */
|
|
@@ -42,11 +43,12 @@ export declare function assignNodeIds(g: Graph): {
|
|
|
42
43
|
nEdges: number;
|
|
43
44
|
};
|
|
44
45
|
/**
|
|
45
|
-
* Append CSR entries for all non-self-loop edges incident on node `np
|
|
46
|
+
* Append CSR entries for all non-self-loop edges incident on node `np`
|
|
47
|
+
* (out-edges first, then in-edges, as agfstedge/agnxtedge).
|
|
46
48
|
* Returns the number of edges appended.
|
|
47
49
|
* @internal
|
|
48
50
|
*/
|
|
49
|
-
export declare function fillNodeEdges(np:
|
|
51
|
+
export declare function fillNodeEdges(np: Node, g: Graph, graph: GraphSgd, edgeOffset: number): number;
|
|
50
52
|
/**
|
|
51
53
|
* Populate the CSR sources/targets/weights/pinneds arrays.
|
|
52
54
|
* @internal
|
|
@@ -95,22 +97,23 @@ export declare function sgdBuildTerms(graph: GraphSgd): TermSgd[];
|
|
|
95
97
|
*/
|
|
96
98
|
export declare function fisheryatesShuffle(terms: TermSgd[], state: RkState): void;
|
|
97
99
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
+
* Seed drand48 from `start` (checkStart) and give every node without a
|
|
101
|
+
* position a random one. start=regular keeps the regular placement that
|
|
102
|
+
* solveModel already made (checkStart's INIT_REGULAR early return).
|
|
100
103
|
*
|
|
101
104
|
* @see lib/neatogen/stuff.c:initial_positions
|
|
102
105
|
* @see lib/neatogen/stuff.c:randompos
|
|
103
106
|
*/
|
|
104
|
-
export declare function initialPositions(g: Graph,
|
|
107
|
+
export declare function initialPositions(g: Graph, nG?: number): void;
|
|
105
108
|
/**
|
|
106
109
|
* Compute the annealing schedule parameters from the term weights.
|
|
107
110
|
*
|
|
108
|
-
* eta_max = 1/w_min; eta_min =
|
|
111
|
+
* eta_max = 1/w_min; eta_min = Epsilon/w_max
|
|
109
112
|
* lambda = log(eta_max/eta_min) / (maxIter - 1)
|
|
110
113
|
*
|
|
111
114
|
* @see lib/neatogen/sgd.c:sgd (initialise annealing schedule)
|
|
112
115
|
*/
|
|
113
|
-
export declare function computeSchedule(terms: TermSgd[], maxIter: number): {
|
|
116
|
+
export declare function computeSchedule(terms: TermSgd[], maxIter: number, epsilon?: number): {
|
|
114
117
|
etaMax: number;
|
|
115
118
|
lambda: number;
|
|
116
119
|
};
|
|
@@ -145,10 +148,11 @@ export declare function buildUnfixed(g: Graph, n: number): boolean[];
|
|
|
145
148
|
* @see lib/neatogen/sgd.c:sgd (model fallback block)
|
|
146
149
|
*/
|
|
147
150
|
export declare function resolveModel(model: number): number;
|
|
148
|
-
/** Optimisation loop: shuffle and step for
|
|
151
|
+
/** Optimisation loop: shuffle and step for `sched.maxIter` iterations. @see lib/neatogen/sgd.c:sgd */
|
|
149
152
|
export declare function runSgdLoop(pos: Float64Array, terms: TermSgd[], unfixed: boolean[], sched: {
|
|
150
153
|
etaMax: number;
|
|
151
154
|
lambda: number;
|
|
155
|
+
maxIter: number;
|
|
152
156
|
}, state: RkState): void;
|
|
153
157
|
/**
|
|
154
158
|
* Run the SGD layout algorithm on graph `g`.
|
|
@@ -158,7 +162,8 @@ export declare function runSgdLoop(pos: Float64Array, terms: TermSgd[], unfixed:
|
|
|
158
162
|
*
|
|
159
163
|
* Node positions are written to `node.info.pos` ([x, y]).
|
|
160
164
|
* Nodes with `node.info.pinned === true` are not moved.
|
|
161
|
-
*
|
|
165
|
+
* The shuffle RNG is seeded with 0 as in C; `start` seeds only the initial
|
|
166
|
+
* positions (drand48, via checkStart).
|
|
162
167
|
*
|
|
163
168
|
* @see lib/neatogen/sgd.c:sgd
|
|
164
169
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgd.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/sgd.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"sgd.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/sgd.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AASrD,6DAA6D;AAC7D,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,yEAAyE;AACzE,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,gEAAgE;AAChE,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,0DAA0D;AAC1D,eAAO,MAAM,SAAS,IAAI,CAAC;AAgB3B;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,oCAAoC;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;IACtB,sCAAsC;IACtC,OAAO,EAAE,OAAO,EAAE,CAAC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kStart) and the
|
|
3
|
+
* fail-loud checks for the neato init features this port does not have
|
|
4
|
+
* (smart init, the subset/circuit distance models, hier/ipsep modes).
|
|
5
|
+
*
|
|
6
|
+
* Each loud check sits where neato's C branches into the unported code and
|
|
7
|
+
* fires only for the modes whose C path reaches it (ADR-3).
|
|
8
|
+
*
|
|
9
|
+
* @see lib/neatogen/neatoinit.c
|
|
10
|
+
*/
|
|
11
|
+
import type { Graph } from '../../model/graph.js';
|
|
12
|
+
/** @see lib/neatogen/neato.h:INIT_SELF */
|
|
13
|
+
export declare const INIT_SELF = 0;
|
|
14
|
+
/** @see lib/neatogen/neato.h:INIT_REGULAR */
|
|
15
|
+
export declare const INIT_REGULAR = 1;
|
|
16
|
+
/** @see lib/neatogen/neato.h:INIT_RANDOM */
|
|
17
|
+
export declare const INIT_RANDOM = 2;
|
|
18
|
+
/**
|
|
19
|
+
* Classify the `start` attribute: keyword prefix, digit-led (random), else the
|
|
20
|
+
* default. A random seed comes from the digits following the keyword; with
|
|
21
|
+
* none, C seeds from time(), which this port keeps at the default seed 1.
|
|
22
|
+
* @see lib/neatogen/neatoinit.c:setSeed
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseStart(p: string | undefined, dflt: number): {
|
|
25
|
+
init: number;
|
|
26
|
+
seed: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Place the nodes on a regular polygon and mark them P_SET (positioned, not
|
|
30
|
+
* pinned), so the stress kernel's initLayout starts from them.
|
|
31
|
+
* @see lib/neatogen/neatoinit.c:initRegular
|
|
32
|
+
*/
|
|
33
|
+
export declare function initRegular(g: Graph, nG: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Analyse `start`: place regular nodes, seed the RNG, return the init kind.
|
|
36
|
+
* @see lib/neatogen/neatoinit.c:checkStart
|
|
37
|
+
*/
|
|
38
|
+
export declare function checkStart(g: Graph, nG?: number, dflt?: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* Read the root `mode` attribute: empty/absent is MODE_MAJOR, an unknown value
|
|
41
|
+
* warns with C's text and is ignored. Case sensitive, as C's streq.
|
|
42
|
+
* @see lib/neatogen/neatoinit.c:neatoMode
|
|
43
|
+
*/
|
|
44
|
+
export declare function neatoMode(g: Graph): number;
|
|
45
|
+
/**
|
|
46
|
+
* Throw UNSUPPORTED_FEATURE where neato's C would run unported init code for
|
|
47
|
+
* this mode/model/start. Call after the nG < 2 guard.
|
|
48
|
+
* @see lib/neatogen/neatoinit.c:neatoLayout
|
|
49
|
+
*/
|
|
50
|
+
export declare function assertSupported(g: Graph, mode: number, model: number): void;
|
|
51
|
+
//# sourceMappingURL=start.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/start.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AASlD,0CAA0C;AAC1C,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,6CAA6C;AAC7C,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,4CAA4C;AAC5C,eAAO,MAAM,WAAW,IAAI,CAAC;AAwB7B;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAYhC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAStD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,KAAK,EAAE,EAAE,GAAE,MAAqB,EAAE,IAAI,GAAE,MAAoB,GAC9D,MAAM,CAQR;AA8BD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAO1C;AAkED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAK3E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `overlap=vpsc`: the VPSC adjuster of removeOverlapWith, moved out of
|
|
3
|
+
* neato/index.ts so every engine reaches it through the shared dispatch.
|
|
4
|
+
*
|
|
5
|
+
* C works on `float` coordinates (`float *coords[2]`), so positions are rounded
|
|
6
|
+
* to float on entry and after each pass: that decides exact-touch verdicts
|
|
7
|
+
* between the x and y passes.
|
|
8
|
+
*
|
|
9
|
+
* @see lib/neatogen/adjust.c:vpscAdjust
|
|
10
|
+
* @see lib/neatogen/quad_prog_vpsc.c:removeoverlaps
|
|
11
|
+
*/
|
|
12
|
+
import type { Graph } from '../../model/graph.js';
|
|
13
|
+
/**
|
|
14
|
+
* Remove overlaps with two VPSC passes (x then y). The gap handed to
|
|
15
|
+
* removeoverlaps is twice the separation margin (opt.gap is the gap size, not
|
|
16
|
+
* the margin): `2 * sep` when `sep` is additive, else twice DFLT_MARGIN.
|
|
17
|
+
* Returns 0 as C does.
|
|
18
|
+
* @see lib/neatogen/adjust.c:vpscAdjust
|
|
19
|
+
*/
|
|
20
|
+
export declare function vpscAdjust(g: Graph): number;
|
|
21
|
+
//# sourceMappingURL=vpsc-adjust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpsc-adjust.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/vpsc-adjust.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAmDlD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAoB3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/sfdp/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/sfdp/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAqBzD,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,EACR,MAAM,EACP,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACjF,OAAO,EAAE,mCAAmC,EAAE,CAAC;AAK/C;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GACrE,IAAI,CAYN;AA+GD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CA4BzC;AAED,gDAAgD;AAChD,eAAO,MAAM,kBAAkB,EAAE,YAIhC,CAAC"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* sfdp graph/node initialization and the adjust.c matrix/size helpers
|
|
3
|
-
* the sfdp pipeline feeds to the embedding.
|
|
4
|
-
*
|
|
5
|
-
* Spec read at the 15.0.0 tag.
|
|
6
|
-
*
|
|
7
|
-
* @see lib/sfdpgen/sfdpinit.c (15.0.0)
|
|
8
|
-
* @see lib/neatogen/adjust.c:makeMatrix / getSizes (15.0.0)
|
|
9
|
-
*/
|
|
10
1
|
import type { Graph } from '../../model/graph.js';
|
|
11
2
|
import { type SpMatrix } from './sparse-matrix.js';
|
|
12
3
|
import { type SpringElectricalControl } from './spring-electrical.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/layout/sfdp/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/layout/sfdp/init.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAUlD,OAAO,EACL,KAAK,QAAQ,EAGd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,uBAAuB,EAK7B,MAAM,wBAAwB,CAAC;AAEhC,8EAA8E;AAC9E,eAAO,MAAM,cAAc,IAAI,CAAC;AAShC;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAoB5C;AAqDD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAiCzE;AA4BD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,QAAQ,CAmB7C;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAQ1E;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAetD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAK1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spring-driver.d.ts","sourceRoot":"","sources":["../../../src/layout/sfdp/spring-driver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spring-driver.d.ts","sourceRoot":"","sources":["../../../src/layout/sfdp/spring-driver.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,KAAK,QAAQ,EAMd,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EACL,KAAK,uBAAuB,EAK7B,MAAM,wBAAwB,CAAC;AAiChC,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,GAAG,OAAO,CAclD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAiCnE;AAqDD;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CACjD,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,uBAAuB,EACxD,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,GACvC,IAAI,CAmDN"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Seven-phase radial layout algorithm for the twopi engine.
|
|
3
|
-
* Ports lib/twopigen/circle.c.
|
|
4
|
-
*
|
|
5
|
-
* @see lib/twopigen/circle.c
|
|
6
|
-
* @see lib/twopigen/circle.h
|
|
7
|
-
*/
|
|
8
1
|
import type { Graph } from '../../model/graph.js';
|
|
9
2
|
import type { Node } from '../../model/node.js';
|
|
10
3
|
/** Minimum per-ring delta. @see lib/common/render.h:MIN_RANKSEP */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../src/layout/twopi/circle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../src/layout/twopi/circle.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAQhD,mEAAmE;AACnE,eAAO,MAAM,WAAW,OAAO,CAAC;AA6BhC;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CASjD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAczC;AAWD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAM1E;AAaD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,CAWpD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAYzD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,MAAM,CAa9D;AAWD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAO7C;AAcD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAQ5D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,CAG7D;AAeD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAO1D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,CAG1D;AAyBD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAU/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAS9D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAiBxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ortho-parallel.d.ts","sourceRoot":"","sources":["../../src/ortho/ortho-parallel.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAyB,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ortho-parallel.d.ts","sourceRoot":"","sources":["../../src/ortho/ortho-parallel.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAyB,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AA6NxE,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,GAAG,MAAM,CAQ9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trap-query.d.ts","sourceRoot":"","sources":["../../src/ortho/trap-query.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,EAG0B,WAAW,EACnC,QAAQ,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"trap-query.d.ts","sourceRoot":"","sources":["../../src/ortho/trap-query.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,EAG0B,WAAW,EACnC,QAAQ,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAGxE;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,QAAQ,EAAE,EACf,CAAC,EAAE,QAAQ,GACV,OAAO,CAaT;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,QAAQ,EAAE,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAGT;AAyBD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,CAAC,EAAE,QAAQ,EACX,EAAE,EAAE,QAAQ,EACZ,CAAC,EAAE,MAAM,EACT,GAAG,EAAE,QAAQ,EAAE,EACf,EAAE,EAAE,KAAK,EAAE,GACV,MAAM,CAeR;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,KAAK,EAAE,EACX,EAAE,EAAE,KAAK,EAAE,GACV,IAAI,CAgBN;AAyCD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/parser/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Graph } from '../model/graph.js';
|
|
2
2
|
import type { GraphKind } from '../model/graph.js';
|
|
3
3
|
import type { Edge } from '../model/edge.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { GvErrorCode, GvExpectation } from '../errors.js';
|
|
5
|
+
import { DotEngineError } from '../errors.js';
|
|
5
6
|
/**
|
|
6
7
|
* Thrown for syntax errors or edge-direction violations.
|
|
7
8
|
*
|
|
8
|
-
* Implements the structured {@link
|
|
9
|
+
* Implements the structured {@link DotEngineError} / `GvError` contract: `location` is primary;
|
|
9
10
|
* `line`/`column` are convenience getters that delegate to it.
|
|
10
11
|
*/
|
|
11
|
-
export declare class ParseError extends
|
|
12
|
+
export declare class ParseError extends DotEngineError {
|
|
12
13
|
readonly type = "syntax";
|
|
13
14
|
readonly code: GvErrorCode;
|
|
14
15
|
readonly friendlyMessage: string;
|
|
@@ -22,7 +23,7 @@ export declare class ParseError extends Error implements GvError {
|
|
|
22
23
|
line: number;
|
|
23
24
|
column: number;
|
|
24
25
|
offset?: number;
|
|
25
|
-
}, expected?: GvExpectation[]);
|
|
26
|
+
}, expected?: GvExpectation[], options?: ErrorOptions);
|
|
26
27
|
get line(): number;
|
|
27
28
|
get column(): number;
|
|
28
29
|
}
|
|
@@ -75,7 +76,10 @@ export declare function isPeggyError(err: unknown): err is {
|
|
|
75
76
|
};
|
|
76
77
|
/**
|
|
77
78
|
* Parse a DOT-language string and return a Graph model.
|
|
78
|
-
* @throws ParseError
|
|
79
|
+
* @throws ParseError `SYNTAX_ERROR`, `SYNTAX_UNEXPECTED_EOF`, `EDGE_OP_*` for
|
|
80
|
+
* syntax errors or edge-direction violations; `GENERIC_ERROR` when nesting
|
|
81
|
+
* is too deep
|
|
82
|
+
* @throws TypeError `ERR_INVALID_ARG_TYPE` if `src` is not a string
|
|
79
83
|
*/
|
|
80
84
|
export declare function parse(src: string): Graph;
|
|
81
85
|
export declare function dotKeyword(kind: GraphKind): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/parser/index.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AAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAKlD;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAO7D;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,CAQlD;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAGjE;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,CASjD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,CASjD;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,CAMrD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAQ1C"}
|
package/dist/render/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export { render } from './public.js';
|
|
20
20
|
export type { OutputFormat, RenderOptions } from './public.js';
|
|
21
|
+
export { renderAsync } from '../async/render-async.js';
|
|
22
|
+
export type { AsyncRenderOptions, AsyncRenderResult, AsyncImageSize, AsyncImageBytes, FontIssue, FontSetLike, } from '../async/render-async.js';
|
|
21
23
|
export { getDrawOps, DEFAULT_DRAW_ENGINE } from './xdot-public.js';
|
|
22
24
|
export type { DrawOpsOptions } from './xdot-public.js';
|
|
23
25
|
export type { Xdot, XdotOp, XdotColor } from './xdot-public.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EACV,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EACtE,SAAS,EAAE,WAAW,GACvB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACnE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/render/public.d.ts
CHANGED
|
@@ -41,8 +41,8 @@ export interface RenderOptions {
|
|
|
41
41
|
* Render a (parsed or built) graph to the requested format string.
|
|
42
42
|
*
|
|
43
43
|
* Lifecycle: createDefaultContext → layout → deviceRender → freeLayout.
|
|
44
|
-
* Error handling mirrors `renderSvg`:
|
|
45
|
-
* unchanged;
|
|
44
|
+
* Error handling mirrors `renderSvg`: usage errors and GvErrors re-surface
|
|
45
|
+
* unchanged; any other throw becomes an `InternalError` with `cause` set.
|
|
46
46
|
*
|
|
47
47
|
* @remarks
|
|
48
48
|
* Security: for the markup formats (`svg`, `cmapx`, `imap`), treat the output
|
|
@@ -56,7 +56,13 @@ export interface RenderOptions {
|
|
|
56
56
|
* @param format - target output format
|
|
57
57
|
* @param opts - optional engine override (default: `'dot'`)
|
|
58
58
|
* @returns rendered string in the requested format
|
|
59
|
-
* @throws
|
|
59
|
+
* @throws TypeError `ERR_INVALID_ARG_TYPE` if `g` is not an object, `format`
|
|
60
|
+
* is not a string, or `opts` is neither undefined nor an object
|
|
61
|
+
* @throws TypeError `ERR_INVALID_ARG_VALUE` if the engine or format is not
|
|
62
|
+
* registered
|
|
63
|
+
* @throws RenderError `RENDER_ERROR`, `UNKNOWN_LAYOUT` or `UNSUPPORTED_FEATURE`
|
|
64
|
+
* on layout or render failure
|
|
65
|
+
* @throws InternalError `INTERNAL_ERROR` on a dot-engine bug
|
|
60
66
|
*
|
|
61
67
|
* @see lib/gvc/gvc.c:gvRender
|
|
62
68
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/render/public.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/render/public.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMpD;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,OAAO,GACP,WAAW,GACX,MAAM,GACN,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CACpB,CAAC,EAAE,KAAK,EACR,MAAM,EAAE,YAAY,EACpB,IAAI,CAAC,EAAE,aAAa,GACnB,MAAM,CAaR"}
|
|
@@ -65,8 +65,13 @@ export declare const DEFAULT_DRAW_ENGINE: EngineName;
|
|
|
65
65
|
* @param g - A Graph from `parse()` or the builder API.
|
|
66
66
|
* @param opts - Optional: `{ engine }` overrides the default `'dot'`.
|
|
67
67
|
* @returns Flat typed draw-op array covering the full graph.
|
|
68
|
-
* @throws
|
|
69
|
-
*
|
|
68
|
+
* @throws TypeError `ERR_INVALID_ARG_TYPE` if `g` is not an object or `opts`
|
|
69
|
+
* is neither undefined nor an object
|
|
70
|
+
* @throws TypeError `ERR_INVALID_ARG_VALUE` if `opts.engine` is not registered
|
|
71
|
+
* @throws RenderError `RENDER_ERROR`, `UNKNOWN_LAYOUT` or `UNSUPPORTED_FEATURE`
|
|
72
|
+
* if layout or rendering fails
|
|
73
|
+
* @throws ParseError if the xdot output cannot be re-parsed (a dot-engine bug)
|
|
74
|
+
* @throws InternalError `INTERNAL_ERROR` on any other dot-engine bug
|
|
70
75
|
*
|
|
71
76
|
* @example
|
|
72
77
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xdot-public.d.ts","sourceRoot":"","sources":["../../src/render/xdot-public.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"xdot-public.d.ts","sourceRoot":"","sources":["../../src/render/xdot-public.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEhE,sCAAsC;AACtC,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,EAAE,UAAkB,CAAC;AAoDrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,MAAM,EAAE,CAIpE"}
|