chart-svg-0.0.3: Charts in SVG

Safe HaskellNone
LanguageHaskell2010

Chart.Hud

Description

A hud (heads-up display) are decorations in and around a chart that assist with data interpretation.

Synopsis

Documentation

runHudWith Source #

Arguments

:: 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.

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