@knowvah/dot-engine 2.0.1 → 2.1.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/dist/async/collect.d.ts.map +1 -1
- package/dist/async/render-async.d.ts.map +1 -1
- package/dist/common/arith.d.ts +6 -0
- package/dist/common/arith.d.ts.map +1 -1
- package/dist/common/poly-sizing.d.ts.map +1 -1
- package/dist/common/textmeasure-factory.d.ts +2 -1
- package/dist/common/textmeasure-factory.d.ts.map +1 -1
- package/dist/common/textmeasure.d.ts +1 -1
- package/dist/common/textmeasure.d.ts.map +1 -1
- package/dist/gvc/device-labels.d.ts +30 -0
- package/dist/gvc/device-labels.d.ts.map +1 -0
- package/dist/gvc/device-transform.d.ts +22 -0
- package/dist/gvc/device-transform.d.ts.map +1 -0
- package/dist/gvc/device.d.ts +2 -42
- package/dist/gvc/device.d.ts.map +1 -1
- package/dist/index.js +98 -79
- package/dist/index.js.map +4 -4
- package/dist/layout/dot/graph-label.d.ts +10 -0
- package/dist/layout/dot/graph-label.d.ts.map +1 -1
- package/dist/layout/dot/splines-label.d.ts.map +1 -1
- package/dist/layout/fdp/normalize.d.ts.map +1 -1
- package/dist/layout/fdp/xlayout.d.ts +1 -1
- package/dist/layout/neato/dijkstra.d.ts +0 -32
- package/dist/layout/neato/dijkstra.d.ts.map +1 -1
- package/dist/layout/neato/fdp-adjust.d.ts +12 -1
- package/dist/layout/neato/fdp-adjust.d.ts.map +1 -1
- package/dist/layout/neato/index.d.ts +5 -5
- package/dist/layout/neato/index.d.ts.map +1 -1
- package/dist/layout/sfdp/index.d.ts.map +1 -1
- package/dist/render/public.d.ts +5 -0
- package/dist/render/public.d.ts.map +1 -1
- package/dist/render.js +95 -76
- package/dist/render.js.map +4 -4
- package/package.json +1 -1
- package/src/async/collect.ts +2 -14
- package/src/async/render-async.ts +7 -12
- package/src/common/arith.ts +9 -0
- package/src/common/poly-sizing.ts +2 -1
- package/src/common/textmeasure-factory.ts +20 -1
- package/src/common/textmeasure.ts +1 -1
- package/src/gvc/device-labels.ts +98 -0
- package/src/gvc/device-transform.ts +58 -0
- package/src/gvc/device.ts +8 -132
- package/src/layout/dot/graph-label.ts +6 -1
- package/src/layout/dot/splines-label.ts +2 -1
- package/src/layout/fdp/normalize.ts +2 -1
- package/src/layout/fdp/xlayout.ts +3 -2
- package/src/layout/neato/dijkstra.ts +0 -141
- package/src/layout/neato/fdp-adjust.ts +25 -3
- package/src/layout/neato/index.ts +13 -12
- package/src/layout/sfdp/index.ts +2 -1
- package/src/render/public.ts +6 -5
- package/dist/layout/neato/overlap.d.ts +0 -85
- package/dist/layout/neato/overlap.d.ts.map +0 -1
- package/src/layout/neato/overlap.ts +0 -158
|
@@ -7,6 +7,16 @@ import type { Graph } from '../../model/graph.js';
|
|
|
7
7
|
import type { TextMeasurer } from '../../common/textmeasure.js';
|
|
8
8
|
/** Graph has a label. @see lib/common/const.h:GRAPH_LABEL */
|
|
9
9
|
export declare const GRAPH_LABEL: number;
|
|
10
|
+
/**
|
|
11
|
+
* Graph/cluster label font, read through graphAttrInherited.
|
|
12
|
+
* @internal also used by src/async/collect.ts to request the same face.
|
|
13
|
+
* @see lib/common/input.c:do_graph_label
|
|
14
|
+
*/
|
|
15
|
+
export declare function readFontParams(sg: Graph): {
|
|
16
|
+
fontsize: number;
|
|
17
|
+
fontname: string;
|
|
18
|
+
fontcolor: string;
|
|
19
|
+
};
|
|
10
20
|
/**
|
|
11
21
|
* Compute cluster label dimensions and set sg.info.border so that clustHt
|
|
12
22
|
* accounts for label height.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-label.d.ts","sourceRoot":"","sources":["../../../src/layout/dot/graph-label.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,6DAA6D;AAC7D,eAAO,MAAM,WAAW,QAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-label.d.ts","sourceRoot":"","sources":["../../../src/layout/dot/graph-label.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,6DAA6D;AAC7D,eAAO,MAAM,WAAW,QAAS,CAAC;AA8ClC;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,KAAK,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAMnG;AAeD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,CAuBhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"splines-label.d.ts","sourceRoot":"","sources":["../../../src/layout/dot/splines-label.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"splines-label.d.ts","sourceRoot":"","sources":["../../../src/layout/dot/splines-label.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACh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IAAI,CAQrD;AAiCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAK9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/layout/fdp/normalize.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/layout/fdp/normalize.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA0ClD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CA6B3C"}
|
|
@@ -3,7 +3,7 @@ import { type XParams } from './fdp-model.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Overlap-removal dispatch on the overlap attribute:
|
|
5
5
|
* ""/null → default "9:prism"; "n:mode" → n x_layout tries, then
|
|
6
|
-
*
|
|
6
|
+
* removeOverlapAs with mode; "true" → keep overlaps.
|
|
7
7
|
* @see lib/fdpgen/xlayout.c:fdp_xLayout
|
|
8
8
|
*/
|
|
9
9
|
export declare function fdpXLayout(g: Graph, xpms: XParams): void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** @see lib/neatogen/dijkstra.c */
|
|
2
|
-
import type { GraphSgd } from './sgd.js';
|
|
3
2
|
/**
|
|
4
3
|
* Sparse-graph vertex descriptor used by neato layout algorithms.
|
|
5
4
|
* Matches `vtx_data` in lib/neatogen/sparsegraph.h.
|
|
@@ -46,35 +45,4 @@ export declare function dijkstraRelax(closest: number, closestDist: number, grap
|
|
|
46
45
|
* @see lib/neatogen/dijkstra.c:dijkstra_f
|
|
47
46
|
*/
|
|
48
47
|
export declare function dijkstra(src: number, graph: VtxData[], n: number, dist: Float32Array): void;
|
|
49
|
-
/**
|
|
50
|
-
* BFS single-source distances for unweighted graphs.
|
|
51
|
-
* Fills `dist` with hop counts; unreachable nodes get BFS_INF (0x7fffffff).
|
|
52
|
-
* edges[0] of each vertex is the self-loop and is skipped.
|
|
53
|
-
* @see lib/neatogen/bfs.c:bfs
|
|
54
|
-
*/
|
|
55
|
-
export declare function bfsDistances(src: number, graph: VtxData[], n: number, dist: Float32Array): void;
|
|
56
|
-
/**
|
|
57
|
-
* All-pairs shortest paths (unweighted), packed upper-triangular.
|
|
58
|
-
* Length n*(n+1)/2; index for (i,j) j>=i: i*(2n-i-1)/2 + j.
|
|
59
|
-
* @see lib/neatogen/stress.c:compute_apsp_packed
|
|
60
|
-
*/
|
|
61
|
-
export declare function computeApspPacked(graph: VtxData[], n: number): Float32Array;
|
|
62
|
-
/**
|
|
63
|
-
* All-pairs shortest paths (weighted), packed upper-triangular.
|
|
64
|
-
* Length n*(n+1)/2.
|
|
65
|
-
* @see lib/neatogen/stress.c:compute_weighted_apsp_packed
|
|
66
|
-
*/
|
|
67
|
-
export declare function computeWeightedApspPacked(graph: VtxData[], n: number): Float32Array;
|
|
68
|
-
/** Initialise SGD dists from source's adjacency list. @internal */
|
|
69
|
-
export declare function sgdInitDist(graph: GraphSgd, src: number, dists: Float32Array): void;
|
|
70
|
-
/** Relax SGD neighbours of `closest` and push updates onto `heap`. @internal */
|
|
71
|
-
export declare function sgdRelaxNeighbors(graph: GraphSgd, closest: number, d: number, dists: Float32Array, heap: number[]): void;
|
|
72
|
-
/**
|
|
73
|
-
* Single-source shortest paths for the SGD engine.
|
|
74
|
-
* Writes terms for all reachable `j < src` and pinned nodes.
|
|
75
|
-
* Returns the count of terms written.
|
|
76
|
-
*
|
|
77
|
-
* @see lib/neatogen/dijkstra.c:dijkstra_sgd
|
|
78
|
-
*/
|
|
79
|
-
export declare function dijkstraSgd(graph: GraphSgd, src: number, terms: TermSgd[]): number;
|
|
80
48
|
//# sourceMappingURL=dijkstra.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dijkstra.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/dijkstra.ts"],"names":[],"mappings":"AACA,mCAAmC;AAEnC
|
|
1
|
+
{"version":3,"file":"dijkstra.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/dijkstra.ts"],"names":[],"mappings":"AACA,mCAAmC;AAEnC;;;;;;;;;GASG;AACH,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAMD,uDAAuD;AACvD,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE,YAAY,EAClB,GAAG,EAAE,MAAM,GACV,IAAI,CAWN;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAcrE;AAED,iEAAiE;AACjE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAOlE;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,YAAY,GACjB,MAAM,EAAE,CAMV;AAMD,yDAAyD;AACzD,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EAAE,EAChB,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,YAAY,GACjB,IAAI,CAKN;AAED,uDAAuD;AACvD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,EAAE,EAChB,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EAAE,GACb,IAAI,CAUN;AAMD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EAAE,EAChB,CAAC,EAAE,MAAM,EACT,IAAI,EAAE,YAAY,GACjB,IAAI,CASN"}
|
|
@@ -38,9 +38,15 @@ export interface AdjustData {
|
|
|
38
38
|
print: string;
|
|
39
39
|
value: number;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* getAdjustMode's fallback warning: a value that is not a mode name, not
|
|
43
|
+
* prism*, and not a boolean is used as `false` (prism) with this warning.
|
|
44
|
+
* @see lib/neatogen/adjust.c:getAdjustMode (unmappable branch)
|
|
45
|
+
*/
|
|
46
|
+
export declare function warnUnrecognizedOverlap(flag: string | undefined): void;
|
|
41
47
|
/**
|
|
42
48
|
* Resolve an `overlap` value to its adjust mode (the PRISM try count lands in
|
|
43
|
-
* `value`).
|
|
49
|
+
* `value`), warning as C does for an unrecognized value.
|
|
44
50
|
* @see lib/neatogen/adjust.c:getAdjustMode
|
|
45
51
|
*/
|
|
46
52
|
export declare function getAdjustMode(flag: string | undefined): AdjustData;
|
|
@@ -56,4 +62,9 @@ export declare function removeOverlapWith(g: Graph, am: AdjustData): number;
|
|
|
56
62
|
* @see lib/neatogen/adjust.c:adjustNodes / removeOverlapAs
|
|
57
63
|
*/
|
|
58
64
|
export declare function adjustNodesFull(g: Graph): number;
|
|
65
|
+
/**
|
|
66
|
+
* The graph's `overlap` value resolved once (agget falls back to the root).
|
|
67
|
+
* @see lib/neatogen/adjust.c:graphAdjustMode
|
|
68
|
+
*/
|
|
69
|
+
export declare function graphAdjustMode(g: Graph): AdjustData;
|
|
59
70
|
//# sourceMappingURL=fdp-adjust.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fdp-adjust.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/fdp-adjust.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA6ClD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAUzE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAgCtD;AAED;wCACwC;AACxC,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B,kEAAkE;AAClE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAsBD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"fdp-adjust.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/fdp-adjust.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA6ClD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAUzE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAgCtD;AAED;wCACwC;AACxC,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,OAAO,KAAK,CAAC;AAC1B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAC3B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B,kEAAkE;AAClE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAsBD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAMtE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAOlE;AA8CD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,UAAU,GAAG,MAAM,CAMlE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAGhD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,UAAU,CAEpD"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { Graph } from '../../model/graph.js';
|
|
13
13
|
import type { LayoutEngine } from '../../gvc/context.js';
|
|
14
|
+
import { type AdjustData } from './fdp-adjust.js';
|
|
14
15
|
export { MODE_KK, MODE_MAJOR, MODE_HIER, MODE_IPSEP, MODE_SGD, MODEL_SHORTPATH, MODEL_CIRCUIT, MODEL_SUBSET, MODEL_MDS, neatoInitNode, setSeed, solveModel, neatoTranslate, neatoSetAspect, neatoCleanup, } from './init.js';
|
|
15
16
|
/**
|
|
16
17
|
* Parse the root `mode` attribute into a numeric mode constant (C neatoMode).
|
|
@@ -27,14 +28,13 @@ export declare function parseMode(g: Graph): number;
|
|
|
27
28
|
*/
|
|
28
29
|
export declare function parseModel(g: Graph): number;
|
|
29
30
|
/**
|
|
30
|
-
* Remove node overlaps
|
|
31
|
-
*
|
|
32
|
-
* every mode, as neato_layout's adjustNodes call does.
|
|
31
|
+
* Remove node overlaps with the mode neato_layout resolved once
|
|
32
|
+
* (graphAdjustMode): C's removeOverlapWith dispatch for every mode.
|
|
33
33
|
*
|
|
34
|
-
* @see lib/neatogen/neatoinit.c:neato_layout (
|
|
34
|
+
* @see lib/neatogen/neatoinit.c:neato_layout (removeOverlapWith calls)
|
|
35
35
|
* @see lib/neatogen/adjust.c:removeOverlapWith
|
|
36
36
|
*/
|
|
37
|
-
export declare function maybeRemoveOverlap(g: Graph): void;
|
|
37
|
+
export declare function maybeRemoveOverlap(g: Graph, am: AdjustData): void;
|
|
38
38
|
/**
|
|
39
39
|
* Full neato layout pipeline for a single graph.
|
|
40
40
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layout/neato/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;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/neato/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAA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@@ -37,6 +37,11 @@ export interface RenderOptions {
|
|
|
37
37
|
*/
|
|
38
38
|
inlineImages?: boolean;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Reject a bad `g` / `format` / `opts` before any work starts.
|
|
42
|
+
* @internal shared with src/async/render-async.ts; not part of the public API.
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkRenderArgs(g: unknown, format: unknown, opts: unknown): void;
|
|
40
45
|
/**
|
|
41
46
|
* Render a (parsed or built) graph to the requested format string.
|
|
42
47
|
*
|
|
@@ -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;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;
|
|
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;AAMD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAUhF;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CACpB,CAAC,EAAE,KAAK,EACR,MAAM,EAAE,YAAY,EACpB,IAAI,CAAC,EAAE,aAAa,GACnB,MAAM,CAaR"}
|
package/dist/render.js
CHANGED
|
@@ -5426,6 +5426,15 @@ function adviseHostFaithful() {
|
|
|
5426
5426
|
"@knowvah/dot-engine: measuring text with built-in metrics (kerning/shaping not applied). For host-faithful sizing matching the rendering font, install `canvas` and call setTextMeasurer(new CanvasTextMeasurer(createCanvas(0,0).getContext('2d'))). Silence with GV_FONT_QUIET=1.\n"
|
|
5427
5427
|
);
|
|
5428
5428
|
}
|
|
5429
|
+
function offscreenMeasurer() {
|
|
5430
|
+
if (typeof OffscreenCanvas === "undefined") return void 0;
|
|
5431
|
+
try {
|
|
5432
|
+
const ctx2d = new OffscreenCanvas(0, 0).getContext("2d");
|
|
5433
|
+
return ctx2d ? new CanvasTextMeasurer(ctx2d) : void 0;
|
|
5434
|
+
} catch {
|
|
5435
|
+
return void 0;
|
|
5436
|
+
}
|
|
5437
|
+
}
|
|
5429
5438
|
function createMeasurer() {
|
|
5430
5439
|
if (override) return override;
|
|
5431
5440
|
const forced = envMeasurer();
|
|
@@ -5437,6 +5446,9 @@ function createMeasurer() {
|
|
|
5437
5446
|
if (ctx2d) return new CanvasTextMeasurer(ctx2d);
|
|
5438
5447
|
} catch {
|
|
5439
5448
|
}
|
|
5449
|
+
} else {
|
|
5450
|
+
const offscreen = offscreenMeasurer();
|
|
5451
|
+
if (offscreen) return offscreen;
|
|
5440
5452
|
}
|
|
5441
5453
|
adviseHostFaithful();
|
|
5442
5454
|
return new EstimateTextMeasurer();
|
|
@@ -10493,6 +10505,14 @@ function fms(a, b, c) {
|
|
|
10493
10505
|
return fma(-a, b, c);
|
|
10494
10506
|
}
|
|
10495
10507
|
|
|
10508
|
+
// src/common/arith.ts
|
|
10509
|
+
function cround(v) {
|
|
10510
|
+
return v >= 0 ? Math.floor(v + 0.5) : Math.ceil(v - 0.5);
|
|
10511
|
+
}
|
|
10512
|
+
function RADIANS(deg) {
|
|
10513
|
+
return deg / 180 * Math.PI;
|
|
10514
|
+
}
|
|
10515
|
+
|
|
10496
10516
|
// src/common/poly-sizing.ts
|
|
10497
10517
|
var GAP = 4;
|
|
10498
10518
|
var XPAD = 4 * GAP;
|
|
@@ -10581,7 +10601,7 @@ function ellipsePeripheryBB(bb, peripheries, penwidth, hasOutline) {
|
|
|
10581
10601
|
}
|
|
10582
10602
|
function transformUnitVertex(R2, g, c, bb) {
|
|
10583
10603
|
const D = { x: R2.x * (c.skewdist + R2.y * c.gdistortion) + R2.y * c.gskew, y: R2.y };
|
|
10584
|
-
const alpha = g.orientation
|
|
10604
|
+
const alpha = RADIANS(g.orientation) + Math.atan2(D.y, D.x);
|
|
10585
10605
|
const r = Math.sqrt(D.x * D.x + D.y * D.y);
|
|
10586
10606
|
return { x: r * Math.cos(alpha) * bb.x, y: r * Math.sin(alpha) * bb.y };
|
|
10587
10607
|
}
|
|
@@ -16758,11 +16778,6 @@ function initEdgeLabels(e, g, measurer) {
|
|
|
16758
16778
|
if (hasEnd) applyEndLabels(e, g, measurer);
|
|
16759
16779
|
}
|
|
16760
16780
|
|
|
16761
|
-
// src/common/arith.ts
|
|
16762
|
-
function cround(v) {
|
|
16763
|
-
return v >= 0 ? Math.floor(v + 0.5) : Math.ceil(v - 0.5);
|
|
16764
|
-
}
|
|
16765
|
-
|
|
16766
16781
|
// src/common/graph-init.ts
|
|
16767
16782
|
var RANKDIR_TB = 0;
|
|
16768
16783
|
var RANKDIR_LR = 1;
|
|
@@ -19277,10 +19292,7 @@ function walkNodesAndEdges(g, renderer, job, info) {
|
|
|
19277
19292
|
}
|
|
19278
19293
|
}
|
|
19279
19294
|
|
|
19280
|
-
// src/gvc/device.ts
|
|
19281
|
-
function renderClusterLabel(sg, renderer, job) {
|
|
19282
|
-
renderOneLabel(sg.info.label, renderer, job, false);
|
|
19283
|
-
}
|
|
19295
|
+
// src/gvc/device-transform.ts
|
|
19284
19296
|
function transformPoint(p, job) {
|
|
19285
19297
|
if ((job.flags & GVRENDER_DOES_TRANSFORM) !== 0) {
|
|
19286
19298
|
return p;
|
|
@@ -19300,6 +19312,50 @@ function buildPoint(x, y) {
|
|
|
19300
19312
|
const pt = { x, y };
|
|
19301
19313
|
return pt;
|
|
19302
19314
|
}
|
|
19315
|
+
|
|
19316
|
+
// src/gvc/device-labels.ts
|
|
19317
|
+
var VALIGN_TOP = "t".charCodeAt(0);
|
|
19318
|
+
var VALIGN_BOTTOM = "b".charCodeAt(0);
|
|
19319
|
+
function labelFirstSpanY(lp) {
|
|
19320
|
+
if (lp.valign === VALIGN_TOP) return lp.pos.y + lp.space.y / 2 - lp.fontsize;
|
|
19321
|
+
if (lp.valign === VALIGN_BOTTOM) {
|
|
19322
|
+
return lp.pos.y - lp.space.y / 2 + lp.dimen.y - lp.fontsize;
|
|
19323
|
+
}
|
|
19324
|
+
return lp.pos.y + lp.dimen.y / 2 - lp.fontsize;
|
|
19325
|
+
}
|
|
19326
|
+
function labelSpanX(lp, just) {
|
|
19327
|
+
if (just === "l") return lp.pos.x - lp.space.x / 2;
|
|
19328
|
+
if (just === "r") return lp.pos.x + lp.space.x / 2;
|
|
19329
|
+
return lp.pos.x;
|
|
19330
|
+
}
|
|
19331
|
+
function renderOneLabel(lp, renderer, job, requireSet = true) {
|
|
19332
|
+
if (!lp) return;
|
|
19333
|
+
if (requireSet && !lp.set) return;
|
|
19334
|
+
if (lp.html) {
|
|
19335
|
+
if (lp.u.kind === "html") {
|
|
19336
|
+
const html = lp.u.html;
|
|
19337
|
+
const pos = lp.pos;
|
|
19338
|
+
withLabelEmitState(job, () => emitHtmlLabel(html, pos, renderer, job));
|
|
19339
|
+
}
|
|
19340
|
+
return;
|
|
19341
|
+
}
|
|
19342
|
+
if (lp.u.kind !== "txt" || lp.u.nspans < 1) return;
|
|
19343
|
+
let y = labelFirstSpanY(lp);
|
|
19344
|
+
for (let i = 0; i < lp.u.nspans; i++) {
|
|
19345
|
+
const span = lp.u.span[i];
|
|
19346
|
+
if (!span) break;
|
|
19347
|
+
gvrenderTextspan(renderer, { x: labelSpanX(lp, span.just), y }, span, job);
|
|
19348
|
+
y -= span.size.y;
|
|
19349
|
+
}
|
|
19350
|
+
}
|
|
19351
|
+
function renderNodeXLabel(n, renderer, job) {
|
|
19352
|
+
renderOneLabel(n.info.xlabel, renderer, job);
|
|
19353
|
+
}
|
|
19354
|
+
function renderClusterLabel(sg, renderer, job) {
|
|
19355
|
+
renderOneLabel(sg.info.label, renderer, job, false);
|
|
19356
|
+
}
|
|
19357
|
+
|
|
19358
|
+
// src/gvc/device.ts
|
|
19303
19359
|
function labelTextOf2(lp) {
|
|
19304
19360
|
return lp?.text ?? null;
|
|
19305
19361
|
}
|
|
@@ -19374,43 +19430,6 @@ function renderEdge(e, renderer, job) {
|
|
|
19374
19430
|
job.popObj();
|
|
19375
19431
|
}
|
|
19376
19432
|
}
|
|
19377
|
-
var VALIGN_TOP = "t".charCodeAt(0);
|
|
19378
|
-
var VALIGN_BOTTOM = "b".charCodeAt(0);
|
|
19379
|
-
function labelFirstSpanY(lp) {
|
|
19380
|
-
if (lp.valign === VALIGN_TOP) return lp.pos.y + lp.space.y / 2 - lp.fontsize;
|
|
19381
|
-
if (lp.valign === VALIGN_BOTTOM) {
|
|
19382
|
-
return lp.pos.y - lp.space.y / 2 + lp.dimen.y - lp.fontsize;
|
|
19383
|
-
}
|
|
19384
|
-
return lp.pos.y + lp.dimen.y / 2 - lp.fontsize;
|
|
19385
|
-
}
|
|
19386
|
-
function labelSpanX(lp, just) {
|
|
19387
|
-
if (just === "l") return lp.pos.x - lp.space.x / 2;
|
|
19388
|
-
if (just === "r") return lp.pos.x + lp.space.x / 2;
|
|
19389
|
-
return lp.pos.x;
|
|
19390
|
-
}
|
|
19391
|
-
function renderOneLabel(lp, renderer, job, requireSet = true) {
|
|
19392
|
-
if (!lp) return;
|
|
19393
|
-
if (requireSet && !lp.set) return;
|
|
19394
|
-
if (lp.html) {
|
|
19395
|
-
if (lp.u.kind === "html") {
|
|
19396
|
-
const html = lp.u.html;
|
|
19397
|
-
const pos = lp.pos;
|
|
19398
|
-
withLabelEmitState(job, () => emitHtmlLabel(html, pos, renderer, job));
|
|
19399
|
-
}
|
|
19400
|
-
return;
|
|
19401
|
-
}
|
|
19402
|
-
if (lp.u.kind !== "txt" || lp.u.nspans < 1) return;
|
|
19403
|
-
let y = labelFirstSpanY(lp);
|
|
19404
|
-
for (let i = 0; i < lp.u.nspans; i++) {
|
|
19405
|
-
const span = lp.u.span[i];
|
|
19406
|
-
if (!span) break;
|
|
19407
|
-
gvrenderTextspan(renderer, { x: labelSpanX(lp, span.just), y }, span, job);
|
|
19408
|
-
y -= span.size.y;
|
|
19409
|
-
}
|
|
19410
|
-
}
|
|
19411
|
-
function renderNodeXLabel(n, renderer, job) {
|
|
19412
|
-
renderOneLabel(n.info.xlabel, renderer, job);
|
|
19413
|
-
}
|
|
19414
19433
|
function renderGraphLabel(g, renderer, job) {
|
|
19415
19434
|
setHtmlAnchorObj(svgGraphId(g, job), labelTextOf2(g.info.label), job.obj ?? void 0);
|
|
19416
19435
|
renderOneLabel(g.info.label, renderer, job, false);
|
|
@@ -28891,7 +28910,7 @@ function applyPortlabelPos(e, headP) {
|
|
|
28891
28910
|
}
|
|
28892
28911
|
function writePortlabelPos(l, pe, pf, angleStr, distanceStr) {
|
|
28893
28912
|
const angleDeg = lateDouble(angleStr, PORT_LABEL_ANGLE, -180);
|
|
28894
|
-
const angle = Math.atan2(pf.y - pe.y, pf.x - pe.x) +
|
|
28913
|
+
const angle = Math.atan2(pf.y - pe.y, pf.x - pe.x) + RADIANS(angleDeg);
|
|
28895
28914
|
const distMult = lateDouble(distanceStr || void 0, 1, 0);
|
|
28896
28915
|
const dist4 = PORT_LABEL_DISTANCE * distMult;
|
|
28897
28916
|
l.pos.x = pe.x + dist4 * Math.cos(angle);
|
|
@@ -41778,7 +41797,7 @@ function angleSet(g) {
|
|
|
41778
41797
|
if (a === void 0 || a === "") return null;
|
|
41779
41798
|
const ang = parseAngle2(a);
|
|
41780
41799
|
if (ang === null) return null;
|
|
41781
|
-
return wrapDegrees(ang)
|
|
41800
|
+
return RADIANS(wrapDegrees(ang));
|
|
41782
41801
|
}
|
|
41783
41802
|
function parseAngle2(a) {
|
|
41784
41803
|
const m = /^\s*[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/.exec(a);
|
|
@@ -43693,7 +43712,15 @@ var ADJUST_MODES = /* @__PURE__ */ new Map([
|
|
|
43693
43712
|
["porthoxy", [AM_PORTHOXY, "xy pseudo-orthogonal constraints"]],
|
|
43694
43713
|
["porthoyx", [AM_PORTHOYX, "yx pseudo-orthogonal constraints"]]
|
|
43695
43714
|
]);
|
|
43715
|
+
function warnUnrecognizedOverlap(flag) {
|
|
43716
|
+
if (flag === void 0 || flag === "") return;
|
|
43717
|
+
const s = flag.toLowerCase();
|
|
43718
|
+
if (s.startsWith("prism") || NAMED_MODES.has(s)) return;
|
|
43719
|
+
if (mapBoolDflt(flag, false) === mapBoolDflt(flag, true)) return;
|
|
43720
|
+
console.warn(`Unrecognized overlap value "${flag}" - using false`);
|
|
43721
|
+
}
|
|
43696
43722
|
function getAdjustMode(flag) {
|
|
43723
|
+
warnUnrecognizedOverlap(flag);
|
|
43697
43724
|
const ntry = overlapPrismTries(flag);
|
|
43698
43725
|
if (ntry !== null) return { mode: AM_PRISM, print: "prism", value: ntry };
|
|
43699
43726
|
const named = ADJUST_MODES.get((flag ?? "").toLowerCase());
|
|
@@ -43742,8 +43769,11 @@ function removeOverlapWith(g, am) {
|
|
|
43742
43769
|
return nret + (am.mode === AM_SCALE ? sAdjustGraph(g) : adjustVoronoi(g, am));
|
|
43743
43770
|
}
|
|
43744
43771
|
function adjustNodesFull(g) {
|
|
43745
|
-
|
|
43746
|
-
return removeOverlapWith(g,
|
|
43772
|
+
if (g.nodes.size < 2) return 0;
|
|
43773
|
+
return removeOverlapWith(g, graphAdjustMode(g));
|
|
43774
|
+
}
|
|
43775
|
+
function graphAdjustMode(g) {
|
|
43776
|
+
return getAdjustMode(g.attrs.get("overlap") ?? g.root.attrs.get("overlap"));
|
|
43747
43777
|
}
|
|
43748
43778
|
|
|
43749
43779
|
// src/layout/twopi/init.ts
|
|
@@ -44110,8 +44140,8 @@ function parseModel(g) {
|
|
|
44110
44140
|
if (!s) return MODEL_SHORTPATH2;
|
|
44111
44141
|
return MODEL_MAP[s] ?? MODEL_SHORTPATH2;
|
|
44112
44142
|
}
|
|
44113
|
-
function maybeRemoveOverlap(g) {
|
|
44114
|
-
|
|
44143
|
+
function maybeRemoveOverlap(g, am) {
|
|
44144
|
+
removeOverlapWith(g, am);
|
|
44115
44145
|
}
|
|
44116
44146
|
function neatoLayout(g) {
|
|
44117
44147
|
graphInit(g, false);
|
|
@@ -44126,13 +44156,14 @@ function neatoLayout(g) {
|
|
|
44126
44156
|
for (const e of g.edges) initEdgeLabels(e, g, measurer);
|
|
44127
44157
|
}
|
|
44128
44158
|
const mode = parseMode(g);
|
|
44159
|
+
const am = graphAdjustMode(g);
|
|
44129
44160
|
const model = parseModel(g);
|
|
44130
44161
|
const { graphs: comps, pinned } = neatoPack(g, mode) >= 0 ? pccomps(g, "_neato_cc") : { graphs: [g], pinned: false };
|
|
44131
44162
|
if (comps.length > 1) {
|
|
44132
|
-
layoutComponents(g, comps, mode, model, pinned);
|
|
44163
|
+
layoutComponents(g, comps, { mode, model, am }, pinned);
|
|
44133
44164
|
} else {
|
|
44134
44165
|
solveModel2(g, mode, model);
|
|
44135
|
-
maybeRemoveOverlap(g);
|
|
44166
|
+
maybeRemoveOverlap(g, am);
|
|
44136
44167
|
splineEdgesShifted(g);
|
|
44137
44168
|
}
|
|
44138
44169
|
addClusters(g);
|
|
@@ -44168,11 +44199,11 @@ function addClusters(g) {
|
|
|
44168
44199
|
g.info.clust = clusters;
|
|
44169
44200
|
g.info.n_cluster = clusters.length;
|
|
44170
44201
|
}
|
|
44171
|
-
function layoutComponents(g, comps,
|
|
44202
|
+
function layoutComponents(g, comps, solve2, pinned) {
|
|
44172
44203
|
for (const gc of comps) {
|
|
44173
44204
|
setEdgeTypeFromAttr(gc, EDGETYPE_LINE);
|
|
44174
|
-
solveModel2(gc, mode, model);
|
|
44175
|
-
maybeRemoveOverlap(gc);
|
|
44205
|
+
solveModel2(gc, solve2.mode, solve2.model);
|
|
44206
|
+
maybeRemoveOverlap(gc, solve2.am);
|
|
44176
44207
|
splineEdgesShifted(gc);
|
|
44177
44208
|
}
|
|
44178
44209
|
const pinfo = {
|
|
@@ -45050,6 +45081,7 @@ function fdpXLayout(g, xpms) {
|
|
|
45050
45081
|
}
|
|
45051
45082
|
function removeOverlapAs(g, flag) {
|
|
45052
45083
|
if (g.nodes.size < 2) return;
|
|
45084
|
+
warnUnrecognizedOverlap(flag);
|
|
45053
45085
|
normalizeG(g);
|
|
45054
45086
|
simpleScale(g);
|
|
45055
45087
|
const ntry = overlapPrismTries(flag);
|
|
@@ -46200,6 +46232,7 @@ function resolveControl(g) {
|
|
|
46200
46232
|
const pad = { x: DFLT_MARGIN / 72, y: DFLT_MARGIN / 72 };
|
|
46201
46233
|
const overlap5 = aggetGraph(g, "overlap");
|
|
46202
46234
|
const flag = overlap5 === void 0 ? "prism0" : overlap5;
|
|
46235
|
+
warnUnrecognizedOverlap(flag);
|
|
46203
46236
|
const ntry = overlapPrismTries(flag);
|
|
46204
46237
|
if (ntry !== null) {
|
|
46205
46238
|
ctrl.overlap = ntry;
|
|
@@ -55120,16 +55153,9 @@ function collectEdge(acc, e) {
|
|
|
55120
55153
|
addLabel(acc, e.attrs.get("headlabel"), lfi);
|
|
55121
55154
|
addLabel(acc, e.attrs.get("taillabel"), lfi);
|
|
55122
55155
|
}
|
|
55123
|
-
function graphLabelFont(sg) {
|
|
55124
|
-
const get = (k) => sg.attrs.get(k) ?? sg.graphDefaultsSnapshot?.get(k);
|
|
55125
|
-
return {
|
|
55126
|
-
fontname: get("fontname") ?? DEFAULT_FONTNAME,
|
|
55127
|
-
fontsize: parseFloat(get("fontsize") ?? "") || DEFAULT_FONTSIZE2
|
|
55128
|
-
};
|
|
55129
|
-
}
|
|
55130
55156
|
function collectGraphLabels(acc, sg, root) {
|
|
55131
55157
|
if (isACluster(sg)) {
|
|
55132
|
-
addLabel(acc, sg.attrs.get("label") ?? sg.graphDefaultsSnapshot?.get("label"),
|
|
55158
|
+
addLabel(acc, sg.attrs.get("label") ?? sg.graphDefaultsSnapshot?.get("label"), readFontParams(sg));
|
|
55133
55159
|
}
|
|
55134
55160
|
for (const child of sg.subgraphs.values()) collectGraphLabels(acc, child, root);
|
|
55135
55161
|
}
|
|
@@ -55189,17 +55215,10 @@ async function loadFonts(fontSet, fonts, timeoutMs) {
|
|
|
55189
55215
|
|
|
55190
55216
|
// src/async/render-async.ts
|
|
55191
55217
|
var DEFAULT_FONT_TIMEOUT_MS = 3e3;
|
|
55192
|
-
function checkRenderArgs2(g, format, opts) {
|
|
55193
|
-
if (typeof g !== "object" || g === null) throw invalidArgType("g", "object", g);
|
|
55194
|
-
if (typeof format !== "string") throw invalidArgType("format", "string", format);
|
|
55195
|
-
if (opts !== void 0 && (typeof opts !== "object" || opts === null)) {
|
|
55196
|
-
throw invalidArgType("opts", "object or undefined", opts);
|
|
55197
|
-
}
|
|
55198
|
-
}
|
|
55199
55218
|
function defaultFontSet() {
|
|
55200
55219
|
const doc = Reflect.get(globalThis, "document");
|
|
55201
|
-
|
|
55202
|
-
const fonts = Reflect.get(
|
|
55220
|
+
const owner = typeof doc === "object" && doc !== null ? doc : globalThis;
|
|
55221
|
+
const fonts = Reflect.get(owner, "fonts");
|
|
55203
55222
|
if (typeof fonts !== "object" || fonts === null) return void 0;
|
|
55204
55223
|
return fonts;
|
|
55205
55224
|
}
|
|
@@ -55231,7 +55250,7 @@ async function prefetchAll(g, opts) {
|
|
|
55231
55250
|
return { fontIssues, sizes, bytes };
|
|
55232
55251
|
}
|
|
55233
55252
|
async function renderAsync(g, format, opts) {
|
|
55234
|
-
|
|
55253
|
+
checkRenderArgs(g, format, opts);
|
|
55235
55254
|
const engine = opts?.engine ?? "dot";
|
|
55236
55255
|
try {
|
|
55237
55256
|
const { fontIssues, sizes, bytes } = await prefetchAll(g, opts);
|