diagrams-lib-0.4: Embedded domain-specific language for declarative graphics

Maintainer diagrams-discuss@googlegroups.com

Diagrams.TwoD.Size

Description

Utilities for working with sizes of two-dimensional objects.

Synopsis

# Size and extent of diagrams in R2

## Computing sizes

width :: (Boundable a, V a ~ R2) => a -> DoubleSource

Compute the width of a boundable object.

height :: (Boundable a, V a ~ R2) => a -> DoubleSource

Compute the height of a boundable object.

size2D :: (Boundable a, V a ~ R2) => a -> (Double, Double)Source

Compute the width and height of a boundable object.

extentX :: (Boundable a, V a ~ R2) => a -> (Double, Double)Source

Compute the absolute x-coordinate range of a boundable object in R2, in the form (lo,hi).

extentY :: (Boundable a, V a ~ R2) => a -> (Double, Double)Source

Compute the absolute y-coordinate range of a boundable object in R2, in the form (lo,hi).

center2D :: (Boundable a, V a ~ R2) => a -> P2Source

Compute the point at the center (in the x- and y-directions) of a boundable object.

## Specifying sizes

data SizeSpec2D Source

A specification of a (requested) rectangular size.

Constructors

 Width Double Specify an explicit width. The height should be determined automatically (so as to preserve aspect ratio). Height Double Specify an explicit height. The width should be determined automatically (so as to preserve aspect ratio) Dims Double Double An explicit specification of both dimensions. Absolute Absolute size: use whatever size an object already has; do not rescale.