Packagefr.kapit.components.treemap
Classpublic class TreeMap
InheritanceTreeMap Inheritance fr.kapit.base.KapUIComponent

This class defines a control that is used to view hierarchical data as a treemap display where data items are represented as nested rectangles that are determined using a treemap algorithm.

Default MXML PropertydataProvider



Public Properties
 PropertyDefined by
  applyGradientFill : Boolean
Indicates whether to apply a gradient fill when drawing treemap nodes.
TreeMap
  areaField : String
The name/index of the property used to detemine the area of an item.
TreeMap
  areaFunction : Function
The function used to detemine the area of an item.
TreeMap
  colorField : String
The name/index of the property used to detemine the color of an item.
TreeMap
  colorFunction : Function
The function used to detemine the color of an item.
TreeMap
  colorGenerator : ITreeMapColorGenerator
The colorGenerator is used by the treemap to determine the displayed colors for nodes and for the legend.
TreeMap
  colorPolicy : String
Indicates the policy used to generate colors for the nodes.
TreeMap
  dataDescriptor : ITreeDataDescriptor
Indicates the ITreeDataDescriptor used to parse the hierarchy of the dataProvider.
TreeMap
  discreteColors : Boolean
Indicates whether the colorField/colorFunction contains discrete(non numerical) values or continue (numerical) values.
TreeMap
  distanceBetweenBranches : Number
Indicates the distance between the different branches.
TreeMap
  distanceBetweenNodes : Number
Indicates the distance between the different nodes.
TreeMap
  dynamicTextSize : Boolean
Indicates whether the text on the nodes should have a dynamic size (to fit the area of the node) or respect the default size value.
TreeMap
  enableSelection : Boolean
Indicates whether to enable item selection or not.
TreeMap
  filterPath : Array
Filter Path is used for CSV and General XML files and enables data source analysis with a given logic.
TreeMap
  firstColor : uint
The first color used to generate nodes colors.
TreeMap
  highlightPolicy : String
Indicates the policy used to display highlight filters.
TreeMap
  iconAlpha : Number
Indicates the icon alpha.
TreeMap
  iconFunction : Function
The function used to detemine the icon of an item.
TreeMap
  labelField : String
The name/index of the property used to detemine the label of an item.
TreeMap
  labelFunction : Function
The function used to detemine the label of an item.
TreeMap
  labelHorizontalAlign : String
The TreeMapNode label horizontal alignment.
TreeMap
  labelMinimumHeight : Number
The minimum height for a TreeMapNode to display a label.
TreeMap
  labelMinimumWidth : Number
The minimum width for a TreeMapNode to display a label.
TreeMap
  labelMultiline : Boolean
Indicates whether the TreeMapNode label has multiline.
TreeMap
  labelPolicy : String
Indicates the policy used to display labels.
TreeMap
  labelTruncateToFit : Boolean
Indicates whether the TreeMapNodel label should be truncated with an '...' indicator to fit the available space.
TreeMap
  labelVerticalAlign : String
The TreeMapNode label vertical alignment.
TreeMap
  labelWordWrap : Boolean
Indicates whether the TreeMapNode label has word wrap.
TreeMap
  maxColorValue : Number
Indicates a custom maximum color value.
TreeMap
  minColorValue : Number
Indicates a custom minimum color value.
TreeMap
  nodeHighlightFilters : Array
Indicates the array of filters used to highlight the node under the mouse.
TreeMap
  secondColor : uint
The second color used to generate nodes colors.
TreeMap
  toolTipField : String
The name/index of the property used to detemine the toolTip of an item.
TreeMap
  toolTipFunction : Function
The function used to detemine the toolTip of an item.
TreeMap
  useLogarithmicScale : Boolean
Indicates whether to display the name of branches or not.
TreeMap
  viewBranchHeader : Boolean
Indicates whether to display the name of branches or not.
TreeMap
Public Methods
 MethodDefined by
  
Constructor.
TreeMap
  
dataToICollectionView(value:Object):ICollectionView
TreeMap
  
filterChanged(filter:TreeMapFilter):void
TreeMap
  
filterFunction(item:Object):Boolean
Determines the area and color filter applied by the user using the areaFilters or colooFiltersField properties.
TreeMap
  
getAreaFromData(data:Object):Number
Determines the area from the data object using the areaFunction or areaField properties.
TreeMap
  
getColorFromData(data:Object):*
Determines the color from the data object using the colorFunction or colorField properties.
TreeMap
  
getIconFromData(data:Object):Bitmap
TreeMap
  
