mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
PGF.VisualizeTree: add white background in the SVG rendering of dependency trees
This makes them look the same as SVG produced by graphviz
This commit is contained in:
@@ -637,6 +637,8 @@ latexDoc body =
|
|||||||
body,
|
body,
|
||||||
text "\\end{document}"]
|
text "\\end{document}"]
|
||||||
|
|
||||||
|
-- * SVG (see https://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html)
|
||||||
|
|
||||||
-- | Render LaTeX pictures as SVG
|
-- | Render LaTeX pictures as SVG
|
||||||
toSVG = concatMap toSVG1
|
toSVG = concatMap toSVG1
|
||||||
where
|
where
|
||||||
@@ -648,8 +650,12 @@ toSVG = concatMap toSVG1
|
|||||||
("viewBox",unwords (map show [0,0,x1,y0+5])),
|
("viewBox",unwords (map show [0,0,x1,y0+5])),
|
||||||
("version","1.1"),
|
("version","1.1"),
|
||||||
("xmlns","http://www.w3.org/2000/svg")]
|
("xmlns","http://www.w3.org/2000/svg")]
|
||||||
(concatMap draw cmds)]
|
(white_bg:concatMap draw cmds)]
|
||||||
where
|
where
|
||||||
|
white_bg =
|
||||||
|
Elem "rect" ["x".=0,"y".=0,"width".=x1,"height".=y0+5,
|
||||||
|
("fill","white")] []
|
||||||
|
|
||||||
draw (Put pos obj) = objectSVG pos obj
|
draw (Put pos obj) = objectSVG pos obj
|
||||||
|
|
||||||
objectSVG pos obj =
|
objectSVG pos obj =
|
||||||
|
|||||||
Reference in New Issue
Block a user