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.
Files changed (75) 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 +12 -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 +19 -0
  12. package/dist/html.js.map +1 -0
  13. package/dist/index.js +3 -3
  14. package/dist/node-ctbuxC-s.js +74 -0
  15. package/dist/node-ctbuxC-s.js.map +1 -0
  16. package/dist/node.js +2 -2
  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/html.d.ts +6 -0
  50. package/dist/types/node/index.d.ts +7 -30
  51. package/dist/types/node/page.d.ts +1 -1
  52. package/dist/types/node/read-definitions.d.ts +17 -0
  53. package/dist/types/node/snapshot.d.ts +1 -1
  54. package/dist/types/viewer/Viewer.d.ts +5 -5
  55. package/package.json +10 -4
  56. package/dist/ParameterControls-A1HJWyt9.js.map +0 -1
  57. package/dist/definition-Cp1CCigh.js.map +0 -1
  58. package/dist/node-aizYAYlq.js +0 -130
  59. package/dist/node-aizYAYlq.js.map +0 -1
  60. package/dist/projection-C-dATsdO.js.map +0 -1
  61. package/dist/types/core/format/index.d.ts +0 -450
  62. package/dist/types/core/format/landscape-layout.d.ts +0 -102
  63. package/dist/types/core/graph.d.ts +0 -16
  64. package/dist/types/core/landscape.d.ts +0 -44
  65. package/dist/types/core/occurrence.d.ts +0 -11
  66. package/dist/types/core/xy.d.ts +0 -43
  67. package/dist/types/layouts/LandscapeLayout.d.ts +0 -8
  68. package/dist/types/layouts/TreeLayout.d.ts +0 -16
  69. /package/dist/types/{layouts → components}/ParameterControls.d.ts +0 -0
  70. /package/dist/types/{layouts → components}/ParameterInputs.d.ts +0 -0
  71. /package/dist/types/{layouts → components}/useParameterControls.d.ts +0 -0
  72. /package/dist/types/core/{format/tree-layout.d.ts → layouts/tree/schema.d.ts} +0 -0
  73. /package/dist/types/core/{format → schema}/param-ref.d.ts +0 -0
  74. /package/dist/types/core/{format → schema}/schema-url.d.ts +0 -0
  75. /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;
@@ -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;