hgeometry-svg-0.9.0.0: Writing geometric primitives from HGeometry as SVG Files

Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.Svg.Writer

Contents

Description

Description :

Write geometry to svg

Synopsis

Documentation

toSvgXML :: ToMarkup t => t -> ByteString Source #

Converts an element into a valid svg document (including doctype etc.) The size of the resulting svg is set to 800x600. Moreover, we flip the axes so that the origin is in the bottom-left.

printSvgXML :: ToMarkup t => t -> IO () Source #

Convert an element to Svg using toSvgXML and prints the resulting svg (as xml) output to stdout.

svgO :: ToMarkup a => a -> Svg Source #

Convert an element to Svg

toSvgXMLElem :: ToMarkup t => t -> ByteString Source #

Convert an element to Svg, and render this svg as xml. Note that the xml contains *only* this element.

printSvgXMLElem :: ToMarkup t => t -> IO () Source #

Convert an element to Svg, and prints the xml output to stdout.

toPath :: Real r => NonEmpty (Point 2 r :+ p) -> Path Source #

Dealing with attributes

applyAts :: Markup -> [(SvgF, AttributeValue)] -> Markup Source #

svgWriteAttrs :: (AllConstrained IpeToSvgAttr rs, RMap rs, RecordToList rs, ReifyConstraint ToValue (Attr f) rs, RecAll (Attr f) rs ToValue) => Attributes f rs -> [(SvgF, AttributeValue)] Source #

Functon to write all attributes in a Rec

writeAttrFunctions :: AllConstrained IpeToSvgAttr rs => Rec f rs -> Rec (Const (Maybe SvgF)) rs Source #

Writing Attribute names

writeAttrValues :: (ReifyConstraint ToValue (Attr f) rs, RMap rs, RecAll (Attr f) rs ToValue) => Rec (Attr f) rs -> Rec (Const (Maybe AttributeValue)) rs Source #

Writing the attribute values

toMaybeValue :: ToValue (Attr f at) => Attr f at -> Maybe AttributeValue Source #

type SvgF = AttributeValue -> Attribute Source #

class IpeToSvgAttr (a :: AttributeUniverse) where Source #

For the types representing attribute values we can get the name/key to use when serializing to ipe.

Methods

attrSvg :: proxy a -> Maybe SvgF Source #

Instances
IpeToSvgAttr Arrow Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Arrow -> Maybe SvgF Source #

IpeToSvgAttr Clip Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Clip -> Maybe SvgF Source #

IpeToSvgAttr Dash Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Dash -> Maybe SvgF Source #

IpeToSvgAttr Fill Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Fill -> Maybe SvgF Source #

IpeToSvgAttr FillRule Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy FillRule -> Maybe SvgF Source #

IpeToSvgAttr Gradient Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Gradient -> Maybe SvgF Source #

IpeToSvgAttr Layer Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Layer -> Maybe SvgF Source #

IpeToSvgAttr LineCap Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy LineCap -> Maybe SvgF Source #

IpeToSvgAttr LineJoin Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy LineJoin -> Maybe SvgF Source #

IpeToSvgAttr Matrix Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Matrix -> Maybe SvgF Source #

IpeToSvgAttr Opacity Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Opacity -> Maybe SvgF Source #

IpeToSvgAttr Pen Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Pen -> Maybe SvgF Source #

IpeToSvgAttr Pin Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Pin -> Maybe SvgF Source #

IpeToSvgAttr RArrow Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy RArrow -> Maybe SvgF Source #

IpeToSvgAttr Size Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Size -> Maybe SvgF Source #

IpeToSvgAttr Stroke Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Stroke -> Maybe SvgF Source #

IpeToSvgAttr Tiling Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Tiling -> Maybe SvgF Source #

IpeToSvgAttr Transformations Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Transformations -> Maybe SvgF Source #

Orphan instances

ToValue FillType Source # 
Instance details

Methods

toValue :: FillType -> AttributeValue

preEscapedToValue :: FillType -> AttributeValue

ToValue PinType Source # 
Instance details

Methods

toValue :: PinType -> AttributeValue

preEscapedToValue :: PinType -> AttributeValue

