Inspired by asciiflow.com, this tool converts callgraph text into ascii text-based UML sequence diagram.
Check out todo for implementation progress and plan.
ClassA::func_1
ClassB::func_2
ClassB::func_3
ClassB::func_4
ClassB::func_2
ClassC
ClassB::func_3
to UML sequence:
┌──────┐ ┌──────┐ ┌──────┐
│ClassA│ │ClassB│ │ClassC│
└──────┘ └──────┘ └──────┘
func │ │ │
_1 │ │ │
──────►│ │ │
│ │ │
│ func_2 │ │
│──────────►│ │
│ │ │
│ │────┐ │
│ │ │ │
│ │ func_3 │
│ │ │ │
│ │◄───┘ │
│ │ │
│ │────┐ │
│ │ │ │
│ │ func_4 │
│ │ │ │
│ │◄───┘ │
│ │ │
│ func_2 │ │
│──────────►│ │
│ │ │
│ │ func_3 │
│ │◄──────────│
│ │ │
CallGraph: Statements?
Statements: ComponentIdentifier::function_identifier
with spaces in front of each statement indicating the calling stack depth;
with empty line separating callgraph sections to switch calling component, which
is automatically derived within each section.
ComponentIdentifier: string type without space, perferred in CamelCase
function_identifier: string type without space, preferred in snake_case
cat ./painter/test/callgraph.txt | cargo run
cargo build --release
cat ./painter/test/callgraph.txt | ./target/release/ascii_painter
# install (from repo dir)
cargo install --path ./ascii_painter
After installing ascii_painter, callgraph text in vim can be turned to graph as demonstrated below: