File: Unit.hs

package info (click to toggle)
haskell-chart 1.9.5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 396 kB
  • sloc: haskell: 4,680; makefile: 3
file content (34 lines) | stat: -rw-r--r-- 926 bytes parent folder | download | duplicates (5)
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
34
-----------------------------------------------------------------------------
-- |
-- Module      :  Graphics.Rendering.Chart.Axis.Unit
-- Copyright   :  (c) Tim Docker 2010
-- License     :  BSD-style (see chart/COPYRIGHT)
--
-- Calculate and render unit indexed axes
{-# OPTIONS_GHC -fno-warn-orphans #-}

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     = []
}