Maintainer | diagrams-discuss@googlegroups.com |
---|---|
Safe Haskell | None |
This module provides tools for compiling QDiagrams
into a more
convenient and optimized tree form, suitable for use by backends.
- data RNode b v a
- = RStyle (Style v)
- | RFrozenTr (Transformation v)
- | RAnnot a
- | RPrim (Transformation v) (Prim b v)
- | REmpty
- type RTree b v a = Tree (RNode b v a)
- toRTree :: HasLinearMap v => QDiagram b v m -> RTree b v Annotation
- toDTree :: HasLinearMap v => QDiagram b v m -> Maybe (DTree b v Annotation)
- fromDTree :: HasLinearMap v => DTree b v Annotation -> RTree b v Annotation
Tools for backends
RStyle (Style v) | A style node. |
RFrozenTr (Transformation v) | A "frozen" transformation, i.e. one which
was applied after a call to |
RAnnot a | |
RPrim (Transformation v) (Prim b v) | A primitive, along with the (non-frozen) transformation which applies to it. |
REmpty |
toRTree :: HasLinearMap v => QDiagram b v m -> RTree b v AnnotationSource
Compile a QDiagram
into an RTree
. Suitable for use by
backends when implementing renderData
.
Internals
toDTree :: HasLinearMap v => QDiagram b v m -> Maybe (DTree b v Annotation)Source
Convert a QDiagram
into a raw tree.
fromDTree :: HasLinearMap v => DTree b v Annotation -> RTree b v AnnotationSource
Convert a DTree
to an RTree
which can be used dirctly by backends.
A DTree
includes nodes of type DTransform (Split (Transformation v))
;
in the RTree
the frozen part of the transform is put in a node of type
RFrozenTr (Transformation v)
and the unfrozen part is pushed down until
it is either frozen or reaches a primitive node.