@statelyai/graph 0.4.0 → 0.6.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 +63 -144
- package/dist/{algorithms-CnTmuX9t.mjs → algorithms-oVD9PYil.mjs} +219 -31
- package/dist/algorithms.d.mts +91 -3
- package/dist/algorithms.mjs +2 -2
- package/dist/{converter-C5DlzzHs.mjs → converter-B5CUD0r9.mjs} +2 -2
- package/dist/formats/adjacency-list/index.d.mts +1 -1
- package/dist/formats/adjacency-list/index.mjs +1 -1
- package/dist/formats/converter/index.d.mts +2 -2
- package/dist/formats/converter/index.mjs +1 -1
- package/dist/formats/cytoscape/index.d.mts +1 -1
- package/dist/formats/cytoscape/index.mjs +1 -1
- package/dist/formats/d3/index.d.mts +1 -1
- package/dist/formats/d3/index.mjs +1 -1
- package/dist/formats/dot/index.d.mts +1 -1
- package/dist/formats/dot/index.mjs +1 -1
- package/dist/formats/edge-list/index.d.mts +1 -1
- package/dist/formats/edge-list/index.mjs +1 -1
- package/dist/formats/elk/index.d.mts +61 -0
- package/dist/formats/elk/index.mjs +176 -0
- package/dist/formats/gexf/index.d.mts +1 -1
- package/dist/formats/gexf/index.mjs +1 -1
- package/dist/formats/gml/index.d.mts +1 -1
- package/dist/formats/gml/index.mjs +1 -1
- package/dist/formats/graphml/index.d.mts +1 -1
- package/dist/formats/graphml/index.mjs +148 -56
- package/dist/formats/jgf/index.d.mts +1 -1
- package/dist/formats/jgf/index.mjs +1 -1
- package/dist/formats/mermaid/index.d.mts +51 -33
- package/dist/formats/mermaid/index.mjs +315 -31
- package/dist/formats/tgf/index.d.mts +1 -1
- package/dist/formats/tgf/index.mjs +1 -1
- package/dist/formats/xyflow/index.d.mts +1 -1
- package/dist/index.d.mts +100 -3
- package/dist/index.mjs +366 -10
- package/dist/queries.d.mts +1 -1
- package/dist/queries.mjs +1 -1
- package/dist/schemas.d.mts +39 -4
- package/dist/schemas.mjs +27 -5
- package/dist/{types-Bq_fmLwW.d.mts → types-DF-HNw50.d.mts} +65 -13
- package/package.json +7 -1
- package/schemas/edge.schema.json +32 -1
- package/schemas/graph.schema.json +114 -4
- package/schemas/node.schema.json +45 -2
- /package/dist/{adjacency-list-Bv4tfiM3.mjs → adjacency-list-fldj-QAL.mjs} +0 -0
- /package/dist/{edge-list-R1SUbHwe.mjs → edge-list-Br05wXMg.mjs} +0 -0
- /package/dist/{indexing-DitHphT7.mjs → indexing-DyfgLuzw.mjs} +0 -0
package/dist/schemas.mjs
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas.ts
|
|
4
|
+
const StyleSchema = z.record(z.string(), z.union([z.string(), z.number()]));
|
|
4
5
|
const NodeSchema = z.object({
|
|
5
6
|
type: z.literal("node"),
|
|
6
7
|
id: z.string(),
|
|
7
|
-
parentId: z.string().nullable(),
|
|
8
|
-
initialNodeId: z.string().nullable(),
|
|
8
|
+
parentId: z.string().nullable().optional(),
|
|
9
|
+
initialNodeId: z.string().nullable().optional(),
|
|
9
10
|
label: z.string(),
|
|
10
|
-
data: z.any()
|
|
11
|
+
data: z.any(),
|
|
12
|
+
x: z.number().optional(),
|
|
13
|
+
y: z.number().optional(),
|
|
14
|
+
width: z.number().optional(),
|
|
15
|
+
height: z.number().optional(),
|
|
16
|
+
shape: z.string().optional(),
|
|
17
|
+
color: z.string().optional(),
|
|
18
|
+
style: StyleSchema.optional()
|
|
11
19
|
});
|
|
12
20
|
const EdgeSchema = z.object({
|
|
13
21
|
type: z.literal("edge"),
|
|
@@ -15,7 +23,14 @@ const EdgeSchema = z.object({
|
|
|
15
23
|
sourceId: z.string(),
|
|
16
24
|
targetId: z.string(),
|
|
17
25
|
label: z.string(),
|
|
18
|
-
|
|
26
|
+
weight: z.number().optional(),
|
|
27
|
+
data: z.any(),
|
|
28
|
+
x: z.number().optional(),
|
|
29
|
+
y: z.number().optional(),
|
|
30
|
+
width: z.number().optional(),
|
|
31
|
+
height: z.number().optional(),
|
|
32
|
+
color: z.string().optional(),
|
|
33
|
+
style: StyleSchema.optional()
|
|
19
34
|
});
|
|
20
35
|
const GraphSchema = z.object({
|
|
21
36
|
id: z.string(),
|
|
@@ -23,7 +38,14 @@ const GraphSchema = z.object({
|
|
|
23
38
|
initialNodeId: z.string().nullable(),
|
|
24
39
|
nodes: z.array(NodeSchema),
|
|
25
40
|
edges: z.array(EdgeSchema),
|
|
26
|
-
data: z.any()
|
|
41
|
+
data: z.any(),
|
|
42
|
+
direction: z.enum([
|
|
43
|
+
"up",
|
|
44
|
+
"down",
|
|
45
|
+
"left",
|
|
46
|
+
"right"
|
|
47
|
+
]).optional(),
|
|
48
|
+
style: StyleSchema.optional()
|
|
27
49
|
});
|
|
28
50
|
|
|
29
51
|
//#endregion
|
|
@@ -45,7 +45,13 @@ interface EdgeConfig<TEdgeData = any> {
|
|
|
45
45
|
/**
|
|
46
46
|
* The label of the edge.
|
|
47
47
|
*/
|
|
48
|
-
label?: string;
|
|
48
|
+
label?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Optional numeric weight for the edge.
|
|
51
|
+
* Used by pathfinding, MST, and other weighted algorithms.
|
|
52
|
+
* When `getWeight` is not provided, algorithms default to `edge.weight ?? 1`.
|
|
53
|
+
*/
|
|
54
|
+
weight?: number;
|
|
49
55
|
data?: TEdgeData;
|
|
50
56
|
x?: number;
|
|
51
57
|
y?: number;
|
|
@@ -84,7 +90,13 @@ interface GraphEdge<TEdgeData = any> {
|
|
|
84
90
|
id: string;
|
|
85
91
|
sourceId: string;
|
|
86
92
|
targetId: string;
|
|
87
|
-
label: string;
|
|
93
|
+
label: string | null;
|
|
94
|
+
/**
|
|
95
|
+
* Optional numeric weight for the edge.
|
|
96
|
+
* Used by pathfinding, MST, and other weighted algorithms.
|
|
97
|
+
* When `getWeight` is not provided, algorithms default to `edge.weight ?? 1`.
|
|
98
|
+
*/
|
|
99
|
+
weight?: number;
|
|
88
100
|
data: TEdgeData;
|
|
89
101
|
x?: number;
|
|
90
102
|
y?: number;
|
|
@@ -139,7 +151,7 @@ interface PathOptions<TEdgeData = any> {
|
|
|
139
151
|
from?: string;
|
|
140
152
|
/** Target node ID. If omitted → paths to all reachable nodes */
|
|
141
153
|
to?: string;
|
|
142
|
-
/** Edge weight function. Default:
|
|
154
|
+
/** Edge weight function. Default: `(e) => e.weight ?? 1`. */
|
|
143
155
|
getWeight?: (edge: GraphEdge<TEdgeData>) => number;
|
|
144
156
|
}
|
|
145
157
|
interface SinglePathOptions<TEdgeData = any> {
|
|
@@ -147,9 +159,22 @@ interface SinglePathOptions<TEdgeData = any> {
|
|
|
147
159
|
from?: string;
|
|
148
160
|
/** Target node ID. Required for single-path queries. */
|
|
149
161
|
to: string;
|
|
150
|
-
/** Edge weight function. Default:
|
|
162
|
+
/** Edge weight function. Default: `(e) => e.weight ?? 1`. */
|
|
151
163
|
getWeight?: (edge: GraphEdge<TEdgeData>) => number;
|
|
152
164
|
}
|
|
165
|
+
interface AStarOptions<TEdgeData = any> {
|
|
166
|
+
/** Source node ID. */
|
|
167
|
+
from: string;
|
|
168
|
+
/** Target node ID. */
|
|
169
|
+
to: string;
|
|
170
|
+
/** Edge weight function. Default: `(e) => e.weight ?? 1`. */
|
|
171
|
+
getWeight?: (edge: GraphEdge<TEdgeData>) => number;
|
|
172
|
+
/**
|
|
173
|
+
* Heuristic function estimating cost from a node to the target.
|
|
174
|
+
* Must be admissible (never overestimates the actual cost).
|
|
175
|
+
*/
|
|
176
|
+
heuristic: (nodeId: string) => number;
|
|
177
|
+
}
|
|
153
178
|
interface TraversalOptions {
|
|
154
179
|
/** Source node ID. Default: graph.initialNodeId, else sole inDegree-0 node */
|
|
155
180
|
from?: string;
|
|
@@ -157,13 +182,13 @@ interface TraversalOptions {
|
|
|
157
182
|
interface MSTOptions<TEdgeData = any> {
|
|
158
183
|
/** Algorithm to use. Default: 'prim'. */
|
|
159
184
|
algorithm?: 'prim' | 'kruskal';
|
|
160
|
-
/** Edge weight function. Default:
|
|
185
|
+
/** Edge weight function. Default: `(e) => e.weight ?? 1`. */
|
|
161
186
|
getWeight?: (edge: GraphEdge<TEdgeData>) => number;
|
|
162
187
|
}
|
|
163
188
|
interface AllPairsShortestPathsOptions<TEdgeData = any> {
|
|
164
189
|
/** Algorithm to use. Default: 'dijkstra'. */
|
|
165
190
|
algorithm?: 'floyd-warshall' | 'dijkstra';
|
|
166
|
-
/** Edge weight function. Default:
|
|
191
|
+
/** Edge weight function. Default: `(e) => e.weight ?? 1`. */
|
|
167
192
|
getWeight?: (edge: GraphEdge<TEdgeData>) => number;
|
|
168
193
|
}
|
|
169
194
|
interface NodeChange<TNodeData = any> {
|
|
@@ -228,22 +253,49 @@ type GraphPatch<TNodeData = any, TEdgeData = any> = {
|
|
|
228
253
|
* };
|
|
229
254
|
* ```
|
|
230
255
|
*/
|
|
231
|
-
interface GraphFormatConverter<TSerial> {
|
|
256
|
+
interface GraphFormatConverter<TSerial, N = any, E = any, G = any> {
|
|
232
257
|
/** Convert a Graph to the serialized format. */
|
|
233
|
-
to(graph: Graph): TSerial;
|
|
258
|
+
to(graph: Graph<N, E, G>): TSerial;
|
|
234
259
|
/** Convert from the serialized format to a Graph. */
|
|
235
|
-
from(input: TSerial): Graph
|
|
260
|
+
from(input: TSerial): Graph<N, E, G>;
|
|
236
261
|
}
|
|
237
262
|
/**
|
|
238
263
|
* A bidirectional converter between `VisualGraph` and a serialized format.
|
|
239
264
|
*
|
|
240
265
|
* Use this for formats that carry position/size data (e.g. xyflow, cytoscape).
|
|
241
266
|
*/
|
|
242
|
-
interface VisualGraphFormatConverter<TSerial> {
|
|
267
|
+
interface VisualGraphFormatConverter<TSerial, N = any, E = any, G = any> {
|
|
243
268
|
/** Convert a VisualGraph to the serialized format. */
|
|
244
|
-
to(graph: VisualGraph): TSerial;
|
|
269
|
+
to(graph: VisualGraph<N, E, G>): TSerial;
|
|
245
270
|
/** Convert from the serialized format to a VisualGraph. */
|
|
246
|
-
from(input: TSerial): VisualGraph
|
|
271
|
+
from(input: TSerial): VisualGraph<N, E, G>;
|
|
272
|
+
}
|
|
273
|
+
interface WalkOptions<TEdgeData = any> {
|
|
274
|
+
/** Start node ID. Default: graph.initialNodeId, else sole inDegree-0 node */
|
|
275
|
+
from?: string;
|
|
276
|
+
/** Seed for deterministic RNG. Omit for Math.random. */
|
|
277
|
+
seed?: number;
|
|
278
|
+
/** Guard: only traverse edges where filter returns true. */
|
|
279
|
+
filter?: (edge: GraphEdge<TEdgeData>, context: WalkContext) => boolean;
|
|
280
|
+
/** Callback fired after each step. */
|
|
281
|
+
onStep?: (step: GraphStep<any, TEdgeData>, context: WalkContext) => void;
|
|
282
|
+
}
|
|
283
|
+
interface WeightedWalkOptions<TEdgeData = any> extends WalkOptions<TEdgeData> {
|
|
284
|
+
/** Edge weight function. Default: `(e) => e.weight ?? 1`. */
|
|
285
|
+
getWeight?: (edge: GraphEdge<TEdgeData>) => number;
|
|
286
|
+
}
|
|
287
|
+
interface WalkContext {
|
|
288
|
+
currentNodeId: string;
|
|
289
|
+
visitedNodes: Set<string>;
|
|
290
|
+
visitedEdges: Set<string>;
|
|
291
|
+
stepCount: number;
|
|
292
|
+
}
|
|
293
|
+
interface CoverageStats {
|
|
294
|
+
nodeCoverage: number;
|
|
295
|
+
edgeCoverage: number;
|
|
296
|
+
visitedNodes: string[];
|
|
297
|
+
visitedEdges: string[];
|
|
298
|
+
totalSteps: number;
|
|
247
299
|
}
|
|
248
300
|
interface TransitionOptions<TState, TEvent> {
|
|
249
301
|
/** Initial state to begin BFS exploration from. */
|
|
@@ -262,4 +314,4 @@ interface TransitionOptions<TState, TEvent> {
|
|
|
262
314
|
id?: string;
|
|
263
315
|
}
|
|
264
316
|
//#endregion
|
|
265
|
-
export {
|
|
317
|
+
export { VisualNode as A, SinglePathOptions as C, VisualGraph as D, VisualEdge as E, WalkOptions as M, WeightedWalkOptions as N, VisualGraphConfig as O, PathOptions as S, TraversalOptions as T, GraphPath as _, EdgeChange as a, NodeChange as b, EntitiesUpdate as c, GraphConfig as d, GraphDiff as f, GraphPatch as g, GraphNode as h, DeleteNodeOptions as i, WalkContext as j, VisualGraphFormatConverter as k, EntityRect as l, GraphFormatConverter as m, AllPairsShortestPathsOptions as n, EdgeConfig as o, GraphEdge as p, CoverageStats as r, EntitiesConfig as s, AStarOptions as t, Graph as u, GraphStep as v, TransitionOptions as w, NodeConfig as x, MSTOptions as y };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statelyai/graph",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"description": "A TypeScript-first graph library with plain JSON-serializable objects",
|
|
6
6
|
"author": "David Khourshid <david@stately.ai>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"./d3": "./dist/formats/d3/index.mjs",
|
|
31
31
|
"./dot": "./dist/formats/dot/index.mjs",
|
|
32
32
|
"./edge-list": "./dist/formats/edge-list/index.mjs",
|
|
33
|
+
"./elk": "./dist/formats/elk/index.mjs",
|
|
33
34
|
"./gexf": "./dist/formats/gexf/index.mjs",
|
|
34
35
|
"./gml": "./dist/formats/gml/index.mjs",
|
|
35
36
|
"./graphml": "./dist/formats/graphml/index.mjs",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"d3-array": "^3.2.4",
|
|
61
62
|
"d3-force": "^3.0.0",
|
|
62
63
|
"dotparser": "^1.1.1",
|
|
64
|
+
"elkjs": "^0.11.1",
|
|
63
65
|
"fast-xml-parser": "^5.3.4",
|
|
64
66
|
"tsdown": "^0.18.1",
|
|
65
67
|
"tsx": "^4.21.0",
|
|
@@ -72,6 +74,7 @@
|
|
|
72
74
|
"cytoscape": "^3.0.0",
|
|
73
75
|
"d3-force": "^3.0.0",
|
|
74
76
|
"dotparser": "^1.0.0",
|
|
77
|
+
"elkjs": "^0.9.0 || ^0.10.0 || ^0.11.0",
|
|
75
78
|
"fast-xml-parser": "^5.0.0",
|
|
76
79
|
"zod": "^4.0.0"
|
|
77
80
|
},
|
|
@@ -85,6 +88,9 @@
|
|
|
85
88
|
"dotparser": {
|
|
86
89
|
"optional": true
|
|
87
90
|
},
|
|
91
|
+
"elkjs": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
88
94
|
"fast-xml-parser": {
|
|
89
95
|
"optional": true
|
|
90
96
|
},
|
package/schemas/edge.schema.json
CHANGED
|
@@ -18,7 +18,38 @@
|
|
|
18
18
|
"label": {
|
|
19
19
|
"type": "string"
|
|
20
20
|
},
|
|
21
|
-
"data": {}
|
|
21
|
+
"data": {},
|
|
22
|
+
"x": {
|
|
23
|
+
"type": "number"
|
|
24
|
+
},
|
|
25
|
+
"y": {
|
|
26
|
+
"type": "number"
|
|
27
|
+
},
|
|
28
|
+
"width": {
|
|
29
|
+
"type": "number"
|
|
30
|
+
},
|
|
31
|
+
"height": {
|
|
32
|
+
"type": "number"
|
|
33
|
+
},
|
|
34
|
+
"color": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"style": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"propertyNames": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
},
|
|
42
|
+
"additionalProperties": {
|
|
43
|
+
"anyOf": [
|
|
44
|
+
{
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"type": "number"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
22
53
|
},
|
|
23
54
|
"required": [
|
|
24
55
|
"type",
|
|
@@ -12,6 +12,16 @@
|
|
|
12
12
|
"undirected"
|
|
13
13
|
]
|
|
14
14
|
},
|
|
15
|
+
"initialNodeId": {
|
|
16
|
+
"anyOf": [
|
|
17
|
+
{
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"type": "null"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
15
25
|
"nodes": {
|
|
16
26
|
"type": "array",
|
|
17
27
|
"items": {
|
|
@@ -34,15 +44,58 @@
|
|
|
34
44
|
}
|
|
35
45
|
]
|
|
36
46
|
},
|
|
47
|
+
"initialNodeId": {
|
|
48
|
+
"anyOf": [
|
|
49
|
+
{
|
|
50
|
+
"type": "string"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "null"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
37
57
|
"label": {
|
|
38
58
|
"type": "string"
|
|
39
59
|
},
|
|
40
|
-
"data": {}
|
|
60
|
+
"data": {},
|
|
61
|
+
"x": {
|
|
62
|
+
"type": "number"
|
|
63
|
+
},
|
|
64
|
+
"y": {
|
|
65
|
+
"type": "number"
|
|
66
|
+
},
|
|
67
|
+
"width": {
|
|
68
|
+
"type": "number"
|
|
69
|
+
},
|
|
70
|
+
"height": {
|
|
71
|
+
"type": "number"
|
|
72
|
+
},
|
|
73
|
+
"shape": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
},
|
|
76
|
+
"color": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"style": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"propertyNames": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"additionalProperties": {
|
|
85
|
+
"anyOf": [
|
|
86
|
+
{
|
|
87
|
+
"type": "string"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"type": "number"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
41
95
|
},
|
|
42
96
|
"required": [
|
|
43
97
|
"type",
|
|
44
98
|
"id",
|
|
45
|
-
"parentId",
|
|
46
99
|
"label",
|
|
47
100
|
"data"
|
|
48
101
|
],
|
|
@@ -70,7 +123,38 @@
|
|
|
70
123
|
"label": {
|
|
71
124
|
"type": "string"
|
|
72
125
|
},
|
|
73
|
-
"data": {}
|
|
126
|
+
"data": {},
|
|
127
|
+
"x": {
|
|
128
|
+
"type": "number"
|
|
129
|
+
},
|
|
130
|
+
"y": {
|
|
131
|
+
"type": "number"
|
|
132
|
+
},
|
|
133
|
+
"width": {
|
|
134
|
+
"type": "number"
|
|
135
|
+
},
|
|
136
|
+
"height": {
|
|
137
|
+
"type": "number"
|
|
138
|
+
},
|
|
139
|
+
"color": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
"style": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"propertyNames": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"additionalProperties": {
|
|
148
|
+
"anyOf": [
|
|
149
|
+
{
|
|
150
|
+
"type": "string"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"type": "number"
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
74
158
|
},
|
|
75
159
|
"required": [
|
|
76
160
|
"type",
|
|
@@ -83,11 +167,37 @@
|
|
|
83
167
|
"additionalProperties": false
|
|
84
168
|
}
|
|
85
169
|
},
|
|
86
|
-
"data": {}
|
|
170
|
+
"data": {},
|
|
171
|
+
"direction": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"enum": [
|
|
174
|
+
"up",
|
|
175
|
+
"down",
|
|
176
|
+
"left",
|
|
177
|
+
"right"
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"style": {
|
|
181
|
+
"type": "object",
|
|
182
|
+
"propertyNames": {
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
"additionalProperties": {
|
|
186
|
+
"anyOf": [
|
|
187
|
+
{
|
|
188
|
+
"type": "string"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"type": "number"
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
87
196
|
},
|
|
88
197
|
"required": [
|
|
89
198
|
"id",
|
|
90
199
|
"type",
|
|
200
|
+
"initialNodeId",
|
|
91
201
|
"nodes",
|
|
92
202
|
"edges",
|
|
93
203
|
"data"
|
package/schemas/node.schema.json
CHANGED
|
@@ -19,15 +19,58 @@
|
|
|
19
19
|
}
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
|
+
"initialNodeId": {
|
|
23
|
+
"anyOf": [
|
|
24
|
+
{
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "null"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
22
32
|
"label": {
|
|
23
33
|
"type": "string"
|
|
24
34
|
},
|
|
25
|
-
"data": {}
|
|
35
|
+
"data": {},
|
|
36
|
+
"x": {
|
|
37
|
+
"type": "number"
|
|
38
|
+
},
|
|
39
|
+
"y": {
|
|
40
|
+
"type": "number"
|
|
41
|
+
},
|
|
42
|
+
"width": {
|
|
43
|
+
"type": "number"
|
|
44
|
+
},
|
|
45
|
+
"height": {
|
|
46
|
+
"type": "number"
|
|
47
|
+
},
|
|
48
|
+
"shape": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"color": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"style": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"propertyNames": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"additionalProperties": {
|
|
60
|
+
"anyOf": [
|
|
61
|
+
{
|
|
62
|
+
"type": "string"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "number"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
26
70
|
},
|
|
27
71
|
"required": [
|
|
28
72
|
"type",
|
|
29
73
|
"id",
|
|
30
|
-
"parentId",
|
|
31
74
|
"label",
|
|
32
75
|
"data"
|
|
33
76
|
],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|