yarramate 1.23.2 → 1.24.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 (29) hide show
  1. package/dist/brief.js +19 -40
  2. package/dist/layout-mode.d.ts +56 -0
  3. package/dist/layout-mode.js +67 -0
  4. package/dist/projection.d.ts +20 -1
  5. package/dist/projection.js +9 -0
  6. package/dist/relationship-reading.d.ts +28 -0
  7. package/dist/relationship-reading.js +52 -0
  8. package/dist/schema-validators.generated.js +36 -23
  9. package/dist/visual-app/assets/index-CJVWkpLt.css +1 -0
  10. package/dist/visual-app/assets/index-wKXrkA2V.js +392 -0
  11. package/dist/visual-app/index.html +2 -2
  12. package/dist/visual-app-lib/editor.js +37303 -37260
  13. package/dist/visual-app-lib/styles.css +1 -1
  14. package/dist/visual-app-lib/types/layout-mode.d.ts +56 -0
  15. package/dist/visual-app-lib/types/projection.d.ts +20 -1
  16. package/dist/visual-app-lib/types/relationship-reading.d.ts +28 -0
  17. package/dist/visual-app-lib/types/visual-app/edge-routes.d.ts +47 -0
  18. package/dist/visual-app-lib/types/visual-app/elk-layout.d.ts +113 -0
  19. package/dist/visual-app-lib/types/visual-app/graph-canvas.d.ts +13 -5
  20. package/dist/visual-app-lib/types/visual-app/layout-controls.d.ts +23 -0
  21. package/dist/visual-app-lib/types/visual-app/query-fields.d.ts +10 -8
  22. package/dist/visual-app-lib/types/visual-app/query-panel.d.ts +5 -3
  23. package/dist/visual-app-lib/types/visual-app/save-view.d.ts +20 -16
  24. package/dist/visual-app-lib/types/visual-app/workspace-state.d.ts +13 -4
  25. package/package.json +1 -2
  26. package/schema/yarramate-projection-result.schema.json +4 -1
  27. package/schema/yarramate-projection.schema.json +6 -1
  28. package/dist/visual-app/assets/index-CnldeUHL.css +0 -1
  29. package/dist/visual-app/assets/index-CyKofiEE.js +0 -394
package/dist/brief.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { conceptKinds } from './profile.js';
2
+ import { RELATIONSHIP_READING, humanizeKind } from './relationship-reading.js';
2
3
  const coreKindNames = new Map(conceptKinds.map(({ id, name }) => [id, name]));
