Safe Haskell | None |
---|
This module glues together axes and plots to actually create a renderable for a chart.
Note that Template haskell is used to derive accessor functions
(see Lens
) for each field of the following data types:
These accessors are not shown in this API documentation. They have the same name as the field, but with the trailing underscore dropped. Hence for data field f_::F in type D, they have type
f :: Control.Lens.Lens' D F
- data Layout1 x y = Layout1 {
- _layout1_background :: FillStyle
- _layout1_plot_background :: Maybe FillStyle
- _layout1_title :: String
- _layout1_title_style :: FontStyle
- _layout1_bottom_axis :: LayoutAxis x
- _layout1_top_axis :: LayoutAxis x
- _layout1_left_axis :: LayoutAxis y
- _layout1_right_axis :: LayoutAxis y
- _layout1_yaxes_control :: ([y], [y]) -> ([y], [y])
- _layout1_margin :: Double
- _layout1_plots :: [Either (Plot x y) (Plot x y)]
- _layout1_legend :: Maybe LegendStyle
- _layout1_grid_last :: Bool
- data LayoutAxis x = LayoutAxis {
- _laxis_title_style :: FontStyle
- _laxis_title :: String
- _laxis_style :: AxisStyle
- _laxis_visible :: [x] -> Bool
- _laxis_generate :: AxisFn x
- _laxis_override :: AxisData x -> AxisData x
- _laxis_reverse :: Bool
- data Layout1Pick x y
- = L1P_Legend String
- | L1P_Title String
- | L1P_BottomAxisTitle String
- | L1P_TopAxisTitle String
- | L1P_LeftAxisTitle String
- | L1P_RightAxisTitle String
- | L1P_PlotArea x y y
- | L1P_BottomAxis x
- | L1P_TopAxis x
- | L1P_LeftAxis y
- | L1P_RightAxis y
- data StackedLayouts x = StackedLayouts {}
- data StackedLayout x = forall y . Ord y => StackedLayout (Layout1 x y)
- type MAxisFn t = [t] -> Maybe (AxisData t)
- defaultLayout1 :: (PlotValue x, PlotValue y) => Layout1 x y
- layout1ToRenderable :: (Ord x, Ord y) => Layout1 x y -> Renderable (Layout1Pick x y)
- linkAxes :: ([a], [a]) -> ([a], [a])
- independentAxes :: (a, b) -> (a, b)
- updateAllAxesStyles :: (AxisStyle -> AxisStyle) -> Layout1 x y -> Layout1 x y
- setLayout1Foreground :: AlphaColour Double -> Layout1 x y -> Layout1 x y
- defaultLayoutAxis :: PlotValue t => LayoutAxis t
- laxis_title_style :: forall x. Lens' (LayoutAxis x) FontStyle
- laxis_title :: forall x. Lens' (LayoutAxis x) String
- laxis_style :: forall x. Lens' (LayoutAxis x) AxisStyle
- laxis_visible :: forall x. Lens' (LayoutAxis x) ([x] -> Bool)
- laxis_generate :: forall x. Lens' (LayoutAxis x) (AxisFn x)
- laxis_override :: forall x. Lens' (LayoutAxis x) (AxisData x -> AxisData x)
- laxis_reverse :: forall x. Lens' (LayoutAxis x) Bool
- layout1_background :: forall x y. Lens' (Layout1 x y) FillStyle
- layout1_plot_background :: forall x y. Lens' (Layout1 x y) (Maybe FillStyle)
- layout1_title :: forall x y. Lens' (Layout1 x y) String
- layout1_title_style :: forall x y. Lens' (Layout1 x y) FontStyle
- layout1_left_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis y)
- layout1_right_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis y)
- layout1_top_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis x)
- layout1_bottom_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis x)
- layout1_yaxes_control :: forall x y. Lens' (Layout1 x y) (([y], [y]) -> ([y], [y]))
- layout1_margin :: forall x y. Lens' (Layout1 x y) Double
- layout1_plots :: forall x y. Lens' (Layout1 x y) [Either (Plot x y) (Plot x y)]
- layout1_legend :: forall x y. Lens' (Layout1 x y) (Maybe LegendStyle)
- layout1_grid_last :: forall x y. Lens' (Layout1 x y) Bool
- defaultStackedLayouts :: StackedLayouts x
- slayouts_layouts :: forall x x. Lens (StackedLayouts x) (StackedLayouts x) [StackedLayout x] [StackedLayout x]
- slayouts_compress_xlabels :: forall x. Lens' (StackedLayouts x) Bool
- slayouts_compress_legend :: forall x. Lens' (StackedLayouts x) Bool
- renderStackedLayouts :: Ord x => StackedLayouts x -> Renderable ()
Documentation
A Layout1 value is a single plot area, with optional: axes on each of the 4 sides; title at the top; legend at the bottom. It's parameterised by the types of values to be plotted on the horizonal and vertical axes.
Layout1 | |
|
data LayoutAxis x Source
LayoutAxis | |
|
PlotValue t => Default (LayoutAxis t) |
data Layout1Pick x y Source
(Show x, Show y) => Show (Layout1Pick x y) |
data StackedLayout x Source
A layout with its y type hidden, so that it can be stacked with other layouts (with differing y types)
forall y . Ord y => StackedLayout (Layout1 x y) |
type MAxisFn t = [t] -> Maybe (AxisData t)Source
A MAxisFn
is a function that generates an (optional) axis
given the points plotted against that axis.
defaultLayout1 :: (PlotValue x, PlotValue y) => Layout1 x ySource
Deprecated: Use the according Data.Default instance!
layout1ToRenderable :: (Ord x, Ord y) => Layout1 x y -> Renderable (Layout1Pick x y)Source
independentAxes :: (a, b) -> (a, b)Source
updateAllAxesStyles :: (AxisStyle -> AxisStyle) -> Layout1 x y -> Layout1 x ySource
Helper to update all axis styles on a Layout1 simultaneously.
setLayout1Foreground :: AlphaColour Double -> Layout1 x y -> Layout1 x ySource
Helper to set the forground color uniformly on a Layout1.
defaultLayoutAxis :: PlotValue t => LayoutAxis tSource
Deprecated: Use the according Data.Default instance!
laxis_title_style :: forall x. Lens' (LayoutAxis x) FontStyleSource
laxis_title :: forall x. Lens' (LayoutAxis x) StringSource
laxis_style :: forall x. Lens' (LayoutAxis x) AxisStyleSource
laxis_visible :: forall x. Lens' (LayoutAxis x) ([x] -> Bool)Source
laxis_generate :: forall x. Lens' (LayoutAxis x) (AxisFn x)Source
laxis_override :: forall x. Lens' (LayoutAxis x) (AxisData x -> AxisData x)Source
laxis_reverse :: forall x. Lens' (LayoutAxis x) BoolSource
layout1_background :: forall x y. Lens' (Layout1 x y) FillStyleSource
layout1_title :: forall x y. Lens' (Layout1 x y) StringSource
layout1_title_style :: forall x y. Lens' (Layout1 x y) FontStyleSource
layout1_left_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis y)Source
layout1_right_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis y)Source
layout1_top_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis x)Source
layout1_bottom_axis :: forall x y. Lens' (Layout1 x y) (LayoutAxis x)Source
layout1_yaxes_control :: forall x y. Lens' (Layout1 x y) (([y], [y]) -> ([y], [y]))Source
layout1_margin :: forall x y. Lens' (Layout1 x y) DoubleSource
layout1_legend :: forall x y. Lens' (Layout1 x y) (Maybe LegendStyle)Source
layout1_grid_last :: forall x y. Lens' (Layout1 x y) BoolSource
defaultStackedLayouts :: StackedLayouts xSource
Deprecated: Use the according Data.Default instance!
slayouts_layouts :: forall x x. Lens (StackedLayouts x) (StackedLayouts x) [StackedLayout x] [StackedLayout x]Source
slayouts_compress_xlabels :: forall x. Lens' (StackedLayouts x) BoolSource
slayouts_compress_legend :: forall x. Lens' (StackedLayouts x) BoolSource
renderStackedLayouts :: Ord x => StackedLayouts x -> Renderable ()Source
Render several layouts with the same x-axis type and range, vertically stacked so that their origins and x-values are aligned.
The legends from all the charts may be optionally combined, and shown once on the bottom chart. The x labels may be optionally removed so that they are only shown once.