getLabelFromData(data:Object, info:Object):String
Determines the label from the data object using the labelFunction or labelField properties.
TreeMap
  
getStyle(styleProp:String):*
TreeMap
  
getToolTipFromData(data:Object, info:Object):String
Determines the toolTip from the data object using the toolTipFunction or toolTipField properties.
TreeMap
  
refresh():void
Forces the treemap to be redrawn.
TreeMap
  
styleChanged(styleProp:String):void
TreeMap
Events
 EventSummaryDefined by
   Dispatched when a goup header is clicked.TreeMap
   Dispatched after a drill-down on a group.TreeMap
   Dispatched after a drill-up on a group.TreeMap
   Dispatched when the mouse is rolled out of a group header.TreeMap
   Dispatched when the mouse is rolled over a group header.TreeMap
   Dispatched when a node is clicked.TreeMap
   Dispatched when the mouse is rolled out of a node.TreeMap
   Dispatched when the mouse is rolled over a node.TreeMap
Styles
 StyleDescriptionDefined by
  
branchColors
Type: Array   Format: Color   CSS Inheritance: no
Array of two colors used to render the branch. Default value is [0x333333, 0x666666].
TreeMap
  
branchHeaderHeight
Type: Number   Format: Length   CSS Inheritance: no
Defines branches header height. The default value is 16.
TreeMap
  
branchTextColors
Type: Array   Format: Color   CSS Inheritance: no
Array of two colors used to render the branch text. Default value is [0xcccccc, 0xffffff].
TreeMap
  
branchTextFontFamily
Type: String   CSS Inheritance: no
Defines the font used to render the text on branches.
TreeMap
  
branchTextFontSize
Type: uint   CSS Inheritance: no
Defines the size of the font used to render the text on branches.
TreeMap
  
drillDownIcon
Type: Class   CSS Inheritance: no
Icon used to render the drill down button.
TreeMap
  
drillUpIcon
Type: Class   CSS Inheritance: no
Icon used to render the drill up button.
TreeMap
  
nodeTextColor
Type: uint   CSS Inheritance: no
Defines the color used to render the text on nodes.
TreeMap
  
nodeTextFontFamily
Type: String   CSS Inheritance: no
Defines the font used to render the text on nodes.
TreeMap
  
nodeTextFontSize
Type: uint   CSS Inheritance: no
Defines the size of the font used to render the text on nodes.
TreeMap
Public Constants
 ConstantDefined by
  COLOR_POLICY_BICHROMATIC : String = "bichromatic"
[static] Colors are generated by mixing firstColor and secondColor.
TreeMap
  COLOR_POLICY_MONOCHROMATIC : String = "monochromatic"
[static] Colors are generated by mixing firstColor and black.
TreeMap
  COLOR_POLICY_SPECTRUM : String = "spectrum"
[static] Colors are generated by mixing red, green and blue colors.
TreeMap
  HIGHLIGHT_POLICY_ALL : String = "all"
[static] Highlight filters are displayed on all nodes and all groups.
TreeMap
  HIGHLIGHT_POLICY_GROUPS : String = "groups"
[static] Highlight filters are displayed only on groups.
TreeMap
  HIGHLIGHT_POLICY_NODES : String = "nodes"
[static] Highlight filters are displayed only on nodes.
TreeMap
  HIGHLIGHT_POLICY_NONE : String = "none"
[static] No highlight filters are displayed.
TreeMap
  LABEL_POLICY_ALL : String = "all"
[static] Labels are displayed on all nodes and all groups.
TreeMap
  LABEL_POLICY_GROUPS : String = "groups"
[static] Labels are displayed only on groups.
TreeMap
  LABEL_POLICY_NODES : String = "nodes"
[static] Labels are displayed only on nodes.
TreeMap
  LABEL_POLICY_NONE : String = "none"
[static] No Labels are displayed.
TreeMap
Property detail
applyGradientFillproperty
applyGradientFill:Boolean  [read-write]

Indicates whether to apply a gradient fill when drawing treemap nodes.

Implementation
    public function get applyGradientFill():Boolean
    public function set applyGradientFill(value:Boolean):void
areaFieldproperty 
areaField:String  [read-write]

The name/index of the property used to detemine the area of an item. Only used when areaFunction is null.

Implementation
    public function get areaField():String
    public function set areaField(value:String):void
areaFunctionproperty 
areaFunction:Function  [read-write]

The function used to detemine the area of an item. It must have the following signature : areaFunction(item:Object):Number.

Implementation
    public function get areaFunction():Function
    public function set areaFunction(value:Function):void
