diagrams-core-1.3.0.4: Core libraries for diagrams EDSL

Safe Haskell None Haskell2010

Diagrams.Core.Measure

Synopsis

# Documentation

newtype Measured n a Source

'Measured n a' is an object that depends on `local`, `normalized` and `global` scales. The `normalized` and `global` scales are calculated when rendering a diagram.

For attributes, the `local` scale gets multiplied by the average scale of the transform.

Constructors

 Measured Fieldsunmeasure :: (n, n, n) -> a

Instances

 Source Source Source Source Source Source Source Floating a => Floating (Measured n a) Source Fractional a => Fractional (Measured n a) Source Num a => Num (Measured n a) Source Monoid a => Monoid (Measured n a) Source Semigroup a => Semigroup (Measured n a) Source HasOrigin t => HasOrigin (Measured n t) Source Qualifiable a => Qualifiable (Measured n a) Source HasStyle b => HasStyle (Measured n b) Source Juxtaposable a => Juxtaposable (Measured n a) Source MonadReader (n, n, n) (Measured n) Source type Rep (Measured n) = (n, n, n) Source type N (Measured n a) = N a Source type V (Measured n a) = V a Source

type Measure n = Measured n n Source

A measure is a `Measured` number.

fromMeasured :: Num n => n -> n -> Measured n a -> a Source

`fromMeasured globalScale normalizedScale measure -> a`

output :: Num n => n -> Measure n Source

Output units don't change.

local :: Num n => n -> Measure n Source

Local units are scaled by the average scale of a transform.

global :: Num n => n -> Measure n Source

Global units are ?

normalized :: Num n => n -> Measure n Source

Normalized units get scaled so that one normalized unit is the size of the final diagram.

normalised :: Num n => n -> Measure n Source

Just like `normalized` but spelt properly.

scaleLocal :: Num n => n -> Measured n a -> Measured n a Source

Scale the local units of a `Measured` thing.

atLeast :: Ord n => Measure n -> Measure n -> Measure n Source

Calculate the smaller of two measures.

atMost :: Ord n => Measure n -> Measure n -> Measure n Source

Calculate the larger of two measures.