Copyright | (c) 2011-2013 diagrams-lib team (see LICENSE) |
---|---|

License | BSD-style (see LICENSE) |

Maintainer | diagrams-discuss@googlegroups.com |

Safe Haskell | None |

Language | Haskell2010 |

## Synopsis

- class Alignable a where
- alignBy' :: (InSpace v n a, Fractional n, HasOrigin a) => (v n -> a -> Point v n) -> v n -> n -> a -> a
- defaultBoundary :: (V a ~ v, N a ~ n) => v n -> a -> Point v n
- alignBy :: (InSpace v n a, Fractional n, HasOrigin a) => v n -> n -> a -> a

- alignBy'Default :: (InSpace v n a, Fractional n, HasOrigin a) => (v n -> a -> Point v n) -> v n -> n -> a -> a
- envelopeBoundary :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> Point v n
- traceBoundary :: (V a ~ v, N a ~ n, Num n, Traced a) => v n -> a -> Point v n
- align :: (InSpace v n a, Fractional n, Alignable a, HasOrigin a) => v n -> a -> a
- snug :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> a -> a
- centerV :: (InSpace v n a, Fractional n, Alignable a, HasOrigin a) => v n -> a -> a
- center :: (InSpace v n a, Fractional n, Traversable v, Alignable a, HasOrigin a) => a -> a
- snugBy :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> n -> a -> a
- snugCenterV :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> a -> a
- snugCenter :: (InSpace v n a, Traversable v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a

# Alignable class

Class of things which can be aligned.

alignBy' :: (InSpace v n a, Fractional n, HasOrigin a) => (v n -> a -> Point v n) -> v n -> n -> a -> a #

`alignBy v d a`

moves the origin of `a`

along the vector
`v`

. If `d = 1`

, the origin is moved to the edge of the
boundary in the direction of `v`

; if `d = -1`

, it moves to the
edge of the boundary in the direction of the negation of `v`

.
Other values of `d`

interpolate linearly (so for example, ```
d =
0
```

centers the origin along the direction of `v`

).

defaultBoundary :: (V a ~ v, N a ~ n) => v n -> a -> Point v n #

alignBy :: (InSpace v n a, Fractional n, HasOrigin a) => v n -> n -> a -> a #

## Instances

(V b ~ v, N b ~ n, Metric v, OrderedField n, Alignable b) => Alignable [b] # | |

Defined in Diagrams.Align | |

(V b ~ v, N b ~ n, Metric v, OrderedField n, Alignable b) => Alignable (Set b) # | |

Defined in Diagrams.Align alignBy' :: (InSpace v n (Set b), Fractional n, HasOrigin (Set b)) => (v n -> Set b -> Point v n) -> v n -> n -> Set b -> Set b # defaultBoundary :: (V (Set b) ~ v, N (Set b) ~ n) => v n -> Set b -> Point v n # alignBy :: (InSpace v n (Set b), Fractional n, HasOrigin (Set b)) => v n -> n -> Set b -> Set b # | |

Alignable a => Alignable (Located a) # | |

Defined in Diagrams.Located alignBy' :: (InSpace v n (Located a), Fractional n, HasOrigin (Located a)) => (v n -> Located a -> Point v n) -> v n -> n -> Located a -> Located a # defaultBoundary :: (V (Located a) ~ v, N (Located a) ~ n) => v n -> Located a -> Point v n # alignBy :: (InSpace v n (Located a), Fractional n, HasOrigin (Located a)) => v n -> n -> Located a -> Located a # | |

(InSpace v n a, HasOrigin a, Alignable a) => Alignable (b -> a) # | Although the |

Defined in Diagrams.Align alignBy' :: (InSpace v n (b -> a), Fractional n, HasOrigin (b -> a)) => (v n -> (b -> a) -> Point v n) -> v n -> n -> (b -> a) -> b -> a # defaultBoundary :: (V (b -> a) ~ v, N (b -> a) ~ n) => v n -> (b -> a) -> Point v n # alignBy :: (InSpace v n (b -> a), Fractional n, HasOrigin (b -> a)) => v n -> n -> (b -> a) -> b -> a # | |

(V b ~ v, N b ~ n, Metric v, OrderedField n, Alignable b) => Alignable (Map k b) # | |

Defined in Diagrams.Align alignBy' :: (InSpace v n (Map k b), Fractional n, HasOrigin (Map k b)) => (v n -> Map k b -> Point v n) -> v n -> n -> Map k b -> Map k b # defaultBoundary :: (V (Map k b) ~ v, N (Map k b) ~ n) => v n -> Map k b -> Point v n # alignBy :: (InSpace v n (Map k b), Fractional n, HasOrigin (Map k b)) => v n -> n -> Map k b -> Map k b # | |

(Metric v, OrderedField n) => Alignable (Envelope v n) # | |

Defined in Diagrams.Align alignBy' :: (InSpace v0 n0 (Envelope v n), Fractional n0, HasOrigin (Envelope v n)) => (v0 n0 -> Envelope v n -> Point v0 n0) -> v0 n0 -> n0 -> Envelope v n -> Envelope v n # defaultBoundary :: (V (Envelope v n) ~ v0, N (Envelope v n) ~ n0) => v0 n0 -> Envelope v n -> Point v0 n0 # alignBy :: (InSpace v0 n0 (Envelope v n), Fractional n0, HasOrigin (Envelope v n)) => v0 n0 -> n0 -> Envelope v n -> Envelope v n # | |

(Metric v, OrderedField n) => Alignable (Trace v n) # | |

Defined in Diagrams.Align alignBy' :: (InSpace v0 n0 (Trace v n), Fractional n0, HasOrigin (Trace v n)) => (v0 n0 -> Trace v n -> Point v0 n0) -> v0 n0 -> n0 -> Trace v n -> Trace v n # defaultBoundary :: (V (Trace v n) ~ v0, N (Trace v n) ~ n0) => v0 n0 -> Trace v n -> Point v0 n0 # alignBy :: (InSpace v0 n0 (Trace v n), Fractional n0, HasOrigin (Trace v n)) => v0 n0 -> n0 -> Trace v n -> Trace v n # | |

(Metric v, OrderedField n) => Alignable (Path v n) # | |

Defined in Diagrams.Path alignBy' :: (InSpace v0 n0 (Path v n), Fractional n0, HasOrigin (Path v n)) => (v0 n0 -> Path v n -> Point v0 n0) -> v0 n0 -> n0 -> Path v n -> Path v n # defaultBoundary :: (V (Path v n) ~ v0, N (Path v n) ~ n0) => v0 n0 -> Path v n -> Point v0 n0 # alignBy :: (InSpace v0 n0 (Path v n), Fractional n0, HasOrigin (Path v n)) => v0 n0 -> n0 -> Path v n -> Path v n # | |

(Metric v, Traversable v, OrderedField n) => Alignable (BoundingBox v n) # | |

Defined in Diagrams.BoundingBox alignBy' :: (InSpace v0 n0 (BoundingBox v n), Fractional n0, HasOrigin (BoundingBox v n)) => (v0 n0 -> BoundingBox v n -> Point v0 n0) -> v0 n0 -> n0 -> BoundingBox v n -> BoundingBox v n # defaultBoundary :: (V (BoundingBox v n) ~ v0, N (BoundingBox v n) ~ n0) => v0 n0 -> BoundingBox v n -> Point v0 n0 # alignBy :: (InSpace v0 n0 (BoundingBox v n), Fractional n0, HasOrigin (BoundingBox v n)) => v0 n0 -> n0 -> BoundingBox v n -> BoundingBox v n # | |

(Metric v, OrderedField n, Monoid' m) => Alignable (QDiagram b v n m) # | |

Defined in Diagrams.Align alignBy' :: (InSpace v0 n0 (QDiagram b v n m), Fractional n0, HasOrigin (QDiagram b v n m)) => (v0 n0 -> QDiagram b v n m -> Point v0 n0) -> v0 n0 -> n0 -> QDiagram b v n m -> QDiagram b v n m # defaultBoundary :: (V (QDiagram b v n m) ~ v0, N (QDiagram b v n m) ~ n0) => v0 n0 -> QDiagram b v n m -> Point v0 n0 # alignBy :: (InSpace v0 n0 (QDiagram b v n m), Fractional n0, HasOrigin (QDiagram b v n m)) => v0 n0 -> n0 -> QDiagram b v n m -> QDiagram b v n m # |

alignBy'Default :: (InSpace v n a, Fractional n, HasOrigin a) => (v n -> a -> Point v n) -> v n -> n -> a -> a #

envelopeBoundary :: (V a ~ v, N a ~ n, Enveloped a) => v n -> a -> Point v n #

Some standard functions which can be used as the `boundary`

argument to
`alignBy'`

.

# General alignment functions

align :: (InSpace v n a, Fractional n, Alignable a, HasOrigin a) => v n -> a -> a #

`align v`

aligns an enveloped object along the edge in the
direction of `v`

. That is, it moves the local origin in the
direction of `v`

until it is on the edge of the envelope. (Note
that if the local origin is outside the envelope to begin with,
it may have to move "backwards".)

snug :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> a -> a #

Like align but uses trace.

centerV :: (InSpace v n a, Fractional n, Alignable a, HasOrigin a) => v n -> a -> a #

`centerV v`

centers an enveloped object along the direction of
`v`

.

center :: (InSpace v n a, Fractional n, Traversable v, Alignable a, HasOrigin a) => a -> a #

`center`

centers an enveloped object along all of its basis vectors.

snugBy :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> n -> a -> a #

Version of `alignBy`

specialized to use `traceBoundary`

snugCenterV :: (InSpace v n a, Fractional n, Alignable a, Traced a, HasOrigin a) => v n -> a -> a #

Like `centerV`

using trace.

snugCenter :: (InSpace v n a, Traversable v, Fractional n, Alignable a, HasOrigin a, Traced a) => a -> a #

Like `center`

using trace.