Safe Haskell | None |
---|---|
Language | Haskell2010 |
A hud (heads-up display) are decorations in and around a chart that assist with data interpretation.
Synopsis
- runHudWith :: Rect Double -> Rect Double -> [Hud Double] -> [Chart Double] -> [Chart Double]
- runHud :: Rect Double -> [Hud Double] -> [Chart Double] -> [Chart Double]
- makeHud :: Rect Double -> HudOptions -> ([Hud Double], [Chart Double])
- freezeTicks :: Place -> Rect Double -> TickStyle -> (TickStyle, Maybe (Rect Double))
- flipAxis :: AxisOptions -> AxisOptions
- canvas :: Monad m => RectStyle -> HudT m Double
- title :: Monad m => Title -> HudT m Double
- tick :: Monad m => Place -> Tick -> HudT m Double
- precision :: (Int -> Double -> Text) -> Int -> [Double] -> [Text]
- adjustTick :: Adjustments -> Rect Double -> Rect Double -> Place -> Tick -> Tick
- makeTickDates :: PosDiscontinuous -> Maybe Text -> Int -> [UTCTime] -> [(Int, Text)]
- legendHud :: LegendOptions -> [Chart Double] -> Hud Double
- legendEntry :: LegendOptions -> Annotation -> Text -> (Chart Double, Chart Double)
- legendChart :: [(Annotation, Text)] -> LegendOptions -> [Chart Double]
- legendFromChart :: [Text] -> [Chart Double] -> [(Annotation, Text)]
Documentation
:: Rect Double | initial canvas dimension |
-> Rect Double | initial data dimension |
-> [Hud Double] | huds to add |
-> [Chart Double] | underlying chart |
-> [Chart Double] | chart list |
combine huds and charts to form a new Chart using the supplied initial canvas and data dimensions. Note that chart data is transformed by this computation. used once in makePixelTick
runHud :: Rect Double -> [Hud Double] -> [Chart Double] -> [Chart Double] Source #
Combine huds and charts to form a new [Chart] using the supplied canvas and the actual data dimension. Note that the original chart data are transformed and irrevocably lost by this computation. used once in renderHudChart
makeHud :: Rect Double -> HudOptions -> ([Hud Double], [Chart Double]) Source #
Make huds from a HudOptions Some huds, such as the creation of tick values, can extend the data dimension of a chart, so we also return a blank chart with the new data dimension. The complexity internally is due to the creation of ticks and, specifically, gridSensible, which is not idempotent. As a result, a tick calculation that does extends the data area, can then lead to new tick values when applying TickRound etc.
flipAxis :: AxisOptions -> AxisOptions Source #
title :: Monad m => Title -> HudT m Double Source #
Add a title to a chart. The logic used to work out placement is flawed due to being able to freely specify text rotation. It works for specific rotations (Top, Bottom at 0, Left at 90, Right @ 270)
tick :: Monad m => Place -> Tick -> HudT m Double Source #
Create tick glyphs (marks), lines (grid) and text (labels)
precision :: (Int -> Double -> Text) -> Int -> [Double] -> [Text] Source #
Provide formatted text for a list of numbers so that they are just distinguished. 'precision commas 2 ticks' means give the tick labels as much precision as is needed for them to be distinguished, but with at least 2 significant figures, and format Integers with commas.
adjustTick :: Adjustments -> Rect Double -> Rect Double -> Place -> Tick -> Tick Source #
adjust Tick for sane font sizes etc
makeTickDates :: PosDiscontinuous -> Maybe Text -> Int -> [UTCTime] -> [(Int, Text)] Source #
Convert a UTCTime list into sensible ticks
legendEntry :: LegendOptions -> Annotation -> Text -> (Chart Double, Chart Double) Source #
legendChart :: [(Annotation, Text)] -> LegendOptions -> [Chart Double] Source #
legendFromChart :: [Text] -> [Chart Double] -> [(Annotation, Text)] Source #