Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Layout formula positioning children horizontally or vertically, with or without wrapping.
Synopsis
- data Flex a b = Flex {
- direction :: Direction
- reverseRows :: Bool
- wrap :: FlexWrapping
- justify :: Justification
- alignLines :: Maybe Justification
- baseGap :: b
- crossGap :: b
- children :: [[FlexChild a b]]
- pageWidth :: Double
- data FlexChild a b = FlexChild {}
- data Direction
- data FlexWrapping
- = NoWrap
- | Wrap
- | WrapReverse
- data Justification
- data Alignment
- = AlStretch
- | AlStart
- | AlEnd
- | AlCenter
- | AlBaseline
- flexMap :: (a -> b) -> Flex a c -> Flex b c
- flexResolve :: CastDouble b => (a -> Direction -> Double) -> Double -> Flex a b -> Flex a Double
- flexMaxBasis :: Flex a Double -> Double
- flexSumBasis :: Flex a Double -> Double
- flexWrap :: CastDouble b => Flex a b -> Double -> Flex a b
- flexRowSize :: (a -> Double) -> [FlexChild a b] -> Double
- flexRowsSize :: (a -> Double) -> Flex a Double -> Double
- justifyOffset :: Double -> [Double] -> Double -> Justification -> Double
- justifySpacing :: Double -> [Double] -> Double -> Justification -> Double
- flexJustify :: (a -> Double) -> Double -> [a] -> Double -> Justification -> [(Double, a)]
- alignOffset :: Double -> Double -> Alignment -> Double
- outerMinMain :: Num m => PaddedBox m m -> Direction -> m
- outerMain :: Num m => PaddedBox m m -> Direction -> m
- outerMaxMain :: Num m => PaddedBox m m -> Direction -> m
- outerMinCross :: Num m => PaddedBox m m -> Direction -> m
- outerCross :: Num m => PaddedBox m m -> Direction -> m
- outerMaxCross :: Num m => PaddedBox m m -> Direction -> m
- innerMinMain :: Num m => PaddedBox m m -> Direction -> m
- innerMain :: Num m => PaddedBox m m -> Direction -> m
- innerMaxMain :: Num m => PaddedBox m m -> Direction -> m
- innerMinCross :: Num m => PaddedBox m m -> Direction -> m
- innerCross :: Num m => PaddedBox m m -> Direction -> m
- innerMaxCross :: Num m => PaddedBox m m -> Direction -> m
- flexGetBox :: (Zero m, CastDouble m, Zero n, CastDouble n) => (a -> PaddedBox Double Double) -> Flex a m -> PaddedBox m n
- flexSplit :: (a -> Size Double Double) -> Double -> Double -> Flex a Double -> (Flex a Double, Flex a Double)
- flexPosition :: ((Double, Double) -> a -> b) -> (a -> Size Double Double) -> (Double, Double) -> Size Double Double -> Flex a Double -> Flex b Double
Documentation
Parameters to flexbox layout
Flex | |
|
Properties for positioning a child of a flexbox
Which axis to position children along
data FlexWrapping Source #
Whether to wrap or reverse the wrapped lines
Instances
Read FlexWrapping Source # | |
Defined in Graphics.Layout.Flex readsPrec :: Int -> ReadS FlexWrapping # readList :: ReadS [FlexWrapping] # | |
Show FlexWrapping Source # | |
Defined in Graphics.Layout.Flex showsPrec :: Int -> FlexWrapping -> ShowS # show :: FlexWrapping -> String # showList :: [FlexWrapping] -> ShowS # | |
Eq FlexWrapping Source # | |
Defined in Graphics.Layout.Flex (==) :: FlexWrapping -> FlexWrapping -> Bool # (/=) :: FlexWrapping -> FlexWrapping -> Bool # |
data Justification Source #
How to position lines within a flexbox, or children within a line
Instances
Read Justification Source # | |
Defined in Graphics.Layout.Flex readsPrec :: Int -> ReadS Justification # readList :: ReadS [Justification] # | |
Show Justification Source # | |
Defined in Graphics.Layout.Flex showsPrec :: Int -> Justification -> ShowS # show :: Justification -> String # showList :: [Justification] -> ShowS # | |
Eq Justification Source # | |
Defined in Graphics.Layout.Flex (==) :: Justification -> Justification -> Bool # (/=) :: Justification -> Justification -> Bool # |
How to align children along the cross-axis (opposite axis from which they're laid out)
flexResolve :: CastDouble b => (a -> Direction -> Double) -> Double -> Flex a b -> Flex a Double Source #
Resolve lengths in the flexbox to doubles.
flexMaxBasis :: Flex a Double -> Double Source #
The minimum size of the flexbox along direction
, i.e. maximum size of a child.
flexWrap :: CastDouble b => Flex a b -> Double -> Flex a b Source #
Wrap all lines to a given size reassigning overflow or underflow space. NOTE: shrink propery may yield negative sizes. Caller will want to enforce min-sizes.
flexRowSize :: (a -> Double) -> [FlexChild a b] -> Double Source #
The cross (opposite from direction
axis) size of a row.
flexRowsSize :: (a -> Double) -> Flex a Double -> Double Source #
The cross (opposite from direction
axis) size of all rows.
justifyOffset :: Double -> [Double] -> Double -> Justification -> Double Source #
How far right to shift some elements to achieve desired justification.
justifySpacing :: Double -> [Double] -> Double -> Justification -> Double Source #
How much space to add between elements.
flexJustify :: (a -> Double) -> Double -> [a] -> Double -> Justification -> [(Double, a)] Source #
Position new positions for the given items according to the given justification.
alignOffset :: Double -> Double -> Alignment -> Double Source #
How far right to shift some elements to achieve desired alignment.
flexGetBox :: (Zero m, CastDouble m, Zero n, CastDouble n) => (a -> PaddedBox Double Double) -> Flex a m -> PaddedBox m n Source #
Compute the size bounds of a flexbox.