haive.core.graph.state_graph.graph_visualizer¶
Enhanced graph visualization utilities for Haive graphs with automatic Agent detection and expansion.
This module provides comprehensive visualization that automatically detects nodes with Agent engines or nodes that are Agents themselves, expanding them to show their complete internal graph structure.
Classes¶
Information about a detected agent node. |
|
Enhanced visualization utilities with automatic Agent detection and expansion. |
|
Standardized node styles for consistent visualization. |
|
Context object for tracking visualization state. |
Module Contents¶
- class haive.core.graph.state_graph.graph_visualizer.AgentInfo¶
Information about a detected agent node.
- class haive.core.graph.state_graph.graph_visualizer.GraphVisualizer¶
Enhanced visualization utilities with automatic Agent detection and expansion.
Key features: - Detects nodes that are Agents or contain Agent engines - Recursively expands Agent graphs showing internal structure - Consistent styling with professional color scheme - Smart edge routing between parent and subgraphs - Handles nested agents and complex hierarchies
- classmethod debug_graph_structure(graph)¶
Debug helper to analyze graph structure.
- classmethod display_graph(graph, output_path=None, include_subgraphs=True, highlight_nodes=None, highlight_paths=None, save_png=False, width='100%', theme='base', subgraph_mode='cluster', show_default_branches=True, direction='TB', compact_mode=False, title=None, debug=False)¶
Generate and display graph with Agent expansion.
- Returns:
Generated Mermaid code
- Parameters:
- Return type:
- classmethod generate_mermaid(graph, include_subgraphs=True, highlight_nodes=None, theme='base', show_branch_labels=True, direction='TB', compact=False, max_depth=3, debug=False)¶
Generate a comprehensive Mermaid diagram with automatic Agent expansion.
- Parameters:
graph (Any) – The graph to visualize
include_subgraphs (bool) – Whether to expand Agent nodes
theme (str) – Mermaid theme
show_branch_labels (bool) – Whether to show labels on conditional branches
direction (str) – Graph direction (TB, LR, etc.)
compact (bool) – Use compact layout
max_depth (int) – Maximum depth for nested agent expansion
debug (bool) – Enable debug output
- Returns:
Complete Mermaid diagram string
- Return type:
- class haive.core.graph.state_graph.graph_visualizer.NodeStyle(*args, **kwds)¶
Bases:
enum.EnumStandardized node styles for consistent visualization.
- class haive.core.graph.state_graph.graph_visualizer.VisualizationContext¶
Context object for tracking visualization state.