diff --git a/osc/main.py b/osc/main.py index 8a7b0ba..a28d70f 100644 --- a/osc/main.py +++ b/osc/main.py @@ -2,7 +2,11 @@ from graphviz import Digraph from pythonosc.dispatcher import Dispatcher from pythonosc.osc_server import BlockingOSCUDPServer -g = Digraph('G', filename='graph.gv', format='pdf') +edge_attrs = { + 'arrowhead': 'vee', +} + +g = Digraph('G', filename='graph.gv', format='pdf', engine='circo', strict=True, edge_attr = edge_attrs) # last vertex received v = -1 @@ -13,12 +17,14 @@ t = "" def print_vertex(address, *args): global v + global g v = args[args.index('vertex') + 1] if v == -1: + g = Digraph('G', filename='graph.gv', format='pdf', engine='circo', strict=True, edge_attr = edge_attrs) return g.node(str(v)) g.render("Test") - print(v) + print(args) def print_edge(address, *args): global v @@ -26,7 +32,8 @@ def print_edge(address, *args): global t w = args[args.index('w') + 1] t = args[args.index('edge_type') + 1] - print((v,w,t)) + print(args) + # print((v,w,t)) if v == -1 or w == -1: return g.edge(str(v), str(w))