Safe Haskell | None |
---|
- data Axis = Axis {
- axis_viewport :: Range -> Double -> Double
- axis_title :: String
- axis_ticks :: [(Double, Double)]
- axis_labels :: [(Double, String)]
- axis_grid :: [Double]
- axis_label_gap :: Double
- axis_title_style :: CairoFontStyle
- axis_line_style :: CairoLineStyle
- axis_label_style :: CairoFontStyle
- axis_grid_style :: CairoLineStyle
- type AxisFn = [Double] -> Maybe Axis
- type AxesFn = [Double] -> [Double] -> (Maybe Axis, Maybe Axis)
- data AxisT = AxisT RectEdge Axis
- minsizeAxis :: AxisT -> CRender RectSize
- axisOverhang :: AxisT -> CRender (Double, Double)
- renderAxis :: AxisT -> Rect -> CRender ()
- axisMapping :: AxisT -> Rect -> (Double, Double, Double, Double, Vector, Double -> Point)
- renderAxisGrid :: Rect -> AxisT -> CRender ()
- steps :: Double -> Range -> [Rational]
- chooseStep :: Double -> Range -> Rational
- explicitAxis :: Maybe Axis -> AxisFn
- linearTicks :: (Double, Double) -> ([Rational], [Rational])
- autoAxis :: (Double -> [Char]) -> ((Double, Double) -> Range -> Double -> Double) -> ([Rational], [Rational]) -> Axis -> Maybe Axis
- autoScaledAxis' :: (Double -> String) -> Axis -> AxisFn
- autoScaledAxis :: Axis -> AxisFn
- showD :: Show a => a -> [Char]
- log10 :: Floating a => a -> a
- frac :: (Integral t, RealFrac t1) => t1 -> (t, t1)
- lmap :: (Double, Double) -> Range -> Double -> Double
- logTicks :: Range -> ([Rational], [Rational])
- autoScaledLogAxis' :: (Double -> String) -> Axis -> AxisFn
- autoScaledLogAxis :: Axis -> AxisFn
- independentAxes :: AxisFn -> AxisFn -> AxesFn
- linkedAxes :: AxisFn -> AxesFn
- linkedAxes' :: AxisFn -> AxesFn
- defaultAxisLineStyle :: CairoLineStyle
- defaultGridLineStyle :: CairoLineStyle
- defaultAxis :: Axis
- refClockTime :: ClockTime
- doubleFromClockTime :: ClockTime -> Double
- clockTimeFromDouble :: Double -> ClockTime
- type TimeSeq = ClockTime -> ([ClockTime], [ClockTime])
- coverTS :: Ord a => (a -> ([a], [a])) -> a -> a -> [a]
- enumerateTS :: Ord a => (a -> ([a], [a])) -> a -> a -> [a]
- elemTS :: Eq a => a -> (a -> (t, [a])) -> Bool
- type TimeLabelFn = ClockTime -> String
- formatTime :: String -> TimeLabelFn
- timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> Axis -> AxisFn
- days :: TimeSeq
- months :: TimeSeq
- years :: TimeSeq
- zeroTime :: CalendarTime -> CalendarTime
- autoTimeAxis :: Axis -> AxisFn
Documentation
The concrete data type for an axis
Axis | |
|
type AxisFn = [Double] -> Maybe AxisSource
Function type to generate an optional axis given a set of points to be plotted against that axis.
type AxesFn = [Double] -> [Double] -> (Maybe Axis, Maybe Axis)Source
Function type to generate a pair of axes (either top and bottom, or left and right), given the set of points to be plotted against each of them.
axisOverhang :: AxisT -> CRender (Double, Double)Source
Calculate the amount by which the labels extend beyond the ends of the axis
renderAxis :: AxisT -> Rect -> CRender ()Source
renderAxisGrid :: Rect -> AxisT -> CRender ()Source
chooseStep :: Double -> Range -> RationalSource
explicitAxis :: Maybe Axis -> AxisFnSource
Explicitly specify an axis
autoAxis :: (Double -> [Char]) -> ((Double, Double) -> Range -> Double -> Double) -> ([Rational], [Rational]) -> Axis -> Maybe AxisSource
autoScaledAxis' :: (Double -> String) -> Axis -> AxisFnSource
Generate a linear axis automatically. The supplied axis is used as a template, with the viewport, ticks, labels and grid set appropriately for the data displayed against that axies. The resulting axis will only show a grid if the template has some grid values.
autoScaledAxis :: Axis -> AxisFnSource
autoScaledLogAxis' :: (Double -> String) -> Axis -> AxisFnSource
Generate a log axis automatically. The supplied axis is used as a template, with the viewport, ticks, labels and grid set appropriately for the data displayed against that axies. The resulting axis will only show a grid if the template has some grid values.
independentAxes :: AxisFn -> AxisFn -> AxesFnSource
Show independent axes on each side of the layout
linkedAxes :: AxisFn -> AxesFnSource
Show the same axis on both sides of the layout
linkedAxes' :: AxisFn -> AxesFnSource
Show the same axis on both sides of the layout, but with labels only on the primary side
doubleFromClockTime :: ClockTime -> DoubleSource
Map a clocktime value to a plot cordinate
clockTimeFromDouble :: Double -> ClockTimeSource
Map a plot cordinate to a clocktime
type TimeSeq = ClockTime -> ([ClockTime], [ClockTime])Source
TimeSeq is a (potentially infinite) set of times. When passes a reference time, the function returns a a pair of lists. The first contains all times in the set less than the reference time in decreasing order. The second contains all times in the set greater than or equal to the reference time, in increasing order.
enumerateTS :: Ord a => (a -> ([a], [a])) -> a -> a -> [a]Source
type TimeLabelFn = ClockTime -> StringSource
How to display a time
formatTime :: String -> TimeLabelFnSource
Use an strftime() formatted string to display a time
timeAxis :: TimeSeq -> TimeSeq -> TimeLabelFn -> Axis -> AxisFnSource
Create an AxisFn
to for a time axis. The first TimeSeq
sets the minor ticks,
and the ultimate range will aligned to it's elements. The second TimeSeq
sets
the labels and grid. The TimeLabelFn
is used to format clocktimes for labels.
The values to be plotted against this axis can be created with doubleFromClockTime
autoTimeAxis :: Axis -> AxisFnSource
Automatically choose a suitable time axis, based upon the time range of data.
The values to be plotted against this axis can be created with doubleFromClockTime