3
4
  const motivationKindIds = new Set(conceptKinds
4
5
  .filter(({ layer }) => layer === 'motivation')
@@ -41,54 +42,32 @@ export const isDeclaredNonGoal = (kind, status, lineages) => {
41
42
  const core = coreLocalKind(kind, lineages);
42
43
  return core !== undefined && nonGoalKindIds.has(core);
43
44
  };
44
- const humanizeKind = (kind) => {
45
- const local = kind.slice(kind.indexOf('#') + 1);
46
- return local
47
- .replaceAll(/([a-z0-9])([A-Z])/g, '$1 $2')
48
- .replaceAll('-', ' ')
49
- .toLowerCase();
50
- };
51
45
  const article = (reading) => /^[aeiou]/.test(reading) ? 'an' : 'a';
52
46
  const sentenceEnd = (text) => /[.!?]["')\]]*$/.test(text.trimEnd()) ? text.trimEnd() : `${text.trimEnd()}.`;
53
47
  const listPhrase = (items) => items.length <= 1
54
48
  ? (items[0] ?? '')
55
49
  : `${items.slice(0, -1).join(', ')} and ${items[items.length - 1]}`;
56
50
  // Phrase forms are the prose readings of each core relationship kind's
57
- // declared intent the same table `next` reads for ordering, spoken
58
- // from the source's perspective.
51
+ // declared intent - the same table `next` reads for ordering, spoken from
52
+ // the source's perspective. The plain readings live in
53
+ // `./relationship-reading.ts`, shared with the canvas's edge labels (ADR
54
+ // 0147); only the two kinds whose reading depends on the relationship's own
55
+ // fields are phrased here.
59
56
  const relationshipPhrase = (coreKind, fallbackKind, mode, content) => {
60
- switch (coreKind) {
61
- case 'serving':
62
- return 'serves';
63
- case 'access':
64
- return mode === 'read'
65
- ? 'reads'
66
- : mode === 'write'
67
- ? 'writes'
68
- : mode === 'read-write'
69
- ? 'reads and writes'
70
- : 'accesses';
71
- case 'realization':
72
- return 'realizes';
73
- case 'composition':
74
- return 'comprises';
75
- case 'aggregation':
76
- return 'aggregates';
77
- case 'assignment':
78
- return 'is assigned to';
79
- case 'triggering':
80
- return 'triggers';
81
- case 'flow':
82
- return content === undefined ? 'flows to' : `sends ${content} to`;
83
- case 'specialization':
84
- return 'specializes';
85
- case 'influence':
86
- return 'influences';
87
- case 'association':
88
- return 'is associated with';
89
- default:
90
- return humanizeKind(fallbackKind);
57
+ if (coreKind === 'access') {
58
+ return mode === 'read'
59
+ ? 'reads'
60
+ : mode === 'write'
61
+ ? 'writes'
62
+ : mode === 'read-write'
63
+ ? 'reads and writes'
64
+ : 'accesses';
65
+ }
66
+ if (coreKind === 'flow') {
67
+ return content === undefined ? 'flows to' : `sends ${content} to`;
91
68
  }
69
+ const reading = coreKind === undefined ? undefined : RELATIONSHIP_READING[coreKind];
70
+ return reading ?? humanizeKind(fallbackKind);
92
71
  };
93
72
  const estimateTokens = (text) => Math.ceil(text.length / 4);
94
73
  export function renderBrief(result, profileContext, budgetTokens,
@@ -0,0 +1,56 @@
1
+ /**
2
+ * How a view arranges itself, kept in a module that imports nothing.
3
+ *
4
+ * Apart from `projection.ts` for the reason `./layout-direction.ts` gives: the
5
+ * browser needs the value and not only the type, and `projection.ts` drags Ajv
6
+ * and the projection schema in for one constant. `projection.ts` re-exports
7
+ * everything here.
8
+ *
9
+ * The four modes are a ladder; each keeps everything below it (ADR 0147).
10
+ *
11
+ * - `layered`: ELK places the nodes and cytoscape draws its own orthogonal
12
+ * lines between them, through whatever happens to sit in the way. This is
13
+ * what shipped before 1.24; measured on the ApertureX reference model, 127
14
+ * of the Landscape's 206 drawn edges cut through a box that was not one of
15
+ * their endpoints.
16
+ * - `routed`: ELK also routes every edge around the nodes and reserves room
17
+ * for each label. Zero edges through boxes on every view measured.
18
+ * - `served-by`: routed, and serving, realization and specialization are
19
+ * layered UPWARD, so the served, realized or general element sits above
20
+ * what serves, realizes or specializes it, and the label reads down the
21
+ * page as "served by". Only the layering turns; the arrowhead, which says
22
+ * which end is which, keeps its ArchiMate form.
23
+ * - `bands`: served-by, and every element is pinned to its ArchiMate layer's
24
+ * band, motivation at the top and physical at the bottom.
25
+ */
26
+ export declare const LAYOUT_MODES: readonly ['layered', 'routed', 'served-by', 'bands'];
27
+ export type LayoutMode = (typeof LAYOUT_MODES)[number];
28
+ /**
29
+ * How a view lays out when it does not say. Served-by, because it is the
30
+ * mode that read correctly the first time anyone looked at real tiers: the
31
+ * plain top-down run put the system API above the experience API (ADR 0147).
32
+ * A view that wants the pre-1.24 picture declares `layout: layered`.
33
+ */
34
+ export declare const DEFAULT_LAYOUT: LayoutMode;
35
+ export declare const isLayoutMode: (value: unknown) => value is LayoutMode;
36
+ /** Whether ELK's own routes are drawn, rather than cytoscape's straight lines. */
37
+ export declare const routesEdges: (mode: LayoutMode) => boolean;
38
+ /** Whether the upward kinds are layered target-above-source. */
39
+ export declare const reversesForLayering: (mode: LayoutMode) => boolean;
40
+ /** Whether every node is pinned to its ArchiMate layer's band. */
41
+ export declare const partitionsByLayer: (mode: LayoutMode) => boolean;
42
+ /**
43
+ * The kinds ArchiMate draws with the TARGET above the source: the served
44
+ * element above its server, the realized above its realizer, the general
45
+ * above its specialization. Reversed for layering only; the notation module
46
+ * still draws the arrowhead at the target.
47
+ */
48
+ export declare const LAYERING_REVERSED_KINDS: ReadonlySet<string>;
49
+ /**
50
+ * Each ArchiMate layer's band under `bands`, top to bottom. `composite` has no
51
+ * band of its own - a grouping holds members from any layer - and a subject
52
+ * with no layer floats free, so neither is listed: ELK partitions only what
53
+ * names a partition, and leaves the rest to the layering.
54
+ */
55
+ export declare const LAYER_BAND: Readonly<Record<string, number>>;
56
+ export declare const layerBandOf: (layer: string | null | undefined) => number | undefined;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * How a view arranges itself, kept in a module that imports nothing.
3
+ *
4
+ * Apart from `projection.ts` for the reason `./layout-direction.ts` gives: the
5
+ * browser needs the value and not only the type, and `projection.ts` drags Ajv
6
+ * and the projection schema in for one constant. `projection.ts` re-exports
7
+ * everything here.
8
+ *
9
+ * The four modes are a ladder; each keeps everything below it (ADR 0147).
10
+ *
11
+ * - `layered`: ELK places the nodes and cytoscape draws its own orthogonal
12
+ * lines between them, through whatever happens to sit in the way. This is
13
+ * what shipped before 1.24; measured on the ApertureX reference model, 127
14
+ * of the Landscape's 206 drawn edges cut through a box that was not one of
15
+ * their endpoints.
16
+ * - `routed`: ELK also routes every edge around the nodes and reserves room
17
+ * for each label. Zero edges through boxes on every view measured.
18
+ * - `served-by`: routed, and serving, realization and specialization are
19
+ * layered UPWARD, so the served, realized or general element sits above
20
+ * what serves, realizes or specializes it, and the label reads down the
21
+ * page as "served by". Only the layering turns; the arrowhead, which says
22
+ * which end is which, keeps its ArchiMate form.
23
+ * - `bands`: served-by, and every element is pinned to its ArchiMate layer's
24
+ * band, motivation at the top and physical at the bottom.
25
+ */
26
+ export const LAYOUT_MODES = ['layered', 'routed', 'served-by', 'bands'];
27
+ /**
28
+ * How a view lays out when it does not say. Served-by, because it is the
29
+ * mode that read correctly the first time anyone looked at real tiers: the
30
+ * plain top-down run put the system API above the experience API (ADR 0147).
31
+ * A view that wants the pre-1.24 picture declares `layout: layered`.
32
+ */
33
+ export const DEFAULT_LAYOUT = 'served-by';
34
+ export const isLayoutMode = (value) => typeof value === 'string' && LAYOUT_MODES.includes(value);
35
+ /** Whether ELK's own routes are drawn, rather than cytoscape's straight lines. */
36
+ export const routesEdges = (mode) => mode !== 'layered';
37
+ /** Whether the upward kinds are layered target-above-source. */
38
+ export const reversesForLayering = (mode) => mode === 'served-by' || mode === 'bands';
39
+ /** Whether every node is pinned to its ArchiMate layer's band. */
40
+ export const partitionsByLayer = (mode) => mode === 'bands';
41
+ /**
42
+ * The kinds ArchiMate draws with the TARGET above the source: the served
43
+ * element above its server, the realized above its realizer, the general
44
+ * above its specialization. Reversed for layering only; the notation module
45
+ * still draws the arrowhead at the target.
46
+ */
47
+ export const LAYERING_REVERSED_KINDS = new Set([
48
+ 'serving',
49
+ 'realization',
50
+ 'specialization',
51
+ ]);
52
+ /**
53
+ * Each ArchiMate layer's band under `bands`, top to bottom. `composite` has no
54
+ * band of its own - a grouping holds members from any layer - and a subject
55
+ * with no layer floats free, so neither is listed: ELK partitions only what
56
+ * names a partition, and leaves the rest to the layering.
57
+ */
58
+ export const LAYER_BAND = {
59
+ motivation: 0,
60
+ strategy: 1,
61
+ business: 2,
62
+ application: 3,
63
+ technology: 4,
64
+ physical: 5,
65
+ implementation: 6,
66
+ };
67
+ export const layerBandOf = (layer) => layer === null || layer === undefined ? undefined : LAYER_BAND[layer];
@@ -51,7 +51,13 @@ export interface ProjectionDefinition {
51
51
  readonly presentation?: {
52
52
  readonly title?: string;
53
53
  readonly description?: string;
54
- readonly layout?: 'layered';
54
+ /**
55
+ * How this view arranges itself: `layered`, `routed`, `served-by` or
56
+ * `bands`, a ladder where each keeps everything below it (ADR 0147). A
57
+ * view that says nothing lays out `served-by`. The canvas offers the
58
+ * choice on screen and a save writes what is in force.
59
+ */
60
+ readonly layout?: LayoutMode;
55
61
  /**
56
62
  * Which way this view runs its layers. Read by the LikeC4 export for its
57
63
  * `autoLayout` and by the canvas for ELK's `elk.direction` (ADR 0121); a
@@ -78,6 +84,13 @@ export interface ProjectionDefinition {
78
84
  readonly showLifecycle?: boolean;
79
85
  readonly showEvidence?: boolean;
80
86
  readonly showOwnership?: boolean;
87
+ /**
88
+ * Whether an unnamed relationship is labelled with its reading - "serves",
89
+ * "served by", "realizes" - or left to its line style and arrowhead
90
+ * (ADR 0147). A named relationship keeps its name either way. On when
91
+ * absent, which is what shipped.
92
+ */
93
+ readonly showKindLabels?: boolean;
81
94
  /**
82
95
  * The folder this view files itself under in an editor's rail: a label the
83
96
  * author declares, nested with `/`, never the directory the projection
@@ -116,6 +129,12 @@ import { type FoldMembership } from './fold-tree.js';
116
129
  */
117
130
  export { DEFAULT_DIRECTION, type LayoutDirection } from './layout-direction.js';
118
131
  import type { LayoutDirection } from './layout-direction.js';
132
+ /**
133
+ * How a view arranges itself, and the default. Same split, same terms
134
+ * (ADR 0147).
135
+ */
136
+ export { DEFAULT_LAYOUT, LAYOUT_MODES, type LayoutMode } from './layout-mode.js';
137
+ import type { LayoutMode } from './layout-mode.js';
119
138
  export type ProjectionQuery = ProjectionDefinition['query'];
120
139
  export interface ProjectionResult {
121
140
  readonly format: 'yarramate/projection-result/v1';
@@ -23,6 +23,11 @@ import { kindLabelOf } from './kind-label.js';
23
23
  * nesting vocabulary above, and re-exported here on the same terms (ADR 0121).
24
24
  */
25
25
  export { DEFAULT_DIRECTION } from './layout-direction.js';
26
+ /**
27
+ * How a view arranges itself, and the default. Same split, same terms
28
+ * (ADR 0147).
29
+ */
30
+ export { DEFAULT_LAYOUT, LAYOUT_MODES } from './layout-mode.js';
26
31
  import { validateProjection } from './schema-validation.js';
27
32
  export function loadProjection(source) {
28
33
  const loaded = loadSourceDocument(source, validateProjection, 'Projection');
@@ -66,6 +71,7 @@ export function canonicalProjection(projection) {
66
71
  ...(presentation.showLifecycle === undefined ? {} : { showLifecycle: presentation.showLifecycle }),
67
72
  ...(presentation.showEvidence === undefined ? {} : { showEvidence: presentation.showEvidence }),
68
73
  ...(presentation.showOwnership === undefined ? {} : { showOwnership: presentation.showOwnership }),
74
+ ...(presentation.showKindLabels === undefined ? {} : { showKindLabels: presentation.showKindLabels }),
69
75
  ...(presentation.notation === undefined ? {} : { notation: presentation.notation }),
70
76
  },
71
77
  }),
@@ -631,6 +637,9 @@ export function evaluateProjection(graph, projection, profileContext, membership
631
637
  ...(projection.presentation.showOwnership === undefined
632
638
  ? {}
633
639
  : { showOwnership: projection.presentation.showOwnership }),
640
+ ...(projection.presentation.showKindLabels === undefined
641
+ ? {}
642
+ : { showKindLabels: projection.presentation.showKindLabels }),
634
643
  ...(projection.presentation.notation === undefined
635
644
  ? {}
636
645
  : { notation: projection.presentation.notation }),
@@ -0,0 +1,28 @@
1
+ /**
2
+ * How a relationship reads as prose, kept in a module that imports nothing.
3
+ *
4
+ * One table for the brief and the canvas (ADR 0147). The brief has said
5
+ * "System API serves Process API" since it existed, and an edge label reading
6
+ * `serving` beside it was the same fact in a different voice. Every phrase
7
+ * here is spoken from the SOURCE: "a serves b".
8
+ *
9
+ * A canvas that layers the served element above what serves it reads the same
10
+ * edge from the other end, "b served by a", so the three kinds that turn for
11
+ * layering (`LAYERING_REVERSED_KINDS` in `./layout-mode.ts`) also carry a
12
+ * passive reading. Nothing else does: "b accessed by a" is not how anyone
13
+ * reads an access.
14
+ */
15
+ export declare const RELATIONSHIP_READING: Readonly<Record<string, string>>;
16
+ export declare const REVERSED_READING: Readonly<Record<string, string>>;
17
+ /**
18
+ * `acme/p@1#applicationComponent` reads "application component" and
19
+ * `data-object` reads "data object": the last resort for a kind the table does
20
+ * not know, which is every extension kind.
21
+ */
22
+ export declare const humanizeKind: (kind: string) => string;
23
+ /**
24
+ * The reading of one relationship kind. `reversed` asks for the passive form
25
+ * and gets it only where one exists; a kind with no passive reading keeps its
26
+ * active one, so a caller can pass the layering's answer straight through.
27
+ */
28
+ export declare const relationshipReading: (coreKind: string, reversed?: boolean) => string;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * How a relationship reads as prose, kept in a module that imports nothing.
3
+ *
4
+ * One table for the brief and the canvas (ADR 0147). The brief has said
5
+ * "System API serves Process API" since it existed, and an edge label reading
6
+ * `serving` beside it was the same fact in a different voice. Every phrase
7
+ * here is spoken from the SOURCE: "a serves b".
8
+ *
9
+ * A canvas that layers the served element above what serves it reads the same
10
+ * edge from the other end, "b served by a", so the three kinds that turn for
11
+ * layering (`LAYERING_REVERSED_KINDS` in `./layout-mode.ts`) also carry a
12
+ * passive reading. Nothing else does: "b accessed by a" is not how anyone
13
+ * reads an access.
14
+ */
15
+ export const RELATIONSHIP_READING = {
16
+ serving: 'serves',
17
+ access: 'accesses',
18
+ realization: 'realizes',
19
+ composition: 'comprises',
20
+ aggregation: 'aggregates',
21
+ assignment: 'is assigned to',
22
+ triggering: 'triggers',
23
+ flow: 'flows to',
24
+ specialization: 'specializes',
25
+ influence: 'influences',
26
+ association: 'is associated with',
27
+ };
28
+ export const REVERSED_READING = {
29
+ serving: 'served by',
30
+ realization: 'realized by',
31
+ specialization: 'specialized by',
32
+ };
33
+ /**
34
+ * `acme/p@1#applicationComponent` reads "application component" and
35
+ * `data-object` reads "data object": the last resort for a kind the table does
36
+ * not know, which is every extension kind.
37
+ */
38
+ export const humanizeKind = (kind) => {
39
+ const local = kind.slice(kind.indexOf('#') + 1);
40
+ return local
41
+ .replaceAll(/([a-z0-9])([A-Z])/g, '$1 $2')
42
+ .replaceAll('-', ' ')
43
+ .toLowerCase();
44
+ };
45
+ /**
46
+ * The reading of one relationship kind. `reversed` asks for the passive form
47
+ * and gets it only where one exists; a kind with no passive reading keeps its
48
+ * active one, so a caller can pass the layering's answer straight through.
49
+ */
50
+ export const relationshipReading = (coreKind, reversed = false) => (reversed ? REVERSED_READING[coreKind] : undefined) ??
51
+ RELATIONSHIP_READING[coreKind] ??
52
+ humanizeKind(coreKind);
@@ -9,7 +9,7 @@
9
9
  // file and not a runtime one; the two pure helpers imported below are
10
10
  // all the runtime still takes from ajv.
11
11
  //
12
- // schema/ sha256: 71358391c82518d840a0bc538999ea67063aa97e7093f7ca099155f57c44abba
12
+ // schema/ sha256: 047e27f42a2bbeaf186894dad22fea47af390a5f299667cca2e70b20873fbf05
13
13
  import ajvRuntime0Module from 'ajv/dist/runtime/ucs2length.js';
14
14
  const ajvRuntime0 = ajvRuntime0Module.default ?? ajvRuntime0Module;
15
15
  import ajvRuntime1Module from 'ajv/dist/runtime/equal.js';
@@ -4476,7 +4476,7 @@ else {
4476
4476
  } validate61.errors = vErrors; return errors === 0; }
4477
4477
  validate61.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
4478
4478
  export const validateProjection = validate62;
4479
- const schema113 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://yarramate.org/schema/projection/v1", "title": "YarraMate semantic projection", "type": "object", "additionalProperties": false, "required": ["format", "id", "version", "query"], "properties": { "format": { "const": "yarramate/projection/v1" }, "id": { "$ref": "#/$defs/id" }, "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+$" }, "query": { "$ref": "#/$defs/query" }, "presentation": { "$ref": "#/$defs/presentation" } }, "$defs": { "query": { "type": "object", "additionalProperties": false, "properties": { "subjects": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "instances": { "description": "Pattern instances whose CONTENTS this query selects (#473, ADR 0144). Each id names an instance, and the facet selects that instance together with everything the fold tree would draw inside it: the same closure `presentation.fold: \"instances\"` collapses into one box, read through this view's own `nesting`. This is the one facet that ADDS rather than narrows. `subjects` and `instances` are a single identity facet spelled two ways and their values combine with OR, while every other field still ANDs over the union. Naming the instance rather than hand-listing its members is what keeps a view from going stale the next time the pattern binds a slot. An id that names nothing is refused (YM921); one that names a subject which is not a pattern instance is refused separately (YM922), because a typo and a category error send an author to different places.", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "exclude": { "description": "Subjects this query would otherwise select and the author has taken out: the exception a rule cannot state (#267, ADR 0122). Applied after every other facet and after relationship expansion, so an excluded subject is out whichever way it would have come back in. Naming a subject no facet selects is allowed and inert until the model grows into the rule.", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "documents": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } }, "kinds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/qualifiedKind" } }, "layers": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/layer" } }, "statuses": { "type": "array", "uniqueItems": true, "items": { "enum": ["planned", "current", "retired"] } }, "excludeStatuses": { "description": "Drop concepts carrying one of these lifecycle statuses while keeping concepts that declare no status at all - 'everything except retired' for viewpoint projections, where a bare statuses filter would wrongly drop unstatused actors and motivation elements.", "type": "array", "uniqueItems": true, "items": { "enum": ["planned", "current", "retired"] } }, "states": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "owners": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "constraints": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "relationshipKinds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/qualifiedKind" } }, "kindMatching": { "enum": ["exact", "descendants"] }, "relationships": { "enum": ["between", "connected", "none"] }, "isolatedConcepts": { "enum": ["include", "exclude"] } } }, "presentation": { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/nonEmptyText" }, "description": { "$ref": "#/$defs/nonEmptyText" }, "layout": { "enum": ["layered"] }, "direction": { "enum": ["top-down", "left-right"] }, "nesting": { "type": "array", "uniqueItems": true, "items": { "enum": ["composition", "assignment"] } }, "fold": { "description": "Whether this view draws pattern instances FOLDED by default (#473). \"instances\" collapses every instance to a single node carrying its members, with the edges into and out of them lifted onto the box; \"none\", the default, draws everything. A reader opens what they want, so this says where to START rather than what may be seen. Folding reads the same containment tree nesting does, so a view declaring fold without \"assignment\" in nesting collapses less than its author probably expects; the editor says so rather than the loader refusing it, because a diagnostic has no warning severity and this is not an error.", "enum": ["instances", "none"] }, "showLifecycle": { "type": "boolean" }, "showEvidence": { "type": "boolean" }, "showOwnership": { "type": "boolean" }, "notation": { "enum": ["archimate"] }, "folder": { "type": "string", "description": "The folder this view files itself under in an editor's rail. A LABEL the author declares, never the directory the projection sits in: nest with '/' separators, and the filesystem is never consulted (ADR 0104).", "pattern": "^[^/]+(?:/[^/]+)*$", "minLength": 1 } } }, "id": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, "qualifiedKind": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(?:/[a-z][a-z0-9-]*)+@[0-9]+\\.[0-9]+#[a-z][A-Za-z0-9-]*$" }, "subjectIdentity": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, "nonEmptyText": { "type": "string", "minLength": 1 }, "layer": { "enum": ["motivation", "strategy", "business", "application", "technology", "physical", "implementation", "composite"] } } };
4479
+ const schema113 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://yarramate.org/schema/projection/v1", "title": "YarraMate semantic projection", "type": "object", "additionalProperties": false, "required": ["format", "id", "version", "query"], "properties": { "format": { "const": "yarramate/projection/v1" }, "id": { "$ref": "#/$defs/id" }, "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+$" }, "query": { "$ref": "#/$defs/query" }, "presentation": { "$ref": "#/$defs/presentation" } }, "$defs": { "query": { "type": "object", "additionalProperties": false, "properties": { "subjects": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "instances": { "description": "Pattern instances whose CONTENTS this query selects (#473, ADR 0144). Each id names an instance, and the facet selects that instance together with everything the fold tree would draw inside it: the same closure `presentation.fold: \"instances\"` collapses into one box, read through this view's own `nesting`. This is the one facet that ADDS rather than narrows. `subjects` and `instances` are a single identity facet spelled two ways and their values combine with OR, while every other field still ANDs over the union. Naming the instance rather than hand-listing its members is what keeps a view from going stale the next time the pattern binds a slot. An id that names nothing is refused (YM921); one that names a subject which is not a pattern instance is refused separately (YM922), because a typo and a category error send an author to different places.", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "exclude": { "description": "Subjects this query would otherwise select and the author has taken out: the exception a rule cannot state (#267, ADR 0122). Applied after every other facet and after relationship expansion, so an excluded subject is out whichever way it would have come back in. Naming a subject no facet selects is allowed and inert until the model grows into the rule.", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "documents": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } }, "kinds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/qualifiedKind" } }, "layers": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/layer" } }, "statuses": { "type": "array", "uniqueItems": true, "items": { "enum": ["planned", "current", "retired"] } }, "excludeStatuses": { "description": "Drop concepts carrying one of these lifecycle statuses while keeping concepts that declare no status at all - 'everything except retired' for viewpoint projections, where a bare statuses filter would wrongly drop unstatused actors and motivation elements.", "type": "array", "uniqueItems": true, "items": { "enum": ["planned", "current", "retired"] } }, "states": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "owners": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "constraints": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "relationshipKinds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/qualifiedKind" } }, "kindMatching": { "enum": ["exact", "descendants"] }, "relationships": { "enum": ["between", "connected", "none"] }, "isolatedConcepts": { "enum": ["include", "exclude"] } } }, "presentation": { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/nonEmptyText" }, "description": { "$ref": "#/$defs/nonEmptyText" }, "layout": { "description": "How the view arranges itself (ADR 0147), a ladder where each mode keeps everything below it: \"layered\" places the nodes and lets the canvas draw straight lines between them; \"routed\" also routes every edge around the nodes and reserves room for its label; \"served-by\" also layers serving, realization and specialization upward, so the served element sits above what serves it and the label reads down the page; \"bands\" also pins every element to its ArchiMate layer's band. A view that says nothing lays out \"served-by\".", "enum": ["layered", "routed", "served-by", "bands"] }, "direction": { "enum": ["top-down", "left-right"] }, "nesting": { "type": "array", "uniqueItems": true, "items": { "enum": ["composition", "assignment"] } }, "fold": { "description": "Whether this view draws pattern instances FOLDED by default (#473). \"instances\" collapses every instance to a single node carrying its members, with the edges into and out of them lifted onto the box; \"none\", the default, draws everything. A reader opens what they want, so this says where to START rather than what may be seen. Folding reads the same containment tree nesting does, so a view declaring fold without \"assignment\" in nesting collapses less than its author probably expects; the editor says so rather than the loader refusing it, because a diagnostic has no warning severity and this is not an error.", "enum": ["instances", "none"] }, "showLifecycle": { "type": "boolean" }, "showEvidence": { "type": "boolean" }, "showOwnership": { "type": "boolean" }, "showKindLabels": { "description": "Whether an unnamed relationship is labelled with its reading (\"serves\", \"served by\", \"realizes\"). Off, the line style and arrowhead alone say the kind; a named relationship keeps its name either way. On when absent.", "type": "boolean" }, "notation": { "enum": ["archimate"] }, "folder": { "type": "string", "description": "The folder this view files itself under in an editor's rail. A LABEL the author declares, never the directory the projection sits in: nest with '/' separators, and the filesystem is never consulted (ADR 0104).", "pattern": "^[^/]+(?:/[^/]+)*$", "minLength": 1 } } }, "id": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, "qualifiedKind": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(?:/[a-z][a-z0-9-]*)+@[0-9]+\\.[0-9]+#[a-z][A-Za-z0-9-]*$" }, "subjectIdentity": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, "nonEmptyText": { "type": "string", "minLength": 1 }, "layer": { "enum": ["motivation", "strategy", "business", "application", "technology", "physical", "implementation", "composite"] } } };
4480
4480
  const schema114 = { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" };
4481
4481
  const schema115 = { "type": "object", "additionalProperties": false, "properties": { "subjects": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "instances": { "description": "Pattern instances whose CONTENTS this query selects (#473, ADR 0144). Each id names an instance, and the facet selects that instance together with everything the fold tree would draw inside it: the same closure `presentation.fold: \"instances\"` collapses into one box, read through this view's own `nesting`. This is the one facet that ADDS rather than narrows. `subjects` and `instances` are a single identity facet spelled two ways and their values combine with OR, while every other field still ANDs over the union. Naming the instance rather than hand-listing its members is what keeps a view from going stale the next time the pattern binds a slot. An id that names nothing is refused (YM921); one that names a subject which is not a pattern instance is refused separately (YM922), because a typo and a category error send an author to different places.", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "exclude": { "description": "Subjects this query would otherwise select and the author has taken out: the exception a rule cannot state (#267, ADR 0122). Applied after every other facet and after relationship expansion, so an excluded subject is out whichever way it would have come back in. Naming a subject no facet selects is allowed and inert until the model grows into the rule.", "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "documents": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } }, "kinds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/qualifiedKind" } }, "layers": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/layer" } }, "statuses": { "type": "array", "uniqueItems": true, "items": { "enum": ["planned", "current", "retired"] } }, "excludeStatuses": { "description": "Drop concepts carrying one of these lifecycle statuses while keeping concepts that declare no status at all - 'everything except retired' for viewpoint projections, where a bare statuses filter would wrongly drop unstatused actors and motivation elements.", "type": "array", "uniqueItems": true, "items": { "enum": ["planned", "current", "retired"] } }, "states": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "owners": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "constraints": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/subjectIdentity" } }, "relationshipKinds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/qualifiedKind" } }, "kindMatching": { "enum": ["exact", "descendants"] }, "relationships": { "enum": ["between", "connected", "none"] }, "isolatedConcepts": { "enum": ["include", "exclude"] } } };
4482
4482
  const schema116 = { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" };
@@ -5314,7 +5314,7 @@ else {
5314
5314
  errors++;
5315
5315
  } validate63.errors = vErrors; return errors === 0; }
5316
5316
  validate63.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
5317
- const schema126 = { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/nonEmptyText" }, "description": { "$ref": "#/$defs/nonEmptyText" }, "layout": { "enum": ["layered"] }, "direction": { "enum": ["top-down", "left-right"] }, "nesting": { "type": "array", "uniqueItems": true, "items": { "enum": ["composition", "assignment"] } }, "fold": { "description": "Whether this view draws pattern instances FOLDED by default (#473). \"instances\" collapses every instance to a single node carrying its members, with the edges into and out of them lifted onto the box; \"none\", the default, draws everything. A reader opens what they want, so this says where to START rather than what may be seen. Folding reads the same containment tree nesting does, so a view declaring fold without \"assignment\" in nesting collapses less than its author probably expects; the editor says so rather than the loader refusing it, because a diagnostic has no warning severity and this is not an error.", "enum": ["instances", "none"] }, "showLifecycle": { "type": "boolean" }, "showEvidence": { "type": "boolean" }, "showOwnership": { "type": "boolean" }, "notation": { "enum": ["archimate"] }, "folder": { "type": "string", "description": "The folder this view files itself under in an editor's rail. A LABEL the author declares, never the directory the projection sits in: nest with '/' separators, and the filesystem is never consulted (ADR 0104).", "pattern": "^[^/]+(?:/[^/]+)*$", "minLength": 1 } } };
5317
+ const schema126 = { "type": "object", "additionalProperties": false, "properties": { "title": { "$ref": "#/$defs/nonEmptyText" }, "description": { "$ref": "#/$defs/nonEmptyText" }, "layout": { "description": "How the view arranges itself (ADR 0147), a ladder where each mode keeps everything below it: \"layered\" places the nodes and lets the canvas draw straight lines between them; \"routed\" also routes every edge around the nodes and reserves room for its label; \"served-by\" also layers serving, realization and specialization upward, so the served element sits above what serves it and the label reads down the page; \"bands\" also pins every element to its ArchiMate layer's band. A view that says nothing lays out \"served-by\".", "enum": ["layered", "routed", "served-by", "bands"] }, "direction": { "enum": ["top-down", "left-right"] }, "nesting": { "type": "array", "uniqueItems": true, "items": { "enum": ["composition", "assignment"] } }, "fold": { "description": "Whether this view draws pattern instances FOLDED by default (#473). \"instances\" collapses every instance to a single node carrying its members, with the edges into and out of them lifted onto the box; \"none\", the default, draws everything. A reader opens what they want, so this says where to START rather than what may be seen. Folding reads the same containment tree nesting does, so a view declaring fold without \"assignment\" in nesting collapses less than its author probably expects; the editor says so rather than the loader refusing it, because a diagnostic has no warning severity and this is not an error.", "enum": ["instances", "none"] }, "showLifecycle": { "type": "boolean" }, "showEvidence": { "type": "boolean" }, "showOwnership": { "type": "boolean" }, "showKindLabels": { "description": "Whether an unnamed relationship is labelled with its reading (\"serves\", \"served by\", \"realizes\"). Off, the line style and arrowhead alone say the kind; a named relationship keeps its name either way. On when absent.", "type": "boolean" }, "notation": { "enum": ["archimate"] }, "folder": { "type": "string", "description": "The folder this view files itself under in an editor's rail. A LABEL the author declares, never the directory the projection sits in: nest with '/' separators, and the filesystem is never consulted (ADR 0104).", "pattern": "^[^/]+(?:/[^/]+)*$", "minLength": 1 } } };
5318
5318
  const schema127 = { "type": "string", "minLength": 1 };
5319
5319
  function validate65(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate65.evaluated; if (evaluated0.dynamicProps) {
5320
5320
  evaluated0.props = undefined;
@@ -5384,7 +5384,8 @@ function validate65(data, { instancePath = "", parentData, parentDataProperty, r
5384
5384
  }
5385
5385
  }
5386
5386
  if (data.layout !== undefined) {
5387
- if (!(data.layout === "layered")) {
5387
+ let data2 = data.layout;
5388
+ if (!((((data2 === "layered") || (data2 === "routed")) || (data2 === "served-by")) || (data2 === "bands"))) {
5388
5389
  const err5 = { instancePath: instancePath + "/layout", schemaPath: "#/properties/layout/enum", keyword: "enum", params: { allowedValues: schema126.properties.layout.enum }, message: "must be equal to one of the allowed values" };
5389
5390
  if (vErrors === null) {
5390
5391
  vErrors = [err5];
@@ -5505,9 +5506,9 @@ function validate65(data, { instancePath = "", parentData, parentDataProperty, r
5505
5506
  errors++;
5506
5507
  }
5507
5508
  }
5508
- if (data.notation !== undefined) {
5509
- if (!(data.notation === "archimate")) {
5510
- const err14 = { instancePath: instancePath + "/notation", schemaPath: "#/properties/notation/enum", keyword: "enum", params: { allowedValues: schema126.properties.notation.enum }, message: "must be equal to one of the allowed values" };
5509
+ if (data.showKindLabels !== undefined) {
5510
+ if (typeof data.showKindLabels !== "boolean") {
5511
+ const err14 = { instancePath: instancePath + "/showKindLabels", schemaPath: "#/properties/showKindLabels/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
5511
5512
  if (vErrors === null) {
5512
5513
  vErrors = [err14];
5513
5514
  }
@@ -5517,49 +5518,61 @@ function validate65(data, { instancePath = "", parentData, parentDataProperty, r
5517
5518
  errors++;
5518
5519
  }
5519
5520
  }
5521
+ if (data.notation !== undefined) {
5522
+ if (!(data.notation === "archimate")) {
5523
+ const err15 = { instancePath: instancePath + "/notation", schemaPath: "#/properties/notation/enum", keyword: "enum", params: { allowedValues: schema126.properties.notation.enum }, message: "must be equal to one of the allowed values" };
5524
+ if (vErrors === null) {
5525
+ vErrors = [err15];
5526
+ }
5527
+ else {
5528
+ vErrors.push(err15);
5529
+ }
5530
+ errors++;
5531
+ }
5532
+ }
5520
5533
  if (data.folder !== undefined) {
5521
- let data11 = data.folder;
5522
- if (typeof data11 === "string") {
5523
- if (func2(data11) < 1) {
5524
- const err15 = { instancePath: instancePath + "/folder", schemaPath: "#/properties/folder/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5534
+ let data12 = data.folder;
5535
+ if (typeof data12 === "string") {
5536
+ if (func2(data12) < 1) {
5537
+ const err16 = { instancePath: instancePath + "/folder", schemaPath: "#/properties/folder/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
5525
5538
  if (vErrors === null) {
5526
- vErrors = [err15];
5539
+ vErrors = [err16];
5527
5540
  }
5528
5541
  else {
5529
- vErrors.push(err15);
5542
+ vErrors.push(err16);
5530
5543
  }
5531
5544
  errors++;
5532
5545
  }
5533
- if (!pattern15.test(data11)) {
5534
- const err16 = { instancePath: instancePath + "/folder", schemaPath: "#/properties/folder/pattern", keyword: "pattern", params: { pattern: "^[^/]+(?:/[^/]+)*$" }, message: "must match pattern \"" + "^[^/]+(?:/[^/]+)*$" + "\"" };
5546
+ if (!pattern15.test(data12)) {
5547
+ const err17 = { instancePath: instancePath + "/folder", schemaPath: "#/properties/folder/pattern", keyword: "pattern", params: { pattern: "^[^/]+(?:/[^/]+)*$" }, message: "must match pattern \"" + "^[^/]+(?:/[^/]+)*$" + "\"" };
5535
5548
  if (vErrors === null) {
5536
- vErrors = [err16];
5549
+ vErrors = [err17];
5537
5550
  }
5538
5551
  else {
5539
- vErrors.push(err16);
5552
+ vErrors.push(err17);
5540
5553
  }
5541
5554
  errors++;
5542
5555
  }
5543
5556
  }
5544
5557
  else {
5545
- const err17 = { instancePath: instancePath + "/folder", schemaPath: "#/properties/folder/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5558
+ const err18 = { instancePath: instancePath + "/folder", schemaPath: "#/properties/folder/type", keyword: "type", params: { type: "string" }, message: "must be string" };
5546
5559
  if (vErrors === null) {
5547
- vErrors = [err17];
5560
+ vErrors = [err18];
5548
5561
  }
5549
5562
  else {
5550
- vErrors.push(err17);
5563
+ vErrors.push(err18);
5551
5564
  }
5552
5565
  errors++;
5553
5566
  }
5554
5567
  }
5555
5568
  }
5556
5569
  else {
5557
- const err18 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5570
+ const err19 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
5558
5571
  if (vErrors === null) {
5559
- vErrors = [err18];
5572
+ vErrors = [err19];
5560
5573
  }
5561
5574
  else {
5562
- vErrors.push(err18);
5575
+ vErrors.push(err19);
5563
5576
  }
5564
5577
  errors++;
5565
5578
  } validate65.errors = vErrors; return errors === 0; }