svg-tree-0.6.2.4: SVG file loader and serializer

Safe HaskellNone
LanguageHaskell2010

Graphics.Svg.Types

Contents

Description

This module define all the types used in the definition of a svg scene.

Most of the types are lensified.

Synopsis

Basic building types

type Coord = Double Source #

Basic coordinate type.

data Origin Source #

Tell if a path command is absolute (in the current user coordiante) or relative to the previous poitn.

Constructors

OriginAbsolute

Next point in absolute coordinate

OriginRelative

Next point relative to the previous

Instances
Eq Origin Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Origin Source # 
Instance details

Defined in Graphics.Svg.Types

type Point = (Number, Number) Source #

Possibly context dependant point.

type RPoint = V2 Coord Source #

Real Point, fully determined and not dependant of the rendering context.

data PathCommand Source #

Path command definition.

Constructors

MoveTo !Origin ![RPoint]

M or m command

LineTo !Origin ![RPoint]

Line to, L or l Svg path command.

HorizontalTo !Origin ![Coord]

Equivalent to the H or h svg path command.

VerticalTo !Origin ![Coord]

Equivalent to the V or v svg path command.

CurveTo !Origin ![(RPoint, RPoint, RPoint)]

Cubic bezier, C or c command

SmoothCurveTo !Origin ![(RPoint, RPoint)]

Smooth cubic bezier, equivalent to S or s command

QuadraticBezier !Origin ![(RPoint, RPoint)]

Quadratic bezier, Q or q command

SmoothQuadraticBezierCurveTo !Origin ![RPoint]

Quadratic bezier, T or t command

EllipticalArc !Origin ![(Coord, Coord, Coord, Bool, Bool, RPoint)]

Eliptical arc, A or a command.

EndPath

Close the path, Z or z svg path command.

Instances
Eq PathCommand Source # 
Instance details

Defined in Graphics.Svg.Types

Show PathCommand Source # 
Instance details

Defined in Graphics.Svg.Types

data Transformation Source #

Describe the content of the transformation attribute. see _transform and transform.

Constructors

TransformMatrix !Coord !Coord !Coord !Coord !Coord !Coord

Directly encode the translation matrix.

Translate !Double !Double

Translation along a vector

Scale !Double !(Maybe Double)

Scaling on both axis or on X axis and Y axis.

Rotate !Double !(Maybe (Double, Double))

Rotation around `(0, 0)` or around an optional point.

SkewX !Double

Skew transformation along the X axis.

SkewY !Double

Skew transformation along the Y axis.

TransformUnknown

Unkown transformation, like identity.

data ElementRef Source #

Correspond to the possible values of the the attributes which are either none or `url(#elem)`

Constructors

RefNone

Value for none

Ref String

Equivalent to `url()` attribute.

Instances
Eq ElementRef Source # 
Instance details

Defined in Graphics.Svg.Types

Show ElementRef Source # 
Instance details

Defined in Graphics.Svg.Types

data CoordinateUnits Source #

Define the possible values of various *units attributes used in the definition of the gradients and masks.

Constructors

CoordUserSpace

userSpaceOnUse value

CoordBoundingBox

objectBoundingBox value

Building helpers

toPoint :: Number -> Number -> Point Source #

Little helper function to build a point.

serializeNumber :: Number -> String Source #

Encode the number to string which can be used in a CSS or a svg attributes.

serializeTransformation :: Transformation -> String Source #

Convert the Transformation to a string which can be directly used in a svg attributes.

serializeTransformations :: [Transformation] -> String Source #

Transform a list of transformations to a string for svg transform attributes.

Drawing control types

data Cap Source #

Describe how the line should be terminated when stroking them. Describe the values of the `stroke-linecap` attribute. See _strokeLineCap

Constructors

CapRound

End with a round (round value)

CapButt

Define straight just at the end (butt value)

CapSquare

Straight further of the ends (square value)

Instances
Eq Cap Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Cap Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

showsPrec :: Int -> Cap -> ShowS #

show :: Cap -> String #

showList :: [Cap] -> ShowS #

data LineJoin Source #

Define the possible values of the `stroke-linejoin` attribute. see _strokeLineJoin

Constructors

JoinMiter

miter value

JoinBevel

bevel value

JoinRound

round value

Instances
Eq LineJoin Source # 
Instance details

Defined in Graphics.Svg.Types

Show LineJoin Source # 
Instance details

Defined in Graphics.Svg.Types

data Tree Source #

Main type for the scene description, reorient to specific type describing each tag.

Instances
Eq Tree Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Tree Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

