Copyright | (C) 2015 Christopher Chalmers |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Christopher Chalmers |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Lines that go along the axis. Supports major and minor grid lines separately for each axis.
Synopsis
- data GridLines v n
- class (HasMinorGridLines f a, HasMajorGridLines f a) => HasGridLines f a where
- data MajorGridLines v n
- class HasMajorGridLines f a where
- majorGridLines :: LensLike' f a (MajorGridLines (V a) (N a))
- majorGridLinesFunction :: Functor f => LensLike' f a (GridLineFunction (N a))
- majorGridLinesStyle :: Functor f => LensLike' f a (Style (V a) (N a))
- data MinorGridLines v n
- class HasMinorGridLines f a where
- minorGridLines :: LensLike' f a (MinorGridLines (V a) (N a))
- minorGridLinesFunction :: Functor f => LensLike' f a (GridLineFunction (N a))
- minorGridLinesStyle :: Functor f => LensLike' f a (Style (V a) (N a))
- 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
class (HasMinorGridLines f a, HasMajorGridLines f a) => HasGridLines f a where Source #
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 # | |
Defined in Plots.Axis gridLines :: LensLike' f (SingleAxis b v n) (GridLines (V (SingleAxis b v n)) (N (SingleAxis b v n))) Source # |
data MajorGridLines v n Source #
Instances
HasMajorGridLines f (MajorGridLines v n) Source # | |
Defined in Plots.Axis.Grid majorGridLines :: LensLike' f (MajorGridLines v n) (MajorGridLines (V (MajorGridLines v n)) (N (MajorGridLines v n))) Source # majorGridLinesFunction :: LensLike' f (MajorGridLines v n) (GridLineFunction (N (MajorGridLines v n))) Source # majorGridLinesStyle :: LensLike' f (MajorGridLines v n) (Style (V (MajorGridLines v n)) (N (MajorGridLines v n))) Source # | |
(Typeable n, Floating n) => Default (MajorGridLines v n) Source # | |
Defined in Plots.Axis.Grid def :: MajorGridLines v n # | |
Typeable n => HasStyle (MajorGridLines v n) Source # | |
Defined in Plots.Axis.Grid applyStyle :: Style (V (MajorGridLines v n)) (N (MajorGridLines v n)) -> MajorGridLines v n -> MajorGridLines v n # | |
HasVisibility (MajorGridLines v n) Source # | |
Defined in Plots.Axis.Grid | |
type N (MajorGridLines v n) Source # | |
Defined in Plots.Axis.Grid | |
type V (MajorGridLines v n) Source # | |
Defined in Plots.Axis.Grid |
class HasMajorGridLines f a where Source #
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
data MinorGridLines v n Source #
Instances
HasMinorGridLines f (MinorGridLines v n) Source # | |
Defined in Plots.Axis.Grid minorGridLines :: LensLike' f (MinorGridLines v n) (MinorGridLines (V (MinorGridLines v n)) (N (MinorGridLines v n))) Source # minorGridLinesFunction :: LensLike' f (MinorGridLines v n) (GridLineFunction (N (MinorGridLines v n))) Source # minorGridLinesStyle :: LensLike' f (MinorGridLines v n) (Style (V (MinorGridLines v n)) (N (MinorGridLines v n))) Source # | |
(Typeable n, Floating n) => Default (MinorGridLines v n) Source # | |
Defined in Plots.Axis.Grid def :: MinorGridLines v n # | |
Typeable n => HasStyle (MinorGridLines v n) Source # | |
Defined in Plots.Axis.Grid applyStyle :: Style (V (MinorGridLines v n)) (N (MinorGridLines v n)) -> MinorGridLines v n -> MinorGridLines v n # | |
HasVisibility (MinorGridLines v n) Source # | Hidden by default. |
Defined in Plots.Axis.Grid | |
type N (MinorGridLines v n) Source # | |
Defined in Plots.Axis.Grid | |
type V (MinorGridLines v n) Source # | |
Defined in Plots.Axis.Grid |
class HasMinorGridLines f a where Source #
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
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 nhideGridLines
::SingleAxis
b c n ->SingleAxis
b c nhideGridLines
::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 nshowGridLines
::SingleAxis
b c n ->SingleAxis
b c nshowGridLines
::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.