|
Wumpus.Deprecated.PictureLanguage | Portability | GHC with TypeFamilies and more | Stability | unstable | Maintainer | stephen.tetley@gmail.com |
|
|
|
|
|
Description |
Type classes and derived functions to compose 2D pictures.
WARNING - this module is deprecated.
|
|
Synopsis |
|
| | | | type family PUnit a | | class Horizontal a where | | | class Vertical a where | | | class Composite a where | | | class Move a where | | | class Blank a where | | | center :: (Horizontal a, Vertical a, Fractional u, u ~ PUnit a) => a -> Point2 u | | topleft :: (Horizontal a, Vertical a, u ~ PUnit a) => a -> Point2 u | | topright :: (Horizontal a, Vertical a, u ~ PUnit a) => a -> Point2 u | | bottomleft :: (Horizontal a, Vertical a, u ~ PUnit a) => a -> Point2 u | | bottomright :: (Horizontal a, Vertical a, u ~ PUnit a) => a -> Point2 u | | (-@-) :: (Horizontal a, Vertical a, Composite a, Move a, Fractional u, u ~ PUnit a) => a -> a -> a | | (->-) :: (Horizontal a, Composite a, Num u, u ~ PUnit a) => a -> a -> a | | (-<-) :: (Horizontal a, Composite a, Num u, u ~ PUnit a) => a -> a -> a | | (-//-) :: (Vertical a, Composite a, Num u, u ~ PUnit a) => a -> a -> a | | above :: (Vertical a, Composite a, Num u, u ~ PUnit a) => a -> a -> a | | below :: (Vertical a, Composite a, Num u, u ~ PUnit a) => a -> a -> a | | at :: (Move a, u ~ PUnit a) => a -> Point2 u -> a | | centeredAt :: (Horizontal a, Vertical a, Move a, Composite a, Blank a, Fractional u, u ~ PUnit a) => a -> Point2 u -> a | | stackOnto :: Composite a => [a] -> a -> a | | hcat :: (Horizontal a, Composite a, Num u, u ~ PUnit a) => a -> [a] -> a | | vcat :: (Vertical a, Composite a, Num u, u ~ PUnit a) => a -> [a] -> a | | stackOntoCenter :: (Horizontal a, Vertical a, Composite a, Move a, Fractional u, u ~ PUnit a) => [a] -> a -> a | | hspace :: (Num u, Composite a, Horizontal a, Blank a, u ~ PUnit a) => u -> a -> a -> a | | vspace :: (Num u, Composite a, Vertical a, Blank a, u ~ PUnit a) => u -> a -> a -> a | | hsep :: (Num u, Composite a, Horizontal a, Blank a, u ~ PUnit a) => u -> a -> [a] -> a | | vsep :: (Num u, Composite a, Vertical a, Blank a, u ~ PUnit a) => u -> a -> [a] -> a | | alignH :: (Fractional u, Composite a, Horizontal a, Vertical a, Move a, u ~ PUnit a) => HAlign -> a -> a -> a | | alignV :: (Fractional u, Composite a, Horizontal a, Vertical a, Move a, u ~ PUnit a) => VAlign -> a -> a -> a | | hcatA :: (Fractional u, Horizontal a, Vertical a, Composite a, Move a, u ~ PUnit a) => HAlign -> a -> [a] -> a | | vcatA :: (Fractional u, Horizontal a, Vertical a, Composite a, Move a, u ~ PUnit a) => VAlign -> a -> [a] -> a | | hsepA :: (Fractional u, Horizontal a, Vertical a, Composite a, Move a, Blank a, u ~ PUnit a) => HAlign -> u -> a -> [a] -> a | | vsepA :: (Fractional u, Horizontal a, Vertical a, Composite a, Move a, Blank a, u ~ PUnit a) => VAlign -> u -> a -> [a] -> a | | multilabel :: (Real u, Floating u, FromPtSize u, TextLabel t) => t -> u -> VAlign -> [String] -> Point2 u -> Picture u |
|
|
|
Data types for alignment
|
|
|
Horizontal alignment - align to the top, center or bottom.
| Constructors | | Instances | |
|
|
|
Vertical alignment - align to the left, center or bottom.
| Constructors | | Instances | |
|
|
Type family and classes
|
|
|
The type of points within a Picture.
|
|
|
class Horizontal a where | Source |
|
Move horizontally.
| | Methods | | | Instances | |
|
|
|
Move vertically.
| | Methods | | | Instances | |
|
|
|
a `over` b
Place 'picture' a over b. The idea of over here is the same
as z-ordering in 2D design programs. Implementations of this
class should 'draw' picture a over b but move neither.
Similarly beneath should 'draw' the first picture behind
the second but move neither.
Beneath has a default definition:
beneath = flip over
| | Methods | | | Instances | |
|
|
|
Move in both the horizontal and vertical.
| | Methods | | | Instances | |
|
|
|
Create a picture that has no content but occupies space
(i.e. it has a bounding box).
| | Methods | | | Instances | |
|
|
Bounds
|
|
Corresponding operations are available on bounding boxes - the
definitions here have different type class obligations.
|
|
|
The center of a picture.
|
|
|
Extract the top-left corner.
|
|
|
Extract the top-right corner.
|
|
|
Extract the bottom-left corner.
|
|
|
Extract the bottom-right corner.
|
|
Composition
|
|
|
a -@- b
Center a on top of b, a is potentially moved and drawn
over b.
|
|
|
a ->- b
Horizontal composition - move b, placing it to the right
of a.
|
|
|
a -<- b
Horizontal composition - move a, placing it to the left
of b.
|
|
|
a -//- b
Vertical composition - move b, placing it below a.
|
|
|
a `above` b
Vertical composition - move a, placing it above b.
|
|
|
a `below` b
Vertical composition - move a, placing it below b
|
|
|
Place the picture at the supplied point.
|
|
|
Center the picture at the supplied point.
|
|
|
xs `stackOnto` a
Stack the list of pictures xs over a.
Note, the first picture in the list is drawn at the top, the
last picture is draw over a.
|
|
|
x ->- xs
Concatenate the list pictures xs horizontally with (->-)
starting at x.
|
|
|
x -//- xs
Concatenate the list of pictures xs vertically with (-//-)
starting at x.
|
|
|
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 n a b
Concatenate the pictures a and b with (->-) - injecting
a space of n units to separate the pictures.
|
|
|
vspace n a b
Concatenate the pictures a and b with (-//-) - injecting
a space of n units to separate the pictures.
|
|
|
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 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 z a b
Move picture b up or down to be horizontally aligned along a
line from the top, center or bottom of picture a
|
|
|
alignV z a b
Move picture b left or right to be vertically aligned along a
line from the left side, center or right side of picture a
|
|
|
Variant of hcat that aligns the pictures as well as
concatenating them.
|
|
|
Variant of vcat that aligns the pictures as well as
concatenating them.
|
|
|
Variant of hsep that aligns the pictures as well as
concatenating and spacing them.
|
|
|
Variant of vsep that aligns the pictures as well as
concatenating and spacing them.
|
|
Special function for text
|
|
|
Create multiple lines of text.
The dimension argument is the linespacing, measured as the
distance between the upper lines descender and the lower
lines ascender.
An error is throw if the list of strings is empty
|
|
Produced by Haddock version 2.6.1 |