The DoCode Dashboard is a React-based web application that provides an interactive interface for exploring knowledge graphs generated by the core analyzer.
Technology Stack:
- React 18+ with TypeScript
- Vite for build tooling
- Graph visualization libraries
- Context-aware navigation
Start Command:
GRAPH_DIR=/path/to/.DoCode pnpm dev:dashboardThe root component that:
- Loads knowledge graph data from
GRAPH_DIR - Manages global state (selected nodes, search query, filters)
- Renders the graph visualization
- Handles keyboard shortcuts
Key State:
graphData: The loaded knowledge graph (nodes + edges)selectedNode: Currently selected node for detail viewsearchQuery: Current search stringfilterType: Active node type filter (file, function, class, etc.)
Modal component displaying available keyboard shortcuts.
Supported Shortcuts:
| Shortcut | Action |
|---|---|
Ctrl/Cmd + F |
Focus search bar |
Escape |
Close modals / Deselect node |
? |
Toggle keyboard shortcuts help |
F |
Open path finder |
G |
Toggle graph layout |
T |
Start guided tour |
Usage in Component:
<KeyboardShortcutsHelp
isOpen={showShortcuts}
onClose={() => setShowShortcuts(false)}
/>Modal for finding the shortest path between two code entities.
Features:
- Source node selector (dropdown or click on graph)
- Target node selector
- Visual path highlighting in graph
- Path length display
Usage:
- Press
For click "Find Path" button - Select source node (or click on graph)
- Select target node (or click on graph)
- View highlighted path in graph
Implementation:
<PathFinderModal
isOpen={showPathFinder}
graphData={graphData}
onClose={() => setShowPathFinder(false)}
onPathFound={(path) => highlightPath(path)}
/>| Type | Color | Description |
|---|---|---|
file |
Blue | Source code files |
function |
Green | Functions and methods |
class |
Purple | Classes and structs |
module |
Orange | Imported modules/packages |
variable |
Yellow | Global variables/constants |
| Type | Style | Description |
|---|---|---|
defines |
Solid line | File defines a function/class |
calls |
Dashed line | Function calls another function |
imports |
Dotted line | File imports a module |
extends |
Thick line | Class extends another class |
references |
Thin line | Generic reference/usage |
Click on Node:
- Highlights the node
- Shows detail panel (file path, line number, etc.)
- Filters connected edges
Double-Click:
- Zoom to fit the node and its neighbors
- Expand/collapse node details
Drag:
- Reposition nodes for better layout
- Custom graph arrangement
Scroll/Pinch:
- Zoom in/out
- Mouse wheel or touch gesture
Located at top of dashboard:
┌─────────────────────────────────┐
│ 🔍 Search nodes... [X] │
└─────────────────────────────────┘
Search Features:
- Real-time filtering as you type
- Searches node labels, IDs, and metadata
- Case-insensitive matching
- Highlight matching nodes in graph
Access via Ctrl/Cmd + F:
Search Scopes:
- All nodes (default)
- Files only
- Functions only
- Classes only
Filters:
- By file extension (
.ts,.js,.py, etc.) - By directory/path
- By connected node count
When a node is selected, the detail panel shows:
┌─────────────────────────────────┐
│ File: src/index.ts │
│ Type: file │
│ Path: /full/path/src/index.ts │
│ Language: TypeScript │
│ │
│ Connections: │
│ → 5 functions defined │
│ → 3 imports │
│ → 12 references │
│ │
│ [View Source] [Find Path] │
└─────────────────────────────────┘
The dashboard can provide a guided tour of your codebase:
Start Tour: Press T or click "Start Tour" button
Tour Steps:
- Overview of repository structure
- Main entry point explanation
- Key function walkthrough
- Dependency visualization
- Export/output explanation
Customization:
Tours can be customized per project by adding a .DoCode/tour.json file.
Switch between layouts:
- Force-directed (default): Physics-based layout
- Hierarchical: Top-down tree layout
- Radial: Circular layout
- Custom: Manual positioning
Toggle visibility:
- ☑ Show file nodes
- ☑ Show function nodes
- ☐ Show class nodes
- ☑ Show edge labels
- ☑ Animate transitions
- Dark (default): Easy on eyes
- Light: Better for presentations
- Auto: Follow system preference
For large codebases:
- Use filters to focus on specific areas
- Collapse unrelated subgraphs
- Use search instead of manual navigation
- Consider analyzing subdirectories separately
The dashboard implements lazy loading:
- Only renders visible nodes/edges
- Viewport culling for off-screen elements
- Progressive rendering for large graphs
Press ? in dashboard to see this:
DoCode Dashboard Shortcuts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Navigation:
? Show this help
Esc Close modal / Deselect
F Find path between nodes
G Toggle graph layout
T Start guided tour
Search:
Ctrl/Cmd+F Focus search bar
Enter Confirm search
↑/↓ Navigate search results
Graph:
+/- Zoom in/out
Drag Pan canvas
Scroll Zoom
Click Select node
Double-click Zoom to node
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
Quick Node Selection: Right-click a node for context menu (copy ID, find references, etc.)
-
Export Screenshot: Use browser's "Print" or "Screenshot" feature to save graph image
-
Share Findings: Copy node URLs (if supported) to share specific views
-
Compare Versions: Analyze different commits and compare graphs
-
Focus Mode: Press
F11for fullscreen dashboard view
- Check browser console (F12) for errors
- Verify
GRAPH_DIRpoints to valid.DoCode/directory - Ensure
knowledge-graph.jsonis valid JSON
- Filter out node types you don't need
- Zoom in to reduce rendered elements
- Close other browser tabs to free memory
- Clear search and retype
- Check if graph data loaded correctly
- Try refreshing the page
- Collaborative cursors (see others' selections in real-time)
- Time-travel (view graph at different commits)
- AI-powered explanations (why does this function exist?)
- Export to PDF/PNG/SVG
- Integration with IDE (VSCode extension)