ghci-diagrams-0.1.1: Display simple diagrams from ghci




data Diagram

Diagram is the core data type which describes a diagram. Diagrams may be constructed, transformed, combined, and ultimately rendered as an image.

rect :: Double -> Double -> Diagram

rect w h is a rectangle of width w and height h.

union :: [Diagram] -> Diagram

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.

class Color c

The Color type class encompasses color representations which can be used by the Diagrams library; that is, every function in the Diagrams library which expects a color can take any type which is an instance of Color. Instances are provided for both the Colour and AlphaColour types from the Data.Colour library.


rgb :: Fractional a => a -> a -> a -> Colour a

Constructs a Colour from RGB values using the linear RGB colour with the same gamut as sRGB.

type Point = (Double, Double)

Basic 2D points/vectors.

(.-.) :: Point -> Point -> Point

Elementwise addition, subtraction and multiplication for Points.

(*.) :: Double -> Point -> Point

Scalar multiplication.

scaleY :: Double -> Diagram -> Diagram

Scale a diagram along the y-axis only. scaleY s is equivalent to stretch 1 s.