colorChangedproperty 
colorChanged:Boolean  [write-only]Implementation
    treemap_internal function set colorChanged(value:Boolean):void
colorFieldproperty 
colorField:String  [read-write]

The name/index of the property used to detemine the color of an item. Only used when colorFunction is null.

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

The function used to detemine the color of an item. It must have the following signature : colorFunction(item:Object):Number.

Implementation
    public function get colorFunction():Function
    public function set colorFunction(value:Function):void
colorGeneratorproperty 
colorGenerator:ITreeMapColorGenerator  [read-write]

The colorGenerator is used by the treemap to determine the displayed colors for nodes and for the legend.

Implementation
    public function get colorGenerator():ITreeMapColorGenerator
    public function set colorGenerator(value:ITreeMapColorGenerator):void
colorPolicyproperty 
colorPolicy:String  [read-write]

Indicates the policy used to generate colors for the nodes.

Implementation
    public function get colorPolicy():String
    public function set colorPolicy(value:String):void

See also

colorValuesDictproperty 
treemap_internal var colorValuesDict:Dictionary
dataDescriptorproperty 
dataDescriptor:ITreeDataDescriptor  [read-write]

Indicates the ITreeDataDescriptor used to parse the hierarchy of the dataProvider. If this property is null, a DefaultDataDescriptor is used. Currently, only the getChildren() and isBranch() methods of the ITreeDataDescriptor interface are used.

Implementation
    public function get dataDescriptor():ITreeDataDescriptor
    public function set dataDescriptor(value:ITreeDataDescriptor):void
discreteColorsproperty 
discreteColors:Boolean  [read-write]

Indicates whether the colorField/colorFunction contains discrete(non numerical) values or continue (numerical) values.

Implementation
    public function get discreteColors():Boolean
    public function set discreteColors(value:Boolean):void
distanceBetweenBranchesproperty 
distanceBetweenBranches:Number  [read-write]

Indicates the distance between the different branches.

Implementation
    public function get distanceBetweenBranches():Number
    public function set distanceBetweenBranches(value:Number):void
distanceBetweenNodesproperty 
distanceBetweenNodes:Number  [read-write]

Indicates the distance between the different nodes.

Implementation
    public function get distanceBetweenNodes():Number
    public function set distanceBetweenNodes(value:Number):void
dynamicTextSizeproperty 
dynamicTextSize:Boolean  [read-write]

Indicates whether the text on the nodes should have a dynamic size (to fit the area of the node) or respect the default size value.

Implementation
    public function get dynamicTextSize():Boolean
    public function set dynamicTextSize(value:Boolean):void
enableSelectionproperty 
enableSelection:Boolean  [read-write]

Indicates whether to enable item selection or not.

Implementation
    public function get enableSelection():Boolean
    public function set enableSelection(value:Boolean):void
filterPathproperty 
filterPath:Array  [read-write]

Filter Path is used for CSV and General XML files and enables data source analysis with a given logic. For CSV files(like other formats), the analysis path is an Array containing the columns headers that describes an Hierarchy or another logical entity. This property can be used as the source for data binding.

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

Implementation
    public function get filterPath():Array
    public function set filterPath(value:Array):void

Example
Given the following CSV file, one of the analysis Paths should be ["Entreprise","Department"], the delimiter should be "," and the record delimiter should be "/"". "Entreprise","Department","Profit (KE)","Employees Number" "Enterp1","Dep11","1000","22" "Enterp2","Dep21","1200","30" "Enterp1","Dep12","1500","100" "Enterp2","Dep22","1500","15" "Enterp3","Dep31","1460","10" "Enterp2","Dep23","3000","28" ...

firstColorproperty 
firstColor:uint  [read-write]

The first color used to generate nodes colors.

Implementation
    public function get firstColor():uint
    public function set firstColor(value:uint):void
highlightPolicyproperty 
highlightPolicy:String  [read-write]

Indicates the policy used to display highlight filters.

Implementation
    public function get highlightPolicy():String
    public function set highlightPolicy(value:String):void

See also

iconAlphaproperty 
iconAlpha:Number  [read-write]

Indicates the icon alpha.

Implementation
    public function get iconAlpha():Number
    public function set iconAlpha(value:Number):void
iconFunctionproperty 
iconFunction:Function  [read-write]

The function used to detemine the icon of an item. It must have one of the following signatures : iconFunction(item:Object):Class and iconFunction(item:Object):Bitmap.

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

The name/index of the property used to detemine the label of an item. Only used when labelFunction is null.

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

