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 +0,0 @@
1
- {"version":3,"file":"projection-C-dATsdO.js","names":[],"sources":["../src/core/annotations.ts","../src/core/graph.ts","../src/core/occurrence.ts","../src/core/tree.ts","../src/core/landscape.ts","../src/core/xy.ts"],"sourcesContent":["import type { RuleSeverity, SpaceGraph, SpaceNode, ValidationResult } from 'structured-context/api';\nimport type { SourceLocation, ValidationIssueKind } from 'structured-context/types';\n\n// core doesn't export NodeId from `structured-context/api` yet; this derives it.\ntype NodeId = SpaceNode['id'];\n\n/** structured-context's severity. */\nexport type Severity = RuleSeverity;\n\n/** structured-context's issue `kind`. */\nexport type AnnotationSource = ValidationIssueKind;\n\n/** One validation result attached to a node. */\nexport type NodeAnnotation = {\n severity: Severity;\n source: AnnotationSource;\n message: string;\n /** The violated rule, for `rule` results. */\n ruleId?: string;\n};\n\n/** A validation result with no node on the map to attach to. */\nexport type UnattachedAnnotation = NodeAnnotation & {\n nodeId?: NodeId;\n location?: SourceLocation;\n};\n\n/** Annotations by the id of the node they apply to. */\nexport type AnnotationIndex = ReadonlyMap<NodeId, readonly NodeAnnotation[]>;\n\ntype Issue = ValidationResult['issues'][number];\n\n/** A `ValidationResult`, or the output of `sctx validate --json`. */\nexport type ValidationInput = {\n issues: ReadonlyArray<Pick<Issue, 'kind' | 'severity' | 'message' | 'nodeId' | 'source'> & { ruleId?: string }>;\n};\n\n/** Attach validation issues to the nodes of `graph`. Issues whose node isn't in the graph are `unattached`. */\nexport function annotationsFrom(\n input: ValidationInput,\n graph: SpaceGraph,\n): { annotations: AnnotationIndex; unattached: UnattachedAnnotation[] } {\n const annotations = new Map<NodeId, NodeAnnotation[]>();\n const unattached: UnattachedAnnotation[] = [];\n\n for (const { kind, severity, message, nodeId, source, ruleId } of input.issues) {\n const annotation: NodeAnnotation = {\n severity,\n source: kind,\n message,\n ...(kind === 'rule' && ruleId !== undefined && { ruleId }),\n };\n if (nodeId !== undefined && graph.nodes.has(nodeId)) {\n annotations.set(nodeId, [...(annotations.get(nodeId) ?? []), annotation]);\n } else {\n unattached.push({\n ...annotation,\n ...(nodeId !== undefined && { nodeId }),\n ...(source !== undefined && { location: source }),\n });\n }\n }\n return { annotations, unattached };\n}\n\nconst RANK: Record<Severity, number> = { error: 0, warning: 1, info: 2 };\n\n/** The most serious severity among annotations, or undefined if there are none. */\nexport function worstSeverity(annotations: readonly NodeAnnotation[]): Severity | undefined {\n return annotations.reduce<Severity | undefined>(\n (worst, { severity }) => (worst === undefined || RANK[severity] < RANK[worst] ? severity : worst),\n undefined,\n );\n}\n\n/**\n * The annotations a map view shows: those at `level` or more serious, from `sources`. `off` shows none.\n * Nodes left with no annotations are dropped from the index.\n */\nexport function filterAnnotations(\n index: AnnotationIndex,\n level: Severity | 'off',\n sources: readonly AnnotationSource[],\n): AnnotationIndex {\n if (level === 'off') return new Map();\n const filtered = new Map<NodeId, readonly NodeAnnotation[]>();\n for (const [id, annotations] of index) {\n const kept = annotations.filter((a) => RANK[a.severity] <= RANK[level] && sources.includes(a.source));\n if (kept.length > 0) filtered.set(id, kept);\n }\n return filtered;\n}\n","import type { Hierarchy, SpaceGraph, SpaceNode } from 'structured-context/api';\n\ntype NodeId = SpaceNode['id'];\n\n/** A directed parent → child edge of a space graph, carrying the metadata of the reference it came from. */\nexport type Edge = SpaceGraph['parentEdges'] extends ReadonlyMap<string, readonly (infer E)[]> ? E : never;\n\nconst NONE: readonly Edge[] = [];\n\n/**\n * Edges to a node's parents, in the order the node declares them. A graph narrowed by a filter keeps\n * edges to parents outside it; those are left out.\n */\nexport function parentEdges(graph: SpaceGraph, id: NodeId): readonly Edge[] {\n return (graph.parentEdges.get(id) ?? NONE).filter((edge) => graph.nodes.has(edge.parent));\n}\n\n/** Edges to a node's children, in graph order of the children. */\nexport function childEdges(graph: SpaceGraph, id: NodeId): readonly Edge[] {\n return graph.childEdges.get(id) ?? NONE;\n}\n\n/** Every edge whose parent and child are both in the graph. */\nexport function edgesWithin(graph: SpaceGraph): Edge[] {\n return [...graph.nodes.keys()].flatMap((id) => parentEdges(graph, id));\n}\n\n/** Whether an edge belongs to the given hierarchy (as opposed to a relationship or another hierarchy). */\nexport function isHierarchyEdge(edge: Edge, hierarchy: Hierarchy | undefined): boolean {\n return hierarchy !== undefined && edge.kind === 'hierarchy' && edge.hierarchy === hierarchy.name;\n}\n","/**\n * One step of an occurrence path: a node title, a `[field, value]` group, or `null` for the\n * ungrouped area. Encoded distinctly, so a field group can't collide with a node of the same name.\n */\nexport type PathSegment = string | readonly [field: string, value: string | null] | null;\n\n/**\n * Path-based key for one occurrence of a node: region, then the steps from the outermost\n * container down to the node. Unique within a map view even when a node appears several times.\n * Hosts can render several map views at once, so layouts scope keys to the map view instance.\n */\nexport function occurrenceKey(regionId: string, path: readonly PathSegment[]): string {\n return JSON.stringify([regionId, ...path]);\n}\n","import type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { DagMode } from './definition';\nimport { childEdges, isHierarchyEdge, parentEdges } from './graph';\nimport { occurrenceKey } from './occurrence';\n\n/** One rendered appearance of a node in a tree. */\nexport type TreeOccurrence = {\n /** Path-based key, unique within the map view (see {@link occurrenceKey}). */\n key: string;\n node: SpaceNode;\n children: TreeOccurrence[];\n /**\n * Key of the node's primary occurrence when this is a repeat. A node with several parents\n * appears under each of them, but its subtree is only rendered at its first occurrence.\n */\n repeatOf?: string;\n};\n\nexport type Tree = {\n roots: TreeOccurrence[];\n /**\n * Hierarchy-typed nodes not reachable from a root, rendered as extra roots: nodes with no\n * hierarchy parent in the space, then entry points into otherwise unreachable cycles.\n */\n orphans: TreeOccurrence[];\n /** Key of each node's primary (first, fully rendered) occurrence. */\n primary: ReadonlyMap<string, string>;\n /**\n * In cross-edge mode, links from a node's other parents to its primary occurrence, which\n * replace repeat occurrences. Empty in repeat mode.\n */\n crossLinks: TreeLink[];\n};\n\nexport type TreeLink = { from: string; to: string; kind: 'tree' | 'cross' };\n\n/**\n * Lay a space out as a tree over its hierarchy.\n *\n * Roots are root-type nodes with no hierarchy parent. Traversal is depth-first in space order,\n * so a node's primary occurrence is under the parent reached first. Under its other parents a\n * node is either repeated without its subtree (`repeat`), or left out and linked by a cross-edge\n * (`cross-edge`). Either way traversal stops there, which also keeps cycles from recursing.\n */\nexport function buildTree(graph: SpaceGraph, regionId: string, dag: DagMode = 'repeat'): Tree {\n const { hierarchy } = graph;\n const levelTypes = new Set(hierarchy?.levels.map((level) => level.type));\n const rootType = hierarchy?.levels[0]?.type;\n const primary = new Map<string, string>();\n // Parent occurrence → child title, resolved to the child's primary occurrence afterwards.\n const pendingCross: { from: string; child: string }[] = [];\n\n const hierarchyParents = (title: SpaceNode['id']) =>\n parentEdges(graph, title).filter((edge) => isHierarchyEdge(edge, hierarchy));\n\n const visit = (node: SpaceNode, path: readonly string[]): TreeOccurrence => {\n const nodePath = [...path, node.id];\n const key = occurrenceKey(regionId, nodePath);\n primary.set(node.id, key);\n // A child can reference the same parent through more than one field; it occurs once.\n const childTitles = new Set(\n childEdges(graph, node.id)\n .filter((edge) => isHierarchyEdge(edge, hierarchy))\n .map((edge) => edge.child),\n );\n const children: TreeOccurrence[] = [];\n for (const title of childTitles) {\n const child = graph.nodes.get(title)!;\n const repeatOf = primary.get(title);\n if (repeatOf === undefined) children.push(visit(child, nodePath));\n else if (dag === 'repeat')\n children.push({ key: occurrenceKey(regionId, [...nodePath, title]), node: child, children: [], repeatOf });\n else pendingCross.push({ from: key, child: title });\n }\n return { key, node, children };\n };\n\n const levelNodes = [...graph.nodes.values()].filter((node) => levelTypes.has(node.resolvedType));\n const unparented = levelNodes.filter((node) => hierarchyParents(node.id).length === 0);\n const roots = unparented.filter((node) => node.resolvedType === rootType).map((node) => visit(node, []));\n const orphans = unparented.filter((node) => node.resolvedType !== rootType).map((node) => visit(node, []));\n // Nodes only reachable through a cycle have a parent but no path from a root. Rather than\n // drop them, enter each such cycle at its first node in space order.\n for (const node of levelNodes) {\n if (!primary.has(node.id)) orphans.push(visit(node, []));\n }\n\n const crossLinks = pendingCross.map(({ from, child }) => ({ from, to: primary.get(child)!, kind: 'cross' as const }));\n return { roots, orphans, primary, crossLinks };\n}\n\n/** Parent → child pairs of occurrence keys: one per rendered parent-child link, then cross-links. */\nexport function treeLinks(tree: Tree): TreeLink[] {\n const links: TreeLink[] = [];\n const walk = (occurrence: TreeOccurrence) => {\n for (const child of occurrence.children) {\n links.push({ from: occurrence.key, to: child.key, kind: 'tree' });\n walk(child);\n }\n };\n for (const root of [...tree.roots, ...tree.orphans]) walk(root);\n return [...links, ...tree.crossLinks];\n}\n","import type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { GroupLevel, LandscapeLayoutConfig } from './definition';\nimport { childEdges, parentEdges } from './graph';\nimport { occurrenceKey, type PathSegment } from './occurrence';\n\n/** One rendered container or node in a landscape. */\nexport type LandscapeOccurrence = {\n /** Path-based key, unique within the map view (see {@link occurrenceKey}). */\n key: string;\n /** Index of the grouping level this occurrence belongs to. */\n level: number;\n /** A node, or a field value shared by the nodes inside (`null`: the field is empty). */\n item: { kind: 'node'; node: SpaceNode } | { kind: 'value'; field: string; value: string | null };\n /** Nodes on the `via` chain that joined this node to the node level above, one entry per skipped type. */\n via: ViaStep[];\n /** Key of the node's first occurrence when this is a repeat. Repeats are rendered in full. */\n repeatOf?: string;\n children: LandscapeOccurrence[];\n};\n\nexport type ViaStep = { type: string; nodes: SpaceNode[] };\n\nexport type Landscape = {\n groups: LandscapeOccurrence[];\n /**\n * Nodes of a grouped level that no container above reaches (e.g. an Activity with no\n * Outcome when grouping by Outcomes), each with its own contents.\n */\n ungrouped: LandscapeOccurrence[];\n};\n\ntype Candidate = { node: SpaceNode; via: ViaStep[] };\ntype FieldFilter = { field: string; value: string | null };\n\n/**\n * Lay a space out as nested containers following the layout's grouping levels.\n *\n * Adjacent node levels are joined by any edge between their types, in either direction, or only\n * edges from `edge.field`. A `via` chain joins them through the skipped types. A field level\n * splits the next node level by that field's values. A node reached from several containers\n * appears in each, in full: the levels are finite, so repeating contents can't recurse.\n */\nexport function buildLandscape(graph: SpaceGraph, regionId: string, layout: LandscapeLayoutConfig): Landscape {\n const levels = layout.group;\n const order = new Map([...graph.nodes.keys()].map((title, i) => [title, i]));\n const first = new Map<string, string>();\n\n const occurrenceFor = (candidate: Candidate, levelIdx: number, path: readonly PathSegment[]): LandscapeOccurrence => {\n const { node } = candidate;\n const nodePath = [...path, node.id];\n const key = occurrenceKey(regionId, nodePath);\n const repeatOf = first.get(node.id);\n if (repeatOf === undefined) first.set(node.id, key);\n return {\n key,\n level: levelIdx,\n item: { kind: 'node', node },\n via: candidate.via,\n ...(repeatOf !== undefined && { repeatOf }),\n children: place(levelIdx + 1, node, [], nodePath),\n };\n };\n\n /** Occurrences for level `levelIdx` inside `anchor`, the nearest enclosing node. */\n const place = (\n levelIdx: number,\n anchor: SpaceNode | undefined,\n filters: readonly FieldFilter[],\n path: readonly PathSegment[],\n ): LandscapeOccurrence[] => {\n const level = levels[levelIdx];\n if (level === undefined) return [];\n if (isTypeLevel(level)) {\n return candidates(level, anchor, filters).map((c) => occurrenceFor(c, levelIdx, path));\n }\n\n const nodeLevel = levels.slice(levelIdx).find(isTypeLevel)!;\n const values = distinctValues(\n candidates(nodeLevel, anchor, filters).map((c) => c.node),\n level.field,\n );\n return values.map((value) => {\n const valuePath = [...path, [level.field, value] as const];\n return {\n key: occurrenceKey(regionId, valuePath),\n level: levelIdx,\n item: { kind: 'value', field: level.field, value },\n via: [],\n children: place(levelIdx + 1, anchor, [...filters, { field: level.field, value }], valuePath),\n };\n });\n };\n\n /** Nodes of a type level joined to `anchor` (all of the type at the top) and matching the filters. */\n const candidates = (\n level: TypeLevel,\n anchor: SpaceNode | undefined,\n filters: readonly FieldFilter[],\n ): Candidate[] => {\n const reached: Candidate[] =\n anchor === undefined\n ? ofType(level.type).map((node) => ({ node, via: [] }))\n : walkChain(anchor, level.via ?? [], level.type, level.edge?.field);\n return reached.filter(({ node }) => filters.every((f) => hasValue(node, f)));\n };\n\n const ofType = (type: string) => [...graph.nodes.values()].filter((node) => node.resolvedType === type);\n\n /** Neighbours of a node with the given type, across edges in either direction, in space order. */\n const neighbours = (title: SpaceNode['id'], type: string, field: string | undefined): SpaceNode[] => {\n const titles = new Set([\n ...childEdges(graph, title)\n .filter((e) => field === undefined || e.field === field)\n .map((e) => e.child),\n ...parentEdges(graph, title)\n .filter((e) => field === undefined || e.field === field)\n .map((e) => e.parent),\n ]);\n return [...titles]\n .map((t) => graph.nodes.get(t)!)\n .filter((node) => node.resolvedType === type)\n .sort((a, b) => order.get(a.id)! - order.get(b.id)!);\n };\n\n /**\n * Follow edges from `anchor` through each `via` type to `target`, keeping the skipped nodes on\n * the way to each target node. Several chains to one target merge into one candidate.\n */\n const walkChain = (anchor: SpaceNode, via: readonly string[], target: string, field: string | undefined) => {\n let frontier = [{ node: anchor, trail: [] as SpaceNode[] }];\n for (const type of via) {\n frontier = frontier.flatMap(({ node, trail }) =>\n neighbours(node.id, type, undefined).map((next) => ({ node: next, trail: [...trail, next] })),\n );\n }\n const byTitle = new Map<string, Candidate>();\n for (const { node, trail } of frontier) {\n for (const next of neighbours(node.id, target, field)) {\n const candidate = byTitle.get(next.id) ?? { node: next, via: via.map((type) => ({ type, nodes: [] })) };\n trail.forEach((skipped, i) => {\n const step = candidate.via[i]!;\n if (!step.nodes.includes(skipped)) step.nodes.push(skipped);\n });\n byTitle.set(next.id, candidate);\n }\n }\n return [...byTitle.values()].sort((a, b) => order.get(a.node.id)! - order.get(b.node.id)!);\n };\n\n const groups = place(0, undefined, [], []);\n\n // Nodes of an inner level that no container reached get their own contents, like tree orphans.\n const ungrouped: LandscapeOccurrence[] = [];\n levels.forEach((level, levelIdx) => {\n if (levelIdx === 0 || !isTypeLevel(level)) return;\n for (const node of ofType(level.type)) {\n if (!first.has(node.id)) ungrouped.push(occurrenceFor({ node, via: [] }, levelIdx, [null]));\n }\n });\n\n return { groups, ungrouped };\n}\n\ntype TypeLevel = Extract<GroupLevel, { type: string }>;\n\nfunction isTypeLevel(level: GroupLevel): level is TypeLevel {\n return 'type' in level;\n}\n\n/** A field's values as group labels: strings, an entry per array item, `null` when empty. */\nfunction valuesOf(node: SpaceNode, field: string): (string | null)[] {\n const raw = node.schemaData[field];\n const list = (Array.isArray(raw) ? raw : [raw]).filter((v) => v !== undefined && v !== null && v !== '');\n return list.length === 0 ? [null] : list.map((v) => (typeof v === 'object' ? JSON.stringify(v) : String(v)));\n}\n\n/** Distinct values in first-seen order, with the empty group last. */\nfunction distinctValues(nodes: SpaceNode[], field: string): (string | null)[] {\n const values = new Set(nodes.flatMap((node) => valuesOf(node, field)));\n const present = [...values].filter((v): v is string => v !== null);\n return values.has(null) ? [...present, null] : present;\n}\n\nfunction hasValue(node: SpaceNode, { field, value }: FieldFilter): boolean {\n return valuesOf(node, field).includes(value);\n}\n","import type { SpaceGraph, SpaceNode } from 'structured-context/api';\nimport type { AxisConfig, XYLayoutConfig } from './definition';\nimport { edgesWithin, isHierarchyEdge } from './graph';\nimport { occurrenceKey } from './occurrence';\n\n/** A plotted node. `x` and `y` run from 0 to 1 across the plot, left to right and bottom to top. */\nexport type XYPoint = { key: string; node: SpaceNode; x: number; y: number };\n\n/** Why a node of a plotted type couldn't be placed, per axis. */\nexport type Unplaced = { key: string; node: SpaceNode; reasons: string[] };\n\n/**\n * An edge between plotted nodes. `lane` separates edges joining the same two nodes: 0 when\n * there's one, otherwise centred around 0 (e.g. -0.5 and 0.5), for layouts to draw side by side.\n */\nexport type XYLink = { from: string; to: string; field: string; hierarchy: boolean; lane: number };\n\nexport type XYPlot = {\n points: XYPoint[];\n unplaced: Unplaced[];\n /** Edges between plotted nodes. */\n links: XYLink[];\n /** Each axis's [min, max]; `direction` says which end is drawn where. */\n domains: { x: readonly [number, number]; y: readonly [number, number] };\n};\n\n/**\n * Position nodes by two numeric fields. Every node of a plotted type appears once: on the plot\n * when both its values are numbers inside the axes' domains, otherwise in `unplaced` with the\n * reason. Positions are normalised; layouts decide the plot's size.\n */\nexport function buildXYPlot(graph: SpaceGraph, regionId: string, layout: XYLayoutConfig): XYPlot {\n const { x, y } = layout;\n const nodes = [...graph.nodes.values()];\n const types = new Set(\n layout.types.length > 0\n ? layout.types\n : nodes\n .filter((n) => isNumber(n.schemaData[x.field]) || isNumber(n.schemaData[y.field]))\n .map((n) => n.resolvedType),\n );\n const plotted = nodes.filter((n) => types.has(n.resolvedType));\n\n const domains = {\n x: domainOf(x, plotted),\n y: domainOf(y, plotted),\n };\n\n const points: XYPoint[] = [];\n const unplaced: Unplaced[] = [];\n for (const node of plotted) {\n const key = occurrenceKey(regionId, [node.id]);\n const px = position(node, x, domains.x);\n const py = position(node, y, domains.y);\n if (typeof px === 'number' && typeof py === 'number') points.push({ key, node, x: px, y: py });\n else unplaced.push({ key, node, reasons: [px, py].filter((r): r is string => typeof r === 'string') });\n }\n\n const keys = new Map<string, string>(points.map((p) => [p.node.id, p.key]));\n const fields = new Set(layout.edgeFields);\n const links = edgesWithin(graph)\n .filter((e) => keys.has(e.parent) && keys.has(e.child) && (fields.size === 0 || fields.has(e.field)))\n .map((e) => ({\n from: keys.get(e.parent)!,\n to: keys.get(e.child)!,\n field: e.field,\n hierarchy: isHierarchyEdge(e, graph.hierarchy),\n lane: 0,\n }));\n assignLanes(links);\n\n return { points, unplaced, links, domains };\n}\n\nfunction isNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value);\n}\n\n/** The axis's fixed domain, or the range of plotted values (widened when they're all equal). */\nfunction domainOf(axis: AxisConfig, nodes: readonly SpaceNode[]): readonly [number, number] {\n if (Array.isArray(axis.domain)) return [axis.domain[0]!, axis.domain[1]!];\n const values = nodes.map((n) => n.schemaData[axis.field]).filter(isNumber);\n if (values.length === 0) return [0, 1];\n const min = Math.min(...values);\n const max = Math.max(...values);\n return min === max ? [min - 1, max + 1] : [min, max];\n}\n\n/** The node's normalised position on the axis, or why it has none. */\nfunction position(node: SpaceNode, axis: AxisConfig, [min, max]: readonly [number, number]): number | string {\n const value = node.schemaData[axis.field];\n if (value === undefined || value === null) return `no ${axis.field}`;\n if (!isNumber(value)) return `${axis.field} is not a number`;\n if (value < min || value > max) return `${axis.field} ${value} is outside ${min}–${max}`;\n const t = (value - min) / (max - min);\n return axis.direction === 'descending' ? 1 - t : t;\n}\n\n/** Spread links joining the same pair of nodes (in either direction) into lanes around 0. */\nfunction assignLanes(links: XYLink[]) {\n const byPair = new Map<string, XYLink[]>();\n for (const link of links) {\n const pair = [link.from, link.to].sort().join('\\n');\n byPair.set(pair, [...(byPair.get(pair) ?? []), link]);\n }\n for (const group of byPair.values()) {\n group.forEach((link, i) => {\n link.lane = i - (group.length - 1) / 2;\n });\n }\n}\n"],"mappings":";;AAsCA,SAAgB,gBACd,OACA,OACsE;CACtE,MAAM,8BAAc,IAAI,IAA8B;CACtD,MAAM,aAAqC,CAAC;CAE5C,KAAK,MAAM,EAAE,MAAM,UAAU,SAAS,QAAQ,QAAQ,YAAY,MAAM,QAAQ;EAC9E,MAAM,aAA6B;GACjC;GACA,QAAQ;GACR;GACA,GAAI,SAAS,UAAU,WAAW,KAAA,KAAa,EAAE,OAAO;EAC1D;EACA,IAAI,WAAW,KAAA,KAAa,MAAM,MAAM,IAAI,MAAM,GAChD,YAAY,IAAI,QAAQ,CAAC,GAAI,YAAY,IAAI,MAAM,KAAK,CAAC,GAAI,UAAU,CAAC;OAExE,WAAW,KAAK;GACd,GAAG;GACH,GAAI,WAAW,KAAA,KAAa,EAAE,OAAO;GACrC,GAAI,WAAW,KAAA,KAAa,EA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GA,SAAS,SAAS,MAAiB,MAAkB,CAAC,KAAK,MAAkD;CAC3G,MAAM,QAAQ,KAAK,WAAW,KAAK;CACnC,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO,MAAM,KAAK;CAC7D,IAAI,CAAC,SAAS,KAAK,GAAG,OAAO,GAAG,KAAK,MAAM;CAC3C,IAAI,QAAQ,OAAO,QAAQ,KAAK,OAAO,GAAG,KAAK,MAAM,GAAG,MAAM,cAAc,IAAI,GAAG;CACnF,MAAM,KAAK,QAAQ,QAAQ,MAAM;CACjC,OAAO,KAAK,cAAc,eAAe,IAAI,IAAI;AACnD;;AAGA,SAAS,YAAY,OAAiB;CACpC,MAAM,yBAAS,IAAI,IAAsB;CACzC,KAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,OAAO,CAAC,KAAK,MAAM,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI;EAClD,OAAO,IAAI,MAAM,CAAC,GAAI,OAAO,IAAI,IAAI,KAAK,CAAC,GAAI,IAAI,CAAC;CACtD;CACA,KAAK,MAAM,SAAS,OAAO,OAAO,GAChC,MAAM,SAAS,MAAM,MAAM;EACzB,KAAK,OAAO,KAAK,MAAM,SAAS,KAAK;CACvC,CAAC;AAEL"}
@@ -1,450 +0,0 @@
1
- import { definitionSchema } from './definition-schema';
2
- import { landscapeLayoutSchema } from './landscape-layout';
3
- import { settingsSchema } from './settings';
4
- import { treeLayoutSchema } from './tree-layout';
5
- import { xyLayoutSchema } from './xy-layout';
6
- export { PARAM_REF } from './param-ref';
7
- export { definitionSchema, landscapeLayoutSchema, settingsSchema, treeLayoutSchema, xyLayoutSchema };
8
- /** The bundled schemas describing the map view definition format. */
9
- export declare const MAP_VIEW_SCHEMAS: readonly [{
10
- readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
11
- readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json";
12
- readonly title: 'Map view definition';
13
- 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.';
14
- readonly type: 'object';
15
- readonly required: readonly ['$id', 'schema', 'regions'];
16
- readonly additionalProperties: false;
17
- readonly properties: {
18
- readonly $schema: {
19
- readonly type: 'string';
20
- };
21
- readonly $id: {
22
- readonly type: 'string';
23
- readonly pattern: '^sctx-map-view://[^/]+(/[^/]+)?$';
24
- 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).';
25
- };
26
- readonly title: {
27
- readonly type: 'string';
28
- readonly minLength: 1;
29
- readonly description: 'Display name. Defaults to the last segment of the `$id`.';
30
- };
31
- readonly description: {
32
- readonly type: 'string';
33
- };
34
- readonly schema: {
35
- readonly type: 'string';
36
- readonly minLength: 1;
37
- readonly description: '`$id` of the structured-context schema whose spaces this map view applies to.';
38
- };
39
- readonly parameters: {
40
- readonly type: 'object';
41
- 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>" }.';
42
- readonly additionalProperties: {
43
- readonly $ref: '#/$defs/parameter';
44
- };
45
- };
46
- readonly regions: {
47
- readonly type: 'array';
48
- readonly minItems: 1;
49
- readonly description: 'Parts of the map view, each with its own layout, nodes and edges. Only the first region is rendered for now.';
50
- readonly items: {
51
- readonly $ref: '#/$defs/region';
52
- };
53
- };
54
- };
55
- readonly $defs: {
56
- readonly parameter: {
57
- readonly type: 'object';
58
- 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.";
59
- readonly required: readonly ['default'];
60
- readonly properties: {
61
- readonly title: {
62
- readonly type: 'string';
63
- };
64
- readonly description: {
65
- readonly type: 'string';
66
- };
67
- readonly default: {};
68
- };
69
- };
70
- readonly paramRef: {
71
- readonly type: 'object';
72
- readonly description: "Takes this setting's value from a declared parameter.";
73
- readonly required: readonly ['$param'];
74
- readonly additionalProperties: false;
75
- readonly properties: {
76
- readonly $param: {
77
- readonly type: 'string';
78
- readonly minLength: 1;
79
- };
80
- };
81
- };
82
- readonly region: {
83
- readonly type: 'object';
84
- readonly required: readonly ['id', 'layout'];
85
- readonly additionalProperties: false;
86
- readonly properties: {
87
- readonly id: {
88
- readonly type: 'string';
89
- readonly minLength: 1;
90
- readonly description: 'Unique within the map view; part of every occurrence id in the region.';
91
- };
92
- readonly select: {
93
- readonly type: 'object';
94
- readonly description: 'Which nodes of the space the region shows. By default, all of them.';
95
- readonly additionalProperties: false;
96
- readonly properties: {
97
- readonly filter: {
98
- readonly type: 'string';
99
- readonly minLength: 1;
100
- readonly description: "A structured-context filter: a view name from the space's config, or an expression such as `WHERE …` or `SELECT … WHERE …`.";
101
- };
102
- };
103
- };
104
- readonly layout: {
105
- readonly description: 'How the region is arranged, chosen by `type`.';
106
- readonly type: 'object';
107
- readonly required: readonly ['type'];
108
- readonly discriminator: {
109
- readonly propertyName: 'type';
110
- };
111
- readonly oneOf: readonly [{
112
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json";
113
- }, {
114
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json";
115
- }, {
116
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json";
117
- }];
118
- };
119
- readonly nodes: {
120
- readonly type: 'object';
121
- readonly additionalProperties: false;
122
- readonly default: {};
123
- readonly properties: {
124
- readonly style: {
125
- readonly description: string;
126
- readonly default: "card";
127
- readonly anyOf: readonly [{
128
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/nodeStyle";
129
- }, {
130
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
131
- }];
132
- };
133
- readonly fields: {
134
- readonly description: string;
135
- readonly default: readonly [];
136
- readonly anyOf: readonly [{
137
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
138
- }, {
139
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
140
- }];
141
- };
142
- readonly validation: {
143
- readonly description: string;
144
- readonly default: "off";
145
- readonly anyOf: readonly [{
146
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/validationLevel";
147
- }, {
148
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
149
- }];
150
- };
151
- readonly validationSources: {
152
- readonly description: string;
153
- readonly default: readonly ["parse", "schema", "duplicate", "broken-link", "hierarchy", "rule", "gated", "content-link"];
154
- readonly anyOf: readonly [{
155
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/validationSources";
156
- }, {
157
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
158
- }];
159
- };
160
- };
161
- };
162
- readonly edges: {
163
- readonly type: 'object';
164
- readonly additionalProperties: false;
165
- readonly default: {};
166
- readonly properties: {
167
- readonly show: {
168
- readonly description: string;
169
- readonly default: true;
170
- readonly anyOf: readonly [{
171
- readonly type: "boolean";
172
- }, {
173
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
174
- }];
175
- };
176
- };
177
- };
178
- };
179
- };
180
- };
181
- }, {
182
- readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
183
- readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json";
184
- readonly title: 'Shared map view settings';
185
- readonly description: 'Reusable setting definitions. Parameters can $ref these and narrow them, e.g. with allOf and enum.';
186
- readonly $defs: {
187
- readonly orientation: {
188
- readonly title: 'Orientation';
189
- readonly enum: readonly ['vertical', 'horizontal'];
190
- };
191
- readonly nodeStyle: {
192
- readonly title: 'Node style';
193
- readonly description: 'card: a box with the title and selected fields. shape: a compact marker with a tooltip.';
194
- readonly enum: readonly ['card', 'shape'];
195
- };
196
- readonly validationLevel: {
197
- readonly title: 'Validation overlay';
198
- readonly description: 'The lowest severity of validation result shown on nodes, or off. error: only errors. warning: errors and warnings. info: everything.';
199
- readonly enum: readonly ['off', 'error', 'warning', 'info'];
200
- };
201
- readonly validationSources: {
202
- readonly title: 'Validation sources';
203
- 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.';
204
- readonly type: 'array';
205
- readonly items: {
206
- readonly enum: readonly ["parse", "schema", "duplicate", "broken-link", "hierarchy", "rule", "gated", "content-link"];
207
- };
208
- readonly uniqueItems: true;
209
- };
210
- readonly fieldList: {
211
- readonly title: 'Fields';
212
- readonly type: 'array';
213
- readonly items: {
214
- readonly type: 'string';
215
- readonly minLength: 1;
216
- };
217
- readonly uniqueItems: true;
218
- };
219
- };
220
- }, {
221
- readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
222
- readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json";
223
- readonly title: 'Tree layout';
224
- readonly description: "A tree over the schema's hierarchy: root-type nodes at the top, children via hierarchy edges.";
225
- readonly type: 'object';
226
- readonly required: readonly ['type'];
227
- readonly additionalProperties: false;
228
- readonly properties: {
229
- readonly type: {
230
- readonly const: 'tree';
231
- };
232
- readonly orientation: {
233
- readonly description: string;
234
- readonly default: "vertical";
235
- readonly anyOf: readonly [{
236
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/orientation";
237
- }, {
238
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
239
- }];
240
- };
241
- readonly dag: {
242
- readonly description: string;
243
- readonly default: "repeat";
244
- readonly anyOf: readonly [{
245
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/tree.json#/$defs/dag";
246
- }, {
247
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
248
- }];
249
- };
250
- };
251
- readonly $defs: {
252
- readonly dag: {
253
- readonly title: 'Nodes with several parents';
254
- 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.';
255
- readonly enum: readonly ['repeat', 'cross-edge'];
256
- };
257
- };
258
- }, {
259
- readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
260
- readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json";
261
- readonly title: 'Landscape layout';
262
- readonly description: 'Nested containers: each grouping level becomes containers inside the level above, and the last level is drawn as nodes.';
263
- readonly type: 'object';
264
- readonly required: readonly ['type', 'group'];
265
- readonly additionalProperties: false;
266
- readonly properties: {
267
- readonly type: {
268
- readonly const: 'landscape';
269
- };
270
- readonly orientation: {
271
- readonly description: string;
272
- readonly default: "horizontal";
273
- readonly anyOf: readonly [{
274
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/orientation";
275
- }, {
276
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
277
- }];
278
- };
279
- readonly group: {
280
- readonly type: 'array';
281
- readonly minItems: 1;
282
- 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.';
283
- readonly items: {
284
- readonly type: 'object';
285
- readonly if: {
286
- readonly type: 'object';
287
- readonly required: readonly ['field'];
288
- };
289
- readonly then: {
290
- readonly type: 'object';
291
- 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.";
292
- readonly required: readonly ['field'];
293
- readonly additionalProperties: false;
294
- readonly properties: {
295
- readonly field: {
296
- readonly type: 'string';
297
- readonly minLength: 1;
298
- };
299
- };
300
- };
301
- readonly else: {
302
- readonly type: 'object';
303
- readonly description: 'A level of nodes of one type.';
304
- readonly required: readonly ['type'];
305
- readonly additionalProperties: false;
306
- readonly properties: {
307
- readonly type: {
308
- readonly description: 'Node type at this level.';
309
- readonly anyOf: readonly [{
310
- readonly type: 'string';
311
- readonly minLength: 1;
312
- }, {
313
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
314
- }];
315
- };
316
- readonly edge: {
317
- readonly type: 'object';
318
- 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.';
319
- readonly required: readonly ['field'];
320
- readonly additionalProperties: false;
321
- readonly properties: {
322
- readonly field: {
323
- readonly type: 'string';
324
- readonly minLength: 1;
325
- };
326
- };
327
- };
328
- readonly via: {
329
- readonly type: 'array';
330
- readonly minItems: 1;
331
- readonly description: 'Types skipped between the node level above and this one, in order. Nodes are joined through a chain of edges across them. Ignored on the first level, which has no level above.';
332
- readonly items: {
333
- readonly type: 'string';
334
- readonly minLength: 1;
335
- };
336
- };
337
- readonly intermediate: {
338
- readonly description: string;
339
- readonly default: "hidden";
340
- readonly anyOf: readonly [{
341
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json#/$defs/intermediate";
342
- }, {
343
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
344
- }];
345
- };
346
- };
347
- };
348
- };
349
- };
350
- };
351
- readonly $defs: {
352
- readonly intermediate: {
353
- readonly title: 'Skipped levels';
354
- readonly description: 'hidden: not shown. breadcrumb: listed on each node reached through them.';
355
- readonly enum: readonly ['hidden', 'breadcrumb'];
356
- };
357
- };
358
- }, {
359
- readonly $schema: 'https://json-schema.org/draft/2020-12/schema';
360
- readonly $id: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json";
361
- readonly title: 'XY layout';
362
- 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.';
363
- readonly type: 'object';
364
- readonly required: readonly ['type', 'x', 'y'];
365
- readonly additionalProperties: false;
366
- readonly properties: {
367
- readonly type: {
368
- readonly const: 'xy';
369
- };
370
- readonly x: {
371
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/axis";
372
- };
373
- readonly y: {
374
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/axis";
375
- };
376
- readonly types: {
377
- readonly description: string;
378
- readonly default: readonly [];
379
- readonly anyOf: readonly [{
380
- readonly type: "array";
381
- readonly items: {
382
- readonly type: "string";
383
- readonly minLength: 1;
384
- };
385
- readonly uniqueItems: true;
386
- }, {
387
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
388
- }];
389
- };
390
- readonly edgeFields: {
391
- readonly description: string;
392
- readonly default: readonly [];
393
- readonly anyOf: readonly [{
394
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/fieldList";
395
- }, {
396
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
397
- }];
398
- };
399
- };
400
- readonly $defs: {
401
- readonly axis: {
402
- readonly title: 'Axis';
403
- readonly type: 'object';
404
- readonly required: readonly ['field'];
405
- readonly additionalProperties: false;
406
- readonly properties: {
407
- readonly field: {
408
- readonly description: 'Numeric field giving the position.';
409
- readonly anyOf: readonly [{
410
- readonly type: 'string';
411
- readonly minLength: 1;
412
- }, {
413
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
414
- }];
415
- };
416
- readonly domain: {
417
- 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.';
418
- readonly default: 'data';
419
- readonly anyOf: readonly [{
420
- readonly const: 'data';
421
- }, {
422
- readonly type: 'array';
423
- readonly items: {
424
- readonly type: 'number';
425
- };
426
- readonly minItems: 2;
427
- readonly maxItems: 2;
428
- }];
429
- };
430
- readonly direction: {
431
- readonly description: string;
432
- readonly default: "ascending";
433
- readonly anyOf: readonly [{
434
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/xy.json#/$defs/direction";
435
- }, {
436
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
437
- }];
438
- };
439
- readonly label: {
440
- readonly type: 'string';
441
- readonly description: 'Axis title. Defaults to the field name.';
442
- };
443
- };
444
- };
445
- readonly direction: {
446
- readonly title: 'Axis direction';
447
- readonly enum: readonly ['ascending', 'descending'];
448
- };
449
- };
450
- }];
@@ -1,102 +0,0 @@
1
- /** Settings of the landscape layout: nested containers following an authored grouping. */
2
- export declare const landscapeLayoutSchema: {
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/landscape.json";
5
- readonly title: 'Landscape layout';
6
- readonly description: 'Nested containers: each grouping level becomes containers inside the level above, and the last level is drawn as nodes.';
7
- readonly type: 'object';
8
- readonly required: readonly ['type', 'group'];
9
- readonly additionalProperties: false;
10
- readonly properties: {
11
- readonly type: {
12
- readonly const: 'landscape';
13
- };
14
- readonly orientation: {
15
- readonly description: string;
16
- readonly default: "horizontal";
17
- readonly anyOf: readonly [{
18
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/settings.json#/$defs/orientation";
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 group: {
24
- readonly type: 'array';
25
- readonly minItems: 1;
26
- 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.';
27
- readonly items: {
28
- readonly type: 'object';
29
- readonly if: {
30
- readonly type: 'object';
31
- readonly required: readonly ['field'];
32
- };
33
- readonly then: {
34
- readonly type: 'object';
35
- 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.";
36
- readonly required: readonly ['field'];
37
- readonly additionalProperties: false;
38
- readonly properties: {
39
- readonly field: {
40
- readonly type: 'string';
41
- readonly minLength: 1;
42
- };
43
- };
44
- };
45
- readonly else: {
46
- readonly type: 'object';
47
- readonly description: 'A level of nodes of one type.';
48
- readonly required: readonly ['type'];
49
- readonly additionalProperties: false;
50
- readonly properties: {
51
- readonly type: {
52
- readonly description: 'Node type at this level.';
53
- readonly anyOf: readonly [{
54
- readonly type: 'string';
55
- readonly minLength: 1;
56
- }, {
57
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
58
- }];
59
- };
60
- readonly edge: {
61
- readonly type: 'object';
62
- 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.';
63
- readonly required: readonly ['field'];
64
- readonly additionalProperties: false;
65
- readonly properties: {
66
- readonly field: {
67
- readonly type: 'string';
68
- readonly minLength: 1;
69
- };
70
- };
71
- };
72
- readonly via: {
73
- readonly type: 'array';
74
- readonly minItems: 1;
75
- readonly description: 'Types skipped between the node level above and this one, in order. Nodes are joined through a chain of edges across them. Ignored on the first level, which has no level above.';
76
- readonly items: {
77
- readonly type: 'string';
78
- readonly minLength: 1;
79
- };
80
- };
81
- readonly intermediate: {
82
- readonly description: string;
83
- readonly default: "hidden";
84
- readonly anyOf: readonly [{
85
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/layouts/landscape.json#/$defs/intermediate";
86
- }, {
87
- readonly $ref: "https://raw.githubusercontent.com/mindsocket/structured-context-map-views/main/schemas/generated/latest/definition.json#/$defs/paramRef";
88
- }];
89
- };
90
- };
91
- };
92
- };
93
- };
94
- };
95
- readonly $defs: {
96
- readonly intermediate: {
97
- readonly title: 'Skipped levels';
98
- readonly description: 'hidden: not shown. breadcrumb: listed on each node reached through them.';
99
- readonly enum: readonly ['hidden', 'breadcrumb'];
100
- };
101
- };
102
- };
@@ -1,16 +0,0 @@
1
- import type { Hierarchy, SpaceGraph, SpaceNode } from 'structured-context/api';
2
- type NodeId = SpaceNode['id'];
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
- export {};