Skip to content

Commit

Permalink
Convert mouse target layout to quantitative scale
Browse files Browse the repository at this point in the history
Re #1
  • Loading branch information
Joey Reid committed Oct 26, 2016
1 parent bdf5e1d commit 41a4a4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inst/htmlwidgets/lib/d3heatmapcore/heatmapcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,12 @@ function heatmap(selector, data, options) {
function layoutMouseTargets(selection) {
selection
.attr("transform", function(d, i) {
var x = rotated ? scale(d) + scale.rangeBand()/2 : 0;
var y = rotated ? padding + 6 : scale(d);
var x = rotated ? scale(i) + bandwidth/2 : 0;
var y = rotated ? padding + 6 : scale(i);
return "translate(" + x + "," + y + ")";
})
.selectAll("rect")
.attr("height", scale.rangeBand() / (rotated ? 1.414 : 1))
.attr("height", bandwidth / (rotated ? 1.414 : 1))
.attr("width", rotated ? height * 1.414 * 1.2 : width);
}
layoutMouseTargets(mouseTargets);
Expand Down

0 comments on commit 41a4a4e

Please sign in to comment.