showsPrec :: Int -> Tree -> ShowS #

show :: Tree -> String #

showList :: [Tree] -> ShowS #

CssMatcheable Tree Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Tree Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Tree Source # 
Instance details

Defined in Graphics.Svg.Types

data Number Source #

Encode complex number possibly dependant to the current render size.

Constructors

Num Double

Simple coordinate in current user coordinate.

Px Double

With suffix "px"

Em Double

Number relative to the current font size.

Percent Double

Number relative to the current viewport size.

Pc Double 
Mm Double

Number in millimeters, relative to DPI.

Cm Double

Number in centimeters, relative to DPI.

Point Double

Number in points, relative to DPI.

Inches Double

Number in inches, relative to DPI.

Instances
Eq Number Source # 
Instance details

Defined in Graphics.Svg.CssTypes

Methods

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

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

Show Number Source # 
Instance details

Defined in Graphics.Svg.CssTypes

data Spread Source #

Define the possible values for the spreadMethod values used for the gradient definitions.

Constructors

SpreadRepeat

reapeat value

SpreadPad

pad value

SpreadReflect

`reflect value`

Instances
Eq Spread Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Spread Source # 
Instance details

Defined in Graphics.Svg.Types

data Texture Source #

Describe the different value which can be used in the fill or stroke attributes.

Constructors

ColorRef PixelRGBA8

Direct solid color (rgb)

TextureRef String

