@hackage lucid-svg0.7.2.0
DSL for SVG using lucid for HTML
Installation
Dependencies (5)
- base >=4.5 && <5
- blaze-builder >=0.2 && <0.5
- lucid >=2.9.2 && <3.0
- text >=0.11 && <1.3 || >=2 && <2.2
- transformers >=0.2 && <0.7 Show all…
Dependents (9)
@hackage/web-rep, @hackage/diagrams-svg, @hackage/chart-svg, @hackage/acme-everything, @hackage/lp-diagrams-svg, @hackage/diagrams-builder, Show all…
lucid-svg 
Simple DSL for writing SVG, based on lucid
Example
{-# LANGUAGE OverloadedStrings #-}
import Lucid.Svg
svg :: Svg () -> Svg ()
svg content = do
doctype_
with (svg11_ content) [width_ "300" , height_ "200"]
contents :: Svg ()
contents = do
rect_ [width_ "100%", height_ "100%", fill_ "red"]
circle_ [cx_ "150", cy_ "100", r_ "80", fill_ "green"]
text_ [x_ "150", y_ "125", font_size_ "60", text_anchor_ "middle", fill_ "white"] "SVG"
main :: IO ()
main = do
print $ svg contents
