diagrams-contrib-1.4.0.1: Collection of user contributions to diagrams EDSL

Copyright(c) 2014 Pontus Granström
LicenseBSD-style (see LICENSE)
Maintainerpnutus@gmail.com
Safe HaskellNone
LanguageHaskell2010

Diagrams.TwoD.Layout.Grid

Description

Functions for effortlessly putting lists of diagrams in a grid layout.

Synopsis

Documentation

gridCat :: TypeableFloat n => [QDiagram b V2 n Any] -> QDiagram b V2 n Any Source #

Puts a list of diagrams in a grid, left-to-right, top-to-bottom. The grid is as close to square as possible.

import Diagrams.TwoD.Layout.Grid
gridCatExample = gridCat $ map (flip regPoly 1) [3..10]

gridCat' :: TypeableFloat n => Int -> [QDiagram b V2 n Any] -> QDiagram b V2 n Any Source #

Same as gridCat, but with a specified number of columns.

import Diagrams.TwoD.Layout.Grid
gridCatExample' = gridCat' 4 $ map (flip regPoly 1) [3..10]

gridSnake :: TypeableFloat n => [QDiagram b V2 n Any] -> QDiagram b V2 n Any Source #

Puts a list of diagrams in a grid, alternating left-to-right and right-to-left. Useful for comparing sequences of diagrams. The grid is as close to square as possible.

import Diagrams.TwoD.Layout.Grid
gridSnakeExample = gridSnake $ map (flip regPoly 1) [3..10]

gridSnake' :: TypeableFloat n => Int -> [QDiagram b V2 n Any] -> QDiagram b V2 n Any Source #

Same as gridSnake, but with a specified number of columns.

import Diagrams.TwoD.Layout.Grid
gridSnakeExample' = gridSnake' 4 $ map (flip regPoly 1) [3..10]

gridWith :: TypeableFloat n => (Int -> Int -> QDiagram b V2 n Any) -> (Int, Int) -> QDiagram b V2 n Any Source #

`gridWith f (cols, rows)` uses f, a function of two zero-indexed integer coordinates, to generate a grid of diagrams with the specified dimensions.

sameBoundingRect :: forall n b. TypeableFloat n => [QDiagram b V2 n Any] -> [QDiagram b V2 n Any] Source #

Make all diagrams have the same bounding rect, one that bounds them all.

sameBoundingSquare :: forall b n. TypeableFloat n => [QDiagram b V2 n Any] -> [QDiagram b V2 n Any] Source #

Make all diagrams have the same bounding square, one that bounds them all.