File: Unit.hs

package info (click to toggle)
haskell-chart 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 336 kB
  • ctags: 1
  • sloc: haskell: 3,916; makefile: 3
file content (33 lines) | stat: -rw-r--r-- 888 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-----------------------------------------------------------------------------
-- |
-- Module      :  Graphics.Rendering.Chart.Axis.Unit
-- Copyright   :  (c) Tim Docker 2010
-- License     :  BSD-style (see chart/COPYRIGHT)
--
-- Calculate and render unit indexed axes

module Graphics.Rendering.Chart.Axis.Unit(
    unitAxis,
) where

import Data.Default.Class

import Graphics.Rendering.Chart.Axis.Types

instance PlotValue () where
    toValue () = 0
    fromValue  = const ()
    autoAxis   = const unitAxis

unitAxis :: AxisData ()
unitAxis = AxisData {
    _axis_visibility = def 
                     { _axis_show_ticks  = False
                     , _axis_show_labels = False 
                     },
    _axis_viewport = \(x0,x1) _ -> (x0+x1)/2,
    _axis_tropweiv = \_       _ -> (),
    _axis_ticks    = [((), 0)],
    _axis_labels   = [[((), "")]],
    _axis_grid     = []
}