|
|
|
|
Synopsis |
|
|
|
Documentation |
|
|
Two kinds of WNodes:
A WSimple node represents a node in an expression tree, e.g., if, +
A WFrame node represents a panel or frame that displays an expression tree,
function call, or something similar.
| Constructors | | Instances | |
|
|
|
Constructors | | Instances | |
|
|
|
A WGraph consists of WNodes with (sort of) Int-labled edges;
the edge labels serve to order the children of a node.
|
|
|
|
|
Insert new node with given label into graph,
without any new edges;
return the new graph and the new node (number)
|
|
|
Remove a node from the graph; return the updated graph.
|
|
|
|
|
Connect parent to child, using inlet as the order of the child
(0, 1, ...). outlet is ignored, since there is only outlet 0.
As rendered, the parent's inlet-th inlet will have a line
to the child's outlet-th outlet.
This is achieved by inserting a labeled edge (parent, child, inlet)
and clearing any incompatible edge. The incompatibles are:
a. from same parent on same inlet to a different child.
b. from the same parent on a different inlet to the same child.
c. from same child (on same outlet) to a different parent.
NOTE: This is confusing, because, from the data flow perspective,
data flows OUT of the child INTO the parent, but from the
tree in graph perspective, links are directed OUT of the parent
INTO the child. So beware!
|
|
|
Removes a link between parent and child
where the edge was labeled inlet (order of child).
Ignores outlet, which should always be 0.
If child is not the inlet-th child of parent,
well, this is an error, but grDisconnect ignores it.
If toFrameP is true, the child node is
reconnected as a child to its frame
|
|
|
|
|
Extract from a graph the expression with root node n,
returning a Tree of ExprNode.
Use only the WSimple nodes of the graph (and n had better be one).
|
|
|
Extract just the single tree layout node of the given graph node
|
|
|
Extract the tree layout (tree) descended from the given root node
|
|
|
Finding characteristics of the WNodes in a graph
It is an implicit error if there is no label for the node
wlab is like lab with no Maybe: the node *must* have a label
|
|
|
llab is the tree layout node of a WSimple node
|
|
|
The ExprNode represented by the graph node
|
|
|
The repr of the node's value
|
|
|
The result of an evaluated node in an expression tree
|
|
|
The node's BBox
|
|
|
|
|
|
|
Finding the children (nodes, numbers) of a node in a graph :
all children, only WSimple-labeled children, only WFrame-labeled children
When constructing the graph, ordered children of a tree node
get graph node numbers in ascending order; therefore,
sorting the graph nodes gives back the original order of
children in the tree (plus WFrames that are added later,
and those should always be after the simple children)
|
|
|
|
|
|
|
|
|
|
|
|
|
An open node has a WFrame-labeled child
|
|
|
The graph node of the frame that contains the given node
|
|
|
The parent (if any) of a node
|
|
|
|
|
Replace the tree embedded in graph g with root n, with a new tree.
|
|
|
|
|
|
|
Replace the label of a node in a graph
|
|
|
Translate the nodes forming a tree with the given root
|
|
|
Get the parts of a Functoid.
See note on functionToParts (just below).
Seems to be unused ***
|
|
|
Convert a function to its parts.
COULDN'T THIS BE DONE USING the function's implementation,
and not need to use the graph? Then this could go in Functoid.hs
without circular import between it and WGraph
|
|
Produced by Haddock version 2.6.1 |