| Copyright | (C) 2015 Christopher Chalmers |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Christopher Chalmers |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Plots.Axis.Grid
Description
Lines that go along the axis. Supports major and minor grid lines separately for each axis.
- data GridLines v n
- class (HasMinorGridLines f a, HasMajorGridLines f a) => HasGridLines f a where
- data MajorGridLines v n
- class HasMajorGridLines f a where
- data MinorGridLines v n
- class HasMinorGridLines f a where
- gridLinesStyle :: (HasGridLines f a, Applicative f) => LensLike' f a (Style (V a) (N a))
- gridLinesVisible :: (HasGridLines f a, Applicative f) => LensLike' f a Bool
- hideGridLines :: (HasGridLines Identity a, MonadState a m) => m ()
- showGridLines :: (HasGridLines Identity a, MonadState a m) => m ()
- type GridLineFunction n = [n] -> (n, n) -> [n]
- onTicksGridLineFunction :: GridLineFunction n
- emptyGridLineFunction :: GridLineFunction n
Grid lines
Type holding information about both major and minor grid lines.
Instances
| Functor f => HasGridLines f (GridLines v n) Source # | |
| Functor f => HasMinorGridLines f (GridLines v n) Source # | |
| Functor f => HasMajorGridLines f (GridLines v n) Source # | |
| (Typeable * n, Floating n) => Default (GridLines v n) Source # | |
| Typeable * n => HasStyle (GridLines v n) Source # | |
| type V (GridLines v n) Source # | |
| type N (GridLines v n) Source # | |
class (HasMinorGridLines f a, HasMajorGridLines f a) => HasGridLines f a where Source #
Minimal complete definition
Instances
| Functor f => HasGridLines f (GridLines v n) Source # | |
| (Applicative f, Traversable c) => HasGridLines f (Axis b c n) Source # | |
| Functor f => HasGridLines f (SingleAxis b v n) Source # | |
data MajorGridLines v n Source #
Instances
| HasMajorGridLines f (MajorGridLines v n) Source # | |
| (Typeable * n, Floating n) => Default (MajorGridLines v n) Source # | |
| Typeable * n => HasStyle (MajorGridLines v n) Source # | |
| HasVisibility (MajorGridLines v n) Source # | |
| type V (MajorGridLines v n) Source # | |
| type N (MajorGridLines v n) Source # | |
class HasMajorGridLines f a where Source #
Minimal complete definition
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'(Axisb c n) (GridLines(BaseSpacec) n)majorGridLines::Lens'(SingleAxisb v n) (GridLinesv n)majorGridLines::Lens'(GridLinesv n) (GridLinesv 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 # | |
| Functor f => HasMajorGridLines f (SingleAxis b v n) Source # | |
data MinorGridLines v n Source #
Instances
| HasMinorGridLines f (MinorGridLines v n) Source # | |
| (Typeable * n, Floating n) => Default (MinorGridLines v n) Source # | |
| Typeable * n => HasStyle (MinorGridLines v n) Source # | |
| HasVisibility (MinorGridLines v n) Source # | Hidden by default. |
| type V (MinorGridLines v n) Source # | |
| type N (MinorGridLines v n) Source # | |
class HasMinorGridLines f a where Source #
Minimal complete definition
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'(Axisb c n) (GridLines(BaseSpacec) n)minorGridLines::Lens'(SingleAxisb v n) (GridLinesv n)minorGridLines::Lens'(GridLinesv n) (GridLinesv 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 # | |
| 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'(Axisb c n)BoolgridLinesVisible::Traversal'(SingleAxisb v n)BoolgridLinesVisible::Traversal'(GridLinesv n)Bool
hideGridLines :: (HasGridLines Identity a, MonadState a m) => m () Source #
Hide both major and minor grid lines.
hideGridLines::Axisb c n ->Axisb c nhideGridLines::SingleAxisb c n ->SingleAxisb c nhideGridLines::GridLinesb c n ->GridLinesb c n
showGridLines :: (HasGridLines Identity a, MonadState a m) => m () Source #
Show both major and minor grid lines.
showGridLines::Axisb c n ->Axisb c nshowGridLines::SingleAxisb c n ->SingleAxisb c nshowGridLines::GridLinesb c n ->GridLinesb 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.