Copyright | (C) 2016 Christopher Chalmers |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Christopher Chalmers |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Options for rendering a colour bar, either attached to an axis or rendered separately.
To change the colour map used for the colour bar see
axisColourMap
from Plots.Style.
- data ColourBar b n
- class HasColourBar a b | a -> b where
- defColourBar :: (Renderable (Text n) b, Renderable (Path V2 n) b, TypeableFloat n) => ColourBar b n
- gradientColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => ColourMap -> QDiagram b V2 n Any
- pathColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => Int -> ColourMap -> QDiagram b V2 n Any
- renderColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => ColourBar b n -> ColourMap -> (n, n) -> n -> QDiagram b V2 n Any
- addColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => BoundingBox V2 n -> ColourBar b n -> ColourMap -> (n, n) -> QDiagram b V2 n Any
The colour bar
Options for drawing a colour bar. Note that for an axis, the
ColourMap
is stored in the AxisStyle
. These options are for
other aspects of the bar, not the colours used.
Functor f => HasMajorTicks f (ColourBar b n) Source # | |
Functor f => HasTickLabels f (ColourBar b n) b Source # | |
Typeable * n => HasStyle (ColourBar b n) Source # | |
HasPlacement (ColourBar b n) Source # | |
HasGap (ColourBar b n) Source # | |
HasOrientation (ColourBar b n) Source # | |
HasVisibility (ColourBar b n) Source # | |
HasColourBar (ColourBar b n) b Source # | |
type V (ColourBar b n) Source # | |
type N (ColourBar b n) Source # | |
class HasColourBar a b | a -> b where Source #
colourBar :: Lens' a (ColourBar b (N a)) Source #
Lens onto the ColourBar
.
colourBarDraw :: Lens' a (ColourMap -> QDiagram b V2 (N a) Any) Source #
How to draw the colour bar. Expects a 1 by 1 box with the
gradient going from left to right, without an outline with origin
in the middle of the left side. See gradientColourBar
and
pathColourBar
.
The colour map this function recieves it given by
axisColourMap
from Plots.Style
Default is gradientColourBar
.
colourBarWidth :: Lens' a (N a) Source #
The width (orthogonal to the colour bar direction) of the colour bar.
Default
is 20
.
colourBarLengthFunction :: Lens' a (N a -> N a) Source #
Set the length of the colour bar given the length of the axis the colour bar is aligned to.
colourBarGap :: Lens' a (N a) Source #
Gap between the axis and the colour bar (if rendered with an axis).
Default
is 20
.
colourBarStyle :: Lens' a (Style V2 (N a)) Source #
Style used for the outline of a colour bar.
HasColourBar (ColourBar b n) b Source # | |
HasColourBar (Axis b v n) b Source # | |
defColourBar :: (Renderable (Text n) b, Renderable (Path V2 n) b, TypeableFloat n) => ColourBar b n Source #
The default colour bar.
Rendering options
gradientColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => ColourMap -> QDiagram b V2 n Any Source #
The colour bar generated by a gradient texture. The final diagram
is 1 by 1, with origin at the middle of the left side. This can be
used as the colourBarDraw
function.
This may not be supported by all backends.
pathColourBar :: (TypeableFloat n, Renderable (Path V2 n) b) => Int -> ColourMap -> QDiagram b V2 n Any Source #
Construct a colour bar made up of n
solid square paths. The final
diagram is 1 by 1, with origin at the middle of the left side. This
can be used as the colourBarDraw
function.
Rendering colour bars
:: (TypeableFloat n, Renderable (Path V2 n) b) | |
=> ColourBar b n | options for colour bar |
-> ColourMap | map to use |
-> (n, n) | bounds of the values on the colour bar |
-> n | length of the colour bar |
-> QDiagram b V2 n Any |
Render a colour bar by it's self at a given width. Note this
ignores colourBarGap
and colourBarLengthFunction
.
:: (TypeableFloat n, Renderable (Path V2 n) b) | |
=> BoundingBox V2 n | bounding box to place against |
-> ColourBar b n | |
-> ColourMap | |
-> (n, n) | |
-> QDiagram b V2 n Any |
Add a colour bar to an object, using the bounding box for the object.