Skip to content

Commit

Permalink
Fix USA label centering issue (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamf authored and markmarkoh committed May 3, 2018
1 parent 6a964c2 commit e11c513
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/js/datamaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@
this.svg.selectAll(".datamaps-subunit")
.attr("data-foo", function(d) {
var center = self.path.centroid(d);
if ( d.properties.iso === 'USA' ) {
center = self.projection([-98.58333, 39.83333])
}
var xOffset = 7.5, yOffset = 5;

if ( ["FL", "KY", "MI"].indexOf(d.id) > -1 ) xOffset = -2.5;
Expand Down

0 comments on commit e11c513

Please sign in to comment.