Skip to content

Commit

Permalink
Fix axis label placement
Browse files Browse the repository at this point in the history
Closes #1
  • Loading branch information
Joey Reid committed Oct 26, 2016
1 parent 100292d commit 427b852
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions inst/htmlwidgets/lib/d3heatmapcore/heatmapcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,10 @@ function heatmap(selector, data, options) {
.data(leaves)
.text(function(d){ return d; })
.attr("transform", function(d, i) {
var y = rotated ? -bandwidth() : bandwidth()/2;
var x = rotated ? 6 + padding : 6;
var y = rotated ? -(6 + padding) : bandwidth()/2;
var r = rotated ? "rotate(45)," : "";
return r + "translate(6," + y + ")";
return r + "translate(" + x + "," + y + ")";
})
.style("font-size", fontSize)
.style("text-anchor", "start");
Expand Down Expand Up @@ -481,8 +482,8 @@ function heatmap(selector, data, options) {
.data(leaves)
.text(function (d) {return d;})
.attr("transform", function(d, i) {
var x = rotated ? bandwidth() * 0.707/2 : 6;
var y = rotated ? -bandwidth() * 0.707/2 : bandwidth()/2;
var x = rotated ? bandwidth() * 0.707/2 + padding : 6;
var y = rotated ? -(bandwidth() * 0.707/2 + padding) : bandwidth()/2;
var r = rotated ? "rotate(45)," : "";
return r + "translate(" + x + "," + y + ")";
})
Expand Down

0 comments on commit 427b852

Please sign in to comment.