Skip to content

Commit 9d8c7b0

Browse files
committed
update
1 parent 6c2b286 commit 9d8c7b0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

visualize/directed_graph.svg

Lines changed: 1 addition & 1 deletion
Loading

visualize/undirected_graph.svg

Lines changed: 1 addition & 1 deletion
Loading

visualize/visualizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Visualizer:
99
def __init__(self):
1010
pass
1111

12-
def visualize(self, graph: Graph) -> List[GraphicObject]:
12+
def visualize(self, graph: Graph, layout='arc-diagram') -> List[GraphicObject]:
1313
"""Generates a list of GraphicObject instances based on the given graph.
1414
1515
Args:
@@ -25,7 +25,7 @@ def visualize(self, graph: Graph) -> List[GraphicObject]:
2525
y = 50
2626
positions[node] = (x, y)
2727
graphic_objects.append(Circle((x, y), 10, fill="white", stroke="black"))
28-
graphic_objects.append(Text(node, (x, y), style="text-anchor:middle"))
28+
graphic_objects.append(Text(node, (x, y), style="text-anchor:middle;baseline-shift: -25%;"))
2929
edges = []
3030
for u, vs in graph.edges.items():
3131
for v in vs:

0 commit comments

Comments
 (0)