HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleblaze-svg-0.3.7Haskell2010

Text.Blaze.Svg

Contents
  1. SVG Path combinators
  2. "moveto" commands
  3. "closepath" command
  4. "lineto" commands
  5. The cubic Bézier curve commands
  6. The quadratic Bézier curve commands
  7. Elliptical arc
  8. SVG Transform combinators
Synopsis
  • Packageblaze-svg-0.3.7
  • Exports30
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs

SVG Path combinators

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

"moveto" commands

"closepath" command

"lineto" commands

The cubic Bézier curve commands

valuec :: Show a => a -> a -> a -> a -> a -> a -> Path

Cubic Bezier curve

valuecr :: Show a => a -> a -> a -> a -> a -> a -> Path

Cubic Bezier curve (relative)

values :: Show a => a -> a -> a -> a -> Path

Smooth Cubic Bezier curve

valuesr :: Show a => a -> a -> a -> a -> Path

Smooth Cubic Bezier curve (relative)

The quadratic Bézier curve commands

valueqr :: Show a => a -> a -> a -> a -> Path

Quadratic Bezier curve (relative)

valuetr :: Show a => a -> a -> Path

Smooth Quadratic Bezier curve (relative)

Elliptical arc

valueaa
  1. :: Show a
  2. => a

    Radius in the x-direction

  3. -> a

    Radius in the y-direction

  4. -> a

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

  5. -> Bool

    Draw the smaller or bigger arc satisfying the start point

  6. -> Bool

    To mirror or not

  7. -> a

    The x-coordinate of the end point

  8. -> a

    The y-coordinate of the end point

  9. -> 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.

valuear
  1. :: Show a
  2. => a

    Radius in the x-direction

  3. -> a

    Radius in the y-direction

  4. -> a

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

  5. -> Bool

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

  6. -> Bool

    To mirror or not

  7. -> a

    The x-coordinate of the end point

  8. -> a

    The y-coordinate of the end point

  9. -> Path

Elliptical Arc (relative)

SVG Transform combinators