capturegraph.procedures.exporting.visualizer
#
Procedure Visualization#
This module provides utilities for creating visual representations of procedure graphs using Graphviz. The visualizer converts procedure DAGs into flowcharts that help users understand workflow structure, data flow, and procedure dependencies.
The generated visualizations show: - Procedure nodes with their types and configurations - Data flow connections between procedures with input names - Sequential execution steps with step numbers - Hierarchical grouping options for complex workflows
procedure_to_graphviz(procedure, group_by_depth=False)
#
Converts a Procedure DAG into a Graphviz diagram for visualization.
Creates a directed graph showing the structure and data flow of a procedure workflow. Each procedure becomes a node showing its type, label, and settings. Edges show data flow (inputs) and control flow (sequential steps).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
procedure
|
Procedure
|
The root procedure to visualize (any procedure in the DAG) |
required |
group_by_depth
|
bool
|
Whether to visually group nodes by their depth level in the procedure hierarchy for better layout |
False
|
Returns:
| Type | Description |
|---|---|
Digraph
|
A Graphviz Digraph object that can be rendered to various formats |
Digraph
|
(PNG, SVG, PDF, etc.) |
Example
import capturegraph.procedures as cgp
# Create your procedure
my_procedure = my_capture_procedure()
# Generate visualization
graph = cgp.procedure_to_graphviz(my_procedure, group_by_depth=True)
# Render to file
graph.render('my_procedure', format='png', cleanup=True)
# Or view directly (if supported)
graph.view()
Source code in capturegraph-lib/capturegraph/procedures/exporting/visualizer.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |