plots-0.1.0.2: Diagrams based plotting library.

Copyright(C) 2015 Christopher Chalmers
LicenseBSD-style (see the file LICENSE)
MaintainerChristopher Chalmers
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Plots.Axis.Grid

Contents

Description

Lines that go along the axis. Supports major and minor grid lines separately for each axis.

Synopsis

Grid lines

data GridLines v n Source #

Type holding information about both major and minor grid lines.

class (HasMinorGridLines f a, HasMajorGridLines f a) => HasGridLines f a where Source #

Minimal complete definition

gridLines

Methods

gridLines :: LensLike' f a (GridLines (V a) (N a)) Source #

Instances

Functor f => HasGridLines f (GridLines v n) Source # 

Methods

gridLines :: LensLike' f (GridLines v n) (GridLines (V (GridLines v n)) (N (GridLines v n))) Source #

(Applicative f, Traversable c) => HasGridLines f (Axis b c n) Source # 

Methods

gridLines :: LensLike' f (Axis b c n) (GridLines (V (Axis b c n)) (N (Axis b c n))) Source #

Functor f => HasGridLines f (SingleAxis b v n) Source # 

Methods

gridLines :: LensLike' f (SingleAxis b v n) (GridLines (V (SingleAxis b v n)) (N (SingleAxis b v n))) Source #

class HasMajorGridLines f a where Source #

Minimal complete definition

majorGridLines

Methods

majorGridLines :: LensLike' f a (MajorGridLines (V a) (N a)) Source #

The options for how to draw the grid lines. This can be used on various levels of the axis:

majorGridLines :: Traversal' (Axis b c n)       (GridLines (BaseSpace c) n)
majorGridLines :: Lens'      (SingleAxis b v n) (GridLines v n)
majorGridLines :: Lens'      (GridLines v n)    (GridLines v n)

majorGridLinesFunction :: Functor f => LensLike' f a (GridLineFunction (N a)) Source #

The function to calculate location of the major grid lines given location of the major ticks and bounds.

majorGridLinesStyle :: Functor f => LensLike' f a (Style (V a) (N a)) Source #

The style applied to the major grid lines.

Instances

Functor f => HasMajorGridLines f (GridLines v n) Source # 
HasMajorGridLines f (MajorGridLines v n) Source # 
(Applicative f, Traversable c) => HasMajorGridLines f (Axis b c n) Source # 

Methods

majorGridLines :: LensLike' f (Axis b c n) (MajorGridLines (V (Axis b c n)) (N (Axis b c n))) Source #

majorGridLinesFunction :: LensLike' f (Axis b c n) (GridLineFunction (N (Axis b c n))) Source #

majorGridLinesStyle :: LensLike' f (Axis b c n) (Style (V (Axis b c n)) (N (Axis b c n))) Source #

Functor f => HasMajorGridLines f (SingleAxis b v n) Source # 

class HasMinorGridLines f a where Source #

Minimal complete definition

minorGridLines

Methods

minorGridLines :: LensLike' f a (MinorGridLines (V a) (N a)) Source #

The options for how to draw the grid lines. This can be used on various levels of the axis:

minorGridLines :: Traversal' (Axis b c n)       (GridLines (BaseSpace c) n)
minorGridLines :: Lens'      (SingleAxis b v n) (GridLines v n)
minorGridLines :: Lens'      (GridLines v n)    (GridLines v n)

minorGridLinesFunction :: Functor f => LensLike' f a (GridLineFunction (N a)) Source #

The function to calculate location of the minor grid lines given location of the minor ticks and bounds.

minorGridLinesStyle :: Functor f => LensLike' f a (Style (V a) (N a)) Source #

The style applied to the minor grid lines.

Instances

Functor f => HasMinorGridLines f (GridLines v n) Source # 
HasMinorGridLines f (MinorGridLines v n) Source # 
(Applicative f, Traversable c) => HasMinorGridLines f (Axis b c n) Source # 

Methods

minorGridLines :: LensLike' f (Axis b c n) (MinorGridLines (V (Axis b c n)) (N (Axis b c n))) Source #

minorGridLinesFunction :: LensLike' f (Axis b c n) (GridLineFunction (N (Axis b c n))) Source #

minorGridLinesStyle :: LensLike' f (Axis b c n) (Style (V (Axis b c n)) (N (Axis b c n))) Source #

Functor f => HasMinorGridLines f (SingleAxis b v n) Source # 

Extra traversals

gridLinesStyle :: (HasGridLines f a, Applicative f) => LensLike' f a (Style (V a) (N a)) Source #

Traversal over both the major and minor grid styles. This can be used at several levels in the axis:

gridLinesVisible :: (HasGridLines f a, Applicative f) => LensLike' f a Bool Source #

Traversal over both the major and minor grid styles.

gridLinesVisible :: Traversal' (Axis b c n) Bool
gridLinesVisible :: Traversal' (SingleAxis b v n) Bool
gridLinesVisible :: Traversal' (GridLines v n) Bool

hideGridLines :: (HasGridLines Identity a, MonadState a m) => m () Source #

Hide both major and minor grid lines.

hideGridLines :: Axis b c n       -> Axis b c n
hideGridLines :: SingleAxis b c n -> SingleAxis b c n
hideGridLines :: GridLines b c n  -> GridLines b c n

showGridLines :: (HasGridLines Identity a, MonadState a m) => m () Source #

Show both major and minor grid lines.

showGridLines :: Axis b c n       -> Axis b c n
showGridLines :: SingleAxis b c n -> SingleAxis b c n
showGridLines :: GridLines b c n  -> GridLines b c n

Grid line functions

type GridLineFunction n = [n] -> (n, n) -> [n] Source #

A grid line function takes the positions of the respective ticks (minor ticks for minor grid lines, major ticks for major grid lines) and the bounds of the axis and returns the positions of the grid lines.

These functions are used in conjuction with majorGridLineFunction and minorGridLineFunction to control how the lines are drawn.

onTicksGridLineFunction :: GridLineFunction n Source #

Place grid lines at the same position as the respective ticks. This is the Default.

emptyGridLineFunction :: GridLineFunction n Source #

The GridLineFunction such that no grid lines appear.

See hideGridLines, majorGridLineVisible or minorGridLineVisible if you just want to hide the grid lines.