The function used to detemine the label of an item. It must have the following signature : labelFunction(item:Object,info:Object):String where info contains some statistics about the item.

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

The TreeMapNode label horizontal alignment. Valid values are: left, center and right.

The default value is <code>center</code>.

Implementation
    public function get labelHorizontalAlign():String
    public function set labelHorizontalAlign(value:String):void
labelMinimumHeightproperty 
labelMinimumHeight:Number  [read-write]

The minimum height for a TreeMapNode to display a label.

The default value is 8.

Implementation
    public function get labelMinimumHeight():Number
    public function set labelMinimumHeight(value:Number):void

See also

labelMinimumWidthproperty 
labelMinimumWidth:Number  [read-write]

The minimum width for a TreeMapNode to display a label.

The default value is 8.

Implementation
    public function get labelMinimumWidth():Number
    public function set labelMinimumWidth(value:Number):void

See also

labelMultilineproperty 
labelMultiline:Boolean  [read-write]

Indicates whether the TreeMapNode label has multiline. This property is not used when dynamicTextSizetrue.

The default value is false.

Implementation
    public function get labelMultiline():Boolean
    public function set labelMultiline(value:Boolean):void
labelPolicyproperty 
labelPolicy:String  [read-write]

Indicates the policy used to display labels.

Implementation
    public function get labelPolicy():String
    public function set labelPolicy(value:String):void

See also

labelTruncateToFitproperty 
labelTruncateToFit:Boolean  [read-write]

Indicates whether the TreeMapNodel label should be truncated with an '...' indicator to fit the available space.

The default value is false.

Implementation
    public function get labelTruncateToFit():Boolean
    public function set labelTruncateToFit(value:Boolean):void
labelVerticalAlignproperty 
labelVerticalAlign:String  [read-write]

The TreeMapNode label vertical alignment. Valid values are: top, middle and bottom.

The default value is <code>middle</code>.

Implementation
    public function get labelVerticalAlign():String
    public function set labelVerticalAlign(value:String):void
labelWordWrapproperty 
labelWordWrap:Boolean  [read-write]

Indicates whether the TreeMapNode label has word wrap. This property is not used when dynamicTextSizetrue.

The default value is false.

Implementation
    public function get labelWordWrap():Boolean
    public function set labelWordWrap(value:Boolean):void
maxColorValueproperty 
maxColorValue:Number  [read-write]

Indicates a custom maximum color value. The Treemap computes the minimum and maximum color values found on the dataProvider and uses them to asign colors to the different nodes. If you don't want to use the default maximum color value, you can specify a custom value using this property.

Implementation
    public function get maxColorValue():Number
    public function set maxColorValue(value:Number):void
minColorValueproperty 
minColorValue:Number  [read-write]

Indicates a custom minimum color value. The Treemap computes the minimum and maximum color values found on the dataProvider and uses them to asign colors to the different nodes. If you don't want to use the default minimum color value, you can specify a custom value using this property.

Implementation
    public function get minColorValue():Number
    public function set minColorValue(value:Number):void
nodeHighlightFiltersproperty 
nodeHighlightFilters:Array  [read-write]

Indicates the array of filters used to highlight the node under the mouse.

Implementation
    public function get nodeHighlightFilters():Array
    public function set nodeHighlightFilters(value:Array):void
secondColorproperty 
secondColor:uint  [read-write]

The second color used to generate nodes colors.

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

The name/index of the property used to detemine the toolTip of an item. Only used when toolTipFunction is null.

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

The function used to detemine the toolTip of an item. It must have the following signature : toolTipFunction(item:Object,info:Object):String where info contains some statistics about the item.

Implementation
    public function get toolTipFunction():Function
    public function set toolTipFunction(value:Function):void
useDiscreteColorsproperty 
useDiscreteColors:Boolean  [read-only]Implementation
    treemap_internal function get useDiscreteColors():Boolean
useKDataproperty 
treemap_internal var useKData:Boolean = false
useLogarithmicScaleproperty 
useLogarithmicScale:Boolean  [read-write]

Indicates whether to display the name of branches or not.

Implementation
    public function get useLogarithmicScale():Boolean
    public function set useLogarithmicScale(value:Boolean):void
viewBranchHeaderproperty 
viewBranchHeader:Boolean  [read-write]

Indicates whether to display the name of branches or not.

Implementation
    public function get viewBranchHeader():Boolean
    public function set viewBranchHeader(value:Boolean):void
Constructor detail
TreeMap()constructor
public function TreeMap()

Constructor.

Method detail
dataToICollectionView()method
public function dataToICollectionView(value:Object):ICollectionViewParameters
value:Object

