| Package | flare.vis.data |
| Class | public class Tree |
| Inheritance | Tree Data flash.events.EventDispatcher |
| Property | Defined by | ||
|---|---|---|---|
![]() | directedEdges : Boolean The default directedness of new edges.
| Data | |
![]() | edges : DataList
The collection of EdgeSprites.
| Data | |
![]() | length : int The total number of items (nodes and edges) in the data.
| Data | |
![]() | nodes : DataList
The collection of NodeSprites.
| Data | |
| root : NodeSprite
[write-only]
Sets the root node of this tree.
| Tree | ||
| tree : Tree
This property simply points back to this object.
| Tree | ||
![]() | treeEdgeWeight : Function The edge weight function for computing a minimum spanning tree.
| Data | |
![]() | treePolicy : String The spanning tree creation policy.
| Data | |
| Method | Defined by | ||
|---|---|---|---|
|
Add a node to the tree.
| Tree | ||
|
Adds the given edge as a child edge between a node already
in the tree and another node not yet in the tree.
| Tree | ||
![]() |
Add an edge to this data set.
| Data | |
![]() |
addEdgeFor(source:NodeSprite, target:NodeSprite, directed:Object = null, data:Object = null):EdgeSprite
Creates a new edge between the given nodes and adds it to the
data collection.
| Data | |
![]() |
Adds a new data group.
| Data | |
![]() |
addNode(d:Object = null):NodeSprite
Adds a node to this data collection.
| Data | |
|
Creates and returns a new root NodeSprite for the tree.
| Tree | ||
|
clear():void
Clears the tree, removing all nodes and edges.
| Tree | ||
![]() |
contains(d:DataSprite):Boolean
Indicates if this Data object contains the input DataSprite.
| Data | |
|
countLeaves():int
Counts the number of leaf nodes in the tree.
| Tree | ||
![]() |
createEdges(sortBy:* = null, groupBy:Boolean = null, ignoreExistingEdges:* = false):void
Generates edges for this data collection that connect the nodes
according to the input properties.
| Data | |
![]() |
[static]
Creates a new Data instance from an array of tuples.
| Data | |
![]() |
[static]
Creates a new Data instance from a data set.
| Data | |
![]() |
Retrieves the data group with the given name.
| Data | |
![]() |
remove(d:DataSprite):Boolean
Removes a DataSprite (node or edge) from this data collection.
| Data | |
|
removeEdge(e:EdgeSprite):Boolean
Removes an edge from tree tree, removing the entire
subtree rooted at the child node adjacent to the edge.
| Tree | ||
![]() |
removeGroup(name:String):DataList
Removes a data group.
| Data | |
|
removeNode(n:NodeSprite):Boolean
Removes a node from the tree, removing the entire
subtree rooted at that node.
| Tree | ||
|
swapToRoot(n:NodeSprite):void
Continuously swaps the given node with its parent node
until it is the root.
| Tree | ||
|
swapWithParent(n:NodeSprite):void
Swaps the given node with its parent node.
| Tree | ||
![]() |
visit(v:Function, group:String = null, filter:Boolean = null, reverse:* = false):Boolean
Visit items, invoking a function on all visited elements.
| Data | |
| Method | Defined by | ||
|---|---|---|---|
|
addDescendants(n:NodeSprite):void
Registers all tree descendants with this Tree instance.
| Tree | ||
![]() |
Internal function for creating a new edge.
| Data | |
![]() |
newNode(data:Object):NodeSprite
Internal function for creating a new node.
| Data | |
| root | property |
root:NodeSprite [write-only]Sets the root node of this tree. This property can only be set when the tree does not yet have a root node.
Implementation public function set root(value:NodeSprite):void
| tree | property |
tree:Tree [read-write]This property simply points back to this object.
Implementation public function get tree():Tree
public function set tree(value:Tree):void
| addChild | () | method |
public function addChild(p:NodeSprite, c:NodeSprite = null):NodeSpriteAdd a node to the tree. If the child node argument is null, a new NodeSprite will be created. A new EdgeSprite connecting the nodes will be created. Returns the new child node.
Parametersp:NodeSprite — the parent node
|
|
c:NodeSprite (default = null) — the child node. If null, a new child node is created.
|
NodeSprite —
the new child node
|
| addChildEdge | () | method |
public function addChildEdge(e:EdgeSprite):EdgeSpriteAdds the given edge as a child edge between a node already in the tree and another node not yet in the tree.
Parameterse:EdgeSprite — the edge to add to the tree
|
EdgeSprite —
the newly added edge
|
| addDescendants | () | method |
protected function addDescendants(n:NodeSprite):voidRegisters all tree descendants with this Tree instance.
Parametersn:NodeSprite — a sub-tree root that has already been added to this Tree
|
| addRoot | () | method |
public function addRoot():NodeSpriteCreates and returns a new root NodeSprite for the tree. If the tree already has a root, this method throws an error.
ReturnsNodeSprite —
the newly added root
|
| clear | () | method |
public override function clear():voidClears the tree, removing all nodes and edges.
| countLeaves | () | method |
public function countLeaves():intCounts the number of leaf nodes in the tree.
Returnsint — the number of leaf nodes
|
| removeEdge | () | method |
public override function removeEdge(e:EdgeSprite):BooleanRemoves an edge from tree tree, removing the entire subtree rooted at the child node adjacent to the edge.
Parameterse:EdgeSprite — the edge to remove from the tree
|
Boolean — true if the edge was successfully removed, false otherwise
|
| removeNode | () | method |
public override function removeNode(n:NodeSprite):BooleanRemoves a node from the tree, removing the entire subtree rooted at that node.
Parametersn:NodeSprite — the node to remove
|
Boolean — true if the node was successfully removed, false otherwise
|
| swapToRoot | () | method |
public function swapToRoot(n:NodeSprite):voidContinuously swaps the given node with its parent node until it is the root.
WARNING: this method causes connecting edges to be reconfigured. If this tree is a spanning tree, this can cause havoc.
Parametersn:NodeSprite — the node to swap with its parent until it becomes the root
|
| swapWithParent | () | method |
public function swapWithParent(n:NodeSprite):voidSwaps the given node with its parent node.
WARNING: this method causes connecting edges to be reconfigured. If this tree is a spanning tree, this can cause havoc.
Parametersn:NodeSprite — the node to swap with its parent
|