Dot to Png
For fun I wasted some time creating diagrams using the dot language. It's pretty fast to get a diagram out, except that there are a lot of things you can't do, like make shadows or rounded and filled rectangles. With this dot code:
You can click on the image to see the SVG rendered in Firefox, if you use that. I wrote a little python program to call the dot command outputting the diagram as an SVG file. Then I used the batik-rasterizer to convert SVG into PNG. Unfortunately, dot doesn't do an excellent job on the SVG that it outputs. The biggest problem is the font ends up being the wrong size. Another small issues is that is uses instead of for it's rectangles. My little program fixes these issues and rounds rectangles and adds shadows to rectangles and ellipses.
digraph "User Clicks" {
node [
shape="rectangle"
style="filled"
]
server [label="Server"]
java [shape="ellipse" label="Java\nCode"]
provider [label="Service\nProvider"]
browser [label="Firefox"]
browser->server[label=<① AJAX Sends Session ID>];
server->java[label=<② Confirms Session ID>];
java->provider[label=<③ Makes HTTPS call>];
provider->java[label=<④ Results>];
java->server[label=<⑤ Results>];
server->browser[label=<⑥ Results>];
}
You can click on the image to see the SVG rendered in Firefox, if you use that. I wrote a little python program to call the dot command outputting the diagram as an SVG file. Then I used the batik-rasterizer to convert SVG into PNG. Unfortunately, dot doesn't do an excellent job on the SVG that it outputs. The biggest problem is the font ends up being the wrong size. Another small issues is that is uses
Comments