Visualize Graphs
Basic Usage
from hypergraph import Graph, node
@node(output_name="doubled")
def double(x: int) -> int:
return x * 2
@node(output_name="result")
def add_one(doubled: int) -> int:
return doubled + 1
graph = Graph([double, add_one])
graph.visualize()Parameters
graph.visualize(
depth=0, # How many nested graph levels to expand
theme="auto", # "dark", "light", or "auto"
show_types=False, # Show type annotations on nodes
separate_outputs=False, # Render outputs as separate DATA nodes
show_inputs=True, # Show INPUT/INPUT_GROUP nodes
show_bounded_inputs=False, # Include bound inputs when INPUT nodes are shown
filepath=None, # Save to HTML file instead of displaying
)depth — Expand nested graphs
depth — Expand nested graphstheme — Color scheme
theme — Color schemeshow_types — Type annotations
show_types — Type annotationsseparate_outputs — Output visibility
separate_outputs — Output visibilityshow_inputs — Root input visibility
show_inputs — Root input visibilityshow_bounded_inputs — Include bound inputs
show_bounded_inputs — Include bound inputsfilepath — Save to HTML
filepath — Save to HTMLNode Types in the Visualization
Node type
Visual style
Description
START and Entrypoints
Expanded Container Edge Routing
Works Offline
Last updated