title: Display a graph generated by Graphviz in tkinter python
body: <p>I wonder if there is a package or example that  display graphs that are created by Graphviz using PyGraphviz, in tkinter</p>
  <p>My investigation:</p>
  <p>My graphs can be rendered in to images without a problem. In the documentation of Graphviz, under <a href="https://graphviz.org/docs/outputs/" rel="nofollow noreferrer">Output Formats</a> I see that it is also capable to output as tk. It is descried as <a href="https://graphviz.org/docs/outputs/tk/" rel="nofollow noreferrer">text-based Tcl/Tk graphics primitives</a>. When I try setting the format in tk and render, it generates a .gv file and a .tk file. The .gv file simply saves the source in dot language. The .tk saves as something very similar to tkinter canvas methods.</p>
  <p>Code:</p>
  <pre><code>graph = ... #some graph source
  graph.format = 'tk'
  graph.render()
  </code></pre>
  <p>.tk file looks like:</p>
  <pre><code># Generated by graphviz version 2.49.3 (20211023.0002)
  # Title: G Pages: 1
  # node2513277377840
  $c create polygon 122.6667 5.3333 56 5.3333 56 80 122.6667 80 -fill #fefecd -width 0.5 -outline #444443 -tags {1node0x244a1f84030}
  $c create polygon 58.6667 26.6667 58.6667 8 120 8 120 26.6667 -fill #fefecd -width 1 -outline transparent -tags {0node0x244a1f84030}
  $c create line 58.6667 26.6667 120 26.6667 -fill #444443 -tags {0node0x244a1f84030}
  $c create text 60 17.95 -text {BSTNode} -fill #444443 -font {&quot;Times&quot; 11} -anchor w -tags {0node0x244a1f84030}
  $c create polygon 58.6667 29.3333 58.6667 26.6667 120 26.6667 120 29.3333 -fill #fefecd -width 1 -outline transparent -tags {0node0x244a1f84030}
  $c create polygon 58.6667 48 58.6667 29.3333 90.6667 29.3333 90.6667 48 -fill #fefecd -width 1 -outline transparent -tags {0node0x244a1f84030}
  $c create line 90.6667 48 90.6667 29.3333 -fill #444443 -tags {0node0x244a1f84030}
  ...
  </code></pre>
  <p>Questions:</p>
  <ol>
  <li><p>How would a graph generated by graphviz usually be displayed in tkinter?</p>
  </li>
  <li><p>Do I read and translate the .tk file to call corresponding methods in order for tkinter canvas to show the graph? Is that how it is meant to be done?</p>
  </li>
  <li><p>Is it better off just display the generated image file (svg,png,bmp,jpeg)?</p>
  </li>
  <li><p>Is there a way to do it without saving and reading files?</p>
  </li>
  </ol>