diff options
| author | hallgren <hallgren@chalmers.se> | 2016-06-08 19:08:29 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2016-06-08 19:08:29 +0000 |
| commit | c9ea17d2931c63ca06fe6d5e0a0af74c332b6569 (patch) | |
| tree | d17f8be2b20bcc308a6859dd50ad002eea078ef4 /src/runtime/haskell | |
| parent | 8dfdee1e9af44e2dafb765db2d7b1e24b59c2928 (diff) | |
PGF.VisualizeTree: add white background in the SVG rendering of dependency trees
This makes them look the same as SVG produced by graphviz
Diffstat (limited to 'src/runtime/haskell')
| -rw-r--r-- | src/runtime/haskell/PGF/VisualizeTree.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime/haskell/PGF/VisualizeTree.hs b/src/runtime/haskell/PGF/VisualizeTree.hs index d274b7300..29e8d3de2 100644 --- a/src/runtime/haskell/PGF/VisualizeTree.hs +++ b/src/runtime/haskell/PGF/VisualizeTree.hs @@ -637,6 +637,8 @@ latexDoc body = body, text "\\end{document}"] +-- * SVG (see https://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html) + -- | Render LaTeX pictures as SVG toSVG = concatMap toSVG1 where @@ -648,8 +650,12 @@ toSVG = concatMap toSVG1 ("viewBox",unwords (map show [0,0,x1,y0+5])), ("version","1.1"), ("xmlns","http://www.w3.org/2000/svg")] - (concatMap draw cmds)] + (white_bg:concatMap draw cmds)] where + white_bg = + Elem "rect" ["x".=0,"y".=0,"width".=x1,"height".=y0+5, + ("fill","white")] [] + draw (Put pos obj) = objectSVG pos obj objectSVG pos obj = |
