Copyright | (c) 2015 Tillmann Vogt <tillk.vogt@googlemail.com> |
---|---|
License | BSD3 |
Maintainer | diagrams-discuss@googlegroups.com |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- initialStyles :: (V c ~ V2, Floating (N c), Typeable (N c), HasStyle c, Ord (N c)) => c -> c
- data CoreAttributes = CA {}
- data ConditionalProcessingAttributes = CPA {}
- data DocumentEventAttributes = DEA {}
- data GraphicalEventAttributes = GEA {
- onfocusin :: Maybe Text
- onfocusout :: Maybe Text
- onactivate :: Maybe Text
- onclick :: Maybe Text
- onmousedown :: Maybe Text
- onmouseup :: Maybe Text
- onmouseover :: Maybe Text
- onmousemove :: Maybe Text
- onmouseout :: Maybe Text
- onload :: Maybe Text
- data XlinkAttributes = XLA {}
- data FilterPrimitiveAttributes = FPA {}
- data NameSpaces = NSP {}
- separatedBy :: Parser Text a -> Text -> Parser Text [a]
- parseOne :: Parser Text b -> Text -> Parser Text b
- parseOne' :: Parser Text b -> Parser Text b
- compose :: [a -> a] -> a -> a
- parseDouble :: RealFloat n => Text -> n
- parseToDouble :: RealFloat n => Maybe Text -> Maybe n
- parsePoints :: RealFloat n => Text -> [(n, n)]
- parseTempl :: Parser a -> Maybe Text -> Maybe a
- parseIRI :: Parser Text (Text, Text)
- applyTr :: (V a ~ V2, Transformable a, RealFloat (N a), Additive (V a), R2 (V a)) => [Transform (N a)] -> a -> a
- parseTr :: RealFloat n => Maybe Text -> [Transform n]
- applyStyleSVG :: (V a ~ V2, HasStyle a, Typeable (N a), RealFloat (N a)) => (t -> [SVGStyle (N a) Double]) -> t -> a -> a
- parseStyles :: (RealFloat n, RealFrac a, Floating a) => Maybe Text -> (HashMap Text (Tag b n), CSSMap, HashMap Text (Gr n)) -> [SVGStyle n a]
- parseLengths :: Fractional n => Parser Text [LenPercent n]
- parseViewBox :: RealFloat n => Maybe Text -> Maybe Text -> Maybe Text -> Maybe (ViewBox n)
- parsePA :: (RealFloat n, RealFloat a, Read a) => PresentationAttributes -> HashMaps b n -> [SVGStyle n a]
- 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]
- fragment :: Maybe Text -> Maybe Text
- p :: RealFloat n => (n, n) -> n -> Maybe Text -> n
- parseSpread :: Maybe Text -> SpreadMethod
- parsePreserveAR :: Maybe Text -> Maybe PreserveAR
- data PreserveAR = PAR AlignSVG MeetOrSlice
- data AlignSVG = AlignXY Place Place
- type Place = Double
- data MeetOrSlice
- data SVGStyle n a
- = Fill (AlphaColour a)
- | FillTex (Texture n)
- | FillOpacity Double
- | FillRule FR
- | Opacity Double
- | Stroke (AlphaColour a)
- | StrokeTex (Texture n)
- | StrokeWidth (LenPercent n)
- | StrokeLineCap LineCap
- | StrokeLineJoin LineJoin
- | StrokeMiterLimit n
- | StrokeDasharray [LenPercent n]
- | StrokeOpacity Double
- | FontFamily String
- | FontStyle FStyle
- | FontVariant FVariant
- | FontWeight FWeight
- | FontStretch FStretch
- | FontSize (LenPercent n)
- | ClipPath (Path V2 n)
- | EmptyStyle
- data PresentationAttributes = PA {
- alignmentBaseline :: Maybe Text
- baselineShift :: Maybe Text
- clip :: Maybe Text
- clipPath :: Maybe Text
- clipRule :: Maybe Text
- color :: Maybe Text
- colorInterpolation :: Maybe Text
- colorInterpolationFilters :: Maybe Text
- colorProfile :: Maybe Text
- colorRendering :: Maybe Text
- cursor :: Maybe Text
- direction :: Maybe Text
- display :: Maybe Text
- dominantBaseline :: Maybe Text
- enableBackground :: Maybe Text
- fill :: Maybe Text
- fillOpacity :: Maybe Text
- fillRuleSVG :: Maybe Text
- filter :: Maybe Text
- floodColor :: Maybe Text
- floodOpacity :: Maybe Text
- fontFamily :: Maybe Text
- fntSize :: Maybe Text
- fontSizeAdjust :: Maybe Text
- fontStretch :: Maybe Text
- fontStyle :: Maybe Text
- fontVariant :: Maybe Text
- fontWeight :: Maybe Text
- glyphOrientationHorizontal :: Maybe Text
- glyphOrientationVertical :: Maybe Text
- imageRendering :: Maybe Text
- kerning :: Maybe Text
- letterSpacing :: Maybe Text
- lightingColor :: Maybe Text
- markerEnd :: Maybe Text
- markerMid :: Maybe Text
- markerStart :: Maybe Text
- mask :: Maybe Text
- opacity :: Maybe Text
- overflow :: Maybe Text
- pointerEvents :: Maybe Text
- shapeRendering :: Maybe Text
- stopColor :: Maybe Text
- stopOpacity :: Maybe Text
- strokeSVG :: Maybe Text
- strokeDasharray :: Maybe Text
- strokeDashoffset :: Maybe Text
- strokeLinecap :: Maybe Text
- strokeLinejoin :: Maybe Text
- strokeMiterlimit :: Maybe Text
- strokeOpacity :: Maybe Text
- strokeWidth :: Maybe Text
- textAnchor :: Maybe Text
- textDecoration :: Maybe Text
- textRendering :: Maybe Text
- unicodeBidi :: Maybe Text
- visibility :: Maybe Text
- wordSpacing :: Maybe Text
- writingMode :: Maybe Text
Documentation
initialStyles :: (V c ~ V2, Floating (N c), Typeable (N c), HasStyle c, Ord (N c)) => c -> c Source #
Inital styles, see: http://www.w3.org/TR/SVG/painting.html#FillProperty
Classes of attributes
data CoreAttributes Source #
data XlinkAttributes Source #
data NameSpaces Source #
Instances
Show NameSpaces Source # | |
Defined in Diagrams.SVG.Attributes showsPrec :: Int -> NameSpaces -> ShowS # show :: NameSpaces -> String # showList :: [NameSpaces] -> ShowS # |
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"
parseDouble :: RealFloat n => Text -> n Source #
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 #
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 #
parseStyles :: (RealFloat n, RealFrac a, Floating a) => Maybe Text -> (HashMap Text (Tag b n), CSSMap, HashMap Text (Gr n)) -> [SVGStyle n 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.
parsePA :: (RealFloat n, RealFloat a, Read a) => PresentationAttributes -> HashMaps b n -> [SVGStyle n a] Source #
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
parsePreserveAR :: Maybe Text -> Maybe PreserveAR Source #
data PreserveAR Source #
= Double | A value between 0 and 1, where 0 is the minimal value and 1 the maximal value |
data MeetOrSlice Source #
Fill (AlphaColour a) | |
FillTex (Texture n) | |
FillOpacity Double | |
FillRule FR | |
Opacity Double | |
Stroke (AlphaColour a) | |
StrokeTex (Texture n) | |
StrokeWidth (LenPercent n) | |
StrokeLineCap LineCap | |
StrokeLineJoin LineJoin | |
StrokeMiterLimit n | |
StrokeDasharray [LenPercent n] | |
StrokeOpacity Double | |
FontFamily String | |
FontStyle FStyle | |
FontVariant FVariant | |
FontWeight FWeight | |
FontStretch FStretch | |
FontSize (LenPercent n) | |
ClipPath (Path V2 n) | |
EmptyStyle |
data PresentationAttributes Source #
Instances
Show PresentationAttributes Source # | |
Defined in Diagrams.SVG.Tree showsPrec :: Int -> PresentationAttributes -> ShowS # show :: PresentationAttributes -> String # showList :: [PresentationAttributes] -> ShowS # |