structured-context-map-views 0.6.2 → 0.7.1

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.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/dist/{ParameterControls-A1HJWyt9.js → ParameterControls-Be05VST0.js} +505 -188
  3. package/dist/ParameterControls-Be05VST0.js.map +1 -0
  4. package/dist/artifact.html +71 -2
  5. package/dist/artifact.js +2 -2
  6. package/dist/artifact.js.map +1 -1
  7. package/dist/cli.js +10 -8
  8. package/dist/cli.js.map +1 -1
  9. package/dist/{definition-Cp1CCigh.js → definition-SjmROmJC.js} +308 -188
  10. package/dist/definition-SjmROmJC.js.map +1 -0
  11. package/dist/html.js +1 -1
  12. package/dist/html.js.map +1 -1
  13. package/dist/index.js +3 -3
  14. package/dist/{node-B0VWZju6.js → node-ctbuxC-s.js} +5 -9
  15. package/dist/node-ctbuxC-s.js.map +1 -0
  16. package/dist/node.js +1 -1
  17. package/dist/page.html +94 -25
  18. package/dist/{projection-C-dATsdO.js → projection-DKNLziP0.js} +282 -124
  19. package/dist/projection-DKNLziP0.js.map +1 -0
  20. package/dist/read-definitions-DFcOXatz.js +51 -0
  21. package/dist/read-definitions-DFcOXatz.js.map +1 -0
  22. package/dist/styles.css +69 -0
  23. package/dist/types/artifact/load.d.ts +1 -1
  24. package/dist/types/{layouts/EdgeOverlay.d.ts → components/ConnectorOverlay.d.ts} +6 -15
  25. package/dist/types/components/GraphLayout.d.ts +8 -0
  26. package/dist/types/components/LandscapeLayout.d.ts +9 -0
  27. package/dist/types/{layouts → components}/MapView.d.ts +4 -1
  28. package/dist/types/components/NeighbourhoodLayout.d.ts +7 -0
  29. package/dist/types/{layouts/NodeCard.d.ts → components/NodeComponent.d.ts} +1 -1
  30. package/dist/types/components/TreeLayout.d.ts +6 -0
  31. package/dist/types/{layouts → components}/XYLayout.d.ts +3 -3
  32. package/dist/types/{layouts → components}/annotations-context.d.ts +1 -1
  33. package/dist/types/components/layout.d.ts +22 -0
  34. package/dist/types/core/annotations.d.ts +2 -3
  35. package/dist/types/core/definition.d.ts +664 -30
  36. package/dist/types/core/layouts/graph/schema.d.ts +24 -0
  37. package/dist/types/core/layouts/helpers.d.ts +42 -0
  38. package/dist/types/core/layouts/landscape/projection.d.ts +75 -0
  39. package/dist/types/core/layouts/landscape/schema.d.ts +223 -0
  40. package/dist/types/core/layouts/neighbourhood/projection.d.ts +26 -0
  41. package/dist/types/core/layouts/neighbourhood/schema.d.ts +51 -0
  42. package/dist/types/core/layouts/schemas.d.ts +427 -0
  43. package/dist/types/core/{tree.d.ts → layouts/tree/projection.d.ts} +9 -11
  44. package/dist/types/core/layouts/xy/projection.d.ts +32 -0
  45. package/dist/types/core/{format/xy-layout.d.ts → layouts/xy/schema.d.ts} +2 -0
  46. package/dist/types/core/{format → schema}/definition-schema.d.ts +22 -12
  47. package/dist/types/core/{snapshot.d.ts → space-snapshot.d.ts} +1 -4
  48. package/dist/types/index.d.ts +6 -9
  49. package/dist/types/node/index.d.ts +6 -12
  50. package/dist/types/node/page.d.ts +1 -1
  51. package/dist/types/node/snapshot.d.ts +1 -1
  52. package/dist/types/viewer/Viewer.d.ts +5 -5
  53. package/package.json +8 -6
  54. package/dist/ParameterControls-A1HJWyt9.js.map +0 -1
  55. package/dist/definition-Cp1CCigh.js.map +0 -1
  56. package/dist/node-B0VWZju6.js.map +0 -1
  57. package/dist/projection-C-dATsdO.js.map +0 -1
  58. package/dist/read-definitions-DNcsxgXM.js +0 -46
  59. package/dist/read-definitions-DNcsxgXM.js.map +0 -1
  60. package/dist/types/core/format/index.d.ts +0 -450
  61. package/dist/types/core/format/landscape-layout.d.ts +0 -102
  62. package/dist/types/core/graph.d.ts +0 -16
  63. package/dist/types/core/landscape.d.ts +0 -44
  64. package/dist/types/core/occurrence.d.ts +0 -11
  65. package/dist/types/core/xy.d.ts +0 -43
  66. package/dist/types/layouts/LandscapeLayout.d.ts +0 -8
  67. package/dist/types/layouts/TreeLayout.d.ts +0 -16
  68. /package/dist/types/{layouts → components}/ParameterControls.d.ts +0 -0
  69. /package/dist/types/{layouts → components}/ParameterInputs.d.ts +0 -0
  70. /package/dist/types/{layouts → components}/useParameterControls.d.ts +0 -0
  71. /package/dist/types/core/{format/tree-layout.d.ts → layouts/tree/schema.d.ts} +0 -0
  72. /package/dist/types/core/{format → schema}/param-ref.d.ts +0 -0
  73. /package/dist/types/core/{format → schema}/schema-url.d.ts +0 -0
  74. /package/dist/types/core/{format → schema}/settings.d.ts +0 -0
@@ -1,14 +1,655 @@
1
1
  import type { FromSchema } from 'json-schema-to-ts';
2
- import { definitionSchema, type landscapeLayoutSchema, MAP_VIEW_SCHEMAS, type settingsSchema, type treeLayoutSchema, type xyLayoutSchema } from './format';
3
- export { MAP_VIEW_SCHEMAS };
2
+ import { layoutSchemas } from './layouts/schemas';
3
+ import { definitionSchema } from './schema/definition-schema';
4
+ import { settingsSchema } from './schema/settings';
5
+ /** The bundled schemas describing the map view definition format. */
6
+ export declare const MAP_VIEW_SCHEMAS: readonly [{
7
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
8
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json";
9
+ readonly title: 'Map view definition';
10
+ readonly description: 'Declares how spaces of one schema are projected into a map view: shared parameters, and the regions the map view is composed of.';
11
+ readonly type: 'object';
12
+ readonly required: readonly ['$id', 'regions'];
13
+ readonly additionalProperties: false;
14
+ readonly properties: {
15
+ readonly $schema: {
16
+ readonly type: 'string';
17
+ };
18
+ readonly $id: {
19
+ readonly type: 'string';
20
+ readonly pattern: '^sctx-map-view://[^/]+(/[^/]+)?$';
21
+ readonly description: 'Identifier, namespaced by where the definition is found: "sctx-map-view://core/<name>" (bundled), "sctx-map-view://<plugin>/<name>" (a plugin) or "sctx-map-view://<name>" (the config folder).';
22
+ };
23
+ readonly title: {
24
+ readonly type: 'string';
25
+ readonly minLength: 1;
26
+ readonly description: 'Display name. Defaults to the last segment of the `$id`.';
27
+ };
28
+ readonly description: {
29
+ readonly type: 'string';
30
+ };
31
+ readonly schema: {
32
+ readonly type: 'string';
33
+ readonly minLength: 1;
34
+ readonly description: '`$id` of the structured-context schema whose spaces this map view applies to. Omitted: it applies to every schema.';
35
+ };
36
+ readonly parameters: {
37
+ readonly type: 'object';
38
+ readonly description: 'Settings the reader can change. Each is a JSON Schema with a default, bound to settings anywhere in the definition with { "$param": "<name>" }.';
39
+ readonly additionalProperties: {
40
+ readonly $ref: '#/$defs/parameter';
41
+ };
42
+ };
43
+ readonly regions: {
44
+ readonly type: 'array';
45
+ readonly minItems: 1;
46
+ readonly description: 'Parts of the map view, each with its own layout, nodes and edges. Only the first region is rendered for now.';
47
+ readonly items: {
48
+ readonly $ref: '#/$defs/region';
49
+ };
50
+ };
51
+ };
52
+ readonly $defs: {
53
+ readonly parameter: {
54
+ readonly type: 'object';
55
+ readonly description: "A JSON Schema for the parameter's values (it can $ref, narrow or extend the bundled setting definitions), plus a title for its control.";
56
+ readonly required: readonly ['default'];
57
+ readonly properties: {
58
+ readonly title: {
59
+ readonly type: 'string';
60
+ };
61
+ readonly description: {
62
+ readonly type: 'string';
63
+ };
64
+ readonly default: {};
65
+ };
66
+ };
67
+ readonly paramRef: {
68
+ readonly type: 'object';
69
+ readonly description: "Takes this setting's value from a declared parameter.";
70
+ readonly required: readonly ['$param'];
71
+ readonly additionalProperties: false;
72
+ readonly properties: {
73
+ readonly $param: {
74
+ readonly type: 'string';
75
+ readonly minLength: 1;
76
+ };
77
+ };
78
+ };
79
+ readonly region: {
80
+ readonly type: 'object';
81
+ readonly required: readonly ['id', 'layout'];
82
+ readonly additionalProperties: false;
83
+ readonly properties: {
84
+ readonly id: {
85
+ readonly type: 'string';
86
+ readonly minLength: 1;
87
+ readonly description: 'Unique within the map view; part of every occurrence key in the region.';
88
+ };
89
+ readonly select: {
90
+ readonly type: 'object';
91
+ readonly description: 'Which nodes of the space the region shows. By default, all of them.';
92
+ readonly additionalProperties: false;
93
+ readonly properties: {
94
+ readonly filter: {
95
+ readonly type: 'string';
96
+ readonly minLength: 1;
97
+ readonly description: "A structured-context filter: a view name from the space's config, or an expression such as `WHERE …` or `SELECT … WHERE …`.";
98
+ };
99
+ };
100
+ };
101
+ readonly layout: {
102
+ readonly description: 'How the region is arranged, chosen by `type`.';
103
+ readonly type: 'object';
104
+ readonly required: readonly ['type'];
105
+ readonly discriminator: {
106
+ readonly propertyName: 'type';
107
+ };
108
+ readonly oneOf: readonly [{
109
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json";
110
+ }, {
111
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json";
112
+ }, {
113
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json";
114
+ }, {
115
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/neighbourhood.json";
116
+ }, {
117
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/graph.json";
118
+ }];
119
+ };
120
+ readonly nodes: {
121
+ readonly type: 'object';
122
+ readonly additionalProperties: false;
123
+ readonly default: {};
124
+ readonly properties: {
125
+ readonly style: {
126
+ readonly description: string;
127
+ readonly default: "card";
128
+ readonly anyOf: readonly [{
129
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/nodeStyle";
130
+ }, {
131
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
132
+ }];
133
+ };
134
+ readonly fields: {
135
+ readonly description: string;
136
+ readonly default: readonly [];
137
+ readonly anyOf: readonly [{
138
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
139
+ }, {
140
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
141
+ }];
142
+ };
143
+ readonly validation: {
144
+ readonly description: string;
145
+ readonly default: "off";
146
+ readonly anyOf: readonly [{
147
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/validationLevel";
148
+ }, {
149
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
150
+ }];
151
+ };
152
+ readonly validationSources: {
153
+ readonly description: string;
154
+ readonly default: readonly ["parse", "schema", "duplicate", "broken-link", "hierarchy", "rule", "gated", "content-link"];
155
+ readonly anyOf: readonly [{
156
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/validationSources";
157
+ }, {
158
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
159
+ }];
160
+ };
161
+ };
162
+ };
163
+ readonly edges: {
164
+ readonly type: 'object';
165
+ readonly additionalProperties: false;
166
+ readonly default: {};
167
+ readonly properties: {
168
+ readonly show: {
169
+ readonly description: string;
170
+ readonly default: true;
171
+ readonly anyOf: readonly [{
172
+ readonly type: "boolean";
173
+ }, {
174
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
175
+ }];
176
+ };
177
+ readonly labels: {
178
+ readonly description: string;
179
+ readonly default: false;
180
+ readonly anyOf: readonly [{
181
+ readonly type: "boolean";
182
+ }, {
183
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
184
+ }];
185
+ };
186
+ };
187
+ };
188
+ };
189
+ };
190
+ };
191
+ }, {
192
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
193
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json";
194
+ readonly title: 'Shared map view settings';
195
+ readonly description: 'Reusable setting definitions. Parameters can $ref these and narrow them, e.g. with allOf and enum.';
196
+ readonly $defs: {
197
+ readonly orientation: {
198
+ readonly title: 'Orientation';
199
+ readonly enum: readonly ['vertical', 'horizontal'];
200
+ };
201
+ readonly nodeStyle: {
202
+ readonly title: 'Node style';
203
+ readonly description: 'card: a box with the title and selected fields. shape: a compact marker with a tooltip.';
204
+ readonly enum: readonly ['card', 'shape'];
205
+ };
206
+ readonly validationLevel: {
207
+ readonly title: 'Validation overlay';
208
+ readonly description: 'The lowest severity of validation result shown on nodes, or off. error: only errors. warning: errors and warnings. info: everything.';
209
+ readonly enum: readonly ['off', 'error', 'warning', 'info'];
210
+ };
211
+ readonly validationSources: {
212
+ readonly title: 'Validation sources';
213
+ readonly description: 'Which kinds of validation result are shown. schema: a node failing its schema. duplicate: an id more than one node uses. broken-link: a relationship to a node that does not exist. hierarchy: a node under a parent type it is not allowed under. rule: a schema rule violation. gated: a note that rules were not checked because an ancestor failed. content-link: a link in the body that resolves to no node.';
214
+ readonly type: 'array';
215
+ readonly items: {
216
+ readonly enum: readonly ["parse", "schema", "duplicate", "broken-link", "hierarchy", "rule", "gated", "content-link"];
217
+ };
218
+ readonly uniqueItems: true;
219
+ };
220
+ readonly fieldList: {
221
+ readonly title: 'Fields';
222
+ readonly type: 'array';
223
+ readonly items: {
224
+ readonly type: 'string';
225
+ readonly minLength: 1;
226
+ };
227
+ readonly uniqueItems: true;
228
+ };
229
+ };
230
+ }, {
231
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
232
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json";
233
+ readonly title: 'Tree layout';
234
+ readonly description: "A tree over the schema's hierarchy: root-type nodes at the top, children via hierarchy edges.";
235
+ readonly type: 'object';
236
+ readonly required: readonly ['type'];
237
+ readonly additionalProperties: false;
238
+ readonly properties: {
239
+ readonly type: {
240
+ readonly const: 'tree';
241
+ };
242
+ readonly orientation: {
243
+ readonly description: string;
244
+ readonly default: "vertical";
245
+ readonly anyOf: readonly [{
246
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/orientation";
247
+ }, {
248
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
249
+ }];
250
+ };
251
+ readonly dag: {
252
+ readonly description: string;
253
+ readonly default: "repeat";
254
+ readonly anyOf: readonly [{
255
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json#/$defs/dag";
256
+ }, {
257
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
258
+ }];
259
+ };
260
+ };
261
+ readonly $defs: {
262
+ readonly dag: {
263
+ readonly title: 'Nodes with several parents';
264
+ readonly description: 'repeat: the node appears under each parent, its subtree shown once. cross-edge: the node appears under its first parent, with extra connectors from the others.';
265
+ readonly enum: readonly ['repeat', 'cross-edge'];
266
+ };
267
+ };
268
+ }, {
269
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
270
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json";
271
+ readonly title: 'Landscape layout';
272
+ readonly description: "Strips, one after the other. Each strip nests its grouping levels, and its last level is drawn as nodes. A dimension divides a strip into cells: the layout's dimension divides every strip alike, so they line up, and a strip's own dimension divides that strip further.";
273
+ readonly type: 'object';
274
+ readonly required: readonly ['type', 'strips'];
275
+ readonly additionalProperties: false;
276
+ readonly properties: {
277
+ readonly type: {
278
+ readonly const: 'landscape';
279
+ };
280
+ readonly orientation: {
281
+ readonly description: string;
282
+ readonly default: "horizontal";
283
+ readonly anyOf: readonly [{
284
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/orientation";
285
+ }, {
286
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
287
+ }];
288
+ };
289
+ readonly dimension: {
290
+ readonly type: 'object';
291
+ readonly if: {
292
+ readonly type: 'object';
293
+ readonly required: readonly ['field'];
294
+ };
295
+ readonly then: {
296
+ readonly type: 'object';
297
+ readonly description: "Groups labelled by the values of a field of the strip's first node level. A value no node has is not a group.";
298
+ readonly required: readonly ['field'];
299
+ readonly additionalProperties: false;
300
+ readonly properties: {
301
+ readonly field: {
302
+ readonly type: 'string';
303
+ readonly minLength: 1;
304
+ };
305
+ };
306
+ };
307
+ readonly else: {
308
+ readonly type: 'object';
309
+ readonly description: 'A group for every node of one type.';
310
+ readonly required: readonly ['type'];
311
+ readonly additionalProperties: false;
312
+ readonly properties: {
313
+ readonly type: {
314
+ readonly description: 'Node type of the groups.';
315
+ readonly anyOf: readonly [{
316
+ readonly type: 'string';
317
+ readonly minLength: 1;
318
+ }, {
319
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
320
+ }];
321
+ };
322
+ readonly edge: {
323
+ readonly type: 'object';
324
+ readonly description: "Which edges join a group's node to the strip's first node level, or to its last `via` type. By default, any edge between the two types, in either direction.";
325
+ readonly required: readonly ['field'];
326
+ readonly additionalProperties: false;
327
+ readonly properties: {
328
+ readonly field: {
329
+ readonly type: 'string';
330
+ readonly minLength: 1;
331
+ };
332
+ };
333
+ };
334
+ };
335
+ };
336
+ readonly description: 'Divides every strip. Its groups are worked out once, so every strip has the same groups in the same order, and a cell exists even when it is empty.';
337
+ };
338
+ readonly strips: {
339
+ readonly type: 'array';
340
+ readonly minItems: 1;
341
+ readonly description: 'The strips, in order along the axis the layout dimension does not run along.';
342
+ readonly items: {
343
+ readonly type: 'object';
344
+ readonly required: readonly ['group'];
345
+ readonly additionalProperties: false;
346
+ readonly properties: {
347
+ readonly dimension: {
348
+ readonly type: 'object';
349
+ readonly if: {
350
+ readonly type: 'object';
351
+ readonly required: readonly ['field'];
352
+ };
353
+ readonly then: {
354
+ readonly type: 'object';
355
+ readonly description: "Groups labelled by the values of a field of the strip's first node level. A value no node has is not a group.";
356
+ readonly required: readonly ['field'];
357
+ readonly additionalProperties: false;
358
+ readonly properties: {
359
+ readonly field: {
360
+ readonly type: 'string';
361
+ readonly minLength: 1;
362
+ };
363
+ };
364
+ };
365
+ readonly else: {
366
+ readonly type: 'object';
367
+ readonly description: 'A group for every node of one type.';
368
+ readonly required: readonly ['type'];
369
+ readonly additionalProperties: false;
370
+ readonly properties: {
371
+ readonly type: {
372
+ readonly description: 'Node type of the groups.';
373
+ readonly anyOf: readonly [{
374
+ readonly type: 'string';
375
+ readonly minLength: 1;
376
+ }, {
377
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
378
+ }];
379
+ };
380
+ readonly edge: {
381
+ readonly type: 'object';
382
+ readonly description: "Which edges join a group's node to the strip's first node level, or to its last `via` type. By default, any edge between the two types, in either direction.";
383
+ readonly required: readonly ['field'];
384
+ readonly additionalProperties: false;
385
+ readonly properties: {
386
+ readonly field: {
387
+ readonly type: 'string';
388
+ readonly minLength: 1;
389
+ };
390
+ };
391
+ };
392
+ };
393
+ };
394
+ readonly description: "Divides this strip further, along the strip's own axis. Without a layout dimension, a strip with its own dimension is a swimlane.";
395
+ };
396
+ readonly showUngrouped: {
397
+ readonly description: string;
398
+ readonly default: true;
399
+ readonly anyOf: readonly [{
400
+ readonly type: "boolean";
401
+ }, {
402
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
403
+ }];
404
+ };
405
+ readonly group: {
406
+ readonly type: 'array';
407
+ readonly minItems: 1;
408
+ readonly description: 'Grouping levels, outermost first. The last level is drawn as nodes; the others as containers. Adjacent node levels are joined by any edge between their types, in either direction. In a strip with a dimension, the first level is joined to each dimension node the same way, so `edge` and `via` apply there.';
409
+ readonly items: {
410
+ readonly type: 'object';
411
+ readonly if: {
412
+ readonly type: 'object';
413
+ readonly required: readonly ['field'];
414
+ };
415
+ readonly then: {
416
+ readonly type: 'object';
417
+ readonly description: "Containers labelled by the values of a field of the next node level's nodes. A node with several values appears under each.";
418
+ readonly required: readonly ['field'];
419
+ readonly additionalProperties: false;
420
+ readonly properties: {
421
+ readonly field: {
422
+ readonly type: 'string';
423
+ readonly minLength: 1;
424
+ };
425
+ };
426
+ };
427
+ readonly else: {
428
+ readonly type: 'object';
429
+ readonly description: 'A level of nodes of one type.';
430
+ readonly required: readonly ['type'];
431
+ readonly additionalProperties: false;
432
+ readonly properties: {
433
+ readonly type: {
434
+ readonly description: 'Node type at this level.';
435
+ readonly anyOf: readonly [{
436
+ readonly type: 'string';
437
+ readonly minLength: 1;
438
+ }, {
439
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
440
+ }];
441
+ };
442
+ readonly edge: {
443
+ readonly type: 'object';
444
+ readonly description: 'Which edges join this level to the node level above (or to the last `via` type). By default, any edge between the two types.';
445
+ readonly required: readonly ['field'];
446
+ readonly additionalProperties: false;
447
+ readonly properties: {
448
+ readonly field: {
449
+ readonly type: 'string';
450
+ readonly minLength: 1;
451
+ };
452
+ };
453
+ };
454
+ readonly via: {
455
+ readonly type: 'array';
456
+ readonly minItems: 1;
457
+ readonly description: "Types skipped between the node level above (or the dimension's node) and this one, in order. Nodes are joined through a chain of edges across them. Ignored on the first level of a strip with no dimension.";
458
+ readonly items: {
459
+ readonly type: 'string';
460
+ readonly minLength: 1;
461
+ };
462
+ };
463
+ readonly intermediate: {
464
+ readonly description: string;
465
+ readonly default: "hidden";
466
+ readonly anyOf: readonly [{
467
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json#/$defs/intermediate";
468
+ }, {
469
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
470
+ }];
471
+ };
472
+ };
473
+ };
474
+ };
475
+ };
476
+ };
477
+ };
478
+ };
479
+ };
480
+ readonly $defs: {
481
+ readonly intermediate: {
482
+ readonly title: 'Skipped levels';
483
+ readonly description: 'hidden: not shown. breadcrumb: listed on each node reached through them.';
484
+ readonly enum: readonly ['hidden', 'breadcrumb'];
485
+ };
486
+ };
487
+ }, {
488
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
489
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json";
490
+ readonly title: 'XY layout';
491
+ readonly description: 'Nodes positioned on two axes by numeric fields. Nodes of the plotted types without a usable value on both axes are listed beside the plot, not dropped.';
492
+ readonly type: 'object';
493
+ readonly required: readonly ['type', 'x', 'y'];
494
+ readonly additionalProperties: false;
495
+ readonly properties: {
496
+ readonly type: {
497
+ readonly const: 'xy';
498
+ };
499
+ readonly x: {
500
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/axis";
501
+ };
502
+ readonly y: {
503
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/axis";
504
+ };
505
+ readonly types: {
506
+ readonly description: string;
507
+ readonly default: readonly [];
508
+ readonly anyOf: readonly [{
509
+ readonly type: "array";
510
+ readonly items: {
511
+ readonly type: "string";
512
+ readonly minLength: 1;
513
+ };
514
+ readonly uniqueItems: true;
515
+ }, {
516
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
517
+ }];
518
+ };
519
+ readonly edgeFields: {
520
+ readonly description: string;
521
+ readonly default: readonly [];
522
+ readonly anyOf: readonly [{
523
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
524
+ }, {
525
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
526
+ }];
527
+ };
528
+ };
529
+ readonly $defs: {
530
+ readonly axis: {
531
+ readonly title: 'Axis';
532
+ readonly type: 'object';
533
+ readonly required: readonly ['field'];
534
+ readonly additionalProperties: false;
535
+ readonly properties: {
536
+ readonly field: {
537
+ readonly description: 'Numeric field giving the position.';
538
+ readonly anyOf: readonly [{
539
+ readonly type: 'string';
540
+ readonly minLength: 1;
541
+ }, {
542
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
543
+ }];
544
+ };
545
+ readonly domain: {
546
+ readonly description: 'Values at the two ends of the axis: [min, max], or "data" for the smallest and largest plotted values. Nodes outside a fixed domain are listed as unplaced.';
547
+ readonly default: 'data';
548
+ readonly anyOf: readonly [{
549
+ readonly const: 'data';
550
+ }, {
551
+ readonly type: 'array';
552
+ readonly items: {
553
+ readonly type: 'number';
554
+ };
555
+ readonly minItems: 2;
556
+ readonly maxItems: 2;
557
+ }];
558
+ };
559
+ readonly direction: {
560
+ readonly description: string;
561
+ readonly default: "ascending";
562
+ readonly anyOf: readonly [{
563
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/direction";
564
+ }, {
565
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
566
+ }];
567
+ };
568
+ readonly label: {
569
+ readonly type: 'string';
570
+ readonly description: 'Axis title. Defaults to the field name.';
571
+ };
572
+ };
573
+ };
574
+ readonly direction: {
575
+ readonly title: 'Axis direction';
576
+ readonly enum: readonly ['ascending', 'descending'];
577
+ };
578
+ };
579
+ }, {
580
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
581
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/neighbourhood.json";
582
+ readonly title: 'Neighbourhood layout';
583
+ readonly description: 'The neighbourhood of one focus node, with related nodes placed around it by role. By default the hierarchy runs down the page (parents above, children below), relationships in either direction sit to the left and the siblings of the focus to the right; with no hierarchy, every edge runs down the page. A role that lists a field takes the nodes that field joins to the focus, in either direction. A node joined by several fields is placed once, by the first of above, below, left, right.';
584
+ readonly type: 'object';
585
+ readonly required: readonly ['type'];
586
+ readonly additionalProperties: false;
587
+ readonly properties: {
588
+ readonly type: {
589
+ readonly const: 'neighbourhood';
590
+ };
591
+ readonly above: {
592
+ readonly description: string;
593
+ readonly default: readonly [];
594
+ readonly anyOf: readonly [{
595
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
596
+ }, {
597
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
598
+ }];
599
+ };
600
+ readonly below: {
601
+ readonly description: string;
602
+ readonly default: readonly [];
603
+ readonly anyOf: readonly [{
604
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
605
+ }, {
606
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
607
+ }];
608
+ };
609
+ readonly left: {
610
+ readonly description: string;
611
+ readonly default: readonly [];
612
+ readonly anyOf: readonly [{
613
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
614
+ }, {
615
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
616
+ }];
617
+ };
618
+ readonly right: {
619
+ readonly description: string;
620
+ readonly default: readonly [];
621
+ readonly anyOf: readonly [{
622
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
623
+ }, {
624
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
625
+ }];
626
+ };
627
+ };
628
+ }, {
629
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
630
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/graph.json";
631
+ readonly title: 'Graph layout';
632
+ readonly description: 'Nodes and edges as a network: connected nodes sit close together. Works with any schema.';
633
+ readonly type: 'object';
634
+ readonly required: readonly ['type'];
635
+ readonly additionalProperties: false;
636
+ readonly properties: {
637
+ readonly type: {
638
+ readonly const: 'graph';
639
+ };
640
+ readonly edgeFields: {
641
+ readonly description: string;
642
+ readonly default: readonly [];
643
+ readonly anyOf: readonly [{
644
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
645
+ }, {
646
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
647
+ }];
648
+ };
649
+ };
650
+ }];
4
651
  type References = {
5
- references: [
6
- typeof settingsSchema,
7
- typeof treeLayoutSchema,
8
- typeof landscapeLayoutSchema,
9
- typeof xyLayoutSchema,
10
- typeof definitionSchema
11
- ];
652
+ references: [typeof settingsSchema, ...typeof layoutSchemas, typeof definitionSchema];
12
653
  parseIfThenElseKeywords: true;
13
654
  };
