From 00855bb2bb5c44f2715265e96bab596ddef5b0b4 Mon Sep 17 00:00:00 2001 From: Gordon Woodhull Date: Thu, 12 Apr 2018 03:39:41 -0400 Subject: [PATCH] initialize cell & tick positions on enter because d3v4 doesn't default to the transition position anymore for #1400 --- src/heatmap.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/heatmap.js b/src/heatmap.js index 8c3f77629..48eb6e4e2 100644 --- a/src/heatmap.js +++ b/src/heatmap.js @@ -222,6 +222,8 @@ dc.heatMap = function (parent, chartGroup) { gEnter.append('rect') .attr('class', 'heat-box') .attr('fill', 'white') + .attr('x', function (d, i) { return cols(_chart.keyAccessor()(d, i)); }) + .attr('y', function (d, i) { return rows(_chart.valueAccessor()(d, i)); }) .on('click', _chart.boxOnClick()); if (_chart.renderTitle()) { @@ -278,10 +280,11 @@ dc.heatMap = function (parent, chartGroup) { gRowsText = gRowsText .enter() .append('text') - .attr('dy', 6) .style('text-anchor', 'end') .attr('x', 0) .attr('dx', -2) + .attr('y', function (d) { return rows(d) + boxHeight / 2; }) + .attr('dy', 6) .on('click', _chart.yAxisOnClick()) .text(_chart.rowsLabel()) .merge(gRowsText);