The quickstart for the diagrams
package tells me to compile and run the following program:
{-# LANGUAGE NoMonomorphismRestriction #-}
import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine
main = mainWith (circle 1 :: Diagram B)
It them claims:
If you now view circle.svg in your favorite web browser, you should see
However, it doesn't. What I actually see is this:
Notice the cropped edges of the diagram. This is because the line has a width, but the image is being cropped with the assumption of the line having no width.
Here is the SVG output:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
xmlns="http://www.w3.org/2000/svg"
height="200.0000" stroke-opacity="1"
viewBox="0 0 200 200"
font-size="1"
width="200.0000"
xmlns:xlink="http://www.w3.org/1999/xlink"
stroke="rgb(0,0,0)"
version="1.1">
<defs></defs>
<g
stroke-linejoin="miter"
stroke-opacity="1.0"
fill-opacity="0.0"
stroke="rgb(0,0,0)"
stroke-width="0.8"
fill="rgb(0,0,0)"
stroke-linecap="butt"
stroke-miterlimit="10.0">
<path
d="M 200.0000,100.0000 c 0.0000,-55.2285 -44.7715,-100.0000 -100.0000 -100.0000c -55.2285,-0.0000 -100.0000,44.7715 -100.0000 100.0000c -0.0000,55.2285 44.7715,100.0000 100.0000 100.0000c 55.2285,0.0000 100.0000,-44.7715 100.0000 -100.0000Z"
/>
</g>
</svg>
How can I tell diagrams
to take the width of the line into account when defining the envelope of the diagram?