lucid-svg: DSL for SVG using lucid for HTML

[ bsd3, graphics, library ] [ Propose Tags ] [ Report a vulnerability ]

Easy to write SVG in the syle of lucid.


[Skip to Readme]

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, 0.7.2.0
Dependencies 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) [details]
License BSD-3-Clause
Copyright 2015 Jeffrey Rosenbluth
Author Jeffrey Rosenbluth
Maintainer ollie@ocharles.org.uk
Category Graphics
Home page http://github.com/ocharles/lucid-svg.git
Uploaded by OliverCharles at 2024-06-13T20:43:02Z
Distributions Debian:0.7.1
Reverse Dependencies 7 direct, 51 indirect [details]
Downloads 14074 total (71 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-06-13 [all 1 reports]

Readme for lucid-svg-0.7.2.0

[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