# then I would recomend you to do so… let's cover that later # we do not need to CREATE nodes, but if you want to give them some custom style # we can get right into action by "drawing" edges between the nodes in our graph # let's add the relationship between the king and vassals # I'm going to hardcode stuff… sorry if that offends you # recursive function to traverse a multidimensional array…
#INSTALL PYDOT AND GRAPHVIZ HOW TO#
# but rather how to graph it, so I'm not going to work on some fancy # the idea here is not to cover how to represent the hierarchical data # first you create a new graph, you do that with pydot.Dot() Import pydot # import pydot or you're not going to get anywhere my friend ? Ok, let’s try an easy one, suppose you have a set of data that you want to represent in a hierarchical way… Say: King, Lords and Vassals… Let’s try to graph that with as little code as we can: In any case, let me provide you with a quick “getting started” tutorial guide on how this works.
#INSTALL PYDOT AND GRAPHVIZ INSTALL#
I’m using this on my Fedora 11 x86_64 box, so I just had to install pydot and easy_install handled the dependencies (it automatically downloaded and installed pyparsing), I am not sure what the requirements for Windows are... specially to get this running with py2exe, I’ll be blogging about that later. It was just what I needed, after a couple of experiments I could quickly generate “fantastic” visualizations with almost no extra effort. I wanted something simpler... lucky me, I stumbled into the wonderful project pydot. But these were complicated projects, because they generated some funky XML (correct me if I’m wrong) files that where later fed to graphviz and you had to mess a little with config options. I even hacked one of them to generate visualizations where each app had it’s own color. I quickly remembered a couple of projects that used Graphviz to generate visualizations of Django model definitions: DjangoGraphviz, and django-graphviz. I am already using wxPython for the application’s UI (it saved me a lot of time, and I learned a lot in the process, even implemented my own clone of the Aero Wizard layout used in Windows Vista and 7), so I tried to look for a way to integrate some other super powered library into my app. For instance, my application generated the following data: A -> BĪnd I needed a way to generate pretty graphs without too much headache! Hi, for my latest college assignment I had to find a way to visualize data that is interrelated.