diagrams-core-1.4.1.1: Core libraries for diagrams EDSL

Safe HaskellNone
LanguageHaskell2010

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 

Fields

Instances

Profunctor Measured Source # 

Methods

dimap :: (a -> b) -> (c -> d) -> Measured b c -> Measured a d #

lmap :: (a -> b) -> Measured b c -> Measured a c #

rmap :: (b -> c) -> Measured a b -> Measured a c #

(#.) :: Coercible * c b => (b -> c) -> Measured a b -> Measured a c #

(.#) :: Coercible * b a => Measured b c -> (a -> b) -> Measured a c #

Monad (Measured n) Source # 

Methods

(>>=) :: Measured n a -> (a -> Measured n b) -> Measured n b #

(>>) :: Measured n a -> Measured n b -> Measured n b #

return :: a -> Measured n a #

fail :: String -> Measured n a #

Functor (Measured n) Source # 

Methods

fmap :: (a -> b) -> Measured n a -> Measured n b #

(<$) :: a -> Measured n b -> Measured n a #

Applicative (Measured n) Source # 

Methods

pure :: a -> Measured n a #

(<*>) :: Measured n (a -> b) -> Measured n a -> Measured n b #

liftA2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c #

(*>) :: Measured n a -> Measured n b -> Measured n b #

(<*) :: Measured n a -> Measured n b -> Measured n a #

Distributive (Measured n) Source # 

Methods

distribute :: Functor f => f (Measured n a) -> Measured n (f a) #

collect :: Functor f => (a -> Measured n b) -> f a -> Measured n (f b) #

distributeM :: Monad m => m (Measured n a) -> Measured n (m a) #

collectM :: Monad m => (a -> Measured n b) -> m a -> Measured n (m b) #

Representable (Measured n) Source # 

Associated Types

type Rep (Measured n :: * -> *) :: * #

Methods

tabulate :: (Rep (Measured n) -> a) -> Measured n a #

index :: Measured n a -> Rep (Measured n) -> a #

Additive (Measured n) Source # 

Methods

zero :: Num a => Measured n a #

(^+^) :: Num a => Measured n a -> Measured n a -> Measured n a #

(^-^) :: Num a => Measured n a -> Measured n a -> Measured n a #

lerp :: Num a => a -> Measured n a -> Measured n a -> Measured n a #

liftU2 :: (a -> a -> a) -> Measured n a -> Measured n a -> Measured n a #

liftI2 :: (a -> b -> c) -> Measured n a -> Measured n b -> Measured n c #

Floating a => Floating (Measured n a) Source # 

Methods

pi :: Measured n a #

exp :: Measured n a -> Measured n a #

log :: Measured n a -> Measured n a #

sqrt :: Measured n a -> Measured n a #

(**) :: Measured n a -> Measured n a -> Measured n a #

logBase :: Measured n a -> Measured n a -> Measured n a #

sin :: Measured n a -> Measured n a #

cos :: Measured n a -> Measured n a #

tan :: Measured n a -> Measured n a #

asin :: Measured n a -> Measured n a #

acos :: Measured n a -> Measured n a #

atan :: Measured n a -> Measured n a #

sinh :: Measured n a -> Measured n a #

cosh :: Measured n a -> Measured n a #

tanh :: Measured n a -> Measured n a #

asinh :: Measured n a -> Measured n a #

acosh :: Measured n a -> Measured n a #

atanh :: Measured n a -> Measured n a #

log1p :: Measured n a -> Measured n a #

expm1 :: Measured n a -> Measured n a #

log1pexp :: Measured n a -> Measured n a #

log1mexp :: Measured n a -> Measured n a #

Fractional a => Fractional (Measured n a) Source # 

Methods

(/) :: Measured n a -> Measured n a -> Measured n a #

recip :: Measured n a -> Measured n a #

fromRational :: Rational -> Measured n a #

Num a => Num (Measured n a) Source # 

Methods

(+) :: Measured n a -> Measured n a -> Measured n a #

(-) :: Measured n a -> Measured n a -> Measured n a #

(*) :: Measured n a -> Measured n a -> Measured n a #

negate :: Measured n a -> Measured n a #

abs :: Measured n a -> Measured n a #

signum :: Measured n a -> Measured n a #

fromInteger :: Integer -> Measured n a #

Semigroup a => Semigroup (Measured n a) Source # 

Methods

(<>) :: Measured n a -> Measured n a -> Measured n a #

sconcat :: NonEmpty (Measured n a) -> Measured n a #

stimes :: Integral b => b -> Measured n a -> Measured n a #

Monoid a => Monoid (Measured n a) Source # 

Methods

mempty :: Measured n a #

mappend :: Measured n a -> Measured n a -> Measured n a #

mconcat :: [Measured n a] -> Measured n a #

HasOrigin t => HasOrigin (Measured n t) Source # 

Methods

moveOriginTo :: Point (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t Source #

(InSpace v n t, Transformable t, HasLinearMap v, Floating n) => Transformable (Measured n t) Source # 

Methods

transform :: Transformation (V (Measured n t)) (N (Measured n t)) -> Measured n t -> Measured n t Source #

HasStyle b => HasStyle (Measured n b) Source # 

Methods

applyStyle :: Style (V (Measured n b)) (N (Measured n b)) -> Measured n b -> Measured n b Source #

Qualifiable a => Qualifiable (Measured n a) Source # 

Methods

(.>>) :: IsName a => a -> Measured n a -> Measured n a Source #

Juxtaposable a => Juxtaposable (Measured n a) Source # 

Methods

juxtapose :: Vn (Measured n a) -> Measured n a -> Measured n a -> Measured n a Source #

MonadReader (n, n, n) (Measured n) Source # 

Methods

ask :: Measured n (n, n, n) #

local :: ((n, n, n) -> (n, n, n)) -> Measured n a -> Measured n a #

reader :: ((n, n, n) -> a) -> Measured n a #

type Rep (Measured n) Source # 
type Rep (Measured n) = (n, n, n)
type N (Measured n a) Source # 
type N (Measured n a) = N a
type V (Measured n a) Source # 
type V (Measured n a) = V a

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 :: 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 scaled so that they are interpreted relative to the size of the final rendered diagram.

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.