glassbrain 0.2.0-alpha.5 → 0.2.0-alpha.7
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-3KUNYSJE.js} +6 -3
- package/dist/chunks/{chunk-F4HDKER4.js → chunk-FNTYI7VP.js} +291 -112
- package/dist/chunks/{chunk-WUBELTBU.js → chunk-GZSWZSSE.js} +392 -339
- package/dist/chunks/{chunk-G7XWVKHN.js → chunk-LK77SYCN.js} +39 -5
- package/dist/chunks/{chunk-ISWKAU5G.js → chunk-Q35ZKWKF.js} +3 -5
- package/dist/cli/glassbrain.js +552 -380
- package/dist/cli/viewer.js +92 -63
- package/dist/core.d.ts +1 -0
- package/dist/core.js +13 -5
- package/dist/edit.d.ts +5 -3
- package/dist/index.js +15 -7
- package/dist/internal.js +15 -7
- package/dist/kinds.d.ts +23 -0
- package/dist/layers.d.ts +1 -1
- package/dist/model.d.ts +15 -5
- package/dist/profile.d.ts +14 -2
- package/dist/react/DetailPanel.js +2 -2
- package/dist/react/GlassPlanes.d.ts +11 -0
- package/dist/react/GraphCanvas.d.ts +2 -0
- package/dist/react/GraphCanvas.js +4 -4
- package/dist/react/icons.d.ts +2 -0
- package/dist/strings.d.ts +2 -2
- package/dist/tree.d.ts +11 -0
- package/package.json +1 -1
- package/schema/graph.schema.json +125 -23
- package/schema/profile.schema.json +2 -2
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
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://unpkg.com/glassbrain/schema/profile.schema.json",
|
|
4
4
|
"title": "glassbrain profile (_profile.json)",
|
|
5
|
-
"description": "The declarative part of a glassbrain profile, as a `_profile.json` next to the graph files. Everything is optional: with no profile a graph still renders (kinds without a color are drawn as skeleton). Layers are not configured here: they are derived from
|
|
5
|
+
"description": "The declarative part of a glassbrain profile, as a `_profile.json` next to the graph files. Everything is optional: with no profile a graph still renders (kinds without a color are drawn as skeleton). Layers are not configured here: they are derived from the order of children in the graph. Parsers, merge and domain validation are code and live in a TypeScript profile instead.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"nodePalette": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"properties": {
|
|
43
43
|
"defaultLayers": {
|
|
44
44
|
"type": "boolean",
|
|
45
|
-
"description": "Open with the layer (2.5D plane) view on when the graph has ordered siblings.
|
|
45
|
+
"description": "Open with the layer (2.5D plane) view on when the graph has ordered siblings. By default, opens layered when the graph has two or more floors."
|
|
46
46
|
},
|
|
47
47
|
"layerColors": {
|
|
48
48
|
"type": "array",
|