glassbrain 0.2.0-alpha.5 → 0.2.0-alpha.6
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 +18 -12
- package/dist/adapters.js +25 -1
- package/dist/chunks/{chunk-3JGZ27DC.js → chunk-3P34XHQ2.js} +4 -3
- package/dist/chunks/{chunk-F4HDKER4.js → chunk-3SAL4526.js} +253 -90
- package/dist/chunks/{chunk-ISWKAU5G.js → chunk-5DEN6HXJ.js} +1 -3
- package/dist/chunks/{chunk-WUBELTBU.js → chunk-LMYD4QHC.js} +26 -25
- package/dist/chunks/{chunk-G7XWVKHN.js → chunk-M3MAM2VD.js} +5 -4
- package/dist/cli/glassbrain.js +432 -275
- package/dist/cli/viewer.js +42 -42
- package/dist/core.js +5 -5
- package/dist/edit.d.ts +5 -3
- package/dist/index.js +7 -7
- package/dist/internal.js +7 -7
- package/dist/layers.d.ts +1 -1
- package/dist/model.d.ts +15 -5
- package/dist/profile.d.ts +9 -1
- package/dist/react/DetailPanel.js +2 -2
- package/dist/react/GraphCanvas.js +4 -4
- package/dist/tree.d.ts +11 -0
- package/package.json +1 -1
- package/schema/graph.schema.json +125 -23
package/dist/core.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
deriveLayers,
|
|
4
4
|
layerIndexOf,
|
|
5
5
|
orderedChildren
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-M3MAM2VD.js";
|
|
7
7
|
import {
|
|
8
8
|
CONTENT_SCALE,
|
|
9
9
|
DARK_THEME,
|
|
@@ -45,7 +45,6 @@ import {
|
|
|
45
45
|
diffStyle,
|
|
46
46
|
edgeKindClass,
|
|
47
47
|
edgesOf,
|
|
48
|
-
encodeParent,
|
|
49
48
|
graphStyle,
|
|
50
49
|
hasChanges,
|
|
51
50
|
indexModel,
|
|
@@ -73,15 +72,16 @@ import {
|
|
|
73
72
|
skeletonColor,
|
|
74
73
|
stepUnion,
|
|
75
74
|
themeColor,
|
|
75
|
+
toBundle,
|
|
76
76
|
toPhysical,
|
|
77
77
|
unionSides,
|
|
78
78
|
untheme,
|
|
79
79
|
validateModel,
|
|
80
80
|
validateStructure
|
|
81
|
-
} from "./chunks/chunk-
|
|
81
|
+
} from "./chunks/chunk-3SAL4526.js";
|
|
82
82
|
import {
|
|
83
83
|
EN
|
|
84
|
-
} from "./chunks/chunk-
|
|
84
|
+
} from "./chunks/chunk-5DEN6HXJ.js";
|
|
85
85
|
import "./chunks/chunk-ZA47FP7C.js";
|
|
86
86
|
export {
|
|
87
87
|
CONTENT_SCALE,
|
|
@@ -127,7 +127,6 @@ export {
|
|
|
127
127
|
diffStyle,
|
|
128
128
|
edgeKindClass,
|
|
129
129
|
edgesOf,
|
|
130
|
-
encodeParent,
|
|
131
130
|
graphStyle,
|
|
132
131
|
hasChanges,
|
|
133
132
|
indexModel,
|
|
@@ -157,6 +156,7 @@ export {
|
|
|
157
156
|
skeletonColor,
|
|
158
157
|
stepUnion,
|
|
159
158
|
themeColor,
|
|
159
|
+
toBundle,
|
|
160
160
|
toPhysical,
|
|
161
161
|
unionSides,
|
|
162
162
|
untheme,
|
package/dist/edit.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { type GraphEdge, type GraphModel } from './model.js';
|
|
|
2
2
|
import type { GraphProfile } from './profile.js';
|
|
3
3
|
/** What can be changed on a node. `parent: null` = move to the top level. */
|
|
4
4
|
export interface NodeFields {
|
|
5
|
+
/** Insert before this sibling; null appends. Native UI uses this instead of numeric order. */
|
|
6
|
+
before?: string | null;
|
|
5
7
|
label?: string;
|
|
6
8
|
kind?: string;
|
|
7
9
|
parent?: string | null;
|
|
@@ -38,7 +40,7 @@ export type EditOp =
|
|
|
38
40
|
op: 'removeEdge';
|
|
39
41
|
edge: EdgeRef;
|
|
40
42
|
};
|
|
41
|
-
export type EditError = '
|
|
43
|
+
export type EditError = 'invalid-position' | 'order-invalid' | 'id-empty' | 'id-taken' | 'no-node' | 'no-parent' | 'cycle' | 'has-children' | 'no-endpoint' | 'self-loop' | 'edge-exists' | 'no-edge';
|
|
42
44
|
/** Whether this op can be applied. null = yes; otherwise the reason (the UI looks it up in `strings.error`). */
|
|
43
45
|
export declare function checkEdit(model: GraphModel, op: EditOp): EditError | null;
|
|
44
46
|
/** How many edges hang on a node (the ones that go with it when it is deleted). */
|
|
@@ -57,5 +59,5 @@ export declare function applyEdits(model: GraphModel, ops: EditOp[], profile?: G
|
|
|
57
59
|
error: EditError;
|
|
58
60
|
}[];
|
|
59
61
|
};
|
|
60
|
-
/** Native CLI edits
|
|
61
|
-
export declare
|
|
62
|
+
/** Native CLI edits keep stable ids and valid forest placements. */
|
|
63
|
+
export declare const checkNativeEdit: typeof checkEdit;
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
deriveLayers,
|
|
6
6
|
layerIndexOf,
|
|
7
7
|
orderedChildren
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-M3MAM2VD.js";
|
|
9
9
|
import {
|
|
10
10
|
ALL_CONTROLS,
|
|
11
11
|
DEFAULT_PLANES,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
clearLayoutCache,
|
|
15
15
|
computeLayout,
|
|
16
16
|
projectPlanes
|
|
17
|
-
} from "./chunks/chunk-
|
|
17
|
+
} from "./chunks/chunk-LMYD4QHC.js";
|
|
18
18
|
import {
|
|
19
19
|
CONTENT_SCALE,
|
|
20
20
|
DARK_THEME,
|
|
@@ -56,7 +56,6 @@ import {
|
|
|
56
56
|
diffStyle,
|
|
57
57
|
edgeKindClass,
|
|
58
58
|
edgesOf,
|
|
59
|
-
encodeParent,
|
|
60
59
|
graphStyle,
|
|
61
60
|
hasChanges,
|
|
62
61
|
indexModel,
|
|
@@ -84,20 +83,21 @@ import {
|
|
|
84
83
|
skeletonColor,
|
|
85
84
|
stepUnion,
|
|
86
85
|
themeColor,
|
|
86
|
+
toBundle,
|
|
87
87
|
toPhysical,
|
|
88
88
|
unionSides,
|
|
89
89
|
untheme,
|
|
90
90
|
validateModel,
|
|
91
91
|
validateStructure
|
|
92
|
-
} from "./chunks/chunk-
|
|
92
|
+
} from "./chunks/chunk-3SAL4526.js";
|
|
93
93
|
import {
|
|
94
94
|
DetailPanel,
|
|
95
95
|
renderInline,
|
|
96
96
|
renderMarkdown
|
|
97
|
-
} from "./chunks/chunk-
|
|
97
|
+
} from "./chunks/chunk-3P34XHQ2.js";
|
|
98
98
|
import {
|
|
99
99
|
EN
|
|
100
|
-
} from "./chunks/chunk-
|
|
100
|
+
} from "./chunks/chunk-5DEN6HXJ.js";
|
|
101
101
|
import "./chunks/chunk-OE5IRKWZ.js";
|
|
102
102
|
import "./chunks/chunk-ZA47FP7C.js";
|
|
103
103
|
export {
|
|
@@ -151,7 +151,6 @@ export {
|
|
|
151
151
|
diffStyle,
|
|
152
152
|
edgeKindClass,
|
|
153
153
|
edgesOf,
|
|
154
|
-
encodeParent,
|
|
155
154
|
graphStyle,
|
|
156
155
|
hasChanges,
|
|
157
156
|
indexModel,
|
|
@@ -184,6 +183,7 @@ export {
|
|
|
184
183
|
skeletonColor,
|
|
185
184
|
stepUnion,
|
|
186
185
|
themeColor,
|
|
186
|
+
toBundle,
|
|
187
187
|
toPhysical,
|
|
188
188
|
unionSides,
|
|
189
189
|
untheme,
|
package/dist/internal.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
deriveLayers,
|
|
6
6
|
layerIndexOf,
|
|
7
7
|
orderedChildren
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-M3MAM2VD.js";
|
|
9
9
|
import {
|
|
10
10
|
ALL_CONTROLS,
|
|
11
11
|
DEFAULT_PLANES,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
shapeOf,
|
|
49
49
|
skeletonLineOf,
|
|
50
50
|
touchGestures
|
|
51
|
-
} from "./chunks/chunk-
|
|
51
|
+
} from "./chunks/chunk-LMYD4QHC.js";
|
|
52
52
|
import {
|
|
53
53
|
CONTENT_SCALE,
|
|
54
54
|
DARK_THEME,
|
|
@@ -104,7 +104,6 @@ import {
|
|
|
104
104
|
edgeKindClass,
|
|
105
105
|
edgeTraffic,
|
|
106
106
|
edgesOf,
|
|
107
|
-
encodeParent,
|
|
108
107
|
fadeAt,
|
|
109
108
|
graphStyle,
|
|
110
109
|
hasChanges,
|
|
@@ -141,6 +140,7 @@ import {
|
|
|
141
140
|
solveDiffLayout,
|
|
142
141
|
stepUnion,
|
|
143
142
|
themeColor,
|
|
143
|
+
toBundle,
|
|
144
144
|
toPhysical,
|
|
145
145
|
trackAt,
|
|
146
146
|
trackLin,
|
|
@@ -148,15 +148,15 @@ import {
|
|
|
148
148
|
untheme,
|
|
149
149
|
validateModel,
|
|
150
150
|
validateStructure
|
|
151
|
-
} from "./chunks/chunk-
|
|
151
|
+
} from "./chunks/chunk-3SAL4526.js";
|
|
152
152
|
import {
|
|
153
153
|
DetailPanel,
|
|
154
154
|
renderInline,
|
|
155
155
|
renderMarkdown
|
|
156
|
-
} from "./chunks/chunk-
|
|
156
|
+
} from "./chunks/chunk-3P34XHQ2.js";
|
|
157
157
|
import {
|
|
158
158
|
EN
|
|
159
|
-
} from "./chunks/chunk-
|
|
159
|
+
} from "./chunks/chunk-5DEN6HXJ.js";
|
|
160
160
|
import "./chunks/chunk-OE5IRKWZ.js";
|
|
161
161
|
import "./chunks/chunk-ZA47FP7C.js";
|
|
162
162
|
export {
|
|
@@ -243,7 +243,6 @@ export {
|
|
|
243
243
|
edgeKindHidden,
|
|
244
244
|
edgeTraffic,
|
|
245
245
|
edgesOf,
|
|
246
|
-
encodeParent,
|
|
247
246
|
fadeAt,
|
|
248
247
|
focusAlphaOf,
|
|
249
248
|
gapOf,
|
|
@@ -299,6 +298,7 @@ export {
|
|
|
299
298
|
solveDiffLayout,
|
|
300
299
|
stepUnion,
|
|
301
300
|
themeColor,
|
|
301
|
+
toBundle,
|
|
302
302
|
toPhysical,
|
|
303
303
|
touchGestures,
|
|
304
304
|
trackAt,
|
package/dist/layers.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface DerivedLayers {
|
|
|
9
9
|
anchor?: string;
|
|
10
10
|
}
|
|
11
11
|
/** Ordered children of `id`, or null when that run is not ordered (all of them carry a distinct order, or none does). */
|
|
12
|
-
export declare function orderedChildren(children: Gy, id: string): GraphNode[] | null;
|
|
12
|
+
export declare function orderedChildren(children: Gy, id: string, unordered?: boolean): GraphNode[] | null;
|
|
13
13
|
type Gy = Map<string, GraphNode[]>;
|
|
14
14
|
export declare function childrenMap(model: GraphModel): Gy;
|
|
15
15
|
export declare function deriveLayers(model: GraphModel, colors?: string[], force?: boolean): DerivedLayers;
|
package/dist/model.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export interface GraphNode {
|
|
|
7
7
|
/** Compound parent node id: expresses "nested inside", the only source of structural hierarchy. */
|
|
8
8
|
parent?: string;
|
|
9
9
|
/** Position among its siblings: every child of a parent carries one, or none does. **The file format writes it as the
|
|
10
|
-
*
|
|
11
|
-
* reads it clockwise,
|
|
10
|
+
* position in `children`** (1-based; retained only in the runtime model). The layout
|
|
11
|
+
* reads it clockwise, unless the parent has data.unordered === true. Unordered groups retain
|
|
12
|
+
* these positions for editing/export, but do not use them for layout, floors or positional diffs. */
|
|
12
13
|
order?: number;
|
|
13
14
|
/** **Where it hung in the previous version** (filled by `diffModels`, only `moved` nodes in a union have it).
|
|
14
15
|
*
|
|
@@ -49,7 +50,16 @@ export interface GraphEdge {
|
|
|
49
50
|
data?: Record<string, unknown>;
|
|
50
51
|
}
|
|
51
52
|
/** A fragment parsed from one piece of raw data. One file = one slice. */
|
|
53
|
+
export interface NodeDeclaration {
|
|
54
|
+
id: string;
|
|
55
|
+
fields: Record<string, unknown>;
|
|
56
|
+
children?: string[];
|
|
57
|
+
path: string;
|
|
58
|
+
}
|
|
52
59
|
export interface GraphSlice {
|
|
60
|
+
/** Native tree declarations, before defaults and field composition. */
|
|
61
|
+
declarations?: NodeDeclaration[];
|
|
62
|
+
rootIds?: string[];
|
|
53
63
|
origin: string;
|
|
54
64
|
title: string;
|
|
55
65
|
nodes: GraphNode[];
|
|
@@ -67,6 +77,8 @@ export interface GraphModel {
|
|
|
67
77
|
errors: {
|
|
68
78
|
origin: string;
|
|
69
79
|
message: string;
|
|
80
|
+
code?: 'schema' | 'field-conflict' | 'children-conflict' | 'parent-error';
|
|
81
|
+
node?: string;
|
|
70
82
|
}[];
|
|
71
83
|
/** id → node (built at construction; do not build your own). */
|
|
72
84
|
index: Map<string, GraphNode>;
|
|
@@ -76,7 +88,7 @@ export interface GraphModel {
|
|
|
76
88
|
export declare const EMPTY_MODEL: GraphModel;
|
|
77
89
|
/** Build a model from bare nodes/edges (builds the index). profile.merge implementations nearly all end with it. */
|
|
78
90
|
export declare function buildModel(nodes: GraphNode[], edges: GraphEdge[], errors?: GraphModel['errors']): GraphModel;
|
|
79
|
-
/**
|
|
91
|
+
/** Native trees compose explicit fields by id; custom profile parsers can supply runtime slices. */
|
|
80
92
|
export declare function mergeSlices(slices: GraphSlice[]): GraphModel;
|
|
81
93
|
/** Add one to a source list (order kept, deduplicated). Needed all over the merge stage. */
|
|
82
94
|
export declare function addOrigin(list: string[] | undefined, origin: string | undefined): string[];
|
|
@@ -95,5 +107,3 @@ export interface GraphIndex {
|
|
|
95
107
|
export declare function indexModel(model: GraphModel): GraphIndex;
|
|
96
108
|
/** The sources that appear in the model (data for the subgraph / view dropdown). */
|
|
97
109
|
export declare function originsOf(model: GraphModel): string[];
|
|
98
|
-
/** Canonical decimal encoding: Number.toString uses exponents for tiny/large orders. */
|
|
99
|
-
export declare function encodeParent(parent: string | null | undefined, order?: number): string | null;
|
package/dist/profile.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface GraphProfile {
|
|
|
44
44
|
id: string;
|
|
45
45
|
/** Parse one piece of raw data. Return null = not recognized (silently skipped, not counted as broken). */
|
|
46
46
|
parse(origin: string, text: string): GraphSlice | null;
|
|
47
|
-
/** Slices → model. Default mergeSlices (
|
|
47
|
+
/** Slices → model. Default mergeSlices (native declarations compose by id). */
|
|
48
48
|
merge(slices: GraphSlice[]): GraphModel;
|
|
49
49
|
layers: LayerSpec[];
|
|
50
50
|
/** Which layer a node belongs to. Defaults to node.layer, then to the first layer. */
|
|
@@ -111,6 +111,14 @@ export declare function toPhysical(model: GraphModel): {
|
|
|
111
111
|
nodes: Record<string, unknown>[];
|
|
112
112
|
edges: Record<string, unknown>[];
|
|
113
113
|
};
|
|
114
|
+
/** Portable page export: preserve the profile and include colours for every depth of the tree. */
|
|
115
|
+
export declare function toBundle(model: GraphModel, profile?: Record<string, unknown> | null): {
|
|
116
|
+
nodes: Record<string, unknown>[];
|
|
117
|
+
edges: Record<string, unknown>[];
|
|
118
|
+
profile: {
|
|
119
|
+
nodePalette: Record<string, string>;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
114
122
|
/** Generic validation: the few things true of any graph (dangling edges, duplicate ids, duplicate edges). Domain checks are added separately.
|
|
115
123
|
*
|
|
116
124
|
* **An edge is defined by its two ends + kind** (compare and edit both use this; `id` is only the name of the primitive on screen).
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
DetailPanel
|
|
5
|
-
} from "../chunks/chunk-
|
|
6
|
-
import "../chunks/chunk-
|
|
5
|
+
} from "../chunks/chunk-3P34XHQ2.js";
|
|
6
|
+
import "../chunks/chunk-5DEN6HXJ.js";
|
|
7
7
|
import "../chunks/chunk-ZA47FP7C.js";
|
|
8
8
|
export {
|
|
9
9
|
DetailPanel as default
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import {
|
|
4
4
|
GraphCanvas
|
|
5
|
-
} from "../chunks/chunk-
|
|
6
|
-
import "../chunks/chunk-
|
|
7
|
-
import "../chunks/chunk-
|
|
8
|
-
import "../chunks/chunk-
|
|
5
|
+
} from "../chunks/chunk-LMYD4QHC.js";
|
|
6
|
+
import "../chunks/chunk-3SAL4526.js";
|
|
7
|
+
import "../chunks/chunk-3P34XHQ2.js";
|
|
8
|
+
import "../chunks/chunk-5DEN6HXJ.js";
|
|
9
9
|
import "../chunks/chunk-OE5IRKWZ.js";
|
|
10
10
|
import "../chunks/chunk-ZA47FP7C.js";
|
|
11
11
|
export {
|
package/dist/tree.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Native ordered tree fragments. Collect facts by id before materializing a forest. */
|
|
2
|
+
import { type GraphModel, type GraphNode, type GraphSlice, type NodeDeclaration } from './model.js';
|
|
3
|
+
export declare function treeDeclarations(raw: unknown, origin: string): Pick<GraphSlice, 'declarations' | 'rootIds' | 'error'>;
|
|
4
|
+
/** Own fields only: descendants must never be copied into an ancestor's diff payload. */
|
|
5
|
+
export declare function treeNodes(declarations?: NodeDeclaration[]): GraphNode[];
|
|
6
|
+
export declare function composeTrees(input: GraphSlice[]): GraphModel;
|
|
7
|
+
/** Complete snapshots only. Never export a conflict's diagnostic first value as accepted knowledge. */
|
|
8
|
+
export declare function serializeTree(model: GraphModel): {
|
|
9
|
+
nodes: Record<string, unknown>[];
|
|
10
|
+
edges: Record<string, unknown>[];
|
|
11
|
+
};
|
package/package.json
CHANGED
package/schema/graph.schema.json
CHANGED
|
@@ -2,50 +2,152 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://unpkg.com/glassbrain/schema/graph.schema.json",
|
|
4
4
|
"title": "glassbrain graph",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "An ordered forest of node fragments plus semantic edges. Nest nodes in children; array order is reading order. Same id means the same node: absent fields are filled, equal values are accepted, conflicting values are errors. Children declarations must have identical direct child id sequences. Top-level fragments acquire a parent wherever another node contains their id. Each node has at most one parent; cycles are invalid.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"anyOf": [
|
|
7
|
+
"anyOf": [
|
|
8
|
+
{
|
|
9
|
+
"required": [
|
|
10
|
+
"nodes"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"required": [
|
|
15
|
+
"edges"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
8
19
|
"properties": {
|
|
9
|
-
"name": {
|
|
10
|
-
|
|
20
|
+
"name": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Title of this file (shown as its source name)."
|
|
23
|
+
},
|
|
24
|
+
"title": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Alias of `name`."
|
|
27
|
+
},
|
|
11
28
|
"nodes": {
|
|
12
29
|
"type": "array",
|
|
13
|
-
"items": {
|
|
30
|
+
"items": {
|
|
31
|
+
"$ref": "#/$defs/node"
|
|
32
|
+
}
|
|
14
33
|
},
|
|
15
34
|
"edges": {
|
|
16
35
|
"type": "array",
|
|
17
|
-
"items": {
|
|
36
|
+
"items": {
|
|
37
|
+
"$ref": "#/$defs/edge"
|
|
38
|
+
}
|
|
18
39
|
}
|
|
19
40
|
},
|
|
20
41
|
"$defs": {
|
|
21
42
|
"node": {
|
|
22
43
|
"type": "object",
|
|
23
|
-
"required": [
|
|
44
|
+
"required": [
|
|
45
|
+
"id"
|
|
46
|
+
],
|
|
24
47
|
"properties": {
|
|
25
|
-
"id": {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
48
|
+
"id": {
|
|
49
|
+
"type": [
|
|
50
|
+
"string",
|
|
51
|
+
"number"
|
|
52
|
+
],
|
|
53
|
+
"pattern": "\\S",
|
|
54
|
+
"description": "Non-empty stable identity. Keep it the same across versions: that is how a diff knows it is the same thing. Prefer a short code."
|
|
55
|
+
},
|
|
56
|
+
"label": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "Display name. Falls back to `name`, then `id`."
|
|
59
|
+
},
|
|
60
|
+
"name": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Alias of `label`."
|
|
63
|
+
},
|
|
64
|
+
"kind": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "What sort of thing this is. Colors come from the profile's `nodePalette[kind]`; kinds not in the palette are drawn as skeleton."
|
|
67
|
+
},
|
|
68
|
+
"flags": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"description": "Boolean markers; each becomes a CSS-like class. A flag listed in the profile's `placeholderFlags` draws the node as a placeholder."
|
|
74
|
+
},
|
|
75
|
+
"description": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Markdown shown in the detail panel. `[text](node:<id>)` links jump to another node."
|
|
78
|
+
},
|
|
79
|
+
"children": {
|
|
80
|
+
"type": "array",
|
|
81
|
+
"items": {
|
|
82
|
+
"$ref": "#/$defs/node"
|
|
83
|
+
},
|
|
84
|
+
"description": "Ordered direct children. Omitted means unspecified; [] explicitly declares no children. Multiple declarations must name the same ids in the same order; child fields are composed independently by id."
|
|
85
|
+
},
|
|
86
|
+
"unordered": { "type": "boolean" },
|
|
87
|
+
"parent": false,
|
|
88
|
+
"order": false,
|
|
89
|
+
"layer": false
|
|
32
90
|
},
|
|
33
91
|
"additionalProperties": true
|
|
34
92
|
},
|
|
35
93
|
"edge": {
|
|
36
94
|
"type": "object",
|
|
37
95
|
"anyOf": [
|
|
38
|
-
{
|
|
39
|
-
|
|
96
|
+
{
|
|
97
|
+
"required": [
|
|
98
|
+
"source",
|
|
99
|
+
"target"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"required": [
|
|
104
|
+
"from",
|
|
105
|
+
"to"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
40
108
|
],
|
|
41
109
|
"properties": {
|
|
42
|
-
"source": {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
110
|
+
"source": {
|
|
111
|
+
"type": [
|
|
112
|
+
"string",
|
|
113
|
+
"number"
|
|
114
|
+
],
|
|
115
|
+
"description": "Node id the edge starts at."
|
|
116
|
+
},
|
|
117
|
+
"target": {
|
|
118
|
+
"type": [
|
|
119
|
+
"string",
|
|
120
|
+
"number"
|
|
121
|
+
],
|
|
122
|
+
"description": "Node id the edge points to."
|
|
123
|
+
},
|
|
124
|
+
"from": {
|
|
125
|
+
"type": [
|
|
126
|
+
"string",
|
|
127
|
+
"number"
|
|
128
|
+
],
|
|
129
|
+
"description": "Alias of `source`."
|
|
130
|
+
},
|
|
131
|
+
"to": {
|
|
132
|
+
"type": [
|
|
133
|
+
"string",
|
|
134
|
+
"number"
|
|
135
|
+
],
|
|
136
|
+
"description": "Alias of `target`."
|
|
137
|
+
},
|
|
138
|
+
"kind": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"description": "Relation type. Colors come from the profile's `edgePalette[kind]`. An edge is identified by its two ends plus its kind."
|
|
141
|
+
},
|
|
142
|
+
"label": {
|
|
143
|
+
"type": "string"
|
|
144
|
+
},
|
|
145
|
+
"weight": {
|
|
146
|
+
"type": "number",
|
|
147
|
+
"minimum": 0,
|
|
148
|
+
"maximum": 1,
|
|
149
|
+
"description": "0–1 (confidence, strength…); drives line width."
|
|
150
|
+
}
|
|
49
151
|
},
|
|
50
152
|
"additionalProperties": true
|
|
51
153
|
}
|