lucid-svg

DSL for SVG using lucid for HTML http://github.com/jeffreyrosenbluth/lucid-svg.git

Version on this page:0.5.0.0
LTS Haskell 9.9:0.7.0.0
Stackage Nightly 2017-07-25:0.7.0.0
Latest on Hackage:0.7.0.0
BSD3 licensed by Jeffrey Rosenbluth
Maintained by jeffrey.rosenbluth@gmail.com

Module documentation for 0.5.0.0

lucid-svg Hackage

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

SVG

Used by 1 package:
comments powered byDisqus