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
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { SpaceGraph, SpaceNode } from 'structured-context/api';
|
|
2
|
-
import type { LandscapeLayoutConfig } 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. */
|
|
8
|
-
level: number;
|
|
9
|
-
/** A node, or a field value shared by 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
|
-
export type ViaStep = {
|
|
25
|
-
type: string;
|
|
26
|
-
nodes: SpaceNode[];
|
|
27
|
-
};
|
|
28
|
-
export type Landscape = {
|
|
29
|
-
groups: LandscapeOccurrence[];
|
|
30
|
-
/**
|
|
31
|
-
* Nodes of a grouped level that no container above reaches (e.g. an Activity with no
|
|
32
|
-
* Outcome when grouping by Outcomes), each with its own contents.
|
|
33
|
-
*/
|
|
34
|
-
ungrouped: LandscapeOccurrence[];
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Lay a space out as nested containers following the layout's grouping levels.
|
|
38
|
-
*
|
|
39
|
-
* Adjacent node levels are joined by any edge between their types, in either direction, or only
|
|
40
|
-
* edges from `edge.field`. A `via` chain joins them through the skipped types. A field level
|
|
41
|
-
* splits the next node level by that field's values. A node reached from several containers
|
|
42
|
-
* appears in each, in full: the levels are finite, so repeating contents can't recurse.
|
|
43
|
-
*/
|
|
44
|
-
export declare function buildLandscape(graph: SpaceGraph, regionId: string, layout: LandscapeLayoutConfig): Landscape;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One step of an occurrence path: a node title, a `[field, value]` group, or `null` for the
|
|
3
|
-
* ungrouped area. Encoded distinctly, so a field group can't collide with a node of the same name.
|
|
4
|
-
*/
|
|
5
|
-
export type PathSegment = string | readonly [field: string, value: string | null] | null;
|
|
6
|
-
/**
|
|
7
|
-
* Path-based key for one occurrence of a node: region, then the steps from the outermost
|
|
8
|
-
* container down to the node. Unique within a map view even when a node appears several times.
|
|
9
|
-
* Hosts can render several map views at once, so layouts scope keys to the map view instance.
|
|
10
|
-
*/
|
|
11
|
-
export declare function occurrenceKey(regionId: string, path: readonly PathSegment[]): string;
|
package/dist/types/core/xy.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { SpaceGraph, SpaceNode } from 'structured-context/api';
|
|
2
|
-
import type { XYLayoutConfig } from './definition';
|
|
3
|
-
/** A plotted node. `x` and `y` run from 0 to 1 across the plot, left to right and bottom to top. */
|
|
4
|
-
export type XYPoint = {
|
|
5
|
-
key: string;
|
|
6
|
-
node: SpaceNode;
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
};
|
|
10
|
-
/** Why a node of a plotted type couldn't be placed, per axis. */
|
|
11
|
-
export type Unplaced = {
|
|
12
|
-
key: string;
|
|
13
|
-
node: SpaceNode;
|
|
14
|
-
reasons: string[];
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* An edge between plotted nodes. `lane` separates edges joining the same two nodes: 0 when
|
|
18
|
-
* there's one, otherwise centred around 0 (e.g. -0.5 and 0.5), for layouts to draw side by side.
|
|
19
|
-
*/
|
|
20
|
-
export type XYLink = {
|
|
21
|
-
from: string;
|
|
22
|
-
to: string;
|
|
23
|
-
field: string;
|
|
24
|
-
hierarchy: boolean;
|
|
25
|
-
lane: number;
|
|
26
|
-
};
|
|
27
|
-
export type XYPlot = {
|
|
28
|
-
points: XYPoint[];
|
|
29
|
-
unplaced: Unplaced[];
|
|
30
|
-
/** Edges between plotted nodes. */
|
|
31
|
-
links: XYLink[];
|
|
32
|
-
/** Each axis's [min, max]; `direction` says which end is drawn where. */
|
|
33
|
-
domains: {
|
|
34
|
-
x: readonly [number, number];
|
|
35
|
-
y: readonly [number, number];
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Position nodes by two numeric fields. Every node of a plotted type appears once: on the plot
|
|
40
|
-
* when both its values are numbers inside the axes' domains, otherwise in `unplaced` with the
|
|
41
|
-
* reason. Positions are normalised; layouts decide the plot's size.
|
|
42
|
-
*/
|
|
43
|
-
export declare function buildXYPlot(graph: SpaceGraph, regionId: string, layout: XYLayoutConfig): XYPlot;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { LandscapeLayoutConfig } from '../core/definition';
|
|
2
|
-
import type { LayoutProps } from './TreeLayout';
|
|
3
|
-
/**
|
|
4
|
-
* Nested containers following the layout's grouping levels; the last level is drawn as nodes.
|
|
5
|
-
* Flexbox does the nesting and wrapping. Containment shows the grouping edges, so no connectors
|
|
6
|
-
* are drawn. PROTOTYPE: `edges.show` has no effect here; other edges aren't drawn yet.
|
|
7
|
-
*/
|
|
8
|
-
export declare function LandscapeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<LandscapeLayoutConfig>): import("react").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SpaceGraph, SpaceNode } from 'structured-context/api';
|
|
2
|
-
import type { LayoutConfig, Region, TreeLayoutConfig } from '../core/definition';
|
|
3
|
-
export type LayoutProps<L extends LayoutConfig = LayoutConfig> = {
|
|
4
|
-
graph: SpaceGraph;
|
|
5
|
-
/** The region with parameter values applied, narrowed to the layout's own settings. */
|
|
6
|
-
region: Region & {
|
|
7
|
-
layout: L;
|
|
8
|
-
};
|
|
9
|
-
/** Scopes occurrence ids when several map views render in one document. */
|
|
10
|
-
instanceId: string;
|
|
11
|
-
onNodeSelect?: (node: SpaceNode) => void;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Tree over the schema's hierarchy. Flexbox does the branching; the SVG overlay draws connectors.
|
|
15
|
-
*/
|
|
16
|
-
export declare function TreeLayout({ graph, region, instanceId, onNodeSelect }: LayoutProps<TreeLayoutConfig>): import("react").JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|