Skip to content

Commit

Permalink
Fix albersUsa, again.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Aug 25, 2011
1 parent 3f6fefb commit fb7e69f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions d3.geo.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ d3.geo.albersUsa = function() {
function albersUsa(coordinates) {
var lon = coordinates[0],
lat = coordinates[1];
return (lat < 21
? (lon < -100 ? hawaii : puertoRico)
: (lat > 50 ? alaska : lower48))(coordinates);
return (lat > 50 ? alaska
: lon < -140 ? hawaii
: lat < 21 ? puertoRico
: lower48)(coordinates);
}

albersUsa.scale = function(x) {
Expand Down
2 changes: 1 addition & 1 deletion d3.geo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion d3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function(){d3 = {version: "2.0.2"}; // semver
(function(){d3 = {version: "2.0.3"}; // semver
if (!Date.now) Date.now = function() {
return +new Date;
};
Expand Down
2 changes: 1 addition & 1 deletion d3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/core.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3 = {version: "2.0.2"}; // semver
d3 = {version: "2.0.3"}; // semver
7 changes: 4 additions & 3 deletions src/geo/albers.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ d3.geo.albersUsa = function() {
function albersUsa(coordinates) {
var lon = coordinates[0],
lat = coordinates[1];
return (lat < 21
? (lon < -100 ? hawaii : puertoRico)
: (lat > 50 ? alaska : lower48))(coordinates);
return (lat > 50 ? alaska
: lon < -140 ? hawaii
: lat < 21 ? puertoRico
: lower48)(coordinates);
}

albersUsa.scale = function(x) {
Expand Down

0 comments on commit fb7e69f

Please sign in to comment.