Link to a complex texture (url(#name))

FillNone

Equivalent to the none value.

Instances
Eq Texture Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Texture Source # 
Instance details

Defined in Graphics.Svg.Types

data FillRule Source #

Describe the possile filling algorithms. Map the values of the `fill-rule` attributes.

Constructors

FillEvenOdd

Correspond to the evenodd value.

FillNonZero

Correspond to the nonzero value.

Instances
Eq FillRule Source # 
Instance details

Defined in Graphics.Svg.Types

Show FillRule Source # 
Instance details

Defined in Graphics.Svg.Types

data FontStyle Source #

Classify the font style, used to search a matching font in the FontCache.

Instances
Eq FontStyle Source # 
Instance details

Defined in Graphics.Svg.Types

Show FontStyle Source # 
Instance details

Defined in Graphics.Svg.Types

type Dpi = Int Source #

Alias describing a "dot per inch" information used for size calculation (see toUserUnit).

class WithDefaultSvg a where Source #

Define an empty 'default' element for the SVG tree. It is used as base when parsing the element from XML.

Methods

defaultSvg :: a Source #

The default element.

Instances
WithDefaultSvg Pattern Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg ClipPath Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Mask Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg RadialGradient Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg LinearGradient Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Marker Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Tree Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Text Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg TextPath Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg TextSpan Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg TextInfo Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Use Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Image Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg MeshGradient Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg MeshGradientRow Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg MeshGradientPatch Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg GradientStop Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Ellipse Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Circle Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Path Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Rectangle Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Line Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Polygon Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg PolyLine Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg PreserveAspectRatio Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg (Symbol a) Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg (Group a) Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

defaultSvg :: Group a Source #

Main type

documentSize :: Dpi -> Document -> (Int, Int) Source #

Calculate the document size in function of the different available attributes in the document.

Drawing attributes

data DrawAttributes Source #

This type define how to draw any primitives, which color to use, how to stroke the primitives and the potential transformations to use.

All these attributes are propagated to the children.

Constructors

DrawAttributes 

Fields

Instances
Eq DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

Show DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

Semigroup DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

Monoid DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

HasDrawAttributes DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

drawAttributes :: Lens' DrawAttributes DrawAttributes Source #

attrClass :: Lens' DrawAttributes [Text] Source #

attrId :: Lens' DrawAttributes (Maybe String) Source #

clipPathRef :: Lens' DrawAttributes (Last ElementRef) Source #

clipRule :: Lens' DrawAttributes (Last FillRule) Source #

fillColor :: Lens' DrawAttributes (Last Texture) Source #

fillOpacity :: Lens' DrawAttributes (Maybe Float) Source #

fillRule :: Lens' DrawAttributes (Last FillRule) Source #

fontFamily :: Lens' DrawAttributes (Last [String]) Source #

fontSize :: Lens' DrawAttributes (Last Number) Source #

fontStyle :: Lens' DrawAttributes (Last FontStyle) Source #

groupOpacity :: Lens' DrawAttributes (Maybe Float) Source #

markerEnd :: Lens' DrawAttributes (Last ElementRef) Source #

markerMid :: Lens' DrawAttributes (Last ElementRef) Source #

markerStart :: Lens' DrawAttributes (Last ElementRef) Source #

maskRef :: Lens' DrawAttributes (Last ElementRef) Source #

strokeColor :: Lens' DrawAttributes (Last Texture) Source #

strokeDashArray :: Lens' DrawAttributes (Last [Number]) Source #

strokeLineCap :: Lens' DrawAttributes (Last Cap) Source #

strokeLineJoin :: Lens' DrawAttributes (Last LineJoin) Source #

strokeMiterLimit :: Lens' DrawAttributes (Last Double) Source #

strokeOffset :: Lens' DrawAttributes (Last Number) Source #

strokeOpacity :: Lens' DrawAttributes (Maybe Float) Source #

strokeWidth :: Lens' DrawAttributes (Last Number) Source #

textAnchor :: Lens' DrawAttributes (Last TextAnchor) Source #

transform :: Lens' DrawAttributes (Maybe [Transformation]) Source #

WithDefaultSvg DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

class HasDrawAttributes a where Source #

Lenses for the DrawAttributes type.

Minimal complete definition

drawAttributes

Instances
HasDrawAttributes DrawAttributes Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

drawAttributes :: Lens' DrawAttributes DrawAttributes Source #

attrClass :: Lens' DrawAttributes [Text] Source #

attrId :: Lens' DrawAttributes (Maybe String) Source #

clipPathRef :: Lens' DrawAttributes (Last ElementRef) Source #

clipRule :: Lens' DrawAttributes (Last FillRule) Source #

fillColor :: Lens' DrawAttributes (Last Texture) Source #

fillOpacity :: Lens' DrawAttributes (Maybe Float) Source #

fillRule :: Lens' DrawAttributes (Last FillRule) Source #

fontFamily :: Lens' DrawAttributes (Last [String]) Source #

fontSize :: Lens' DrawAttributes (Last Number) Source #

fontStyle :: Lens' DrawAttributes (Last FontStyle) Source #

groupOpacity :: Lens' DrawAttributes (Maybe Float) Source #

markerEnd :: Lens' DrawAttributes (Last ElementRef) Source #

markerMid :: Lens' DrawAttributes (Last ElementRef) Source #

markerStart :: Lens' DrawAttributes (Last ElementRef) Source #

maskRef :: Lens' DrawAttributes (Last ElementRef) Source #

strokeColor :: Lens' DrawAttributes (Last Texture) Source #

strokeDashArray :: Lens' DrawAttributes (Last [Number]) Source #

strokeLineCap :: Lens' DrawAttributes (Last Cap) Source #

strokeLineJoin :: Lens' DrawAttributes (Last LineJoin) Source #

strokeMiterLimit :: Lens' DrawAttributes (Last Double) Source #

strokeOffset :: Lens' DrawAttributes (Last Number) Source #

strokeOpacity :: Lens' DrawAttributes (Maybe Float) Source #

strokeWidth :: Lens' DrawAttributes (Last Number) Source #

textAnchor :: Lens' DrawAttributes (Last TextAnchor) Source #

transform :: Lens' DrawAttributes (Maybe [Transformation]) Source #

class WithDrawAttributes a where Source #

Class helping find the drawing attributes for all the SVG attributes.

Methods

drawAttr :: Lens' a DrawAttributes Source #

Lens which can be used to read/write primitives.

Instances
WithDrawAttributes Pattern Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes ClipPath Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Mask Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Marker Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Tree Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Text Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Use Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Image Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes MeshGradient Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Ellipse Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Circle Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Path Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Rectangle Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Line Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Polygon Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes PolyLine Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes (Symbol a) Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes (Group a) Source # 
Instance details

Defined in Graphics.Svg.Types

SVG drawing primitives

Rectangle

data Rectangle Source #

Define a rectangle. Correspond to `<rectangle>` svg tag.

Constructors

Rectangle 

Fields

Line

data Line Source #

Define a simple line. Correspond to the `<line>` tag.

Constructors

Line 

Fields

Instances
Eq Line Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Line Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

HasLine Line Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Line Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Line Source # 
Instance details

Defined in Graphics.Svg.Types

Polygon

data Polygon Source #

Primitive decriving polygon composed of segements. Correspond to the `<polygon>` tag

Constructors

Polygon 

Fields

Polyline

data PolyLine Source #

This primitive describe an unclosed suite of segments. Correspond to the `<polyline>` tag.

Constructors

PolyLine 

Fields

Path

data Path Source #

Type mapping the `<path>` svg tag.

Constructors

Path 

Fields

Instances
Eq Path Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Path Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

HasPath Path Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Path Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Path Source # 
Instance details

Defined in Graphics.Svg.Types

class HasPath c_alhy where Source #

Lenses for the Path type

Minimal complete definition

path

Circle

data Circle Source #

Define a `<circle>`.

Constructors

Circle 

Fields

Ellipse

data Ellipse Source #

Define an `<ellipse>`

Constructors

Ellipse 

Fields

Mesh (gradient mesh)

data GradientPathCommand Source #

Description of path used in meshgradient tag

Constructors

GLine !Origin !(Maybe RPoint)

Line to, L or l Svg path command.

GCurve !Origin !RPoint !RPoint !(Maybe RPoint)

Cubic bezier, C or c command

GClose

Z command

data MeshGradient Source #

Define a `<meshgradient>` tag.

Constructors

MeshGradient 

Fields

Image

data Image Source #

Define an `<image>` tag.

Constructors

Image 

Fields

Use

data Use Source #

Define an `<use>` for a named content. Every named content can be reused in the document using this element.

Constructors

Use 

Fields

Grouping primitives

Group

data Group a Source #

Define a SVG group, corresponding `<g>` tag.

Constructors

Group 

Fields

Instances
Eq a => Eq (Group a) Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

(==) :: Group a -> Group a -> Bool #

(/=) :: Group a -> Group a -> Bool #

Show a => Show (Group a) Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

showsPrec :: Int -> Group a -> ShowS #

show :: Group a -> String #

showList :: [Group a] -> ShowS #

WithDefaultSvg (Group a) Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

defaultSvg :: Group a Source #

WithDrawAttributes (Group a) Source # 
Instance details

Defined in Graphics.Svg.Types

HasGroup (Group a) a Source # 
Instance details

Defined in Graphics.Svg.Types

Symbol

newtype Symbol a Source #

Define the `<symbol>` tag, equivalent to a named group.

Constructors

Symbol 

Fields

Instances
Eq a => Eq (Symbol a) Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

(==) :: Symbol a -> Symbol a -> Bool #

(/=) :: Symbol a -> Symbol a -> Bool #

Show a => Show (Symbol a) Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

showsPrec :: Int -> Symbol a -> ShowS #

show :: Symbol a -> String #

showList :: [Symbol a] -> ShowS #

WithDefaultSvg (Symbol a) Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes (Symbol a) Source # 
Instance details

Defined in Graphics.Svg.Types

groupOfSymbol :: Lens (Symbol s) (Symbol t) (Group s) (Group t) Source #

Lenses associated with the Symbol type.

Text related types

Text

data Text Source #

Define the global `<tag>` SVG tag.

Constructors

Text 

Fields

Instances
Eq Text Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

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

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

Show Text Source # 
Instance details

Defined in Graphics.Svg.Types

Methods

showsPrec :: Int -> Text -> ShowS #

show :: Text -> String #

showList :: [Text] -> ShowS #

HasText Text Source # 
Instance details

Defined in Graphics.Svg.Types

WithDefaultSvg Text Source # 
Instance details

Defined in Graphics.Svg.Types

WithDrawAttributes Text Source # 
Instance details

Defined in Graphics.Svg.Types

class HasText c_aorD where Source #

Lenses for the Text type.

Minimal complete definition

text

data TextAnchor Source #

Tell where to anchor the text, where the position given is realative to the text.

Constructors

TextAnchorStart

The text with left aligned, or start at the postion If the point is the * then the text will be printed this way:

 *THE_TEXT_TO_PRINT

Equivalent to the start value.

TextAnchorMiddle

The text is middle aligned, so the text will be at the left and right of the position:

  THE_TEXT*TO_PRINT

Equivalent to the middle value.

TextAnchorEnd

The text is right aligned.

  THE_TEXT_TO_PRINT*

Equivalent to the end value.

Instances
Eq TextAnchor Source # 
Instance details

Defined in Graphics.Svg.Types

Show TextAnchor Source # 
Instance details

Defined in Graphics.Svg.Types

textAt :: Point -> Text -> Text Source #

Little helper to create a SVG text at a given baseline position.

Text path

data TextPath Source #

Describe the `<textpath>` SVG tag.

Constructors

TextPath 

Fields

data TextPathSpacing Source #

Describe the content of the spacing text path attribute.

Constructors

TextPathSpacingExact

Map to the exact value.

TextPathSpacingAuto

Map to the auto value.

data TextPathMethod Source #

Describe the content of the method attribute on text path.

Constructors

TextPathAlign

Map to the align value.

TextPathStretch

Map to the stretch value.

Text span.

data TextSpanContent Source #

Define the content of a `<tspan>` tag.

Constructors

SpanText !Text

Raw text

SpanTextRef !String

Equivalent to a `<tref>`

SpanSub !TextSpan

Define a `<tspan>`

data TextSpan Source #

Define a `<tspan>` tag.

Constructors

TextSpan 

Fields

data TextInfo Source #

Define position information associated to `<text>` or `<tspan>` svg tag.

Constructors

TextInfo 

Fields

data TextAdjust Source #

Define the possible values of the lengthAdjust attribute.

Constructors

TextAdjustSpacing

Value spacing

TextAdjustSpacingAndGlyphs

Value spacingAndGlyphs

Instances
Eq TextAdjust Source # 
Instance details

Defined in Graphics.Svg.Types

Show TextAdjust Source # 
Instance details

Defined in Graphics.Svg.Types

Marker definition

data Marker Source #

Define the `<marker>` tag.

Constructors

Marker 

Fields

data Overflow Source #

Define the content of the markerUnits attribute on the Marker.

Constructors

OverflowVisible

Value visible

OverflowHidden

Value hidden

Instances
Eq Overflow Source # 
Instance details

Defined in Graphics.Svg.Types

Show Overflow Source # 
Instance details

Defined in Graphics.Svg.Types

data MarkerOrientation Source #

Define the orientation, associated to the orient attribute on the Marker

Constructors

OrientationAuto

Auto value

OrientationAngle Coord

Specific angle.

data MarkerUnit Source #

Define the content of the markerUnits attribute on the Marker.

Constructors

MarkerUnitStrokeWidth

Value strokeWidth

MarkerUnitUserSpaceOnUse

Value userSpaceOnUse

Instances
Eq MarkerUnit Source # 
Instance details

Defined in Graphics.Svg.Types

Show MarkerUnit Source # 
Instance details

Defined in Graphics.Svg.Types

Gradient definition

data GradientStop Source #

Define a color stop for the gradients. Represent the `<stop>` SVG tag.

Constructors

GradientStop 

Fields

Linear Gradient

data LinearGradient Source #

Define a `<linearGradient>` tag.

Constructors

LinearGradient 

Fields

Radial Gradient

data RadialGradient Source #

Define a `<radialGradient>` tag.

Constructors

RadialGradient 

Fields

Pattern definition

data Pattern Source #

Define a `<pattern>` tag.

Constructors

Pattern 

Fields

Mask definition

data Mask Source #

Define a SVG `<mask>` tag.

Constructors

Mask 

Fields

Clip path definition

Aspect Ratio description

data Alignment Source #

This type represent the align information of the preserveAspectRatio SVGattribute

Constructors

AlignNone

"none" value

AlignxMinYMin 
AlignxMidYMin

"xMidYMin" value

AlignxMaxYMin

"xMaxYMin" value

AlignxMinYMid

"xMinYMid" value

AlignxMidYMid

"xMidYMid" value

AlignxMaxYMid

"xMaxYMid" value

AlignxMinYMax

"xMinYMax" value

AlignxMidYMax

"xMidYMax" value

AlignxMaxYMax

"xMaxYMax" value

Instances
Eq Alignment Source # 
Instance details

Defined in Graphics.Svg.Types

Show Alignment Source # 
Instance details

Defined in Graphics.Svg.Types

data MeetSlice Source #

This type represent the "meet or slice" information of the preserveAspectRatio SVGattribute

Constructors

Meet 
Slice 
Instances
Eq MeetSlice Source # 
Instance details

Defined in Graphics.Svg.Types

Show MeetSlice Source # 
Instance details

Defined in Graphics.Svg.Types

MISC functions

isPathArc :: PathCommand -> Bool Source #

Tell if the path command is an EllipticalArc.

isPathWithArc :: Foldable f => f PathCommand -> Bool Source #

Tell if a full path contain an EllipticalArc.

nameOfTree :: Tree -> Text Source #

For every element of a svg tree, associate it's SVG tag name.

zipTree :: ([[Tree]] -> Tree) -> Tree -> Tree Source #

Map a tree while propagating context information. The function passed in parameter receive a list representing the the path used to go arrive to the current node.

mapTree :: (Tree -> Tree) -> Tree -> Tree Source #

Helper function mapping every tree element.

foldTree :: (a -> Tree -> a) -> a -> Tree -> a Source #

Fold all nodes of a SVG tree.

toUserUnit :: Dpi -> Number -> Number Source #

This function replace all device dependant units to user units given it's DPI configuration. Preserve percentage and "em" notation.

mapNumber :: (Double -> Double) -> Number -> Number Source #

Helper function to modify inner value of a number