Our current policy says that we use the two tools Graphviz (drawing Graphs) and Ditaa (drawing ascii art) to generate SVG. The two tools are highly specialized and bound to their original purpose. I strongly believe that we will not be able to visualize more complex situations like this http://1.bp.blogspot.com/--CG_kXBFWzw/UgW5JROpbDI/AAAAAAAAAHc/9V8iwO1qluQ/s1600/arch.bmp or that: https://severalnines.com/sites/default/files/blog/node_5266/image5.jpg without using other tools, which are more flexible.

In the past, we had many discussions on this topic and didn't come to a final decision in favor on one single or a few number of such tools. However, we came to the important and very helpful conclusion to store two files per graphic: the original tool-specific (simple to read, diff-able) and the generated SVG version.

Out in the wild there is the open source tool SVGO https://github.com/svg/svgo. Its purpose is the generation of a small, easy to read SVG file out of any other SVG file by removing all the clutter, tools typically generate. In my opinion it's not perfect, but it has some strong advantages: the generated files are really small and nearly free of unnecessary information; it is flexible because a lot of parameters control the degree of optimization; it is extensible: missing features may be added by ourselves.


The SVGO tool is a node.js application. At Ubuntu you can install it:
  sudo apt install npm nodejs
  sudo npm install -g svgo
run it, e.g.:
  svgo test1_ink.svg --pretty --indent=2 --precision=2 --multipass --disable=removeComments  \
                     --output test1_svgo.svg
Please test it with your own examples.


In contrast to our previous policy the generated file is the diff-able, whereas the original one is hard to read.


Jürgen Purtz

Reply via email to