Shrinking SVG (Again) - Mailing list pgsql-docs

From Jürgen Purtz
Subject Shrinking SVG (Again)
Date
Msg-id af4a422b-b456-f381-a3f1-321e9ba805bb@purtz.de
Whole thread Raw
Responses Re: Shrinking SVG (Again)  (Jürgen Purtz <juergen@purtz.de>)
List pgsql-docs
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


Attachment

pgsql-docs by date:

Previous
From: Liudmila Mantrova
Date:
Subject: GSoD - a patch for Getting Started tutorial
Next
From: Laurenz Albe
Date:
Subject: Re: GSoD - a patch for Getting Started tutorial