lp-diagrams-1.0: An EDSL for diagrams based based on linear constraints

Safe HaskellNone
LanguageHaskell2010

Graphics.Diagrams.Core

Synopsis

Documentation

type Solution = Map Var Double Source

Solution of the linear programming problem

type Expr = LinExpr Var Constant Source

Expressions are linear functions of the variables

newtype Decoration Source

Tikz decoration

Constructors

Decoration String 

type Color = String Source

Tikz color

data LineCap Source

Tikz line cap

Constructors

ButtCap 
RectCap 
RoundCap 

data LineJoin Source

Tikz line join

Constructors

MiterJoin 
RoundJoin 
BevelJoin 

type DashPattern = [(Constant, Constant)] Source

Tikz dash pattern

data BoxSpec Source

Size of a box, in points. boxDepth is how far the baseline is from the bottom. boxHeight is how far the baseline is from the top. (These are TeX meanings)

Constructors

BoxSpec 

Instances

data Backend lab m Source

Constructors

Backend 

Fields

_tracePath :: PathOptions -> FrozenPath -> m ()
 
_traceLabel :: forall location x. Monad x => (location -> (FrozenPoint -> m ()) -> x ()) -> (forall a. m a -> x a) -> location -> lab -> x BoxSpec
 

tracePath :: forall lab m. Lens' (Backend lab m) (PathOptions -> FrozenPath -> m ()) Source

traceLabel :: forall lab m location x. Monad x => Getter (Backend lab m) ((location -> (FrozenPoint -> m ()) -> x ()) -> (forall a. m a -> x a) -> location -> lab -> x BoxSpec) Source

data Env lab m Source

Constructors

Env 

Fields

_diaTightness :: Constant

Multiplicator to minimize constraints

_diaPathOptions :: PathOptions
 
_diaBackend :: Backend lab m
 

Instances

Monad m => MonadReader (Env lab m) (Diagram lab m) Source 

diaTightness :: forall lab m. Lens' (Env lab m) Constant Source

diaPathOptions :: forall lab m. Lens' (Env lab m) PathOptions Source

diaBackend :: forall lab m lab m. Lens (Env lab m) (Env lab m) (Backend lab m) (Backend lab m) Source

data Freeze m where Source

Constructors

Freeze :: forall t m. Functor t => (t Constant -> m ()) -> t Expr -> Freeze m 

Instances

newtype Diagram lab m a Source

Constructors

Dia (RWST (Env lab m) [Freeze m] (Var, LPState) m a) 

Instances

Monad m => MonadState LPState (Diagram lab m) Source 
Monad m => MonadWriter [Freeze m] (Diagram lab m) Source 
Monad m => Monad (Diagram lab m) Source 
Functor m => Functor (Diagram lab m) Source 
Monad m => Applicative (Diagram lab m) Source 
Monad m => MonadReader (Env lab m) (Diagram lab m) Source 

freeze :: (Functor t, Monad m) => t Expr -> (t Constant -> m ()) -> Diagram lab m () Source

relax :: Monad m => Constant -> Diagram lab m a -> Diagram lab m a Source

tighten :: Monad m => Constant -> Diagram lab m a -> Diagram lab m a Source

newVars :: Monad m => [VarKind] -> Diagram lab m [Expr] Source

runDiagram :: Monad m => Backend lab m -> Diagram lab m a -> m a Source

(*-) :: Module Constant a => Constant -> a -> a infixr 6 Source

avg :: Module Constant a => [a] -> a Source

absoluteValue :: Monad m => Expr -> Diagram lab m Expr Source

Absolute value, which can be MINIMIZED or put and upper bound on (but not the other way around).

satAll :: Monad m => (Expr -> a -> Diagram lab m b) -> [a] -> Diagram lab m Expr Source

maximVar :: Monad m => [Expr] -> Diagram lab m Expr Source

Minimum or maximum of a list of expressions.

minimVar :: Monad m => [Expr] -> Diagram lab m Expr Source

Minimum or maximum of a list of expressions.

(===) :: Expr -> Expr -> Monad m => Diagram lab m () infix 4 Source

(>==) :: Expr -> Expr -> Monad m => Diagram lab m () infix 4 Source

(<==) :: Expr -> Expr -> Monad m => Diagram lab m () infix 4 Source

(=~=) :: Monad m => Expr -> Expr -> Diagram lab m () Source

minimize the distance between expressions

minimize :: Monad m => Expr -> Diagram lab m () Source

maximize :: Monad m => Expr -> Diagram lab m () Source

drawText :: Monad m => Point' Expr -> lab -> Diagram lab m BoxSpec Source

diaRaw :: Monad m => m a -> Diagram lab m a Source