Fix #1437 - add identity projection.
The identity projection is equivalent to setting path.projection(null), except that you can apply post-projection features such as viewport clipping.
This commit is contained in:
Родитель
23ee2c08a6
Коммит
84793153d5
|
@ -3932,6 +3932,21 @@ d3 = function() {
|
|||
(d3.geo.gnomonic = function() {
|
||||
return d3_geo_projection(d3_geo_gnomonic);
|
||||
}).raw = d3_geo_gnomonic;
|
||||
d3.geo.identity = function() {
|
||||
var clipExtent = null;
|
||||
function identity(x) {
|
||||
return x;
|
||||
}
|
||||
identity.invert = identity;
|
||||
identity.stream = identity;
|
||||
identity.clipExtent = function(_) {
|
||||
if (!arguments.length) return clipExtent;
|
||||
clipExtent = _;
|
||||
identity.stream = _ == null ? identity : d3_geo_clipView(_[0][0], _[0][1], _[1][0], _[1][1]);
|
||||
return identity;
|
||||
};
|
||||
return identity;
|
||||
};
|
||||
function d3_geo_mercator(λ, φ) {
|
||||
return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
|
||||
}
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,20 @@
|
|||
d3.geo.identity = function() {
|
||||
var clipExtent = null;
|
||||
|
||||
function identity(x) {
|
||||
return x;
|
||||
}
|
||||
|
||||
identity.invert = identity;
|
||||
|
||||
identity.stream = identity;
|
||||
|
||||
identity.clipExtent = function(_) {
|
||||
if (!arguments.length) return clipExtent;
|
||||
clipExtent = _;
|
||||
identity.stream = _ == null ? identity : d3_geo_clipView(_[0][0], _[0][1], _[1][0], _[1][1]);
|
||||
return identity;
|
||||
};
|
||||
|
||||
return identity;
|
||||
};
|
|
@ -26,6 +26,7 @@ import "conic-equal-area";
|
|||
import "conic-equidistant";
|
||||
import "equirectangular";
|
||||
import "gnomonic";
|
||||
import "identity";
|
||||
import "mercator";
|
||||
import "orthographic";
|
||||
import "stereographic";
|
||||
|
|
Загрузка…
Ссылка в новой задаче