Build a DAG and draw it in ASCII.
Example:
from langchain_core.runnables.graph_ascii import draw_ascii
vertices = {1: "1", 2: "2", 3: "3", 4: "4"}
edges = [
(source, target, None, None)
for source, target in [(1, 2), (2, 3), (2, 4), (1, 4)]
]
print(draw_ascii(vertices, edges))
+---+
| 1 |
+---+
* *
* *
* *
+---+ *
| 2 | *
+---+** *
* ** *
* ** *
* **
+---+ +---+
| 3 | | 4 |
+---+ +---+