This commit is contained in:
Jason Davies 2012-11-18 20:05:33 +00:00
Родитель cf6b2fad90
Коммит bc96647636
3 изменённых файлов: 13 добавлений и 54 удалений

32
d3.js поставляемый
Просмотреть файл

@ -5495,38 +5495,18 @@
function circle() {
var o = typeof origin === "function" ? origin.apply(this, arguments) : origin;
rotate = d3_geo_rotation(-o[0] * d3_radians, -o[1] * d3_radians, 0);
var rings = [ [] ], context = bufferContext(rings);
d3_geo_circleInterpolateCircle(interpolate, context);
context.closePath();
return {
type: "Polygon",
coordinates: rings
};
}
function bufferContext(rings) {
var ring = rings[0];
return {
point: function(λ, φ) {
var point = rotate.invert(λ, φ);
point[0] *= d3_degrees;
point[1] *= d3_degrees;
rings.push(point);
},
moveTo: function(λ, φ) {
var point = rotate.invert(λ, φ);
point[0] *= d3_degrees;
point[1] *= d3_degrees;
rings.push(ring = [ point ]);
},
var ring = [];
d3_geo_circleInterpolateCircle(interpolate, {
lineTo: function(λ, φ) {
var point = rotate.invert(λ, φ);
point[0] *= d3_degrees;
point[1] *= d3_degrees;
ring.push(point);
},
closePath: function() {
if (ring.length) ring.push(ring[0]);
}
});
return {
type: "Polygon",
coordinates: [ ring ]
};
}
circle.origin = function(x) {

2
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -8,39 +8,18 @@ d3.geo.circle = function() {
function circle() {
var o = typeof origin === "function" ? origin.apply(this, arguments) : origin;
rotate = d3_geo_rotation(-o[0] * d3_radians, -o[1] * d3_radians, 0);
var rings = [[]], context = bufferContext(rings);
d3_geo_circleInterpolateCircle(interpolate, context);
context.closePath();
return {
type: "Polygon",
coordinates: rings
};
}
function bufferContext(rings) {
var ring = rings[0];
return {
point: function(λ, φ) {
var point = rotate.invert(λ, φ);
point[0] *= d3_degrees;
point[1] *= d3_degrees;
rings.push(point);
},
moveTo: function(λ, φ) {
var point = rotate.invert(λ, φ);
point[0] *= d3_degrees;
point[1] *= d3_degrees;
rings.push(ring = [point]);
},
var ring = [];
d3_geo_circleInterpolateCircle(interpolate, {
lineTo: function(λ, φ) {
var point = rotate.invert(λ, φ);
point[0] *= d3_degrees;
point[1] *= d3_degrees;
ring.push(point);
},
closePath: function() {
if (ring.length) ring.push(ring[0]);
}
});
return {
type: "Polygon",
coordinates: [ring]
};
}