Packagecom.flextoolbox.controls
Classpublic class TreeMap
InheritanceTreeMap Inheritance mx.core.UIComponent
ImplementsITreeMapBranchRenderer

A treemap is a space-constrained visualization of hierarchical structures. It is very effective in showing attributes of leaf nodes using size and color coding.

See also

http://en.wikipedia.org/wiki/Treemapping
http://www.cs.umd.edu/hcil/treemap-history/


Public Properties
 PropertyDefined by
  branchRenderer : ClassFactory
The custom branch renderer for the control.
TreeMap
  colorField : String
The name of the field in the data provider items to use as the color.
TreeMap
  colorFunction : Function
A user-supplied function to run on each item to determine its color.
TreeMap
  data : Object
Used to render data when the TreeMap is a branch renderer for a parent TreeMap.
TreeMap
  dataDescriptor : ITreeDataDescriptor
Returns the current ITreeDataDescriptor.
TreeMap
  dataProvider : Object
Set of data to be viewed.
TreeMap
  deriveBranchWeightFromLeaves : Boolean
If true, the weight value of a branch will be the sum of its children.
TreeMap
  header : TreeMapHeader
The header.
TreeMap
  headerToolTip : String
A TreeMap may display a tooltip on its header.
TreeMap
  label : String
A TreeMap may display a label in its header.
TreeMap
  labelField : String
The name of the field in the data provider items to display as the label of the data renderer.
TreeMap
  labelFunction : Function
A user-supplied function to run on each item to determine its label.
TreeMap
  layoutStrategy : ITreeMapLayoutStrategy
The custom layout algorithm for the control.
TreeMap
  maximumDepth : int
If value is >= 0, the treemap will only render branches to a specific depth.
TreeMap
  nodeRenderer : ClassFactory
The custom node renderer for the control.
TreeMap
  selectable : Boolean
Indicates if the node's within the TreeMap can be selected by the user.
TreeMap
  selected : Boolean
If this TreeMap is a renderer for a parent TreeMap, it may be the selected node.
TreeMap
  selectedItem : Object
The data for the currently selected node.
TreeMap
  toolTipField : String
The name of the field in the data provider items to display as the ToolTip of the data renderer.
TreeMap
  toolTipFunction : Function
A user-supplied function to run on each item to determine its ToolTip.
TreeMap
  weightField : String
The name of the field in the data provider items to use in weight calculations.
TreeMap
  weightFunction : Function
A user-supplied function to run on each item to determine its weight.
TreeMap
  zoomOutType : String
Determines the way that zoom out actions work.
TreeMap
Protected Properties
 PropertyDefined by
  border : IFlexDisplayObject
The skinnable border.
TreeMap
  collection : ICollectionView
An ICollectionView that represents the data provider.
TreeMap
  zoomed : Boolean = false
TreeMap
  zoomedNode : ITreeMapNodeRenderer
The node that is currently zoomed.
TreeMap
Public Methods
 MethodDefined by
  
Constructor.
TreeMap
  
itemToColor(item:Object):uint
Determines the color value for an item from the data provider.
TreeMap
  
itemToLabel(item:Object):String
Determines the label text for an item from the data provider.
TreeMap
  
Returns the node renderer that displays specific data.
TreeMap
  
itemToToolTip(item:Object):String
Determines the tooltip text for an item from the data provider.
TreeMap
  
itemToWeight(item:Object):Number
Determines the weight value for an item from the data provider.
TreeMap
Protected Methods
 MethodDefined by
  
containsItem(item:Object, data:Object = null):Boolean
Searches the data provider for the specified item.
TreeMap
Events
 EventSummaryDefined by
   Dispatched when the selectedIndex or selectedItem property changes as a result of user interaction.TreeMap
   Dispatched when the user clicks on an node in the control.TreeMap
   Dispatched when the user double-clicks on an node in the control.TreeMap
   Dispatched when the user rolls the mouse pointer out of an node in the control.TreeMap
   Dispatched when the user rolls the mouse pointer over an node in the control.TreeMap
Styles
 StyleDescriptionDefined by
  
borderSkin
Type: Class
The border skin of the component.
TreeMap
  
borderStyle
Type: String
The style name for the border skin.
TreeMap
  
branchStyleName
Type: String   CSS Inheritance: yes
Sets the style name for all branches.
TreeMap
  
headerStyleName
Type: String   CSS Inheritance: yes
Sets the style name for the header.
TreeMap
  
nodeStyleName
Type: String   CSS Inheritance: yes
Sets the style name for all standard nodes.
TreeMap
Property detail
borderproperty
protected var border:IFlexDisplayObject

The skinnable border.

branchRendererproperty 
branchRenderer:ClassFactory  [read-write]

The custom branch renderer for the control. You can specify a drop-in, inline, or custom branch renderer. Unlike the renderers used by Tree components, nodes and branches in a TreeMap are quite different visually and functionally. As a result, it's easier to specify and customize seperate renderers for either type.

The default branch renderer is TreeMap.

Implementation
    public function get branchRenderer():ClassFactory
    public function set branchRenderer(value:ClassFactory):void
collectionproperty 
protected var collection:ICollectionView

An ICollectionView that represents the data provider. When you set the dataProvider property, Flex wraps the data provider as necessary to support the ICollectionView interface and sets this property to the result. The TreeMap class then uses this property to access data in the provider. When you get the dataProvider property, Flex returns this value.

colorFieldproperty 
colorField:String  [read-write]

The name of the field in the data provider items to use as the color.

This property can be used as the source for data binding.

Implementation
    public function get colorField():String
    public function set colorField(value:String):void
colorFunctionproperty 
colorFunction:Function  [read-write]

A user-supplied function to run on each item to determine its color.

The color function takes one argument, the item in the data provider. It returns a uint.

colorFunction(item:Object):uint

This property can be used as the source for data binding.

Implementation
    public function get colorFunction():Function
    public function set colorFunction(value:Function):void
dataproperty 
data:Object  [read-write]

Used to render data when the TreeMap is a branch renderer for a parent TreeMap. For most applications, it is recommended that you use the dataProvider property.

Implementation
    public function get data():Object
    public function set data(value:Object):void

See also

dataDescriptorproperty 
dataDescriptor:ITreeDataDescriptor  [read-write]

Returns the current ITreeDataDescriptor.

The default value is DefaultDataDescriptor.

Implementation
    public function get dataDescriptor():ITreeDataDescriptor
    public function set dataDescriptor(value:ITreeDataDescriptor):void
dataProviderproperty 
dataProvider:Object  [read-write]

Set of data to be viewed. This property lets you use most types of objects as data providers. If you set the dataProvider property to an Array, it will be converted to an ArrayCollection. If you set the property to an XML object, it will be converted into an XMLListCollection with only one item. If you set the property to an XMLList, it will be converted to an XMLListCollection. If you set the property to an object that implements the ICollectionView interface, the object will be used directly.

As a consequence of the conversions, when you get the dataProvider property, it will always be an ICollectionView, and therefore not necessarily be the type of object you used to set the property. This behavor is important to understand if you want to modify the data in the data provider: changes to the original data may not be detected, but changes to the ICollectionView object that you get back from the dataProvider property will be detected.

The default value is null.

This property can be used as the source for data binding.

Implementation
    public function get dataProvider():Object
    public function set dataProvider(value:Object):void

See also

mx.collections.ICollectionView
deriveBranchWeightFromLeavesproperty 
deriveBranchWeightFromLeaves:Boolean  [read-write]

If true, the weight value of a branch will be the sum of its children. If false, a branch's weight value is derived from the weightField or weightFunction.

This property can be used as the source for data binding.

Implementation
    public function get deriveBranchWeightFromLeaves():Boolean
    public function set deriveBranchWeightFromLeaves(value:Boolean):void
headerproperty 
public var header:TreeMapHeader

The header. Contains a label. Works like the Accordion's header.

See also

mx.containers.Accordion
headerToolTipproperty 
headerToolTip:String  [read-write]

A TreeMap may display a tooltip on its header.

Implementation
    public function get headerToolTip():String
    public function set headerToolTip(value:String):void
labelproperty 
label:String  [read-write]

A TreeMap may display a label in its header.

Implementation
    public function get label():String
    public function set label(value:String):void
labelFieldproperty 
labelField:String  [read-write]

The name of the field in the data provider items to display as the label of the data renderer. As a special case, if the nodes are TreeMap components, this function applies to the TreeMap label.

This property can be used as the source for data binding.

Implementation
    public function get labelField():String
    public function set labelField(value:String):void
labelFunctionproperty 
labelFunction:Function  [read-write]

A user-supplied function to run on each item to determine its label.

The label function takes one argument, the item in the data provider. It returns a String.

labelFunction(item:Object):String

This property can be used as the source for data binding.

Implementation
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void
layoutStrategyproperty 
layoutStrategy:ITreeMapLayoutStrategy  [read-write]

The custom layout algorithm for the control.

The default alogrithm is Squarify.

Implementation
    public function get layoutStrategy():ITreeMapLayoutStrategy
    public function set layoutStrategy(value:ITreeMapLayoutStrategy):void
maximumDepthproperty 
maximumDepth:int  [read-write]

If value is >= 0, the treemap will only render branches to a specific depth.

