Why is my svg output huge even for very small graphs (4 nodes)?
Adding bb, size, or viewport arguments has no effect.
Similarly using layout engines dot or circo.
Here’s the svg header for a 4 node graph laid out by dot:
<svg width="1375pt" height="1422pt"
viewBox="1152.00 1152.00 1578.00 1692.00" .... etc.
I can constrain it somewhat when displaying the svg in a web page by using width= and height= arguments on the object or img tag that I use to display the svg, but that’s a hack, and the margin around the graph is still too large.
I don’t see any harm in our someday adding dimensions to input units (e.g. 2.0i, 100px, 18pt, etc.) as this could be done in way that is completely backward compatible and it might be constructive.
@schmoo2k That solved it, and the observable link saves a lot of time.
@scnorth That would be very welcome to have. As a result of this error, I’m making a note to self to be more diligent about commenting code that generates dot source as to what units values are in, but your solution would be self-documenting.
Also, some units (mindist) have to be deduced by their default values, since the doc doesn’t explicitly say what the units are.