aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graph.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/graph.py b/src/graph.py
index 9aecde1..6c8ab53 100644
--- a/src/graph.py
+++ b/src/graph.py
@@ -1,4 +1,4 @@
-import io
+import tkinter as tk
from graphviz import Digraph
import matplotlib.pyplot as plt
@@ -49,8 +49,13 @@ class Graph:
self.dot.edge(str(id(node1)), str(id(node2)) + node2._op)
def show(self):
- fp = io.BytesIO(self.dot.pipe(format='jpeg'))
- with fp:
- img = mpimg.imread(fp, format='jpeg')
- plt.imshow(img)
- plt.show()
+ root = tk.Tk()
+ root.title('float')
+
+ data = self.dot.pipe(format='png')
+ img = tk.PhotoImage(data=data, format='png')
+
+ panel = tk.Label(root, image=img)
+ panel.pack();
+
+ tk.mainloop()