Created
June 13, 2018 03:40
-
-
Save rnagasam/b147db4c7c9ddbda685d032ed04c319a to your computer and use it in GitHub Desktop.
svg-builder example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Graphics.Svg | |
svg :: Element -> Element | |
svg content = doctype | |
<> with (svg11_ content) [Version_ <<- "1.1", Width_ <<- "300", Height_ <<- "200"] | |
contents :: Element | |
contents = | |
text_ [ X_ <<- "150", Y_ <<- "125", Font_size_ <<- "60" | |
, Text_anchor_ <<- "middle", Fill_ <<- "white" ] "SVG" | |
main :: IO () | |
main = do | |
print $ svg contents |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment