diagrams-input-0.1.1: Parse raster and SVG files for diagrams
Copyright(c) 2015 Tillmann Vogt <tillk.vogt@googlemail.com>
LicenseBSD3
Maintainerdiagrams-discuss@googlegroups.com
Stabilitystable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Diagrams.SVG.Attributes

Description

 
Synopsis

Documentation

Classes of attributes

data NameSpaces Source #

Constructors

NSP 

Instances

Instances details
Show NameSpaces Source # 
Instance details

Defined in Diagrams.SVG.Attributes

General Parsing Functions

separatedBy :: Parser Text a -> Text -> Parser Text [a] Source #

Parsing content separated by something, e.g. ";" like in: "a;b;c;d;" or "a;b;c;d"

parsePoints :: RealFloat n => Text -> [(n, n)] Source #

parseTempl :: Parser a -> Maybe Text -> Maybe a Source #

a template that deals with the common parser errors

Transformations

applyTr :: (V a ~ V2, Transformable a, RealFloat (N a), Additive (V a), R2 (V a)) => [Transform (N a)] -> a -> a Source #

parseTr :: RealFloat n => Maybe Text -> [Transform n] Source #

Parsing the style attribute

applyStyleSVG :: (V a ~ V2, HasStyle a, Typeable (N a), RealFloat (N a)) => (t -> [SVGStyle (N a) Double]) -> t -> a -> a Source #

parseLengths :: Fractional n => Parser Text [LenPercent n] Source #

parseViewBox :: RealFloat n => Maybe Text -> Maybe Text -> Maybe Text -> Maybe (ViewBox n) Source #

Example: viewBox="0 0 100 30" Viewboxes establish a new viewport. Percentages (e.g. x="50%") only make sense with a viewport.

cssStylesFromMap :: (RealFloat n, RealFrac a, Floating a) => (HashMap Text (Tag b n), HashMap Text [(Text, Text)], HashMap Text (Gr n)) -> Text -> Maybe Text -> Maybe Text -> [SVGStyle n a] Source #

This function is called on every tag and returns a list of style-attributes to apply (if there is a rule that matches) TO DO: CSS2 + CSS3 selectors cssStylesFromMap :: (Read a, RealFloat a, RealFloat n) => HashMaps b n -> Text -> Maybe Text -> Maybe Text -> [(SVGStyle n a)]

p :: RealFloat n => (n, n) -> n -> Maybe Text -> n Source #

Given a minimum and maximum value of a viewbox (x or y-direction) and a maybe a Text value Parse this Text value as a length (with a unit) or a percentage relative to the viewbox (minx,maxx) If parsers fails return def

parseSpread :: Maybe Text -> SpreadMethod Source #

Example: spreadMethod="pad"

Parsing Colors

Parsing preserve aspect ratio

data AlignSVG Source #

Constructors

AlignXY Place Place

alignment in x and y direction

type Place Source #

Arguments

 = Double

A value between 0 and 1, where 0 is the minimal value and 1 the maximal value

data MeetOrSlice Source #

Constructors

Meet 
Slice 

data SVGStyle n a Source #

Instances

Instances details
Show (SVGStyle n a) Source # 
Instance details

Defined in Diagrams.SVG.Attributes

Methods

showsPrec :: Int -> SVGStyle n a -> ShowS #

show :: SVGStyle n a -> String #

showList :: [SVGStyle n a] -> ShowS #

data PresentationAttributes Source #

Constructors

PA 

Fields