Portability | GHC |
---|---|

Stability | unstable |

Maintainer | stephen.tetley@gmail.com |

Composition operators for Pictures.

Note - empty pictures cannot exist in Wumpus hence the *list*
functions in this module are always supplied with an initial
picture, as well as the (possibly empty) list.

- data HAlign
- data VAlign
- centerPoint :: Fractional u => Picture u -> Point2 u
- over :: (Num u, Ord u) => Picture u -> Picture u -> Picture u
- under :: (Num u, Ord u) => Picture u -> Picture u -> Picture u
- centerOver :: (Fractional u, Ord u) => Picture u -> Picture u -> Picture u
- nextToH :: (Num u, Ord u) => Picture u -> Picture u -> Picture u
- nextToV :: (Num u, Ord u) => Picture u -> Picture u -> Picture u
- atPoint :: (Num u, Ord u) => Picture u -> Point2 u -> Picture u
- centeredAt :: (Fractional u, Ord u) => Picture u -> Point2 u -> Picture u
- stackOver :: (Num u, Ord u) => [Picture u] -> Picture u -> Picture u
- zconcat :: (Num u, Ord u) => Picture u -> [Picture u] -> Picture u
- hcat :: (Num u, Ord u) => Picture u -> [Picture u] -> Picture u
- vcat :: (Num u, Ord u) => Picture u -> [Picture u] -> Picture u
- stackOverCenter :: (Fractional u, Ord u) => [Picture u] -> Picture u -> Picture u
- hspace :: (Num u, Ord u) => u -> Picture u -> Picture u -> Picture u
- vspace :: (Num u, Ord u) => u -> Picture u -> Picture u -> Picture u
- hsep :: (Num u, Ord u) => u -> Picture u -> [Picture u] -> Picture u
- vsep :: (Num u, Ord u) => u -> Picture u -> [Picture u] -> Picture u
- alignH :: (Fractional u, Ord u) => HAlign -> Picture u -> Picture u -> Picture u
- alignV :: (Fractional u, Ord u) => VAlign -> Picture u -> Picture u -> Picture u
- alignHSep :: (Fractional u, Ord u) => HAlign -> u -> Picture u -> Picture u -> Picture u
- alignVSep :: (Fractional u, Ord u) => VAlign -> u -> Picture u -> Picture u -> Picture u
- hcatA :: (Fractional u, Ord u) => HAlign -> Picture u -> [Picture u] -> Picture u
- vcatA :: (Fractional u, Ord u) => VAlign -> Picture u -> [Picture u] -> Picture u
- hsepA :: (Fractional u, Ord u) => HAlign -> u -> Picture u -> [Picture u] -> Picture u
- vsepA :: (Fractional u, Ord u) => VAlign -> u -> Picture u -> [Picture u] -> Picture u

# Data types for alignment

Horizontal alignment - align to the top, center or bottom.

Vertical alignment - align to the left, center or bottom.

# Operations on boundary

centerPoint :: Fractional u => Picture u -> Point2 uSource

The center of a picture.

# Composition

over :: (Num u, Ord u) => Picture u -> Picture u -> Picture uSource

a `over` b

Place 'picture' a over b. The idea of `over`

here is in
terms z-ordering, nither picture a or b are actually moved.

under :: (Num u, Ord u) => Picture u -> Picture u -> Picture uSource

a `under` b

Similarly `under`

draws the first picture behind
the second but move neither.

`under`

was previously `beneath`

.

centerOver :: (Fractional u, Ord u) => Picture u -> Picture u -> Picture uSource

Draw a centered over b - a is moved, b is static.

a `centerOver` b

`centerOver`

was previously the (-@-) operator.

nextToH :: (Num u, Ord u) => Picture u -> Picture u -> Picture uSource

a `nextToH` b

Horizontal composition - move `b`

, placing it to the right
of `a`

.

`nextToH`

was previously the (->-) operator.

nextToV :: (Num u, Ord u) => Picture u -> Picture u -> Picture uSource

a `nextToV` b

Vertical composition - move `b`

, placing it below `a`

.

nextToV was previously the (--) operator.

atPoint :: (Num u, Ord u) => Picture u -> Point2 u -> Picture uSource

Place the picture at the supplied point.

`atPoint`

was previous the `at`

operator.

centeredAt :: (Fractional u, Ord u) => Picture u -> Point2 u -> Picture uSource

Center the picture at the supplied point.

zconcat :: (Num u, Ord u) => Picture u -> [Picture u] -> Picture uSource

x `zconcat` xs

Concatenate `x`

over the list of pictures `xs`

.

`x`

is drawn at the top. No pictures are moved.

` p1 ``zconcat`

[p2,p3,p4] => [p1,p2,p3,p4]

hcat :: (Num u, Ord u) => Picture u -> [Picture u] -> Picture uSource

Concatenate the list pictures `xs`

horizontally with `nextToH`

starting at `x`

.

vcat :: (Num u, Ord u) => Picture u -> [Picture u] -> Picture uSource

Concatenate the list of pictures `xs`

vertically with `nextToV`

starting at `x`

.

stackOverCenter :: (Fractional u, Ord u) => [Picture u] -> Picture u -> Picture uSource

Stack pictures centered ontop of each other - the first picture in the list is drawn at the top, last picture is on drawn at the bottom.

hspace :: (Num u, Ord u) => u -> Picture u -> Picture u -> Picture uSource

hspace n a b

Horizontal composition - move `b`

, placing it to the right
of `a`

with a horizontal gap of `n`

separating the pictures.

vspace :: (Num u, Ord u) => u -> Picture u -> Picture u -> Picture uSource

vspace n a b

Vertical composition - move `b`

, placing it below `a`

with a
vertical gap of `n`

separating the pictures.

hsep :: (Num u, Ord u) => u -> Picture u -> [Picture u] -> Picture uSource

hsep n x xs

Concatenate the list of pictures `xs`

horizontally with
`hspace`

starting at `x`

. The pictures are interspersed with
spaces of `n`

units.

vsep :: (Num u, Ord u) => u -> Picture u -> [Picture u] -> Picture uSource

vsep n x xs

Concatenate the list of pictures `xs`

vertically with
`vspace`

starting at `x`

. The pictures are interspersed with
spaces of `n`

units.

# Compose with alignment

alignH :: (Fractional u, Ord u) => HAlign -> Picture u -> Picture u -> Picture uSource

alignH align a b

Horizontal composition - move `b`

, placing it to the right
of `a`

and align it with the top, center or bottom of `a`

.

alignV :: (Fractional u, Ord u) => VAlign -> Picture u -> Picture u -> Picture uSource

alignV align a b

Vertical composition - move `b`

, placing it below `a`

and align it with the left, center or right of `a`

.

alignHSep :: (Fractional u, Ord u) => HAlign -> u -> Picture u -> Picture u -> Picture uSource

alignHSep align sep a b

Spacing version of alignH - move `b`

to the right of `a`

separated by `sep`

units, align `b`

according to `align`

.

alignVSep :: (Fractional u, Ord u) => VAlign -> u -> Picture u -> Picture u -> Picture uSource

alignHSep align sep a b

Spacing version of alignV - move `b`

below `a`

separated by `sep`

units, align `b`

according to `align`

.

hcatA :: (Fractional u, Ord u) => HAlign -> Picture u -> [Picture u] -> Picture uSource

Variant of `hcat`

that aligns the pictures as well as
concatenating them.

vcatA :: (Fractional u, Ord u) => VAlign -> Picture u -> [Picture u] -> Picture uSource

Variant of `vcat`

that aligns the pictures as well as
concatenating them.