Oak Visualization Library
Advanced visualization and layout algorithms for Oak language constructs, including AST visualization, dependency graphs, and code structure diagrams.
🎯 Overview
Oak Visualization is a comprehensive library designed to create beautiful and informative visualizations of programming language constructs. Built on the solid foundation of oak-core, it provides advanced layout algorithms for trees, graphs, and geometric structures, enabling developers to visualize code structures, dependencies, and complex relationships.
✨ Features
- AST Visualization: Visualize Abstract Syntax Trees with customizable layouts and node styling.
- Dependency Graphs: Create complex dependency and relationship visualizations with automatic edge routing.
- Advanced Tree Layouts: Multiple algorithms including Hierarchical (Reingold-Tilford), Radial, and Force-Directed.
- Geometric Algorithms: Computational geometry for optimal node positioning and collision avoidance.
- Interactive HTML: Generate interactive visualizations with zoom, pan, and tooltip support.
- Multiple Output Formats: Export to SVG, PNG, and interactive HTML.
🚀 Quick Start
Basic example using oak-core integration:
use ;
use RedNode;
📋 Visualization Examples
Custom Tree Construction
use ;
let mut root = new
.with_child
.with_child;
let layout = new
.with_algorithm
.with_spacing;
let svg = layout.visualize?;
Dependency Graph with Force-Directed Layout
use ;
let mut graph = new;
graph.add_node;
graph.add_node;
graph.add_edge;
let svg = new
.with_algorithm
.with_repulsion
.visualize?;
🔧 Advanced Features
Custom Styling
use ;
let style = new
.with_node_style;
let layout = new.with_style;
Interactive Features
use ;
let features = InteractiveFeatures ;
let html = new
.with_interactive_features
.render_visualization?;
🏗️ Layout Algorithms
- Hierarchical: Optimized Reingold-Tilford algorithm for compact tree layouts.
- Radial: Circular layouts for large trees to maximize space efficiency.
- Force-Directed: Physical simulation (Spring-Embedder) for organic graph structures.
- Sugiyama: Layered graph drawing for Directed Acyclic Graphs (DAGs).
📊 Performance
- Efficient Layouts: O(N log N) or O(N) complexity for most tree layout algorithms.
- Parallel Processing: Layout computations for large graphs can be parallelized.
- Incremental Updates: Support for updating existing visualizations with minimal re-computation.
- Low Memory Footprint: Uses optimized geometric primitives and minimal intermediate allocations.
🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Oak Visualization - Bringing code structure to life 🚀