Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
parse :: Text -> Either Text SvgElement Source #
Parse the input line-wise into various SVG elements.
g
paths:M413.654,295.115c0,0-1.283-13.865,12.717-19.615
- Line elements:
LINE x1 y1 x2 y2
- Circles:
CIRCLE cx cy r
- Ellipses:
ELLIPSE cx cy rx ry
This is not a full SVG parser, but in practice it’s much easier to edit an SVG source file to extract all g element contents to a line rather than writing a full-fledged SVG parser.
data SvgElement Source #
SvgLine Line | |
SvgCircle Circle | |
SvgEllipse Ellipse | |
SvgPath [[Either Line Bezier]] | List of poly-bezier-lines. |
Instances
Show SvgElement Source # | |
Defined in Geometry.SvgParser showsPrec :: Int -> SvgElement -> ShowS # show :: SvgElement -> String # showList :: [SvgElement] -> ShowS # | |
HasBoundingBox SvgElement Source # | |
Defined in Geometry.SvgParser boundingBox :: SvgElement -> BoundingBox Source # |