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.Types

Contents

Description

This module defines the various types for holding plots:

PlotOptions b v n
Generic options all plots have.
PlotMods b v n
Includes PlotOptions along with modifications to the PlotStyle.
Plot p b
A rawPlot p grouped with a PlotMods.
DynamicPlot b v n
A wrapped up Plot so it can be stored in an Axis.
StyledPlot b v n
A DynamicPlot with a concrete PlotStyle, ready to be rendered.

As well as other things like the Plotable class, LegendEntries, HasOrientation and HasVisibility.

Synopsis

Plot options

data PlotOptions b v n Source #

Data type for holding information all plots must contain.

Instances

HasPlotOptions f (PlotOptions b v n) b Source # 
(Additive v, Num n) => Default (PlotOptions b v n) Source # 

Methods

def :: PlotOptions b v n #

Qualifiable (PlotOptions b v n) Source # 

Methods

(.>>) :: IsName a => a -> PlotOptions b v n -> PlotOptions b v n #

(HasLinearMap v, Num n) => Transformable (PlotOptions b v n) Source # 

Methods

transform :: Transformation (V (PlotOptions b v n)) (N (PlotOptions b v n)) -> PlotOptions b v n -> PlotOptions b v n #

(Additive v, Num n) => HasOrigin (PlotOptions b v n) Source #

Move origin by applying to plotTransform.

Methods

moveOriginTo :: Point (V (PlotOptions b v n)) (N (PlotOptions b v n)) -> PlotOptions b v n -> PlotOptions b v n #

HasVisibility (PlotOptions b v n) Source # 
type V (PlotOptions b v n) Source # 
type V (PlotOptions b v n) = v
type N (PlotOptions b v n) Source # 
type N (PlotOptions b v n) = n

class HasPlotOptions f a b | a -> b where Source #

Class of things that have PlotOptions.

Minimal complete definition

plotOptions

Methods

plotOptions :: LensLike' f a (PlotOptions b (V a) (N a)) Source #

Lens onto the PlotOptions.

plotName :: Functor f => LensLike' f a Name Source #

The Name applied to the plot. This gives a way to reference a specific plot in a rendered axis.

Default is mempty.

clipPlot :: Functor f => LensLike' f a Bool Source #

Whether the plot should be clipped to the bounds of the axes.

Default is True.

legendEntries :: Functor f => LensLike' f a [LegendEntry b (V a) (N a)] Source #

The legend entries to be used for the current plot.

Default is mempty.

plotTransform :: Functor f => LensLike' f a (Transformation (V a) (N a)) Source #

The transform applied to the plot once it's in the axis coordinates.

Default is mempty.

plotVisible :: Functor f => LensLike' f a Bool Source #

Whether or not the plot should be shown. The BoundingBox of the plot will still affect the inferred axis bounds.

Default is True.

Instances

Functor f => HasPlotOptions f (Plot p b) b Source # 
HasPlotOptions f (PlotOptions b v n) b Source # 
Functor f => HasPlotOptions f (StyledPlot b v n) b Source # 
Functor f => HasPlotOptions f (DynamicPlot b v n) b Source # 
Functor f => HasPlotOptions f (PlotMods b v n) b Source # 
Settable f => HasPlotOptions f (Axis b c n) b Source # 

Methods

plotOptions :: LensLike' f (Axis b c n) (PlotOptions b (V (Axis b c n)) (N (Axis b c n))) Source #

plotName :: LensLike' f (Axis b c n) Name Source #

clipPlot :: LensLike' f (Axis b c n) Bool Source #

legendEntries :: LensLike' f (Axis b c n) [LegendEntry b (V (Axis b c n)) (N (Axis b c n))] Source #

plotTransform :: LensLike' f (Axis b c n) (Transformation (V (Axis b c n)) (N (Axis b c n))) Source #

plotVisible :: LensLike' f (Axis b c n) Bool Source #

key :: (HasPlotOptions Identity a b, MonadState a m, Num (N a)) => String -> m () Source #

Add a LegendEntry to something with PlotOptions using the String as the legendText and a DefaultLegendPic. Here are some typical examples:

key :: String -> State (Plot (ScatterPlot v n) b) ()
key :: String -> State (DynamicPlot b v n) ()
key :: String -> State (PlotMods b v n) ()

If you only care about the name of the legend, use key.

addLegendEntry :: (HasPlotOptions Identity a b, MonadState a m) => LegendEntry b (V a) (N a) -> m () Source #

Add a LegendEntry to something with PlotOptions. Here are some typical examples:

addLegendEntry :: LegendEntry b v n -> State (Plot (ScatterPlot v n) b) ()
addLegendEntry :: LegendEntry b v n -> State (DynamicPlot b v n) ()

If you only care about the name of the legend, use key.

Plot modifications

data PlotMods b v n Source #

A PlotOptions with modifications to a PlotStyle.

Instances

Settable f => HasPlotStyle f (PlotMods b v n) b Source # 

Methods

plotStyle :: LensLike' f (PlotMods b v n) (PlotStyle b (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

plotColour :: LensLike' f (PlotMods b v n) (Colour Double) Source #

plotColor :: LensLike' f (PlotMods b v n) (Colour Double) Source #

lineStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

lineStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

markerStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

markerStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

areaStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

areaStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

textStyle :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

textStyleFunction :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

plotMarker :: LensLike' f (PlotMods b v n) (QDiagram b (V (PlotMods b v n)) (N (PlotMods b v n)) Any) Source #

plotStyles :: LensLike' f (PlotMods b v n) (Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

plotStyleFunctions :: LensLike' f (PlotMods b v n) (Colour Double -> Style (V (PlotMods b v n)) (N (PlotMods b v n))) Source #

Functor f => HasPlotOptions f (PlotMods b v n) b Source # 
(Additive v, Num n) => Default (PlotMods b v n) Source # 

Methods

def :: PlotMods b v n #

HasVisibility (PlotMods b v n) Source # 
type V (PlotMods b v n) Source # 
type V (PlotMods b v n) = v
type N (PlotMods b v n) Source # 
type N (PlotMods b v n) = n

plotMods :: Lens' (Plot p b) (PlotMods b (V p) (N p)) Source #

The modifications to the PlotOptions and PlotStyle in a Plot.

Plotable class

class (Typeable p, Enveloped p) => Plotable p b where Source #

Class defining how plots should be rendered.

Minimal complete definition

renderPlotable

Methods

renderPlotable :: InSpace v n p => AxisSpec v n -> PlotStyle b v n -> p -> QDiagram b v n Any Source #

Render a plot according to the AxisSpec, using the PlotStyle.

defLegendPic :: InSpace v n p => PlotStyle b v n -> p -> QDiagram b v n Any Source #

The default legend picture when the LegendPic is DefaultLegendPic.

Instances

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (BarPlot n) b Source # 

Methods

renderPlotable :: InSpace v n (BarPlot n) => AxisSpec v n -> PlotStyle b v n -> BarPlot n -> QDiagram b v n Any Source #

defLegendPic :: InSpace v n (BarPlot n) => PlotStyle b v n -> BarPlot n -> QDiagram b v n Any Source #

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (HistogramPlot n) b Source # 
(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (Wedge n) b Source # 

Methods

renderPlotable :: InSpace v n (Wedge n) => AxisSpec v n -> PlotStyle b v n -> Wedge n -> QDiagram b v n Any Source #

defLegendPic :: InSpace v n (Wedge n) => PlotStyle b v n -> Wedge n -> QDiagram b v n Any Source #

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (Path V2 n) b Source # 

Methods

renderPlotable :: InSpace v n (Path V2 n) => AxisSpec v n -> PlotStyle b v n -> Path V2 n -> QDiagram b v n Any Source #

defLegendPic :: InSpace v n (Path V2 n) => PlotStyle b v n -> Path V2 n -> QDiagram b v n Any Source #

(Typeable * b, TypeableFloat n, Renderable (Path V2 n) b) => Plotable (HeatMap b n) b Source # 

Methods

renderPlotable :: InSpace v n (HeatMap b n) => AxisSpec v n -> PlotStyle b v n -> HeatMap b n -> QDiagram b v n Any Source #

defLegendPic :: InSpace v n (HeatMap b n) => PlotStyle b v n -> HeatMap b n -> QDiagram b v n Any Source #

(TypeableFloat n, Renderable (Path V2 n) b) => Plotable (ScatterPlot V2 n) b Source # 

Methods

renderPlotable :: InSpace v n (ScatterPlot V2 n) => AxisSpec v n -> PlotStyle b v n -> ScatterPlot V2 n -> QDiagram b v n Any Source #

defLegendPic :: InSpace v n (ScatterPlot V2 n) => PlotStyle b v n -> ScatterPlot V2 n -> QDiagram b v n Any Source #

(Typeable * b, Typeable (* -> *) v, Metric v, Typeable * n, OrderedField n) => Plotable (QDiagram b v n Any) b Source # 

Methods

renderPlotable :: InSpace v n (QDiagram b v n Any) => AxisSpec v n -> PlotStyle b v n -> QDiagram b v n Any -> QDiagram b v n Any Source #

defLegendPic :: InSpace v n (QDiagram b v n Any) => PlotStyle b v n -> QDiagram b v n Any -> QDiagram b v n Any Source #

Plot types

Parameterised plot

data Plot p b Source #

A parameterised plot, together with a PlotMods. This type has an instance of many classes for modifying specific plots.

Instances

(Functor f, HasWedge f a) => HasWedge f (Plot a b) Source # 

Methods

pieWedge :: LensLike' f (Plot a b) (Wedge (N (Plot a b))) Source #

wedgeOuterRadius :: LensLike' f (Plot a b) (N (Plot a b)) Source #

wedgeInnerRadius :: LensLike' f (Plot a b) (N (Plot a b)) Source #

wedgeOffset :: LensLike' f (Plot a b) (N (Plot a b)) Source #

wedgeWidth :: LensLike' f (Plot a b) (Angle (N (Plot a b))) Source #

wedgeDirection :: LensLike' f (Plot a b) (Direction V2 (N (Plot a b))) Source #

HasConnectingLine f p => HasConnectingLine f (Plot p b) Source # 
Settable f => HasPlotStyle f (Plot p b) b Source # 

Methods

plotStyle :: LensLike' f (Plot p b) (PlotStyle b (V (Plot p b)) (N (Plot p b))) Source #

plotColour :: LensLike' f (Plot p b) (Colour Double) Source #

plotColor :: LensLike' f (Plot p b) (Colour Double) Source #

lineStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

lineStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

markerStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

markerStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

areaStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

areaStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

textStyle :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

textStyleFunction :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

plotMarker :: LensLike' f (Plot p b) (QDiagram b (V (Plot p b)) (N (Plot p b)) Any) Source #

plotStyles :: LensLike' f (Plot p b) (Style (V (Plot p b)) (N (Plot p b))) Source #

plotStyleFunctions :: LensLike' f (Plot p b) (Colour Double -> Style (V (Plot p b)) (N (Plot p b))) Source #

Functor f => HasPlotOptions f (Plot p b) b Source # 
(Functor f, HasHeatMap f a b) => HasHeatMap f (Plot a b) b Source # 
(Functor f, HasScatterOptions f p a) => HasScatterOptions f (Plot p b) a Source # 

Methods

gscatterOptions :: LensLike' f (Plot p b) (ScatterOptions (V (Plot p b)) (N (Plot p b)) a) Source #

scatterTransform :: LensLike' f (Plot p b) (a -> Transformation (V (Plot p b)) (N (Plot p b))) Source #

scatterStyle :: LensLike' f (Plot p b) (a -> Style (V (Plot p b)) (N (Plot p b))) Source #

scatterPosition :: LensLike' f (Plot p b) (a -> Point (V (Plot p b)) (N (Plot p b))) Source #

HasOrientation p => HasOrientation (Plot p b) Source # 
HasVisibility (Plot p b) Source # 
HasBarLayout a => HasBarLayout (Plot a b) Source # 

Methods

barLayout :: Lens' (Plot a b) (BarLayout (N (Plot a b))) Source #

barWidth :: Lens' (Plot a b) (N (Plot a b)) Source #

barSpacing :: Lens' (Plot a b) (N (Plot a b)) Source #

barStart :: Lens' (Plot a b) (N (Plot a b)) Source #

HasHistogramOptions a => HasHistogramOptions (Plot a b) Source # 
type V (Plot p b) Source # 
type V (Plot p b) = V p
type N (Plot p b) Source # 
type N (Plot p b) = N p

mkPlot :: (Additive (V p), Num (N p)) => p -> Plot p b Source #

Make a Plot with Default PlotOptions.

rawPlot :: SameSpace p p' => Lens (Plot p b) (Plot p' b) p p' Source #

