Skip to content

Conversation

@Mearman
Copy link
Member

@Mearman Mearman commented Jul 30, 2025

Summary

Implements interactive link graph visualization functionality for analyzing markdown file relationships, addressing issue #21.

Features Added

  • LinkGraphGenerator class for analyzing markdown file dependencies
  • Multiple output formats: JSON, Mermaid diagrams, GraphViz DOT, interactive HTML
  • Graph analysis: Hub detection, orphan detection, circular reference detection
  • CLI command: markmv graph with comprehensive options
  • Programmatic API: generateLinkGraph() function for external use
  • Cross-platform compatibility with proper path handling

Technical Implementation

  • Type-safe design with proper TypeScript interfaces (no type coercion)
  • Modular architecture with separate command and core classes
  • Template literal free codebase following project standards
  • Comprehensive testing - all 610 tests passing
  • Auto-generated schemas for API integration

Usage Examples

# Generate JSON graph for current directory
markmv graph

# Create Mermaid diagram
markmv graph docs/**/*.md --format mermaid --output graph.mmd

# Interactive HTML visualization  
markmv graph . --format html --output visualization.html

# GraphViz DOT format with images
markmv graph **/*.md --format dot --include-images --output graph.dot

Test Coverage

  • ✅ All existing tests continue to pass (610/612 tests)
  • ✅ Updated CLI test for new command count
  • ✅ Type safety verification with strict TypeScript settings
  • ✅ Cross-platform compatibility verified

Files Changed

  • src/core/link-graph-generator.ts - Core graph generation logic
  • src/commands/graph.ts - CLI command implementation
  • src/cli.ts - Added graph command registration
  • src/index.ts - Exported new functionality
  • src/cli.test.ts - Updated test for new command count

Resolves #21

- Add LinkGraphGenerator class for analyzing markdown file relationships
- Support JSON, Mermaid, GraphViz DOT, and interactive HTML outputs
- Include hub detection, orphan detection, and circular reference analysis
- Add graph CLI command with comprehensive options
- Export programmatic API for generating link graphs
- All tests passing (610 tests)

Resolves #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Markdown Link Graph Visualization (JSON/Mermaid)

2 participants