lucid-svg: DSL for SVG using lucid for HTML

[ bsd3, graphics, library ] [ Propose Tags ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.1, 0.3, 0.4, 0.4.0.1, 0.4.0.2, 0.4.0.3, 0.4.0.4, 0.5.0.0, 0.6.0.0, 0.6.0.1, 0.7.0.0, 0.7.0.1, 0.7.1, 0.7.1.1
Dependencies base (>=4.5 && <4.9), blaze-builder (>=0.2 && <0.4), lucid (>=2.9 && <3.0), text (>=0.11 && <1.3), transformers (>=0.2 && <0.5) [details]
License BSD-3-Clause
Copyright 2015 Jeffrey Rosenbluth
Author Jeffrey Rosenbluth
Maintainer jeffrey.rosenbluth@gmail.com
Category Graphics
Home page http://github.com/jeffreyrosenbluth/lucid-svg.git
Uploaded by jeffreyrosenbluth at 2015-02-11T00:52:05Z
Distributions Debian:0.7.1
Reverse Dependencies 7 direct, 51 indirect [details]
Downloads 13674 total (62 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-02-12 [all 1 reports]

Readme for lucid-svg-0.4.0.2

[back to package description]

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