structured-context-map-views 0.6.2 → 0.7.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.
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 +70 -1
  5. package/dist/artifact.js +2 -2
  6. package/dist/artifact.js.map +1 -1
  7. package/dist/cli.js +8 -6
  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 +6 -4
  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
@@ -0,0 +1,427 @@
1
+ import type { AuthoredLayout } from '../definition';
2
+ /** Every layout's settings schema. The definition format and its types follow from this list. */
3
+ export declare const layoutSchemas: readonly [{
4
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
5
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json";
6
+ readonly title: 'Tree layout';
7
+ readonly description: "A tree over the schema's hierarchy: root-type nodes at the top, children via hierarchy edges.";
8
+ readonly type: 'object';
9
+ readonly required: readonly ['type'];
10
+ readonly additionalProperties: false;
11
+ readonly properties: {
12
+ readonly type: {
13
+ readonly const: 'tree';
14
+ };
15
+ readonly orientation: {
16
+ readonly description: string;
17
+ readonly default: "vertical";
18
+ readonly anyOf: readonly [{
19
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/orientation";
20
+ }, {
21
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
22
+ }];
23
+ };
24
+ readonly dag: {
25
+ readonly description: string;
26
+ readonly default: "repeat";
27
+ readonly anyOf: readonly [{
28
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json#/$defs/dag";
29
+ }, {
30
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
31
+ }];
32
+ };
33
+ };
34
+ readonly $defs: {
35
+ readonly dag: {
36
+ readonly title: 'Nodes with several parents';
37
+ 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.';
38
+ readonly enum: readonly ['repeat', 'cross-edge'];
39
+ };
40
+ };
41
+ }, {
42
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
43
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json";
44
+ readonly title: 'Landscape layout';
45
+ 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.";
46
+ readonly type: 'object';
47
+ readonly required: readonly ['type', 'strips'];
48
+ readonly additionalProperties: false;
49
+ readonly properties: {
50
+ readonly type: {
51
+ readonly const: 'landscape';
52
+ };
53
+ readonly orientation: {
54
+ readonly description: string;
55
+ readonly default: "horizontal";
56
+ readonly anyOf: readonly [{
57
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/orientation";
58
+ }, {
59
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
60
+ }];
61
+ };
62
+ readonly dimension: {
63
+ readonly type: 'object';
64
+ readonly if: {
65
+ readonly type: 'object';
66
+ readonly required: readonly ['field'];
67
+ };
68
+ readonly then: {
69
+ readonly type: 'object';
70
+ 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.";
71
+ readonly required: readonly ['field'];
72
+ readonly additionalProperties: false;
73
+ readonly properties: {
74
+ readonly field: {
75
+ readonly type: 'string';
76
+ readonly minLength: 1;
77
+ };
78
+ };
79
+ };
80
+ readonly else: {
81
+ readonly type: 'object';
82
+ readonly description: 'A group for every node of one type.';
83
+ readonly required: readonly ['type'];
84
+ readonly additionalProperties: false;
85
+ readonly properties: {
86
+ readonly type: {
87
+ readonly description: 'Node type of the groups.';
88
+ readonly anyOf: readonly [{
89
+ readonly type: 'string';
90
+ readonly minLength: 1;
91
+ }, {
92
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
93
+ }];
94
+ };
95
+ readonly edge: {
96
+ readonly type: 'object';
97
+ 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.";
98
+ readonly required: readonly ['field'];
99
+ readonly additionalProperties: false;
100
+ readonly properties: {
101
+ readonly field: {
102
+ readonly type: 'string';
103
+ readonly minLength: 1;
104
+ };
105
+ };
106
+ };
107
+ };
108
+ };
109
+ 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.';
110
+ };
111
+ readonly strips: {
112
+ readonly type: 'array';
113
+ readonly minItems: 1;
114
+ readonly description: 'The strips, in order along the axis the layout dimension does not run along.';
115
+ readonly items: {
116
+ readonly type: 'object';
117
+ readonly required: readonly ['group'];
118
+ readonly additionalProperties: false;
119
+ readonly properties: {
120
+ readonly dimension: {
121
+ readonly type: 'object';
122
+ readonly if: {
123
+ readonly type: 'object';
124
+ readonly required: readonly ['field'];
125
+ };
126
+ readonly then: {
127
+ readonly type: 'object';
128
+ 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.";
129
+ readonly required: readonly ['field'];
130
+ readonly additionalProperties: false;
131
+ readonly properties: {
132
+ readonly field: {
133
+ readonly type: 'string';
134
+ readonly minLength: 1;
135
+ };
136
+ };
137
+ };
138
+ readonly else: {
139
+ readonly type: 'object';
140
+ readonly description: 'A group for every node of one type.';
141
+ readonly required: readonly ['type'];
142
+ readonly additionalProperties: false;
143
+ readonly properties: {
144
+ readonly type: {
145
+ readonly description: 'Node type of the groups.';
146
+ readonly anyOf: readonly [{
147
+ readonly type: 'string';
148
+ readonly minLength: 1;
149
+ }, {
150
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
151
+ }];
152
+ };
153
+ readonly edge: {
154
+ readonly type: 'object';
155
+ 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.";
156
+ readonly required: readonly ['field'];
157
+ readonly additionalProperties: false;
158
+ readonly properties: {
159
+ readonly field: {
160
+ readonly type: 'string';
161
+ readonly minLength: 1;
162
+ };
163
+ };
164
+ };
165
+ };
166
+ };
167
+ 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.";
168
+ };
169
+ readonly showUngrouped: {
170
+ readonly description: string;
171
+ readonly default: true;
172
+ readonly anyOf: readonly [{
173
+ readonly type: "boolean";
174
+ }, {
175
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
176
+ }];
177
+ };
178
+ readonly group: {
179
+ readonly type: 'array';
180
+ readonly minItems: 1;
181
+ 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.';
182
+ readonly items: {
183
+ readonly type: 'object';
184
+ readonly if: {
185
+ readonly type: 'object';
186
+ readonly required: readonly ['field'];
187
+ };
188
+ readonly then: {
189
+ readonly type: 'object';
190
+ 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.";
191
+ readonly required: readonly ['field'];
192
+ readonly additionalProperties: false;
193
+ readonly properties: {
194
+ readonly field: {
195
+ readonly type: 'string';
196
+ readonly minLength: 1;
197
+ };
198
+ };
199
+ };
200
+ readonly else: {
201
+ readonly type: 'object';
202
+ readonly description: 'A level of nodes of one type.';
203
+ readonly required: readonly ['type'];
204
+ readonly additionalProperties: false;
205
+ readonly properties: {
206
+ readonly type: {
207
+ readonly description: 'Node type at this level.';
208
+ readonly anyOf: readonly [{
209
+ readonly type: 'string';
210
+ readonly minLength: 1;
211
+ }, {
212
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
213
+ }];
214
+ };
215
+ readonly edge: {
216
+ readonly type: 'object';
217
+ 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.';
218
+ readonly required: readonly ['field'];
219
+ readonly additionalProperties: false;
220
+ readonly properties: {
221
+ readonly field: {
222
+ readonly type: 'string';
223
+ readonly minLength: 1;
224
+ };
225
+ };
226
+ };
227
+ readonly via: {
228
+ readonly type: 'array';
229
+ readonly minItems: 1;
230
+ 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.";
231
+ readonly items: {
232
+ readonly type: 'string';
233
+ readonly minLength: 1;
234
+ };
235
+ };
236
+ readonly intermediate: {
237
+ readonly description: string;
238
+ readonly default: "hidden";
239
+ readonly anyOf: readonly [{
240
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json#/$defs/intermediate";
241
+ }, {
242
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
243
+ }];
244
+ };
245
+ };
246
+ };
247
+ };
248
+ };
249
+ };
250
+ };
251
+ };
252
+ };
253
+ readonly $defs: {
254
+ readonly intermediate: {
255
+ readonly title: 'Skipped levels';
256
+ readonly description: 'hidden: not shown. breadcrumb: listed on each node reached through them.';
257
+ readonly enum: readonly ['hidden', 'breadcrumb'];
258
+ };
259
+ };
260
+ }, {
261
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
262
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json";
263
+ readonly title: 'XY layout';
264
+ 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.';
265
+ readonly type: 'object';
266
+ readonly required: readonly ['type', 'x', 'y'];
267
+ readonly additionalProperties: false;
268
+ readonly properties: {
269
+ readonly type: {
270
+ readonly const: 'xy';
271
+ };
272
+ readonly x: {
273
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/axis";
274
+ };
275
+ readonly y: {
276
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/axis";
277
+ };
278
+ readonly types: {
279
+ readonly description: string;
280
+ readonly default: readonly [];
281
+ readonly anyOf: readonly [{
282
+ readonly type: "array";
283
+ readonly items: {
284
+ readonly type: "string";
285
+ readonly minLength: 1;
286
+ };
287
+ readonly uniqueItems: true;
288
+ }, {
289
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
290
+ }];
291
+ };
292
+ readonly edgeFields: {
293
+ readonly description: string;
294
+ readonly default: readonly [];
295
+ readonly anyOf: readonly [{
296
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
297
+ }, {
298
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
299
+ }];
300
+ };
301
+ };
302
+ readonly $defs: {
303
+ readonly axis: {
304
+ readonly title: 'Axis';
305
+ readonly type: 'object';
306
+ readonly required: readonly ['field'];
307
+ readonly additionalProperties: false;
308
+ readonly properties: {
309
+ readonly field: {
310
+ readonly description: 'Numeric field giving the position.';
311
+ readonly anyOf: readonly [{
312
+ readonly type: 'string';
313
+ readonly minLength: 1;
314
+ }, {
315
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
316
+ }];
317
+ };
318
+ readonly domain: {
319
+ 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.';
320
+ readonly default: 'data';
321
+ readonly anyOf: readonly [{
322
+ readonly const: 'data';
323
+ }, {
324
+ readonly type: 'array';
325
+ readonly items: {
326
+ readonly type: 'number';
327
+ };
328
+ readonly minItems: 2;
329
+ readonly maxItems: 2;
330
+ }];
331
+ };
332
+ readonly direction: {
333
+ readonly description: string;
334
+ readonly default: "ascending";
335
+ readonly anyOf: readonly [{
336
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/direction";
337
+ }, {
338
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
339
+ }];
340
+ };
341
+ readonly label: {
342
+ readonly type: 'string';
343
+ readonly description: 'Axis title. Defaults to the field name.';
344
+ };
345
+ };
346
+ };
347
+ readonly direction: {
348
+ readonly title: 'Axis direction';
349
+ readonly enum: readonly ['ascending', 'descending'];
350
+ };
351
+ };
352
+ }, {
353
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
354
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/neighbourhood.json";
355
+ readonly title: 'Neighbourhood layout';
356
+ 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.';
357
+ readonly type: 'object';
358
+ readonly required: readonly ['type'];
359
+ readonly additionalProperties: false;
360
+ readonly properties: {
361
+ readonly type: {
362
+ readonly const: 'neighbourhood';
363
+ };
364
+ readonly above: {
365
+ readonly description: string;
366
+ readonly default: readonly [];
367
+ readonly anyOf: readonly [{
368
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
369
+ }, {
370
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
371
+ }];
372
+ };
373
+ readonly below: {
374
+ readonly description: string;
375
+ readonly default: readonly [];
376
+ readonly anyOf: readonly [{
377
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
378
+ }, {
379
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
380
+ }];
381
+ };
382
+ readonly left: {
383
+ readonly description: string;
384
+ readonly default: readonly [];
385
+ readonly anyOf: readonly [{
386
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
387
+ }, {
388
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
389
+ }];
390
+ };
391
+ readonly right: {
392
+ readonly description: string;
393
+ readonly default: readonly [];
394
+ readonly anyOf: readonly [{
395
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
396
+ }, {
397
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
398
+ }];
399
+ };
400
+ };
401
+ }, {
402
+ readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
403
+ readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/graph.json";
404
+ readonly title: 'Graph layout';
405
+ readonly description: 'Nodes and edges as a network: connected nodes sit close together. Works with any schema.';
406
+ readonly type: 'object';
407
+ readonly required: readonly ['type'];
408
+ readonly additionalProperties: false;
409
+ readonly properties: {
410
+ readonly type: {
411
+ readonly const: 'graph';
412
+ };
413
+ readonly edgeFields: {
414
+ readonly description: string;
415
+ readonly default: readonly [];
416
+ readonly anyOf: readonly [{
417
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
418
+ }, {
419
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
420
+ }];
421
+ };
422
+ };
423
+ }];
424
+ /** Rules a layout's schema can't express. A check returns a message for settings that break one. */
425
+ export declare const layoutChecks: {
426
+ [T in AuthoredLayout['type']]?: (layout: AuthoredLayout<T>) => string | undefined;
427
+ };
@@ -1,5 +1,6 @@
1
1
  import type { SpaceGraph, SpaceNode } from 'structured-context/api';
