Safe Haskell | None |
---|---|
Language | Haskell2010 |
Sizes grid cells & positions elements to them.
Synopsis
- type Grid m n = Size (Track m) (Track n)
- data Track x = Track {}
- type GridItem = Size GridItem' GridItem'
- data GridItem' = GridItem {}
- data Alignment
- buildTrack :: CastDouble x => [Either x Double] -> Track x
- buildGrid :: (CastDouble m, CastDouble n) => [Either m Double] -> [Either n Double] -> Grid m n
- setCellBox :: (CastDouble m, CastDouble n) => GridItem -> PaddedBox m n -> GridItem
- enumerate :: [b] -> [(Int, b)]
- gridItemBox :: (CastDouble x, CastDouble y) => Grid y x -> GridItem -> PaddedBox Double Double
- cellSize :: CastDouble x => Track x -> GridItem' -> Double
- trackMin :: (n -> Double) -> Track n -> Double
- trackNat :: (n -> Double) -> Track n -> Double
- gridEstWidth :: Grid y Length -> [GridItem] -> Double
- sizeTrackMins :: Double -> Track Length -> [GridItem'] -> [Double]
- sizeTrackNats :: Double -> Track Length -> [GridItem'] -> [Double]
- sizeTrackMaxs :: Double -> Track Length -> [Double]
- trackPosition :: Track Double -> [GridItem'] -> [Double]
- gridPosition :: Grid Double Double -> [GridItem] -> [(Double, Double)]
- trackLayout :: Double -> Double -> Track Length -> [GridItem'] -> (Track Double, [(Double, GridItem')])
- gridLayout :: Size Double Double -> Grid Length Length -> [GridItem] -> (Grid Double Double, [((Double, Double), GridItem)])
Documentation
type Grid m n = Size (Track m) (Track n) Source #
An element which positions it's children within a grid.
The sizes to which children are alonged on a single axis.
How a grid child should be aligned per-axis.
GridItem | |
|
buildTrack :: CastDouble x => [Either x Double] -> Track x Source #
Constructs a track with default (to-be-computed) values & given cell sizes.
buildGrid :: (CastDouble m, CastDouble n) => [Either m Double] -> [Either n Double] -> Grid m n Source #
Constructs a grid with default (to-be-computed) values & given cell sizes.
setCellBox :: (CastDouble m, CastDouble n) => GridItem -> PaddedBox m n -> GridItem Source #
Sets minimum & natural sizes from the given padded box.
gridItemBox :: (CastDouble x, CastDouble y) => Grid y x -> GridItem -> PaddedBox Double Double Source #
Compute the maximum size as a PaddedBox of a child, for it to be sized to.
trackMin :: (n -> Double) -> Track n -> Double Source #
Compute the minimum size for the track given cell sizes. Refers to computed min sizes if cached.
trackNat :: (n -> Double) -> Track n -> Double Source #
Compute the natural size for the track given cell sizes. Refers to compute natural sizes if cached.
gridEstWidth :: Grid y Length -> [GridItem] -> Double Source #
Estimate grid width to inform proper width calculation.
sizeTrackMins :: Double -> Track Length -> [GridItem'] -> [Double] Source #
Calculate minimum sizes for all cells in the track. Sized to fit given children.
sizeTrackNats :: Double -> Track Length -> [GridItem'] -> [Double] Source #
Compute natural sizes for all cells in the track. Sized to fit given children.
sizeTrackMaxs :: Double -> Track Length -> [Double] Source #
Compute maximum sizes for all cells in the track, sized to the parent element.
trackPosition :: Track Double -> [GridItem'] -> [Double] Source #
Compute the position of all children within the grid.
gridPosition :: Grid Double Double -> [GridItem] -> [(Double, Double)] Source #
Compute the position of all children in a grid.