Graph Visualization
IWE provides powerful graph visualization capabilities through DOT format export, allowing you to create visual representations of your knowledge graph structure. This helps you understand the relationships between documents, sections, and references in your markdown collection.
Export Command
The iwe export dot command generates graph data in DOT format, which can be processed by Graphviz and other visualization tools.
Basic Usage
# Export all root documents
iwe export dot
# Export specific document by key
iwe export dot --key project-notes
# Export with depth limit
iwe export dot --depth 3Advanced Visualization with Headers
Use the --include-headers flag to create detailed visualizations that show document structure with sections grouped in colored subgraphs:
# Include sections and subgraphs
iwe export dot --include-headers
# Detailed view of specific document
iwe export dot --key documentation --include-headers
# Combined with depth limit
iwe export dot --key meetings --depth 2 --include-headersVisualization Modes
Basic Mode (Default)
Shows document-to-document relationships with clean node styling:
digraph G {
rankdir=LR
fontname=Verdana
1[label="Project Notes",fillcolor="#ffeaea",fontsize=16,shape=note,style=filled]
2[label="Meeting Notes",fillcolor="#f6e5ee",fontsize=16,shape=note,style=filled]
1 -> 2 [color="#38546c66",arrowhead=normal,penwidth=1.2]
}Detailed Mode (–include-headers)
Shows document structure with sections grouped in colored subgraphs:
digraph G {
rankdir=LR
1[label="Project Notes",shape=note,style=filled]
2[label="Introduction",shape=plain]
3[label="Requirements",shape=plain]
subgraph cluster_0 {
labeljust="l"
style=filled
color="#fff9de"
fillcolor="#fff9de"
2
3
}
2 -> 1 [arrowhead="empty",style="dashed"]
3 -> 1 [arrowhead="empty",style="dashed"]
}Key Features
- Color Coding: Each document key gets a unique, consistent color scheme
- Shape Differentiation: Documents use
noteshape, sections useplainshape - Subgraph Clustering: Sections are grouped in colored clusters with document keys
- Edge Styles: Different styles for document vs section relationships
- Automatic Layout: Left-to-right layout optimized for readability
Integration with Graphviz
Generate PNG Images
# Basic visualization
iwe export dot | dot -Tpng -o knowledge-graph.png
# Detailed with sections
iwe export dot --include-headers | dot -Tpng -o detailed-graph.png
# Focus on specific topic
iwe export dot --key project --include-headers | dot -Tpng -o project-structure.pngGenerate SVG for Web
# Scalable vector graphics
iwe export dot | dot -Tsvg -o interactive-graph.svg
# With better layout for complex graphs
iwe export dot --include-headers | neato -Tsvg -o network-view.svgDifferent Layout Engines
# Hierarchical layout (default)
iwe export dot | dot -Tpng -o hierarchical.png
# Force-directed layout
iwe export dot | neato -Tpng -o network.png
# Circular layout
iwe export dot | circo -Tpng -o circular.png
# Spring-based layout
iwe export dot | fdp -Tpng -o spring.pngFiltering and Focusing
By Document Key
# Show only documents related to 'meetings'
iwe export dot --key meetings --include-headers
# Multiple levels of related documents
iwe export dot --key architecture --depth 2By Content Depth
# Show only immediate relationships
iwe export dot --depth 1
# Show deeper connections
iwe export dot --depth 3 --include-headersWorkflow Examples
Daily Documentation Review
#!/bin/bash
# Generate today's knowledge graph
iwe export dot --include-headers > today.dot
dot -Tpng today.dot -o daily-review.png
open daily-review.png # macOSProject Structure Analysis
#!/bin/bash
# Analyze specific project structure
iwe export dot --key $PROJECT_NAME --include-headers | \
dot -Tsvg -o "project-${PROJECT_NAME}.svg"Knowledge Base Overview
#!/bin/bash
# Create multiple views of your knowledge base
iwe export dot > overview.dot
iwe export dot --include-headers > detailed.dot
# Generate both views
dot -Tpng overview.dot -o overview.png
dot -Tpng detailed.dot -o detailed.pngCustomization Tips
Layout Optimization
For large graphs, experiment with different Graphviz engines:
dot: Best for hierarchical structuresneato: Good for network-like relationshipsfdp: Spring model, useful for clustered datacirco: Circular layout for cyclic structures
Output Formats
Graphviz supports many output formats:
- PNG/JPG: For presentations and documents
- SVG: For interactive web displays
- PDF: For high-quality prints
- DOT: For further processing or debugging
Performance Considerations
- Use
--depthlimits for large knowledge bases - Filter by
--keyto focus on specific areas - Use
--include-headersfor detailed structure visualization when needed
Troubleshooting
Large Graphs
# Reduce complexity with depth limits
iwe export dot --depth 2 | dot -Tpng -o simplified.png
# Use different layout engine
iwe export dot | fdp -Tpng -o alternative-layout.pngMissing Graphviz
Install Graphviz on your system:
# macOS
brew install graphviz
# Ubuntu/Debian
sudo apt install graphviz
# Windows
winget install graphvizComplex Layouts
For complex graphs, try different approaches:
# Increase node separation
iwe export dot | dot -Tpng -Gnodesep=1.0 -o spaced.png
# Adjust DPI for clarity
iwe export dot | dot -Tpng -Gdpi=200 -o high-res.pngThe visualization feature makes IWE’s knowledge management capabilities tangible, helping you understand and navigate your documentation structure at a glance.