blaze-svg-0.3.0.0: SVG combinator library

Safe HaskellSafe-Infered

Text.Blaze.Svg.Internal

Synopsis

Documentation

type Svg = MarkupSource

Type to represent an SVG document fragment

type Path = State AttributeValue ()Source

Type to accumulate an SVG path

mkPath :: Path -> AttributeValueSource

Construct SVG path values using path instruction combinators. See simple example below of how you can use mkPath to specify a path using the path instruction combinators that are included as part of the same module

More information available at: http://www.w3.org/TR/SVG/paths.html

 import Text.Blaze.Svg11 ((!), mkPath, l, m)
 import qualified Text.Blaze.Svg11 as S
 import qualified Text.Blaze.Svg11.Attributes as A

 svgDoc :: S.Svg
 svgDoc = S.docTypeSvg ! A.version "1.1" ! A.width "150" ! A.height "100" $ do
  path ! d makeSimplePath

 makeSimplePath :: S.AttributeValue
 makeSimplePath =  mkPath do
   l 2 3
   m 4 5

m :: Show a => a -> a -> PathSource

Moveto

mr :: Show a => a -> a -> PathSource

Moveto (relative)

z :: PathSource

ClosePath

l :: Show a => a -> a -> PathSource

Lineto

lr :: Show a => a -> a -> PathSource

Lineto (relative)

h :: Show a => a -> PathSource

Horizontal lineto

hr :: Show a => a -> PathSource

Horizontal lineto (relative)

v :: Show a => a -> PathSource

Vertical lineto

vr :: Show a => a -> PathSource

Vertical lineto (relative)

c :: Show a => a -> a -> a -> a -> a -> a -> PathSource

Cubic Bezier curve

cr :: Show a => a -> a -> a -> a -> a -> a -> PathSource

Cubic Bezier curve (relative)

s :: Show a => a -> a -> a -> a -> PathSource

Smooth Cubic Bezier curve

sr :: Show a => a -> a -> a -> a -> PathSource

Smooth Cubic Bezier curve (relative)

q :: Show a => a -> a -> a -> a -> PathSource

Quadratic Bezier curve

qr :: Show a => a -> a -> a -> a -> PathSource

Quadratic Bezier curve (relative)

t :: Show a => a -> a -> PathSource

Smooth Quadratic Bezier curve

tr :: Show a => a -> a -> PathSource

Smooth Quadratic Bezier curve (relative)

translate :: Show a => a -> a -> AttributeValueSource

Specifies a translation by x and y

scale :: Show a => a -> a -> AttributeValueSource

Specifies a scale operation by x and y

rotate :: Show a => a -> AttributeValueSource

Specifies a rotation by rotate-angle degrees

rotateAround :: Show a => a -> a -> a -> AttributeValueSource

Specifies a rotation by rotate-angle degrees about the given time rx,ry

skewX, skewY :: Show a => a -> AttributeValueSource

Skew tansformation along x-axis

matrix :: Show a => a -> a -> a -> a -> a -> a -> AttributeValueSource

Specifies a transform in the form of a transformation matrix