diagrams-0.1: An EDSL for creating simple diagrams

Portabilityportable
Stabilityexperimental
Maintainerbyorgey@gmail.com
Safe HaskellNone

Graphics.Rendering.Diagrams.Layouts

Contents

Description

Layout definitions for Graphics.Rendering.Diagrams, an embedded domain-specific language (EDSL) for creating simple diagrams.

Synopsis

Union

(##) :: Diagram -> Diagram -> DiagramSource

Superimpose one diagram atop another. d1 d2 results in a diagram in which d2 is on top of d1 (i.e., d1 is drawn first, then d2).

union :: [Diagram] -> DiagramSource

Create a Diagram as a union of subdiagrams which will not be repositioned. If the subdiagrams overlap, they will appear with the first Diagram on the bottom, and the last on top.

unionA :: HAlignment -> VAlignment -> [Diagram] -> DiagramSource

Create a Diagram as a union of subdiagrams superimposed on one another, aligned vertically and/or horizontally.

Lists

(<>) :: Diagram -> Diagram -> DiagramSource

d1 d2 is a Diagram with d1 to the left of d2, aligned along their top edges.

(//) :: Diagram -> Diagram -> DiagramSource

d1 d2 is a Diagram with d1 above d2, aligned along their left edges.

hcat :: [Diagram] -> DiagramSource

Lay out a list of Diagrams horizontally from left to right, aligned along their top edges.

vcat :: [Diagram] -> DiagramSource

Lay out a list of Diagrams vertically from top to bottom, aligned along their left edges.

hcatA :: VAlignment -> [Diagram] -> DiagramSource

Lay out a list of Diagrams horizontally from left to right, with the given vertical alignment (top, vcenter, or bottom).

vcatA :: HAlignment -> [Diagram] -> DiagramSource

Lay out a list of Diagrams vertically from top to bottom, with the given horizontal alignment (left, hcenter, or right).

hsepSource

Arguments

:: Double

amount of separation between each pair of diagrams

-> [Diagram] 
-> Diagram 

Lay out a list of Diagrams horizontally, aligned along their top edges, with a given amount of separation in between each pair.

vsepSource

Arguments

:: Double

amount of separation between each pair of diagrams

-> [Diagram] 
-> Diagram 

Lay out a list of Diagrams vertically, aligned along their left edges, with a given amount of separation in between each pair.

hsepASource

Arguments

:: Double

amount of separation between each pair of diagrams

-> VAlignment

alignment to use (top, vcenter, or bottom)

-> [Diagram] 
-> Diagram 

Lay out a list of Diagrams horizontally, with the given amount of separation in between each pair, using the given vertical alignment (top, center, or bottom).

vsepASource

Arguments

:: Double

amount of separation between each pair of diagrams

-> HAlignment

alignment to use (left, hcenter, or right)

-> [Diagram] 
-> Diagram 

Lay out a list of Diagrams vertically, with the given amount of separation in between each pair, using the given horizontal alignment (left, hcenter, or right).

hdistribSource

Arguments

:: Double

How far from one diagram to the next?

-> HAlignment

Distribute according to which parts of the diagrams (left, hcenter, right)?

-> [Diagram] 
-> Diagram 

Distribute a list of Diagrams horizontally according to a regular spacing, aligned along their top edges.

vdistribSource

Arguments

:: Double

How far from one diagram to the next?

-> VAlignment

Distribute according to which parts of the diagrams (top, vcenter, bottom)?

-> [Diagram] 
-> Diagram 

Distribute a list of Diagrams vertically according to a regular spacing, aligned along their left edges.

hdistribASource

Arguments

:: Double

How far from one diagram to the next?

-> HAlignment

Distribute according to which parts of the diagrams (left, hcenter, right)?

-> VAlignment

alignment to use (top, vcenter, bottom)

-> [Diagram] 
-> Diagram 

Distribute a list of Diagrams horizontally according to a regular spacing, with the given alignment.

vdistribASource

Arguments

:: Double

How far from one diagram to the next?

-> VAlignment

Distribute according to which parts of the diagrams (top, vcenter, bottom)?

-> HAlignment

alignment to use (left, hcenter, right)

-> [Diagram] 
-> Diagram 

Distribute a list of Diagrams vertically according to a regular spacing, with the given alignment.

type VAlignment = AlignmentSource

Vertical alignment.

type HAlignment = AlignmentSource

Horizontal alignment.