reflex-dom-svg-0.3.2.0: Reflex functions for SVG elements.

Safe HaskellNone
LanguageHaskell2010

Reflex.Dom.Widget.SVG.Types.SVG_Path

Description

Types and functions for constructing type-safe SVG <path> properties.

Synopsis

Documentation

data PathCommandType Source #

These are the commands to be used when building the d attribute for an SVG path element.

Constructors

MoveTo P

Pick up and move the drawing instrument to another position

LineTo P

Draw a straight line

Horizontal (Pos X)

Straight horizontal line

Vertical (Pos Y)

Straight vertical line

SmthQuadBez P

Smooth Quadratic Bezier Curve

QuadBez P P

Quadratic Bezier Curve using the given control points

SmthCubicBez P P

Smooth Cubic Bezier Curve with control points at the end

CubicBez P P P

Cubic Bezier Curve with beginning and end control points

ClosePath

Draw a straight line from the current position to the first point in the path.

data PathCommand Source #

To be able to describe a path command, we need to know the command you would like to use (and its inputs). As well as whether or not you're issuing a relative command, or an absolute one.

data PathCommandRelativity Source #

Indicates if a given command is expected to distances from the current position or be set coordinates. See the documentation for more.

Constructors

Relative

Input are considered distances relative to the current position

Absolute

Input is considered to be an absolute position

newtype SVG_Path Source #

A wrapper for a list of commands to describe a SVG path. An empty list of commands doesn't make sense, so you have to construct a NonEmpty list.

Constructors

D (NonEmpty PathCommand) 

newtype P Source #

For a bit of brevity we wrap a combined X,Y position in a tuple tucked in a newtype.

Constructors

P (Pos X, Pos Y) 
Instances
Eq P Source # 
Instance details

Defined in Reflex.Dom.Widget.SVG.Types.SVG_Path

Methods

(==) :: P -> P -> Bool #

(/=) :: P -> P -> Bool #

Show P Source # 
Instance details

Defined in Reflex.Dom.Widget.SVG.Types.SVG_Path

Methods

showsPrec :: Int -> P -> ShowS #

show :: P -> String #

showList :: [P] -> ShowS #

Wrapped P Source # 
Instance details

Defined in Reflex.Dom.Widget.SVG.Types.SVG_Path

Associated Types

type Unwrapped P :: * #

Methods

_Wrapped' :: Iso' P (Unwrapped P) #

P ~ t => Rewrapped P t Source # 
Instance details

Defined in Reflex.Dom.Widget.SVG.Types.SVG_Path

type Unwrapped P Source # 
Instance details

Defined in Reflex.Dom.Widget.SVG.Types.SVG_Path

type Unwrapped P = (Pos X, Pos Y)

_SmthQuadBez :: Prism' PathCommandType P Source #

Prism for a Smooth Quadradic Bezier Curve [MDN]

_QuadBez :: Prism' PathCommandType (P, P) Source #

Prism for a Quadradic Bezier Curve [MDN]

_SmthCubicBez :: Prism' PathCommandType (P, P) Source #

Prism for a Smooth Cubic Bezier Curve [MDN]

_CubicBez :: Prism' PathCommandType (P, P, P) Source #

Prism for a Cubic Bezier Curve [MDN]

_MoveTo :: Prism' PathCommandType P Source #

Prism for the 'M/m' command [MDN]

_LineTo :: Prism' PathCommandType P Source #

Prism for the 'L/l' command [MDN]

_Horizontal :: Prism' PathCommandType (Pos X) Source #

Prism for the 'H/h' command [MDN]

_Vertical :: Prism' PathCommandType (Pos Y) Source #

Prism for the 'V/v' command [MDN]

_ClosePath :: Prism' PathCommandType () Source #

Prism for the 'Z/z' command [MDN]

_PathComm :: Prism' PathCommand (PathCommandType, PathCommandRelativity) Source #

Prism for the PathCommand that encompasses the command and it's relativity.

_m :: Pos X -> Pos Y -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_M :: Pos X -> Pos Y -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_l :: Pos X -> Pos Y -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_L :: Pos X -> Pos Y -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_h :: Pos X -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_H :: Pos X -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_v :: Pos Y -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_V :: Pos Y -> PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_z :: PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

_Z :: PathCommand Source #

These are some short-hand functions to help in the construction of a PathCommand. Named to match their respective SVG equivalent.

makePathProps :: SVG_Path -> Map Text Text Source #

Convert a SVG_Path to a Map Text Text that includes the correctly formatted d attribute.

pathCommandToText :: PathCommand -> Text Source #

Take a given PathCommand and produce a Text that is intended for a d attribute of a <path> element.