-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A grid box model -- -- Spans a 2D grid of n rows and m boxes with equal size. @package gridbox @version 0.2.0.0 -- | Box in a row module GridBox.Box -- | A grid box with position (x,y) at row and col with size. data Box Box :: Double -> Double -> BoxRow -> BoxCol -> Double -> Double -> Box [x] :: Box -> Double [y] :: Box -> Double [row] :: Box -> BoxRow [col] :: Box -> BoxCol [width] :: Box -> Double [height] :: Box -> Double -- | Row of a box type BoxRow = Int -- | Col of a box type BoxCol = Int -- | Create a box with position (x,y) at row and col with given size. makeBox :: Double -> Double -> Int -> Int -> (Double, Double) -> Box instance GHC.Classes.Eq GridBox.Box.Box instance GHC.Show.Show GridBox.Box.Box instance GHC.Read.Read GridBox.Box.Box -- | Coordinate module GridBox.Coordinate -- | Create a List of (x,y) coordinates with given size. fromBox :: Box -> [(Double, Double)] -- | Convert all boxes in list from Box to (x, y) coordinates fromBoxes :: [Box] -> [[(Double, Double)]] -- | Get the x-position for given row, size and x-offset. getX :: Int -> Double -> Double -> Double -- | Get the y-position for given col, size and y-offset. getY :: Int -> Double -> Double -> Double -- | Get the given position with x-offset. topX :: Double -> Double -> Double -- | Get the given position with y-offset. topY :: Double -> Double -> Double -- | Transform given coordinates with position (x, y) scale, x- and -- y-offset. transform :: (Double, Double) -> Double -> Double -> Double -> (Double, Double) -> (Double, Double) -- | Position module GridBox.Position -- | Box position type BoxPosition = (BoxRow, BoxCol) -- | Box positions type BoxPositions = [BoxPosition] -- | Convert from Box to (row, col) fromBox :: Box -> BoxPosition -- | Convert all boxes in list from Box to (row, col) fromBoxes :: [Box] -> BoxPositions -- | Grouping of boxes module GridBox.Grouping -- | Grouped box positions type GroupedByRow = [GroupedRow] -- | Grouped row type GroupedRow = (BoxRow, [BoxCol]) -- | Group given list of boxes by row groupBoxesByRow :: [Box] -> GroupedByRow -- | Row of a grid module GridBox.Row -- | A row of boxes. type Row = [Box] -- | Create a box with given row, col, size, x- and y-offset. createBox :: (Double, Double) -> Double -> Double -> Int -> Int -> Box -- | Create a row with given row, List of col-indexes, size, x- and -- y-offset. makeRow :: (Double, Double) -> Double -> Double -> [Int] -> Int -> Row -- | Grid of rows module GridBox.Grid -- | A grid of rows. type Grid = [Row] -- | Create a grid with given size width, height, x- and y-offset. createGrid :: (Double, Double) -> Double -> Double -> Double -> Double -> Grid -- | Create a grid with given List of row- and col-indexes, size, x- and -- y-offset. makeGrid :: [Int] -> [Int] -> (Double, Double) -> Double -> Double -> Grid -- | Grid compression module GridBox.Compress -- | Length of a compressed col type Length = Int -- | Compressed grid type CompressedGrid = [CompressedRow] -- | Compressed row type CompressedRow = (BoxRow, CompressedCols) -- | Compressed cols type CompressedCols = [CompressedCol] -- | Compressed col type CompressedCol = (BoxCol, Length) -- | Compress grid compressGrid :: Grid -> CompressedGrid -- | Compress row compressRow :: Row -> CompressedGrid -- | Compress boxes compressBoxes :: [Box] -> CompressedGrid -- | Compress grouped rows compressGroupedRows :: GroupedByRow -> CompressedGrid -- | Compress grouped row compressGroupedRow :: GroupedRow -> CompressedRow -- | Compress cols compressCols :: [BoxCol] -> CompressedCols -- | Convert list of box cols to compressed cols with length = 1 fromCols :: [BoxCol] -> CompressedCols -- | Merge cols that have neighbours. Each col a and b is merged to c. The -- index of c is the index of a and the length of c is the sum of length -- a and b. mergeCols :: CompressedCols -> CompressedCols