API: Heatmap

Reusable Heatmap API module that renders a simple and configurable heatmap chart.

(require("Heatmap"))(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data HeatmapData The data to attach and generate the chart
Source:

Requires

  • module:d3-array,

Methods


module:Heatmap(_selection, _data)

This function creates the graph using the selection as container
Parameters:
Name Type Description
_selection D3Selection A d3 selection that represents the container(s) where the chart(s) will be rendered
_data HeatmapData The data to attach and generate the chart
Source:

<static> boxSize(_x)

Gets or Sets the boxSize of the chart
Parameters:
Name Type Default Description
_x Number 30 Desired boxSize for the heatmap boxes
Source:
Returns:
Current boxSize or Chart module to chain calls
Type
Number | module

<static> colorSchema(_x)

Gets or Sets the colorSchema of the chart
Parameters:
Name Type Default Description
_x Array.<String> britecharts-red Desired colorSchema for the heatma boxes
Source:
Returns:
Current colorSchema or Chart module to chain calls
Type
Array.<String> | module

<static> exportChart(filename, title)

Chart exported to png and a download action is fired
Parameters:
Name Type Description
filename String File title for the resulting picture
title String Title to add at the top of the exported picture
Source:

<static> height(_x)

Gets or Sets the height of the chart
Parameters:
Name Type Default Description
_x Number 270 Desired height for the chart
Source:
Returns:
Current height or Chart module to chain calls
Type
Number | module

<static> isAnimated(_x)

Gets or Sets the isAnimated value of the chart
Parameters:
Name Type Default Description
_x Boolean true Decide whether to show chart animation
Source:
Returns:
Current isAnimated value or Chart module to chain calls
Type
Boolean | module

<static> margin(_x)

Gets or Sets the margin of the chart
Parameters:
Name Type Description
_x Object Margin object to get/set
Source:
Returns:
Current margin or Chart module to chain calls
Type
margin | module

<static> width(_x)

Gets or Sets the width of the chart
Parameters:
Name Type Default Description
_x Number 780 Desired width for the chart
Source:
Returns:
Current width or Chart module to chain calls
Type
Number | module

<static> yAxisLabels(_x)

Gets or Sets the y-axis labels of the chart
Parameters:
Name Type Default Description
_x Array.<String> ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'] An array of string labels across the y-axis
Source:
Returns:
Current yAxisLabels array or Chart module to chain calls
Type
yAxisLabels | module