Lens onto the raw Plotable inside a Plot.

Dynamic plot

data DynamicPlot b v n where Source #

A wrapped up Plot, used to store plots in an Axis.

Constructors

DynamicPlot :: (InSpace v n p, Plotable p b) => Plot p b -> DynamicPlot b v n 

Instances

(Applicative f, Typeable * b, (~) (* -> *) v V2, Typeable * n) => HasWedge f (DynamicPlot b v n) Source # 
(Applicative f, Typeable * b, Typeable (* -> *) v, Typeable * n) => HasConnectingLine f (DynamicPlot b v n) Source # 
Settable f => HasPlotStyle f (DynamicPlot b v n) b Source # 

Methods

plotStyle :: LensLike' f (DynamicPlot b v n) (PlotStyle b (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

plotColour :: LensLike' f (DynamicPlot b v n) (Colour Double) Source #

plotColor :: LensLike' f (DynamicPlot b v n) (Colour Double) Source #

lineStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

lineStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

markerStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

markerStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

areaStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

areaStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

textStyle :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

textStyleFunction :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

plotMarker :: LensLike' f (DynamicPlot b v n) (QDiagram b (V (DynamicPlot b v n)) (N (DynamicPlot b v n)) Any) Source #

plotStyles :: LensLike' f (DynamicPlot b v n) (Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

plotStyleFunctions :: LensLike' f (DynamicPlot b v n) (Colour Double -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

Functor f => HasPlotOptions f (DynamicPlot b v n) b Source # 
(Applicative f, Typeable * b, Typeable (* -> *) v, Typeable * n, Typeable * a) => HasScatterOptions f (DynamicPlot b v n) a Source # 

Methods

gscatterOptions :: LensLike' f (DynamicPlot b v n) (ScatterOptions (V (DynamicPlot b v n)) (N (DynamicPlot b v n)) a) Source #

scatterTransform :: LensLike' f (DynamicPlot b v n) (a -> Transformation (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

scatterStyle :: LensLike' f (DynamicPlot b v n) (a -> Style (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

scatterPosition :: LensLike' f (DynamicPlot b v n) (a -> Point (V (DynamicPlot b v n)) (N (DynamicPlot b v n))) Source #

HasVisibility (DynamicPlot b v n) Source # 
type V (DynamicPlot b v n) Source # 
type V (DynamicPlot b v n) = v
type N (DynamicPlot b v n) Source # 
type N (DynamicPlot b v n) = n

_DynamicPlot :: (Plotable p b, Typeable b) => Prism' (DynamicPlot b (V p) (N p)) (Plot p b) Source #

Prism for a DynamicPlot.

dynamicPlot :: forall p b. (Typeable p, Typeable b) => Traversal' (DynamicPlot b (V p) (N p)) (Plot p b) Source #

Traversal over the dynamic plot without the Plotable constraint _DynamicPlot has.

dynamicPlotMods :: Lens' (DynamicPlot b v n) (PlotMods b v n) Source #

The modifications to the PlotOptions and PlotStyle in a DynamicPlot.

Styled plot

data StyledPlot b v n Source #

A DynamicPlot with a concrete style. This is suitable for being rendered with renderStyledPlot and get extract the legend entries with styledPlotLegend.

You can make a StyledPlot with styleDynamic

Instances

((~) (* -> *) v V2, Applicative f, Typeable * n) => HasWedge f (StyledPlot b v n) Source # 
(Applicative f, Typeable (* -> *) v, Typeable * n) => HasConnectingLine f (StyledPlot b v n) Source # 
Functor f => HasPlotStyle f (StyledPlot b v n) b Source # 

Methods

plotStyle :: LensLike' f (StyledPlot b v n) (PlotStyle b (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

plotColour :: LensLike' f (StyledPlot b v n) (Colour Double) Source #

plotColor :: LensLike' f (StyledPlot b v n) (Colour Double) Source #

lineStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

lineStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

markerStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

markerStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

areaStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

areaStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

textStyle :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

textStyleFunction :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

plotMarker :: LensLike' f (StyledPlot b v n) (QDiagram b (V (StyledPlot b v n)) (N (StyledPlot b v n)) Any) Source #

plotStyles :: LensLike' f (StyledPlot b v n) (Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

plotStyleFunctions :: LensLike' f (StyledPlot b v n) (Colour Double -> Style (V (StyledPlot b v n)) (N (StyledPlot b v n))) Source #

Functor f => HasPlotOptions f (StyledPlot b v n) b Source # 
(Metric v, OrderedField n) => Enveloped (StyledPlot b v n) Source # 

Methods

getEnvelope :: StyledPlot b v n -> Envelope (V (StyledPlot b v n)) (N (StyledPlot b v n)) #

HasVisibility (StyledPlot b v n) Source # 
type V (StyledPlot b v n) Source # 
type V (StyledPlot b v n) = v
type N (StyledPlot b v n) Source # 
type N (StyledPlot b v n) = n

styledPlot :: forall p b. Typeable p => Traversal' (StyledPlot b (V p) (N p)) p Source #

Traversal over a raw plot of a styled plot. The type of the plot must match for the traversal to be successful.

styleDynamic :: PlotStyle b v n -> DynamicPlot b v n -> StyledPlot b v n Source #

Give a DynamicPlot a concrete PlotStyle.

singleStyledPlotLegend Source #

Arguments

:: StyledPlot b v n 
-> [(n, QDiagram b v n Any, String)]
(z-order, legend pic, legend text)

Get the legend rendered entries from a single styled plot. The resulting entries are in no particular order. See also styledPlotLegends.

styledPlotLegends Source #

Arguments

:: Ord n 
=> [StyledPlot b v n] 
-> [(QDiagram b v n Any, String)]
[(legend pic, legend text)]

Render a list of legend entries, in order.

Miscellaneous

Visibility

class HasVisibility a where Source #

Class of objects that can be hidden.

Minimal complete definition

visible

Methods

visible :: Lens' a Bool Source #

Lens onto whether an object should be visible when rendered.

hidden :: Lens' a Bool Source #

The opposite of visible.

Instances

HasVisibility (Plot p b) Source # 
HasVisibility (Legend b n) Source # 
HasVisibility (MinorTicks v n) Source # 
HasVisibility (MajorTicks v n) Source # 
HasVisibility (AxisLine v n) Source # 
HasVisibility (MinorGridLines v n) Source #

Hidden by default.

HasVisibility (MajorGridLines v n) Source # 
HasVisibility (ColourBar b n) Source # 
HasVisibility (PlotOptions b v n) Source # 
HasVisibility (StyledPlot b v n) Source # 
HasVisibility (DynamicPlot b v n) Source # 
HasVisibility (PlotMods b v n) Source # 
HasVisibility (Title b v n) Source # 

Methods

visible :: Lens' (Title b v n) Bool Source #

hidden :: Lens' (Title b v n) Bool Source #

HasVisibility (TickLabels b v n) Source # 
HasVisibility (AxisLabel b v n) Source # 
HasVisibility (SingleAxis b v n) Source # 

hide :: (MonadState s m, HasVisibility a) => ASetter' s a -> m () Source #

Set visible to False for the given setter.

hide minorTicks          :: State (Axis b v n) ()
hide (xAxis . gridLines) :: State (Axis b v n) ()

display :: (MonadState s m, HasVisibility a) => ASetter' s a -> m () Source #

Set visible to True for the given setter.

display minorGridLines :: State (Axis b v n) ()
display colourBar      :: State (Axis b v n) ()

Orientation

orient :: HasOrientation o => o -> a -> a -> a Source #