14
655
  type ParamRef = {
@@ -23,28 +664,20 @@ export type AuthoredDefinition = FromSchema<typeof definitionSchema, References
23
664
  keepDefaultedPropertiesOptional: true;
24
665
  }>;
25
666
  type FilledDefinition = FromSchema<typeof definitionSchema, References>;
667
+ type LayoutOf<L extends {
668
+ type: string;
669
+ }, T extends L['type']> = Extract<L, {
670
+ type: T;
671
+ }>;
672
+ /** One layout's settings as authored. */
673
+ export type AuthoredLayout<T extends AuthoredDefinition['regions'][number]['layout']['type'] = AuthoredDefinition['regions'][number]['layout']['type']> = LayoutOf<AuthoredDefinition['regions'][number]['layout'], T>;
26
674
  /** A region with parameters applied and defaults filled in: what layouts receive. */
27
675
  export type Region = Resolved<FilledDefinition['regions'][number]>;
28
- export type LayoutConfig = Region['layout'];
29
- export type TreeLayoutConfig = Extract<LayoutConfig, {
30
- type: 'tree';
31
- }>;
32
- export type LandscapeLayoutConfig = Extract<LayoutConfig, {
33
- type: 'landscape';
34
- }>;
35
- export type XYLayoutConfig = Extract<LayoutConfig, {
36
- type: 'xy';
37
- }>;
38
- export type AxisConfig = XYLayoutConfig['x'];
39
- export type GroupLevel = LandscapeLayoutConfig['group'][number];
40
- export type IntermediateDisplay = Extract<GroupLevel, {
41
- type: string;
42
- }>['intermediate'];
676
+ /** A layout's settings, resolved: every layout's, or those of the layout `T` names. */
677
+ export type LayoutConfig<T extends Region['layout']['type'] = Region['layout']['type']> = LayoutOf<Region['layout'], T>;
43
678
  export type NodesConfig = Region['nodes'];
