Type to represent an SVG document fragment.
Moduleblaze-svg-0.3.7Haskell2010
Text.Blaze.Svg
- 2 types
- 28 values
- Packageblaze-svg-0.3.7
- Exports30
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceInternal.hs
Type to accumulate an SVG path.
SVG Path combinators
1 declarationConstruct 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"moveto" commands
Moveto
Moveto (relative)
"closepath" command
ClosePath
"lineto" commands
Lineto
Lineto (relative)
Horizontal lineto
Horizontal lineto (relative)
Vertical lineto
Vertical lineto (relative)
The cubic Bézier curve commands
Cubic Bezier curve
Cubic Bezier curve (relative)
Smooth Cubic Bezier curve
Smooth Cubic Bezier curve (relative)
The quadratic Bézier curve commands
Quadratic Bezier curve
Quadratic Bezier curve (relative)
Smooth Quadratic Bezier curve
Smooth Quadratic Bezier curve (relative)
Elliptical arc
aa :: Show a=> aRadius in the x-direction
-> aRadius in the y-direction
-> aThe rotation of the arc's x-axis compared to the normal x-axis
-> BoolDraw the smaller or bigger arc satisfying the start point
-> BoolTo mirror or not
-> aThe x-coordinate of the end point
-> aThe 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.
ar :: Show a=> aRadius in the x-direction
-> aRadius in the y-direction
-> aThe rotation of the arc's x-axis compared to the normal x-axis
-> BoolTrue to draw the larger of the two arcs satisfying constraints.
-> BoolTo mirror or not
-> aThe x-coordinate of the end point
-> aThe y-coordinate of the end point
-> Path
Elliptical Arc (relative)
SVG Transform combinators
7 declarationsSpecifies a translation by x and y
Specifies a rotation by rotate-angle degrees
Specifies a rotation by rotate-angle degrees about the given time rx,ry
Specifies a scale operation by x and y
Skew tansformation along x-axis
Skew tansformation along y-axis
Specifies a transform in the form of a transformation matrix