diagrams-0.2: An EDSL for creating simple diagrams

Portabilityportable
Stabilityexperimental
Maintainerbyorgey@gmail.com
Safe HaskellNone

Graphics.Rendering.Diagrams.Attributes

Description

Attributes which can be added as annotations to a Diagram, implemented via instances of AttrClass.

Synopsis

Documentation

defaultAttributes :: Diagram -> DiagramSource

Apply all the default attributes to a Diagram.

fillColor :: Color c => c -> Diagram -> DiagramSource

Draw a diagram using the given fill color. Note that the new color only applies to parts of the diagram which are not otherwise colored; subdiagrams which already have an explicit fill color will not be affected. The default fill color is completely transparent.

fc :: Color c => c -> Diagram -> DiagramSource

fc is provided as a convenient short synonym for fillColor.

lineColor :: Color c => c -> Diagram -> DiagramSource

Draw a diagram using the given color for lines. Note that the new color only applies to parts of the diagram which are not otherwise colored; subdiagrams which already have an explicit line color will not be affected. The default line color is black.

lc :: Color c => c -> Diagram -> DiagramSource

lc is provided as a convenient short synonym for lineColor.

lineWidth :: Double -> Diagram -> DiagramSource

Draw shape outlines and lines with the given width. Note that the line width is invariant under uniform scaling, although under non-uniform scaling (scaling by different amounts in the x and y axes) lines can become distorted. The default line width is 1.

lw :: Double -> Diagram -> DiagramSource

lw is provided as a convenient short synonym for lineWidth.

lineCap :: LineCap -> Diagram -> DiagramSource

Set the line cap style. Valid values for LineCap are LineCapButt, LineCapRound, and LineCapSquare.

data LineCap

Specify line endings.

LineCapButt
Start(stop) the line exactly at the start(end) point.
LineCapRound
Use a round ending, the center of the circle is the end point.
LineCapSquare
Use squared ending, the center of the square is the end point

lineJoin :: LineJoin -> Diagram -> DiagramSource

Set the line join style. Valid values for LineJoin are LineJoinMiter, LineJoinRound, and LineJoinBevel.

data LineJoin

Specify how lines join.

dashingSource

Arguments

:: [Double]

a list specifying alternate lengths of on and off portions of the stroke. The empty list indicates no dashing.

-> Double

an offset into the dash pattern at which the stroke should start

-> Diagram 
-> Diagram 

Set the line dashing pattern.

typeface :: String -> Diagram -> DiagramSource

Change the default typeface to one named.

tf :: String -> Diagram -> DiagramSource

Convenience function to change the typeface.

stretch :: Double -> Double -> Diagram -> DiagramSource

Stretch a diagram by a separate scaling factor for each axis. stretch w h scales by a factor of w in the x direction and a factor of h in the y direction.

scale :: Double -> Diagram -> DiagramSource

Scale by the same scaling factor in both dimensions, so the diagram retains its aspect ratio.

scaleX :: Double -> Diagram -> DiagramSource

Scale a diagram along the x-axis only. scaleX s is equivalent to stretch s 1.

scaleY :: Double -> Diagram -> DiagramSource

Scale a diagram along the y-axis only. scaleY s is equivalent to stretch 1 s.

translate :: Double -> Double -> Diagram -> DiagramSource

Translate a diagram by the given relative offsets in the x and y directions. Note that the positive x-axis is to the right, while the positive y-axis points downwards.

translateX :: Double -> Diagram -> DiagramSource

Translate a diagram along the x-axis only. translateX x is equivalent to translate x 0.

translateY :: Double -> Diagram -> DiagramSource

Translate a diagram along the y-axis only. translateY y is equivalent to translate 0 y.

rotate :: Double -> Diagram -> DiagramSource

rotate f rotates a diagram clockwise by fraction f of a complete revolution. rotate f is equivalent to rotateR (2*pi*f).

rotateR :: Double -> Diagram -> DiagramSource

rotateR r rotates a diagram clockwise by r radians.