Skip to content

Commit 4652d54

Browse files
committed
More TODOs.
1 parent 3f1d801 commit 4652d54

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

d3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6296,7 +6296,7 @@
62966296
})();
62976297
}
62986298
function d3_geo_projectionMutator(projectAt) {
6299-
var project, rotate, rotation, projectRotate, k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, clip = d3_geo_cut, clipAngle = null;
6299+
var project, rotate, rotation, projectRotate, k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, δ2 = .5, maxDepth = 16, clip = d3_geo_cut, clipAngle = null;
63006300
function projection(coordinates) {
63016301
coordinates = projectRotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
63026302
return [ coordinates[0] * k + δx, δy - coordinates[1] * k ];
@@ -6351,7 +6351,6 @@
63516351
δy = y + center[1] * k;
63526352
return projection;
63536353
}
6354-
var λ00, φ00, λ0, sinφ0, cosφ0, x0, y0, δ2 = .5, maxDepth = 16;
63556354
var resample = d3_geo_type({
63566355
Point: function(o) {
63576356
o.coordinates = resamplePoint(o.coordinates);
@@ -6385,6 +6384,7 @@
63856384
function resamplePoint(point) {
63866385
return projectPoint(point[0], point[1]);
63876386
}
6387+
var λ00, φ00, λ0, sinφ0, cosφ0, x0, y0;
63886388
function resampleLine(coordinates) {
63896389
if (!(n = coordinates.length)) return coordinates;
63906390
var n, i = 0, p = coordinates[0], λ, φ, line;

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/projection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function d3_geo_projectionMutator(projectAt) {
116116

117117
// TODO rename: this is not just rotation, it also converts to radians!
118118
// TODO don't create new objects for rotation? (since clipping does the same?)
119+
// TODO don't call rotate when rotate is a no-op
119120
var rotation = d3_geo_type({
120121
point: function(coordinates) {
121122
return rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);

src/geo/rotation.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,19 @@ function d3_geo_rotation(δλ, δφ, δγ) {
1818
: d3_geo_identityRotation);
1919
}
2020

21+
// TODO should it be the responsibility of d3_geo_rotation to fix angles outside ±180°?
22+
// what if you wanted to avoid function call overhead by not rotating when there is no rotation?
23+
// probably better to enforce this when converting from degrees to radians
2124
function d3_geo_identityRotation(λ, φ) {
2225
return [
2326
λ > π ? λ - 2 * π : λ < -π ? λ + 2 * π : λ,
2427
φ
2528
];
2629
}
2730

28-
d3_geo_identityRotation.invert = function(x, y) { return [x, y]; };
31+
d3_geo_identityRotation.invert = function(x, y) {
32+
return [x, y];
33+
};
2934

3035
function d3_geo_forwardRotationλ(δλ) {
3136
return function(λ, φ) {

0 commit comments

Comments
 (0)