codeviz 0.1.0 → 0.1.2
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 +446 -1
- package/dist/browser.d.mts +19 -0
- package/dist/browser.d.ts +19 -0
- package/dist/browser.js +7164 -0
- package/dist/browser.mjs +270 -0
- package/dist/chunk-HMMRZXQ4.mjs +7118 -0
- package/dist/index.d.mts +731 -5
- package/dist/index.d.ts +731 -5
- package/dist/index.js +9978 -5
- package/dist/index.mjs +3021 -4
- package/dist/useOverlayPort-dGxZQTue.d.mts +2448 -0
- package/dist/useOverlayPort-dGxZQTue.d.ts +2448 -0
- package/package.json +72 -4
package/README.md
CHANGED
|
@@ -1 +1,446 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CodeViz
|
|
2
|
+
|
|
3
|
+
**Interactive 2D codebase visualization with hierarchical semantic zoom**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/codeviz)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
|
|
9
|
+
CodeViz is a React component library for visualizing codebases as interactive 2D maps. It provides developers with an intuitive, map-like interface for understanding code structure, dependencies, and relationships at multiple levels of abstraction.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Hierarchical Visualization** - Directories as nested containment regions (scopes)
|
|
14
|
+
- **Semantic Zoom** - 5 discrete zoom levels showing different information density
|
|
15
|
+
- **Multi-Language Support** - TypeScript, JavaScript, Python via tree-sitter parsing
|
|
16
|
+
- **Dependency Visualization** - Import and call graph relationships as edges
|
|
17
|
+
- **Overlay System** - Cursors, badges, annotations for collaboration
|
|
18
|
+
- **Theme Support** - Light and dark themes with full customization
|
|
19
|
+
- **Dual Renderers** - React Flow (default) or Sigma.js (WebGL) for large graphs
|
|
20
|
+
- **High Performance** - Supports codebases up to 10,000+ files with Sigma renderer
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install codeviz
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { CodeMapComponent, useLayout, analyzeCodebase } from 'codeviz';
|
|
30
|
+
|
|
31
|
+
function App() {
|
|
32
|
+
const [codeGraph, setCodeGraph] = useState(null);
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
analyzeCodebase('./src').then(result => {
|
|
36
|
+
setCodeGraph(result.codeGraph);
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
const { codeMap, isComputing } = useLayout(codeGraph);
|
|
41
|
+
|
|
42
|
+
if (isComputing || !codeMap) {
|
|
43
|
+
return <div>Loading...</div>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<CodeMapComponent
|
|
48
|
+
codeMap={codeMap}
|
|
49
|
+
theme="dark"
|
|
50
|
+
onNodeClick={(node) => console.log('Clicked:', node)}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# npm
|
|
60
|
+
npm install codeviz
|
|
61
|
+
|
|
62
|
+
# yarn
|
|
63
|
+
yarn add codeviz
|
|
64
|
+
|
|
65
|
+
# pnpm
|
|
66
|
+
pnpm add codeviz
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Peer Dependencies
|
|
70
|
+
|
|
71
|
+
CodeViz requires React 18+:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install react react-dom
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Usage
|
|
78
|
+
|
|
79
|
+
### Analyzing a Codebase
|
|
80
|
+
|
|
81
|
+
Use `analyzeCodebase` to scan and parse source files:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { analyzeCodebase } from 'codeviz';
|
|
85
|
+
|
|
86
|
+
const result = await analyzeCodebase('./src', {
|
|
87
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
|
88
|
+
ignorePatterns: ['node_modules', 'dist', '*.test.ts'],
|
|
89
|
+
maxDepth: 10,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// result.codeGraph contains:
|
|
93
|
+
// - files: FileNode[]
|
|
94
|
+
// - directories: DirectoryNode[]
|
|
95
|
+
// - symbols: SymbolNode[]
|
|
96
|
+
// - imports: ImportEdge[]
|
|
97
|
+
// - calls: CallEdge[]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Computing Layout
|
|
101
|
+
|
|
102
|
+
Transform a `CodeGraph` into positioned `CodeMap`:
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import { useLayout, computeLayout } from 'codeviz';
|
|
106
|
+
|
|
107
|
+
// React hook (recommended)
|
|
108
|
+
const { codeMap, isComputing, error } = useLayout(codeGraph, {
|
|
109
|
+
algorithm: 'force-directed',
|
|
110
|
+
clusteringEnabled: true,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Or imperative API
|
|
114
|
+
const codeMap = await computeLayout(codeGraph, layoutConfig);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Rendering the Map
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import { CodeMapComponent } from 'codeviz';
|
|
121
|
+
|
|
122
|
+
<CodeMapComponent
|
|
123
|
+
codeMap={codeMap}
|
|
124
|
+
theme="dark"
|
|
125
|
+
|
|
126
|
+
// Interaction callbacks
|
|
127
|
+
onNodeClick={(node) => handleNodeClick(node)}
|
|
128
|
+
onNodeHover={(node) => handleNodeHover(node)}
|
|
129
|
+
onScopeToggle={(scopeId, expanded) => handleScopeToggle(scopeId, expanded)}
|
|
130
|
+
onViewportChange={(viewport) => handleViewportChange(viewport)}
|
|
131
|
+
onZoomLevelChange={(level) => handleZoomLevelChange(level)}
|
|
132
|
+
|
|
133
|
+
// Selection (controlled)
|
|
134
|
+
selectedNodes={['file-1', 'file-2']}
|
|
135
|
+
onSelectionChange={(nodeIds) => setSelectedNodes(nodeIds)}
|
|
136
|
+
/>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Using Overlays
|
|
140
|
+
|
|
141
|
+
Add cursors, badges, and annotations:
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { useOverlayPort, CodeMapComponent } from 'codeviz';
|
|
145
|
+
|
|
146
|
+
function CollaborativeMap({ codeMap }) {
|
|
147
|
+
const { port, overlays } = useOverlayPort();
|
|
148
|
+
|
|
149
|
+
// Add a cursor overlay
|
|
150
|
+
const cursorId = port.bind({
|
|
151
|
+
type: 'cursor',
|
|
152
|
+
position: { type: 'absolute', x: 100, y: 200 },
|
|
153
|
+
color: '#6366f1',
|
|
154
|
+
label: 'Alice',
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Add a badge to a node
|
|
158
|
+
port.bind({
|
|
159
|
+
type: 'badge',
|
|
160
|
+
position: { type: 'node', nodeId: 'file-1', anchor: 'top-right' },
|
|
161
|
+
variant: 'count',
|
|
162
|
+
value: 3,
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// Update cursor position
|
|
166
|
+
port.update(cursorId, {
|
|
167
|
+
position: { type: 'absolute', x: 150, y: 250 },
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
return (
|
|
171
|
+
<CodeMapComponent
|
|
172
|
+
codeMap={codeMap}
|
|
173
|
+
overlayPort={port}
|
|
174
|
+
onOverlayClick={(id, overlay) => console.log('Overlay clicked:', id)}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Sigma Renderer (WebGL)
|
|
181
|
+
|
|
182
|
+
For large codebases (1,000+ files), use the Sigma.js renderer for better performance:
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
import { CodeMap } from 'codeviz';
|
|
186
|
+
|
|
187
|
+
<CodeMap
|
|
188
|
+
codeMap={codeMap}
|
|
189
|
+
codeGraph={codeGraph} // Required for nexus view
|
|
190
|
+
renderer="sigma" // Use WebGL renderer
|
|
191
|
+
view="structure" // "structure" or "nexus"
|
|
192
|
+
theme="dark"
|
|
193
|
+
onNodeClick={(nodeId, node) => console.log('Clicked:', nodeId)}
|
|
194
|
+
/>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### View Modes
|
|
198
|
+
|
|
199
|
+
| Mode | Description | Data Source | Best For |
|
|
200
|
+
|------|-------------|-------------|----------|
|
|
201
|
+
| `structure` | File system hierarchy with scopes | `CodeMap` | Understanding project organization |
|
|
202
|
+
| `nexus` | Flat relationship graph | `CodeGraph` | Exploring dependencies and imports |
|
|
203
|
+
|
|
204
|
+
### When to Use Sigma vs React Flow
|
|
205
|
+
|
|
206
|
+
| Scenario | Recommended Renderer |
|
|
207
|
+
|----------|---------------------|
|
|
208
|
+
| < 500 nodes | React Flow (richer interactions) |
|
|
209
|
+
| 500 - 2,000 nodes | Either (test both) |
|
|
210
|
+
| 2,000+ nodes | Sigma (WebGL performance) |
|
|
211
|
+
| Need nested scopes | React Flow |
|
|
212
|
+
| Need force-directed layout | Sigma |
|
|
213
|
+
|
|
214
|
+
### Sigma-Specific Features
|
|
215
|
+
|
|
216
|
+
```tsx
|
|
217
|
+
import { SigmaRenderer } from 'codeviz';
|
|
218
|
+
|
|
219
|
+
// Direct Sigma renderer access (advanced)
|
|
220
|
+
<SigmaRenderer
|
|
221
|
+
graph={graphologyGraph}
|
|
222
|
+
view="nexus"
|
|
223
|
+
theme={darkTheme}
|
|
224
|
+
|
|
225
|
+
// Selection
|
|
226
|
+
selectedNodeId={selectedNode}
|
|
227
|
+
onSelectedNodeChange={setSelectedNode}
|
|
228
|
+
|
|
229
|
+
// Highlights (e.g., from AI/search)
|
|
230
|
+
highlightedNodeIds={['file-1', 'file-2']}
|
|
231
|
+
|
|
232
|
+
// Controls
|
|
233
|
+
showControls={true}
|
|
234
|
+
controlsPosition="bottom-right"
|
|
235
|
+
|
|
236
|
+
// Overlays work with Sigma too
|
|
237
|
+
overlays={overlays}
|
|
238
|
+
onOverlayClick={handleOverlayClick}
|
|
239
|
+
/>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Imperative API
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import { useRef } from 'react';
|
|
246
|
+
import { SigmaRenderer, SigmaRendererHandle } from 'codeviz';
|
|
247
|
+
|
|
248
|
+
function MyComponent() {
|
|
249
|
+
const sigmaRef = useRef<SigmaRendererHandle>(null);
|
|
250
|
+
|
|
251
|
+
const handleFocus = () => {
|
|
252
|
+
sigmaRef.current?.focusNode('file-1');
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const handleFitAll = () => {
|
|
256
|
+
sigmaRef.current?.fitToNodes(['file-1', 'file-2', 'file-3']);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<>
|
|
261
|
+
<SigmaRenderer ref={sigmaRef} ... />
|
|
262
|
+
<button onClick={handleFocus}>Focus Node</button>
|
|
263
|
+
<button onClick={() => sigmaRef.current?.zoomIn()}>Zoom In</button>
|
|
264
|
+
<button onClick={() => sigmaRef.current?.resetView()}>Reset</button>
|
|
265
|
+
</>
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Zoom Levels
|
|
271
|
+
|
|
272
|
+
CodeViz uses 5 semantic zoom levels:
|
|
273
|
+
|
|
274
|
+
| Level | Name | Zoom Range | Content |
|
|
275
|
+
|-------|------|------------|---------|
|
|
276
|
+
| 0 | Overview | 0 - 0.25 | Top directories only, aggregated edges |
|
|
277
|
+
| 1 | Modules | 0.25 - 0.5 | Subdirectories + large files (>200 LOC) |
|
|
278
|
+
| 2 | Files | 0.5 - 1.0 | All files + exported symbols |
|
|
279
|
+
| 3 | Symbols | 1.0 - 2.0 | All symbols + call graph edges |
|
|
280
|
+
| 4 | Code | 2.0+ | Code preview panels, all details |
|
|
281
|
+
|
|
282
|
+
## Configuration
|
|
283
|
+
|
|
284
|
+
### Layout Configuration
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
import { computeLayout, DEFAULT_LAYOUT_CONFIG } from 'codeviz';
|
|
288
|
+
|
|
289
|
+
const layoutConfig = {
|
|
290
|
+
...DEFAULT_LAYOUT_CONFIG,
|
|
291
|
+
|
|
292
|
+
// Clustering
|
|
293
|
+
clusteringEnabled: true,
|
|
294
|
+
clusteringResolution: 1.0,
|
|
295
|
+
|
|
296
|
+
// Force-directed layout
|
|
297
|
+
forceIterations: 100,
|
|
298
|
+
forceGravity: 0.1,
|
|
299
|
+
forceRepulsion: 1.0,
|
|
300
|
+
|
|
301
|
+
// Sizing
|
|
302
|
+
nodeSizeBase: 40,
|
|
303
|
+
nodeSizeScale: 1.5,
|
|
304
|
+
scopePadding: { top: 40, right: 20, bottom: 20, left: 20 },
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
const codeMap = await computeLayout(codeGraph, layoutConfig);
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Theme Customization
|
|
311
|
+
|
|
312
|
+
```tsx
|
|
313
|
+
import { CodeMapComponent, darkTheme, mergeTheme } from 'codeviz';
|
|
314
|
+
|
|
315
|
+
const customTheme = mergeTheme(darkTheme, {
|
|
316
|
+
colors: {
|
|
317
|
+
nodes: {
|
|
318
|
+
file: { background: '#1e293b', border: '#334155' },
|
|
319
|
+
},
|
|
320
|
+
scopes: {
|
|
321
|
+
depth0: '#0f172a',
|
|
322
|
+
depth1: '#1e293b',
|
|
323
|
+
depth2: '#334155',
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
<CodeMapComponent codeMap={codeMap} theme={customTheme} />
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
## API Overview
|
|
332
|
+
|
|
333
|
+
### Components
|
|
334
|
+
|
|
335
|
+
| Component | Description |
|
|
336
|
+
|-----------|-------------|
|
|
337
|
+
| `CodeMapComponent` | Main visualization component (React Flow renderer) |
|
|
338
|
+
| `CodeMap` | Unified component supporting both renderers |
|
|
339
|
+
| `SigmaRenderer` | WebGL-based Sigma.js renderer |
|
|
340
|
+
| `ThemeProvider` | Theme context provider |
|
|
341
|
+
| `OverlayLayer` | Overlay rendering layer |
|
|
342
|
+
| `GraphControls` | Zoom/pan controls for Sigma renderer |
|
|
343
|
+
|
|
344
|
+
### Hooks
|
|
345
|
+
|
|
346
|
+
| Hook | Description |
|
|
347
|
+
|------|-------------|
|
|
348
|
+
| `useLayout` | Compute layout from CodeGraph |
|
|
349
|
+
| `useOverlayPort` | Manage overlay state |
|
|
350
|
+
| `useTheme` | Access current theme |
|
|
351
|
+
|
|
352
|
+
### Core Functions
|
|
353
|
+
|
|
354
|
+
| Function | Description |
|
|
355
|
+
|----------|-------------|
|
|
356
|
+
| `analyzeCodebase` | Scan and parse source files |
|
|
357
|
+
| `computeLayout` | Transform CodeGraph to CodeMap |
|
|
358
|
+
| `createOverlayPort` | Create imperative overlay controller |
|
|
359
|
+
|
|
360
|
+
### Types
|
|
361
|
+
|
|
362
|
+
```tsx
|
|
363
|
+
import type {
|
|
364
|
+
// Input types
|
|
365
|
+
CodeGraph,
|
|
366
|
+
FileNode,
|
|
367
|
+
DirectoryNode,
|
|
368
|
+
SymbolNode,
|
|
369
|
+
|
|
370
|
+
// Output types
|
|
371
|
+
CodeMap,
|
|
372
|
+
MapNode,
|
|
373
|
+
MapScope,
|
|
374
|
+
MapEdge,
|
|
375
|
+
|
|
376
|
+
// Configuration
|
|
377
|
+
LayoutConfig,
|
|
378
|
+
ZoomLevelConfig,
|
|
379
|
+
Theme,
|
|
380
|
+
|
|
381
|
+
// Overlays
|
|
382
|
+
Overlay,
|
|
383
|
+
CursorOverlay,
|
|
384
|
+
BadgeOverlay,
|
|
385
|
+
AnnotationOverlay,
|
|
386
|
+
} from 'codeviz';
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
## Storybook
|
|
390
|
+
|
|
391
|
+
Explore components interactively:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
npm run storybook
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
Visit http://localhost:6006 to see:
|
|
398
|
+
- CodeMap with sample data
|
|
399
|
+
- Theme comparisons (light/dark)
|
|
400
|
+
- Overlay demonstrations
|
|
401
|
+
- Hook integration examples
|
|
402
|
+
|
|
403
|
+
## Development
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
# Install dependencies
|
|
407
|
+
npm install
|
|
408
|
+
|
|
409
|
+
# Run tests
|
|
410
|
+
npm test
|
|
411
|
+
|
|
412
|
+
# Run tests once
|
|
413
|
+
npm run test:run
|
|
414
|
+
|
|
415
|
+
# Type checking
|
|
416
|
+
npm run typecheck
|
|
417
|
+
|
|
418
|
+
# Build library
|
|
419
|
+
npm run build
|
|
420
|
+
|
|
421
|
+
# Start Storybook
|
|
422
|
+
npm run storybook
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
## Contributing
|
|
426
|
+
|
|
427
|
+
1. Fork the repository
|
|
428
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
429
|
+
3. Run tests (`npm test`)
|
|
430
|
+
4. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
431
|
+
5. Push to the branch (`git push origin feature/amazing-feature`)
|
|
432
|
+
6. Open a Pull Request
|
|
433
|
+
|
|
434
|
+
## License
|
|
435
|
+
|
|
436
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
437
|
+
|
|
438
|
+
## Acknowledgments
|
|
439
|
+
|
|
440
|
+
Built with:
|
|
441
|
+
- [React Flow](https://reactflow.dev/) - React library for node-based UIs
|
|
442
|
+
- [Sigma.js](https://www.sigmajs.org/) - WebGL graph visualization
|
|
443
|
+
- [tree-sitter](https://tree-sitter.github.io/) - Incremental parsing system
|
|
444
|
+
- [graphology](https://graphology.github.io/) - Graph data structure
|
|
445
|
+
- [ELK](https://www.eclipse.org/elk/) - Eclipse Layout Kernel
|
|
446
|
+
- [Lucide](https://lucide.dev/) - Icon library
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { cl as AbsolutePosition, cL as AgentStatus, cw as AgentWidgetOverlay, cE as AgentWidgetOverlayInput, bM as AggregateNodeComponent, A as AggregateNodeData, c6 as AggregateReactFlowNodeData, ck as AnchorPoint, s as AnimationConfig, cI as AnnotationContentType, cu as AnnotationOverlay, cC as AnnotationOverlayInput, ct as BadgeOverlay, cB as BadgeOverlayInput, cH as BadgeSize, cG as BadgeVariant, cq as BaseOverlay, B as BoundingBox, bQ as BundledEdgeComponent, cb as BundledEdgeData, cS as CalculatedPosition, C as CallEdge, bP as CallEdgeComponent, ca as CallEdgeData, aU as ClusteringOptions, aV as ClusteringResult, i as CodeGraph, p as CodeMap, bD as CodeMapComponent, t as CodeMapConfig, b$ as CodeMapProps, h as CodebaseMetadata, ag as ColorPalette, b3 as ComputeLayoutOptions, cr as CursorOverlay, cz as CursorOverlayInput, w as DEFAULT_ANIMATION_CONFIG, x as DEFAULT_CODEMAP_CONFIG, v as DEFAULT_LAYOUT_CONFIG, u as DEFAULT_ZOOM_LEVELS, aQ as DirectoryEdgeAttributes, aW as DirectoryForceOptions, aX as DirectoryForceResult, aT as DirectoryGraphResult, D as DirectoryMetrics, e as DirectoryNode, cv as DocumentOverlay, cD as DocumentOverlayInput, cK as DocumentStatus, cJ as DocumentType, aj as EdgeColors, cU as EdgePath, cn as EdgePosition, b0 as EdgeRoutingOptions, c3 as EdgeType, aR as EntityIdMapping, F as FileMetrics, d as FileNode, bJ as FileNodeComponent, c4 as FileNodeData, bE as Flow, c0 as FlowProps, a_ as ForcePositioningOptions, aP as GraphEdgeAttributes, aO as GraphNodeAttributes, aS as GraphologyConversionResult, aY as HierarchyOptions, aZ as HierarchyResult, cs as HighlightOverlay, cA as HighlightOverlayInput, cF as HighlightStyle, cQ as IOverlayPort, I as ImportEdge, bO as ImportEdgeComponent, c9 as ImportEdgeData, L as LayoutConfig, cf as LayoutProgress, b4 as LayoutProgressCallback, o as MapEdge, n as MapEdgeType, k as MapNode, j as MapNodeData, M as MapNodeType, m as MapScope, l as MapScopeData, cT as NodeBounds, ai as NodeColors, cm as NodePosition, c2 as NodeType, a$ as NoverlapOptions, cx as Overlay, cN as OverlayBatchUpdate, cO as OverlayClickHandler, ak as OverlayColors, cM as OverlayFilter, cP as OverlayHoverHandler, cy as OverlayInput, cY as OverlayLayer, cR as OverlayLayerProps, cW as OverlayPort, co as OverlayPosition, cp as OverlayType, a as Padding, c_ as PortalOverlayLayer, P as Position, af as RGBAColor, ae as RGBColor, cc as ReactFlowEdgeData, c8 as ReactFlowNodeData, cZ as SVGOverlayLayer, ah as ScopeDepthColors, bK as ScopeNodeComponent, c7 as ScopeNodeData, c1 as ScopeNodeProps, S as Size, b as SourceLocation, f as SymbolKind, c as SymbolMetrics, g as SymbolNode, bL as SymbolNodeComponent, c5 as SymbolNodeData, am as Theme, an as ThemeContextValue, bF as ThemeProvider, ao as ThemeProviderProps, al as UIColors, cg as UseLayoutOptions, ch as UseLayoutResult, ci as UseOverlayPortOptions, cj as UseOverlayPortResult, cV as ViewportTransform, Z as ZoomLevel, r as ZoomLevelConfig, b2 as ZoomLevelData, q as ZoomLevelName, b1 as ZoomPrecomputeOptions, be as assignClusterColors, W as boundingBoxFromCorners, _ as boundingBoxesOverlap, b6 as buildDirectoryGraph, bq as calculateNodeSize, c$ as calculateOverlayPosition, a4 as clampPosition, b5 as codeGraphToGraphology, bY as codeMapToReactFlowEdges, bX as codeMapToReactFlowNodes, bg as computeDirectoryForces, bt as computeEdges, bk as computeHierarchy, bC as computeLayout, bw as computeZoomLevels, V as createBoundingBox, cX as createOverlayPort, aM as createScopeColorGetter, aq as darkTheme, aB as darken, bb as detectCommunities, ab as detectLanguage, a2 as distance, bR as edgeTypes, a0 as expandBoundingBox, bW as formatLoc, bV as formatNumber, H as generateCallEdgeId, z as generateDirectoryId, y as generateFileId, G as generateImportEdgeId, aH as generateScopeDepthColors, E as generateSymbolId, d0 as getAnchorOffset, Q as getBasename, X as getBoundingBoxCenter, bm as getChildScopes, bd as getClusterStats, aJ as getContrastRatio, bZ as getDefaultExpandedScopes, au as getDefaultTheme, K as getDirectory, ba as getDirectoryConnectionWeight, bi as getDirectoryPosition, bv as getEdgeLabel, bu as getEdgesAtZoomLevel, b7 as getEntityId, O as getExtension, bS as getFileIcon, N as getFilename, b9 as getFilesInDirectory, ad as getIconName, aI as getLuminance, aa as getMediumFileLabel, bf as getNodeCluster, b8 as getNodeKey, bB as getNodeOpacityAtLevel, bA as getNodeSizeAtLevel, bc as getNodesInCluster, R as getParentDirectories, T as getPathDepth, bj as getPositionsAtDepth, bn as getRootScopes, bl as getScopeByDirectoryId, aG as getScopeDepthColor, a9 as getShortFileLabel, bT as getSymbolIcon, bU as getSymbolKindLabel, aL as getTextColorForBackground, ar as getTheme, at as getThemeIds, bz as getVisibleEdges, bx as getVisibleNodes, by as getVisibleScopes, a7 as getZoomLevel, b_ as getZoomLevelFromZoom, d1 as graphToScreen, av as hexToRgb, ay as hslToHex, ax as hslToRgb, ac as isCodeFile, Y as isPointInBoundingBox, a3 as lerp, ap as lightTheme, aA as lighten, U as matchesPattern, aN as mergeTheme, aD as mix, bN as nodeTypes, J as normalizePath, bh as normalizePositions, bp as positionAllNodes, bo as positionNodesInScope, as as registerTheme, bs as removeAllOverlaps, br as removeOverlapsInScope, aw as rgbToHex, az as rgbToHsl, aF as rgbaToCss, aC as saturate, a5 as scaleSize, d2 as screenToGraph, aK as shouldUseDarkText, a1 as shrinkBoundingBox, a8 as truncateLabel, a6 as uniformPadding, $ as unionBoundingBoxes, bH as useCurrentTheme, bI as useIsDarkTheme, cd as useLayout, ce as useOverlayPort, bG as useTheme, aE as withOpacity } from './useOverlayPort-dGxZQTue.mjs';
|
|
2
|
+
import 'graphology';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import '@xyflow/react';
|
|
5
|
+
import 'graphology-types';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'lucide-react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* CodeViz - Browser-safe exports (excludes Node.js-only analyzer)
|
|
11
|
+
*
|
|
12
|
+
* Use this entry point for browser environments:
|
|
13
|
+
* import { CodeMapComponent, useLayout } from 'codeviz/browser'
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
declare const VERSION = "0.1.0";
|
|
18
|
+
|
|
19
|
+
export { VERSION };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { cl as AbsolutePosition, cL as AgentStatus, cw as AgentWidgetOverlay, cE as AgentWidgetOverlayInput, bM as AggregateNodeComponent, A as AggregateNodeData, c6 as AggregateReactFlowNodeData, ck as AnchorPoint, s as AnimationConfig, cI as AnnotationContentType, cu as AnnotationOverlay, cC as AnnotationOverlayInput, ct as BadgeOverlay, cB as BadgeOverlayInput, cH as BadgeSize, cG as BadgeVariant, cq as BaseOverlay, B as BoundingBox, bQ as BundledEdgeComponent, cb as BundledEdgeData, cS as CalculatedPosition, C as CallEdge, bP as CallEdgeComponent, ca as CallEdgeData, aU as ClusteringOptions, aV as ClusteringResult, i as CodeGraph, p as CodeMap, bD as CodeMapComponent, t as CodeMapConfig, b$ as CodeMapProps, h as CodebaseMetadata, ag as ColorPalette, b3 as ComputeLayoutOptions, cr as CursorOverlay, cz as CursorOverlayInput, w as DEFAULT_ANIMATION_CONFIG, x as DEFAULT_CODEMAP_CONFIG, v as DEFAULT_LAYOUT_CONFIG, u as DEFAULT_ZOOM_LEVELS, aQ as DirectoryEdgeAttributes, aW as DirectoryForceOptions, aX as DirectoryForceResult, aT as DirectoryGraphResult, D as DirectoryMetrics, e as DirectoryNode, cv as DocumentOverlay, cD as DocumentOverlayInput, cK as DocumentStatus, cJ as DocumentType, aj as EdgeColors, cU as EdgePath, cn as EdgePosition, b0 as EdgeRoutingOptions, c3 as EdgeType, aR as EntityIdMapping, F as FileMetrics, d as FileNode, bJ as FileNodeComponent, c4 as FileNodeData, bE as Flow, c0 as FlowProps, a_ as ForcePositioningOptions, aP as GraphEdgeAttributes, aO as GraphNodeAttributes, aS as GraphologyConversionResult, aY as HierarchyOptions, aZ as HierarchyResult, cs as HighlightOverlay, cA as HighlightOverlayInput, cF as HighlightStyle, cQ as IOverlayPort, I as ImportEdge, bO as ImportEdgeComponent, c9 as ImportEdgeData, L as LayoutConfig, cf as LayoutProgress, b4 as LayoutProgressCallback, o as MapEdge, n as MapEdgeType, k as MapNode, j as MapNodeData, M as MapNodeType, m as MapScope, l as MapScopeData, cT as NodeBounds, ai as NodeColors, cm as NodePosition, c2 as NodeType, a$ as NoverlapOptions, cx as Overlay, cN as OverlayBatchUpdate, cO as OverlayClickHandler, ak as OverlayColors, cM as OverlayFilter, cP as OverlayHoverHandler, cy as OverlayInput, cY as OverlayLayer, cR as OverlayLayerProps, cW as OverlayPort, co as OverlayPosition, cp as OverlayType, a as Padding, c_ as PortalOverlayLayer, P as Position, af as RGBAColor, ae as RGBColor, cc as ReactFlowEdgeData, c8 as ReactFlowNodeData, cZ as SVGOverlayLayer, ah as ScopeDepthColors, bK as ScopeNodeComponent, c7 as ScopeNodeData, c1 as ScopeNodeProps, S as Size, b as SourceLocation, f as SymbolKind, c as SymbolMetrics, g as SymbolNode, bL as SymbolNodeComponent, c5 as SymbolNodeData, am as Theme, an as ThemeContextValue, bF as ThemeProvider, ao as ThemeProviderProps, al as UIColors, cg as UseLayoutOptions, ch as UseLayoutResult, ci as UseOverlayPortOptions, cj as UseOverlayPortResult, cV as ViewportTransform, Z as ZoomLevel, r as ZoomLevelConfig, b2 as ZoomLevelData, q as ZoomLevelName, b1 as ZoomPrecomputeOptions, be as assignClusterColors, W as boundingBoxFromCorners, _ as boundingBoxesOverlap, b6 as buildDirectoryGraph, bq as calculateNodeSize, c$ as calculateOverlayPosition, a4 as clampPosition, b5 as codeGraphToGraphology, bY as codeMapToReactFlowEdges, bX as codeMapToReactFlowNodes, bg as computeDirectoryForces, bt as computeEdges, bk as computeHierarchy, bC as computeLayout, bw as computeZoomLevels, V as createBoundingBox, cX as createOverlayPort, aM as createScopeColorGetter, aq as darkTheme, aB as darken, bb as detectCommunities, ab as detectLanguage, a2 as distance, bR as edgeTypes, a0 as expandBoundingBox, bW as formatLoc, bV as formatNumber, H as generateCallEdgeId, z as generateDirectoryId, y as generateFileId, G as generateImportEdgeId, aH as generateScopeDepthColors, E as generateSymbolId, d0 as getAnchorOffset, Q as getBasename, X as getBoundingBoxCenter, bm as getChildScopes, bd as getClusterStats, aJ as getContrastRatio, bZ as getDefaultExpandedScopes, au as getDefaultTheme, K as getDirectory, ba as getDirectoryConnectionWeight, bi as getDirectoryPosition, bv as getEdgeLabel, bu as getEdgesAtZoomLevel, b7 as getEntityId, O as getExtension, bS as getFileIcon, N as getFilename, b9 as getFilesInDirectory, ad as getIconName, aI as getLuminance, aa as getMediumFileLabel, bf as getNodeCluster, b8 as getNodeKey, bB as getNodeOpacityAtLevel, bA as getNodeSizeAtLevel, bc as getNodesInCluster, R as getParentDirectories, T as getPathDepth, bj as getPositionsAtDepth, bn as getRootScopes, bl as getScopeByDirectoryId, aG as getScopeDepthColor, a9 as getShortFileLabel, bT as getSymbolIcon, bU as getSymbolKindLabel, aL as getTextColorForBackground, ar as getTheme, at as getThemeIds, bz as getVisibleEdges, bx as getVisibleNodes, by as getVisibleScopes, a7 as getZoomLevel, b_ as getZoomLevelFromZoom, d1 as graphToScreen, av as hexToRgb, ay as hslToHex, ax as hslToRgb, ac as isCodeFile, Y as isPointInBoundingBox, a3 as lerp, ap as lightTheme, aA as lighten, U as matchesPattern, aN as mergeTheme, aD as mix, bN as nodeTypes, J as normalizePath, bh as normalizePositions, bp as positionAllNodes, bo as positionNodesInScope, as as registerTheme, bs as removeAllOverlaps, br as removeOverlapsInScope, aw as rgbToHex, az as rgbToHsl, aF as rgbaToCss, aC as saturate, a5 as scaleSize, d2 as screenToGraph, aK as shouldUseDarkText, a1 as shrinkBoundingBox, a8 as truncateLabel, a6 as uniformPadding, $ as unionBoundingBoxes, bH as useCurrentTheme, bI as useIsDarkTheme, cd as useLayout, ce as useOverlayPort, bG as useTheme, aE as withOpacity } from './useOverlayPort-dGxZQTue.js';
|
|
2
|
+
import 'graphology';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import '@xyflow/react';
|
|
5
|
+
import 'graphology-types';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'lucide-react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* CodeViz - Browser-safe exports (excludes Node.js-only analyzer)
|
|
11
|
+
*
|
|
12
|
+
* Use this entry point for browser environments:
|
|
13
|
+
* import { CodeMapComponent, useLayout } from 'codeviz/browser'
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
declare const VERSION = "0.1.0";
|
|
18
|
+
|
|
19
|
+
export { VERSION };
|