0

RGL supports writing DOT files from a graph, is it possible to create a graph from a DOT file?

(Obviously I can parse the DOT file myself and create a graph, but I'm wondering if this functionality exists already).

oz10
  • 153,307
  • 27
  • 93
  • 128
  • See `graph_from_dotfile(file)` in the examples. http://rgl.rubyforge.org/rgl/files/examples/examples_rb.html – onionjake Dec 23 '13 at 21:27
  • @onionjake. Thanks for the link, the example is a start. Ideally, I'd like the library to support this conversion (with properties as well as edges). – oz10 Dec 26 '13 at 21:01

1 Answers1

0

First you have to install graphviz which gives you the 'dot' command. Then you can run

dot -Tpng graph.dot > output.png

but I found that after installing dot the rgl method write_to_graphic_file automatically writes the image if you do something like

graph_obj.write_to_graphic_file('png')
James
  • 1,841
  • 1
  • 18
  • 23
  • Um, I don't mean an image of the graph. In your example, I want to load graph_obj from a dot file. – oz10 Aug 15 '13 at 05:29