Adding Graphviz plugin to this Blog

I would like to embed diagrams like the one below into my articles so now I can. There’s a small problem with it though and that’s that I cannot edit my article in ‘visual’ mode anymore. This is because as soon as I hit the ‘Visual’ tab the > character gets modified. I’ve imported the eht-graphviz wordpress plugin in my own opensource trac/subversion and filed a bug for it. Should the author of the plugin or anybody else ever want to see my local fixes, they are right here

TFO Graphviz Demo











The bug/feature turned out to be easily fixed as I only needed to add a simple str_replace line in the Graphviz.php file that replaces any > occurences within the graphviz section with the literal > before writing out the dot file for graphviz. There are some other small changes I intend to do while I'm on the subject as I don't really like the current behaviour of black lines on a white background. I think it's relatively easy to add that to the diagram code itself but I could also just make it a default in the plugin, which I added as an enhancement in Trac.

I also noticed that the ‘name’ that’s being used in the plugin tag gets used as filename for the dot file, which causes errors if there are spaces in it. This should not be a real problem were it not that the generated digraph name also gets used as a label for the generated image, which you sometimes want to contain some spaces.  I’ve added an enhancement ticket in Trac for this as well.

More Coding

If you enjoyed reading this article you might be interested in reading some more articles in the Coding category on 3DN Techblog:

email

About Fred Leeflang

Hoi! Ik ben de website beheerder van de Forza website.