@knowvah/dot-engine 2.12.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.
- package/dist/common/edge-in-box.d.ts +6 -20
- package/dist/common/edge-in-box.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/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/device.d.ts.map +1 -1
- package/dist/gvc/emit-xdot.d.ts +9 -0
- package/dist/gvc/emit-xdot.d.ts.map +1 -1
- package/dist/index.js +7316 -7200
- 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 +3 -8
- package/dist/layout/dot/edge-route.d.ts.map +1 -1
- package/dist/layout/dot/init.d.ts +25 -4
- package/dist/layout/dot/init.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/neato/fdp-adjust.d.ts.map +1 -1
- package/dist/layout/sfdp/spring-electrical.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 +4 -7
- package/dist/render/dot/agwrite.d.ts.map +1 -1
- package/dist/render/dot/attrs.d.ts.map +1 -1
- package/dist/render/dot/write-back.d.ts +10 -0
- package/dist/render/dot/write-back.d.ts.map +1 -1
- package/dist/render/dot.d.ts +1 -2
- package/dist/render/dot.d.ts.map +1 -1
- package/dist/render/json-cluster-edge.d.ts +22 -0
- package/dist/render/json-cluster-edge.d.ts.map +1 -0
- package/dist/render/json.d.ts.map +1 -1
- package/dist/render/map.d.ts.map +1 -1
- package/dist/render/svg-graph.d.ts.map +1 -1
- package/dist/render.js +7316 -7200
- package/dist/render.js.map +4 -4
- package/dist/util/printf-round.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/edge-in-box.ts +9 -24
- package/src/common/emit-bb.ts +128 -0
- 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/device.ts +26 -27
- package/src/gvc/emit-gates.ts +1 -1
- package/src/gvc/emit-xdot.ts +5 -6
- package/src/layout/dot/decomp.ts +23 -2
- package/src/layout/dot/edge-route.ts +8 -37
- package/src/layout/dot/init.ts +36 -11
- package/src/layout/dot/splines-flat.ts +2 -2
- package/src/layout/dot/splines-groups.ts +2 -2
- package/src/layout/dot/splines-route.ts +2 -2
- package/src/layout/dot/splines.ts +8 -8
- package/src/layout/neato/conjgrad.ts +2 -2
- package/src/layout/neato/fdp-adjust.ts +1 -16
- package/src/layout/sfdp/spring-electrical.ts +5 -3
- package/src/render/dot/agwrite-linelength.ts +58 -0
- package/src/render/dot/agwrite.ts +13 -13
- package/src/render/dot/attrs.ts +27 -1
- package/src/render/dot/write-back.ts +21 -0
- package/src/render/dot/xdot-ops.ts +1 -1
- package/src/render/dot.ts +11 -17
- package/src/render/json-cluster-edge.ts +50 -0
- package/src/render/json.ts +16 -19
- package/src/render/map.ts +3 -7
- package/src/render/svg-graph.ts +22 -9
- package/src/render/svg.ts +3 -3
- package/src/util/printf-round.ts +16 -10
- 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,31 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* emit_edge's edge_in_box gate, shared by the device walk (edge comments) and
|
|
3
|
-
* the SVG / xdot renderers (edge group and draw ops).
|
|
4
|
-
* render/svg.ts unchanged.
|
|
3
|
+
* the SVG / xdot renderers (edge group and draw ops).
|
|
5
4
|
*
|
|
6
5
|
* @see lib/common/emit.c:edge_in_box, lib/common/utils.c:overlap_label
|
|
7
6
|
*/
|
|
8
7
|
import type { Box } from '../model/geom.js';
|
|
9
8
|
import type { Edge } from '../model/edge.js';
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* The only piece that can legitimately fall OUTSIDE the clip on this corpus is a
|
|
17
|
-
* degenerate labeled-flat label: it is spline-less, so map_edge leaves it at its
|
|
18
|
-
* internal (un-normalized) x-frame position while the clip is the final frame.
|
|
19
|
-
* The `overlapLabel` test on the main label reproduces C's draw-iff-overlap for
|
|
20
|
-
* exactly that case — on-canvas (2368) → drawn; off-canvas (2368_1, negative
|
|
21
|
-
* un-normalized x) → suppressed. A present spline always lies within the clip
|
|
22
|
-
* (GD_bb contains it), and head/tail/xlabels are positioned at on-canvas
|
|
23
|
-
* endpoints, so those keep their existing unconditional triggers — adding an
|
|
24
|
-
* overlap test there only risks suppressing legitimately-drawn content (it
|
|
25
|
-
* regressed neato/circo edges whose spl.bb is computed differently). The `set`
|
|
26
|
-
* guard on the main label is kept: the port retains an unplaced (`pos=0,0`,
|
|
27
|
-
* `set=false`) label on merged back-edges where C has none.
|
|
28
|
-
* @see lib/common/emit.c:edge_in_box, lib/common/utils.c:overlap_label
|
|
10
|
+
* `edge_in_box`: whether any piece of the edge overlaps the page clip — the
|
|
11
|
+
* spline's box (`spl->bb`, which init_bb computes before every render; see
|
|
12
|
+
* emit-bb.ts), the label, or a placed xlabel. emit_edge draws nothing, not even
|
|
13
|
+
* the edge's group, when this fails. Head and tail labels are not tested.
|
|
14
|
+
* @see lib/common/emit.c:2686 edge_in_box, lib/common/utils.c:overlap_label
|
|
29
15
|
*/
|
|
30
16
|
export declare function edgeHasDrawableContent(e: Edge, clip: Box): boolean;
|
|
31
17
|
//# sourceMappingURL=edge-in-box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-in-box.d.ts","sourceRoot":"","sources":["../../src/common/edge-in-box.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"edge-in-box.d.ts","sourceRoot":"","sources":["../../src/common/edge-in-box.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAe7C;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAKlE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounding boxes gvRenderJobs computes before every render: each node's
|
|
3
|
+
* `ND_bb` and each out-edge's `spl->bb`, which `edge_in_box` tests against the
|
|
4
|
+
* page clip. The node half is not stored: `nodeInBox` derives `ND_bb` from the
|
|
5
|
+
* same fields at the test, and nothing between here and that test moves a node.
|
|
6
|
+
*
|
|
7
|
+
* @see lib/common/emit.c:4076 bezier_bb, :4101 init_splines_bb, :4157 init_bb
|
|
8
|
+
* @see lib/common/arrows.c:1107 arrow_bb
|
|
9
|
+
*/
|
|
10
|
+
import type { Bezier, Box, Point, Spline } from '../model/geom.js';
|
|
11
|
+
import type { Graph } from '../model/graph.js';
|
|
12
|
+
/**
|
|
13
|
+
* The box of an arrowhead of length `ARROW_LENGTH * arrowsize` at `p`, aimed
|
|
14
|
+
* along `u - p`: the four corners of the rotated head's bounding square.
|
|
15
|
+
* @see lib/common/arrows.c:1107 arrow_bb
|
|
16
|
+
*/
|
|
17
|
+
export declare function arrowBb(p: Point, u0: Point, arrowsize: number): Box;
|
|
18
|
+
/**
|
|
19
|
+
* A bezier's box: its first point, then per segment the midpoint of the two
|
|
20
|
+
* control points and the segment's end point.
|
|
21
|
+
* @see lib/common/emit.c:4076 bezier_bb
|
|
22
|
+
*/
|
|
23
|
+
export declare function bezierBb(bz: Bezier): Box;
|
|
24
|
+
/**
|
|
25
|
+
* `spl->bb`: the union of every bezier's box and, for each flagged end, the
|
|
26
|
+
* box of a unit-size arrowhead there.
|
|
27
|
+
* @see lib/common/emit.c:4101 init_splines_bb
|
|
28
|
+
*/
|
|
29
|
+
export declare function initSplinesBb(spl: Spline): void;
|
|
30
|
+
/**
|
|
31
|
+
* Before each render: `spl->bb` of every out-edge of every node of `g`, the
|
|
32
|
+
* graph being rendered (a subgraph render leaves other edges' boxes alone).
|
|
33
|
+
* @see lib/common/emit.c:4127 init_bb_edge, :4136 init_bb_node, :4157 init_bb
|
|
34
|
+
*/
|
|
35
|
+
export declare function initBb(g: Graph): void;
|
|
36
|
+
//# sourceMappingURL=emit-bb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit-bb.d.ts","sourceRoot":"","sources":["../../src/common/emit-bb.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAmB/C;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG,CAsBnE;AAkBD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,CAWxC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAY/C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAQrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EngineName } from '../../context.js';
|
|
2
|
+
export type SubgMode = 'root' | 'nofree';
|
|
3
|
+
export type SubgFmt = 'xdot' | 'svg';
|
|
4
|
+
/** Native's renders of one case, in order (harness/T7b/noaddr). */
|
|
5
|
+
export declare function nativeSubgRenders(engine: EngineName, sub: string, mode: SubgMode, fmt: SubgFmt): string[];
|
|
6
|
+
/** The port's renders of one case, in the harness's order. */
|
|
7
|
+
export declare function portSubgRenders(engine: EngineName, sub: string, mode: SubgMode, fmt: SubgFmt): string[];
|
|
8
|
+
/** svg's generator banner and `<svg>` tag layout differ from native's on every render; drop them. */
|
|
9
|
+
export declare function svgBody(svg: string): string;
|
|
10
|
+
//# sourceMappingURL=subg-renders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subg-renders.d.ts","sourceRoot":"","sources":["../../../../src/gvc/__fixtures__/subg-renders/subg-renders.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAOnD,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AACzC,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAErC,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,CAEzG;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,GAAG,MAAM,EAAE,CAkBvG;AAED,qGAAqG;AACrG,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C"}
|
package/dist/gvc/device.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/gvc/device.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,UAAU,EAAW,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAE,SAAS,EAA0D,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/gvc/device.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,UAAU,EAAW,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAE,SAAS,EAA0D,MAAM,UAAU,CAAC;AA8B7F,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAc1F,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAU,SAAS;QACjB,0EAA0E;QAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB;CACF;AAkCD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CA6BnG;AAqCD,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAyClF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAIzF;AAiGD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAQvF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,CAyBtF;AA2CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,MAAM,CAuE9F"}
|
package/dist/gvc/emit-xdot.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import type { Box } from '../model/geom.js';
|
|
1
2
|
import type { Graph } from '../model/graph.js';
|
|
2
3
|
import { type RendererPlugin } from './context.js';
|
|
3
4
|
import type { RenderJob } from './job.js';
|
|
5
|
+
/**
|
|
6
|
+
* job->clip for this device, computed in C's order, rounding included. svg's
|
|
7
|
+
* pad is `job.pad` (default 4); the xdot device's default is 0, so with no
|
|
8
|
+
* `pad` its clip is the bb.
|
|
9
|
+
* @see plugin/core/gvrender_core_dot.c:739 render_features_dot
|
|
10
|
+
* @see lib/common/emit.c:1558
|
|
11
|
+
*/
|
|
12
|
+
export declare function deviceClip(g: Graph, renderer: RendererPlugin, job: RenderJob): Box;
|
|
4
13
|
/**
|
|
5
14
|
* Replays the graph's draw ops, inside emit_background. A text op is skipped:
|
|
6
15
|
* only xdotBB builds its span, so C dereferences a null span here and a `_draw_`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-xdot.d.ts","sourceRoot":"","sources":["../../src/gvc/emit-xdot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emit-xdot.d.ts","sourceRoot":"","sources":["../../src/gvc/emit-xdot.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,GAAG,EAAS,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAItE,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,UAAU,CAAC;AAWpD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GAAG,GAAG,CAKlF;AA8JD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GAAG,IAAI,CAejF"}
|