@webpieces/nx-webpieces-rules 0.3.333 → 0.3.334

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.
@@ -5,34 +5,84 @@
5
5
  * - DOT format (for Graphviz)
6
6
  * - Interactive HTML (using viz.js)
7
7
  *
8
- * Output files go to tmp/webpieces/ for easy viewing without committing.
8
+ * All behavior lives on the injectable GraphVisualizer class so webpieces DI +
9
+ * @DocumentDesign can wire it — module-scope functions are a dead end the DI
10
+ * graph can't reach.
9
11
  */
10
12
  import type { EnhancedGraph } from './graph-sorter';
11
- /**
12
- * Generate Graphviz DOT format from the graph
13
- */
14
- export declare function generateDot(graph: EnhancedGraph, title?: string): string;
15
- /**
16
- * Generate interactive HTML with embedded SVG using viz.js
17
- */
18
- export declare function generateHTML(dot: string, title?: string): string;
19
- interface VisualizationPaths {
13
+ export declare class VisualizationPaths {
20
14
  htmlPath: string;
15
+ constructor(htmlPath: string);
16
+ }
17
+ export declare class GraphVisualizer {
18
+ private readonly names;
19
+ private readonly responsibilities;
20
+ /**
21
+ * Fill color for an env set — the color of the first env in the set that has
22
+ * a known color, else the default.
23
+ */
24
+ private frameworkColor;
25
+ /**
26
+ * Role border styling — fill stays keyed on framework; the border shows a
27
+ * project's ROLE at a glance. Server and client are the top-level runnable
28
+ * nodes, so they get bold, colored borders to stand out:
29
+ * server → thick GREEN border (a runnable server app)
30
+ * client → thick RED border (a client app, e.g. angular)
31
+ * designed-lib → bold border (a library with a generated @DocumentDesign design)
32
+ * lib / other → plain thin border
33
+ */
34
+ private roleBorderAttrs;
35
+ /**
36
+ * Click-through href for a node: the project's committed design.html, made
37
+ * relative to architecture/dependencies.html. Returns null when the project
38
+ * has no generated DI design (no design.json → no clickable design page).
39
+ */
40
+ private designHtmlHref;
41
+ /**
42
+ * Generate Graphviz DOT format from the graph
43
+ */
44
+ generateDot(graph: EnhancedGraph, title?: string): string;
45
+ private dotNodes;
46
+ private dotEdges;
47
+ /**
48
+ * Generate interactive HTML with embedded SVG using viz.js
49
+ */
50
+ generateHTML(dot: string, title?: string, lockControl?: string, responsibilitiesHtml?: string): string;
51
+ /**
52
+ * The lock control (a single-select dropdown, rendered above the legend).
53
+ * Picking a module LOCKS the graph into that box's hover view — its full
54
+ * ancestor + descendant chain stays lit while everything else stays dimmed —
55
+ * and narrows the responsibilities list below the graph to just that chain.
56
+ * The first option, "All", is the default and clears the lock. Hover still
57
+ * works on top of a lock; leaving a box returns to the locked view.
58
+ *
59
+ * Options are ordered by level DESCENDING to match the responsibilities cards.
60
+ */
61
+ lockControl(graph: EnhancedGraph): string;
62
+ private styles;
63
+ private componentStyles;
64
+ private legend;
65
+ /**
66
+ * The page script. The browser code lives in graph-visualizer.client.js (a
67
+ * plain .js asset, NOT a TS template literal) so its dim/highlight/lock
68
+ * functions can be ordinary browser functions — the TS lint rules that scan
69
+ * .ts template strings would otherwise forbid them, and browser JS cannot
70
+ * carry TS return annotations. We inline it and substitute the DOT.
71
+ */
72
+ private script;
73
+ /**
74
+ * Write the committed architecture visualization to
75
+ * architecture/dependencies.html, next to dependencies.json.
76
+ *
77
+ * This is a checked-in artifact, regenerated deterministically by
78
+ * architecture:generate so the boxes stay clickable into each project's
79
+ * design.html. The DOT is embedded in the HTML (rendered client-side by
80
+ * viz.js). Output is deterministic (sorted graph in → same bytes out) so git
81
+ * only shows a diff when the architecture actually changed.
82
+ */
83
+ writeVisualization(graph: EnhancedGraph, workspaceRoot: string, title?: string): VisualizationPaths;
84
+ /**
85
+ * Open the HTML visualization in the default browser
86
+ */
87
+ openVisualization(htmlPath: string): boolean;
21
88
  }
22
- /**
23
- * Write the committed architecture visualization to architecture/dependencies.html,
24
- * next to dependencies.json.
25
- *
26
- * This is a checked-in artifact, regenerated deterministically by
27
- * architecture:generate so the boxes stay clickable into each project's
28
- * design.html. The DOT is embedded in the HTML (rendered client-side by
29
- * viz.js), so no separate .dot file is committed — same as design.html. Output
30
- * is deterministic (sorted graph in → same bytes out) so git only shows a diff
31
- * when the architecture actually changed.
32
- */
33
- export declare function writeVisualization(graph: EnhancedGraph, workspaceRoot: string, title?: string): VisualizationPaths;
34
- /**
35
- * Open the HTML visualization in the default browser
36
- */
37
- export declare function openVisualization(htmlPath: string): boolean;
38
- export {};