structured-context-map-views 0.6.1 → 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.
- package/README.md +1 -1
- package/dist/{ParameterControls-A1HJWyt9.js → ParameterControls-Be05VST0.js} +505 -188
- package/dist/ParameterControls-Be05VST0.js.map +1 -0
- package/dist/artifact.html +70 -1
- package/dist/artifact.js +2 -2
- package/dist/artifact.js.map +1 -1
- package/dist/cli.js +12 -6
- package/dist/cli.js.map +1 -1
- package/dist/{definition-Cp1CCigh.js → definition-SjmROmJC.js} +308 -188
- package/dist/definition-SjmROmJC.js.map +1 -0
- package/dist/html.js +19 -0
- package/dist/html.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/node-ctbuxC-s.js +74 -0
- package/dist/node-ctbuxC-s.js.map +1 -0
- package/dist/node.js +2 -2
- package/dist/page.html +94 -25
- package/dist/{projection-C-dATsdO.js → projection-DKNLziP0.js} +282 -124
- package/dist/projection-DKNLziP0.js.map +1 -0
- package/dist/read-definitions-DFcOXatz.js +51 -0
- package/dist/read-definitions-DFcOXatz.js.map +1 -0
- package/dist/styles.css +69 -0
- package/dist/types/artifact/load.d.ts +1 -1
- package/dist/types/{layouts/EdgeOverlay.d.ts → components/ConnectorOverlay.d.ts} +6 -15
- package/dist/types/components/GraphLayout.d.ts +8 -0
- package/dist/types/components/LandscapeLayout.d.ts +9 -0
- package/dist/types/{layouts → components}/MapView.d.ts +4 -1
- package/dist/types/components/NeighbourhoodLayout.d.ts +7 -0
- package/dist/types/{layouts/NodeCard.d.ts → components/NodeComponent.d.ts} +1 -1
- package/dist/types/components/TreeLayout.d.ts +6 -0
- package/dist/types/{layouts → components}/XYLayout.d.ts +3 -3
- package/dist/types/{layouts → components}/annotations-context.d.ts +1 -1
- package/dist/types/components/layout.d.ts +22 -0
- package/dist/types/core/annotations.d.ts +2 -3
- package/dist/types/core/definition.d.ts +664 -30
- package/dist/types/core/layouts/graph/schema.d.ts +24 -0
- package/dist/types/core/layouts/helpers.d.ts +42 -0
- package/dist/types/core/layouts/landscape/projection.d.ts +75 -0
- package/dist/types/core/layouts/landscape/schema.d.ts +223 -0
- package/dist/types/core/layouts/neighbourhood/projection.d.ts +26 -0
- package/dist/types/core/layouts/neighbourhood/schema.d.ts +51 -0
- package/dist/types/core/layouts/schemas.d.ts +427 -0
- package/dist/types/core/{tree.d.ts → layouts/tree/projection.d.ts} +9 -11
- package/dist/types/core/layouts/xy/projection.d.ts +32 -0
- package/dist/types/core/{format/xy-layout.d.ts → layouts/xy/schema.d.ts} +2 -0
- package/dist/types/core/{format → schema}/definition-schema.d.ts +22 -12
- package/dist/types/core/{snapshot.d.ts → space-snapshot.d.ts} +1 -4
- package/dist/types/index.d.ts +6 -9
- package/dist/types/node/html.d.ts +6 -0
- package/dist/types/node/index.d.ts +7 -30
- package/dist/types/node/page.d.ts +1 -1
- package/dist/types/node/read-definitions.d.ts +17 -0
- package/dist/types/node/snapshot.d.ts +1 -1
- package/dist/types/viewer/Viewer.d.ts +5 -5
- package/package.json +10 -4
- package/dist/ParameterControls-A1HJWyt9.js.map +0 -1
- package/dist/definition-Cp1CCigh.js.map +0 -1
- package/dist/node-aizYAYlq.js +0 -130
- package/dist/node-aizYAYlq.js.map +0 -1
- package/dist/projection-C-dATsdO.js.map +0 -1
- package/dist/types/core/format/index.d.ts +0 -450
- package/dist/types/core/format/landscape-layout.d.ts +0 -102
- package/dist/types/core/graph.d.ts +0 -16
- package/dist/types/core/landscape.d.ts +0 -44
- package/dist/types/core/occurrence.d.ts +0 -11
- package/dist/types/core/xy.d.ts +0 -43
- package/dist/types/layouts/LandscapeLayout.d.ts +0 -8
- package/dist/types/layouts/TreeLayout.d.ts +0 -16
- /package/dist/types/{layouts → components}/ParameterControls.d.ts +0 -0
- /package/dist/types/{layouts → components}/ParameterInputs.d.ts +0 -0
- /package/dist/types/{layouts → components}/useParameterControls.d.ts +0 -0
- /package/dist/types/core/{format/tree-layout.d.ts → layouts/tree/schema.d.ts} +0 -0
- /package/dist/types/core/{format → schema}/param-ref.d.ts +0 -0
- /package/dist/types/core/{format → schema}/schema-url.d.ts +0 -0
- /package/dist/types/core/{format → schema}/settings.d.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Settings of the graph layout: every node and edge as a network. */
|
|
2
|
+
export declare const graphLayoutSchema: {
|
|
3
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
4
|
+
readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/graph.json";
|
|
5
|
+
readonly title: 'Graph layout';
|
|
6
|
+
readonly description: 'Nodes and edges as a network: connected nodes sit close together. Works with any schema.';
|
|
7
|
+
readonly type: 'object';
|
|
8
|
+
readonly required: readonly ['type'];
|
|
9
|
+
readonly additionalProperties: false;
|
|
10
|
+
readonly properties: {
|
|
11
|
+
readonly type: {
|
|
12
|
+
readonly const: 'graph';
|
|
13
|
+
};
|
|
14
|
+
readonly edgeFields: {
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly default: readonly [];
|
|
17
|
+
readonly anyOf: readonly [{
|
|
18
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
|
|
19
|
+
}, {
|
|
20
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
21
|
+
}];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Hierarchy, SpaceGraph } from 'structured-context/api';
|
|
2
|
+
import type { NodeId } from 'structured-context/types';
|
|
3
|
+
/** A directed parent → child edge of a space graph, carrying the metadata of the reference it came from. */
|
|
4
|
+
export type Edge = SpaceGraph['parentEdges'] extends ReadonlyMap<string, readonly (infer E)[]> ? E : never;
|
|
5
|
+
/**
|
|
6
|
+
* Edges to a node's parents, in the order the node declares them. A graph narrowed by a filter keeps
|
|
7
|
+
* edges to parents outside it; those are left out.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parentEdges(graph: SpaceGraph, id: NodeId): readonly Edge[];
|
|
10
|
+
/** Edges to a node's children, in graph order of the children. */
|
|
11
|
+
export declare function childEdges(graph: SpaceGraph, id: NodeId): readonly Edge[];
|
|
12
|
+
/** Every edge whose parent and child are both in the graph. */
|
|
13
|
+
export declare function edgesWithin(graph: SpaceGraph): Edge[];
|
|
14
|
+
/** Whether an edge belongs to the given hierarchy (as opposed to a relationship or another hierarchy). */
|
|
15
|
+
export declare function isHierarchyEdge(edge: Edge, hierarchy: Hierarchy | undefined): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* A connector between two occurrences, by key, in the direction of the edge it draws.
|
|
18
|
+
* `field` is the field the edge is declared in. `lane` separates connectors joining the same two
|
|
19
|
+
* occurrences: 0 when there's one, otherwise centred around 0 (e.g. -0.5 and 0.5).
|
|
20
|
+
* `dashed` marks a connector that is secondary to the layout's structure.
|
|
21
|
+
*/
|
|
22
|
+
export type Connector = {
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
field?: string;
|
|
26
|
+
lane?: number;
|
|
27
|
+
dashed?: boolean;
|
|
28
|
+
};
|
|
29
|
+
/** Spread connectors joining the same pair of occurrences (in either direction) into lanes around 0. */
|
|
30
|
+
export declare function assignLanes(connectors: Connector[]): void;
|
|
31
|
+
/**
|
|
32
|
+
* One step of an occurrence path: a node title, a `[field, value]` group, `null` for the ungrouped
|
|
33
|
+
* area, or a number for a part of the layout picked by position. Each kind encodes differently in
|
|
34
|
+
* JSON, so none can collide with another.
|
|
35
|
+
*/
|
|
36
|
+
export type PathSegment = string | readonly [field: string, value: string | null] | null | number;
|
|
37
|
+
/**
|
|
38
|
+
* Path-based key for one occurrence of a node: region, then the steps from the outermost
|
|
39
|
+
* container down to the node. Unique within a map view even when a node appears several times.
|
|
40
|
+
* Hosts can render several map views at once, so layouts scope keys to the map view instance.
|
|
41
|
+
*/
|
|
42
|
+
export declare function occurrenceKey(regionId: string, path: readonly PathSegment[]): string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { SpaceGraph, SpaceNode } from 'structured-context/api';
|
|
2
|
+
import type { LayoutConfig } from '../../definition';
|
|
3
|
+
/** One rendered container or node in a landscape. */
|
|
4
|
+
export type LandscapeOccurrence = {
|
|
5
|
+
/** Path-based key, unique within the map view (see {@link occurrenceKey}). */
|
|
6
|
+
key: string;
|
|
7
|
+
/** Index of the grouping level this occurrence belongs to, within its strip. */
|
|
8
|
+
level: number;
|
|
9
|
+
/** A node, or a field value common to the nodes inside (`null`: the field is empty). */
|
|
10
|
+
item: {
|
|
11
|
+
kind: 'node';
|
|
12
|
+
node: SpaceNode;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'value';
|
|
15
|
+
field: string;
|
|
16
|
+
value: string | null;
|
|
17
|
+
};
|
|
18
|
+
/** Nodes on the `via` chain that joined this node to the node level above, one entry per skipped type. */
|
|
19
|
+
via: ViaStep[];
|
|
20
|
+
/** Key of the node's first occurrence when this is a repeat. Repeats are rendered in full. */
|
|
21
|
+
repeatOf?: string;
|
|
22
|
+
children: LandscapeOccurrence[];
|
|
23
|
+
};
|
|
24
|
+
type ViaStep = {
|
|
25
|
+
type: string;
|
|
26
|
+
nodes: SpaceNode[];
|
|
27
|
+
};
|
|
28
|
+
/** A group of a dimension: a node of the dimension's type, or a value of its field. It holds nothing itself. */
|
|
29
|
+
export type LandscapeGroup = Pick<LandscapeOccurrence, 'key' | 'item'>;
|
|
30
|
+
type LandscapeStrip = {
|
|
31
|
+
/** The strip's own dimension, dividing it further. */
|
|
32
|
+
dimension?: LandscapeGroup[];
|
|
33
|
+
/**
|
|
34
|
+
* A cell for every group of the layout's dimension paired with every group of the strip's own, the
|
|
35
|
+
* layout's varying slowest. A strip with no dimension has one cell.
|
|
36
|
+
*/
|
|
37
|
+
cells: LandscapeCell[];
|
|
38
|
+
/**
|
|
39
|
+
* Nodes of the strip's levels that no cell or container reached (e.g. an Activity with no
|
|
40
|
+
* Outcome when grouping by Outcomes), each with its own contents. Empty when the strip hides them.
|
|
41
|
+
*/
|
|
42
|
+
ungrouped: LandscapeOccurrence[];
|
|
43
|
+
};
|
|
44
|
+
/** What the strip's grouping levels place among the nodes that belong to one group of each dimension. */
|
|
45
|
+
type LandscapeCell = {
|
|
46
|
+
/** Path-based key of the strip and its group or pair of groups. */
|
|
47
|
+
key: string;
|
|
48
|
+
/** Indexes of its groups in the layout's dimension and in the strip's own; 0 where there is none. */
|
|
49
|
+
at: [layout: number, strip: number];
|
|
50
|
+
children: LandscapeOccurrence[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The layout as strips divided into cells. A dimension's groups are worked out once, so every cell
|
|
54
|
+
* exists, empty or not. Which axis a dimension runs along is the component's choice. A plain
|
|
55
|
+
* landscape is one strip with one cell and no dimension: the cell holds its top-level containers.
|
|
56
|
+
*/
|
|
57
|
+
export type Landscape = {
|
|
58
|
+
/** The layout's dimension: its groups divide every strip alike, so the strips line up. */
|
|
59
|
+
dimension?: LandscapeGroup[];
|
|
60
|
+
/** The strips, in order. */
|
|
61
|
+
strips: LandscapeStrip[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Lay a space out as strips of nested containers following each strip's grouping levels.
|
|
65
|
+
*
|
|
66
|
+
* Adjacent node levels are joined by any edge between their types, in either direction, or only
|
|
67
|
+
* edges from `edge.field`. A `via` chain joins them through the skipped types. A field level
|
|
68
|
+
* splits the next node level by that field's values. A node reached from several containers
|
|
69
|
+
* appears in each, in full: the levels are finite, so repeating contents can't recurse.
|
|
70
|
+
*
|
|
71
|
+
* A dimension divides a strip into cells. A strip's first level is joined to a dimension's node the
|
|
72
|
+
* way a level is joined to the node level above, so `via` applies there too.
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildLandscape(graph: SpaceGraph, regionId: string, layout: LayoutConfig<'landscape'>): Landscape;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { AuthoredLayout } from '../../definition';
|
|
2
|
+
/** Settings of the landscape layout: strips of nested containers, optionally divided into cells by dimensions. */
|
|
3
|
+
export declare const landscapeLayoutSchema: {
|
|
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/landscape.json";
|
|
6
|
+
readonly title: 'Landscape layout';
|
|
7
|
+
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.";
|
|
8
|
+
readonly type: 'object';
|
|
9
|
+
readonly required: readonly ['type', 'strips'];
|
|
10
|
+
readonly additionalProperties: false;
|
|
11
|
+
readonly properties: {
|
|
12
|
+
readonly type: {
|
|
13
|
+
readonly const: 'landscape';
|
|
14
|
+
};
|
|
15
|
+
readonly orientation: {
|
|
16
|
+
readonly description: string;
|
|
17
|
+
readonly default: "horizontal";
|
|
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 dimension: {
|
|
25
|
+
readonly type: 'object';
|
|
26
|
+
readonly if: {
|
|
27
|
+
readonly type: 'object';
|
|
28
|
+
readonly required: readonly ['field'];
|
|
29
|
+
};
|
|
30
|
+
readonly then: {
|
|
31
|
+
readonly type: 'object';
|
|
32
|
+
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.";
|
|
33
|
+
readonly required: readonly ['field'];
|
|
34
|
+
readonly additionalProperties: false;
|
|
35
|
+
readonly properties: {
|
|
36
|
+
readonly field: {
|
|
37
|
+
readonly type: 'string';
|
|
38
|
+
readonly minLength: 1;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly else: {
|
|
43
|
+
readonly type: 'object';
|
|
44
|
+
readonly description: 'A group for every node of one type.';
|
|
45
|
+
readonly required: readonly ['type'];
|
|
46
|
+
readonly additionalProperties: false;
|
|
47
|
+
readonly properties: {
|
|
48
|
+
readonly type: {
|
|
49
|
+
readonly description: 'Node type of the groups.';
|
|
50
|
+
readonly anyOf: readonly [{
|
|
51
|
+
readonly type: 'string';
|
|
52
|
+
readonly minLength: 1;
|
|
53
|
+
}, {
|
|
54
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
55
|
+
}];
|
|
56
|
+
};
|
|
57
|
+
readonly edge: {
|
|
58
|
+
readonly type: 'object';
|
|
59
|
+
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.";
|
|
60
|
+
readonly required: readonly ['field'];
|
|
61
|
+
readonly additionalProperties: false;
|
|
62
|
+
readonly properties: {
|
|
63
|
+
readonly field: {
|
|
64
|
+
readonly type: 'string';
|
|
65
|
+
readonly minLength: 1;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
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.';
|
|
72
|
+
};
|
|
73
|
+
readonly strips: {
|
|
74
|
+
readonly type: 'array';
|
|
75
|
+
readonly minItems: 1;
|
|
76
|
+
readonly description: 'The strips, in order along the axis the layout dimension does not run along.';
|
|
77
|
+
readonly items: {
|
|
78
|
+
readonly type: 'object';
|
|
79
|
+
readonly required: readonly ['group'];
|
|
80
|
+
readonly additionalProperties: false;
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly dimension: {
|
|
83
|
+
readonly type: 'object';
|
|
84
|
+
readonly if: {
|
|
85
|
+
readonly type: 'object';
|
|
86
|
+
readonly required: readonly ['field'];
|
|
87
|
+
};
|
|
88
|
+
readonly then: {
|
|
89
|
+
readonly type: 'object';
|
|
90
|
+
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.";
|
|
91
|
+
readonly required: readonly ['field'];
|
|
92
|
+
readonly additionalProperties: false;
|
|
93
|
+
readonly properties: {
|
|
94
|
+
readonly field: {
|
|
95
|
+
readonly type: 'string';
|
|
96
|
+
readonly minLength: 1;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly else: {
|
|
101
|
+
readonly type: 'object';
|
|
102
|
+
readonly description: 'A group for every node of one type.';
|
|
103
|
+
readonly required: readonly ['type'];
|
|
104
|
+
readonly additionalProperties: false;
|
|
105
|
+
readonly properties: {
|
|
106
|
+
readonly type: {
|
|
107
|
+
readonly description: 'Node type of the groups.';
|
|
108
|
+
readonly anyOf: readonly [{
|
|
109
|
+
readonly type: 'string';
|
|
110
|
+
readonly minLength: 1;
|
|
111
|
+
}, {
|
|
112
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
113
|
+
}];
|
|
114
|
+
};
|
|
115
|
+
readonly edge: {
|
|
116
|
+
readonly type: 'object';
|
|
117
|
+
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.";
|
|
118
|
+
readonly required: readonly ['field'];
|
|
119
|
+
readonly additionalProperties: false;
|
|
120
|
+
readonly properties: {
|
|
121
|
+
readonly field: {
|
|
122
|
+
readonly type: 'string';
|
|
123
|
+
readonly minLength: 1;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
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.";
|
|
130
|
+
};
|
|
131
|
+
readonly showUngrouped: {
|
|
132
|
+
readonly description: string;
|
|
133
|
+
readonly default: true;
|
|
134
|
+
readonly anyOf: readonly [{
|
|
135
|
+
readonly type: "boolean";
|
|
136
|
+
}, {
|
|
137
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
138
|
+
}];
|
|
139
|
+
};
|
|
140
|
+
readonly group: {
|
|
141
|
+
readonly type: 'array';
|
|
142
|
+
readonly minItems: 1;
|
|
143
|
+
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.';
|
|
144
|
+
readonly items: {
|
|
145
|
+
readonly type: 'object';
|
|
146
|
+
readonly if: {
|
|
147
|
+
readonly type: 'object';
|
|
148
|
+
readonly required: readonly ['field'];
|
|
149
|
+
};
|
|
150
|
+
readonly then: {
|
|
151
|
+
readonly type: 'object';
|
|
152
|
+
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.";
|
|
153
|
+
readonly required: readonly ['field'];
|
|
154
|
+
readonly additionalProperties: false;
|
|
155
|
+
readonly properties: {
|
|
156
|
+
readonly field: {
|
|
157
|
+
readonly type: 'string';
|
|
158
|
+
readonly minLength: 1;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly else: {
|
|
163
|
+
readonly type: 'object';
|
|
164
|
+
readonly description: 'A level of nodes of one type.';
|
|
165
|
+
readonly required: readonly ['type'];
|
|
166
|
+
readonly additionalProperties: false;
|
|
167
|
+
readonly properties: {
|
|
168
|
+
readonly type: {
|
|
169
|
+
readonly description: 'Node type at this level.';
|
|
170
|
+
readonly anyOf: readonly [{
|
|
171
|
+
readonly type: 'string';
|
|
172
|
+
readonly minLength: 1;
|
|
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 edge: {
|
|
178
|
+
readonly type: 'object';
|
|
179
|
+
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.';
|
|
180
|
+
readonly required: readonly ['field'];
|
|
181
|
+
readonly additionalProperties: false;
|
|
182
|
+
readonly properties: {
|
|
183
|
+
readonly field: {
|
|
184
|
+
readonly type: 'string';
|
|
185
|
+
readonly minLength: 1;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
readonly via: {
|
|
190
|
+
readonly type: 'array';
|
|
191
|
+
readonly minItems: 1;
|
|
192
|
+
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.";
|
|
193
|
+
readonly items: {
|
|
194
|
+
readonly type: 'string';
|
|
195
|
+
readonly minLength: 1;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
readonly intermediate: {
|
|
199
|
+
readonly description: string;
|
|
200
|
+
readonly default: "hidden";
|
|
201
|
+
readonly anyOf: readonly [{
|
|
202
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json#/$defs/intermediate";
|
|
203
|
+
}, {
|
|
204
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
205
|
+
}];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
readonly $defs: {
|
|
216
|
+
readonly intermediate: {
|
|
217
|
+
readonly title: 'Skipped levels';
|
|
218
|
+
readonly description: 'hidden: not shown. breadcrumb: listed on each node reached through them.';
|
|
219
|
+
readonly enum: readonly ['hidden', 'breadcrumb'];
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
export declare function checkLandscapeLayout(layout: AuthoredLayout<'landscape'>): "the last grouping level of a strip must be a node type, not a field" | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SpaceGraph, SpaceNode } from 'structured-context/api';
|
|
2
|
+
import type { LayoutConfig } from '../../definition';
|
|
3
|
+
import { type Connector } from '../helpers';
|
|
4
|
+
type NeighbourhoodRole = 'above' | 'below' | 'left' | 'right';
|
|
5
|
+
/** One occurrence in a neighbourhood. A neighbour is placed once, however many fields join it to the focus. */
|
|
6
|
+
export type Neighbour = {
|
|
7
|
+
key: string;
|
|
8
|
+
node: SpaceNode;
|
|
9
|
+
};
|
|
10
|
+
export type Neighbourhood = {
|
|
11
|
+
/** `undefined` when the graph has no nodes. */
|
|
12
|
+
focus: Neighbour | undefined;
|
|
13
|
+
roles: Record<NeighbourhoodRole, Neighbour[]>;
|
|
14
|
+
/**
|
|
15
|
+
* The nodes that share a hierarchy parent with the focus or, for a hierarchy root, the other
|
|
16
|
+
* roots of its type. No edge joins them to the focus, so they have no connector.
|
|
17
|
+
*/
|
|
18
|
+
siblings: Neighbour[];
|
|
19
|
+
connectors: Connector[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The focus and its neighbours placed by role. Without a usable `focusId`, the focus is the
|
|
23
|
+
* first hierarchy root, else the first node.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildNeighbourhood(graph: SpaceGraph, regionId: string, layout: LayoutConfig<'neighbourhood'>, focusId?: SpaceNode['id']): Neighbourhood;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Settings of the neighbourhood layout: the neighbourhood of one node, placed by role. */
|
|
2
|
+
export declare const neighbourhoodLayoutSchema: {
|
|
3
|
+
readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
|
|
4
|
+
readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/neighbourhood.json";
|
|
5
|
+
readonly title: 'Neighbourhood layout';
|
|
6
|
+
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.';
|
|
7
|
+
readonly type: 'object';
|
|
8
|
+
readonly required: readonly ['type'];
|
|
9
|
+
readonly additionalProperties: false;
|
|
10
|
+
readonly properties: {
|
|
11
|
+
readonly type: {
|
|
12
|
+
readonly const: 'neighbourhood';
|
|
13
|
+
};
|
|
14
|
+
readonly above: {
|
|
15
|
+
readonly description: string;
|
|
16
|
+
readonly default: readonly [];
|
|
17
|
+
readonly anyOf: readonly [{
|
|
18
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
|
|
19
|
+
}, {
|
|
20
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
21
|
+
}];
|
|
22
|
+
};
|
|
23
|
+
readonly below: {
|
|
24
|
+
readonly description: string;
|
|
25
|
+
readonly default: readonly [];
|
|
26
|
+
readonly anyOf: readonly [{
|
|
27
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
|
|
28
|
+
}, {
|
|
29
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
30
|
+
}];
|
|
31
|
+
};
|
|
32
|
+
readonly left: {
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly default: readonly [];
|
|
35
|
+
readonly anyOf: readonly [{
|
|
36
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
|
|
37
|
+
}, {
|
|
38
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
39
|
+
}];
|
|
40
|
+
};
|
|
41
|
+
readonly right: {
|
|
42
|
+
readonly description: string;
|
|
43
|
+
readonly default: readonly [];
|
|
44
|
+
readonly anyOf: readonly [{
|
|
45
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
|
|
46
|
+
}, {
|
|
47
|
+
readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
|
|
48
|
+
}];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|