Skip to content

Commit 1bdc299

Browse files
committed
Fix d3.geo.albersUsa tests.
1 parent ac84e7e commit 1bdc299

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

d3.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3359,6 +3359,9 @@ d3 = function() {
33593359
(d3.geo.conicEqualArea = function() {
33603360
return d3_geo_conic(d3_geo_conicEqualArea);
33613361
}).raw = d3_geo_conicEqualArea;
3362+
d3.geo.albers = function() {
3363+
return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
3364+
};
33623365
d3.geo.albersUsa = function() {
33633366
var lower48 = d3.geo.albers();
33643367
var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
@@ -3688,9 +3691,6 @@ d3 = function() {
36883691
};
36893692
};
36903693
}
3691-
d3.geo.albers = function() {
3692-
return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
3693-
};
36943694
function d3_geo_azimuthal(scale, angle) {
36953695
function azimuthal(λ, φ) {
36963696
var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);

d3.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/geo/albers-usa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "conic-equal-area";
1+
import "albers";
22
import "geo";
33

44
// A composite projection for the United States, configured by default for

test/geo/albers-usa-test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ suite.addBatch({
1010
topic: load("geo/albers-usa").expression("d3.geo.albersUsa"),
1111
"default": projectionTestSuite({
1212
topic: function(projection) { return projection(); },
13-
"has the scale 1000": function(p) {
14-
assert.inDelta(p.scale(), 1000, 1e-6);
13+
"has the scale 1070": function(p) {
14+
assert.inDelta(p.scale(), 1070, 1e-6);
1515
}
1616
}, {
17-
"Washington, DC": [[-120.50000000, 47.50000000], [ 215.47899724, 51.97649392]],
18-
"San Francisco, CA": [[-122.42000000, 37.78000000], [ 150.07267740, 211.25782936]],
19-
"Juneau, AK": [[-134.22000000, 58.43000000], [ 217.36659042, 409.49851773]],
20-
"Honolulu, HI": [[-157.82000000, 21.30000000], [ 325.69600300, 427.27882479]],
21-
"San Juan, PR": [[ -66.07000000, 18.45000000], [ 909.15925090, 456.39482719]]
17+
"Washington, DC": [[-120.50000000, 47.50000000], [ 181.00023857, 45.12748866]],
18+
"San Francisco, CA": [[-122.42000000, 37.78000000], [ 107.44485839, 214.04820561]],
19+
"Juneau, AK": [[-134.22000000, 58.43000000], [ 224.79015007, 455.65860760]],
20+
"Honolulu, HI": [[-157.82000000, 21.30000000], [ 299.14918225, 451.11762634]],
21+
"San Juan, PR": [[ -66.07000000, 18.45000000], [1030.00551581, 540.01932405]]
2222
}),
2323
"translated to 0,0 and at scale 1": projectionTestSuite({
2424
topic: function(projection) { return projection().translate([0, 0]).scale(1); }
2525
}, {
26-
"Washington, DC": [[-120.50000000, 47.50000000], [ -0.26452100, -0.19802351]],
27-
"San Francisco, CA": [[-122.42000000, 37.78000000], [ -0.32992732, -0.03874217]],
28-
"Juneau, AK": [[-134.22000000, 58.43000000], [ -0.26263341, 0.15949852]],
29-
"Honolulu, HI": [[-157.82000000, 21.30000000], [ -0.15430400, 0.17727882]],
30-
"San Juan, PR": [[ -66.07000000, 18.45000000], [ 0.42915925, 0.20639483]]
26+
"Washington, DC": [[-120.50000000, 47.50000000], [ -0.27943903, -0.19146964]],
27+
"San Francisco, CA": [[-122.42000000, 37.78000000], [ -0.34818238, -0.03359981]],
28+
"Juneau, AK": [[-134.22000000, 58.43000000], [ -0.23851388, 0.19220431]],
29+
"Honolulu, HI": [[-157.82000000, 21.30000000], [ -0.16901946, 0.18796040]],
30+
"San Juan, PR": [[ -66.07000000, 18.45000000], [ 0.51402385, 0.27104610]]
3131
})
3232
}
3333
});

0 commit comments

Comments
 (0)