@ts-graphviz/core 0.0.0-next-20240301111950
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/CHANGELOG.md +301 -0
- package/LICENSE +22 -0
- package/README.md +47 -0
- package/lib/AttributeList.cjs +14 -0
- package/lib/AttributeList.d.ts +43 -0
- package/lib/AttributeList.js +14 -0
- package/lib/AttributesBase.cjs +40 -0
- package/lib/AttributesBase.d.ts +30 -0
- package/lib/AttributesBase.js +40 -0
- package/lib/AttributesGroup.cjs +7 -0
- package/lib/AttributesGroup.d.ts +39 -0
- package/lib/AttributesGroup.js +7 -0
- package/lib/Digraph.cjs +9 -0
- package/lib/Digraph.d.ts +107 -0
- package/lib/Digraph.js +9 -0
- package/lib/DotObject.cjs +5 -0
- package/lib/DotObject.d.ts +8 -0
- package/lib/DotObject.js +5 -0
- package/lib/Edge.cjs +23 -0
- package/lib/Edge.d.ts +26 -0
- package/lib/Edge.js +23 -0
- package/lib/Graph.cjs +9 -0
- package/lib/Graph.d.ts +107 -0
- package/lib/Graph.js +9 -0
- package/lib/GraphBase.cjs +152 -0
- package/lib/GraphBase.d.ts +81 -0
- package/lib/GraphBase.js +152 -0
- package/lib/Node.cjs +23 -0
- package/lib/Node.d.ts +64 -0
- package/lib/Node.js +23 -0
- package/lib/RootGraph.cjs +22 -0
- package/lib/RootGraph.d.ts +99 -0
- package/lib/RootGraph.js +22 -0
- package/lib/Subgraph.cjs +26 -0
- package/lib/Subgraph.d.ts +95 -0
- package/lib/Subgraph.js +26 -0
- package/lib/core.cjs +26 -0
- package/lib/core.d.ts +590 -0
- package/lib/core.js +26 -0
- package/lib/register-default.cjs +18 -0
- package/lib/register-default.d.ts +3 -0
- package/lib/register-default.js +18 -0
- package/package.json +76 -0
package/lib/core.d.ts
ADDED
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { Attribute } from '@ts-graphviz/common';
|
|
2
|
+
import { AttributeKey } from '@ts-graphviz/common';
|
|
3
|
+
import { AttributeListKind } from '@ts-graphviz/common';
|
|
4
|
+
import { AttributeListModel } from '@ts-graphviz/common';
|
|
5
|
+
import { Attributes } from '@ts-graphviz/common';
|
|
6
|
+
import { AttributesEntities } from '@ts-graphviz/common';
|
|
7
|
+
import { AttributesGroupModel } from '@ts-graphviz/common';
|
|
8
|
+
import { AttributesObject } from '@ts-graphviz/common';
|
|
9
|
+
import { ClusterSubgraphAttributeKey } from '@ts-graphviz/common';
|
|
10
|
+
import { EdgeAttributeKey } from '@ts-graphviz/common';
|
|
11
|
+
import { EdgeAttributesObject } from '@ts-graphviz/common';
|
|
12
|
+
import { EdgeModel } from '@ts-graphviz/common';
|
|
13
|
+
import { EdgeTargetLikeTuple } from '@ts-graphviz/common';
|
|
14
|
+
import { EdgeTargetTuple } from '@ts-graphviz/common';
|
|
15
|
+
import { ForwardRefNode } from '@ts-graphviz/common';
|
|
16
|
+
import { GraphAttributeKey } from '@ts-graphviz/common';
|
|
17
|
+
import { GraphAttributesObject } from '@ts-graphviz/common';
|
|
18
|
+
import { GraphBaseModel } from '@ts-graphviz/common';
|
|
19
|
+
import { GraphCommonAttributes } from '@ts-graphviz/common';
|
|
20
|
+
import { ModelsContext } from '@ts-graphviz/common';
|
|
21
|
+
import { NodeAttributeKey } from '@ts-graphviz/common';
|
|
22
|
+
import { NodeAttributesObject } from '@ts-graphviz/common';
|
|
23
|
+
import { NodeModel } from '@ts-graphviz/common';
|
|
24
|
+
import { Port } from '@ts-graphviz/common';
|
|
25
|
+
import { RootGraphModel } from '@ts-graphviz/common';
|
|
26
|
+
import { SubgraphAttributeKey } from '@ts-graphviz/common';
|
|
27
|
+
import { SubgraphAttributesObject } from '@ts-graphviz/common';
|
|
28
|
+
import { SubgraphModel } from '@ts-graphviz/common';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A set of attribute values for any object.
|
|
32
|
+
* @group Models
|
|
33
|
+
*/
|
|
34
|
+
export declare class AttributeList<K extends AttributeListKind, T extends AttributeKey = AttributeKey> extends AttributesBase_2<T> implements AttributeListModel<K, T> {
|
|
35
|
+
readonly $$kind: K;
|
|
36
|
+
get $$type(): 'AttributeList';
|
|
37
|
+
comment?: string;
|
|
38
|
+
constructor($$kind: K, attributes?: AttributesObject<T>);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Base class for DOT objects with attributes.
|
|
43
|
+
* @group Models
|
|
44
|
+
*/
|
|
45
|
+
export declare abstract class AttributesBase<T extends AttributeKey> extends DotObject_3 implements Attributes<T> {
|
|
46
|
+
#private;
|
|
47
|
+
constructor(attributes?: AttributesObject<T>);
|
|
48
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
49
|
+
get size(): number;
|
|
50
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
51
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
52
|
+
delete(key: T): void;
|
|
53
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
54
|
+
clear(): void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Base class for DOT objects with attributes.
|
|
59
|
+
* @group Models
|
|
60
|
+
*/
|
|
61
|
+
declare abstract class AttributesBase_2<T extends AttributeKey> extends DotObject_2 implements Attributes<T> {
|
|
62
|
+
#private;
|
|
63
|
+
constructor(attributes?: AttributesObject<T>);
|
|
64
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
65
|
+
get size(): number;
|
|
66
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
67
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
68
|
+
delete(key: T): void;
|
|
69
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
70
|
+
clear(): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Base class for DOT objects with attributes.
|
|
75
|
+
* @group Models
|
|
76
|
+
*/
|
|
77
|
+
declare abstract class AttributesBase_3<T extends AttributeKey> extends DotObject_4 implements Attributes<T> {
|
|
78
|
+
#private;
|
|
79
|
+
constructor(attributes?: AttributesObject<T>);
|
|
80
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
81
|
+
get size(): number;
|
|
82
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
83
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
84
|
+
delete(key: T): void;
|
|
85
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
86
|
+
clear(): void;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Base class for DOT objects with attributes.
|
|
91
|
+
* @group Models
|
|
92
|
+
*/
|
|
93
|
+
declare abstract class AttributesBase_4<T extends AttributeKey> extends DotObject_5 implements Attributes<T> {
|
|
94
|
+
#private;
|
|
95
|
+
constructor(attributes?: AttributesObject<T>);
|
|
96
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
97
|
+
get size(): number;
|
|
98
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
99
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
100
|
+
delete(key: T): void;
|
|
101
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
102
|
+
clear(): void;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Base class for DOT objects with attributes.
|
|
107
|
+
* @group Models
|
|
108
|
+
*/
|
|
109
|
+
declare abstract class AttributesBase_5<T extends AttributeKey> extends DotObject_7 implements Attributes<T> {
|
|
110
|
+
#private;
|
|
111
|
+
constructor(attributes?: AttributesObject<T>);
|
|
112
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
113
|
+
get size(): number;
|
|
114
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
115
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
116
|
+
delete(key: T): void;
|
|
117
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
118
|
+
clear(): void;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Base class for DOT objects with attributes.
|
|
123
|
+
* @group Models
|
|
124
|
+
*/
|
|
125
|
+
declare abstract class AttributesBase_6<T extends AttributeKey> extends DotObject_8 implements Attributes<T> {
|
|
126
|
+
#private;
|
|
127
|
+
constructor(attributes?: AttributesObject<T>);
|
|
128
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
129
|
+
get size(): number;
|
|
130
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
131
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
132
|
+
delete(key: T): void;
|
|
133
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
134
|
+
clear(): void;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Base class for DOT objects with attributes.
|
|
139
|
+
* @group Models
|
|
140
|
+
*/
|
|
141
|
+
declare abstract class AttributesBase_7<T extends AttributeKey> extends DotObject_2_2 implements Attributes<T> {
|
|
142
|
+
#private;
|
|
143
|
+
constructor(attributes?: AttributesObject<T>);
|
|
144
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
145
|
+
get size(): number;
|
|
146
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
147
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
148
|
+
delete(key: T): void;
|
|
149
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
150
|
+
clear(): void;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Base class for DOT objects with attributes.
|
|
155
|
+
* @group Models
|
|
156
|
+
*/
|
|
157
|
+
declare abstract class AttributesBase_8<T extends AttributeKey> extends DotObject_10 implements Attributes<T> {
|
|
158
|
+
#private;
|
|
159
|
+
constructor(attributes?: AttributesObject<T>);
|
|
160
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
161
|
+
get size(): number;
|
|
162
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
163
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
164
|
+
delete(key: T): void;
|
|
165
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
166
|
+
clear(): void;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Base class for DOT objects with attributes.
|
|
171
|
+
* @group Models
|
|
172
|
+
*/
|
|
173
|
+
declare abstract class AttributesBase_9<T extends AttributeKey> extends DotObject_11 implements Attributes<T> {
|
|
174
|
+
#private;
|
|
175
|
+
constructor(attributes?: AttributesObject<T>);
|
|
176
|
+
get values(): ReadonlyArray<[T, Attribute<T>]>;
|
|
177
|
+
get size(): number;
|
|
178
|
+
get<K extends T>(key: K): Attribute<K> | undefined;
|
|
179
|
+
set<K extends T>(key: K, value: Attribute<K>): void;
|
|
180
|
+
delete(key: T): void;
|
|
181
|
+
apply(attributes: AttributesObject<T> | AttributesEntities<T>): void;
|
|
182
|
+
clear(): void;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* A set of attribute values for any object.
|
|
187
|
+
* @group Models
|
|
188
|
+
*/
|
|
189
|
+
export declare class AttributesGroup<T extends AttributeKey = AttributeKey> extends AttributesBase_3<T> implements AttributesGroupModel<T> {
|
|
190
|
+
comment?: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* A set of attribute values for any object.
|
|
195
|
+
* @group Models
|
|
196
|
+
*/
|
|
197
|
+
declare class AttributesGroup_2<T extends AttributeKey = AttributeKey> extends AttributesBase_7<T> implements AttributesGroupModel<T> {
|
|
198
|
+
comment?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* DOT object class representing a digraph.
|
|
203
|
+
* @group Models
|
|
204
|
+
*/
|
|
205
|
+
export declare class Digraph extends RootGraph_2 {
|
|
206
|
+
get directed(): boolean;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Base class for DOT objects.
|
|
211
|
+
* @group Models
|
|
212
|
+
*/
|
|
213
|
+
export declare abstract class DotObject {
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Base class for DOT objects.
|
|
218
|
+
* @group Models
|
|
219
|
+
*/
|
|
220
|
+
declare abstract class DotObject_10 {
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Base class for DOT objects.
|
|
225
|
+
* @group Models
|
|
226
|
+
*/
|
|
227
|
+
declare abstract class DotObject_11 {
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Base class for DOT objects.
|
|
232
|
+
* @group Models
|
|
233
|
+
*/
|
|
234
|
+
declare abstract class DotObject_2 {
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Base class for DOT objects.
|
|
239
|
+
* @group Models
|
|
240
|
+
*/
|
|
241
|
+
declare abstract class DotObject_2_2 {
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Base class for DOT objects.
|
|
246
|
+
* @group Models
|
|
247
|
+
*/
|
|
248
|
+
declare abstract class DotObject_3 {
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Base class for DOT objects.
|
|
253
|
+
* @group Models
|
|
254
|
+
*/
|
|
255
|
+
declare abstract class DotObject_4 {
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Base class for DOT objects.
|
|
260
|
+
* @group Models
|
|
261
|
+
*/
|
|
262
|
+
declare abstract class DotObject_5 {
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Base class for DOT objects.
|
|
267
|
+
* @group Models
|
|
268
|
+
*/
|
|
269
|
+
declare abstract class DotObject_6 {
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Base class for DOT objects.
|
|
274
|
+
* @group Models
|
|
275
|
+
*/
|
|
276
|
+
declare abstract class DotObject_7 {
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Base class for DOT objects.
|
|
281
|
+
* @group Models
|
|
282
|
+
*/
|
|
283
|
+
declare abstract class DotObject_8 {
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Base class for DOT objects.
|
|
288
|
+
* @group Models
|
|
289
|
+
*/
|
|
290
|
+
declare abstract class DotObject_9 {
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* DOT object class representing a edge.
|
|
295
|
+
* @group Models
|
|
296
|
+
*/
|
|
297
|
+
export declare class Edge extends DotObject_6 implements EdgeModel {
|
|
298
|
+
readonly targets: EdgeTargetTuple;
|
|
299
|
+
get $$type(): 'Edge';
|
|
300
|
+
comment?: string;
|
|
301
|
+
readonly attributes: AttributesGroupModel<EdgeAttributeKey>;
|
|
302
|
+
constructor(targets: EdgeTargetTuple, attributes?: EdgeAttributesObject);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* DOT object class representing a graph.
|
|
307
|
+
* @group Models
|
|
308
|
+
*/
|
|
309
|
+
export declare class Graph extends RootGraph_3 {
|
|
310
|
+
get directed(): boolean;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Base class for Graph objects.
|
|
315
|
+
* @group Models
|
|
316
|
+
*/
|
|
317
|
+
export declare abstract class GraphBase<T extends AttributeKey> extends AttributesBase_6<T> implements GraphBaseModel<T> {
|
|
318
|
+
#private;
|
|
319
|
+
readonly id?: string;
|
|
320
|
+
comment?: string;
|
|
321
|
+
readonly attributes: Readonly<GraphCommonAttributes>;
|
|
322
|
+
get nodes(): ReadonlyArray<NodeModel>;
|
|
323
|
+
get edges(): ReadonlyArray<EdgeModel>;
|
|
324
|
+
get subgraphs(): ReadonlyArray<SubgraphModel>;
|
|
325
|
+
with(models: Partial<ModelsContext>): void;
|
|
326
|
+
addNode(node: NodeModel): void;
|
|
327
|
+
addEdge(edge: EdgeModel): void;
|
|
328
|
+
addSubgraph(subgraph: SubgraphModel): void;
|
|
329
|
+
existNode(nodeId: string): boolean;
|
|
330
|
+
existEdge(edge: EdgeModel): boolean;
|
|
331
|
+
existSubgraph(subgraph: SubgraphModel): boolean;
|
|
332
|
+
createSubgraph(id?: string, attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
333
|
+
createSubgraph(attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
334
|
+
removeNode(node: NodeModel | string): void;
|
|
335
|
+
removeEdge(edge: EdgeModel): void;
|
|
336
|
+
removeSubgraph(subgraph: SubgraphModel): void;
|
|
337
|
+
createNode(id: string, attributes?: NodeAttributesObject): NodeModel;
|
|
338
|
+
getSubgraph(id: string): SubgraphModel | undefined;
|
|
339
|
+
getNode(id: string): NodeModel | undefined;
|
|
340
|
+
createEdge(targets: EdgeTargetLikeTuple, attributes?: EdgeAttributesObject): EdgeModel;
|
|
341
|
+
subgraph(id: string, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
342
|
+
subgraph(id: string, attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
343
|
+
subgraph(attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
344
|
+
subgraph(callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
345
|
+
node(id: string, callback?: (node: NodeModel) => void): NodeModel;
|
|
346
|
+
node(id: string, attributes: NodeAttributesObject, callback?: (node: NodeModel) => void): NodeModel;
|
|
347
|
+
node(attributes: NodeAttributesObject): void;
|
|
348
|
+
edge(targets: EdgeTargetLikeTuple, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
349
|
+
edge(targets: EdgeTargetLikeTuple, attributes: EdgeAttributesObject, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
350
|
+
edge(attributes: EdgeAttributesObject): void;
|
|
351
|
+
graph(attributes: SubgraphAttributesObject): void;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Base class for Graph objects.
|
|
356
|
+
* @group Models
|
|
357
|
+
*/
|
|
358
|
+
declare abstract class GraphBase_2<T extends AttributeKey> extends AttributesBase_4<T> implements GraphBaseModel<T> {
|
|
359
|
+
#private;
|
|
360
|
+
readonly id?: string;
|
|
361
|
+
comment?: string;
|
|
362
|
+
readonly attributes: Readonly<GraphCommonAttributes>;
|
|
363
|
+
get nodes(): ReadonlyArray<NodeModel>;
|
|
364
|
+
get edges(): ReadonlyArray<EdgeModel>;
|
|
365
|
+
get subgraphs(): ReadonlyArray<SubgraphModel>;
|
|
366
|
+
with(models: Partial<ModelsContext>): void;
|
|
367
|
+
addNode(node: NodeModel): void;
|
|
368
|
+
addEdge(edge: EdgeModel): void;
|
|
369
|
+
addSubgraph(subgraph: SubgraphModel): void;
|
|
370
|
+
existNode(nodeId: string): boolean;
|
|
371
|
+
existEdge(edge: EdgeModel): boolean;
|
|
372
|
+
existSubgraph(subgraph: SubgraphModel): boolean;
|
|
373
|
+
createSubgraph(id?: string, attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
374
|
+
createSubgraph(attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
375
|
+
removeNode(node: NodeModel | string): void;
|
|
376
|
+
removeEdge(edge: EdgeModel): void;
|
|
377
|
+
removeSubgraph(subgraph: SubgraphModel): void;
|
|
378
|
+
createNode(id: string, attributes?: NodeAttributesObject): NodeModel;
|
|
379
|
+
getSubgraph(id: string): SubgraphModel | undefined;
|
|
380
|
+
getNode(id: string): NodeModel | undefined;
|
|
381
|
+
createEdge(targets: EdgeTargetLikeTuple, attributes?: EdgeAttributesObject): EdgeModel;
|
|
382
|
+
subgraph(id: string, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
383
|
+
subgraph(id: string, attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
384
|
+
subgraph(attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
385
|
+
subgraph(callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
386
|
+
node(id: string, callback?: (node: NodeModel) => void): NodeModel;
|
|
387
|
+
node(id: string, attributes: NodeAttributesObject, callback?: (node: NodeModel) => void): NodeModel;
|
|
388
|
+
node(attributes: NodeAttributesObject): void;
|
|
389
|
+
edge(targets: EdgeTargetLikeTuple, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
390
|
+
edge(targets: EdgeTargetLikeTuple, attributes: EdgeAttributesObject, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
391
|
+
edge(attributes: EdgeAttributesObject): void;
|
|
392
|
+
graph(attributes: SubgraphAttributesObject): void;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Base class for Graph objects.
|
|
397
|
+
* @group Models
|
|
398
|
+
*/
|
|
399
|
+
declare abstract class GraphBase_3<T extends AttributeKey> extends AttributesBase_5<T> implements GraphBaseModel<T> {
|
|
400
|
+
#private;
|
|
401
|
+
readonly id?: string;
|
|
402
|
+
comment?: string;
|
|
403
|
+
readonly attributes: Readonly<GraphCommonAttributes>;
|
|
404
|
+
get nodes(): ReadonlyArray<NodeModel>;
|
|
405
|
+
get edges(): ReadonlyArray<EdgeModel>;
|
|
406
|
+
get subgraphs(): ReadonlyArray<SubgraphModel>;
|
|
407
|
+
with(models: Partial<ModelsContext>): void;
|
|
408
|
+
addNode(node: NodeModel): void;
|
|
409
|
+
addEdge(edge: EdgeModel): void;
|
|
410
|
+
addSubgraph(subgraph: SubgraphModel): void;
|
|
411
|
+
existNode(nodeId: string): boolean;
|
|
412
|
+
existEdge(edge: EdgeModel): boolean;
|
|
413
|
+
existSubgraph(subgraph: SubgraphModel): boolean;
|
|
414
|
+
createSubgraph(id?: string, attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
415
|
+
createSubgraph(attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
416
|
+
removeNode(node: NodeModel | string): void;
|
|
417
|
+
removeEdge(edge: EdgeModel): void;
|
|
418
|
+
removeSubgraph(subgraph: SubgraphModel): void;
|
|
419
|
+
createNode(id: string, attributes?: NodeAttributesObject): NodeModel;
|
|
420
|
+
getSubgraph(id: string): SubgraphModel | undefined;
|
|
421
|
+
getNode(id: string): NodeModel | undefined;
|
|
422
|
+
createEdge(targets: EdgeTargetLikeTuple, attributes?: EdgeAttributesObject): EdgeModel;
|
|
423
|
+
subgraph(id: string, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
424
|
+
subgraph(id: string, attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
425
|
+
subgraph(attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
426
|
+
subgraph(callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
427
|
+
node(id: string, callback?: (node: NodeModel) => void): NodeModel;
|
|
428
|
+
node(id: string, attributes: NodeAttributesObject, callback?: (node: NodeModel) => void): NodeModel;
|
|
429
|
+
node(attributes: NodeAttributesObject): void;
|
|
430
|
+
edge(targets: EdgeTargetLikeTuple, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
431
|
+
edge(targets: EdgeTargetLikeTuple, attributes: EdgeAttributesObject, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
432
|
+
edge(attributes: EdgeAttributesObject): void;
|
|
433
|
+
graph(attributes: SubgraphAttributesObject): void;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Base class for Graph objects.
|
|
438
|
+
* @group Models
|
|
439
|
+
*/
|
|
440
|
+
declare abstract class GraphBase_4<T extends AttributeKey> extends AttributesBase_8<T> implements GraphBaseModel<T> {
|
|
441
|
+
#private;
|
|
442
|
+
readonly id?: string;
|
|
443
|
+
comment?: string;
|
|
444
|
+
readonly attributes: Readonly<GraphCommonAttributes>;
|
|
445
|
+
get nodes(): ReadonlyArray<NodeModel>;
|
|
446
|
+
get edges(): ReadonlyArray<EdgeModel>;
|
|
447
|
+
get subgraphs(): ReadonlyArray<SubgraphModel>;
|
|
448
|
+
with(models: Partial<ModelsContext>): void;
|
|
449
|
+
addNode(node: NodeModel): void;
|
|
450
|
+
addEdge(edge: EdgeModel): void;
|
|
451
|
+
addSubgraph(subgraph: SubgraphModel): void;
|
|
452
|
+
existNode(nodeId: string): boolean;
|
|
453
|
+
existEdge(edge: EdgeModel): boolean;
|
|
454
|
+
existSubgraph(subgraph: SubgraphModel): boolean;
|
|
455
|
+
createSubgraph(id?: string, attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
456
|
+
createSubgraph(attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
457
|
+
removeNode(node: NodeModel | string): void;
|
|
458
|
+
removeEdge(edge: EdgeModel): void;
|
|
459
|
+
removeSubgraph(subgraph: SubgraphModel): void;
|
|
460
|
+
createNode(id: string, attributes?: NodeAttributesObject): NodeModel;
|
|
461
|
+
getSubgraph(id: string): SubgraphModel | undefined;
|
|
462
|
+
getNode(id: string): NodeModel | undefined;
|
|
463
|
+
createEdge(targets: EdgeTargetLikeTuple, attributes?: EdgeAttributesObject): EdgeModel;
|
|
464
|
+
subgraph(id: string, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
465
|
+
subgraph(id: string, attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
466
|
+
subgraph(attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
467
|
+
subgraph(callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
468
|
+
node(id: string, callback?: (node: NodeModel) => void): NodeModel;
|
|
469
|
+
node(id: string, attributes: NodeAttributesObject, callback?: (node: NodeModel) => void): NodeModel;
|
|
470
|
+
node(attributes: NodeAttributesObject): void;
|
|
471
|
+
edge(targets: EdgeTargetLikeTuple, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
472
|
+
edge(targets: EdgeTargetLikeTuple, attributes: EdgeAttributesObject, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
473
|
+
edge(attributes: EdgeAttributesObject): void;
|
|
474
|
+
graph(attributes: SubgraphAttributesObject): void;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Base class for Graph objects.
|
|
479
|
+
* @group Models
|
|
480
|
+
*/
|
|
481
|
+
declare abstract class GraphBase_5<T extends AttributeKey> extends AttributesBase_9<T> implements GraphBaseModel<T> {
|
|
482
|
+
#private;
|
|
483
|
+
readonly id?: string;
|
|
484
|
+
comment?: string;
|
|
485
|
+
readonly attributes: Readonly<GraphCommonAttributes>;
|
|
486
|
+
get nodes(): ReadonlyArray<NodeModel>;
|
|
487
|
+
get edges(): ReadonlyArray<EdgeModel>;
|
|
488
|
+
get subgraphs(): ReadonlyArray<SubgraphModel>;
|
|
489
|
+
with(models: Partial<ModelsContext>): void;
|
|
490
|
+
addNode(node: NodeModel): void;
|
|
491
|
+
addEdge(edge: EdgeModel): void;
|
|
492
|
+
addSubgraph(subgraph: SubgraphModel): void;
|
|
493
|
+
existNode(nodeId: string): boolean;
|
|
494
|
+
existEdge(edge: EdgeModel): boolean;
|
|
495
|
+
existSubgraph(subgraph: SubgraphModel): boolean;
|
|
496
|
+
createSubgraph(id?: string, attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
497
|
+
createSubgraph(attributes?: SubgraphAttributesObject): SubgraphModel;
|
|
498
|
+
removeNode(node: NodeModel | string): void;
|
|
499
|
+
removeEdge(edge: EdgeModel): void;
|
|
500
|
+
removeSubgraph(subgraph: SubgraphModel): void;
|
|
501
|
+
createNode(id: string, attributes?: NodeAttributesObject): NodeModel;
|
|
502
|
+
getSubgraph(id: string): SubgraphModel | undefined;
|
|
503
|
+
getNode(id: string): NodeModel | undefined;
|
|
504
|
+
createEdge(targets: EdgeTargetLikeTuple, attributes?: EdgeAttributesObject): EdgeModel;
|
|
505
|
+
subgraph(id: string, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
506
|
+
subgraph(id: string, attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
507
|
+
subgraph(attributes: SubgraphAttributesObject, callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
508
|
+
subgraph(callback?: (subgraph: SubgraphModel) => void): SubgraphModel;
|
|
509
|
+
node(id: string, callback?: (node: NodeModel) => void): NodeModel;
|
|
510
|
+
node(id: string, attributes: NodeAttributesObject, callback?: (node: NodeModel) => void): NodeModel;
|
|
511
|
+
node(attributes: NodeAttributesObject): void;
|
|
512
|
+
edge(targets: EdgeTargetLikeTuple, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
513
|
+
edge(targets: EdgeTargetLikeTuple, attributes: EdgeAttributesObject, callback?: (edge: EdgeModel) => void): EdgeModel;
|
|
514
|
+
edge(attributes: EdgeAttributesObject): void;
|
|
515
|
+
graph(attributes: SubgraphAttributesObject): void;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* DOT object class representing a node.
|
|
520
|
+
* @group Models
|
|
521
|
+
*/
|
|
522
|
+
export declare class Node extends DotObject_9 implements NodeModel {
|
|
523
|
+
readonly id: string;
|
|
524
|
+
get $$type(): 'Node';
|
|
525
|
+
comment?: string;
|
|
526
|
+
readonly attributes: AttributesGroup_2<NodeAttributeKey>;
|
|
527
|
+
constructor(id: string, attributes?: NodeAttributesObject);
|
|
528
|
+
port(port: string | Partial<Port>): ForwardRefNode;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export declare function registerDefault(): void;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Base class representing a root graph(digraph, graph).
|
|
535
|
+
* @group Models
|
|
536
|
+
*/
|
|
537
|
+
export declare abstract class RootGraph extends GraphBase_4<GraphAttributeKey> implements RootGraphModel {
|
|
538
|
+
get $$type(): 'Graph';
|
|
539
|
+
readonly id?: string;
|
|
540
|
+
abstract readonly directed: boolean;
|
|
541
|
+
strict: boolean;
|
|
542
|
+
constructor(id?: string, attributes?: GraphAttributesObject);
|
|
543
|
+
constructor(id?: string, strict?: boolean, attributes?: GraphAttributesObject);
|
|
544
|
+
constructor(strict?: boolean, attributes?: GraphAttributesObject);
|
|
545
|
+
constructor(attributes?: GraphAttributesObject);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Base class representing a root graph(digraph, graph).
|
|
550
|
+
* @group Models
|
|
551
|
+
*/
|
|
552
|
+
declare abstract class RootGraph_2 extends GraphBase_2<GraphAttributeKey> implements RootGraphModel {
|
|
553
|
+
get $$type(): 'Graph';
|
|
554
|
+
readonly id?: string;
|
|
555
|
+
abstract readonly directed: boolean;
|
|
556
|
+
strict: boolean;
|
|
557
|
+
constructor(id?: string, attributes?: GraphAttributesObject);
|
|
558
|
+
constructor(id?: string, strict?: boolean, attributes?: GraphAttributesObject);
|
|
559
|
+
constructor(strict?: boolean, attributes?: GraphAttributesObject);
|
|
560
|
+
constructor(attributes?: GraphAttributesObject);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Base class representing a root graph(digraph, graph).
|
|
565
|
+
* @group Models
|
|
566
|
+
*/
|
|
567
|
+
declare abstract class RootGraph_3 extends GraphBase_3<GraphAttributeKey> implements RootGraphModel {
|
|
568
|
+
get $$type(): 'Graph';
|
|
569
|
+
readonly id?: string;
|
|
570
|
+
abstract readonly directed: boolean;
|
|
571
|
+
strict: boolean;
|
|
572
|
+
constructor(id?: string, attributes?: GraphAttributesObject);
|
|
573
|
+
constructor(id?: string, strict?: boolean, attributes?: GraphAttributesObject);
|
|
574
|
+
constructor(strict?: boolean, attributes?: GraphAttributesObject);
|
|
575
|
+
constructor(attributes?: GraphAttributesObject);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* DOT object class representing a subgraph.
|
|
580
|
+
* @group Models
|
|
581
|
+
*/
|
|
582
|
+
export declare class Subgraph extends GraphBase_5<SubgraphAttributeKey | ClusterSubgraphAttributeKey> implements SubgraphModel {
|
|
583
|
+
get $$type(): 'Subgraph';
|
|
584
|
+
readonly id?: string;
|
|
585
|
+
constructor(id?: string, attributes?: SubgraphAttributesObject);
|
|
586
|
+
constructor(attributes?: SubgraphAttributesObject);
|
|
587
|
+
isSubgraphCluster(): boolean;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export { }
|
package/lib/core.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { registerDefault } from "./register-default.js";
|
|
2
|
+
import { AttributeList } from "./AttributeList.js";
|
|
3
|
+
import { AttributesBase } from "./AttributesBase.js";
|
|
4
|
+
import { AttributesGroup } from "./AttributesGroup.js";
|
|
5
|
+
import { Digraph } from "./Digraph.js";
|
|
6
|
+
import { DotObject } from "./DotObject.js";
|
|
7
|
+
import { Edge } from "./Edge.js";
|
|
8
|
+
import { Graph } from "./Graph.js";
|
|
9
|
+
import { GraphBase } from "./GraphBase.js";
|
|
10
|
+
import { Node } from "./Node.js";
|
|
11
|
+
import { RootGraph } from "./RootGraph.js";
|
|
12
|
+
import { Subgraph } from "./Subgraph.js";
|
|
13
|
+
export {
|
|
14
|
+
AttributeList,
|
|
15
|
+
AttributesBase,
|
|
16
|
+
AttributesGroup,
|
|
17
|
+
Digraph,
|
|
18
|
+
DotObject,
|
|
19
|
+
Edge,
|
|
20
|
+
Graph,
|
|
21
|
+
GraphBase,
|
|
22
|
+
Node,
|
|
23
|
+
RootGraph,
|
|
24
|
+
Subgraph,
|
|
25
|
+
registerDefault
|
|
26
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const common = require("@ts-graphviz/common");
|
|
4
|
+
const Digraph = require("./Digraph.cjs");
|
|
5
|
+
const Edge = require("./Edge.cjs");
|
|
6
|
+
const Graph = require("./Graph.cjs");
|
|
7
|
+
const Node = require("./Node.cjs");
|
|
8
|
+
const Subgraph = require("./Subgraph.cjs");
|
|
9
|
+
function registerDefault() {
|
|
10
|
+
Object.assign(common.RootModelsContext, {
|
|
11
|
+
Graph: Graph.Graph,
|
|
12
|
+
Digraph: Digraph.Digraph,
|
|
13
|
+
Subgraph: Subgraph.Subgraph,
|
|
14
|
+
Node: Node.Node,
|
|
15
|
+
Edge: Edge.Edge
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.registerDefault = registerDefault;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RootModelsContext } from "@ts-graphviz/common";
|
|
2
|
+
import { Digraph } from "./Digraph.js";
|
|
3
|
+
import { Edge } from "./Edge.js";
|
|
4
|
+
import { Graph } from "./Graph.js";
|
|
5
|
+
import { Node } from "./Node.js";
|
|
6
|
+
import { Subgraph } from "./Subgraph.js";
|
|
7
|
+
function registerDefault() {
|
|
8
|
+
Object.assign(RootModelsContext, {
|
|
9
|
+
Graph,
|
|
10
|
+
Digraph,
|
|
11
|
+
Subgraph,
|
|
12
|
+
Node,
|
|
13
|
+
Edge
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
registerDefault
|
|
18
|
+
};
|