@webpieces/nx-webpieces-rules 0.4.912 → 0.4.913

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 (72) hide show
  1. package/README.md +11 -0
  2. package/executors.json +5 -0
  3. package/package.json +7 -7
  4. package/src/executors/help/executor.js +2 -0
  5. package/src/executors/help/executor.js.map +1 -1
  6. package/src/executors/visualize-runtime/executor.d.ts +3 -1
  7. package/src/executors/visualize-runtime/executor.js +9 -3
  8. package/src/executors/visualize-runtime/executor.js.map +1 -1
  9. package/src/executors/visualize-runtime-goal/executor.d.ts +27 -0
  10. package/src/executors/visualize-runtime-goal/executor.js +98 -0
  11. package/src/executors/visualize-runtime-goal/executor.js.map +1 -0
  12. package/src/executors/visualize-runtime-goal/schema.json +13 -0
  13. package/src/lib/graph-color-modes.d.ts +8 -1
  14. package/src/lib/graph-color-modes.js +11 -1
  15. package/src/lib/graph-color-modes.js.map +1 -1
  16. package/src/lib/graph-filter.client.d.ts +9 -2
  17. package/src/lib/graph-filter.client.js +15 -0
  18. package/src/lib/graph-filter.client.js.map +1 -1
  19. package/src/lib/graph-mode-state.client.d.ts +9 -2
  20. package/src/lib/graph-mode-state.client.js +17 -4
  21. package/src/lib/graph-mode-state.client.js.map +1 -1
  22. package/src/lib/graph-page-shell.js +6 -5
  23. package/src/lib/graph-page-shell.js.map +1 -1
  24. package/src/lib/graph-render-model.d.ts +41 -0
  25. package/src/lib/graph-render-model.js +45 -1
  26. package/src/lib/graph-render-model.js.map +1 -1
  27. package/src/lib/graph-visualizer.client.d.ts +7 -1
  28. package/src/lib/graph-visualizer.client.js +37 -4
  29. package/src/lib/graph-visualizer.client.js.map +1 -1
  30. package/src/lib/runtime-goal-comparison.d.ts +55 -0
  31. package/src/lib/runtime-goal-comparison.js +209 -0
  32. package/src/lib/runtime-goal-comparison.js.map +1 -0
  33. package/src/lib/runtime-goal-details.d.ts +17 -0
  34. package/src/lib/runtime-goal-details.js +118 -0
  35. package/src/lib/runtime-goal-details.js.map +1 -0
  36. package/src/lib/runtime-goal-file.d.ts +72 -0
  37. package/src/lib/runtime-goal-file.js +201 -0
  38. package/src/lib/runtime-goal-file.js.map +1 -0
  39. package/src/lib/runtime-goal-styles.d.ts +10 -0
  40. package/src/lib/runtime-goal-styles.js +25 -0
  41. package/src/lib/runtime-goal-styles.js.map +1 -0
  42. package/src/lib/runtime-goal-validator.d.ts +39 -0
  43. package/src/lib/runtime-goal-validator.js +236 -0
  44. package/src/lib/runtime-goal-validator.js.map +1 -0
  45. package/src/lib/runtime-goal-view.d.ts +22 -0
  46. package/src/lib/runtime-goal-view.js +64 -0
  47. package/src/lib/runtime-goal-view.js.map +1 -0
  48. package/src/lib/runtime-graph-diff.d.ts +107 -0
  49. package/src/lib/runtime-graph-diff.js +346 -0
  50. package/src/lib/runtime-graph-diff.js.map +1 -0
  51. package/src/lib/runtime-html-page.d.ts +2 -0
  52. package/src/lib/runtime-html-page.js +28 -3
  53. package/src/lib/runtime-html-page.js.map +1 -1
  54. package/src/lib/runtime-layout.d.ts +2 -0
  55. package/src/lib/runtime-layout.js +4 -0
  56. package/src/lib/runtime-layout.js.map +1 -1
  57. package/src/lib/runtime-union-graph.d.ts +20 -0
  58. package/src/lib/runtime-union-graph.js +94 -0
  59. package/src/lib/runtime-union-graph.js.map +1 -0
  60. package/src/lib/runtime-visualizer.client.js +7 -3
  61. package/src/lib/runtime-visualizer.client.js.map +1 -1
  62. package/src/lib/runtime-visualizer.d.ts +8 -3
  63. package/src/lib/runtime-visualizer.js +18 -10
  64. package/src/lib/runtime-visualizer.js.map +1 -1
  65. package/src/lib/runtime-viz-options.d.ts +28 -1
  66. package/src/lib/runtime-viz-options.js +36 -2
  67. package/src/lib/runtime-viz-options.js.map +1 -1
  68. package/src/plugin.js +2 -2
  69. package/src/plugin.js.map +1 -1
  70. package/src/runtime-targets.d.ts +6 -0
  71. package/src/runtime-targets.js +17 -0
  72. package/src/runtime-targets.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"graph-render-model.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/graph-render-model.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,2DAA2E;AAE3E;;;;;;;;;GASG;AACH,MAAa,UAAU;IAEC;IACA;IACA;IACA;IACA;IACA;IANpB,YACoB,EAAU,EACV,GAAW,EACX,KAA0B,EAC1B,IAAqB,EACrB,QAAkB,EAClB,YAAsB,EAAE;QALxB,OAAE,GAAF,EAAE,CAAQ;QACV,QAAG,GAAH,GAAG,CAAQ;QACX,UAAK,GAAL,KAAK,CAAqB;QAC1B,SAAI,GAAJ,IAAI,CAAiB;QACrB,aAAQ,GAAR,QAAQ,CAAU;QAClB,cAAS,GAAT,SAAS,CAAe;IACzC,CAAC;CACP;AATD,gCASC;AAED,gGAAgG;AAChG,MAAa,QAAQ;IAEG;IACA;IACA;IAHpB,YACoB,KAAa,EACb,IAAY,EACZ,UAAoB;QAFpB,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAU;IACrC,CAAC;CACP;AAND,4BAMC;AAED,MAAa,UAAU;IAEC;IACA;IACA;IACA;IAMA;IAVpB,YACoB,IAAY,EACZ,EAAU,EACV,GAAW,EACX,EAAU;IAC1B;;;;OAIG;IACa,aAA4B,IAAI;QAThC,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QACV,QAAG,GAAH,GAAG,CAAQ;QACX,OAAE,GAAF,EAAE,CAAQ;QAMV,eAAU,GAAV,UAAU,CAAsB;IACjD,CAAC;CACP;AAbD,gCAaC;AAED,mEAAmE;AACnE,MAAa,gBAAgB;IACzB,MAAM,GAA+B,cAAc,CAAC;IAC3C,KAAK,GAAiB,EAAE,CAAC;IACzB,KAAK,GAAiB,EAAE,CAAC;IAClC,KAAK,GAAgB,EAAE,CAAC;IACxB,OAAO,GAAG,EAAE,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Facts, NodeModeDots } from './graph-color-modes';\n\n/**\n * Renderer-owned records, captured while emitting DOT, never recovered by parsing labels.\n *\n * `dot` is the statement `fullDot` carries. `modes` carries per-mode statements in both viewers; `tags` carries declared service/project\n * metadata. Runtime auxiliary entities leave tags null so facets count services and retain context\n * separately.\n *\n * `products` is set on BOTH graphs (#1179): the products a box belongs to, which each page's product\n * filter matches on. Empty for a box in no product.\n */\nexport class RenderNode {\n constructor(\n public readonly id: string,\n public readonly dot: string,\n public readonly modes: NodeModeDots | null,\n public readonly tags: NodeTags | null,\n public readonly products: string[],\n public readonly queueKeys: string[] = [],\n ) {}\n}\n\n/** What the architecture page's Filter matches a box on: its level, role and framework tags. */\nexport class NodeTags {\n constructor(\n public readonly level: number,\n public readonly role: string,\n public readonly frameworks: string[],\n ) {}\n}\n\nexport class RenderEdge {\n constructor(\n public readonly from: string,\n public readonly to: string,\n public readonly dot: string,\n public readonly id: string,\n /**\n * The statement the architecture page's Product color mode draws instead of `dot` (#1204): a\n * dependency crossing into another product, dashed in that product's color. Null for every\n * other edge, which draws `dot` in every mode.\n */\n public readonly productDot: string | null = null,\n ) {}\n}\n\n/** The immutable drawable snapshot carried by a generated page. */\nexport class GraphRenderModel {\n viewer: 'architecture' | 'runtime' = 'architecture';\n readonly nodes: RenderNode[] = [];\n readonly edges: RenderEdge[] = [];\n bands: LevelBand[] = [];\n fullDot = '';\n header = '';\n footer = '';\n /** The colors and roles in use, so the page's legend lists exactly those (architecture graph). */\n legend = new LegendFacts();\n\n node(id: string, dot: string, products: string[] = [], queueKeys: string[] = []): string {\n this.nodes.push(new RenderNode(id, dot, null, null, products, queueKeys));\n return dot;\n }\n\n /**\n * Every product a declared box (a queue, a cron trigger, an external system) inherits from the\n * services its edges touch (#1179): it belongs to whichever product's services it is attached to.\n * Called by the runtime graph once every edge is emitted; RenderNode is immutable, so a node gains\n * its products by being replaced.\n */\n attachProducts(isService: (id: string) => boolean): void {\n const byId = new Map<string, RenderNode>();\n for (const node of this.nodes) byId.set(node.id, node);\n for (let index = 0; index < this.nodes.length; index++) {\n const node = this.nodes[index];\n if (isService(node.id)) continue;\n const inherited = new Set<string>();\n for (const edge of this.edges) {\n const other =\n edge.from === node.id ? edge.to : edge.to === node.id ? edge.from : null;\n if (other === null || !isService(other)) continue;\n for (const product of byId.get(other)?.products ?? []) inherited.add(product);\n }\n if (inherited.size === 0) continue;\n this.nodes[index] = new RenderNode(\n node.id,\n node.dot,\n node.modes,\n node.tags,\n [...inherited].sort(),\n node.queueKeys,\n );\n }\n }\n\n /** A box drawn differently per color mode; `fullDot` carries its RUNTIME statement. */\n styledNode(facts: NodeFacts, modes: NodeModeDots): string {\n this.nodes.push(\n new RenderNode(\n facts.nodeId,\n modes.runtime,\n modes,\n new NodeTags(facts.level, facts.role, facts.frameworks),\n facts.products,\n ),\n );\n return modes.runtime;\n }\n\n completeEndpoints(): void {\n const ids = new Set(this.nodes.map((node) => node.id));\n for (const edge of this.edges) {\n for (const id of [edge.from, edge.to]) {\n if (ids.has(id)) continue;\n ids.add(id);\n this.node(id, ` \"${dotValue(id)}\";\\n`);\n }\n }\n }\n\n /**\n * One edge. `productAttrs`, when not empty, is the attribute list the Product color mode adds to\n * the statement (a later list overrides an earlier one in DOT), e.g. a cross-product dependency's\n * dash and color; `fullDot` always carries the plain statement.\n */\n edge(from: string, to: string, dot: string, productAttrs: string = ''): string {\n const id = `wp-real-edge-${this.edges.length}`;\n const base = `${dot.slice(0, -2)} [id=\"${id}\"]`;\n const statement = `${base};\\n`;\n const productDot = productAttrs === '' ? null : `${base} [${productAttrs}];\\n`;\n this.edges.push(new RenderEdge(from, to, statement, id, productDot));\n return statement;\n }\n}\n\n/** Shared filter chrome and script-safe JSON for pages opened directly from disk. */\nexport class GraphFilterAssets {\n json<T>(value: T): string {\n return JSON.stringify(value).replace(/</g, '\\\\u003c');\n }\n\n html(): string {\n return (\n '<p id=\"wp-filter-status\" hidden>Filtering: <strong id=\"wp-filter-anchor\"></strong> ' +\n '<button id=\"wp-filter-off\" type=\"button\">Turn off Filter</button></p>' +\n '<p id=\"wp-graph-error\" role=\"alert\" hidden></p>'\n );\n }\n\n styles(): string {\n return (\n '#wp-filter-status { text-align:center; } #wp-graph-error { color:#b71c1c; } ' +\n '#graph .wp-filter-anchor polygon, #graph .wp-filter-anchor path, ' +\n '#graph .wp-filter-anchor ellipse { stroke:#8b3cf0; stroke-width:3; }'\n );\n }\n}\n"]}
