Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use GraphViz and Racket

Is it possible to use the graphviz module to draw graphs in a racket frame (GUI)? If it's possible, would anyone a tutorial that shows how to use? Thank's

like image 666
chsms Avatar asked Oct 31 '22 06:10

chsms


1 Answers

Here is what I would do:

  • generate a dot-file (the Graphviz format) from the graph
  • use system to run grapviz on the file producing a png file
  • display the png in a racket frame

For actual code see: https://github.com/wangkuiyi/graphviz-server

Note that Stephen Chang's graph library has support for generating dot-files: http://pkg-build.racket-lang.org/doc/graph/index.html#%28part._.Graphviz%29

Update:

In order to make a graph editor you can save the graph data in a file, then let Graphviz output layout information in the dot-format: http://www.graphviz.org/doc/info/output.html#d:xdot1.4 Parse the output file and then redraw the graphs on screen.

like image 62
soegaard Avatar answered Nov 17 '22 05:11

soegaard