Skip to content

Commit 19d2a02

Browse files
authored
Removing hard coded 0 to support negative numbers.
By hard coding the 0 in the color domain, the heatmap did not support negative numbers and grouped all negative numbers into the same bucket. The fix simply takes the smaller of 0 or the smallest value in the dataset.
1 parent f13859c commit 19d2a02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

public/vis/components/visualization/heatmap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function heatmap() {
5959
var colDomain = getDomain(metrics, colValue);
6060
var rowDomain = getDomain(metrics, rowValue);
6161
var colorRange = colorbrewer[colors][numberOfColors];
62-
var colorDomain = [0, Math.max(d3.max(metrics, metric), 1)];
62+
var colorDomain = [Math.min(0, d3.min(metrics, metric)), Math.max(d3.max(metrics, metric), 1)];
6363
var columnScale = d3.scale.ordinal()
6464
.domain(colDomain)
6565
.rangeBands([0, adjustedWidth], padding);

0 commit comments

Comments
 (0)