Skip to content

Commit 650ebcf

Browse files
committed
Fix for garticule.outline.
1 parent e40787c commit 650ebcf

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

d3.v2.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6309,9 +6309,9 @@
63096309
geometries: graticule.lines()
63106310
};
63116311
}
6312-
var x1 = 180, x0 = -x1, y1 = 90, y0 = -y1, dx = 22.5, dy = dx, δx = 2, δy = 2;
6312+
var x1 = 180 - ε, x0 = -x1, y1 = 90 - ε, y0 = -y1, dx = 22.5, dy = dx, δx = 2, δy = 2;
63136313
graticule.lines = function() {
6314-
var xSteps = d3.range(x0, x1 - δx / 2, δx).concat(x1), ySteps = d3.range(y0, y1 - δy / 2, δy).concat(y1), xLines = d3.range(Math.ceil(x0 / dx) * dx, x1, dx).map(function(x) {
6314+
var xSteps = d3.range(x0, x1 - ε, δx).concat(x1), ySteps = d3.range(y0, y1 - ε, δy).concat(y1), xLines = d3.range(Math.ceil(x0 / dx) * dx, x1, dx).map(function(x) {
63156315
return ySteps.map(function(y) {
63166316
return [ x, y ];
63176317
});
@@ -6328,9 +6328,10 @@
63286328
});
63296329
};
63306330
graticule.outline = function() {
6331+
var x2 = (x0 + x1) / 2;
63316332
return {
63326333
type: "Polygon",
6333-
coordinates: [ [ [ x0, y0 ], [ x1, y0 ], [ x1, y1 ], [ x0, y1 ], [ x0, x0 ] ] ]
6334+
coordinates: [ [ [ x0, y1 ], [ x2, y1 ], [ x1, y1 ], [ x1, y0 ], [ x2, y0 ], [ x0, y0 ], [ x0, y1 ] ] ]
63346335
};
63356336
};
63366337
graticule.extent = function(_) {

0 commit comments

Comments
 (0)