d3js-plugins-rails 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/d3js-plugins-rails/version.rb +2 -2
- data/vendor/assets/javascripts/d3/plugins/LICENSE +1 -1
- data/vendor/assets/javascripts/d3/plugins/README.md +0 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/README.md +1 -252
- data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/README.md +9 -0
- data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/interpolate-zoom-test.js +27 -0
- data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/interpolate-zoom.js +18 -32
- data.tar.gz.sig +0 -0
- metadata +4 -140
- metadata.gz.sig +2 -5
- data/vendor/assets/javascripts/d3/plugins/.gitignore +0 -1
- data/vendor/assets/javascripts/d3/plugins/Makefile +0 -18
- data/vendor/assets/javascripts/d3/plugins/geo/projection/airy.js +0 -55
- data/vendor/assets/javascripts/d3/plugins/geo/projection/aitoff.js +0 -42
- data/vendor/assets/javascripts/d3/plugins/geo/projection/armadillo.js +0 -81
- data/vendor/assets/javascripts/d3/plugins/geo/projection/august.js +0 -36
- data/vendor/assets/javascripts/d3/plugins/geo/projection/baker.js +0 -30
- data/vendor/assets/javascripts/d3/plugins/geo/projection/berghaus.js +0 -76
- data/vendor/assets/javascripts/d3/plugins/geo/projection/boggs.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/bonne.js +0 -30
- data/vendor/assets/javascripts/d3/plugins/geo/projection/bromley.js +0 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/chamberlin.js +0 -116
- data/vendor/assets/javascripts/d3/plugins/geo/projection/collignon.js +0 -19
- data/vendor/assets/javascripts/d3/plugins/geo/projection/craig.js +0 -31
- data/vendor/assets/javascripts/d3/plugins/geo/projection/craster.js +0 -20
- data/vendor/assets/javascripts/d3/plugins/geo/projection/cylindrical-equal-area.js +0 -24
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert1.js +0 -20
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js +0 -19
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert3.js +0 -19
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert4.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert5.js +0 -19
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js +0 -24
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eisenlohr.js +0 -78
- data/vendor/assets/javascripts/d3/plugins/geo/projection/elliptic.js +0 -118
- data/vendor/assets/javascripts/d3/plugins/geo/projection/end.js +0 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/fahey.js +0 -21
- data/vendor/assets/javascripts/d3/plugins/geo/projection/gall-stereographic.js +0 -19
- data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg-polyconic.js +0 -56
- data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg4.js +0 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg5.js +0 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg6.js +0 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg8.js +0 -29
- data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg9.js +0 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/gringorten.js +0 -150
- data/vendor/assets/javascripts/d3/plugins/geo/projection/guyou.js +0 -55
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer-retroazimuthal.js +0 -106
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer.js +0 -53
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hatano.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/healpix.js +0 -85
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hill.js +0 -66
- data/vendor/assets/javascripts/d3/plugins/geo/projection/homolosine.js +0 -18
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hyperbolic.js +0 -22
- data/vendor/assets/javascripts/d3/plugins/geo/projection/index.js +0 -72
- data/vendor/assets/javascripts/d3/plugins/geo/projection/interrupt.js +0 -150
- data/vendor/assets/javascripts/d3/plugins/geo/projection/kavrayskiy7.js +0 -17
- data/vendor/assets/javascripts/d3/plugins/geo/projection/lagrange.js +0 -47
- data/vendor/assets/javascripts/d3/plugins/geo/projection/larrivee.js +0 -41
- data/vendor/assets/javascripts/d3/plugins/geo/projection/laskowski.js +0 -33
- data/vendor/assets/javascripts/d3/plugins/geo/projection/littrow.js +0 -23
- data/vendor/assets/javascripts/d3/plugins/geo/projection/loximuthal.js +0 -30
- data/vendor/assets/javascripts/d3/plugins/geo/projection/math.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/miller.js +0 -17
- data/vendor/assets/javascripts/d3/plugins/geo/projection/modified-stereographic.js +0 -106
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mollweide.js +0 -37
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-parabolic.js +0 -23
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-quartic.js +0 -25
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-sinusoidal.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/natural-earth.js +0 -24
- data/vendor/assets/javascripts/d3/plugins/geo/projection/nell-hammer.js +0 -22
- data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel1.js +0 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel2.js +0 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/peirce-quincuncial.js +0 -7
- data/vendor/assets/javascripts/d3/plugins/geo/projection/polyconic.js +0 -31
- data/vendor/assets/javascripts/d3/plugins/geo/projection/projection.js +0 -4
- data/vendor/assets/javascripts/d3/plugins/geo/projection/quincuncial.js +0 -73
- data/vendor/assets/javascripts/d3/plugins/geo/projection/rectangular-polyconic.js +0 -41
- data/vendor/assets/javascripts/d3/plugins/geo/projection/robinson.js +0 -85
- data/vendor/assets/javascripts/d3/plugins/geo/projection/satellite.js +0 -70
- data/vendor/assets/javascripts/d3/plugins/geo/projection/sinu-mollweide.js +0 -20
- data/vendor/assets/javascripts/d3/plugins/geo/projection/sinusoidal.js +0 -17
- data/vendor/assets/javascripts/d3/plugins/geo/projection/start.js +0 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/airy-test.js +0 -25
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/aitoff-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js +0 -30
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/assert.js +0 -32
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/august-test.js +0 -29
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/baker-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/berghaus-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/boggs-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/bonne-test.js +0 -45
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craig-test.js +0 -40
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craster-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/eckert4-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/eisenlohr-test.js +0 -36
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/equirectangular-test.js +0 -96
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/fahey-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg4-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg5-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg6-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg8-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg9-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/gringorten-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/guyou-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-retroazimuthal-test.js +0 -39
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-test.js +0 -29
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hatano-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/healpix-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hill-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/lagrange-test.js +0 -59
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/larrivee-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/laskowski-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/littrow-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/load.js +0 -20
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/loximuthal-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/modified-stereographic-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mollweide-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-parabolic-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-quartic-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-sinusoidal-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/natural-earth-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/peirce-quincuncial-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/polyconic-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/quartic-authalic-test.js +0 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/rectangular-polyconic-test.js +0 -48
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/robinson-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/times-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-azimuthal-test.js +0 -24
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-equidistant-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten2-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten3-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten4-test.js +0 -32
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wagner6-test.js +0 -27
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wiechel-test.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/winkel3-test.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/times.js +0 -21
- data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-azimuthal.js +0 -47
- data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-equidistant.js +0 -83
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten.js +0 -43
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten2.js +0 -30
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten3.js +0 -26
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten4.js +0 -56
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner4.js +0 -10
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner6.js +0 -17
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner7.js +0 -24
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wiechel.js +0 -28
- data/vendor/assets/javascripts/d3/plugins/geo/projection/winkel3.js +0 -41
- data/vendor/assets/javascripts/d3/plugins/package.json +0 -22
@@ -1,32 +0,0 @@
|
|
1
|
-
var vows = require("vows"),
|
2
|
-
assert = require("./assert"),
|
3
|
-
load = require("./load");
|
4
|
-
|
5
|
-
var suite = vows.describe("d3.geo.vanDerGrinten4");
|
6
|
-
|
7
|
-
suite.addBatch({
|
8
|
-
"vanDerGrinten4": {
|
9
|
-
topic: load("van-der-grinten4"),
|
10
|
-
"default": {
|
11
|
-
topic: function(geo) { return geo.vanDerGrinten4(); },
|
12
|
-
"doesn't generate NaNs": function(vanDerGrinten4) {
|
13
|
-
assert.inDelta(vanDerGrinten4([20, 1e-7]), [532.359877, 250], 1e-6);
|
14
|
-
assert.inDelta(vanDerGrinten4([180.0000000000001, -90.00000000000003]), [480, 485.619449], 1e-6);
|
15
|
-
assert.inDelta(vanDerGrinten4([-180, -90.00000000000003]), [480, 485.619449], 1e-6);
|
16
|
-
},
|
17
|
-
"projections and inverse projections": function(vanDerGrinten4) {
|
18
|
-
assert.equalInverse(vanDerGrinten4, [ 0, 0], [480, 250]);
|
19
|
-
assert.equalInverse(vanDerGrinten4, [ 0, -45], [480, 367.809724]);
|
20
|
-
assert.equalInverse(vanDerGrinten4, [ 0, 45], [480, 132.190275]);
|
21
|
-
assert.equalInverse(vanDerGrinten4, [-90, 0], [244.380550, 250]);
|
22
|
-
assert.equalInverse(vanDerGrinten4, [ 90, 0], [715.619449, 250]);
|
23
|
-
assert.equalInverse(vanDerGrinten4, [-80, 15], [274.023642, 209.610498]);
|
24
|
-
assert.equalInverse(vanDerGrinten4, [ 1, 1], [482.617670, 247.382005]);
|
25
|
-
assert.equalInverse(vanDerGrinten4, [ 15, 45], [509.605158, 131.892658]);
|
26
|
-
assert.equalInverse(vanDerGrinten4, [-180, 15], [ 12.226093, 204.955105]);
|
27
|
-
}
|
28
|
-
}
|
29
|
-
}
|
30
|
-
});
|
31
|
-
|
32
|
-
suite.export(module);
|
@@ -1,27 +0,0 @@
|
|
1
|
-
var vows = require("vows"),
|
2
|
-
assert = require("./assert"),
|
3
|
-
load = require("./load");
|
4
|
-
|
5
|
-
var suite = vows.describe("d3.geo.wagner6");
|
6
|
-
|
7
|
-
suite.addBatch({
|
8
|
-
"wagner6": {
|
9
|
-
topic: load("wagner6"),
|
10
|
-
"default": {
|
11
|
-
topic: function(geo) { return geo.wagner6(); },
|
12
|
-
"projections and inverse projections": function(wagner6) {
|
13
|
-
assert.equalInverse(wagner6, [ 0, 0], [480, 250]);
|
14
|
-
assert.equalInverse(wagner6, [ 0, -90], [480, 485.619449]);
|
15
|
-
assert.equalInverse(wagner6, [ 0, 90], [480, 14.380550]);
|
16
|
-
assert.equalInverse(wagner6, [ 0, -45], [480, 367.809724]);
|
17
|
-
assert.equalInverse(wagner6, [ 0, 45], [480, 132.190275]);
|
18
|
-
assert.equalInverse(wagner6, [-180, 0], [ 8.761101, 250]);
|
19
|
-
assert.equalInverse(wagner6, [ 180, 0], [951.238898, 250]);
|
20
|
-
assert.equalInverse(wagner6, [-179, 15], [16.2862562, 210.730091]);
|
21
|
-
assert.equalInverse(wagner6, [ 1, 1], [482.617872, 247.382006]);
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
});
|
26
|
-
|
27
|
-
suite.export(module);
|
@@ -1,26 +0,0 @@
|
|
1
|
-
var vows = require("vows"),
|
2
|
-
assert = require("./assert"),
|
3
|
-
load = require("./load");
|
4
|
-
|
5
|
-
var suite = vows.describe("d3.geo.wiechel");
|
6
|
-
|
7
|
-
suite.addBatch({
|
8
|
-
"wiechel": {
|
9
|
-
topic: load("wiechel"),
|
10
|
-
"default": {
|
11
|
-
topic: function(geo) { return geo.wiechel(); },
|
12
|
-
"projections and inverse projections": function(wiechel) {
|
13
|
-
assert.equalInverse(wiechel, [ 0, 0], [480, 250]);
|
14
|
-
assert.equalInverse(wiechel, [ 0, -45], [436.066017, 356.066017]);
|
15
|
-
assert.equalInverse(wiechel, [ 0, 45], [523.933982, 143.933982]);
|
16
|
-
assert.equalInverse(wiechel, [-90, 0], [330, 100]);
|
17
|
-
assert.equalInverse(wiechel, [ 90, 0], [630, 400]);
|
18
|
-
assert.equalInverse(wiechel, [-80, 15], [370.087700, 90.716040]);
|
19
|
-
assert.equalInverse(wiechel, [ 1, 1], [482.649770, 247.414442]);
|
20
|
-
assert.equalInverse(wiechel, [ 15, 45], [553.483232, 155.847766]);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|
24
|
-
});
|
25
|
-
|
26
|
-
suite.export(module);
|
@@ -1,28 +0,0 @@
|
|
1
|
-
var vows = require("vows"),
|
2
|
-
assert = require("./assert"),
|
3
|
-
load = require("./load");
|
4
|
-
|
5
|
-
var suite = vows.describe("d3.geo.winkel3");
|
6
|
-
|
7
|
-
suite.addBatch({
|
8
|
-
"winkel3": {
|
9
|
-
topic: load("winkel3"),
|
10
|
-
"default": {
|
11
|
-
topic: function(geo) { return geo.winkel3(); },
|
12
|
-
"projections and inverse projections": function(winkel3) {
|
13
|
-
assert.equalInverse(winkel3, [ 0, 0], [480, 250]);
|
14
|
-
assert.equalInverse(winkel3, [ 0, -90], [480, 485.619449]);
|
15
|
-
assert.equalInverse(winkel3, [ 0, 90], [480, 14.380550]);
|
16
|
-
assert.equalInverse(winkel3, [ 0, -45], [480, 367.809724]);
|
17
|
-
assert.equalInverse(winkel3, [ 0, 45], [480, 132.190275]);
|
18
|
-
assert.equalInverse(winkel3, [-180, 0], [ 94.380550, 250]);
|
19
|
-
assert.equalInverse(winkel3, [ 180, 0], [865.619449, 250]);
|
20
|
-
assert.equalInverse(winkel3, [-179, 15], [104.464309, 200.036192]);
|
21
|
-
assert.equalInverse(winkel3, [ 1, 1], [482.142197, 247.381989]);
|
22
|
-
assert.equalInverse(winkel3, [ 45, 87], [522.079049, 21.958321]);
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
});
|
27
|
-
|
28
|
-
suite.export(module);
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function times(λ, φ) {
|
4
|
-
var t = Math.tan(φ / 2),
|
5
|
-
s = Math.sin(π / 4 * t);
|
6
|
-
return [
|
7
|
-
λ * (.74482 - .34588 * s * s),
|
8
|
-
1.70711 * t
|
9
|
-
];
|
10
|
-
}
|
11
|
-
|
12
|
-
times.invert = function(x, y) {
|
13
|
-
var t = y / 1.70711,
|
14
|
-
s = Math.sin(π / 4 * t);
|
15
|
-
return [
|
16
|
-
x / (.74482 - .34588 * s * s),
|
17
|
-
2 * Math.atan(t)
|
18
|
-
];
|
19
|
-
};
|
20
|
-
|
21
|
-
(d3.geo.times = function() { return projection(times); }).raw = times;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
import "two-point-equidistant";
|
3
|
-
|
4
|
-
function twoPointAzimuthal(d) {
|
5
|
-
var cosd = Math.cos(d);
|
6
|
-
|
7
|
-
function forward(λ, φ) {
|
8
|
-
var coordinates = d3.geo.gnomonic.raw(λ, φ);
|
9
|
-
coordinates[0] *= cosd;
|
10
|
-
return coordinates;
|
11
|
-
}
|
12
|
-
|
13
|
-
forward.invert = function(x, y) {
|
14
|
-
return d3.geo.gnomonic.raw.invert(x / cosd, y);
|
15
|
-
};
|
16
|
-
|
17
|
-
return forward;
|
18
|
-
}
|
19
|
-
|
20
|
-
function twoPointAzimuthalProjection() {
|
21
|
-
var points = [[0, 0], [0, 0]],
|
22
|
-
m = projectionMutator(twoPointAzimuthal),
|
23
|
-
p = m(0),
|
24
|
-
rotate = p.rotate;
|
25
|
-
|
26
|
-
delete p.rotate;
|
27
|
-
|
28
|
-
p.points = function(_) {
|
29
|
-
if (!arguments.length) return points;
|
30
|
-
points = _;
|
31
|
-
|
32
|
-
var interpolate = d3.geo.interpolate(_[0], _[1]),
|
33
|
-
origin = interpolate(.5),
|
34
|
-
p = twoPointEquidistant_rotate(-origin[0] * radians, -origin[1] * radians, _[0][0] * radians, _[0][1] * radians),
|
35
|
-
b = interpolate.distance * .5, // |[0, 0] - p|
|
36
|
-
c = (p[0] < 0 ? -1 : +1) * p[1], // |[p[0], 0] - p|
|
37
|
-
γ = asin(Math.sin(c) / Math.sin(b));
|
38
|
-
|
39
|
-
rotate.call(p, [-origin[0], -origin[1], -γ * degrees]);
|
40
|
-
|
41
|
-
return m(b);
|
42
|
-
};
|
43
|
-
|
44
|
-
return p;
|
45
|
-
}
|
46
|
-
|
47
|
-
(d3.geo.twoPointAzimuthal = twoPointAzimuthalProjection).raw = twoPointAzimuthal;
|
@@ -1,83 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
// TODO clip to ellipse
|
4
|
-
// TODO expose d3.geo.rotation?
|
5
|
-
|
6
|
-
function twoPointEquidistant(z0) {
|
7
|
-
if (!z0) return d3.geo.azimuthalEquidistant.raw;
|
8
|
-
var λa = -z0 / 2,
|
9
|
-
λb = -λa,
|
10
|
-
z02 = z0 * z0,
|
11
|
-
tanλ0 = Math.tan(λb),
|
12
|
-
S = .5 / Math.sin(λb);
|
13
|
-
|
14
|
-
function forward(λ, φ) {
|
15
|
-
var za = acos(Math.cos(φ) * Math.cos(λ - λa)),
|
16
|
-
zb = acos(Math.cos(φ) * Math.cos(λ - λb)),
|
17
|
-
ys = φ < 0 ? -1 : 1;
|
18
|
-
za *= za, zb *= zb;
|
19
|
-
return [
|
20
|
-
(za - zb) / (2 * z0),
|
21
|
-
ys * asqrt(4 * z02 * zb - (z02 - za + zb) * (z02 - za + zb)) / (2 * z0)
|
22
|
-
];
|
23
|
-
}
|
24
|
-
|
25
|
-
forward.invert = function(x, y) {
|
26
|
-
var y2 = y * y,
|
27
|
-
cosza = Math.cos(Math.sqrt(y2 + (t = x + λa) * t)),
|
28
|
-
coszb = Math.cos(Math.sqrt(y2 + (t = x + λb) * t)),
|
29
|
-
t,
|
30
|
-
d;
|
31
|
-
return [
|
32
|
-
Math.atan2(d = cosza - coszb, t = (cosza + coszb) * tanλ0),
|
33
|
-
(y < 0 ? -1 : 1) * acos(Math.sqrt(t * t + d * d) * S)
|
34
|
-
];
|
35
|
-
};
|
36
|
-
|
37
|
-
return forward;
|
38
|
-
}
|
39
|
-
|
40
|
-
function twoPointEquidistantProjection() {
|
41
|
-
var points = [[0, 0], [0, 0]],
|
42
|
-
m = projectionMutator(twoPointEquidistant),
|
43
|
-
p = m(0),
|
44
|
-
rotate = p.rotate;
|
45
|
-
|
46
|
-
delete p.rotate;
|
47
|
-
|
48
|
-
p.points = function(_) {
|
49
|
-
if (!arguments.length) return points;
|
50
|
-
points = _;
|
51
|
-
|
52
|
-
// Compute the origin as the midpoint of the two reference points.
|
53
|
-
// Rotate one of the reference points by the origin.
|
54
|
-
// Apply the spherical law of sines to compute γ rotation.
|
55
|
-
var interpolate = d3.geo.interpolate(_[0], _[1]),
|
56
|
-
origin = interpolate(.5),
|
57
|
-
p = twoPointEquidistant_rotate(-origin[0] * radians, -origin[1] * radians, _[0][0] * radians, _[0][1] * radians),
|
58
|
-
b = interpolate.distance * .5, // |[0, 0] - p|
|
59
|
-
c = (p[0] < 0 ? -1 : +1) * p[1], // |[p[0], 0] - p|
|
60
|
-
γ = asin(Math.sin(c) / Math.sin(b));
|
61
|
-
|
62
|
-
rotate.call(p, [-origin[0], -origin[1], -γ * degrees]);
|
63
|
-
|
64
|
-
return m(b * 2);
|
65
|
-
};
|
66
|
-
|
67
|
-
return p;
|
68
|
-
}
|
69
|
-
|
70
|
-
function twoPointEquidistant_rotate(δλ, δφ, λ, φ) {
|
71
|
-
var cosδφ = Math.cos(δφ),
|
72
|
-
sinδφ = Math.sin(δφ),
|
73
|
-
cosφ = Math.cos(φ),
|
74
|
-
x = Math.cos(λ += δλ) * cosφ,
|
75
|
-
y = Math.sin(λ) * cosφ,
|
76
|
-
z = Math.sin(φ);
|
77
|
-
return [
|
78
|
-
Math.atan2(y, x * cosδφ - z * sinδφ),
|
79
|
-
asin(z * cosδφ + x * sinδφ)
|
80
|
-
];
|
81
|
-
}
|
82
|
-
|
83
|
-
(d3.geo.twoPointEquidistant = twoPointEquidistantProjection).raw = twoPointEquidistant;
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function vanDerGrinten(λ, φ) {
|
4
|
-
if (Math.abs(φ) < ε) return [λ, 0];
|
5
|
-
var sinθ = Math.abs(2 * φ / π),
|
6
|
-
θ = asin(sinθ);
|
7
|
-
if (Math.abs(λ) < ε || Math.abs(Math.abs(φ) - π / 2) < ε) return [0, sgn(φ) * π * Math.tan(θ / 2)];
|
8
|
-
var cosθ = Math.cos(θ),
|
9
|
-
A = Math.abs(π / λ - λ / π) / 2,
|
10
|
-
A2 = A * A,
|
11
|
-
G = cosθ / (sinθ + cosθ - 1),
|
12
|
-
P = G * (2 / sinθ - 1),
|
13
|
-
P2 = P * P,
|
14
|
-
P2_A2 = P2 + A2,
|
15
|
-
G_P2 = G - P2,
|
16
|
-
Q = A2 + G;
|
17
|
-
return [
|
18
|
-
sgn(λ) * π * (A * G_P2 + Math.sqrt(A2 * G_P2 * G_P2 - P2_A2 * (G * G - P2))) / P2_A2,
|
19
|
-
sgn(φ) * π * (P * Q - A * Math.sqrt((A2 + 1) * P2_A2 - Q * Q)) / P2_A2
|
20
|
-
];
|
21
|
-
}
|
22
|
-
|
23
|
-
vanDerGrinten.invert = function(x, y) {
|
24
|
-
if (Math.abs(y) < ε) return [x, 0];
|
25
|
-
if (Math.abs(x) < ε) return [0, π / 2 * Math.sin(2 * Math.atan(y / π))];
|
26
|
-
var x2 = (x /= π) * x,
|
27
|
-
y2 = (y /= π) * y,
|
28
|
-
x2_y2 = x2 + y2,
|
29
|
-
z = x2_y2 * x2_y2,
|
30
|
-
c1 = -Math.abs(y) * (1 + x2_y2),
|
31
|
-
c2 = c1 - 2 * y2 + x2,
|
32
|
-
c3 = -2 * c1 + 1 + 2 * y2 + z,
|
33
|
-
d = y2 / c3 + (2 * c2 * c2 * c2 / (c3 * c3 * c3) - 9 * c1 * c2 / (c3 * c3)) / 27,
|
34
|
-
a1 = (c1 - c2 * c2 / (3 * c3)) / c3,
|
35
|
-
m1 = 2 * Math.sqrt(-a1 / 3),
|
36
|
-
θ1 = acos(3 * d / (a1 * m1)) / 3;
|
37
|
-
return [
|
38
|
-
π * (x2_y2 - 1 + Math.sqrt(1 + 2 * (x2 - y2) + z)) / (2 * x),
|
39
|
-
sgn(y) * π * (-m1 * Math.cos(θ1 + π / 3) - c2 / (3 * c3))
|
40
|
-
];
|
41
|
-
};
|
42
|
-
|
43
|
-
(d3.geo.vanDerGrinten = function() { return projection(vanDerGrinten); }).raw = vanDerGrinten;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function vanDerGrinten2(λ, φ) {
|
4
|
-
if (Math.abs(φ) < ε) return [λ, 0];
|
5
|
-
var sinθ = Math.abs(2 * φ / π),
|
6
|
-
θ = asin(sinθ);
|
7
|
-
if (Math.abs(λ) < ε || Math.abs(Math.abs(φ) - π / 2) < ε) return [0, sgn(φ) * π * Math.tan(θ / 2)];
|
8
|
-
var cosθ = Math.cos(θ),
|
9
|
-
A = Math.abs(π / λ - λ / π) / 2,
|
10
|
-
A2 = A * A,
|
11
|
-
x1 = cosθ * (Math.sqrt(1 + A2) - A * cosθ) / (1 + A2 * sinθ * sinθ);
|
12
|
-
return [
|
13
|
-
sgn(λ) * π * x1,
|
14
|
-
sgn(φ) * π * asqrt(1 - x1 * (2 * A + x1))
|
15
|
-
];
|
16
|
-
}
|
17
|
-
|
18
|
-
vanDerGrinten2.invert = function(x, y) {
|
19
|
-
if (!x) return [0, π / 2 * Math.sin(2 * Math.atan(y / π))];
|
20
|
-
var x1 = Math.abs(x / π),
|
21
|
-
A = (1 - x1 * x1 - (y /= π) * y) / (2 * x1),
|
22
|
-
A2 = A * A,
|
23
|
-
B = Math.sqrt(A2 + 1);
|
24
|
-
return [
|
25
|
-
sgn(x) * π * (B - A),
|
26
|
-
sgn(y) * π / 2 * Math.sin(2 * Math.atan2(Math.sqrt((1 - 2 * A * x1) * (A + B) - x1), Math.sqrt(B + A + x1)))
|
27
|
-
];
|
28
|
-
};
|
29
|
-
|
30
|
-
(d3.geo.vanDerGrinten2 = function() { return projection(vanDerGrinten2); }).raw = vanDerGrinten2;
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function vanDerGrinten3(λ, φ) {
|
4
|
-
if (Math.abs(φ) < ε) return [λ, 0];
|
5
|
-
var sinθ = 2 * φ / π,
|
6
|
-
θ = asin(sinθ);
|
7
|
-
if (Math.abs(λ) < ε || Math.abs(Math.abs(φ) - π / 2) < ε) return [0, π * Math.tan(θ / 2)];
|
8
|
-
var A = (π / λ - λ / π) / 2,
|
9
|
-
y1 = sinθ / (1 + Math.cos(θ));
|
10
|
-
return [
|
11
|
-
π * (sgn(λ) * asqrt(A * A + 1 - y1 * y1) - A),
|
12
|
-
π * y1
|
13
|
-
];
|
14
|
-
}
|
15
|
-
|
16
|
-
vanDerGrinten3.invert = function(x, y) {
|
17
|
-
if (!y) return [x, 0];
|
18
|
-
var y1 = y / π,
|
19
|
-
A = (π * π * (1 - y1 * y1) - x * x) / (2 * π * x);
|
20
|
-
return [
|
21
|
-
x ? π * (sgn(x) * Math.sqrt(A * A + 1) - A) : 0,
|
22
|
-
π / 2 * Math.sin(2 * Math.atan(y1))
|
23
|
-
];
|
24
|
-
};
|
25
|
-
|
26
|
-
(d3.geo.vanDerGrinten3 = function() { return projection(vanDerGrinten3); }).raw = vanDerGrinten3;
|
@@ -1,56 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function vanDerGrinten4(λ, φ) {
|
4
|
-
if (!φ) return [λ, 0];
|
5
|
-
var φ0 = Math.abs(φ);
|
6
|
-
if (!λ || φ0 === π / 2) return [0, φ];
|
7
|
-
var B = 2 * φ0 / π,
|
8
|
-
B2 = B * B,
|
9
|
-
C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)),
|
10
|
-
C2 = C * C,
|
11
|
-
BC = B * C,
|
12
|
-
B_C2 = B2 + C2 + 2 * BC,
|
13
|
-
B_3C = B + 3 * C,
|
14
|
-
λ0 = 2 * λ / π,
|
15
|
-
λ1 = λ0 + 1 / λ0,
|
16
|
-
D = sgn(Math.abs(λ) - π / 2) * Math.sqrt(λ1 * λ1 - 4),
|
17
|
-
D2 = D * D,
|
18
|
-
F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + 12 * BC * C2 + 4 * C2 * C2),
|
19
|
-
x1 = (D * (B_C2 + C2 - 1) + 2 * asqrt(F)) / (4 * B_C2 + D2);
|
20
|
-
return [
|
21
|
-
sgn(λ) * π * x1 / 2,
|
22
|
-
sgn(φ) * π / 2 * asqrt(1 + D * Math.abs(x1) - x1 * x1)
|
23
|
-
];
|
24
|
-
}
|
25
|
-
|
26
|
-
vanDerGrinten4.invert = function(x, y) {
|
27
|
-
if (!x || !y) return [x, y];
|
28
|
-
y /= π;
|
29
|
-
var x1 = sgn(x) * x * 2 / π,
|
30
|
-
D = (x1 * x1 - 1 + 4 * y * y) / Math.abs(x1),
|
31
|
-
D2 = D * D,
|
32
|
-
B = 2 * y,
|
33
|
-
i = 50;
|
34
|
-
do {
|
35
|
-
var B2 = B * B,
|
36
|
-
C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)),
|
37
|
-
C_ = (3 * B - B2 * B - 10) / (2 * B2 * B),
|
38
|
-
C2 = C * C,
|
39
|
-
BC = B * C,
|
40
|
-
B_C = B + C,
|
41
|
-
B_C2 = B_C * B_C,
|
42
|
-
B_3C = B + 3 * C,
|
43
|
-
F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * (B_3C * B_3C + 4 * C2) + C2 * (12 * BC + 4 * C2)),
|
44
|
-
F_ = -2 * B_C * (4 * BC * C2 + (1 - 4 * B2 + 3 * B2 * B2) * (1 + C_) + C2 * (-6 + 14 * B2 - D2 + (-8 + 8 * B2 - 2 * D2) * C_) + BC * (-8 + 12 * B2 + (-10 + 10 * B2 - D2) * C_)),
|
45
|
-
sqrtF = Math.sqrt(F),
|
46
|
-
f = D * (B_C2 + C2 - 1) + 2 * sqrtF - x1 * (4 * B_C2 + D2),
|
47
|
-
f_ = D * (2 * C * C_ + 2 * B_C * (1 + C_)) + F_ / sqrtF - 8 * B_C * (D * (-1 + C2 + B_C2) + 2 * sqrtF) * (1 + C_) / (D2 + 4 * B_C2);
|
48
|
-
B -= δ = f / f_;
|
49
|
-
} while (δ > ε && --i > 0);
|
50
|
-
return [
|
51
|
-
sgn(x) * (Math.sqrt(D * D + 4) + D) * π / 4,
|
52
|
-
π / 2 * B
|
53
|
-
];
|
54
|
-
};
|
55
|
-
|
56
|
-
(d3.geo.vanDerGrinten4 = function() { return projection(vanDerGrinten4); }).raw = vanDerGrinten4;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
import "mollweide";
|
3
|
-
|
4
|
-
var wagner4 = (function() {
|
5
|
-
var A = 4 * π + 3 * Math.sqrt(3),
|
6
|
-
B = 2 * Math.sqrt(2 * π * Math.sqrt(3) / A);
|
7
|
-
return mollweideBromley(B * Math.sqrt(3) / π, B, A / 6);
|
8
|
-
})();
|
9
|
-
|
10
|
-
(d3.geo.wagner4 = function() { return projection(wagner4); }).raw = wagner4;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function wagner6(λ, φ) {
|
4
|
-
return [
|
5
|
-
λ * Math.sqrt(1 - 3 * φ * φ / (π * π)),
|
6
|
-
φ
|
7
|
-
];
|
8
|
-
}
|
9
|
-
|
10
|
-
wagner6.invert = function(x, y) {
|
11
|
-
return [
|
12
|
-
x / Math.sqrt(1 - 3 * y * y / (π * π)),
|
13
|
-
y
|
14
|
-
];
|
15
|
-
};
|
16
|
-
|
17
|
-
(d3.geo.wagner6 = function() { return projection(wagner6); }).raw = wagner6;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function wagner7(λ, φ) {
|
4
|
-
var s = .90631 * Math.sin(φ),
|
5
|
-
c0 = Math.sqrt(1 - s * s),
|
6
|
-
c1 = Math.sqrt(2 / (1 + c0 * Math.cos(λ /= 3)));
|
7
|
-
return [
|
8
|
-
2.66723 * c0 * c1 * Math.sin(λ),
|
9
|
-
1.24104 * s * c1
|
10
|
-
];
|
11
|
-
}
|
12
|
-
|
13
|
-
wagner7.invert = function(x, y) {
|
14
|
-
var t1 = x / 2.66723,
|
15
|
-
t2 = y / 1.24104,
|
16
|
-
p = Math.sqrt(t1 * t1 + t2 * t2),
|
17
|
-
c = 2 * asin(p / 2);
|
18
|
-
return [
|
19
|
-
3 * Math.atan2(x * Math.tan(c), 2.66723 * p),
|
20
|
-
p && asin(y * Math.sin(c) / (1.24104 * 0.90631 * p))
|
21
|
-
];
|
22
|
-
};
|
23
|
-
|
24
|
-
(d3.geo.wagner7 = function() { return projection(wagner7); }).raw = wagner7;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
|
3
|
-
function wiechel(λ, φ) {
|
4
|
-
var cosφ = Math.cos(φ),
|
5
|
-
sinφ = Math.cos(λ) * cosφ,
|
6
|
-
sin1_φ = 1 - sinφ,
|
7
|
-
cosλ = Math.cos(λ = Math.atan2(Math.sin(λ) * cosφ, -Math.sin(φ))),
|
8
|
-
sinλ = Math.sin(λ);
|
9
|
-
cosφ = asqrt(1 - sinφ * sinφ);
|
10
|
-
return [
|
11
|
-
sinλ * cosφ - cosλ * sin1_φ,
|
12
|
-
-cosλ * cosφ - sinλ * sin1_φ
|
13
|
-
];
|
14
|
-
}
|
15
|
-
|
16
|
-
wiechel.invert = function(x, y) {
|
17
|
-
var w = -.5 * (x * x + y * y),
|
18
|
-
k = Math.sqrt(-w * (2 + w)),
|
19
|
-
b = y * w + x * k,
|
20
|
-
a = x * w - y * k,
|
21
|
-
D = Math.sqrt(a * a + b * b);
|
22
|
-
return [
|
23
|
-
Math.atan2(k * b, D * (1 + w)),
|
24
|
-
D ? -asin(k * a / D) : 0
|
25
|
-
];
|
26
|
-
};
|
27
|
-
|
28
|
-
(d3.geo.wiechel = function() { return projection(wiechel); }).raw = wiechel;
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import "projection";
|
2
|
-
import "aitoff";
|
3
|
-
|
4
|
-
function winkel3(λ, φ) {
|
5
|
-
var coordinates = aitoff(λ, φ);
|
6
|
-
return [
|
7
|
-
(coordinates[0] + λ * 2 / π) / 2,
|
8
|
-
(coordinates[1] + φ) / 2
|
9
|
-
];
|
10
|
-
}
|
11
|
-
|
12
|
-
winkel3.invert = function(x, y) {
|
13
|
-
var λ = x, φ = y, i = 25;
|
14
|
-
do {
|
15
|
-
var cosφ = Math.cos(φ),
|
16
|
-
sinφ = Math.sin(φ),
|
17
|
-
sin_2φ = Math.sin(2 * φ),
|
18
|
-
sin2φ = sinφ * sinφ,
|
19
|
-
cos2φ = cosφ * cosφ,
|
20
|
-
sinλ = Math.sin(λ),
|
21
|
-
cosλ_2 = Math.cos(λ / 2),
|
22
|
-
sinλ_2 = Math.sin(λ / 2),
|
23
|
-
sin2λ_2 = sinλ_2 * sinλ_2,
|
24
|
-
C = 1 - cos2φ * cosλ_2 * cosλ_2,
|
25
|
-
E = C ? acos(cosφ * cosλ_2) * Math.sqrt(F = 1 / C) : F = 0,
|
26
|
-
F,
|
27
|
-
fx = .5 * (2 * E * cosφ * sinλ_2 + λ * 2 / π) - x,
|
28
|
-
fy = .5 * (E * sinφ + φ) - y,
|
29
|
-
δxδλ = .5 * F * (cos2φ * sin2λ_2 + E * cosφ * cosλ_2 * sin2φ) + .5 * 2 / π,
|
30
|
-
δxδφ = F * (sinλ * sin_2φ / 4 - E * sinφ * sinλ_2),
|
31
|
-
δyδλ = .125 * F * (sin_2φ * sinλ_2 - E * sinφ * cos2φ * sinλ),
|
32
|
-
δyδφ = .5 * F * (sin2φ * cosλ_2 + E * sin2λ_2 * cosφ) + .5,
|
33
|
-
denominator = δxδφ * δyδλ - δyδφ * δxδλ,
|
34
|
-
δλ = (fy * δxδφ - fx * δyδφ) / denominator,
|
35
|
-
δφ = (fx * δyδλ - fy * δxδλ) / denominator;
|
36
|
-
λ -= δλ, φ -= δφ;
|
37
|
-
} while ((Math.abs(δλ) > ε || Math.abs(δφ) > ε) && --i > 0);
|
38
|
-
return [λ, φ];
|
39
|
-
};
|
40
|
-
|
41
|
-
(d3.geo.winkel3 = function() { return projection(winkel3); }).raw = winkel3;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "d3-plugins",
|
3
|
-
"version": "0.0.1",
|
4
|
-
"description": "Plugins for D3.js.",
|
5
|
-
"keywords": ["visualization"],
|
6
|
-
"homepage": "http://github.com/d3/d3-plugins",
|
7
|
-
"repository": {
|
8
|
-
"type": "git",
|
9
|
-
"url": "http://github.com/d3/d3-plugins.git"
|
10
|
-
},
|
11
|
-
"dependencies": {
|
12
|
-
"d3": "3.0.x"
|
13
|
-
},
|
14
|
-
"devDependencies": {
|
15
|
-
"smash": "~0.0.8",
|
16
|
-
"uglify-js": "git://github.com/mishoo/UglifyJS2.git#3bd7ca9961125b39dcd54d2182cb72bd1ca6006e",
|
17
|
-
"vows": "0.7.x"
|
18
|
-
},
|
19
|
-
"scripts": {
|
20
|
-
"test": "node_modules/.bin/vows `find . -name \"*-test.js\" \\! -path \"./node_modules/*\"`"
|
21
|
-
}
|
22
|
-
}
|