heatmap-tooltip: normalize histogram Y axis

This commit is contained in:
Alexander Zobnin
2017-06-18 20:58:13 +03:00
parent 581b977787
commit 1f4140057b
@@ -172,9 +172,11 @@ export class HeatmapTooltip {
}
barWidth = Math.max(barWidth, 1);
// Normalize histogram Y axis
let histogramDomain = _.reduce(_.map(histogramData, d => d[1]), (sum, val) => sum + val, 0);
let histYScale = d3.scaleLinear()
.domain([0, _.max(_.map(histogramData, d => d[1]))])
.range([0, HISTOGRAM_HEIGHT]);
.domain([0, histogramDomain])
.range([0, HISTOGRAM_HEIGHT]);
let histogram = this.tooltip.select(".heatmap-histogram")
.append("svg")