@aiready/visualizer 0.1.35 → 0.1.37
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.
- package/README.md +33 -228
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,253 +1,58 @@
|
|
|
1
1
|
# @aiready/visualizer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> AIReady Spoke: Interactive graph visualization for AIReady analysis results.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://npmjs.com/package/@aiready/visualizer)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
7
|
|
|
7
8
|
## Overview
|
|
8
9
|
|
|
9
|
-
This package provides tools to transform AIReady analysis results into interactive force-directed graph visualizations. It
|
|
10
|
-
|
|
11
|
-
- **Graph Builder**: Transforms analysis data into graph structures
|
|
12
|
-
- **CLI Tool**: Generates standalone HTML visualizations
|
|
13
|
-
- **Web App**: React-based interactive visualization (Vite-powered)
|
|
14
|
-
- **Type Definitions**: Comprehensive TypeScript types for graph data
|
|
15
|
-
|
|
16
|
-
## Features
|
|
17
|
-
|
|
18
|
-
### Core Capabilities
|
|
19
|
-
|
|
20
|
-
- ✅ **Graph Building**: Transform aiready analysis reports into graph structures
|
|
21
|
-
- ✅ **Node Management**: File nodes with metrics (token cost, LOC, duplicates, complexity)
|
|
22
|
-
- ✅ **Edge Management**: Dependency edges with types (import, dependency, similarity, reference)
|
|
23
|
-
- ✅ **Issue Tracking**: Overlay detected issues on the graph with severity levels
|
|
24
|
-
- ✅ **Circular Dependency Detection**: Automatic detection of circular dependencies
|
|
25
|
-
|
|
26
|
-
### Interactive Visualization
|
|
27
|
-
|
|
28
|
-
- ✅ **Force-Directed Layout**: Physics-based graph layout using d3-force
|
|
29
|
-
- ✅ **Flexible Node Repositioning**:
|
|
30
|
-
- Drag individual nodes to reposition
|
|
31
|
-
- Pin/unpin nodes (double-click or programmatically)
|
|
32
|
-
- Pin all / Unpin all controls
|
|
33
|
-
- Manual layout mode (disable physics)
|
|
34
|
-
- Reset layout to auto
|
|
35
|
-
- Fit view to show all nodes
|
|
36
|
-
- ✅ **Theme Support**: Dark/Light mode with system preference detection
|
|
37
|
-
- ✅ **Node Details Panel**: Click nodes to see detailed metrics
|
|
38
|
-
- ✅ **Legend Panel**: Color coding by severity and edge types
|
|
39
|
-
- ✅ **Zoom & Pan**: Scroll to zoom, drag to pan
|
|
40
|
-
|
|
41
|
-
### CLI & Integration
|
|
42
|
-
|
|
43
|
-
- ✅ **Standalone HTML Generation**: Generate shareable visualizations
|
|
44
|
-
- ✅ **Programmatic API**: Use GraphBuilder in your own code
|
|
45
|
-
- ✅ **Sample Data Generation**: Test with sample graphs
|
|
46
|
-
|
|
47
|
-
## Installation
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
pnpm add @aiready/visualizer
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Usage
|
|
54
|
-
|
|
55
|
-
### As a Library
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
import { GraphBuilder, createSampleGraph } from '@aiready/visualizer';
|
|
59
|
-
|
|
60
|
-
// Build graph from analysis results
|
|
61
|
-
const builder = new GraphBuilder('./src');
|
|
62
|
-
builder.addNode('src/index.ts', 'Main entry', 100);
|
|
63
|
-
builder.addNode('src/utils.ts', 'Utilities', 50);
|
|
64
|
-
builder.addEdge('src/index.ts', 'src/utils.ts', 'dependency');
|
|
65
|
-
const graph = builder.build();
|
|
66
|
-
|
|
67
|
-
// Or create a sample graph for testing
|
|
68
|
-
const sampleGraph = createSampleGraph();
|
|
69
|
-
|
|
70
|
-
console.log(`Graph has ${graph.nodes.length} nodes and ${graph.edges.length} edges`);
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Building from aiready Reports
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
import { GraphBuilder } from '@aiready/visualizer';
|
|
77
|
-
import fs from 'fs';
|
|
78
|
-
|
|
79
|
-
const report = JSON.parse(fs.readFileSync('aiready-report.json', 'utf-8'));
|
|
80
|
-
const graph = GraphBuilder.buildFromReport(report, '/path/to/project');
|
|
81
|
-
|
|
82
|
-
console.log(`Graph: ${graph.metadata.totalFiles} files, ${graph.metadata.totalDependencies} dependencies`);
|
|
83
|
-
console.log(`Issues: ${graph.metadata.criticalIssues} critical, ${graph.metadata.majorIssues} major`);
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### As a CLI Tool
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
aiready visualise
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Web Application
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
# Start development server
|
|
96
|
-
cd packages/visualizer/web
|
|
97
|
-
pnpm dev
|
|
98
|
-
|
|
99
|
-
# Build for production
|
|
100
|
-
pnpm build
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Data Structure
|
|
104
|
-
|
|
105
|
-
The visualizer uses a comprehensive graph data structure:
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
interface GraphData {
|
|
109
|
-
nodes: FileNode[]; // Files in the codebase
|
|
110
|
-
edges: DependencyEdge[]; // Import/dependency relationships
|
|
111
|
-
clusters: Cluster[]; // Domain/module groupings
|
|
112
|
-
issues: IssueOverlay[]; // Detected issues
|
|
113
|
-
metadata: GraphMetadata; // Aggregate information
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Node Properties
|
|
118
|
-
|
|
119
|
-
- **Metrics**: Lines of code, token cost, complexity
|
|
120
|
-
- **Issues**: Duplicates, inconsistencies count
|
|
121
|
-
- **Categorization**: Domain, module type
|
|
122
|
-
- **Visual**: Color, size, group
|
|
123
|
-
|
|
124
|
-
### Edge Properties
|
|
125
|
-
|
|
126
|
-
- **Type**: import, require, dynamic
|
|
127
|
-
- **Weight**: Dependency strength
|
|
128
|
-
- **Visual**: Color, width, label
|
|
129
|
-
|
|
130
|
-
## Development Status
|
|
131
|
-
|
|
132
|
-
### ✅ Phase 1-2: Core Foundation - COMPLETE
|
|
133
|
-
|
|
134
|
-
- Type definitions
|
|
135
|
-
- Graph builder with sample data
|
|
136
|
-
- Basic CLI structure
|
|
137
|
-
|
|
138
|
-
### ✅ Phase 3: Interactive Frontend - COMPLETE
|
|
139
|
-
|
|
140
|
-
- Vite + React setup
|
|
141
|
-
- ForceDirectedGraph integration
|
|
142
|
-
- Controls and filters
|
|
143
|
-
- Node details panel
|
|
144
|
-
|
|
145
|
-
### ✅ Phase 4: Flexible Node Repositioning - COMPLETE
|
|
146
|
-
|
|
147
|
-
- Drag nodes individually
|
|
148
|
-
- Pin/unpin nodes (double-click)
|
|
149
|
-
- Pin all/Unpin all controls
|
|
150
|
-
- Manual layout mode
|
|
151
|
-
- Fit view & Reset layout
|
|
10
|
+
This package provides tools to transform AIReady analysis results into interactive force-directed graph visualizations. It helps teams see architectural bottlenecks and context fragmentation visually.
|
|
152
11
|
|
|
153
12
|
## 🏛️ Architecture
|
|
154
13
|
|
|
155
|
-
This package is a **middle spoke** that sits between CLI and Core - it consumes analysis results from other spokes and provides visualization capabilities:
|
|
156
|
-
|
|
157
14
|
```
|
|
158
15
|
🎯 USER
|
|
159
16
|
│
|
|
160
17
|
▼
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
│ │ │ │ │ │ │
|
|
180
|
-
│ │✅ Ready│ │✅ Ready│ │✅ Ready│
|
|
181
|
-
│ └────────┘ └────────┘ └────────┘
|
|
182
|
-
│ │ │ │
|
|
183
|
-
└───────────┴─────────────────────┴─────────────────────┘
|
|
184
|
-
│
|
|
185
|
-
▼
|
|
186
|
-
🏢 HUB (@aiready/core)
|
|
18
|
+
🎛️ @aiready/cli (orchestrator)
|
|
19
|
+
│ │ │ │ │ │ │ │ │
|
|
20
|
+
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
|
|
21
|
+
[PAT] [CTX] [CON] [AMP] [DEP] [DOC] [SIG] [AGT] [TST]
|
|
22
|
+
│ │ │ │ │ │ │ │ │
|
|
23
|
+
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
🏢 @aiready/core
|
|
27
|
+
|
|
28
|
+
Legend:
|
|
29
|
+
PAT = pattern-detect CTX = context-analyzer
|
|
30
|
+
CON = consistency AMP = change-amplification
|
|
31
|
+
DEP = deps-health DOC = doc-drift
|
|
32
|
+
SIG = ai-signal-clarity AGT = agent-grounding
|
|
33
|
+
TST = testability
|
|
34
|
+
VIZ = @aiready/visualizer ★ (support package — renders analysis results, not a scorer)
|
|
35
|
+
★ = YOU ARE HERE
|
|
187
36
|
```
|
|
188
37
|
|
|
189
|
-
|
|
190
|
-
```
|
|
191
|
-
@aiready/visualizer
|
|
192
|
-
├── Graph Builder (src/graph/)
|
|
193
|
-
├── Type Definitions (src/types.ts)
|
|
194
|
-
├── CLI Tool (src/cli.ts)
|
|
195
|
-
└── Web App (web/)
|
|
196
|
-
└── @aiready/components
|
|
197
|
-
├── ForceDirectedGraph
|
|
198
|
-
└── GraphControls
|
|
199
|
-
```
|
|
38
|
+
## Features
|
|
200
39
|
|
|
201
|
-
|
|
40
|
+
- **Graph Builder**: Transforms analysis data into graph structures.
|
|
41
|
+
- **Force-Directed Layout**: Physics-based graph layout using d3-force.
|
|
42
|
+
- **Node Details**: Click nodes to see detailed metrics (LOC, token cost, etc.).
|
|
43
|
+
- **Issue Overlay**: Visualize detected issues directly on the dependency graph.
|
|
202
44
|
|
|
203
|
-
|
|
204
|
-
packages/visualizer/
|
|
205
|
-
├── src/
|
|
206
|
-
│ ├── cli.ts # CLI entry point
|
|
207
|
-
│ ├── index.ts # Package exports
|
|
208
|
-
│ ├── types.ts # Core TypeScript types
|
|
209
|
-
│ └── graph/
|
|
210
|
-
│ └── builder.ts # Graph building logic
|
|
211
|
-
├── web/ # React web application
|
|
212
|
-
│ ├── src/
|
|
213
|
-
│ │ ├── App.tsx # Main app component
|
|
214
|
-
│ │ ├── components/ # UI components
|
|
215
|
-
│ │ ├── hooks/ # Custom React hooks
|
|
216
|
-
│ │ └── utils.ts # Utilities
|
|
217
|
-
│ └── vite.config.ts # Vite configuration
|
|
218
|
-
├── scripts/ # Development scripts
|
|
219
|
-
├── test/ # Unit tests
|
|
220
|
-
└── README.md # This file
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## Development Commands
|
|
45
|
+
## Installation
|
|
224
46
|
|
|
225
47
|
```bash
|
|
226
|
-
|
|
227
|
-
pnpm dev
|
|
228
|
-
|
|
229
|
-
# Start web dev server
|
|
230
|
-
pnpm dev:web
|
|
231
|
-
|
|
232
|
-
# Build CLI + Web
|
|
233
|
-
pnpm build
|
|
234
|
-
|
|
235
|
-
# Build CLI only
|
|
236
|
-
pnpm build:cli
|
|
237
|
-
|
|
238
|
-
# Build web only
|
|
239
|
-
pnpm build:web
|
|
240
|
-
|
|
241
|
-
# Type check
|
|
242
|
-
pnpm typecheck
|
|
243
|
-
|
|
244
|
-
# Run tests
|
|
245
|
-
pnpm test
|
|
48
|
+
pnpm add @aiready/visualizer
|
|
246
49
|
```
|
|
247
50
|
|
|
248
|
-
##
|
|
51
|
+
## Usage
|
|
249
52
|
|
|
250
|
-
|
|
53
|
+
```bash
|
|
54
|
+
aiready visualise
|
|
55
|
+
```
|
|
251
56
|
|
|
252
57
|
## License
|
|
253
58
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/visualizer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"description": "Interactive graph visualization for AIReady analysis results",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-dom": "19.2.4",
|
|
50
50
|
"regenerator-runtime": "^0.14.1",
|
|
51
51
|
"d3": "^7",
|
|
52
|
-
"@aiready/core": "0.9.
|
|
52
|
+
"@aiready/core": "0.9.32"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@tailwindcss/vite": "^4.1.18",
|