lucid-svg: DSL for SVG using lucid for HTML

[ bsd3, graphics, library ] [ Propose Tags ]

[Skip to Readme]
Versions 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
Dependencies base (==4.7.*), blaze-builder (==0.3.*), lucid (>=2.8.1 && <2.9), text (==1.2.*), transformers (==0.4.*) [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 Tue Jan 27 15:39:47 UTC 2015
Distributions Debian:0.7.0.0, NixOS:0.7.0.0
Downloads 6023 total (52 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-01-27 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for lucid-svg-0.2.1

[back to package description]

lucid-svg Hackage

Simple DSL for writing SVG, base 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", fontSize_ "60", textAnchor_ "middle", fill_ "white"] "SVG"


main :: IO ()
main = do
  print $ svg contents

SVG