Safe Haskell | Safe-Inferred |
---|---|
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.
Instances
Read x => Read (Track x) Source # | |
Show x => Show (Track x) Source # | |
Eq x => Eq (Track x) Source # | |
Ord x => Ord (Track x) Source # | |
How a grid child should be aligned per-axis.
GridItem | |
|
Instances
Generic GridItem' Source # | |
Read GridItem' Source # | |
Show GridItem' Source # | |
NFData GridItem' Source # | |
Defined in Graphics.Layout.Grid | |
Eq GridItem' Source # | |
Ord GridItem' Source # | |
Defined in Graphics.Layout.Grid | |
type Rep GridItem' Source # | |
Defined in Graphics.Layout.Grid type Rep GridItem' = D1 ('MetaData "GridItem'" "Graphics.Layout.Grid" "cattrap-0.4.0.0-inplace" 'False) (C1 ('MetaCons "GridItem" 'PrefixI 'True) ((S1 ('MetaSel ('Just "cellStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "cellEnd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "alignment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Alignment) :*: (S1 ('MetaSel ('Just "minSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "natSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))))) |
How to redistribute excess space.
Instances
Enum Alignment Source # | |
Defined in Graphics.Layout.Grid succ :: Alignment -> Alignment Source # pred :: Alignment -> Alignment Source # toEnum :: Int -> Alignment Source # fromEnum :: Alignment -> Int Source # enumFrom :: Alignment -> [Alignment] Source # enumFromThen :: Alignment -> Alignment -> [Alignment] Source # enumFromTo :: Alignment -> Alignment -> [Alignment] Source # enumFromThenTo :: Alignment -> Alignment -> Alignment -> [Alignment] Source # | |
Generic Alignment Source # | |
Read Alignment Source # | |
Show Alignment Source # | |
NFData Alignment Source # | |
Defined in Graphics.Layout.Grid | |
Eq Alignment Source # | |
Ord Alignment Source # | |
Defined in Graphics.Layout.Grid | |
type Rep Alignment Source # | |
Defined in Graphics.Layout.Grid |
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.
cellSize :: CastDouble x => Track x -> GridItem' -> Double Source #
Compute the maximum size along an axis 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.