blaze-svg-0.3.6.1: SVG combinator library

Safe HaskellNone
LanguageHaskell98

Text.Blaze.Svg.Internal

Synopsis

Documentation

type Svg = Markup #

Type to represent an SVG document fragment.

toSvg :: ToMarkup a => a -> Svg #

type Path = State AttributeValue () #

Type to accumulate an SVG path.

mkPath :: Path -> AttributeValue #

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
 S.path ! A.d makeSimplePath

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

m :: Show a => a -> a -> Path #

Moveto

mr :: Show a => a -> a -> Path #

Moveto (relative)

z :: Path #

ClosePath

l :: Show a => a -> a -> Path #

Lineto

lr :: Show a => a -> a -> Path #

Lineto (relative)

h :: Show a => a -> Path #

Horizontal lineto

hr :: Show a => a -> Path #

Horizontal lineto (relative)

v :: Show a => a -> Path #

Vertical lineto

vr :: Show a => a -> Path #

Vertical lineto (relative)

c :: Show a => a -> a -> a -> a -> a -> a -> Path #

Cubic Bezier curve

cr :: Show a => a -> a -> a -> a -> a -> a -> Path #

Cubic Bezier curve (relative)

s :: Show a => a -> a -> a -> a -> Path #

Smooth Cubic Bezier curve

sr :: Show a => a -> a -> a -> a -> Path #

Smooth Cubic Bezier curve (relative)

q :: Show a => a -> a -> a -> a -> Path #

Quadratic Bezier curve

qr :: Show a => a -> a -> a -> a -> Path #

Quadratic Bezier curve (relative)

t :: Show a => a -> a -> Path #

Smooth Quadratic Bezier curve

tr :: Show a => a -> a -> Path #

Smooth Quadratic Bezier curve (relative)

aa #

Arguments

:: Show a 
=> a

Radius in the x-direction

-> a

Radius in the y-direction

-> a

The rotation of the arc's x-axis compared to the normal x-axis

-> Bool

Draw the smaller or bigger arc satisfying the start point

-> Bool

To mirror or not

-> a

The x-coordinate of the end point

-> a

The y-coordinate of the end point

-> Path 

Elliptical Arc (absolute).

Note that this function is an alias for the function a, defined in Text.Blaze.Svg.Internal. aa is exported from Text.Blaze.Svg instead of a due to naming conflicts with a from Text.Blaze.SVG11.

a #

Arguments

:: Show a 
=> a

Radius in the x-direction

-> a

Radius in the y-direction

-> a

The rotation of the arc's x-axis compared to the normal x-axis

-> Bool

True to draw the larger of the two arcs satisfying constraints.

-> Bool

To mirror or not

-> a

The x-coordinate of the end point

-> a

The y-coordinate of the end point

-> Path 

Elliptical Arc (absolute). This is the internal definition for absolute arcs. It is not exported but instead exported as aa due to naming conflicts with a.

ar #

Arguments

:: Show a 
=> a

Radius in the x-direction

-> a

Radius in the y-direction

-> a

The rotation of the arc's x-axis compared to the normal x-axis

-> Bool

True to draw the larger of the two arcs satisfying constraints.

-> Bool

To mirror or not

-> a

The x-coordinate of the end point

-> a

The y-coordinate of the end point

-> Path 

Elliptical Arc (relative)

translate :: Show a => a -> a -> AttributeValue #

Specifies a translation by x and y

scale :: Show a => a -> a -> AttributeValue #

Specifies a scale operation by x and y

rotate :: Show a => a -> AttributeValue #

Specifies a rotation by rotate-angle degrees

rotateAround :: Show a => a -> a -> a -> AttributeValue #

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

skewX :: Show a => a -> AttributeValue #

Skew tansformation along x-axis

skewY :: Show a => a -> AttributeValue #

Skew tansformation along y-axis

matrix :: Show a => a -> a -> a -> a -> a -> a -> AttributeValue #

Specifies a transform in the form of a transformation matrix