44
679
  export type EdgesConfig = Region['edges'];
45
- export type Orientation = TreeLayoutConfig['orientation'];
46
- export type DagMode = TreeLayoutConfig['dag'];
47
- export type NodeStyle = NodesConfig['style'];
680
+ export type Orientation = LayoutConfig<'tree'>['orientation'];
48
681
  /**
49
682
  * A validated map view definition. Plain data, so hosts can pass it across a server/browser
50
683
  * boundary. Settings in `source` may still be `{ $param }` bindings; {@link resolveRegions}
@@ -55,8 +688,8 @@ export type MapViewDefinition = {
55
688
  id: string;
56
689
  title: string;
57
690
  description?: string;
58
- /** `$id` of the schema whose spaces this map view applies to. */
59
- schema: string;
691
+ /** `$id` of the schema whose spaces this map view applies to; unset: every schema. */
692
+ schema?: string;
60
693
  parameters: Parameter[];
61
694
  /** The definition as authored. */
62
695
  source: AuthoredDefinition;
@@ -113,5 +746,6 @@ export declare function selectionFilter(definition: MapViewDefinition, values?:
113
746
  * decide whether to run validation at all, since results are only drawn when this isn't `off`.
114
747
  */
115
748
  export declare function viewValidationLevel(definition: MapViewDefinition, values?: ParameterValues): NodesConfig['validation'];
116
- /** Map view definitions that apply to a space with the given schema. */
749
+ /** Map view definitions that apply to a space with the given schema, including those for every schema. */
117
750
  export declare function mapViewsForSchema(definitions: readonly MapViewDefinition[], schemaId: string | undefined): MapViewDefinition[];
751
+ export {};