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 |
Determine how to scale an axis.
- data AxisScaling n
- data ScaleMode
- data UniformScaleStrategy
- data Extending n
- = AbsoluteExtend n
- | RelativeExtend n
- noExtend :: Num n => Extending n
- class HasAxisScaling f a where
- data LogScale
- logNumber :: Floating a => LogScale -> a -> a
- logPoint :: (Additive v, Floating n) => v LogScale -> Point v n -> Point v n
- logDeform :: (InSpace v n a, Foldable v, Floating n, Deformable a a) => v LogScale -> a -> a
- calculateBounds :: OrderedField n => AxisScaling n -> Maybe (n, n) -> (n, n)
- calculateScaling :: (HasLinearMap v, OrderedField n, Applicative v) => v (AxisScaling n) -> BoundingBox v n -> (v (n, n), Transformation v n, Transformation v n)
Axis scale
data AxisScaling n Source #
Data type used that concerns everything to do with the size or scale of the axis.
HasAxisScaling f (AxisScaling n) Source # | |
Fractional n => Default (AxisScaling n) Source # | |
type N (AxisScaling n) Source # | |
How the axis should be scaled when not all dimensions are set.
data UniformScaleStrategy Source #
?
How much to extend the bounds beyond any inferred bounds.
class HasAxisScaling f a where Source #
Class of things that have an AxisScaling
.
axisScaling :: LensLike' f a (AxisScaling (N a)) Source #
The way to scale in one direction.
scaleAspectRatio :: Functor f => LensLike' f a (Maybe (N a)) Source #
The ratio relative to other axis. If no ratios are set, the ratio
is not enforced. If at least one is set, Nothing
ratios are
1
.
scaleMode :: Functor f => LensLike' f a ScaleMode Source #
The mode to determine how to scale the bounds in a direction.
Choose between AutoScale
, NoScale
, Stretch
or
UniformScale
.
logScale :: Functor f => LensLike' f a LogScale Source #
Whether the axis uses LogAxis
or LinearAxis
.
Default
is LinearAxis
.
axisExtend :: Functor f => LensLike' f a (Extending (N a)) Source #
How much to extend the bounds over infered bounds. This is
ignored if a boundMax
or boundMin
is set.
boundMin :: Functor f => LensLike' f a (Maybe (N a)) Source #
The maximum bound the axis. There are helper functions for setting a minimum bound for a specific axis.
xMin
::Lens'
(Axis
bV2
Double
) (Maybe
Double
)yMin
::Lens'
(Axis
bV2
Double
) (Maybe
Double
)
Default is Nothing
.
boundMax :: Functor f => LensLike' f a (Maybe (N a)) Source #
The maximum bound the axis. There are helper functions for setting a maximum bound specific axis.
xMax
::Lens'
(Axis
bV2
Double
) (Maybe
Double
)yMax
::Lens'
(Axis
bV2
Double
) (Maybe
Double
)rMax
::Lens'
(Axis
b 'PolarDouble
) (Maybe
Double
)
Default is Nothing
.
renderSize :: Functor f => LensLike' f a (Maybe (N a)) Source #
The size of the rendered axis. Default is
.Just
400
HasAxisScaling f (AxisScaling n) Source # | |
(Applicative f, Traversable c) => HasAxisScaling f (Axis b c n) Source # | |
Functor f => HasAxisScaling f (SingleAxis b v n) Source # | |
Log scales
Should the axis be on a logarithmic scale. The Default
is
LinearAxis
.
logNumber :: Floating a => LogScale -> a -> a Source #
Log the number for LogAxis
, do nothing for LinearAxis
.
logPoint :: (Additive v, Floating n) => v LogScale -> Point v n -> Point v n Source #
Transform a point according to the axis scale. Does nothing for linear scales.
logDeform :: (InSpace v n a, Foldable v, Floating n, Deformable a a) => v LogScale -> a -> a Source #
Deform an object according to the axis scale. Does nothing for linear scales.
Low level calculations
These functions are used by Plots.Axis.Render.
:: OrderedField n | |
=> AxisScaling n | Scaling to use for this axis |
-> Maybe (n, n) | Inferred bounds (from any plots) |
-> (n, n) | Lower and upper bounds to use for this axis |
Calculating the bounds for an axis.
:: (HasLinearMap v, OrderedField n, Applicative v) | |
=> v (AxisScaling n) | axis scaling options |
-> BoundingBox v n | bounding box from the axis plots |
-> (v (n, n), Transformation v n, Transformation v n) |
Calculate the scaling for the axis.
The result returns:
- The final bounds for the axis
- scale to match desired
scaleAspectRatio
- scale to match desired
asSizeSpec