1
+ {"version":3,"file":"graph-render-model.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/graph-render-model.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,2DAA2E;AAE3E;;;;;;;;;GASG;AACH,MAAa,UAAU;IAEC;IACA;IACA;IACA;IACA;IACA;IANpB,YACoB,EAAU,EACV,GAAW,EACX,KAA0B,EAC1B,IAAqB,EACrB,QAAkB,EAClB,YAAsB,EAAE;QALxB,OAAE,GAAF,EAAE,CAAQ;QACV,QAAG,GAAH,GAAG,CAAQ;QACX,UAAK,GAAL,KAAK,CAAqB;QAC1B,SAAI,GAAJ,IAAI,CAAiB;QACrB,aAAQ,GAAR,QAAQ,CAAU;QAClB,cAAS,GAAT,SAAS,CAAe;IACzC,CAAC;CACP;AATD,gCASC;AAED,gGAAgG;AAChG,MAAa,QAAQ;IAEG;IACA;IACA;IAHpB,YACoB,KAAa,EACb,IAAY,EACZ,UAAoB;QAFpB,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAU;IACrC,CAAC;CACP;AAND,4BAMC;AAED,MAAa,UAAU;IAEC;IACA;IACA;IACA;IAMA;IAVpB,YACoB,IAAY,EACZ,EAAU,EACV,GAAW,EACX,EAAU;IAC1B;;;;OAIG;IACa,aAA4B,IAAI;QAThC,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QACV,QAAG,GAAH,GAAG,CAAQ;QACX,OAAE,GAAF,E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IAC9B,kFAAkF;IAClE,SAAiB;IACjC,0EAA0E;IAC1D,OAAe;IAC/B,6DAA6D;IAC7C,KAA8B;IAC9C,2DAA2D;IAC3C,WAAqC;IACrD,8EAA8E;IAC9D,WAAqC;IACrD,4EAA4E;IAC5D,WAAqB;QAdrB,cAAS,GAAT,SAAS,CAAS;QAElB,WAAM,GAAN,MAAM,CAAQ;QAEd,cAAS,GAAT,SAAS,CAAQ;QAEjB,YAAO,GAAP,OAAO,CAAQ;QAEf,UAAK,GAAL,KAAK,CAAyB;QAE9B,gBAAW,GAAX,WAAW,CAA0B;QAErC,gBAAW,GAAX,WAAW,CAA0B;QAErC,gBAAW,GAAX,WAAW,CAAU;IACtC,CAAC;CACP;AAlBD,sDAkBC;AAED,qFAAqF;AACrF,MAAa,iBAAiB;IAC1B,IAAI,CAAI,KAAQ;QACZ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI;QACA,OAAO,CACH,qFAAqF;YACrF,uEAAuE;YACvE,iDAAiD,CACpD,CAAC;IACN,CAAC;IAED,MAAM;QACF,OAAO,CACH,8EAA8E;YAC9E,mEAAmE;YACnE,sEAAsE,CACzE,CAAC;IACN,CAAC;CACJ;AApBD,8CAoBC","sourcesContent":["import { dotValue } from './dot-syntax';\nimport { LevelBand } from './graph-level-bands';\nimport { LegendFacts, NodeFacts, NodeModeDots } from './graph-color-modes';\n\n/**\n * Renderer-owned records, captured while emitting DOT, never recovered by parsing labels.\n *\n * `dot` is the statement `fullDot` carries. `modes` carries per-mode statements in both viewers; `tags` carries declared service/project\n * metadata. Runtime auxiliary entities leave tags null so facets count services and retain context\n * separately.\n *\n * `products` is set on BOTH graphs (#1179): the products a box belongs to, which each page's product\n * filter matches on. Empty for a box in no product.\n */\nexport class RenderNode {\n constructor(\n public readonly id: string,\n public readonly dot: string,\n public readonly modes: NodeModeDots | null,\n public readonly tags: NodeTags | null,\n public readonly products: string[],\n public readonly queueKeys: string[] = [],\n ) {}\n}\n\n/** What the architecture page's Filter matches a box on: its level, role and framework tags. */\nexport class NodeTags {\n constructor(\n public readonly level: number,\n public readonly role: string,\n public readonly frameworks: string[],\n ) {}\n}\n\nexport class RenderEdge {\n constructor(\n public readonly from: string,\n public readonly to: string,\n public readonly dot: string,\n public readonly id: string,\n /**\n * The statement the architecture page's Product color mode draws instead of `dot` (#1204): a\n * dependency crossing into another product, dashed in that product's color. Null for every\n * other edge, which draws `dot` in every mode.\n */\n public readonly productDot: string | null = null,\n ) {}\n}\n\n/** The immutable drawable snapshot carried by a generated page. */\nexport class GraphRenderModel {\n viewer: 'architecture' | 'runtime' = 'architecture';\n readonly nodes: RenderNode[] = [];\n readonly edges: RenderEdge[] = [];\n bands: LevelBand[] = [];\n fullDot = '';\n header = '';\n footer = '';\n /** The colors and roles in use, so the page's legend lists exactly those (architecture graph). */\n legend = new LegendFacts();\n /** Runtime pages only (#1239): the Goal vs Current overlay, or why it is unavailable. */\n comparison: RuntimeComparisonView | null = null;\n\n node(id: string, dot: string, products: string[] = [], queueKeys: string[] = []): string {\n this.nodes.push(new RenderNode(id, dot, null, null, products, queueKeys));\n return dot;\n }\n\n /**\n * Every product a declared box (a queue, a cron trigger, an external system) inherits from the\n * services its edges touch (#1179): it belongs to whichever product's services it is attached to.\n * Called by the runtime graph once every edge is emitted; RenderNode is immutable, so a node gains\n * its products by being replaced.\n */\n attachProducts(isService: (id: string) => boolean): void {\n const byId = new Map<string, RenderNode>();\n for (const node of this.nodes) byId.set(node.id, node);\n for (let index = 0; index < this.nodes.length; index++) {\n const node = this.nodes[index];\n if (isService(node.id)) continue;\n const inherited = new Set<string>();\n for (const edge of this.edges) {\n const other =\n edge.from === node.id ? edge.to : edge.to === node.id ? edge.from : null;\n if (other === null || !isService(other)) continue;\n for (const product of byId.get(other)?.products ?? []) inherited.add(product);\n }\n if (inherited.size === 0) continue;\n this.nodes[index] = new RenderNode(\n node.id,\n node.dot,\n node.modes,\n node.tags,\n [...inherited].sort(),\n node.queueKeys,\n );\n }\n }\n\n /** A box drawn differently per color mode; `fullDot` carries its RUNTIME statement. */\n styledNode(facts: NodeFacts, modes: NodeModeDots): string {\n this.nodes.push(\n new RenderNode(\n facts.nodeId,\n modes.runtime,\n modes,\n new NodeTags(facts.level, facts.role, facts.frameworks),\n facts.products,\n ),\n );\n return modes.runtime;\n }\n\n completeEndpoints(): void {\n const ids = new Set(this.nodes.map((node) => node.id));\n for (const edge of this.edges) {\n for (const id of [edge.from, edge.to]) {\n if (ids.has(id)) continue;\n ids.add(id);\n this.node(id, ` \"${dotValue(id)}\";\\n`);\n }\n }\n }\n\n /**\n * One edge. `productAttrs`, when not empty, is the attribute list the Product color mode adds to\n * the statement (a later list overrides an earlier one in DOT), e.g. a cross-product dependency's\n * dash and color; `fullDot` always carries the plain statement.\n */\n edge(from: string, to: string, dot: string, productAttrs: string = ''): string {\n const id = `wp-real-edge-${this.edges.length}`;\n const base = `${dot.slice(0, -2)} [id=\"${id}\"]`;\n const statement = `${base};\\n`;\n const productDot = productAttrs === '' ? null : `${base} [${productAttrs}];\\n`;\n this.edges.push(new RenderEdge(from, to, statement, id, productDot));\n return statement;\n }\n}\n\n/**\n * What a runtime page carries for its Goal vs Current color mode (#1239), serialized into the page\n * with the render model so it works opened straight from disk (`file://`, no fetch).\n *\n * Never a silent \"no differences\": an unavailable comparison says why (a missing or unusable input,\n * naming its path and repair), and identical inputs say so explicitly with the normal graph context.\n */\nexport class RuntimeComparisonView {\n constructor(\n public readonly available: boolean,\n /** Why the mode is unavailable; '' when available. */\n public readonly reason: string,\n /** Always \"Current → Goal\": the direction every added/removed word is read in. */\n public readonly direction: string,\n /** One line: counts per status, or the explicit no-differences result. */\n public readonly summary: string,\n /** The overlay drawn in this mode; null when unavailable. */\n public readonly model: GraphRenderModel | null,\n /** Overlay render-node id -> before/after detail lines. */\n public readonly nodeDetails: Record<string, string[]>,\n /** Overlay render-edge id (`wp-real-edge-N`) -> before/after detail lines. */\n public readonly edgeDetails: Record<string, string[]>,\n /** Every added, removed and changed fact, one line each, for the legend. */\n public readonly differences: string[],\n ) {}\n}\n\n/** Shared filter chrome and script-safe JSON for pages opened directly from disk. */\nexport class GraphFilterAssets {\n json<T>(value: T): string {\n return JSON.stringify(value).replace(/</g, '\\\\u003c');\n }\n\n html(): string {\n return (\n '<p id=\"wp-filter-status\" hidden>Filtering: <strong id=\"wp-filter-anchor\"></strong> ' +\n '<button id=\"wp-filter-off\" type=\"button\">Turn off Filter</button></p>' +\n '<p id=\"wp-graph-error\" role=\"alert\" hidden></p>'\n );\n }\n\n styles(): string {\n return (\n '#wp-filter-status { text-align:center; } #wp-graph-error { color:#b71c1c; } ' +\n '#graph .wp-filter-anchor polygon, #graph .wp-filter-anchor path, ' +\n '#graph .wp-filter-anchor ellipse { stroke:#8b3cf0; stroke-width:3; }'\n );\n }\n}\n"]}
@@ -119,12 +119,18 @@ declare class GraphDrawer {
119
119
  declare class GraphPage extends WpFilterPage {
120
120
  private highlighter;
121
121
  private selected;
122
+ /** The page's own graph; Goal vs Current swaps in its overlay and back (#1239). */
123
+ private readonly base;
122
124
  private readonly modes;
123
- private readonly projects;
125
+ private projects;
124
126
  private applied;
125
127
  private readonly drawer;
126
128
  protected captureBinding(_svg: SVGSVGElement | null): () => void;
127
129
  protected wireControls(): void;
130
+ /** '' when this page can show Goal vs Current, else why not. */
131
+ private goalUnavailable;
132
+ /** Goal vs Current draws its overlay topology; every other mode draws the page's own graph. */
133
+ private syncModel;
128
134
  protected nodeDot(node: RenderNodeJson): string;
129
135
  /** Product mode dashes a dependency that crosses into another product (#1204); every other mode draws it plain. */
130
136
  protected edgeDot(edge: RenderEdgeJson): string;
@@ -181,6 +181,9 @@ class GraphHighlighter {
181
181
  const implemented = window.__WP_RUNTIME__?.implementsItem(name, node);
182
182
  if (implemented)
183
183
  items.push(implemented);
184
+ const goal = window.__WP_GOAL__?.item(name, node);
185
+ if (goal)
186
+ items.push(goal);
184
187
  return items;
185
188
  });
186
189
  }
@@ -433,7 +436,7 @@ class GraphDrawer {
433
436
  const target = ev.target;
434
437
  if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement)
435
438
  return;