ToValue TransformationTypes Source # 
Instance details

Methods

toValue :: TransformationTypes -> AttributeValue

preEscapedToValue :: TransformationTypes -> AttributeValue

ToValue LayerName Source # 
Instance details

Methods

toValue :: LayerName -> AttributeValue

preEscapedToValue :: LayerName -> AttributeValue

Real r => ToMarkup (Group r) Source # 
Instance details

Methods

toMarkup :: Group r -> Markup

preEscapedToMarkup :: Group r -> Markup

Real r => ToMarkup (Image r) Source # 
Instance details

Methods

toMarkup :: Image r -> Markup

preEscapedToMarkup :: Image r -> Markup

Real r => ToMarkup (IpeObject r) Source # 
Instance details

Methods

toMarkup :: IpeObject r -> Markup

preEscapedToMarkup :: IpeObject r -> Markup

Real r => ToMarkup (IpeSymbol r) Source # 
Instance details

Methods

toMarkup :: IpeSymbol r -> Markup

preEscapedToMarkup :: IpeSymbol r -> Markup

Real r => ToMarkup (MiniPage r) Source # 
Instance details

Methods

toMarkup :: MiniPage r -> Markup

preEscapedToMarkup :: MiniPage r -> Markup

Real r => ToMarkup (Path r) Source # 
Instance details

Methods

toMarkup :: Path r -> Markup

preEscapedToMarkup :: Path r -> Markup

Real r => ToMarkup (TextLabel r) Source # 
Instance details

Methods

toMarkup :: TextLabel r -> Markup

preEscapedToMarkup :: TextLabel r -> Markup

Integral a => ToValue (Ratio a) Source # 
Instance details

Methods

toValue :: Ratio a -> AttributeValue

preEscapedToValue :: Ratio a -> AttributeValue

HasResolution p => ToValue (Fixed p) Source # 
Instance details

Methods

toValue :: Fixed p -> AttributeValue

preEscapedToValue :: Fixed p -> AttributeValue

Real r => ToValue (IpeArrow r) Source # 
Instance details

Methods

toValue :: IpeArrow r -> AttributeValue

preEscapedToValue :: IpeArrow r -> AttributeValue

Real r => ToValue (IpeDash r) Source # 
Instance details

Methods

toValue :: IpeDash r -> AttributeValue

preEscapedToValue :: IpeDash r -> AttributeValue

Real r => ToValue (IpePen r) Source # 
Instance details

Methods

toValue :: IpePen r -> AttributeValue

preEscapedToValue :: IpePen r -> AttributeValue

Real r => ToValue (IpeSize r) Source # 
Instance details

Methods

toValue :: IpeSize r -> AttributeValue

preEscapedToValue :: IpeSize r -> AttributeValue

Real r => ToValue (IpeColor r) Source # 
Instance details

Methods

toValue :: IpeColor r -> AttributeValue

preEscapedToValue :: IpeColor r -> AttributeValue

Real r => ToValue (Path r) Source # 
Instance details

Methods

toValue :: Path r -> AttributeValue

preEscapedToValue :: Path r -> AttributeValue

Real r => ToValue (PathSegment r) Source # 
Instance details

Methods

toValue :: PathSegment r -> AttributeValue

preEscapedToValue :: PathSegment r -> AttributeValue

(ToMarkup g, AllConstrained IpeToSvgAttr rs, ReifyConstraint ToValue (Attr f) rs, RMap rs, RecordToList rs, RecAll (Attr f) rs ToValue) => ToMarkup (g :+ Attributes f rs) Source # 
Instance details

Methods

toMarkup :: (g :+ Attributes f rs) -> Markup

preEscapedToMarkup :: (g :+ Attributes f rs) -> Markup

ToValue (Apply f at) => ToValue (Attr f at) Source # 
Instance details

Methods

toValue :: Attr f at -> AttributeValue

preEscapedToValue :: Attr f at -> AttributeValue

Real r => ToValue (Matrix 3 3 r) Source # 
Instance details

Methods

toValue :: Matrix 3 3 r -> AttributeValue

preEscapedToValue :: Matrix 3 3 r -> AttributeValue