Skip to content

Commit 00855bb

Browse files
initialize cell & tick positions on enter
because d3v4 doesn't default to the transition position anymore for #1400
1 parent f30a27b commit 00855bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/heatmap.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ dc.heatMap = function (parent, chartGroup) {
222222
gEnter.append('rect')
223223
.attr('class', 'heat-box')
224224
.attr('fill', 'white')
225+
.attr('x', function (d, i) { return cols(_chart.keyAccessor()(d, i)); })
226+
.attr('y', function (d, i) { return rows(_chart.valueAccessor()(d, i)); })
225227
.on('click', _chart.boxOnClick());
226228

227229
if (_chart.renderTitle()) {
@@ -278,10 +280,11 @@ dc.heatMap = function (parent, chartGroup) {
278280
gRowsText = gRowsText
279281
.enter()
280282
.append('text')
281-
.attr('dy', 6)
282283
.style('text-anchor', 'end')
283284
.attr('x', 0)
284285
.attr('dx', -2)
286+
.attr('y', function (d) { return rows(d) + boxHeight / 2; })
287+
.attr('dy', 6)
285288
.on('click', _chart.yAxisOnClick())
286289
.text(_chart.rowsLabel())
287290
.merge(gRowsText);

0 commit comments

Comments
 (0)