2
- import type { DagMode } from './definition';
2
+ import type { LayoutConfig } from '../../definition';
3
+ import { type Connector } from '../helpers';
3
4
  /** One rendered appearance of a node in a tree. */
4
5
  export type TreeOccurrence = {
5
6
  /** Path-based key, unique within the map view (see {@link occurrenceKey}). */
@@ -11,6 +12,8 @@ export type TreeOccurrence = {
11
12
  * appears under each of them, but its subtree is only rendered at its first occurrence.
12
13
  */
13
14
  repeatOf?: string;
15
+ /** The field the parent declares this node through (the edge's label); unset for roots. */
16
+ field?: string;
14
17
  };
15
18
  export type Tree = {
16
19
  roots: TreeOccurrence[];
@@ -22,15 +25,10 @@ export type Tree = {
22
25
  /** Key of each node's primary (first, fully rendered) occurrence. */
23
26
  primary: ReadonlyMap<string, string>;
24
27
  /**
25
- * In cross-edge mode, links from a node's other parents to its primary occurrence, which
28
+ * In cross-edge mode, connectors from a node's other parents to its primary occurrence, which
26
29
  * replace repeat occurrences. Empty in repeat mode.
27
30
  */
28
- crossLinks: TreeLink[];
29
- };
30
- export type TreeLink = {
31
- from: string;
32
- to: string;
33
- kind: 'tree' | 'cross';
31
+ crossConnectors: Connector[];
34
32
  };
35
33
  /**
36
34
  * Lay a space out as a tree over its hierarchy.
@@ -40,6 +38,6 @@ export type TreeLink = {
40
38
  * node is either repeated without its subtree (`repeat`), or left out and linked by a cross-edge
41
39
  * (`cross-edge`). Either way traversal stops there, which also keeps cycles from recursing.
42
40
  */
43
- export declare function buildTree(graph: SpaceGraph, regionId: string, dag?: DagMode): Tree;
44
- /** Parent → child pairs of occurrence keys: one per rendered parent-child link, then cross-links. */
45
- export declare function treeLinks(tree: Tree): TreeLink[];
41
+ export declare function buildTree(graph: SpaceGraph, regionId: string, dag?: LayoutConfig<'tree'>['dag']): Tree;
42
+ /** Parent → child pairs of occurrence keys: one per rendered parent-child connector, then cross-edge connectors. */
43
+ export declare function treeConnectors(tree: Tree): Connector[];
@@ -0,0 +1,32 @@
1
+ import type { SpaceGraph, SpaceNode } from 'structured-context/api';
2
+ import type { LayoutConfig } from '../../definition';
3
+ import { type Connector } from '../helpers';
4
+ type XYPlot = {
5
+ /** `x` and `y` run from 0 to 1 across the plot, left to right and bottom to top. */
6
+ points: {
7
+ key: string;
8
+ node: SpaceNode;
9
+ x: number;
10
+ y: number;
11
+ }[];
12
+ /** Nodes of a plotted type that couldn't be placed, with the reason per axis. */
13
+ unplaced: {
14
+ key: string;
15
+ node: SpaceNode;
16
+ reasons: string[];
17
+ }[];
18
+ /** Relationship edges are dashed, to tell them from the hierarchy. */
19
+ connectors: Connector[];
20
+ /** Each axis's [min, max]; `direction` says which end is drawn where. */
21
+ domains: {
22
+ x: readonly [number, number];
23
+ y: readonly [number, number];
24
+ };
25
+ };
26
+ /**
27
+ * Position nodes by two numeric fields. Every node of a plotted type appears once: on the plot
28
+ * when both its values are numbers inside the axes' domains, otherwise in `unplaced` with the
29
+ * reason. Positions are normalised; layouts decide the plot's size.
30
+ */
31
+ export declare function buildXYPlot(graph: SpaceGraph, regionId: string, layout: LayoutConfig<'xy'>): XYPlot;
32
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { AuthoredLayout } from '../../definition';
1
2
  /** Settings of the XY layout: nodes positioned by two numeric fields. */
2
3
  export declare const xyLayoutSchema: {
3
4
  readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
@@ -92,3 +93,4 @@ export declare const xyLayoutSchema: {
92
93
  };
93
94
  };
94
95
  };
96
+ export declare function checkXYLayout(layout: AuthoredLayout<'xy'>): string | undefined;
@@ -1,4 +1,11 @@
1
- import { PARAM_REF } from './param-ref';
1
+ import { layoutSchemas } from '../layouts/schemas';
2
+ type Refs<T extends readonly {
3
+ $id: string;
4
+ }[]> = {
5
+ readonly [K in keyof T]: {
6
+ readonly $ref: T[K]['$id'];
7
+ };
8
+ };
2
9
  /**
3
10
  * The map view definition format: shared parameters, and the regions a map view is composed of.
4
11
  *
@@ -11,7 +18,7 @@ export declare const definitionSchema: {
11
18
  readonly title: 'Map view definition';
12
19
  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.';
13
20
  readonly type: 'object';
14
- readonly required: readonly ['$id', 'schema', 'regions'];
21
+ readonly required: readonly ['$id', 'regions'];
15
22
  readonly additionalProperties: false;
16
23
  readonly properties: {
17
24
  readonly $schema: {
@@ -33,7 +40,7 @@ export declare const definitionSchema: {
33
40
  readonly schema: {
34
41
  readonly type: 'string';
35
42
  readonly minLength: 1;
36
- readonly description: '`$id` of the structured-context schema whose spaces this map view applies to.';
43
+ readonly description: '`$id` of the structured-context schema whose spaces this map view applies to. Omitted: it applies to every schema.';
37
44
  };
38
45
  readonly parameters: {
39
46
  readonly type: 'object';
@@ -86,7 +93,7 @@ export declare const definitionSchema: {
86
93
  readonly id: {
87
94
  readonly type: 'string';
88
95
  readonly minLength: 1;
89
- readonly description: 'Unique within the map view; part of every occurrence id in the region.';
96
+ readonly description: 'Unique within the map view; part of every occurrence key in the region.';
90
97
  };
91
98
  readonly select: {
92
99
  readonly type: 'object';
@@ -107,13 +114,7 @@ export declare const definitionSchema: {
107
114
  readonly discriminator: {
108
115
  readonly propertyName: 'type';
109
116
  };
110
- readonly oneOf: readonly [{
111
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json";
112
- }, {
113
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json";
114
- }, {
115
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json";
116
- }];
117
+ readonly oneOf: Refs<typeof layoutSchemas>;
117
118
  };
118
119
  readonly nodes: {
119
120
  readonly type: 'object';
@@ -172,10 +173,19 @@ export declare const definitionSchema: {
172
173
  readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
173
174
  }];
174
175
  };
176
+ readonly labels: {
177
+ readonly description: string;
178
+ readonly default: false;
179
+ readonly anyOf: readonly [{
180
+ readonly type: "boolean";
181
+ }, {
182
+ readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
183
+ }];
184
+ };
175
185
  };
176
186
  };
177
187
  };
178
188
  };
179
189
  };
180
190
  };
181
- export { PARAM_REF };
191
+ export {};
@@ -1,10 +1,7 @@
1
1
  import type { spaceGraphFrom } from 'structured-context/browser';
2
2
  import type { ValidationInput } from './annotations';
3
3
  import type { MapViewDefinition } from './definition';
4
- /**
5
- * Everything a host without filesystem access needs to render a space: its graph, the validation
6
- * results that attach to nodes, and the map view definitions that apply to its schema. Plain JSON.
7
- */
4
+ /** What a host without filesystem access needs to render a space. Plain JSON. */
8
5
  export type SpaceSnapshot = {
9
6
  space: string;
10
7
  schemaId: string | undefined;
@@ -1,11 +1,8 @@
1
- /**
2
- * The package's public surface. Everything else (layouts, node cards, the edge overlay, the other projections)
3
- * is internal; add an export here when a host needs it.
4
- */
1
+ /** The package's public surface. Everything else is internal; add an export here when a host needs it. */
2
+ export { MapView } from './components/MapView';
3
+ export { ParameterControls } from './components/ParameterControls';
4
+ export { MultiSelectParameterInput, ParameterInput, SelectParameterInput, ToggleParameterInput, } from './components/ParameterInputs';
5
+ export { type ParameterControlState, useParameterControls } from './components/useParameterControls';
5
6
  export { type AnnotationIndex, type AnnotationSource, annotationsFrom, type NodeAnnotation, type Severity, type UnattachedAnnotation, type ValidationInput, worstSeverity, } from './core/annotations';
6
7
  export { MAP_VIEW_SCHEMAS, type MapViewDefinition, MapViewDefinitionError, mapViewsForSchema, type Parameter, type ParameterControl, type ParameterValues, parseMapViewDefinition, resolveParameterValues, selectionFilter, viewValidationLevel, } from './core/definition';
7
- export { buildTree, type Tree, type TreeOccurrence } from './core/tree';
8
- export { MapView } from './layouts/MapView';
9
- export { ParameterControls } from './layouts/ParameterControls';
10
- export { MultiSelectParameterInput, ParameterInput, SelectParameterInput, ToggleParameterInput, } from './layouts/ParameterInputs';
11
- export { type ParameterControlState, useParameterControls } from './layouts/useParameterControls';
8
+ export { buildTree, type Tree, type TreeOccurrence } from './core/layouts/tree/projection';
@@ -1,17 +1,11 @@
1
1
  import { type Config } from 'structured-context/api';
2
2
  import type { MapViewDefinition } from '../core/definition';
3
- export type LoadMapViewDefinitionsOptions = {
4
- /** Root of the main config file (`resolveConfigPath().root`). Defaults to where structured-context finds it. */
5
- configDir?: string;
6
- };
7
3
  /**
8
- * Every map view definition available with `config`, from:
9
- * - this package's embedded definitions (`sctx-map-view://core/<name>`), for structured-context's bundled schemas;
10
- * - each plugin found from a config folder or named by a space (`sctx-map-view://<plugin>/<name>`): the
11
- * folder named by `"sctx": { "map-views": "…" }` in its package.json, else its `map-views/` folder;
12
- * - the `map-views` resources folder of each config root (`sctx-map-view://<name>`).
4
+ * Every map view definition available with `config`, found as docs/definitions.md describes.
5
+ * Throws on the first invalid definition, including one outside its namespace or with a duplicate `$id`.
13
6
  *
14
- * Each definition's `$id` must be in the namespace of where it was found, and ids must be unique.
15
- * Throws on the first invalid definition.
7
+ * `configDir` is the root of the main config file; it defaults to where structured-context finds it.
16
8
  */
17
- export declare function loadMapViewDefinitions(config: Config, options?: LoadMapViewDefinitionsOptions): MapViewDefinition[];
9
+ export declare function loadMapViewDefinitions(config: Config, options?: {
10
+ configDir?: string;
11
+ }): MapViewDefinition[];