Pick the first a if the object has Horizontal orientation and the second a if the object has a Vertical orientation.

horizontal :: HasOrientation a => Lens' a Bool Source #

Lens onto whether an object's orientation is horizontal.

vertical :: HasOrientation a => Lens' a Bool Source #

Lens onto whether an object's orientation is vertical.

Legend entries

data LegendEntry b v n Source #

Data type for holding a legend entry.

Instances

type V (LegendEntry b v n) Source # 
type V (LegendEntry b v n) = v
type N (LegendEntry b v n) Source # 
type N (LegendEntry b v n) = n

data LegendPic b v n Source #

Type allowing use of the default legend picture (depending on the plot) or a custom legend picture with access to the PlotStyle.

Constructors

DefaultLegendPic 
CustomLegendPic (PlotStyle b v n -> QDiagram b v n Any) 

Instances

Default (LegendPic b v n) Source # 

Methods

def :: LegendPic b v n #

mkLegendEntry :: Num n => String -> LegendEntry b v n Source #

Make a legend entry with a default legendPicture and legendPrecedence 0 using the string as the legendText.

legendPicture :: Lens' (LegendEntry b v n) (LegendPic b v n) Source #

The picture used in the legend entry.

legendText :: Lens' (LegendEntry b v n) String Source #

The text used in the legend entry.

legendPrecedence :: Lens' (LegendEntry b v n) n Source #

The order in which the legend entries are rendered. If precedences are equal, the entries are put in the order they are added to the axis.

Default is 0.

Axis spec

data AxisSpec v n Source #

Information from the Axis necessary to render a Plotable.

Constructors

AxisSpec 

Instances

type V (AxisSpec v n) Source # 
type V (AxisSpec v n) = v
type N (AxisSpec v n) Source # 
type N (AxisSpec v n) = n

specTrans :: forall v n. Lens' (AxisSpec v n) (Transformation v n) Source #

specBounds :: forall v n. Lens' (AxisSpec v n) (v (n, n)) Source #

specScale :: forall v n. Lens' (AxisSpec v n) (v LogScale) Source #

scaleNum :: Floating n => (n, n) -> LogScale -> n -> n Source #

Scale a number by log10-ing it and linearly scaling it so it's within the same range.

specPoint :: (Applicative v, Additive v, Floating n) => AxisSpec v n -> Point v n -> Point v n Source #

Apply log scaling and the transform to a point.

Positioning

class HasPlacement a where Source #

Minimal complete definition

placement

Methods

placement :: Lens' a Placement Source #

placementAt :: Lens' a (V2 Rational) Source #

The position relative to the axis. V2 0 0 corresponds to the bottom left corner, V2 1 1 is the top right corner.

placementAnchor :: Lens' a (V2 Rational) Source #

The anchor used for the object being positioned. V2 0 0 corresponds to the bottom left corner, V2 1 1 is the top right corner.

gapDirection :: Lens' a (Direction V2 Rational) Source #

The direction to extend the gap when positioning.

class HasGap a where Source #

Minimal complete definition

gap

Methods

gap :: Lens' a (N a) Source #

The value of the gap when rendering.

Instances

HasGap (Legend b n) Source # 

Methods

gap :: Lens' (Legend b n) (N (Legend b n)) Source #

HasGap (ColourBar b n) Source # 

Methods

gap :: Lens' (ColourBar b n) (N (ColourBar b n)) Source #

HasGap (Title b v n) Source # 

Methods

gap :: Lens' (Title b v n) (N (Title b v n)) Source #

HasGap (TickLabels b v n) Source # 

Methods

gap :: Lens' (TickLabels b v n) (N (TickLabels b v n)) Source #

HasGap (AxisLabel b v n) Source # 

Methods

gap :: Lens' (AxisLabel b v n) (N (AxisLabel b v n)) Source #

placeAgainst :: (InSpace V2 n a, SameSpace a b, Enveloped a, HasOrigin b, Alignable b) => a -> Placement -> n -> b -> b Source #

A tool for aligned one object to another. Positions b around the bounding box of a by translating b.

Common positions

Inside positions

Outside positions