dc.js Class: heatMap (original) (raw)

dc. heatMap


new heatMap(parent [, chartGroup])

A heat map is matrix that represents the values of two dimensions of data using colors.

Parameters:
Name Type Argument Description
parent String|node d3.selection
chartGroup String The name of the chart group this chart instance should be placed in. Interaction with a chart will only trigger events and redraws within the chart's group.

Mixes In:

Source:

Returns:

Type

dc.heatMap

Example

// create a heat map under #chart-container1 element using the default global chart group var heatMap1 = dc.heatMap('#chart-container1'); // create a heat map under #chart-container2 element using chart group A var heatMap2 = dc.heatMap('#chart-container2', 'chartGroupA');

Methods


boxOnClick( [handler])

Gets or sets the handler that fires when an individual cell is clicked in the heatmap. By default, filtering of the cell will be toggled.

Parameters:
Name Type Argument Description
handler function

Source:

Returns:

Type

function|dc.heatMap

Example

// default box on click handler chart.boxOnClick(function (d) { var filter = d.key; dc.events.trigger(function () { _chart.filter(filter); _chart.redrawGroup(); }); });


colOrdering( [colOrdering])

Get or set a comparator to order the columns. Default is d3.ascending.

Parameters:
Name Type Argument Description
colOrdering function

Source:

Returns:

Type

function|dc.heatMap


cols( [cols])

Gets or sets the keys used to create the columns of the heatmap, as an array. By default, all the values will be fetched from the data using the key accessor.

Parameters:
Name Type Argument Description
cols Array.<(String|Number)>

Source:

Returns:

Type

Array.<(String|Number)>|dc.heatMap


colsLabel( [labelFunction])

Set or get the column label function. The chart class uses this function to render column labels on the X axis. It is passed the column name.

Parameters:
Name Type Argument Default Description
labelFunction function function(d) { return d; }

Source:

Returns:

Type

function|dc.heatMap

Example

// the default label function just returns the name chart.colsLabel(function(d) { return d; });


rowOrdering( [rowOrdering])

Get or set a comparator to order the rows. Default is d3.ascending.

Parameters:
Name Type Argument Description
rowOrdering function

Source:

Returns:

Type

function|dc.heatMap


rows( [rows])

Gets or sets the values used to create the rows of the heatmap, as an array. By default, all the values will be fetched from the data using the value accessor.

Parameters:
Name Type Argument Description
rows Array.<(String|Number)>

Source:

Returns:

Type

Array.<(String|Number)>|dc.heatMap


rowsLabel( [labelFunction])

Set or get the row label function. The chart class uses this function to render row labels on the Y axis. It is passed the row name.

Parameters:
Name Type Argument Default Description
labelFunction function function(d) { return d; }

Source:

Returns:

Type

function|dc.heatMap

Example

// the default label function just returns the name chart.rowsLabel(function(d) { return d; });


xAxisOnClick( [handler])

Gets or sets the handler that fires when a column tick is clicked in the x axis. By default, if any cells in the column are unselected, the whole column will be selected, otherwise the whole column will be unselected.

Parameters:
Name Type Argument Description
handler function

Source:

Returns:

Type

function|dc.heatMap


xBorderRadius( [xBorderRadius])

Gets or sets the X border radius. Set to 0 to get full rectangles.

Parameters:
Name Type Argument Default Description
xBorderRadius Number 6.75

Source:

Returns:

Type

Number|dc.heatMap


yAxisOnClick( [handler])

Gets or sets the handler that fires when a row tick is clicked in the y axis. By default, if any cells in the row are unselected, the whole row will be selected, otherwise the whole row will be unselected.

Parameters:
Name Type Argument Description
handler function

Source:

Returns:

Type

function|dc.heatMap


yBorderRadius( [yBorderRadius])

Gets or sets the Y border radius. Set to 0 to get full rectangles.

Parameters:
Name Type Argument Default Description
yBorderRadius Number 6.75

Source:

Returns:

Type

Number|dc.heatMap