Returns
ICollectionView
drillDownUp()method 
treemap_internal function drillDownUp(b:TreeMapBranch):voidParameters
b:TreeMapBranch
filterChanged()method 
public function filterChanged(filter:TreeMapFilter):voidParameters
filter:TreeMapFilter
filterFunction()method 
public function filterFunction(item:Object):Boolean

Determines the area and color filter applied by the user using the areaFilters or colooFiltersField properties.

Parameters
item:Object

Returns
Boolean
getAreaFromData()method 
public function getAreaFromData(data:Object):Number

Determines the area from the data object using the areaFunction or areaField properties.

Parameters
data:Object — The data object from which the area will be determined.

Returns
Number — The area determined from the data object.
getColorFromData()method 
public function getColorFromData(data:Object):*

Determines the color from the data object using the colorFunction or colorField properties.

Parameters
data:Object — The data object from which the color will be determined.

Returns
* — The color determined from the data object.
getIconFromData()method 
public function getIconFromData(data:Object):BitmapParameters
data:Object

Returns
Bitmap
getLabelFromData()method 
public function getLabelFromData(data:Object, info:Object):String

Determines the label from the data object using the labelFunction or labelField properties.

Parameters
data:Object — The data object from which the label will be determined.
 
info:Object

Returns
String — The label determined from the data object.
getStyle()method 
public override function getStyle(styleProp:String):*Parameters
styleProp:String

Returns
*
getToolTipFromData()method 
public function getToolTipFromData(data:Object, info:Object):String

Determines the toolTip from the data object using the toolTipFunction or toolTipField properties.

Parameters
data:Object — The data object from which the toolTip will be determined.
 
info:Object

Returns
String — The toolTip determined from the data object.
newNode()method 
treemap_internal function newNode(parentbranch:ITreeMapBranch):TreeMapNodeParameters
parentbranch:ITreeMapBranch

Returns
TreeMapNode
refresh()method 
public function refresh():void

Forces the treemap to be redrawn.

styleChanged()method 
public override function styleChanged(styleProp:String):voidParameters
styleProp:String
Event detail
groupClickevent 
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched when a goup header is clicked.

groupDrillDownevent  
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched after a drill-down on a group.

groupDrillUpevent  
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched after a drill-up on a group.

groupRollOutevent  
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched when the mouse is rolled out of a group header.

groupRollOverevent  
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched when the mouse is rolled over a group header.

nodeClickevent  
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched when a node is clicked.

nodeRollOutevent  
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched when the mouse is rolled out of a node.

nodeRollOverevent  
Event object type: fr.kapit.components.treemap.events.TreeMapEvent

Dispatched when the mouse is rolled over a node.

Constant detail
COLOR_POLICY_BICHROMATICconstant
public static const COLOR_POLICY_BICHROMATIC:String = "bichromatic"

Colors are generated by mixing firstColor and secondColor.

COLOR_POLICY_MONOCHROMATICconstant 
public static const COLOR_POLICY_MONOCHROMATIC:String = "monochromatic"

Colors are generated by mixing firstColor and black.

COLOR_POLICY_SPECTRUMconstant 
public static const COLOR_POLICY_SPECTRUM:String = "spectrum"

Colors are generated by mixing red, green and blue colors.

HIGHLIGHT_POLICY_ALLconstant 
public static const HIGHLIGHT_POLICY_ALL:String = "all"

Highlight filters are displayed on all nodes and all groups.

HIGHLIGHT_POLICY_GROUPSconstant 
public static const HIGHLIGHT_POLICY_GROUPS:String = "groups"

Highlight filters are displayed only on groups.

HIGHLIGHT_POLICY_NODESconstant 
public static const HIGHLIGHT_POLICY_NODES:String = "nodes"

Highlight filters are displayed only on nodes.

HIGHLIGHT_POLICY_NONEconstant 
public static const HIGHLIGHT_POLICY_NONE:String = "none"

No highlight filters are displayed.

LABEL_POLICY_ALLconstant 
public static const LABEL_POLICY_ALL:String = "all"

Labels are displayed on all nodes and all groups.

LABEL_POLICY_GROUPSconstant 
public static const LABEL_POLICY_GROUPS:String = "groups"

Labels are displayed only on groups.

LABEL_POLICY_NODESconstant 
public static const LABEL_POLICY_NODES:String = "nodes"

Labels are displayed only on nodes.

LABEL_POLICY_NONEconstant 
public static const LABEL_POLICY_NONE:String = "none"

No Labels are displayed.