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

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

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 Clip Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Clip -> Maybe SvgF Source #

IpeToSvgAttr Gradient Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Gradient -> Maybe SvgF Source #

IpeToSvgAttr Tiling Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Tiling -> Maybe SvgF Source #

IpeToSvgAttr Opacity Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Opacity -> Maybe SvgF Source #

IpeToSvgAttr RArrow Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy RArrow -> Maybe SvgF Source #

IpeToSvgAttr Arrow Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Arrow -> Maybe SvgF Source #

IpeToSvgAttr FillRule Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy FillRule -> Maybe SvgF Source #

IpeToSvgAttr LineJoin Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy LineJoin -> Maybe SvgF Source #

IpeToSvgAttr LineCap Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy LineCap -> Maybe SvgF Source #

IpeToSvgAttr Dash Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Dash -> Maybe SvgF Source #

IpeToSvgAttr Size Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Size -> Maybe SvgF Source #

IpeToSvgAttr Pen Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Pen -> Maybe SvgF Source #

IpeToSvgAttr Fill Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Fill -> Maybe SvgF Source #

IpeToSvgAttr Stroke Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Stroke -> Maybe SvgF Source #

IpeToSvgAttr Transformations Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

IpeToSvgAttr Pin Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Pin -> Maybe SvgF Source #

IpeToSvgAttr Matrix Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Matrix -> Maybe SvgF Source #

IpeToSvgAttr Layer Source # 
Instance details

Defined in Data.Geometry.Svg.Writer

Methods

attrSvg :: proxy Layer -> Maybe SvgF Source #

Orphan instances

ToValue LayerName Source # 
Instance details

ToValue PinType Source # 
Instance details

ToValue TransformationTypes Source # 
Instance details

ToValue FillType Source # 
Instance details

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(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 #

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

Methods

toValue :: Matrix 3 3 r -> AttributeValue #

preEscapedToValue :: Matrix 3 3 r -> AttributeValue #

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