436
- const menuOpen = document.getElementById('wp-node-menu') !== null || document.querySelector('.wp-graph-details:not([hidden])') !== null;
439
+ const menuOpen = document.getElementById('wp-node-menu') !== null || document.querySelector('.wp-graph-details:not([hidden]), .wp-goal-details:not([hidden])') !== null;
437
440
  if (ev.key === '/') {
438
441
  this.byId('wp-shell')?.classList.remove('wp-collapsed');
439
442
  this.byId('wp-collapse')?.setAttribute('aria-expanded', 'true');
@@ -441,7 +444,7 @@ class GraphDrawer {
441
444
  this.lockInput()?.focus();
442
445
  return;
443
446
  }
444
- const index = ['1', '2', '3', '4'].indexOf(ev.key);
447
+ const index = ['1', '2', '3', '4', '5'].indexOf(ev.key);
445
448
  if (index >= 0 && !menuOpen) {
446
449
  this.page.setMode(WpModeState.MODES[index]);
447
450
  return;
@@ -511,6 +514,13 @@ class GraphDrawer {
511
514
  button.title = reason === '' ? 'Key 3' : reason;
512
515
  if (mode === 'product')
513
516
  button.title = modes.productReason() === '' ? 'Key 4' : modes.productReason();
517
+ if (mode === 'goal') {
518
+ // Unavailable is said in the menu itself, never shown as "no differences" (#1239).
519
+ button.title = modes.goalReason() === '' ? 'Key 5' : modes.goalReason();
520
+ const sub = button.querySelector('.wp-mode-sub');
521
+ if (sub !== null)
522
+ sub.textContent = modes.goalReason() === '' ? modes.subtitle(mode) : `Unavailable: ${modes.goalReason()}`;
523
+ }
514
524
  });
515
525
  this.text('wp-mode-current', modes.name(modes.mode));
516
526
  this.text('wp-mode-current-sub', modes.subtitle(modes.mode));
@@ -650,7 +660,9 @@ class GraphDrawer {
650
660
  class GraphPage extends WpFilterPage {
651
661
  highlighter = null;
652
662
  selected = null;
653
- modes = new WpModeState(this.model.nodes.some((node) => node.products.length > 0), this.model.viewer ?? 'architecture');
663
+ /** The page's own graph; Goal vs Current swaps in its overlay and back (#1239). */
664
+ base = this.model;
665
+ modes = new WpModeState(this.model.nodes.some((node) => node.products.length > 0), this.model.viewer ?? 'architecture', this.goalUnavailable());
654
666
  projects = new WpProjectFilter(this.model, this.modes);
655
667
  applied = new WpFilterChoice();
656
668
  drawer = new GraphDrawer(this);
@@ -663,9 +675,28 @@ class GraphPage extends WpFilterPage {
663
675
  };
664
676
  }
665
677
  wireControls() {
678
+ this.syncModel();
666
679
  this.drawer.wire();
667
680
  this.syncControls();
668
681
  }
682
+ /** '' when this page can show Goal vs Current, else why not. */
683
+ goalUnavailable() {
684
+ if (this.model.viewer !== 'runtime')
685
+ return 'Goal vs Current compares runtime architecture only.';
686
+ const comparison = this.model.comparison;
687
+ if (comparison === undefined || comparison === null)
688
+ return 'This page carries no Goal vs Current data. Re-open it with pnpm nx run architecture:visualize-runtime.';
689
+ return comparison.available ? '' : comparison.reason;
690
+ }
691
+ /** Goal vs Current draws its overlay topology; every other mode draws the page's own graph. */
692
+ syncModel() {
693
+ const overlay = this.base.comparison?.model ?? null;
694
+ const next = this.modes.mode === 'goal' && overlay !== null ? overlay : this.base;
695
+ if (next === this.model)
696
+ return;
697
+ this.useModel(next);
698
+ this.projects = new WpProjectFilter(next, this.modes);
699
+ }
669
700
  nodeDot(node) {
670
701
  const modes = node.modes;
671
702
  if (modes === null)
@@ -685,7 +716,7 @@ class GraphPage extends WpFilterPage {
685
716
  return edge.dot;
686
717
  }
687
718
  usesFullDot() {
688
- return this.modes.mode === 'runtime' && this.applied.count() === 0;
719
+ return (this.modes.mode === 'runtime' || this.modes.mode === 'goal') && this.applied.count() === 0;
689
720
  }
690
721
  narrow(retained) {
691
722
  return this.projects.apply(retained, this.applied);
@@ -741,6 +772,7 @@ class GraphPage extends WpFilterPage {
741
772
  setMode(mode) {
742
773
  if (mode === this.modes.mode || !this.modes.set(mode))
743
774
  return;
775
+ this.syncModel();
744
776
  this.syncControls();
745
777
  this.redraw();
746
778
  }
@@ -797,6 +829,7 @@ class GraphPage extends WpFilterPage {
797
829
  this.applyFilter(next);
798
830
  }
799
831
  syncControls() {
832
+ document.body.dataset['wpMode'] = this.modes.mode;
800
833
  this.drawer.sync(this.modes, this.locked, this.anchor !== null, this.applied);
801
834
  const count = this.model.nodes.filter(node => this.retained.has(node.id) && this.projects.isService(node)).length;
802
835
  const empty = document.getElementById('wp-empty');
@@ -1 +1 @@
1
- {"version":3,"file":"graph-visualizer.client.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/graph-visualizer.client.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,MAAM,cAAc;IAChB,KAAK,GAAG,YAAY,CAAC;IACZ,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAC7B,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAC1B,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEtC,IAAI;QACA,MAAM,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAChE,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,8DAA8D;IAC9D,KAAK;QACD,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,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CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxO,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,WAAW;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjF,QAAQ,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,IAAa,EAAE,EAAE;YACjE,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,CAAC,MAAM,CACjB,WAAW,EACX,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAC9D,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["/**\n * One state of the Filter popover: a change scope plus the selected Runtime, Role and Product chips.\n * The page holds the APPLIED one; the popover edits a copy until \"Show N projects\".\n */\nclass WpFilterChoice {\n scope = 'everything';\n readonly runtimes = new Set<string>();\n readonly roles = new Set<string>();\n readonly products = new Set<string>();\n\n copy(): WpFilterChoice {\n const copy = new WpFilterChoice();\n copy.scope = this.scope;\n for (const runtime of this.runtimes) copy.runtimes.add(runtime);\n for (const role of this.roles) copy.roles.add(role);\n for (const product of this.products) copy.products.add(product);\n return copy;\n }\n\n /** How many filters are active: the drawer button's badge. */\n count(): number {\n return (this.scope === 'everything' ? 0 : 1) + this.runtimes.size + this.roles.size + this.products.size;\n }\n\n /** The chip set a `data-wp-chip-group` (or a pill's group) names. */\n group(name: string): Set<string> {\n if (name === 'role') return this.roles;\n if (name === 'product') return this.products;\n return this.runtimes;\n }\n}\n\n/**\n * The Filter popover's four groups, INTERSECTED: a box stays when it is in the change scope, AND has\n * any selected runtime chip (when one is selected), AND has any selected role chip (likewise), AND\n * belongs to any selected product (likewise — several products are the UNION of their closures).\n */\nclass WpProjectFilter {\n constructor(\n private readonly model: RenderModelJson,\n private readonly modes: WpModeState,\n ) {}\n\n /** The node ids a change scope keeps; null for \"everything\" (and whenever Impact is unavailable). */\n scopeSet(scope: string): Set<string> | null {\n const impact = this.modes.impact;\n if (scope === 'everything' || impact === null || this.modes.impactReason() !== '') return null;\n const ids: string[] = [...impact.touched];\n if (scope === 'dependents' || scope === 'build') ids.push(...impact.affected);\n if (scope === 'dependencies') ids.push(...impact.dependencies);\n if (scope === 'build') ids.push(...impact.buildInputs);\n return new Set(ids);\n }\n\n /** How many drawn projects a scope keeps on its own: the count beside each option. */\n scopeCount(scope: string): number {\n const set = this.scopeSet(scope);\n return this.model.nodes.filter((node: RenderNodeJson): boolean => this.isService(node) && (set === null || set.has(node.id))).length;\n }\n\n /** `base` (everything, or the Hide-unconnected chain) narrowed by `choice`. */\n apply(base: Set<string>, choice: WpFilterChoice): Set<string> {\n const scope = this.scopeSet(choice.scope);\n const kept = new Set<string>();\n for (const node of this.model.nodes) {\n if (!base.has(node.id) || !this.isService(node)) continue;\n if (scope !== null && !scope.has(node.id)) continue;\n if (!this.anyOf(choice.runtimes, node.tags?.frameworks ?? [])) continue;\n if (!this.anyOf(choice.roles, node.tags === null ? [] : [node.tags.role])) continue;\n if (!this.anyOf(choice.products, node.products)) continue;\n kept.add(node.id);\n }\n if (this.model.viewer === 'runtime') {\n for (const node of this.model.nodes) {\n if (node.tags !== null || !base.has(node.id)) continue;\n if (this.model.edges.some(edge => (edge.from === node.id && kept.has(edge.to)) || (edge.to === node.id && kept.has(edge.from)))) kept.add(node.id);\n }\n }\n return kept;\n }\n\n isService(node: RenderNodeJson): boolean { return this.model.viewer !== 'runtime' || node.tags !== null; }\n\n /** An empty chip group matches every box; otherwise the box must carry one of the chips. */\n private anyOf(selected: Set<string>, carried: string[]): boolean {\n return selected.size === 0 || carried.some((value: string): boolean => selected.has(value));\n }\n}\n\n/** Architecture interactions bind to each new SVG; logical Lock/Filter state belongs to the page. */\nclass GraphHighlighter {\n private readonly nodeByName = new Map<string, SVGGElement>();\n private hovered: string | null = null;\n\n constructor(\n private readonly svg: SVGSVGElement,\n private readonly chain: WpGraphChain,\n private readonly model: RenderModelJson,\n private readonly page: GraphPage,\n ) {}\n\n wire(): void {\n this.svg.querySelectorAll<SVGGElement>('g.node').forEach((g: SVGGElement) => {\n if (g.classList.contains('wp-layout')) return;\n const name = g.querySelector('title')?.textContent;\n if (name !== null && name !== undefined) this.nodeByName.set(name, g);\n });\n this.wireHover();\n this.wireMenu();\n this.relight();\n }\n\n private clear(): void {\n this.svg.classList.remove('wp-dim');\n this.svg.querySelectorAll('.wp-focus, .wp-neighbor, .wp-hl, .wp-locked').forEach((el: Element) => {\n el.classList.remove('wp-focus', 'wp-neighbor', 'wp-hl', 'wp-locked');\n });\n }\n\n relight(): void {\n this.clear();\n const locked = this.page.lockSelection();\n if (locked !== null) this.nodeByName.get(locked)?.classList.add('wp-locked');\n // A filtered-out Lock is suspended, including its otherwise visible relatives.\n const anchors = [locked, this.hovered].filter(\n (name: string | null): name is string => name !== null && this.nodeByName.has(name),\n );\n if (anchors.length === 0) return;\n const lit = new Set<string>();\n for (const name of anchors) {\n this.nodeByName.get(name)?.classList.add('wp-focus');\n for (const id of this.chain.nodes(name)) {\n if (this.nodeByName.has(id)) lit.add(id);\n }\n }\n this.svg.classList.add('wp-dim');\n for (const id of lit) this.nodeByName.get(id)?.classList.add('wp-neighbor');\n for (const edge of this.model.edges) {\n if (lit.has(edge.from) && lit.has(edge.to)) {\n this.svg.querySelector(`[id=\"${edge.id}\"]`)?.classList.add('wp-hl');\n }\n }\n }\n\n private wireHover(): void {\n this.nodeByName.forEach((g: SVGGElement, name: string) => {\n g.addEventListener('mouseenter', () => {\n this.hovered = name;\n this.relight();\n });\n g.addEventListener('mouseleave', () => {\n this.hovered = null;\n this.relight();\n });\n });\n }\n\n private wireMenu(): void {\n const designs = new Map<string, string>();\n for (const link of __DESIGN_LINKS__) designs.set(link.nodeId, link.href);\n WpNodeMenu.wire(this.svg, (name: string, node: SVGGElement): WpNodeMenuItem[] => {\n const items: WpNodeMenuItem[] = [];\n const href = designs.get(name);\n if (href !== undefined)\n items.push(new WpNodeMenuItem('View Design', () => window.open(href, '_blank')));\n const locked = this.page.lockSelection() === name;\n items.push(\n new WpNodeMenuItem(locked ? 'Unlock' : 'Lock', () =>\n locked ? this.page.clearSelection() : this.page.setLock(name),\n ),\n );\n items.push(this.page.filterItem(name));\n const implemented = window.__WP_RUNTIME__?.implementsItem(name, node);\n if (implemented) items.push(implemented);\n return items;\n });\n }\n}\n\n/**\n * The Filter popover: edits a COPY of the page's applied filter, shows what each choice would keep,\n * and hands the copy to the page on \"Show N projects\". Closing it any other way discards the edit.\n */\nclass GraphFilterPopover {\n private draft = new WpFilterChoice();\n\n constructor(private readonly page: GraphPage) {}\n\n wire(): void {\n this.byId('wp-filter-open')?.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n if (this.isOpen()) this.close();\n else this.open();\n });\n this.byId('wp-filter-close')?.addEventListener('click', () => this.close());\n this.byId('wp-filter-clear')?.addEventListener('click', () => {\n this.draft = new WpFilterChoice();\n this.paint();\n });\n this.byId('wp-filter-apply')?.addEventListener('click', () => {\n this.page.applyFilter(this.draft.copy());\n this.close();\n });\n document.querySelectorAll<HTMLInputElement>('input[name=\"wp-scope\"]').forEach((radio: HTMLInputElement) => {\n radio.addEventListener('change', () => {\n if (!radio.checked) return;\n this.draft.scope = radio.value;\n this.paint();\n });\n });\n document.querySelectorAll<HTMLButtonElement>('.wp-chip[data-wp-chip]').forEach((chip: HTMLButtonElement) => {\n chip.addEventListener('click', () => {\n const set = this.draft.group(chip.dataset['wpChipGroup'] ?? '');\n const value = chip.dataset['wpChip'] ?? '';\n if (set.has(value)) set.delete(value);\n else set.add(value);\n this.paint();\n });\n });\n }\n\n isOpen(): boolean {\n return this.byId('wp-filter-pop')?.hidden === false;\n }\n\n /** The active Impact scan changed: an open popover's counts and labels follow it. */\n refresh(): void {\n if (this.isOpen()) this.paint();\n }\n\n open(): void {\n const pop = this.byId('wp-filter-pop');\n if (pop === null) return;\n this.draft = this.page.appliedFilter().copy();\n this.paint();\n pop.hidden = false;\n this.byId('wp-filter-open')?.setAttribute('aria-expanded', 'true');\n }\n\n close(): void {\n const pop = this.byId('wp-filter-pop');\n if (pop === null || pop.hidden) return;\n pop.hidden = true;\n this.byId('wp-filter-open')?.setAttribute('aria-expanded', 'false');\n }\n\n /** Repaint the controls from the draft: checked scope, pressed chips, counts and the footer. */\n private paint(): void {\n const reason = this.page.scopeReason();\n const group = this.byId('wp-scope-group') as HTMLFieldSetElement | null;\n if (group !== null) group.disabled = reason !== '';\n const reasonEl = this.byId('wp-scope-reason');\n if (reasonEl !== null) {\n reasonEl.textContent = reason;\n reasonEl.hidden = reason === '';\n }\n document.querySelectorAll<HTMLInputElement>('input[name=\"wp-scope\"]').forEach((radio: HTMLInputElement) => {\n radio.checked = radio.value === this.draft.scope;\n });\n document.querySelectorAll<HTMLElement>('[data-wp-scope-count]').forEach((count: HTMLElement) => {\n count.textContent = reason === '' ? String(this.page.scopeCount(count.dataset['wpScopeCount'] ?? '')) : '';\n });\n document.querySelectorAll<HTMLButtonElement>('.wp-chip[data-wp-chip]').forEach((chip: HTMLButtonElement) => {\n const set = this.draft.group(chip.dataset['wpChipGroup'] ?? '');\n chip.setAttribute('aria-pressed', String(set.has(chip.dataset['wpChip'] ?? '')));\n });\n const apply = this.byId('wp-filter-apply');\n if (apply !== null) {\n const shown = this.page.preview(this.draft);\n apply.textContent = `Show ${shown} ${this.page.noun()}${shown === 1 ? '' : 's'}`;\n }\n }\n\n private byId(id: string): HTMLElement | null {\n return document.getElementById(id);\n }\n}\n\n/**\n * The drawer and its floating panels: every control outside the graph itself. Holds no graph state —\n * each control calls back into the page, and `sync()` repaints the controls from the page's state.\n */\nclass GraphDrawer {\n readonly popover: GraphFilterPopover;\n private readonly openers = new Map<string, HTMLElement>();\n\n constructor(private readonly page: GraphPage) {\n this.popover = new GraphFilterPopover(page);\n }\n\n wire(): void {\n this.wireModeMenu();\n this.popover.wire();\n this.wireImpactKinds();\n this.wireLock();\n this.byId('wp-lock-toggle')?.addEventListener('click', () => this.page.toggleLock());\n this.byId('wp-filter-toggle')?.addEventListener('click', () => this.page.toggleFilter());\n this.toggles('wp-collapse', 'wp-shell', true);\n this.toggles('wp-help-btn', 'wp-help', false);\n this.toggles('wp-help-close', 'wp-help', false);\n this.toggles('wp-legend-pop', 'wp-legend-popout', false);\n this.toggles('wp-legend-close', 'wp-legend-popout', false);\n this.toggles('wp-resp-open', 'wp-resp-panel', false);\n this.toggles('wp-resp-close', 'wp-resp-panel', false);\n this.toggles('wp-snapshot-open', 'wp-snapshot', false);\n window.addEventListener('keydown', (ev: KeyboardEvent) => this.onKey(ev), true);\n window.addEventListener('hashchange', () => this.page.setMode(location.hash.slice(1)));\n document.addEventListener('click', (ev: MouseEvent) => {\n const target = ev.target;\n if (target instanceof Node && this.byId('wp-mode-menu')?.parentElement?.contains(target)) return;\n this.closeModeMenu(false);\n this.dismissOutside(target);\n });\n }\n\n /** \"Color by\": the pill trigger opens the menu of four; picking one switches and closes it. */\n private wireModeMenu(): void {\n this.byId('wp-mode-trigger')?.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n const menu = this.byId('wp-mode-menu');\n if (menu === null) return;\n if (!menu.hidden) {\n this.closeModeMenu(false);\n return;\n }\n menu.hidden = false;\n this.byId('wp-mode-trigger')?.setAttribute('aria-expanded', 'true');\n menu.querySelector<HTMLButtonElement>('.wp-mode[aria-checked=\"true\"]')?.focus({ preventScroll: true });\n });\n document.querySelectorAll<HTMLButtonElement>('.wp-mode[data-wp-mode]').forEach((button: HTMLButtonElement) => {\n button.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n this.closeModeMenu(true);\n this.page.setMode(button.dataset['wpMode'] ?? 'runtime');\n });\n });\n }\n\n /** The \"Changed on this branch\" / \"Last commit\" toggle, in the drawer and in the Filter popover. */\n private wireImpactKinds(): void {\n document.querySelectorAll<HTMLButtonElement>('[data-wp-impact-kind]').forEach((button: HTMLButtonElement) => {\n button.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n this.page.setImpactKind(button.dataset['wpImpactKind'] ?? '');\n this.popover.refresh();\n });\n });\n }\n\n /** Shown only when two scans exist; the drawer's copy only while Impact colors the graph. */\n private syncImpactKinds(modes: WpModeState): void {\n document.querySelectorAll<HTMLElement>('[data-wp-impact-kinds]').forEach((group: HTMLElement) => {\n const inDrawer = group.dataset['wpImpactKinds'] === 'drawer';\n group.hidden = modes.scans.length < 2 || (inDrawer && modes.mode !== 'impact');\n });\n document.querySelectorAll<HTMLButtonElement>('[data-wp-impact-kind]').forEach((button: HTMLButtonElement) => {\n const kind = button.dataset['wpImpactKind'] ?? '';\n button.setAttribute('aria-pressed', String(kind === modes.kind));\n button.disabled = !modes.kindAvailable(kind);\n const scan = modes.scans.find((candidate: ImpactJson): boolean => candidate.kind === kind);\n button.title = scan === undefined ? '' : scan.available ? scan.label : scan.reason;\n });\n const legend = this.byId('wp-scope-legend');\n if (legend !== null) legend.textContent = modes.impact?.label ?? 'Changes on this branch';\n }\n\n private closeModeMenu(returnFocus: boolean): void {\n const menu = this.byId('wp-mode-menu');\n if (menu === null || menu.hidden) return;\n menu.hidden = true;\n const trigger = this.byId('wp-mode-trigger');\n trigger?.setAttribute('aria-expanded', 'false');\n if (returnFocus) trigger?.focus({ preventScroll: true });\n }\n\n /** Type-to-search lock: an exact project id (or a unique short name) locks, empty or Esc unlocks. */\n private wireLock(): void {\n const input = this.lockInput();\n if (input === null) return;\n input.addEventListener('input', () => {\n const value = input.value.trim();\n if (value === '') this.page.clearSelection();\n else if (this.page.hasNode(value)) this.page.setLock(value);\n });\n input.addEventListener('change', () => {\n const match = this.page.resolveName(input.value.trim());\n if (match !== null) this.page.setLock(match);\n else input.value = this.page.lockSelection() ?? '';\n });\n input.addEventListener('keydown', (ev: KeyboardEvent) => {\n if (ev.key !== 'Escape') return;\n ev.preventDefault();\n input.value = '';\n this.page.clearSelection();\n input.blur();\n });\n }\n\n /**\n * Page keys, in the CAPTURE phase so the open/closed state of the node menu is read before the\n * menu's own Escape handler closes it: Esc with a menu open only closes the menu. Esc closes an\n * open Color-by menu or Filter popover first, too.\n */\n private onKey(ev: KeyboardEvent): void {\n if (ev.altKey || ev.ctrlKey || ev.metaKey) return;\n if (ev.key === 'Escape' && this.byId('wp-mode-menu')?.hidden === false) {\n this.closeModeMenu(true);\n return;\n }\n if (ev.key === 'Escape' && this.popover.isOpen()) {\n this.popover.close();\n return;\n }\n if (ev.key === 'Escape' && this.dismissOverlay()) return;\n const target = ev.target;\n if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return;\n const menuOpen = document.getElementById('wp-node-menu') !== null || document.querySelector('.wp-graph-details:not([hidden])') !== null;\n if (ev.key === '/') {\n this.byId('wp-shell')?.classList.remove('wp-collapsed');\n this.byId('wp-collapse')?.setAttribute('aria-expanded', 'true');\n ev.preventDefault();\n this.lockInput()?.focus();\n return;\n }\n const index = ['1', '2', '3', '4'].indexOf(ev.key);\n if (index >= 0 && !menuOpen) {\n this.page.setMode(WpModeState.MODES[index]);\n return;\n }\n if (ev.key === 'Escape' && !menuOpen && this.page.lockSelection() !== null) this.page.setLock(null);\n }\n\n /** `button` shows/hides `target`; for the drawer itself it toggles the collapsed class instead. */\n private toggles(buttonId: string, targetId: string, collapse: boolean): void {\n const button = this.byId(buttonId);\n const target = this.byId(targetId);\n if (button === null || target === null) return;\n button.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n let expanded: boolean;\n if (collapse) {\n expanded = !target.classList.toggle('wp-collapsed');\n } else {\n target.hidden = !target.hidden;\n expanded = !target.hidden;\n if (expanded) this.openers.set(targetId, button);\n else this.openers.get(targetId)?.focus({ preventScroll: true });\n }\n document.querySelectorAll(`[aria-controls=\"${targetId}\"], #${buttonId}[aria-expanded]`).forEach(\n (el: Element) => el.setAttribute('aria-expanded', String(expanded)),\n );\n });\n }\n\n private dismissOverlay(): boolean {\n for (const id of ['wp-help', 'wp-legend-popout', 'wp-snapshot', 'wp-resp-panel']) {\n const panel = this.byId(id);\n if (!panel || panel.hidden) continue;\n panel.hidden = true;\n this.openers.get(id)?.focus({ preventScroll: true });\n this.openers.get(id)?.setAttribute('aria-expanded', 'false');\n return true;\n }\n return false;\n }\n\n private dismissOutside(target: EventTarget | null): void {\n if (!(target instanceof Node)) return;\n const filter = this.byId('wp-filter-pop');\n if (this.popover.isOpen() && !filter?.contains(target) && !this.byId('wp-filter-open')?.contains(target)) this.popover.close();\n for (const entry of this.openers) {\n const id = entry[0];\n const opener = entry[1];\n const panel = this.byId(id);\n if (panel && !panel.hidden && !panel.contains(target) && !opener.contains(target)) {\n panel.hidden = true;\n opener.setAttribute('aria-expanded', 'false');\n }\n }\n }\n\n /** Repaint every control from the page's state. */\n sync(modes: WpModeState, locked: string | null, filtering: boolean, filter: WpFilterChoice): void {\n const reason = modes.impactReason();\n document.querySelectorAll<HTMLButtonElement>('.wp-mode[data-wp-mode]').forEach((button: HTMLButtonElement) => {\n const mode = button.dataset['wpMode'] ?? '';\n button.setAttribute('aria-checked', String(mode === modes.mode));\n button.disabled = !modes.available(mode);\n if (mode === 'impact') button.title = reason === '' ? 'Key 3' : reason;\n if (mode === 'product') button.title = modes.productReason() === '' ? 'Key 4' : modes.productReason();\n });\n this.text('wp-mode-current', modes.name(modes.mode));\n this.text('wp-mode-current-sub', modes.subtitle(modes.mode));\n const reasonEl = this.byId('wp-impact-reason');\n if (reasonEl !== null) {\n reasonEl.textContent = reason;\n reasonEl.hidden = reason === '';\n }\n document.querySelectorAll<HTMLElement>('[data-wp-legend-mode]').forEach((section: HTMLElement) => {\n section.hidden = section.dataset['wpLegendMode'] !== modes.mode;\n });\n document.querySelectorAll<HTMLElement>('[data-wp-impact-note]').forEach((note: HTMLElement) => {\n note.textContent = this.impactNote(modes);\n });\n this.syncImpactKinds(modes);\n const title = this.byId('wp-legend-pop-title');\n if (title !== null) title.textContent = `Legend · ${modes.name(modes.mode)}`;\n const input = this.lockInput();\n if (input !== null && document.activeElement !== input) input.value = this.page.focusSelection() ?? '';\n const lockToggle = this.byId('wp-lock-toggle') as HTMLButtonElement | null;\n if (lockToggle !== null) {\n lockToggle.setAttribute('aria-pressed', String(locked !== null));\n lockToggle.disabled = locked === null && this.page.focusSelection() === null;\n lockToggle.title = lockToggle.disabled ? 'Select a node in Focus first' : '';\n }\n this.syncFilterToggle(locked, filtering);\n this.syncFilter(filter);\n this.crumb(modes.name(modes.mode), locked);\n }\n\n private syncFilterToggle(locked: string | null, filtering: boolean): void {\n const toggle = this.byId('wp-filter-toggle') as HTMLButtonElement | null;\n if (toggle === null) return;\n toggle.setAttribute('aria-pressed', String(filtering));\n toggle.disabled = !filtering && locked === null;\n toggle.title = toggle.disabled ? 'Lock a project first' : '';\n }\n\n /** The drawer button's count badge, and one removable pill per active filter in the top bar. */\n private syncFilter(filter: WpFilterChoice): void {\n const badge = this.byId('wp-filter-badge');\n if (badge !== null) {\n badge.textContent = String(filter.count());\n badge.hidden = filter.count() === 0;\n }\n const pills = this.byId('wp-filter-pills');\n if (pills === null) return;\n const items: HTMLElement[] = [];\n if (filter.scope !== 'everything') items.push(this.pill(this.scopeLabel(filter.scope), 'scope', filter.scope));\n for (const runtime of filter.runtimes) items.push(this.pill(runtime, 'runtime', runtime));\n for (const role of filter.roles) items.push(this.pill(role, 'role', role));\n for (const product of filter.products) items.push(this.pill(`product: ${product}`, 'product', product));\n pills.replaceChildren(...items);\n }\n\n /** A change scope's name, read from the Filter popover's markup: the shell owns the ONE copy. */\n private scopeLabel(scope: string): string {\n return document.querySelector(`[data-wp-scope-label=\"${scope}\"]`)?.textContent ?? scope;\n }\n\n /** A pill, built with text nodes so no value is parsed as HTML. */\n private pill(label: string, group: string, value: string): HTMLElement {\n const pill = document.createElement('span');\n pill.className = 'wp-pill';\n pill.dataset['wpPill'] = `${group}:${value}`;\n pill.append(label);\n const remove = document.createElement('button');\n remove.type = 'button';\n remove.textContent = '✕';\n remove.setAttribute('aria-label', `Remove filter ${label}`);\n remove.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n this.page.removeFilter(group, value);\n });\n pill.append(remove);\n return pill;\n }\n\n private impactNote(modes: WpModeState): string {\n const impact = modes.impact;\n if (impact === null || !impact.available) return '';\n // An available scan with a note is an EMPTY one, e.g. \"Nothing changed on this branch yet\".\n if (impact.reason !== '') return `${impact.label}: ${impact.reason}.`;\n const stats =\n `${impact.label}: ${impact.touched.length} changed · ${impact.affected.length} dependents · ` +\n `${impact.buildInputs.length} dependencies — nx affected, ${impact.changedFiles} changed files.`;\n const cause = this.globalCause(impact);\n return cause === '' ? stats : `${cause}. ${stats}`;\n }\n\n /**\n * When files changed but no project owns one, everything nx affected is affected by a\n * workspace-global input (a lockfile, the workspace manifest). That is correct for CI, and\n * baffling on a graph, so the note names the cause.\n */\n private globalCause(impact: ImpactJson): string {\n if (impact.touched.length > 0 || impact.changedFiles === 0) return '';\n const affected = impact.affected.length;\n const who = affected >= this.page.projectCount() ? 'Every project affected' : `${affected} projects affected`;\n const files = impact.globalFiles;\n if (files.length === 0)\n return `${who}: ${impact.changedFiles} changed files that no project owns (workspace-global input)`;\n const named = files.slice(0, 2).join(', ') + (files.length > 2 ? ` and ${files.length - 2} more` : '');\n return `${who}: ${named} changed (workspace-global input${files.length > 1 ? 's' : ''})`;\n }\n\n /** \"Mode: <b>Runtime</b> · Locked: <b>x</b>\", built with text nodes so no name is parsed as HTML. */\n private crumb(mode: string, locked: string | null): void {\n const crumb = this.byId('wp-crumb');\n if (crumb === null) return;\n const bold = (text: string): HTMLElement => {\n const b = document.createElement('b');\n b.textContent = text;\n return b;\n };\n const parts: (string | Node)[] = ['Mode: ', bold(mode)];\n if (locked !== null) parts.push(' · Locked: ', bold(locked));\n crumb.replaceChildren(...parts);\n }\n\n private text(id: string, value: string): void {\n const el = this.byId(id);\n if (el !== null) el.textContent = value;\n }\n\n private lockInput(): HTMLInputElement | null {\n return document.getElementById('wp-lock') as HTMLInputElement | null;\n }\n\n private byId(id: string): HTMLElement | null {\n return document.getElementById(id);\n }\n}\n\nclass GraphPage extends WpFilterPage {\n private highlighter: GraphHighlighter | null = null;\n private selected: string | null = null;\n private readonly modes = new WpModeState(\n this.model.nodes.some((node: RenderNodeJson): boolean => node.products.length > 0),\n this.model.viewer ?? 'architecture',\n );\n private readonly projects = new WpProjectFilter(this.model, this.modes);\n private applied = new WpFilterChoice();\n private readonly drawer = new GraphDrawer(this);\n\n protected override captureBinding(_svg: SVGSVGElement | null): () => void {\n const previous = this.highlighter;\n return (): void => {\n this.highlighter = previous;\n this.filterCards();\n this.syncControls();\n };\n }\n\n protected override wireControls(): void {\n this.drawer.wire();\n this.syncControls();\n }\n\n protected override nodeDot(node: RenderNodeJson): string {\n const modes = node.modes;\n if (modes === null) return node.dot;\n if (this.modes.mode === 'architecture') return modes.architecture;\n if (this.modes.mode === 'impact') return modes[this.modes.status(node.id)];\n if (this.modes.mode === 'product') return modes.product;\n return modes.runtime;\n }\n\n /** Product mode dashes a dependency that crosses into another product (#1204); every other mode draws it plain. */\n protected override edgeDot(edge: RenderEdgeJson): string {\n if (this.modes.mode === 'product' && edge.productDot !== null) return edge.productDot;\n return edge.dot;\n }\n\n protected override usesFullDot(): boolean {\n return this.modes.mode === 'runtime' && this.applied.count() === 0;\n }\n\n protected override narrow(retained: Set<string>): Set<string> {\n return this.projects.apply(retained, this.applied);\n }\n\n /** Filtering keeps every box in its own L-row: an emptied level stays as a thin labeled band. */\n protected override keepsEmptyLevels(): boolean {\n return true;\n }\n\n protected override prepareSvg(svg: SVGSVGElement): void { window.__WP_RUNTIME__?.prepare(svg); }\n\n protected wireSvg(svg: SVGSVGElement): void {\n this.highlighter = new GraphHighlighter(svg, this.chain, this.model, this);\n this.highlighter.wire();\n this.filterCards();\n this.syncControls();\n svg.querySelectorAll<SVGGElement>('g.node').forEach((node: SVGGElement) => {\n if (node.querySelector('title')?.textContent === this.anchor)\n node.classList.add('wp-filter-anchor');\n });\n }\n\n lockSelection(): string | null {\n return this.locked;\n }\n\n hasNode(id: string): boolean {\n return this.model.nodes.some((node: RenderNodeJson): boolean => node.id === id);\n }\n\n noun(): string { return this.model.viewer === 'runtime' ? 'service' : 'project'; }\n\n projectCount(): number { return this.model.nodes.filter(node => this.projects.isService(node)).length; }\n\n focusSelection(): string | null { return this.selected; }\n\n toggleLock(): void {\n if (this.locked !== null) this.setLock(null);\n else if (this.selected !== null) this.setLock(this.selected);\n }\n\n /** An exact id, else the one id whose short name (after any scope) is `text`; null if none or several. */\n resolveName(text: string): string | null {\n if (text === '') return null;\n if (this.hasNode(text)) return text;\n const matches = this.model.nodes.filter(\n (node: RenderNodeJson): boolean => node.id.split('/').pop() === text,\n );\n return matches.length === 1 ? matches[0].id : null;\n }\n\n setLock(name: string | null): void {\n this.locked = name;\n if (name !== null) this.selected = name;\n this.highlighter?.relight();\n this.filterCards();\n this.syncControls();\n }\n\n clearSelection(): void { this.selected = null; this.setLock(null); }\n\n setMode(mode: string): void {\n if (mode === this.modes.mode || !this.modes.set(mode)) return;\n this.syncControls();\n this.redraw();\n }\n\n /** Switch the active Impact scan: Impact recolours and an active change-scope filter re-applies. */\n setImpactKind(kind: string): void {\n if (kind === this.modes.kind || !this.modes.setKind(kind)) return;\n this.syncControls();\n this.redraw();\n }\n\n /** The drawer's \"Hide unconnected\": filter to the locked box's chain, or turn the filter off. */\n toggleFilter(): void {\n if (this.anchor !== null) this.filter(null);\n else if (this.locked !== null) this.filter(this.locked);\n }\n\n appliedFilter(): WpFilterChoice {\n return this.applied;\n }\n\n /** '' when the change-scope group can be used, else Impact's reason (the group is disabled). */\n scopeReason(): string {\n return this.modes.impactReason();\n }\n\n scopeCount(scope: string): number {\n if (this.model.viewer !== 'runtime') return this.projects.scopeCount(scope);\n const choice = new WpFilterChoice(); choice.scope = scope;\n return this.preview(choice);\n }\n\n /** How many boxes `choice` would show, with the current Hide-unconnected chain. */\n preview(choice: WpFilterChoice): number {\n const base =\n this.anchor === null\n ? new Set(this.model.nodes.map((node: RenderNodeJson): string => node.id))\n : this.chain.nodes(this.anchor);\n const kept = this.projects.apply(base, choice);\n return this.model.nodes.filter(node => kept.has(node.id) && this.projects.isService(node)).length;\n }\n\n applyFilter(choice: WpFilterChoice): void {\n if (this.scopeReason() !== '') choice.scope = 'everything';\n this.applied = choice;\n this.syncControls();\n this.redraw();\n }\n\n /** A top-bar pill's ✕. */\n removeFilter(group: string, value: string): void {\n const next = this.applied.copy();\n if (group === 'scope') next.scope = 'everything';\n else next.group(group).delete(value);\n this.applyFilter(next);\n }\n\n private syncControls(): void {\n this.drawer.sync(this.modes, this.locked, this.anchor !== null, this.applied);\n const count = this.model.nodes.filter(node => this.retained.has(node.id) && this.projects.isService(node)).length;\n const empty = document.getElementById('wp-empty');\n if (empty !== null) empty.hidden = count !== 0;\n const context = document.getElementById('wp-context-count');\n if (context !== null) context.textContent = `${count} services · ${this.retained.size - count} contextual nodes`;\n this.syncLegend();\n }\n\n private syncLegend(): void {\n document.querySelectorAll<HTMLElement>('[data-wp-legend-value]').forEach(row => {\n const group = row.dataset['wpLegendGroup'];\n const value = row.dataset['wpLegendValue'] ?? '';\n row.hidden = !this.model.nodes.some(node => this.retained.has(node.id) &&\n (group === 'runtime' ? (value === 'unknown' ? node.tags !== null && node.tags.frameworks.length === 0 : node.tags?.frameworks.includes(value)) : group === 'role' ? node.tags?.role === value : node.products.includes(value)));\n });\n }\n\n private filterCards(): void {\n const lit = this.locked === null ? this.retained : this.chain.nodes(this.locked);\n document.querySelectorAll('.wp-resp-card').forEach((card: Element) => {\n const name = card.getAttribute('data-node');\n card.classList.toggle(\n 'wp-hidden',\n name === null || !this.retained.has(name) || !lit.has(name),\n );\n });\n }\n}\n\nnew GraphPage(__RENDER_MODEL__).render();\n"]}
1
+ {"version":3,"file":"graph-visualizer.client.js","sourceRoot":"","sources":["../../../../../../packages/tooling/nx-webpieces-rules/src/lib/graph-visualizer.client.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,MAAM,cAAc;IAChB,KAAK,GAAG,YAAY,CAAC;IACZ,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAC7B,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAC1B,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEtC,IAAI;QACA,MAAM,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAChE,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpD,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,8DAA8D;IAC9D,KAAK;QACD,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC7G,CAAC;IAED,qEAAqE;IACrE,KAAK,CAAC,IAAY;QACd,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC,K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AAI,CAAC,EAAE,CAAC;gBAClE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACxO,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,WAAW;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjF,QAAQ,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,IAAa,EAAE,EAAE;YACjE,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,CAAC,MAAM,CACjB,WAAW,EACX,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAC9D,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,IAAI,SAAS,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["/**\n * One state of the Filter popover: a change scope plus the selected Runtime, Role and Product chips.\n * The page holds the APPLIED one; the popover edits a copy until \"Show N projects\".\n */\nclass WpFilterChoice {\n scope = 'everything';\n readonly runtimes = new Set<string>();\n readonly roles = new Set<string>();\n readonly products = new Set<string>();\n\n copy(): WpFilterChoice {\n const copy = new WpFilterChoice();\n copy.scope = this.scope;\n for (const runtime of this.runtimes) copy.runtimes.add(runtime);\n for (const role of this.roles) copy.roles.add(role);\n for (const product of this.products) copy.products.add(product);\n return copy;\n }\n\n /** How many filters are active: the drawer button's badge. */\n count(): number {\n return (this.scope === 'everything' ? 0 : 1) + this.runtimes.size + this.roles.size + this.products.size;\n }\n\n /** The chip set a `data-wp-chip-group` (or a pill's group) names. */\n group(name: string): Set<string> {\n if (name === 'role') return this.roles;\n if (name === 'product') return this.products;\n return this.runtimes;\n }\n}\n\n/**\n * The Filter popover's four groups, INTERSECTED: a box stays when it is in the change scope, AND has\n * any selected runtime chip (when one is selected), AND has any selected role chip (likewise), AND\n * belongs to any selected product (likewise — several products are the UNION of their closures).\n */\nclass WpProjectFilter {\n constructor(\n private readonly model: RenderModelJson,\n private readonly modes: WpModeState,\n ) {}\n\n /** The node ids a change scope keeps; null for \"everything\" (and whenever Impact is unavailable). */\n scopeSet(scope: string): Set<string> | null {\n const impact = this.modes.impact;\n if (scope === 'everything' || impact === null || this.modes.impactReason() !== '') return null;\n const ids: string[] = [...impact.touched];\n if (scope === 'dependents' || scope === 'build') ids.push(...impact.affected);\n if (scope === 'dependencies') ids.push(...impact.dependencies);\n if (scope === 'build') ids.push(...impact.buildInputs);\n return new Set(ids);\n }\n\n /** How many drawn projects a scope keeps on its own: the count beside each option. */\n scopeCount(scope: string): number {\n const set = this.scopeSet(scope);\n return this.model.nodes.filter((node: RenderNodeJson): boolean => this.isService(node) && (set === null || set.has(node.id))).length;\n }\n\n /** `base` (everything, or the Hide-unconnected chain) narrowed by `choice`. */\n apply(base: Set<string>, choice: WpFilterChoice): Set<string> {\n const scope = this.scopeSet(choice.scope);\n const kept = new Set<string>();\n for (const node of this.model.nodes) {\n if (!base.has(node.id) || !this.isService(node)) continue;\n if (scope !== null && !scope.has(node.id)) continue;\n if (!this.anyOf(choice.runtimes, node.tags?.frameworks ?? [])) continue;\n if (!this.anyOf(choice.roles, node.tags === null ? [] : [node.tags.role])) continue;\n if (!this.anyOf(choice.products, node.products)) continue;\n kept.add(node.id);\n }\n if (this.model.viewer === 'runtime') {\n for (const node of this.model.nodes) {\n if (node.tags !== null || !base.has(node.id)) continue;\n if (this.model.edges.some(edge => (edge.from === node.id && kept.has(edge.to)) || (edge.to === node.id && kept.has(edge.from)))) kept.add(node.id);\n }\n }\n return kept;\n }\n\n isService(node: RenderNodeJson): boolean { return this.model.viewer !== 'runtime' || node.tags !== null; }\n\n /** An empty chip group matches every box; otherwise the box must carry one of the chips. */\n private anyOf(selected: Set<string>, carried: string[]): boolean {\n return selected.size === 0 || carried.some((value: string): boolean => selected.has(value));\n }\n}\n\n/** Architecture interactions bind to each new SVG; logical Lock/Filter state belongs to the page. */\nclass GraphHighlighter {\n private readonly nodeByName = new Map<string, SVGGElement>();\n private hovered: string | null = null;\n\n constructor(\n private readonly svg: SVGSVGElement,\n private readonly chain: WpGraphChain,\n private readonly model: RenderModelJson,\n private readonly page: GraphPage,\n ) {}\n\n wire(): void {\n this.svg.querySelectorAll<SVGGElement>('g.node').forEach((g: SVGGElement) => {\n if (g.classList.contains('wp-layout')) return;\n const name = g.querySelector('title')?.textContent;\n if (name !== null && name !== undefined) this.nodeByName.set(name, g);\n });\n this.wireHover();\n this.wireMenu();\n this.relight();\n }\n\n private clear(): void {\n this.svg.classList.remove('wp-dim');\n this.svg.querySelectorAll('.wp-focus, .wp-neighbor, .wp-hl, .wp-locked').forEach((el: Element) => {\n el.classList.remove('wp-focus', 'wp-neighbor', 'wp-hl', 'wp-locked');\n });\n }\n\n relight(): void {\n this.clear();\n const locked = this.page.lockSelection();\n if (locked !== null) this.nodeByName.get(locked)?.classList.add('wp-locked');\n // A filtered-out Lock is suspended, including its otherwise visible relatives.\n const anchors = [locked, this.hovered].filter(\n (name: string | null): name is string => name !== null && this.nodeByName.has(name),\n );\n if (anchors.length === 0) return;\n const lit = new Set<string>();\n for (const name of anchors) {\n this.nodeByName.get(name)?.classList.add('wp-focus');\n for (const id of this.chain.nodes(name)) {\n if (this.nodeByName.has(id)) lit.add(id);\n }\n }\n this.svg.classList.add('wp-dim');\n for (const id of lit) this.nodeByName.get(id)?.classList.add('wp-neighbor');\n for (const edge of this.model.edges) {\n if (lit.has(edge.from) && lit.has(edge.to)) {\n this.svg.querySelector(`[id=\"${edge.id}\"]`)?.classList.add('wp-hl');\n }\n }\n }\n\n private wireHover(): void {\n this.nodeByName.forEach((g: SVGGElement, name: string) => {\n g.addEventListener('mouseenter', () => {\n this.hovered = name;\n this.relight();\n });\n g.addEventListener('mouseleave', () => {\n this.hovered = null;\n this.relight();\n });\n });\n }\n\n private wireMenu(): void {\n const designs = new Map<string, string>();\n for (const link of __DESIGN_LINKS__) designs.set(link.nodeId, link.href);\n WpNodeMenu.wire(this.svg, (name: string, node: SVGGElement): WpNodeMenuItem[] => {\n const items: WpNodeMenuItem[] = [];\n const href = designs.get(name);\n if (href !== undefined)\n items.push(new WpNodeMenuItem('View Design', () => window.open(href, '_blank')));\n const locked = this.page.lockSelection() === name;\n items.push(\n new WpNodeMenuItem(locked ? 'Unlock' : 'Lock', () =>\n locked ? this.page.clearSelection() : this.page.setLock(name),\n ),\n );\n items.push(this.page.filterItem(name));\n const implemented = window.__WP_RUNTIME__?.implementsItem(name, node);\n if (implemented) items.push(implemented);\n const goal = window.__WP_GOAL__?.item(name, node);\n if (goal) items.push(goal);\n return items;\n });\n }\n}\n\n/**\n * The Filter popover: edits a COPY of the page's applied filter, shows what each choice would keep,\n * and hands the copy to the page on \"Show N projects\". Closing it any other way discards the edit.\n */\nclass GraphFilterPopover {\n private draft = new WpFilterChoice();\n\n constructor(private readonly page: GraphPage) {}\n\n wire(): void {\n this.byId('wp-filter-open')?.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n if (this.isOpen()) this.close();\n else this.open();\n });\n this.byId('wp-filter-close')?.addEventListener('click', () => this.close());\n this.byId('wp-filter-clear')?.addEventListener('click', () => {\n this.draft = new WpFilterChoice();\n this.paint();\n });\n this.byId('wp-filter-apply')?.addEventListener('click', () => {\n this.page.applyFilter(this.draft.copy());\n this.close();\n });\n document.querySelectorAll<HTMLInputElement>('input[name=\"wp-scope\"]').forEach((radio: HTMLInputElement) => {\n radio.addEventListener('change', () => {\n if (!radio.checked) return;\n this.draft.scope = radio.value;\n this.paint();\n });\n });\n document.querySelectorAll<HTMLButtonElement>('.wp-chip[data-wp-chip]').forEach((chip: HTMLButtonElement) => {\n chip.addEventListener('click', () => {\n const set = this.draft.group(chip.dataset['wpChipGroup'] ?? '');\n const value = chip.dataset['wpChip'] ?? '';\n if (set.has(value)) set.delete(value);\n else set.add(value);\n this.paint();\n });\n });\n }\n\n isOpen(): boolean {\n return this.byId('wp-filter-pop')?.hidden === false;\n }\n\n /** The active Impact scan changed: an open popover's counts and labels follow it. */\n refresh(): void {\n if (this.isOpen()) this.paint();\n }\n\n open(): void {\n const pop = this.byId('wp-filter-pop');\n if (pop === null) return;\n this.draft = this.page.appliedFilter().copy();\n this.paint();\n pop.hidden = false;\n this.byId('wp-filter-open')?.setAttribute('aria-expanded', 'true');\n }\n\n close(): void {\n const pop = this.byId('wp-filter-pop');\n if (pop === null || pop.hidden) return;\n pop.hidden = true;\n this.byId('wp-filter-open')?.setAttribute('aria-expanded', 'false');\n }\n\n /** Repaint the controls from the draft: checked scope, pressed chips, counts and the footer. */\n private paint(): void {\n const reason = this.page.scopeReason();\n const group = this.byId('wp-scope-group') as HTMLFieldSetElement | null;\n if (group !== null) group.disabled = reason !== '';\n const reasonEl = this.byId('wp-scope-reason');\n if (reasonEl !== null) {\n reasonEl.textContent = reason;\n reasonEl.hidden = reason === '';\n }\n document.querySelectorAll<HTMLInputElement>('input[name=\"wp-scope\"]').forEach((radio: HTMLInputElement) => {\n radio.checked = radio.value === this.draft.scope;\n });\n document.querySelectorAll<HTMLElement>('[data-wp-scope-count]').forEach((count: HTMLElement) => {\n count.textContent = reason === '' ? String(this.page.scopeCount(count.dataset['wpScopeCount'] ?? '')) : '';\n });\n document.querySelectorAll<HTMLButtonElement>('.wp-chip[data-wp-chip]').forEach((chip: HTMLButtonElement) => {\n const set = this.draft.group(chip.dataset['wpChipGroup'] ?? '');\n chip.setAttribute('aria-pressed', String(set.has(chip.dataset['wpChip'] ?? '')));\n });\n const apply = this.byId('wp-filter-apply');\n if (apply !== null) {\n const shown = this.page.preview(this.draft);\n apply.textContent = `Show ${shown} ${this.page.noun()}${shown === 1 ? '' : 's'}`;\n }\n }\n\n private byId(id: string): HTMLElement | null {\n return document.getElementById(id);\n }\n}\n\n/**\n * The drawer and its floating panels: every control outside the graph itself. Holds no graph state —\n * each control calls back into the page, and `sync()` repaints the controls from the page's state.\n */\nclass GraphDrawer {\n readonly popover: GraphFilterPopover;\n private readonly openers = new Map<string, HTMLElement>();\n\n constructor(private readonly page: GraphPage) {\n this.popover = new GraphFilterPopover(page);\n }\n\n wire(): void {\n this.wireModeMenu();\n this.popover.wire();\n this.wireImpactKinds();\n this.wireLock();\n this.byId('wp-lock-toggle')?.addEventListener('click', () => this.page.toggleLock());\n this.byId('wp-filter-toggle')?.addEventListener('click', () => this.page.toggleFilter());\n this.toggles('wp-collapse', 'wp-shell', true);\n this.toggles('wp-help-btn', 'wp-help', false);\n this.toggles('wp-help-close', 'wp-help', false);\n this.toggles('wp-legend-pop', 'wp-legend-popout', false);\n this.toggles('wp-legend-close', 'wp-legend-popout', false);\n this.toggles('wp-resp-open', 'wp-resp-panel', false);\n this.toggles('wp-resp-close', 'wp-resp-panel', false);\n this.toggles('wp-snapshot-open', 'wp-snapshot', false);\n window.addEventListener('keydown', (ev: KeyboardEvent) => this.onKey(ev), true);\n window.addEventListener('hashchange', () => this.page.setMode(location.hash.slice(1)));\n document.addEventListener('click', (ev: MouseEvent) => {\n const target = ev.target;\n if (target instanceof Node && this.byId('wp-mode-menu')?.parentElement?.contains(target)) return;\n this.closeModeMenu(false);\n this.dismissOutside(target);\n });\n }\n\n /** \"Color by\": the pill trigger opens the menu of four; picking one switches and closes it. */\n private wireModeMenu(): void {\n this.byId('wp-mode-trigger')?.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n const menu = this.byId('wp-mode-menu');\n if (menu === null) return;\n if (!menu.hidden) {\n this.closeModeMenu(false);\n return;\n }\n menu.hidden = false;\n this.byId('wp-mode-trigger')?.setAttribute('aria-expanded', 'true');\n menu.querySelector<HTMLButtonElement>('.wp-mode[aria-checked=\"true\"]')?.focus({ preventScroll: true });\n });\n document.querySelectorAll<HTMLButtonElement>('.wp-mode[data-wp-mode]').forEach((button: HTMLButtonElement) => {\n button.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n this.closeModeMenu(true);\n this.page.setMode(button.dataset['wpMode'] ?? 'runtime');\n });\n });\n }\n\n /** The \"Changed on this branch\" / \"Last commit\" toggle, in the drawer and in the Filter popover. */\n private wireImpactKinds(): void {\n document.querySelectorAll<HTMLButtonElement>('[data-wp-impact-kind]').forEach((button: HTMLButtonElement) => {\n button.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n this.page.setImpactKind(button.dataset['wpImpactKind'] ?? '');\n this.popover.refresh();\n });\n });\n }\n\n /** Shown only when two scans exist; the drawer's copy only while Impact colors the graph. */\n private syncImpactKinds(modes: WpModeState): void {\n document.querySelectorAll<HTMLElement>('[data-wp-impact-kinds]').forEach((group: HTMLElement) => {\n const inDrawer = group.dataset['wpImpactKinds'] === 'drawer';\n group.hidden = modes.scans.length < 2 || (inDrawer && modes.mode !== 'impact');\n });\n document.querySelectorAll<HTMLButtonElement>('[data-wp-impact-kind]').forEach((button: HTMLButtonElement) => {\n const kind = button.dataset['wpImpactKind'] ?? '';\n button.setAttribute('aria-pressed', String(kind === modes.kind));\n button.disabled = !modes.kindAvailable(kind);\n const scan = modes.scans.find((candidate: ImpactJson): boolean => candidate.kind === kind);\n button.title = scan === undefined ? '' : scan.available ? scan.label : scan.reason;\n });\n const legend = this.byId('wp-scope-legend');\n if (legend !== null) legend.textContent = modes.impact?.label ?? 'Changes on this branch';\n }\n\n private closeModeMenu(returnFocus: boolean): void {\n const menu = this.byId('wp-mode-menu');\n if (menu === null || menu.hidden) return;\n menu.hidden = true;\n const trigger = this.byId('wp-mode-trigger');\n trigger?.setAttribute('aria-expanded', 'false');\n if (returnFocus) trigger?.focus({ preventScroll: true });\n }\n\n /** Type-to-search lock: an exact project id (or a unique short name) locks, empty or Esc unlocks. */\n private wireLock(): void {\n const input = this.lockInput();\n if (input === null) return;\n input.addEventListener('input', () => {\n const value = input.value.trim();\n if (value === '') this.page.clearSelection();\n else if (this.page.hasNode(value)) this.page.setLock(value);\n });\n input.addEventListener('change', () => {\n const match = this.page.resolveName(input.value.trim());\n if (match !== null) this.page.setLock(match);\n else input.value = this.page.lockSelection() ?? '';\n });\n input.addEventListener('keydown', (ev: KeyboardEvent) => {\n if (ev.key !== 'Escape') return;\n ev.preventDefault();\n input.value = '';\n this.page.clearSelection();\n input.blur();\n });\n }\n\n /**\n * Page keys, in the CAPTURE phase so the open/closed state of the node menu is read before the\n * menu's own Escape handler closes it: Esc with a menu open only closes the menu. Esc closes an\n * open Color-by menu or Filter popover first, too.\n */\n private onKey(ev: KeyboardEvent): void {\n if (ev.altKey || ev.ctrlKey || ev.metaKey) return;\n if (ev.key === 'Escape' && this.byId('wp-mode-menu')?.hidden === false) {\n this.closeModeMenu(true);\n return;\n }\n if (ev.key === 'Escape' && this.popover.isOpen()) {\n this.popover.close();\n return;\n }\n if (ev.key === 'Escape' && this.dismissOverlay()) return;\n const target = ev.target;\n if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) return;\n const menuOpen = document.getElementById('wp-node-menu') !== null || document.querySelector('.wp-graph-details:not([hidden]), .wp-goal-details:not([hidden])') !== null;\n if (ev.key === '/') {\n this.byId('wp-shell')?.classList.remove('wp-collapsed');\n this.byId('wp-collapse')?.setAttribute('aria-expanded', 'true');\n ev.preventDefault();\n this.lockInput()?.focus();\n return;\n }\n const index = ['1', '2', '3', '4', '5'].indexOf(ev.key);\n if (index >= 0 && !menuOpen) {\n this.page.setMode(WpModeState.MODES[index]);\n return;\n }\n if (ev.key === 'Escape' && !menuOpen && this.page.lockSelection() !== null) this.page.setLock(null);\n }\n\n /** `button` shows/hides `target`; for the drawer itself it toggles the collapsed class instead. */\n private toggles(buttonId: string, targetId: string, collapse: boolean): void {\n const button = this.byId(buttonId);\n const target = this.byId(targetId);\n if (button === null || target === null) return;\n button.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n let expanded: boolean;\n if (collapse) {\n expanded = !target.classList.toggle('wp-collapsed');\n } else {\n target.hidden = !target.hidden;\n expanded = !target.hidden;\n if (expanded) this.openers.set(targetId, button);\n else this.openers.get(targetId)?.focus({ preventScroll: true });\n }\n document.querySelectorAll(`[aria-controls=\"${targetId}\"], #${buttonId}[aria-expanded]`).forEach(\n (el: Element) => el.setAttribute('aria-expanded', String(expanded)),\n );\n });\n }\n\n private dismissOverlay(): boolean {\n for (const id of ['wp-help', 'wp-legend-popout', 'wp-snapshot', 'wp-resp-panel']) {\n const panel = this.byId(id);\n if (!panel || panel.hidden) continue;\n panel.hidden = true;\n this.openers.get(id)?.focus({ preventScroll: true });\n this.openers.get(id)?.setAttribute('aria-expanded', 'false');\n return true;\n }\n return false;\n }\n\n private dismissOutside(target: EventTarget | null): void {\n if (!(target instanceof Node)) return;\n const filter = this.byId('wp-filter-pop');\n if (this.popover.isOpen() && !filter?.contains(target) && !this.byId('wp-filter-open')?.contains(target)) this.popover.close();\n for (const entry of this.openers) {\n const id = entry[0];\n const opener = entry[1];\n const panel = this.byId(id);\n if (panel && !panel.hidden && !panel.contains(target) && !opener.contains(target)) {\n panel.hidden = true;\n opener.setAttribute('aria-expanded', 'false');\n }\n }\n }\n\n /** Repaint every control from the page's state. */\n sync(modes: WpModeState, locked: string | null, filtering: boolean, filter: WpFilterChoice): void {\n const reason = modes.impactReason();\n document.querySelectorAll<HTMLButtonElement>('.wp-mode[data-wp-mode]').forEach((button: HTMLButtonElement) => {\n const mode = button.dataset['wpMode'] ?? '';\n button.setAttribute('aria-checked', String(mode === modes.mode));\n button.disabled = !modes.available(mode);\n if (mode === 'impact') button.title = reason === '' ? 'Key 3' : reason;\n if (mode === 'product') button.title = modes.productReason() === '' ? 'Key 4' : modes.productReason();\n if (mode === 'goal') {\n // Unavailable is said in the menu itself, never shown as \"no differences\" (#1239).\n button.title = modes.goalReason() === '' ? 'Key 5' : modes.goalReason();\n const sub = button.querySelector('.wp-mode-sub');\n if (sub !== null) sub.textContent = modes.goalReason() === '' ? modes.subtitle(mode) : `Unavailable: ${modes.goalReason()}`;\n }\n });\n this.text('wp-mode-current', modes.name(modes.mode));\n this.text('wp-mode-current-sub', modes.subtitle(modes.mode));\n const reasonEl = this.byId('wp-impact-reason');\n if (reasonEl !== null) {\n reasonEl.textContent = reason;\n reasonEl.hidden = reason === '';\n }\n document.querySelectorAll<HTMLElement>('[data-wp-legend-mode]').forEach((section: HTMLElement) => {\n section.hidden = section.dataset['wpLegendMode'] !== modes.mode;\n });\n document.querySelectorAll<HTMLElement>('[data-wp-impact-note]').forEach((note: HTMLElement) => {\n note.textContent = this.impactNote(modes);\n });\n this.syncImpactKinds(modes);\n const title = this.byId('wp-legend-pop-title');\n if (title !== null) title.textContent = `Legend · ${modes.name(modes.mode)}`;\n const input = this.lockInput();\n if (input !== null && document.activeElement !== input) input.value = this.page.focusSelection() ?? '';\n const lockToggle = this.byId('wp-lock-toggle') as HTMLButtonElement | null;\n if (lockToggle !== null) {\n lockToggle.setAttribute('aria-pressed', String(locked !== null));\n lockToggle.disabled = locked === null && this.page.focusSelection() === null;\n lockToggle.title = lockToggle.disabled ? 'Select a node in Focus first' : '';\n }\n this.syncFilterToggle(locked, filtering);\n this.syncFilter(filter);\n this.crumb(modes.name(modes.mode), locked);\n }\n\n private syncFilterToggle(locked: string | null, filtering: boolean): void {\n const toggle = this.byId('wp-filter-toggle') as HTMLButtonElement | null;\n if (toggle === null) return;\n toggle.setAttribute('aria-pressed', String(filtering));\n toggle.disabled = !filtering && locked === null;\n toggle.title = toggle.disabled ? 'Lock a project first' : '';\n }\n\n /** The drawer button's count badge, and one removable pill per active filter in the top bar. */\n private syncFilter(filter: WpFilterChoice): void {\n const badge = this.byId('wp-filter-badge');\n if (badge !== null) {\n badge.textContent = String(filter.count());\n badge.hidden = filter.count() === 0;\n }\n const pills = this.byId('wp-filter-pills');\n if (pills === null) return;\n const items: HTMLElement[] = [];\n if (filter.scope !== 'everything') items.push(this.pill(this.scopeLabel(filter.scope), 'scope', filter.scope));\n for (const runtime of filter.runtimes) items.push(this.pill(runtime, 'runtime', runtime));\n for (const role of filter.roles) items.push(this.pill(role, 'role', role));\n for (const product of filter.products) items.push(this.pill(`product: ${product}`, 'product', product));\n pills.replaceChildren(...items);\n }\n\n /** A change scope's name, read from the Filter popover's markup: the shell owns the ONE copy. */\n private scopeLabel(scope: string): string {\n return document.querySelector(`[data-wp-scope-label=\"${scope}\"]`)?.textContent ?? scope;\n }\n\n /** A pill, built with text nodes so no value is parsed as HTML. */\n private pill(label: string, group: string, value: string): HTMLElement {\n const pill = document.createElement('span');\n pill.className = 'wp-pill';\n pill.dataset['wpPill'] = `${group}:${value}`;\n pill.append(label);\n const remove = document.createElement('button');\n remove.type = 'button';\n remove.textContent = '✕';\n remove.setAttribute('aria-label', `Remove filter ${label}`);\n remove.addEventListener('click', (ev: MouseEvent) => {\n ev.stopPropagation();\n this.page.removeFilter(group, value);\n });\n pill.append(remove);\n return pill;\n }\n\n private impactNote(modes: WpModeState): string {\n const impact = modes.impact;\n if (impact === null || !impact.available) return '';\n // An available scan with a note is an EMPTY one, e.g. \"Nothing changed on this branch yet\".\n if (impact.reason !== '') return `${impact.label}: ${impact.reason}.`;\n const stats =\n `${impact.label}: ${impact.touched.length} changed · ${impact.affected.length} dependents · ` +\n `${impact.buildInputs.length} dependencies — nx affected, ${impact.changedFiles} changed files.`;\n const cause = this.globalCause(impact);\n return cause === '' ? stats : `${cause}. ${stats}`;\n }\n\n /**\n * When files changed but no project owns one, everything nx affected is affected by a\n * workspace-global input (a lockfile, the workspace manifest). That is correct for CI, and\n * baffling on a graph, so the note names the cause.\n */\n private globalCause(impact: ImpactJson): string {\n if (impact.touched.length > 0 || impact.changedFiles === 0) return '';\n const affected = impact.affected.length;\n const who = affected >= this.page.projectCount() ? 'Every project affected' : `${affected} projects affected`;\n const files = impact.globalFiles;\n if (files.length === 0)\n return `${who}: ${impact.changedFiles} changed files that no project owns (workspace-global input)`;\n const named = files.slice(0, 2).join(', ') + (files.length > 2 ? ` and ${files.length - 2} more` : '');\n return `${who}: ${named} changed (workspace-global input${files.length > 1 ? 's' : ''})`;\n }\n\n /** \"Mode: <b>Runtime</b> · Locked: <b>x</b>\", built with text nodes so no name is parsed as HTML. */\n private crumb(mode: string, locked: string | null): void {\n const crumb = this.byId('wp-crumb');\n if (crumb === null) return;\n const bold = (text: string): HTMLElement => {\n const b = document.createElement('b');\n b.textContent = text;\n return b;\n };\n const parts: (string | Node)[] = ['Mode: ', bold(mode)];\n if (locked !== null) parts.push(' · Locked: ', bold(locked));\n crumb.replaceChildren(...parts);\n }\n\n private text(id: string, value: string): void {\n const el = this.byId(id);\n if (el !== null) el.textContent = value;\n }\n\n private lockInput(): HTMLInputElement | null {\n return document.getElementById('wp-lock') as HTMLInputElement | null;\n }\n\n private byId(id: string): HTMLElement | null {\n return document.getElementById(id);\n }\n}\n\nclass GraphPage extends WpFilterPage {\n private highlighter: GraphHighlighter | null = null;\n private selected: string | null = null;\n /** The page's own graph; Goal vs Current swaps in its overlay and back (#1239). */\n private readonly base: RenderModelJson = this.model;\n private readonly modes = new WpModeState(\n this.model.nodes.some((node: RenderNodeJson): boolean => node.products.length > 0),\n this.model.viewer ?? 'architecture',\n this.goalUnavailable(),\n );\n private projects = new WpProjectFilter(this.model, this.modes);\n private applied = new WpFilterChoice();\n private readonly drawer = new GraphDrawer(this);\n\n protected override captureBinding(_svg: SVGSVGElement | null): () => void {\n const previous = this.highlighter;\n return (): void => {\n this.highlighter = previous;\n this.filterCards();\n this.syncControls();\n };\n }\n\n protected override wireControls(): void {\n this.syncModel();\n this.drawer.wire();\n this.syncControls();\n }\n\n /** '' when this page can show Goal vs Current, else why not. */\n private goalUnavailable(): string {\n if (this.model.viewer !== 'runtime') return 'Goal vs Current compares runtime architecture only.';\n const comparison = this.model.comparison;\n if (comparison === undefined || comparison === null)\n return 'This page carries no Goal vs Current data. Re-open it with pnpm nx run architecture:visualize-runtime.';\n return comparison.available ? '' : comparison.reason;\n }\n\n /** Goal vs Current draws its overlay topology; every other mode draws the page's own graph. */\n private syncModel(): void {\n const overlay = this.base.comparison?.model ?? null;\n const next = this.modes.mode === 'goal' && overlay !== null ? overlay : this.base;\n if (next === this.model) return;\n this.useModel(next);\n this.projects = new WpProjectFilter(next, this.modes);\n }\n\n protected override nodeDot(node: RenderNodeJson): string {\n const modes = node.modes;\n if (modes === null) return node.dot;\n if (this.modes.mode === 'architecture') return modes.architecture;\n if (this.modes.mode === 'impact') return modes[this.modes.status(node.id)];\n if (this.modes.mode === 'product') return modes.product;\n return modes.runtime;\n }\n\n /** Product mode dashes a dependency that crosses into another product (#1204); every other mode draws it plain. */\n protected override edgeDot(edge: RenderEdgeJson): string {\n if (this.modes.mode === 'product' && edge.productDot !== null) return edge.productDot;\n return edge.dot;\n }\n\n protected override usesFullDot(): boolean {\n return (this.modes.mode === 'runtime' || this.modes.mode === 'goal') && this.applied.count() === 0;\n }\n\n protected override narrow(retained: Set<string>): Set<string> {\n return this.projects.apply(retained, this.applied);\n }\n\n /** Filtering keeps every box in its own L-row: an emptied level stays as a thin labeled band. */\n protected override keepsEmptyLevels(): boolean {\n return true;\n }\n\n protected override prepareSvg(svg: SVGSVGElement): void { window.__WP_RUNTIME__?.prepare(svg); }\n\n protected wireSvg(svg: SVGSVGElement): void {\n this.highlighter = new GraphHighlighter(svg, this.chain, this.model, this);\n this.highlighter.wire();\n this.filterCards();\n this.syncControls();\n svg.querySelectorAll<SVGGElement>('g.node').forEach((node: SVGGElement) => {\n if (node.querySelector('title')?.textContent === this.anchor)\n node.classList.add('wp-filter-anchor');\n });\n }\n\n lockSelection(): string | null {\n return this.locked;\n }\n\n hasNode(id: string): boolean {\n return this.model.nodes.some((node: RenderNodeJson): boolean => node.id === id);\n }\n\n noun(): string { return this.model.viewer === 'runtime' ? 'service' : 'project'; }\n\n projectCount(): number { return this.model.nodes.filter(node => this.projects.isService(node)).length; }\n\n focusSelection(): string | null { return this.selected; }\n\n toggleLock(): void {\n if (this.locked !== null) this.setLock(null);\n else if (this.selected !== null) this.setLock(this.selected);\n }\n\n /** An exact id, else the one id whose short name (after any scope) is `text`; null if none or several. */\n resolveName(text: string): string | null {\n if (text === '') return null;\n if (this.hasNode(text)) return text;\n const matches = this.model.nodes.filter(\n (node: RenderNodeJson): boolean => node.id.split('/').pop() === text,\n );\n return matches.length === 1 ? matches[0].id : null;\n }\n\n setLock(name: string | null): void {\n this.locked = name;\n if (name !== null) this.selected = name;\n this.highlighter?.relight();\n this.filterCards();\n this.syncControls();\n }\n\n clearSelection(): void { this.selected = null; this.setLock(null); }\n\n setMode(mode: string): void {\n if (mode === this.modes.mode || !this.modes.set(mode)) return;\n this.syncModel();\n this.syncControls();\n this.redraw();\n }\n\n /** Switch the active Impact scan: Impact recolours and an active change-scope filter re-applies. */\n setImpactKind(kind: string): void {\n if (kind === this.modes.kind || !this.modes.setKind(kind)) return;\n this.syncControls();\n this.redraw();\n }\n\n /** The drawer's \"Hide unconnected\": filter to the locked box's chain, or turn the filter off. */\n toggleFilter(): void {\n if (this.anchor !== null) this.filter(null);\n else if (this.locked !== null) this.filter(this.locked);\n }\n\n appliedFilter(): WpFilterChoice {\n return this.applied;\n }\n\n /** '' when the change-scope group can be used, else Impact's reason (the group is disabled). */\n scopeReason(): string {\n return this.modes.impactReason();\n }\n\n scopeCount(scope: string): number {\n if (this.model.viewer !== 'runtime') return this.projects.scopeCount(scope);\n const choice = new WpFilterChoice(); choice.scope = scope;\n return this.preview(choice);\n }\n\n /** How many boxes `choice` would show, with the current Hide-unconnected chain. */\n preview(choice: WpFilterChoice): number {\n const base =\n this.anchor === null\n ? new Set(this.model.nodes.map((node: RenderNodeJson): string => node.id))\n : this.chain.nodes(this.anchor);\n const kept = this.projects.apply(base, choice);\n return this.model.nodes.filter(node => kept.has(node.id) && this.projects.isService(node)).length;\n }\n\n applyFilter(choice: WpFilterChoice): void {\n if (this.scopeReason() !== '') choice.scope = 'everything';\n this.applied = choice;\n this.syncControls();\n this.redraw();\n }\n\n /** A top-bar pill's ✕. */\n removeFilter(group: string, value: string): void {\n const next = this.applied.copy();\n if (group === 'scope') next.scope = 'everything';\n else next.group(group).delete(value);\n this.applyFilter(next);\n }\n\n private syncControls(): void {\n document.body.dataset['wpMode'] = this.modes.mode;\n this.drawer.sync(this.modes, this.locked, this.anchor !== null, this.applied);\n const count = this.model.nodes.filter(node => this.retained.has(node.id) && this.projects.isService(node)).length;\n const empty = document.getElementById('wp-empty');\n if (empty !== null) empty.hidden = count !== 0;\n const context = document.getElementById('wp-context-count');\n if (context !== null) context.textContent = `${count} services · ${this.retained.size - count} contextual nodes`;\n this.syncLegend();\n }\n\n private syncLegend(): void {\n document.querySelectorAll<HTMLElement>('[data-wp-legend-value]').forEach(row => {\n const group = row.dataset['wpLegendGroup'];\n const value = row.dataset['wpLegendValue'] ?? '';\n row.hidden = !this.model.nodes.some(node => this.retained.has(node.id) &&\n (group === 'runtime' ? (value === 'unknown' ? node.tags !== null && node.tags.frameworks.length === 0 : node.tags?.frameworks.includes(value)) : group === 'role' ? node.tags?.role === value : node.products.includes(value)));\n });\n }\n\n private filterCards(): void {\n const lit = this.locked === null ? this.retained : this.chain.nodes(this.locked);\n document.querySelectorAll('.wp-resp-card').forEach((card: Element) => {\n const name = card.getAttribute('data-node');\n card.classList.toggle(\n 'wp-hidden',\n name === null || !this.retained.has(name) || !lit.has(name),\n );\n });\n }\n}\n\nnew GraphPage(__RENDER_MODEL__).render();\n"]}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Goal vs Current (#1239): turns the semantic diff of the two saved runtime files into the overlay the
3
+ * runtime viewer's "Goal vs Current" color mode draws.
4
+ *
5
+ * The overlay is rendered by the SAME shared runtime renderer as both pages (generateRuntimeRenderModel
6
+ * over RuntimeUnionGraph), so queue boxes, self-queue sub-rows, level bands and non-constraining
7
+ * feedback edges behave exactly as on the normal pages. Only the statements are restyled afterwards:
8
+ *
9
+ * added in goal green
10
+ * removed from goal red, dashed box / dotted arrow — still drawn, never dropped
11
+ * changed amber; a moved level reads `L4 → L2`
12
+ * unchanged subdued grey, kept for context
13
+ *
14
+ * Every drawn box and arrow maps back to the diff's FACT identities (never to display names or edge
15
+ * ids), and its before/after lines travel in the page for the details panel.
16
+ */
17
+ import { RenderEdge, RenderNode, RuntimeComparisonView } from './graph-render-model';
18
+ import type { RuntimeGraph } from './runtime-graph-model';
19
+ import { RuntimeDiffStatus, RuntimeFactChange } from './runtime-graph-diff';
20
+ import { RuntimeVizOptions } from './runtime-viz-options';
21
+ /** Render-node / render-edge → the diff fact identities it draws. */
22
+ export declare class RuntimeComparisonIds {
23
+ private readonly graph;
24
+ private readonly byNode;
25
+ private readonly triggerService;
26
+ constructor(graph: RuntimeGraph);
27
+ node(node: RenderNode): string[];
28
+ edge(edge: RenderEdge, nodes: Map<string, RenderNode>): string[];
29
+ /** A service's arrow into a context node: an external system, a remote service or a vendor library. */
30
+ private towards;
31
+ private queues;
32
+ private put;
33
+ }
34
+ /** Restyles one rendered statement for its diff status. */
35
+ export declare class RuntimeComparisonStyler {
36
+ status(changes: RuntimeFactChange[]): RuntimeDiffStatus;
37
+ /** A service box: rebuilt (its HTML label carries the level badge and the status in words). */
38
+ service(node: RenderNode, status: RuntimeDiffStatus, changes: RuntimeFactChange[]): string;
39
+ /** A context box (queue, datastore, clock, vendor): kind shape kept, status colors laid over it. */
40
+ context(node: RenderNode, status: RuntimeDiffStatus, changes: RuntimeFactChange[]): string;
41
+ /** An arrow: its line style says rpc/event as always; color (and dots for a removal) says the diff. */
42
+ edge(dot: string, status: RuntimeDiffStatus): string;
43
+ /** `L4`, or `L4 → L2` when the level moved. */
44
+ levels(change: RuntimeFactChange | undefined): string;
45
+ }
46
+ /** Builds the Goal vs Current view both runtime pages carry. */
47
+ export declare class RuntimeGoalComparison {
48
+ private readonly styler;
49
+ build(current: RuntimeGraph, goal: RuntimeGraph, options: RuntimeVizOptions): RuntimeComparisonView;
50
+ private restyleNodes;
51
+ private restyleEdges;
52
+ private changes;
53
+ private summary;
54
+ private line;
55
+ }