@hpcc-js/wasm-graphviz 1.24.0 → 1.25.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 +107 -43
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/package.json +4 -4
- package/src/graphviz.ts +387 -52
- package/src/types.ts +6 -0
- package/types/graphviz.d.ts +136 -27
- package/types/graphvizlib.d.ts +52 -0
- package/types/types.d.ts +3 -0
package/types/graphviz.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { MainModule, CGraph as CGraphWasm, CSubgraph as CSubgraphWasm } from "../types/graphvizlib.js";
|
|
2
2
|
import type { NodeDotAttr, NodeAttrs, EdgeDotAttr, EdgeAttrs, ClusterDotAttr, ClusterAttrs, GraphDotAttr, GraphAttrs as GraphAttrs } from "./types.ts";
|
|
3
|
+
type AttrValues<T> = Partial<{
|
|
4
|
+
[K in keyof T]: NonNullable<T[K]>;
|
|
5
|
+
}>;
|
|
3
6
|
/**
|
|
4
|
-
* Various graphic and data formats for end user, web, documents and other applications. See [Output Formats](https://graphviz.
|
|
7
|
+
* Various graphic and data formats for end user, web, documents and other applications. See [Output Formats](https://graphviz.org/docs/outputs/) for more information.
|
|
5
8
|
*/
|
|
6
9
|
export type Format = "svg" | "svg_inline" | "dot" | "json" | "dot_json" | "xdot_json" | "plain" | "plain-ext" | "canon";
|
|
7
10
|
/**
|
|
@@ -19,7 +22,7 @@ export interface EdgeInfo {
|
|
|
19
22
|
key: string;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
|
-
* Various algorithms for projecting abstract graphs into a space for visualization. See [Layout Engines](https://graphviz.
|
|
25
|
+
* Various algorithms for projecting abstract graphs into a space for visualization. See [Layout Engines](https://graphviz.org/docs/layouts/) for more details.
|
|
23
26
|
*/
|
|
24
27
|
export type Engine = "circo" | "dot" | "fdp" | "sfdp" | "neato" | "osage" | "patchwork" | "twopi" | "nop" | "nop2";
|
|
25
28
|
/**
|
|
@@ -64,6 +67,30 @@ export interface Options {
|
|
|
64
67
|
* - `"strict undirected"` – undirected graph that disallows parallel edges and self-loops
|
|
65
68
|
*/
|
|
66
69
|
export type GraphType = "directed" | "undirected" | "strict directed" | "strict undirected";
|
|
70
|
+
export interface GraphInit {
|
|
71
|
+
name?: string;
|
|
72
|
+
type?: GraphType;
|
|
73
|
+
attrs?: AttrValues<GraphAttrs>;
|
|
74
|
+
htmlAttrs?: AttrValues<GraphAttrs>;
|
|
75
|
+
}
|
|
76
|
+
export interface NodeInit {
|
|
77
|
+
name: string;
|
|
78
|
+
attrs?: AttrValues<NodeAttrs>;
|
|
79
|
+
htmlAttrs?: AttrValues<NodeAttrs>;
|
|
80
|
+
}
|
|
81
|
+
export interface EdgeInit {
|
|
82
|
+
tail: string;
|
|
83
|
+
head: string;
|
|
84
|
+
key?: string;
|
|
85
|
+
attrs?: AttrValues<EdgeAttrs>;
|
|
86
|
+
htmlAttrs?: AttrValues<EdgeAttrs>;
|
|
87
|
+
}
|
|
88
|
+
export interface SubgraphInit {
|
|
89
|
+
name: string;
|
|
90
|
+
attrs?: AttrValues<ClusterAttrs>;
|
|
91
|
+
htmlAttrs?: AttrValues<ClusterAttrs>;
|
|
92
|
+
}
|
|
93
|
+
export type ClusterInit = SubgraphInit;
|
|
67
94
|
/**
|
|
68
95
|
* A subgraph (or cluster) inside a {@link Graph}.
|
|
69
96
|
*
|
|
@@ -92,11 +119,14 @@ export declare class Subgraph {
|
|
|
92
119
|
* Create (or find) a node and add it to this subgraph.
|
|
93
120
|
*/
|
|
94
121
|
addNode(name: string): this;
|
|
122
|
+
addNode(init: NodeInit): this;
|
|
95
123
|
/**
|
|
96
124
|
* Create an edge inside this subgraph. Both endpoints are created
|
|
97
125
|
* automatically if they do not already exist.
|
|
98
126
|
*/
|
|
99
127
|
addEdge(tail: string, head: string, key?: string): this;
|
|
128
|
+
addEdge(init: EdgeInit): this;
|
|
129
|
+
applyInit(init: SubgraphInit): this;
|
|
100
130
|
/**
|
|
101
131
|
* Remove a node from this subgraph only. The node (and any edges
|
|
102
132
|
* connecting it) remains in the root graph and all other subgraphs.
|
|
@@ -110,14 +140,25 @@ export declare class Subgraph {
|
|
|
110
140
|
removeEdge(tail: string, head: string, key?: string): this;
|
|
111
141
|
/**
|
|
112
142
|
* Set an attribute on the subgraph itself (e.g. `"label"`, `"style"`,
|
|
113
|
-
* `"color"`, `"bgcolor"`).
|
|
143
|
+
* `"color"`, `"bgcolor"`). See the official Graphviz
|
|
144
|
+
* [attribute reference](https://graphviz.org/docs/attrs/) for supported
|
|
145
|
+
* attributes and values.
|
|
114
146
|
*
|
|
115
147
|
* When `attr` is a known cluster attribute the value type is inferred
|
|
116
148
|
* automatically. A generic `string | number | boolean` fallback is
|
|
117
|
-
* provided for custom or less-common attributes.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
149
|
+
* provided for custom or less-common attributes. Omit `value` to reset
|
|
150
|
+
* the attribute to Graphviz's default empty value. `defaultValue` is
|
|
151
|
+
* passed to Graphviz as the default for this attribute if it has not
|
|
152
|
+
* already been declared.
|
|
153
|
+
*/
|
|
154
|
+
setAttr<K extends ClusterDotAttr>(attr: K, value?: NonNullable<ClusterAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
155
|
+
setAttr(attr: string, value?: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
156
|
+
setHtmlAttr<K extends ClusterDotAttr>(attr: K, value: NonNullable<ClusterAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
157
|
+
setHtmlAttr(attr: string, value: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
158
|
+
setDefaultAttr<K extends ClusterDotAttr>(attr: K, value: NonNullable<ClusterAttrs[K]>): this;
|
|
159
|
+
setDefaultAttr(attr: string, value: string | number | boolean): this;
|
|
160
|
+
setDefaultHtmlAttr<K extends ClusterDotAttr>(attr: K, value: NonNullable<ClusterAttrs[K]>): this;
|
|
161
|
+
setDefaultHtmlAttr(attr: string, value: string | number | boolean): this;
|
|
121
162
|
/**
|
|
122
163
|
* Clear a subgraph-level attribute by resetting it to its default (empty)
|
|
123
164
|
* value. Equivalent to `setAttr(attr, "")`.
|
|
@@ -128,10 +169,18 @@ export declare class Subgraph {
|
|
|
128
169
|
*
|
|
129
170
|
* When `attr` is a known node attribute the value type is inferred
|
|
130
171
|
* automatically. A generic `string | number | boolean` fallback is
|
|
131
|
-
* provided for custom attributes.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
172
|
+
* provided for custom attributes. Omit `value` to reset the attribute to
|
|
173
|
+
* Graphviz's default empty value. `defaultValue` is passed to Graphviz as
|
|
174
|
+
* the default for this attribute if it has not already been declared.
|
|
175
|
+
*/
|
|
176
|
+
setNodeAttr<K extends NodeDotAttr>(node: string, attr: K, value?: NonNullable<NodeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
177
|
+
setNodeAttr(node: string, attr: string, value?: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
178
|
+
setNodeHtmlAttr<K extends NodeDotAttr>(node: string, attr: K, value: NonNullable<NodeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
179
|
+
setNodeHtmlAttr(node: string, attr: string, value: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
180
|
+
setDefaultNodeAttr<K extends NodeDotAttr>(attr: K, value: NonNullable<NodeAttrs[K]>): this;
|
|
181
|
+
setDefaultNodeAttr(attr: string, value: string | number | boolean): this;
|
|
182
|
+
setDefaultNodeHtmlAttr<K extends NodeDotAttr>(attr: K, value: NonNullable<NodeAttrs[K]>): this;
|
|
183
|
+
setDefaultNodeHtmlAttr(attr: string, value: string | number | boolean): this;
|
|
135
184
|
/**
|
|
136
185
|
* Clear a node attribute inside this subgraph by resetting it to its
|
|
137
186
|
* default (empty) value. Equivalent to `setNodeAttr(node, attr, "")`.
|
|
@@ -143,10 +192,18 @@ export declare class Subgraph {
|
|
|
143
192
|
*
|
|
144
193
|
* When `attr` is a known edge attribute the value type is inferred
|
|
145
194
|
* automatically. A generic `string | number | boolean` fallback is
|
|
146
|
-
* provided for custom attributes.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
195
|
+
* provided for custom attributes. Omit `value` to reset the attribute to
|
|
196
|
+
* Graphviz's default empty value. `defaultValue` is passed to Graphviz as
|
|
197
|
+
* the default for this attribute if it has not already been declared.
|
|
198
|
+
*/
|
|
199
|
+
setEdgeAttr<K extends EdgeDotAttr>(tail: string, head: string, key: string, attr: K, value?: NonNullable<EdgeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
200
|
+
setEdgeAttr(tail: string, head: string, key: string, attr: string, value?: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
201
|
+
setEdgeHtmlAttr<K extends EdgeDotAttr>(tail: string, head: string, key: string, attr: K, value: NonNullable<EdgeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
202
|
+
setEdgeHtmlAttr(tail: string, head: string, key: string, attr: string, value: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
203
|
+
setDefaultEdgeAttr<K extends EdgeDotAttr>(attr: K, value: NonNullable<EdgeAttrs[K]>): this;
|
|
204
|
+
setDefaultEdgeAttr(attr: string, value: string | number | boolean): this;
|
|
205
|
+
setDefaultEdgeHtmlAttr<K extends EdgeDotAttr>(attr: K, value: NonNullable<EdgeAttrs[K]>): this;
|
|
206
|
+
setDefaultEdgeHtmlAttr(attr: string, value: string | number | boolean): this;
|
|
150
207
|
/**
|
|
151
208
|
* Clear an edge attribute inside this subgraph by resetting it to its
|
|
152
209
|
* default (empty) value. Equivalent to `setEdgeAttr(tail, head, key, attr, "")`.
|
|
@@ -166,6 +223,8 @@ export declare class Subgraph {
|
|
|
166
223
|
nodeCount(): number;
|
|
167
224
|
/** Returns the number of edges in this subgraph. */
|
|
168
225
|
edgeCount(): number;
|
|
226
|
+
/** Returns the degree of a named node in this subgraph. */
|
|
227
|
+
nodeDegree(node: string, inDegree?: number, outDegree?: number): number;
|
|
169
228
|
/**
|
|
170
229
|
* Returns the current value of a subgraph-level attribute, or `""` if
|
|
171
230
|
* the attribute has not been set.
|
|
@@ -249,6 +308,7 @@ export declare class Graph {
|
|
|
249
308
|
* unchanged.
|
|
250
309
|
*/
|
|
251
310
|
addNode(name: string): this;
|
|
311
|
+
addNode(init: NodeInit): this;
|
|
252
312
|
/**
|
|
253
313
|
* Create an edge from `tail` to `head`. Both nodes are created
|
|
254
314
|
* automatically if they do not already exist. `key` distinguishes
|
|
@@ -256,25 +316,51 @@ export declare class Graph {
|
|
|
256
316
|
* an anonymous edge.
|
|
257
317
|
*/
|
|
258
318
|
addEdge(tail: string, head: string, key?: string): this;
|
|
319
|
+
addEdge(init: EdgeInit): this;
|
|
320
|
+
applyInit(init: GraphInit): this;
|
|
321
|
+
/**
|
|
322
|
+
* Replace this graph with one parsed from DOT source using Graphviz cgraph
|
|
323
|
+
* reading support.
|
|
324
|
+
*/
|
|
325
|
+
read(dotSource: string): this;
|
|
259
326
|
/**
|
|
260
327
|
* Set a graph-level attribute (e.g. `"rankdir"`, `"label"`, `"bgcolor"`).
|
|
328
|
+
* See the official Graphviz [attribute reference](https://graphviz.org/docs/attrs/)
|
|
329
|
+
* for supported attributes and values.
|
|
261
330
|
*
|
|
262
331
|
* When `attr` is a known graph attribute the value type is inferred
|
|
263
332
|
* automatically. A generic `string | number | boolean` fallback is
|
|
264
|
-
* provided for custom or less-common attributes.
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
333
|
+
* provided for custom or less-common attributes. Omit `value` to reset
|
|
334
|
+
* the attribute to Graphviz's default empty value. `defaultValue` is
|
|
335
|
+
* passed to Graphviz as the default for this attribute if it has not
|
|
336
|
+
* already been declared.
|
|
337
|
+
*/
|
|
338
|
+
setGraphAttr<K extends GraphDotAttr>(attr: K, value?: NonNullable<GraphAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
339
|
+
setGraphAttr(attr: string, value?: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
340
|
+
setGraphHtmlAttr<K extends GraphDotAttr>(attr: K, value: NonNullable<GraphAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
341
|
+
setGraphHtmlAttr(attr: string, value: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
342
|
+
setDefaultGraphAttr<K extends GraphDotAttr>(attr: K, value: NonNullable<GraphAttrs[K]>): this;
|
|
343
|
+
setDefaultGraphAttr(attr: string, value: string | number | boolean): this;
|
|
344
|
+
setDefaultGraphHtmlAttr<K extends GraphDotAttr>(attr: K, value: NonNullable<GraphAttrs[K]>): this;
|
|
345
|
+
setDefaultGraphHtmlAttr(attr: string, value: string | number | boolean): this;
|
|
268
346
|
/**
|
|
269
347
|
* Set an attribute on a named node (e.g. `"color"`, `"label"`, `"shape"`).
|
|
270
348
|
* The node must exist; call {@link addNode} first if needed.
|
|
271
349
|
*
|
|
272
350
|
* When `attr` is a known node attribute the value type is inferred
|
|
273
351
|
* automatically. A generic `string | number | boolean` fallback is
|
|
274
|
-
* provided for custom attributes.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
352
|
+
* provided for custom attributes. Omit `value` to reset the attribute to
|
|
353
|
+
* Graphviz's default empty value. `defaultValue` is passed to Graphviz as
|
|
354
|
+
* the default for this attribute if it has not already been declared.
|
|
355
|
+
*/
|
|
356
|
+
setNodeAttr<K extends NodeDotAttr>(node: string, attr: K, value?: NonNullable<NodeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
357
|
+
setNodeAttr(node: string, attr: string, value?: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
358
|
+
setNodeHtmlAttr<K extends NodeDotAttr>(node: string, attr: K, value: NonNullable<NodeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
359
|
+
setNodeHtmlAttr(node: string, attr: string, value: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
360
|
+
setDefaultNodeAttr<K extends NodeDotAttr>(attr: K, value: NonNullable<NodeAttrs[K]>): this;
|
|
361
|
+
setDefaultNodeAttr(attr: string, value: string | number | boolean): this;
|
|
362
|
+
setDefaultNodeHtmlAttr<K extends NodeDotAttr>(attr: K, value: NonNullable<NodeAttrs[K]>): this;
|
|
363
|
+
setDefaultNodeHtmlAttr(attr: string, value: string | number | boolean): this;
|
|
278
364
|
/**
|
|
279
365
|
* Set an attribute on an edge identified by `(tail, head, key)`.
|
|
280
366
|
* Use the same `key` that was passed to {@link addEdge}; pass `""` for
|
|
@@ -282,10 +368,18 @@ export declare class Graph {
|
|
|
282
368
|
*
|
|
283
369
|
* When `attr` is a known edge attribute the value type is inferred
|
|
284
370
|
* automatically. A generic `string | number | boolean` fallback is
|
|
285
|
-
* provided for custom attributes.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
371
|
+
* provided for custom attributes. Omit `value` to reset the attribute to
|
|
372
|
+
* Graphviz's default empty value. `defaultValue` is passed to Graphviz as
|
|
373
|
+
* the default for this attribute if it has not already been declared.
|
|
374
|
+
*/
|
|
375
|
+
setEdgeAttr<K extends EdgeDotAttr>(tail: string, head: string, key: string, attr: K, value?: NonNullable<EdgeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
376
|
+
setEdgeAttr(tail: string, head: string, key: string, attr: string, value?: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
377
|
+
setEdgeHtmlAttr<K extends EdgeDotAttr>(tail: string, head: string, key: string, attr: K, value: NonNullable<EdgeAttrs[K]>, defaultValue?: string | number | boolean): this;
|
|
378
|
+
setEdgeHtmlAttr(tail: string, head: string, key: string, attr: string, value: string | number | boolean, defaultValue?: string | number | boolean): this;
|
|
379
|
+
setDefaultEdgeAttr<K extends EdgeDotAttr>(attr: K, value: NonNullable<EdgeAttrs[K]>): this;
|
|
380
|
+
setDefaultEdgeAttr(attr: string, value: string | number | boolean): this;
|
|
381
|
+
setDefaultEdgeHtmlAttr<K extends EdgeDotAttr>(attr: K, value: NonNullable<EdgeAttrs[K]>): this;
|
|
382
|
+
setDefaultEdgeHtmlAttr(attr: string, value: string | number | boolean): this;
|
|
289
383
|
/**
|
|
290
384
|
* Remove a node and all its edges from the graph. Removing from the root
|
|
291
385
|
* graph also removes the node from every subgraph.
|
|
@@ -339,6 +433,8 @@ export declare class Graph {
|
|
|
339
433
|
edgeCount(): number;
|
|
340
434
|
/** Returns the number of direct subgraphs of this graph. */
|
|
341
435
|
subgraphCount(): number;
|
|
436
|
+
/** Returns the degree of a named node in the graph. */
|
|
437
|
+
nodeDegree(node: string, inDegree?: number, outDegree?: number): number;
|
|
342
438
|
/**
|
|
343
439
|
* Returns the current value of a graph-level attribute, or `""` if the
|
|
344
440
|
* attribute has not been set.
|
|
@@ -398,6 +494,7 @@ export declare class Graph {
|
|
|
398
494
|
* ```
|
|
399
495
|
*/
|
|
400
496
|
addSubgraph(name: string): Subgraph;
|
|
497
|
+
addSubgraph(init: SubgraphInit): Subgraph;
|
|
401
498
|
/**
|
|
402
499
|
* Look up an existing subgraph by name without creating a new one.
|
|
403
500
|
* Returns a {@link Subgraph} wrapper if a subgraph with that name exists,
|
|
@@ -426,6 +523,10 @@ export declare class Graph {
|
|
|
426
523
|
* @returns The rendered output as a string.
|
|
427
524
|
*/
|
|
428
525
|
layout(outputFormat?: Format, layoutEngine?: Engine, options?: Options): string;
|
|
526
|
+
/**
|
|
527
|
+
* Serialise the graph to a DOT-language string.
|
|
528
|
+
*/
|
|
529
|
+
write(): string;
|
|
429
530
|
/**
|
|
430
531
|
* Serialise the graph to a DOT-language string.
|
|
431
532
|
*/
|
|
@@ -655,4 +756,12 @@ export declare class Graphviz {
|
|
|
655
756
|
* ```
|
|
656
757
|
*/
|
|
657
758
|
createGraph(name?: string, type?: GraphType): Graph;
|
|
759
|
+
createGraph(init: GraphInit): Graph;
|
|
760
|
+
/**
|
|
761
|
+
* Parse DOT source into a mutable {@link Graph}. The returned graph can
|
|
762
|
+
* be queried, modified, rendered directly, or serialised back to DOT with
|
|
763
|
+
* {@link Graph.toDot}.
|
|
764
|
+
*/
|
|
765
|
+
read(dotSource: string): Graph;
|
|
658
766
|
}
|
|
767
|
+
export {};
|
package/types/graphvizlib.d.ts
CHANGED
|
@@ -47,8 +47,15 @@ export interface CGraphviz extends ClassHandle {
|
|
|
47
47
|
set unflatten_out(value: EmbindString);
|
|
48
48
|
createFile(_0: EmbindString, _1: EmbindString): void;
|
|
49
49
|
layout(_0: EmbindString, _1: EmbindString, _2: EmbindString): string;
|
|
50
|
+
acyclic(_0: EmbindString): boolean;
|
|
51
|
+
acyclic(_0: EmbindString, _1: boolean): boolean;
|
|
50
52
|
acyclic(_0: EmbindString, _1: boolean, _2: boolean): boolean;
|
|
53
|
+
tred(_0: EmbindString): void;
|
|
54
|
+
tred(_0: EmbindString, _1: boolean): void;
|
|
51
55
|
tred(_0: EmbindString, _1: boolean, _2: boolean): void;
|
|
56
|
+
unflatten(_0: EmbindString): string;
|
|
57
|
+
unflatten(_0: EmbindString, _1: number): string;
|
|
58
|
+
unflatten(_0: EmbindString, _1: number, _2: boolean): string;
|
|
52
59
|
unflatten(_0: EmbindString, _1: number, _2: boolean, _3: number): string;
|
|
53
60
|
}
|
|
54
61
|
|
|
@@ -61,18 +68,40 @@ export interface CGraph extends ClassHandle {
|
|
|
61
68
|
edgeCount(): number;
|
|
62
69
|
subgraphCount(): number;
|
|
63
70
|
addNode(_0: EmbindString): void;
|
|
71
|
+
addEdge(_0: EmbindString, _1: EmbindString): void;
|
|
64
72
|
addEdge(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
65
73
|
setGraphAttr(_0: EmbindString, _1: EmbindString): void;
|
|
74
|
+
setGraphAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
75
|
+
setGraphHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
76
|
+
setGraphHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
66
77
|
setNodeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
78
|
+
setNodeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString): void;
|
|
79
|
+
setNodeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
80
|
+
setNodeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString): void;
|
|
67
81
|
setEdgeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString): void;
|
|
82
|
+
setEdgeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString, _5: EmbindString): void;
|
|
83
|
+
setEdgeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString): void;
|
|
84
|
+
setEdgeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString, _5: EmbindString): void;
|
|
85
|
+
setDefaultGraphAttr(_0: EmbindString, _1: EmbindString): void;
|
|
86
|
+
setDefaultGraphHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
87
|
+
setDefaultNodeAttr(_0: EmbindString, _1: EmbindString): void;
|
|
88
|
+
setDefaultNodeHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
89
|
+
setDefaultEdgeAttr(_0: EmbindString, _1: EmbindString): void;
|
|
90
|
+
setDefaultEdgeHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
91
|
+
read(_0: EmbindString): boolean;
|
|
68
92
|
addSubgraph(_0: EmbindString): CSubgraph | null;
|
|
69
93
|
getSubgraph(_0: EmbindString): CSubgraph | null;
|
|
70
94
|
removeNode(_0: EmbindString): void;
|
|
95
|
+
removeEdge(_0: EmbindString, _1: EmbindString): void;
|
|
71
96
|
removeEdge(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
72
97
|
removeSubgraph(_0: EmbindString): void;
|
|
73
98
|
hasNode(_0: EmbindString): boolean;
|
|
99
|
+
hasEdge(_0: EmbindString, _1: EmbindString): boolean;
|
|
74
100
|
hasEdge(_0: EmbindString, _1: EmbindString, _2: EmbindString): boolean;
|
|
75
101
|
hasSubgraph(_0: EmbindString): boolean;
|
|
102
|
+
nodeDegree(_0: EmbindString): number;
|
|
103
|
+
nodeDegree(_0: EmbindString, _1: number): number;
|
|
104
|
+
nodeDegree(_0: EmbindString, _1: number, _2: number): number;
|
|
76
105
|
getGraphAttr(_0: EmbindString): string;
|
|
77
106
|
getNodeAttr(_0: EmbindString, _1: EmbindString): string;
|
|
78
107
|
getEdgeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString): string;
|
|
@@ -82,6 +111,7 @@ export interface CGraph extends ClassHandle {
|
|
|
82
111
|
outEdges(_0: EmbindString): string;
|
|
83
112
|
inEdges(_0: EmbindString): string;
|
|
84
113
|
nodeEdges(_0: EmbindString): string;
|
|
114
|
+
write(): string;
|
|
85
115
|
toDot(): string;
|
|
86
116
|
layout(_0: EmbindString, _1: EmbindString): string;
|
|
87
117
|
}
|
|
@@ -90,14 +120,35 @@ export interface CSubgraph extends ClassHandle {
|
|
|
90
120
|
nodeCount(): number;
|
|
91
121
|
edgeCount(): number;
|
|
92
122
|
addNode(_0: EmbindString): void;
|
|
123
|
+
addEdge(_0: EmbindString, _1: EmbindString): void;
|
|
93
124
|
addEdge(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
94
125
|
setAttr(_0: EmbindString, _1: EmbindString): void;
|
|
126
|
+
setAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
127
|
+
setHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
128
|
+
setHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
95
129
|
setNodeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
130
|
+
setNodeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString): void;
|
|
131
|
+
setNodeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
132
|
+
setNodeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString): void;
|
|
96
133
|
setEdgeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString): void;
|
|
134
|
+
setEdgeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString, _5: EmbindString): void;
|
|
135
|
+
setEdgeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString): void;
|
|
136
|
+
setEdgeHtmlAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString, _4: EmbindString, _5: EmbindString): void;
|
|
137
|
+
setDefaultAttr(_0: EmbindString, _1: EmbindString): void;
|
|
138
|
+
setDefaultHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
139
|
+
setDefaultNodeAttr(_0: EmbindString, _1: EmbindString): void;
|
|
140
|
+
setDefaultNodeHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
141
|
+
setDefaultEdgeAttr(_0: EmbindString, _1: EmbindString): void;
|
|
142
|
+
setDefaultEdgeHtmlAttr(_0: EmbindString, _1: EmbindString): void;
|
|
97
143
|
removeNode(_0: EmbindString): void;
|
|
144
|
+
removeEdge(_0: EmbindString, _1: EmbindString): void;
|
|
98
145
|
removeEdge(_0: EmbindString, _1: EmbindString, _2: EmbindString): void;
|
|
99
146
|
hasNode(_0: EmbindString): boolean;
|
|
147
|
+
hasEdge(_0: EmbindString, _1: EmbindString): boolean;
|
|
100
148
|
hasEdge(_0: EmbindString, _1: EmbindString, _2: EmbindString): boolean;
|
|
149
|
+
nodeDegree(_0: EmbindString): number;
|
|
150
|
+
nodeDegree(_0: EmbindString, _1: number): number;
|
|
151
|
+
nodeDegree(_0: EmbindString, _1: number, _2: number): number;
|
|
101
152
|
getAttr(_0: EmbindString): string;
|
|
102
153
|
getNodeAttr(_0: EmbindString, _1: EmbindString): string;
|
|
103
154
|
getEdgeAttr(_0: EmbindString, _1: EmbindString, _2: EmbindString, _3: EmbindString): string;
|
|
@@ -111,6 +162,7 @@ export interface CSubgraph extends ClassHandle {
|
|
|
111
162
|
interface EmbindModule {
|
|
112
163
|
CGraphviz: {
|
|
113
164
|
new(): CGraphviz;
|
|
165
|
+
new(_0: number): CGraphviz;
|
|
114
166
|
new(_0: number, _1: number): CGraphviz;
|
|
115
167
|
version(): string;
|
|
116
168
|
lastError(): string;
|
package/types/types.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export interface NodeAttrs {
|
|
|
40
40
|
group?: string;
|
|
41
41
|
height?: number;
|
|
42
42
|
href?: string;
|
|
43
|
+
id?: string;
|
|
43
44
|
image?: string;
|
|
44
45
|
imagepos?: string;
|
|
45
46
|
imagescale?: boolean | string;
|
|
@@ -102,6 +103,7 @@ export interface EdgeAttrs {
|
|
|
102
103
|
headtooltip?: string;
|
|
103
104
|
headURL?: string;
|
|
104
105
|
href?: string;
|
|
106
|
+
id?: string;
|
|
105
107
|
label?: string;
|
|
106
108
|
labelangle?: number;
|
|
107
109
|
labeldistance?: number;
|
|
@@ -156,6 +158,7 @@ export interface ClusterAttrs {
|
|
|
156
158
|
fontsize?: number;
|
|
157
159
|
gradientangle?: number;
|
|
158
160
|
href?: string;
|
|
161
|
+
id?: string;
|
|
159
162
|
K?: number;
|
|
160
163
|
label?: string;
|
|
161
164
|
labeljust?: string;
|