Implementation
    public function get maximumDepth():int
    public function set maximumDepth(value:int):void
nodeRendererproperty 
nodeRenderer:ClassFactory  [read-write]

The custom node renderer for the control. You can specify a drop-in, inline, or custom node renderer.

The default node renderer is TreeMapNodeRenderer.

Implementation
    public function get nodeRenderer():ClassFactory
    public function set nodeRenderer(value:ClassFactory):void
selectableproperty 
selectable:Boolean  [read-write]

Indicates if the node's within the TreeMap can be selected by the user.

Implementation
    public function get selectable():Boolean
    public function set selectable(value:Boolean):void
selectedproperty 
selected:Boolean  [read-write]

If this TreeMap is a renderer for a parent TreeMap, it may be the selected node.

Implementation
    public function get selected():Boolean
    public function set selected(value:Boolean):void
selectedItemproperty 
selectedItem:Object  [read-write]

The data for the currently selected node. May be the data for a grandchild or deeper ancestor.

This property can be used as the source for data binding.

Implementation
    public function get selectedItem():Object
    public function set selectedItem(value:Object):void
toolTipFieldproperty 
toolTipField:String  [read-write]

The name of the field in the data provider items to display as the ToolTip of the data renderer.

This property can be used as the source for data binding.

Implementation
    public function get toolTipField():String
    public function set toolTipField(value:String):void
toolTipFunctionproperty 
toolTipFunction:Function  [read-write]

A user-supplied function to run on each item to determine its ToolTip.

The tooltip function takes one argument, the item in the data provider. It returns a String.

toolTipFunction(item:Object):String

This property can be used as the source for data binding.

Implementation
    public function get toolTipFunction():Function
    public function set toolTipFunction(value:Function):void
weightFieldproperty 
weightField:String  [read-write]

The name of the field in the data provider items to use in weight calculations.

This property can be used as the source for data binding.

Implementation
    public function get weightField():String
    public function set weightField(value:String):void
weightFunctionproperty 
weightFunction:Function  [read-write]

A user-supplied function to run on each item to determine its weight.

The weight function takes one arguments, the item in the data provider. It returns a Number.

weightFunction(item:Object):Number

This property can be used as the source for data binding.

Implementation
    public function get weightFunction():Function
    public function set weightFunction(value:Function):void
zoomedproperty 
protected var zoomed:Boolean = false
zoomedNodeproperty 
protected var zoomedNode:ITreeMapNodeRenderer

The node that is currently zoomed. Null if none are zoomed.

zoomOutTypeproperty 
zoomOutType:String  [read-write]

Determines the way that zoom out actions work. Values are defined by the constants in the TreeMapZoomOutType class.

Implementation
    public function get zoomOutType():String
    public function set zoomOutType(value:String):void
Constructor detail
TreeMap()constructor
public function TreeMap()

Constructor.

Method detail
containsItem()method
protected function containsItem(item:Object, data:Object = null):Boolean

Searches the data provider for the specified item.

Parameters
item:Object — this item to search for within the data provider
 
data:Object (default = null) — the current recursive position within the data provider

Returns
Boolean
itemToColor()method 
public function itemToColor(item:Object):uint

Determines the color value for an item from the data provider.

Parameters
item:Object

Returns
uint
itemToLabel()method 
public function itemToLabel(item:Object):String

Determines the label text for an item from the data provider.

Parameters
item:Object

Returns
String
itemToRenderer()method 
public function itemToRenderer(data:Object):ITreeMapNodeRenderer

Returns the node renderer that displays specific data.

Parameters
data:Object — the data for which to find a matching node renderer

Returns
ITreeMapNodeRenderer — the node renderer that matches the data
itemToToolTip()method 
public function itemToToolTip(item:Object):String

Determines the tooltip text for an item from the data provider.

Parameters
item:Object

Returns
String
itemToWeight()method 
public function itemToWeight(item:Object):Number

Determines the weight value for an item from the data provider.

Parameters
item:Object

Returns
Number
Event detail
changeevent 
Event object type: flash.events.Event

Dispatched when the selectedIndex or selectedItem property changes as a result of user interaction.

nodeClickevent  
Event object type: com.flextoolbox.events.TreeMapEvent

Dispatched when the user clicks on an node in the control.

nodeDoubleClickevent  
Event object type: com.flextoolbox.events.TreeMapEvent

Dispatched when the user double-clicks on an node in the control.

nodeRollOutevent  
Event object type: com.flextoolbox.events.TreeMapEvent

Dispatched when the user rolls the mouse pointer out of an node in the control.

nodeRollOverevent  
Event object type: com.flextoolbox.events.TreeMapEvent

Dispatched when the user rolls the mouse pointer over an node in the control.