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

Maintainerdiagrams-discuss@googlegroups.com

Diagrams.TwoD.Util

Contents

Description

Utility functions for diagrams in two-dimensional Cartesian space.

Synopsis

General two-dimensional utilities

unitX :: R2Source

A unit vector in the positive X direction.

unitY :: R2Source

A unit vector in the positive Y direction.

Size and extent of diagrams in R2

width :: AnnDiagram b R2 m -> DoubleSource

Compute the width of a diagram.

height :: AnnDiagram b R2 m -> DoubleSource

Compute the height of a diagram.

size2D :: AnnDiagram b R2 m -> (Double, Double)Source

Compute the width and height of a diagram.

extentX :: AnnDiagram b R2 a -> (Double, Double)Source

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

extentY :: AnnDiagram b R2 a -> (Double, Double)Source

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

center2D :: AnnDiagram b R2 a -> P2Source

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