Skip to content
This repository has been archived by the owner. It is now read-only.

Latest commit

 

History

History
2382 lines (1463 loc) · 38.4 KB

File metadata and controls

2382 lines (1463 loc) · 38.4 KB
layout post
title API reference for ejTreeMap
description What are the options, methods and events available in Essential JavaScript TreeMap.
documentation API
platform angular-api
keywords ejTreeMap, API, Essential JS TreeMap, TreeMap
metaname
metacontent

ejTreeMap

The treemap can be easily configured to the DOM element, such as div and can be created with a highly customized look and feel.

Example

{% highlight html %}

{% endhighlight %}

Requires

  • module:jQuery

  • module:ej.datavisualization.TreeMap

  • module:JsRender

  • module:properties

Members

borderBrush string

{:#members:borderbrush}

Specifies the border brush color of the treemap

Default Value

  • "white"

Example

{% highlight js %}

{% endhighlight %}

borderThickness number

{:#members:borderthickness}

Specifies the border thickness of the treemap

Default Value

  • 1

Example

{% highlight js %}

<ej-treemap id="treemap" [borderThickness] = "1" >

{% endhighlight %}

uniColorMapping object

{:#members:unicolormapping}

Specifies the uniColorMapping settings of the treemap

uniColorMapping.color string

{:#members:unicolormapping-color}

Specifies the uniform color mapping of the treemap

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

desaturationColorMapping object

{:#members:desaturationcolormapping}

Specifies the desaturationColorMapping settings of the treemap

desaturationColorMapping.to number

{:#members:desaturationcolormapping-to}

Specifies the to value for desaturation color mapping

Default Value

  • 0

Example

{% highlight js %}

{% endhighlight %}

desaturationColorMapping.color string

{:#members:desaturationcolormapping-color}

Specifies the color for desaturationColorMapping

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

desaturationColorMapping.from number

{:#members:desaturationcolormapping-from}

Specifies the from value for desaturation color mapping

Default Value

  • 0

Example

{% highlight js %}

{% endhighlight %}

desaturationColorMapping.rangeMaximum number

{:#members:desaturationcolormapping-rangemaximum}

Specifies the rangeMaximum value for desaturation color mapping

Default Value

  • 0

Example

{% highlight js %}

{% endhighlight %}

desaturationColorMapping.rangeMinimum number

{:#members:desaturationcolormapping-rangeminimum}

Specifies the rangeMinimum value for desaturation color mapping

Default Value

  • 0

Example

{% highlight js %}

{% endhighlight %}

paletteColorMapping object

{:#members:palettecolormapping}

Specifies the paletteColorMapping of the treemap

paletteColorMapping.colors array

{:#members:palettecolormapping-colors}

Specifies the colors of the paletteColorMapping

Default Value

  • []

Example

{% highlight js %}

{% endhighlight %}

{% highlight ts %}

this.colorMapping = ["red","green","blue", "yellow"];

{% endhighlight %}

colorValuePath string

{:#members:colorvaluepath}

Specifies the color value path of the treemap

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

dataSource object

{:#members:datasource}

Specifies the datasource of the treemap

Default Value

  • null

Example

{% highlight js %}

<ej-treemap id="treemap" [dataSource]='medal_data' >

{% endhighlight %}

dockPosition enum

{:#members:dockposition}

Specifies the dockPosition for legend
Name Description
top specifies the top position
bottom specifies the bottom position
right specifies the bottom position
left specifies the left position

Default Value

  • top

Example

{% highlight js %}

{% endhighlight %}

drillDownHeaderColor string

{:#members:drilldownheadercolor}

specifies the drillDown header color

####Default Value

  • 'null'

Example

{% highlight js %}

{% endhighlight %}

drillDownSelectionColor string

{:#members:drilldownselectioncolor}

specifies the drillDown selection color

Default Value

  • '#000000'

Example

{% highlight js %}

{% endhighlight %}

isHierarchicalDatasource boolean

{:#members:ishierarchicaldatasource}

Specifies whether datasource is hierarchical or not.

Default Value

  • false

Example

{:.example}

{% highlight js %}

{% endhighlight %}

header string

{:#members:header}

Specifies the header for parent item during drilldown. This is applicable only for hierarchical data source.

Default Value

  • null

Example

{:.example}

{% highlight js %}

{% endhighlight %}

enableDrillDown boolean

{:#members:enabledrilldown}

Enable/Disable the drillDown for treemap

Default Value

  • false

Example

{:.example}

{% highlight js %}

<ej-treemap id="treemap" [enableDrillDown]='true' >

{% endhighlight %}

isResponsive boolean

{:#members:isresponsive}

Controls whether Treemap has to be responsive while resizing the window.

Default Value

  • true

Example

{% highlight js %}

<ej-treemap id="treemap" [isResponsive]='true' >

{% endhighlight %}

enableResize boolean

{:#members:enableresize}

Specifies whether treemap need to resize when container is resized

Default Value

  • true

Example

{% highlight js %}

<ej-treemap id="treemap" [enableResize]='true' >

{% endhighlight %}

draggingOnSelectionboolean

{:#members:draggingOnSelection}

This property is used to select treemap items while clicking and dragging

Default Value

  • false

Example

{% highlight js %}

<ej-treemap id="treemap" [draggingOnSelection]='false' >

{% endhighlight %}

draggingGroupOnSelectionboolean

{:#members:draggingGroupOnSelection}

This property is used to select group of treemap items while clicking and dragging

Default Value

  • false

Example

{% highlight js %}

<ej-treemap id="treemap" [draggingGroupOnSelection]='false' >

{% endhighlight %}

groupColorMapping array

{:#members:groupcolormapping}

Specifies the group color mapping of the treemap

Default Value

  • []

Example

{% highlight ts %}

this.groupColor = [{ groupID: 'Asia', rangeColorMapping: [{ color: "red", from: "20000000", to: "2128657283"}] }];

{% endhighlight %}

{% highlight js %}

<ej-treemap id="treemap" [groupColorMapping]='groupColor' >

{% endhighlight %}

groupColorMapping.groupID string

{:#members:groupcolormapping-groupid}

Specifies the groupID for GroupColorMapping.

Default Value

  • null

Example

{% highlight js %}

<ej-treemap id="treemap" [groupColorMapping]='groupColor' >

{% endhighlight %}

{% highlight ts %}

this.groupColor = [{ groupID: 'Asia', }]

{% endhighlight %}

legendSettings object

{:#members:legendsettings}

Specifies the legend settings of the treemap

legendSettings.height number

{:#members:legendsettings-height}

Specifies the height for legend

Default Value

  • 30

Example

{% highlight js %}

<ej-treemap id="treemap" [legendSettings.height]=40 >

{% endhighlight %}

legendSettings.width number

{:#members:legendsettings-width}

Specifies the width for legend

Default Value

  • 100

Example

{% highlight js %}

<ej-treemap id="treemap" [legendSettings.width]=100 >

{% endhighlight %}

legendSettings.iconHeight number

{:#members:legendsettings-iconheight}

Specifies the iconHeight for legend

Default Value

  • 15

Example

{% highlight js %}

<ej-treemap id="treemap" [legendSettings.iconHeight]=15 >

{% endhighlight %}

legendSettings.iconWidth number

{:#members:legendsettings-iconwidth}

Specifies the iconWidth for legend

Default Value

  • 15

Example

{% highlight js %}

<ej-treemap id="treemap" [legendSettings.iconWidth]=15 >

{% endhighlight %}

legendSettings.template string

{:#members:legendsettings-template}

Specifies the template for legendSettings

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

legendSettings.mode string

{:#members:legendsettings-mode}

Specifies the mode for legendSettings whether default or interactive mode

Default Value

  • "default"

Example

{% highlight js %}

{% endhighlight %}

legendSettings.title string

{:#members:legendsettings-title}

Specifies the title text for legend

Default Value

  • ""

Example

{% highlight js %}

{% endhighlight %}

legendSettings.leftLabel string

{:#members:legendsettings-leftlabel}

Specifies the leftLabel text for legend

Default Value

  • ""

Example

{% highlight js %}

{% endhighlight %}

legendSettings.rightLabel string

{:#members:legendsettings-rightlabel}

Specifies the rightLabel text for legend

Default Value

  • ""

Example

{% highlight js %}

{% endhighlight %}

legendSettings.dockPosition string

{:#members:legendsettings-dockposition}

Specifies the dockPosition text for legend

Default Value

  • "top"

Example

{% highlight js %}

{% endhighlight %}

legendSettings.alignment string

{:#members:legendsettings-alignment}

Specifies the alignment text for legend

Default Value

  • "near"

Example

{% highlight js %}

{% endhighlight %}

legendSettings.columnCount number

{:#members:legendsettings-columncount}

Specifies the alignment text for legend

Default Value

  • 0

Example

{% highlight js %}

{% endhighlight %}

highlightBorderBrush string

{:#members:highlightborderbrush}

Specifies the highlight border brush of treemap

Default Value

  • "gray"

Example

{% highlight js %}

<ej-treemap id="treemap" [highlightBorderBrush]='gray' >

{% endhighlight %}

highlightBorderThickness number

{:#members:highlightborderthickness}

Specifies the border thickness when treemap items is highlighted in the treemap

Default Value

  • 5

Example

{% highlight js %}

<ej-treemap id="treemap" [highlightBorderThickness]='5' >

{% endhighlight %}

highlightGroupBorderBrush string

{:#members:highlightgroupborderbrush}

Specifies the highlight border brush of treemap

Default Value

  • "gray"

Example

{% highlight js %}

<ej-treemap id="treemap" [highlightGroupBorderBrush]='gray' >

{% endhighlight %}

highlightGroupBorderThickness number

{:#members:highlightgroupborderthickness}

Specifies the border thickness when treemap items is highlighted in the treemap

Default Value

  • 5

Example

{% highlight js %}

<ej-treemap id="treemap" [highlightGroupBorderThickness]='5' >

{% endhighlight %}

highlightGroupOnSelection boolean

{:#members:highlightgrouponselection}

Specifies whether treemap item need to highlighted on selection

Default Value

  • false

Example

{:.example}

{% highlight js %}

<ej-treemap id="treemap" [highlightGroupOnSelection]='false' >

{% endhighlight %}

highlightOnSelection boolean

{:#members:highlightonselection}

Specifies whether treemap item need to highlighted on selection

Default Value

  • false

Example

{% highlight js %}

<ej-treemap id="treemap" [highlightOnSelection]='false' >

{% endhighlight %}

itemsLayoutMode enum

{:#members:itemslayoutmode}

Specifies the items layout mode of the treemap. Accepted itemsLayoutMode values are Squarified, SliceAndDiceHorizontal, SliceAndDiceVertical and SliceAndDiceAuto
Name Description
squarified specifies the squarified as layout type position
sliceanddicehorizontal specifies the sliceanddicehorizontal as layout type position
sliceanddicevertical specifies the sliceanddicevertical as layout type position
sliceanddiceauto specifies the sliceanddiceauto as layout type position

Default Value

  • "Squarified"

Example

{% highlight js %}

{% endhighlight %}

enableGroupSeparator boolean

{:#members:enablegroupseparator}

Specify to convert the date object to string, using locale settings.

Default Value

  • false

Example

{% highlight js %}

{% endhighlight %}

locale string

{:#members:locale}

Name of the culture based on which Tree Map should be localized.

Default Value

  • "en-US"

Example

{% highlight js %}

{% endhighlight %}

leafItemSettings object

{:#members:leafitemsettings}

Specifies the leaf settings of the treemap

leafItemSettings.borderBrush string

{:#members:leafitemsettings-borderbrush}

Specifies the border brush color of the leaf item.

Default Value

  • "white"

Example

{% highlight js %}

{% endhighlight %}

leafItemSettings.borderThickness number

{:#members:leafitemsettings-borderthickness}

Specifies the border thickness of the leaf item.

Default Value

  • 1

Example

{% highlight js %}

<ej-treemap id="treemap" [leafItemSettings.borderThickness]= '1' >

{% endhighlight %}

leafItemSettings.gap number

{:#members:leafitemsettings-gap}

Specifies the space between the leaf items.

Default Value

  • 0

Example

{% highlight js %}

<ej-treemap id="treemap" [leafItemSettings.gap]= '1' >

{% endhighlight %}

leafItemSettings.itemTemplate string

{:#members:leafitemsettings-itemtemplate}

Specifies the label template of the leaf item.

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

leafItemSettings.labelPath string

{:#members:leafitemsettings-labelpath}

Specifies the label path of the leaf item.

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

leafItemSettings.labelPosition enum

{:#members:leafitemsettings-labelposition}

Specifies the position of the leaf labels.
Name Description
none specifies the none position
topleft specifies the topleft position
topcenter specifies the topcenter position
topright specifies the topright position
centerleft specifies the centerleft position
center specifies the center position
centerright specifies the centerright position
bottomleft specifies the bottomleft position
bottomcenter specifies the bottomcenter position
bottomright specifies the bottomright position

Default Value

  • center

Example

{% highlight js %}

{% endhighlight %}

leafItemSettings.textOverflow enum

{:#members:leafitemsettings-textOverflow}

Specifies the overflow options for leaf labels.
Name Description
none Displays the label within the grid width
hide Hides the label when its width exceeds grid width
wrap Wrap the label by letter when its width exceeds grid width
wrapByWord Wrap the label by word when its width exceeds grid width

Default Value

  • none

Example

{% highlight js %}

{% endhighlight %}

leafItemSettings.labelVisibilityMode enum

{:#members:leafitemsettings-labelvisibilitymode}

Specifies the mode of label visibility
Name Description
top specifies the visible mode
hide on exceeded length specifies the hide on exceeded length mode

Default Value

  • visible

Example

{% highlight js %}

{% endhighlight %}

leafItemSettings.showLabels boolean

{:#members:leafitemsettings-showlabels}

Shows or hides the label of the leaf item.

Default Value

  • "false"

Example

{% highlight js %}

<ej-treemap id="treemap" [leafItemSettings.showLabels]= 'false' >

{% endhighlight %}

rangeColorMapping array

{:#members:rangecolormapping}

Specifies the rangeColorMapping settings of the treemap

Default Value

  • []

Example

{% highlight js %}

{% endhighlight %}

rangeColorMapping.color string

{:#members:rangecolormapping-color}

Specifies the color value for rangeColorMapping.

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

rangeColorMapping.gradientColors array

{:#members:rangecolormapping-gradientcolors}

specifies the gradient colors for th given range value

Default Value

  • []

Example

{% highlight ts %}

this.colorMapping = [{ from: "0", to: "1", gradientColors: ["#fde6cc", "#fab665"] }];

{% endhighlight %}

{% highlight js %}

<ej-treemap id="treemap" [rangeColorMapping]='colorMapping'>
{% endhighlight %}

rangeColorMapping.from number

{:#members:rangecolormapping-from}

Specifies the from value for rangeColorMapping.

Default Value

  • -1

Example

{% highlight js %}

{% endhighlight %}

rangeColorMapping.legendLabel string

{:#members:rangecolormapping-legendlabel}

Specifies the legend label value for rangeColorMapping.

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

rangeColorMapping.to number

{:#members:rangecolormapping-to}

Specifies the to value for rangeColorMapping.

Default Value

  • -1

Example

{% highlight js %}

{% endhighlight %}

selectionMode enum

{:#members:selectionmode}

Specifies the selection mode of treemap item. Accepted selection mode values are Default and Multiple.
Name Description
default specifies the default mode
multiple specifies the multiple mode

Default Value

  • "default"

Example

{% highlight js %}

<ej-treemap id="treemap" [selectionMode]="default">

{% endhighlight %}

groupSelectionMode enum

{:#members:groupselectionmode}

Specifies the selection mode of the treemap. Accepted selection mode values are Default and Multiple.
Name Description
default specifies the default mode
multiple specifies the multiple mode

Default Value

  • "default"

Example

{% highlight js %}

<ej-treemap id="treemap" [groupSelectionMode]="default">

{% endhighlight %}

showLegend boolean

{:#members:showlegend}

Specifies the legend visibility status of the treemap

Default Value

  • false

Example

{% highlight js %}

<ej-treemap id="treemap" [showLegend]="false">

{% endhighlight %}

enableGradient boolean

{:#members:enableGradient}

Specifies whether gradient color has to be applied for treemap items

Default Value

  • false

Example

{% highlight js %}

<ej-treemap id="treemap" [enableGradient]="true">

{% endhighlight %}

showTooltip boolean

{:#members:showTooltip}

Specifies whether treemap showTooltip need to be visible

{% highlight js %}

<ej-treemap id="treemap" [showTooltip]="false">

{% endhighlight %}

tooltipTemplate string

{:#members:tooltiptemplate}

Specifies the tooltip template of the treemap

Default Value

  • null

Example

{% highlight js %}

<ej-treemap id="treemap" [tooltipTemplate]="template">

{% endhighlight %}

treeMapItems array

{:#members:treemapitems}

Hold the treeMapItems to be displayed in treemap

Default Value

  • []

Example

{% highlight js %}

<ej-treemap id="treemap" [treeMapItems]="items">

{% endhighlight %}

{% highlight ts %}

this.items=[];

{% endhighlight %}

levels array

{:#members:levels}

Specify levels of treemap for grouped visualization of data

Default Value

  • []

Example

{% highlight js %}

{% endhighlight %}

levels.groupBackground string

{:#members:levels-groupbackground}

specifies the group background

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

levels.groupBorderColor string

{:#members:levels-groupbordercolor}

Specifies the group border color for tree map level.

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

levels.groupBorderThickness number

{:#members:levels-groupborderthickness}

Specifies the group border thickness for tree map level.

Default Value

  • 1

Example

{% highlight js %}

{% endhighlight %}

levels.groupGap number

{:#members:levels-groupgap}

Specifies the group gap for tree map level.

Default Value

  • 1

Example

{% highlight js %}

{% endhighlight %}

levels.groupPadding number

{:#members:levels-grouppadding}

Specifies the group padding for tree map level.

Default Value

  • 4

Example

{% highlight js %}

/ <e-level [groupPadding]="4">

{% endhighlight %}

levels.groupPath string

{:#members:levels-grouppath}

Specifies the group path for tree map level.

Example

{% highlight js %}

{% endhighlight %}

levels.headerHeight number

{:#members:levels-headerheight}

Specifies the header height for tree map level.

Default Value

  • 0

Example

{% highlight js %}

{% endhighlight %}

levels.headerTemplate string

{:#members:levels-headertemplate}

Specifies the header template for tree map level.

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

levels.headerVisibilityMode enum

{:#members:levels-headervisibilitymode}

Specifies the mode of header visibility
Name Description
top specifies the visible mode
hide on exceeded length specifies the hide on exceeded length mode

Default Value

  • visible

Example

{% highlight js %}

{% endhighlight %}

levels.labelPosition enum

{:#members:levels-labelposition}

Specifies the position of the labels.

Name Description
none specifies the none position
topleft specifies the topleft position
topcenter specifies the topcenter position
topright specifies the topright position
centerleft specifies the centerleft position
center specifies the center position
centerright specifies the centerright position
bottomleft specifies the bottomleft position
bottomcenter specifies the bottomcenter position
bottomright specifies the bottomright position

Default Value

  • center

Example

{% highlight js %}

{% endhighlight %}

levels.textOverflow enum

{:#members:levels-textOverflow}

Specifies the overflow options for leaf labels.

Name Description
none Displays the label within the grid width
hide Hides the label when its width exceeds grid width
wrap Wrap the label by letter when its width exceeds grid width
wrapByWord Wrap the label by word when its width exceeds grid width

Default Value

  • none

Example

{% highlight js %}

{% endhighlight %}

levels.labelTemplate string

{:#members:levels-labeltemplate}

Specifies the label template for tree map level.

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

levels.labelVisibilityMode enum

{:#members:levels-labelvisibilitymode}

Specifies the mode of label visibility

Name Description
top specifies the visible mode
hide on exceeded length specifies the hide on exceeded length mode

Default Value

  • visible

Example

{% highlight js %}

{% endhighlight %}

levels.showHeader boolean

{:#members:levels-showheader}

Shows or hides the header for tree map level.

Default Value

  • false

Example

{% highlight js %}

{% endhighlight %}

levels.showLabels boolean

{:#members:levels-showlabels}

Shows or hides the labels for tree map level.

Default Value

  • false

Example

{% highlight js %}

{% endhighlight %}

weightValuePath string

{:#members:weightvaluepath}

Specifies the weight value path of the treemap

Default Value

  • null

Example

{% highlight js %}

{% endhighlight %}

Methods

refresh()

{:#methods:refresh}

Method to reload treemap with updated values.

Returns: void

Example

{% highlight ts %}

refresh(){

 //Do something
 this.treemap.widget.refresh();

}

{% endhighlight %}

Events

treeMapItemSelected

{:#events:treemapitemselected}

Triggers on treemap item selected.

Name Type Description
{% highlight html %}originalEvent{% endhighlight %} object Returns selected treeMapItem object.

Example

{% highlight js %}

<ej-treemap id="treemap" (treeMapItemSelected)="treeMapitemselected($event)">

{% endhighlight %}

{% highlight ts %}

treeMapitemselected(sender) {

// do something

}

{% endhighlight %}

drillStarted

{:#events:drillstarted}

Triggers when drilldown is started

Name Type Description
{% highlight html %}originalEvent{% endhighlight %} object Returns selected drilled treeMap object.

Example

{% highlight js %}

<ej-treemap id="treemap" (drillStarted)="drillStarted($event)">

{% endhighlight %}

{% highlight ts %}

drillStarted(sender) {

// do something

} {% endhighlight %}

drillDownItemSelected

{:#events:drilldownitemselected}

Triggers on treemap drilldown item selected.

Name Type Description
{% highlight html %}originalEvent{% endhighlight %} object Returns selected drilldown treeMap object.

Example

{% highlight js %}

<ej-treemap id="treemap" (drillDownItemSelected)="drilldownitemselected($event)">

{% endhighlight %}

{% highlight ts %}

drilldownitemselected(sender) {

// do something

}

{% endhighlight %}

headerTemplateRendering

{:#events:headerTemplateRendering}

Triggers before rendering the treemap drilldown header template

Name Type Description
{% highlight html %}originalEvent{% endhighlight %} object Returns drilldown header.

Example

{% highlight js %}

<ej-treemap id="treemap" (headerTemplateRendering)="headerTemplateRenderer($event)">

{% endhighlight %}

{% highlight ts %}

headerTemplateRenderer(sender) {

// do something

}

{% endhighlight %}

refreshed

{:#events:refreshed}

Triggers after refreshing the treemap items.

Name Type Description
{% highlight html %}originalEvent{% endhighlight %} object Refresh and load the treemap.

Example

{% highlight js %}

<ej-treemap id="treemap" (refreshed)="refreshed($event)">

{% endhighlight %}

{% highlight ts %}

refreshed(sender) {

// do something

}

{% endhighlight %}

treeMapGroupSelected

{:#events:treeMapGroupSelected}

Triggers when the group selection is performed on treemap items.

Name Type Description
{% highlight html %}originalEvent{% endhighlight %} object Returns the selected group of treeMapItems as object.

Example

{% highlight js %}

<ej-treemap id="treemap" (treeMapGroupSelected)="treemapGroupSelected($event)">

{% endhighlight %}

{% highlight ts %}

treemapGroupSelected(sender) {

// do something

}

{% endhighlight %}