drawingPart :: Drawing a b -> DPath -> Drawing a b type DPath = [Int] up :: DPath -> DPath maybeDrawingPart :: Drawing a b -> DPath -> Maybe (Drawing a b) replacePart :: Drawing a b -> DPath -> Drawing a b -> Drawing a b updatePart :: Drawing a b -> DPath -> (Drawing a b -> Drawing a b) -> Drawing a b mapLabelDrawing :: (a -> b) -> Drawing a c -> Drawing b c deletePart :: Drawing a b -> [Int] -> Drawing a b drawingAnnots :: Drawing a b -> [(DPath, a)]
These are functions that operate on parts of drawings.
Values of type
DPath are used as references to parts of drawings. The
up returns the path of the parent of a node.
There are two functions for extracting a part with a given path.
drawingPart fails if the path refers to a non-existing
Just part if the part exists,
updatePart replace parts of
drawings. They fail if the path refers to a non-existing part.
mapLabelDrawing applies a function to all the labels in a drawing.
deletePart deletes a part of a drawing.
drawingAnnots returns the paths and labels of the labelled nodes of
replacePart drawing path newpart = updatePart drawing path (const newpart)