Copyright | (c) 2014 Pontus Granström |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | pnutus@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Functions for effortlessly putting lists of diagrams in a grid layout.
- gridCat :: TypeableFloat n => [QDiagram b V2 n Any] -> QDiagram b V2 n Any
- gridCat' :: TypeableFloat n => Int -> [QDiagram b V2 n Any] -> QDiagram b V2 n Any
- gridSnake :: TypeableFloat n => [QDiagram b V2 n Any] -> QDiagram b V2 n Any
- gridSnake' :: TypeableFloat n => Int -> [QDiagram b V2 n Any] -> QDiagram b V2 n Any
- gridWith :: TypeableFloat n => (Int -> Int -> QDiagram b V2 n Any) -> (Int, Int) -> QDiagram b V2 n Any
- sameBoundingRect :: forall n b. TypeableFloat n => [QDiagram b V2 n Any] -> [QDiagram b V2 n Any]
- sameBoundingSquare :: forall b n. TypeableFloat n => [QDiagram b V2 n Any] -> [QDiagram b V2 n Any]
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.