d3js-plugins-rails 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/d3js-plugins-rails/version.rb +2 -1
- data/vendor/assets/javascripts/d3/plugins/Makefile +8 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/README.md +8 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/august.js +19 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/berghaus.js +14 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/bonne.js +1 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/conic-conformal.js +11 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/conic-equidistant.js +3 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/craig.js +13 -7
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eisenlohr.js +70 -9
- data/vendor/assets/javascripts/d3/plugins/geo/projection/elliptic.js +115 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/fahey.js +19 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/guyou.js +50 -36
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer-retroazimuthal.js +40 -11
- data/vendor/assets/javascripts/d3/plugins/geo/projection/lagrange.js +19 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/laskowski.js +3 -3
- data/vendor/assets/javascripts/d3/plugins/geo/projection/modified-stereographic.js +104 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/peirce-quincuncial.js +41 -5
- data/vendor/assets/javascripts/d3/plugins/geo/projection/polyconic.js +10 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/projection.js +21 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/rectangular-polyconic.js +40 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/august-test.js +27 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/berghaus-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craig-test.js +26 -11
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/eisenlohr-test.js +34 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/env.js +5 -4
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/fahey-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/guyou-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-retroazimuthal-test.js +39 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/lagrange-test.js +59 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/loximuthal-test.js +1 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/modified-stereographic-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/peirce-quincuncial-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/polyconic-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/rectangular-polyconic-test.js +48 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/times-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-azimuthal-test.js +22 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-equidistant-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten2-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten3-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten4-test.js +28 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wiechel-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/times.js +19 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-azimuthal.js +46 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-equidistant.js +23 -5
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten2.js +28 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten3.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten4.js +37 -5
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wiechel.js +12 -0
- data/vendor/assets/javascripts/d3/plugins/graph/README.md +6 -7
- data/vendor/assets/javascripts/d3/plugins/graph/graph.js +0 -33
- data/vendor/assets/javascripts/d3/plugins/graph/index.html +0 -1
- data/vendor/assets/javascripts/d3/plugins/keybinding/keybinding.js +189 -112
- data/vendor/assets/javascripts/d3/plugins/longscroll/longscroll.js +3 -2
- metadata +29 -3
@@ -0,0 +1,34 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.eisenlohr");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"eisenlohr": {
|
10
|
+
topic: d3.geo.eisenlohr,
|
11
|
+
"projections and inverse projections": function(eisenlohr) {
|
12
|
+
assert.equalInverse(eisenlohr, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(eisenlohr, [ 0, -45], [480, 377.392745]);
|
14
|
+
assert.equalInverse(eisenlohr, [ 0, 45], [480, 122.607254]);
|
15
|
+
assert.equalInverse(eisenlohr, [ 0, 90], [480, -125.237349]);
|
16
|
+
assert.equalInverse(eisenlohr, [ 0, 80], [480, -35.291289]);
|
17
|
+
assert.equalInverse(eisenlohr, [-90, 0], [211.729605, 250]);
|
18
|
+
assert.equalInverse(eisenlohr, [ 90, 0], [748.270394, 250]);
|
19
|
+
assert.equalInverse(eisenlohr, [-80, 15], [251.382362, 196.991404]);
|
20
|
+
assert.equalInverse(eisenlohr, [ 1, 1], [482.617916, 247.381795]);
|
21
|
+
assert.equalInverse(eisenlohr, [ 15, 80], [497.624439, -36.694591]);
|
22
|
+
assert.equalInverse(eisenlohr, [100, 50], [728.016830, 33.813625]);
|
23
|
+
assert.equalInverse(eisenlohr, [179, 80], [562.029382, -249.246945]);
|
24
|
+
assert.equalInverse(eisenlohr, [179, 89], [482.929745, -140.157928]);
|
25
|
+
assert.equalInverse(eisenlohr, [180, 0], [1411.685689, 250]);
|
26
|
+
assert.equalInverse(eisenlohr, [180, 60], [842.900816, -348.742594]);
|
27
|
+
assert.equalInverse(eisenlohr, [180, 80], [560.323951, -251.261143]);
|
28
|
+
assert.equalInverse(eisenlohr, [180, 89], [482.673656, -140.229826]);
|
29
|
+
assert.inDelta(eisenlohr.invert([480 + 6 * 3, 250 - 126 * 3]), [108.053239, 88.652617], 1e-6);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
suite.export(module);
|
@@ -9,11 +9,12 @@ assert.inDelta = function(actual, expected, delta, message) {
|
|
9
9
|
}
|
10
10
|
};
|
11
11
|
|
12
|
-
assert.equalInverse = function(projection, location, point) {
|
12
|
+
assert.equalInverse = function(projection, location, point, delta) {
|
13
|
+
delta = delta || 1e-6;
|
13
14
|
var projected;
|
14
|
-
assert.inDelta(projected = projection(location), point,
|
15
|
-
assert.inDelta(projection.invert(projected), location,
|
16
|
-
assert.inDelta(projection(projection.invert(point)), point,
|
15
|
+
assert.inDelta(projected = projection(location), point, delta);
|
16
|
+
assert.inDelta(projection.invert(projected), location, delta);
|
17
|
+
assert.inDelta(projection(projection.invert(point)), point, delta);
|
17
18
|
};
|
18
19
|
|
19
20
|
function inDelta(actual, expected, delta) {
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.fahey");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"fahey": {
|
10
|
+
topic: d3.geo.fahey,
|
11
|
+
"projections and inverse projections": function(fahey) {
|
12
|
+
assert.equalInverse(fahey, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(fahey, [ 0, -90], [480, 522.872806]);
|
14
|
+
assert.equalInverse(fahey, [ 0, 90], [480, -22.872806]);
|
15
|
+
assert.equalInverse(fahey, [ 0, -45], [480, 363.027617]);
|
16
|
+
assert.equalInverse(fahey, [ 0, 45], [480, 136.972382]);
|
17
|
+
assert.equalInverse(fahey, [-180, 0], [ 93.983693, 250]);
|
18
|
+
assert.equalInverse(fahey, [ 180, 0], [866.016306, 250]);
|
19
|
+
assert.equalInverse(fahey, [-179, 15], [ 99.469475, 214.075613]);
|
20
|
+
assert.equalInverse(fahey, [ 1, 1], [482.144453, 247.618675]);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
});
|
24
|
+
|
25
|
+
suite.export(module);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.guyou");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"guyou": {
|
10
|
+
topic: d3.geo.guyou,
|
11
|
+
"projections and inverse projections": function(guyou) {
|
12
|
+
assert.equalInverse(guyou, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(guyou, [ 0, -45], [480, 487.382], 1e-3);
|
14
|
+
assert.equalInverse(guyou, [ 0, 45], [480, 12.6172], 1e-4);
|
15
|
+
assert.equalInverse(guyou, [-90, 0], [242.617240, 250]);
|
16
|
+
assert.equalInverse(guyou, [ 90, 0], [717.382759, 250]);
|
17
|
+
assert.equalInverse(guyou, [ 45, 0], [611.625205, 250]);
|
18
|
+
assert.equalInverse(guyou, [-80, 15], [264.628233, 216.032299]);
|
19
|
+
assert.equalInverse(guyou, [ 1, 1], [483.160518, 246.839962]);
|
20
|
+
assert.equalInverse(guyou, [ 15, 45], [561.412842, 86.826667]);
|
21
|
+
assert.equalInverse(guyou, [180, -60], [823.140312, 487.382759], 1e-4);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
suite.export(module);
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.hammerRetroazimuthal");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"hammerRetroazimuthal": {
|
10
|
+
"0° parallel": {
|
11
|
+
topic: d3.geo.hammerRetroazimuthal,
|
12
|
+
"projections and inverse projections": function(hammerRetroazimuthal) {
|
13
|
+
assert.equalInverse(hammerRetroazimuthal, [ 0, 0], [480, 250]);
|
14
|
+
assert.equalInverse(hammerRetroazimuthal, [ 0, -45], [480, 367.809724]);
|
15
|
+
assert.equalInverse(hammerRetroazimuthal, [ 0, 45], [480, 132.190275]);
|
16
|
+
assert.equalInverse(hammerRetroazimuthal, [-80, 15], [269.878429, 240.410727]);
|
17
|
+
assert.equalInverse(hammerRetroazimuthal, [ 1, 1], [482.618126, 247.382271]);
|
18
|
+
assert.equalInverse(hammerRetroazimuthal, [ 15, 45], [523.527397, 135.133006]);
|
19
|
+
assert.equalInverse(hammerRetroazimuthal, [120, 30], [770.915361, 166.019968]);
|
20
|
+
}
|
21
|
+
},
|
22
|
+
"30° parallel": {
|
23
|
+
topic: function() {
|
24
|
+
return d3.geo.hammerRetroazimuthal().parallel(30);
|
25
|
+
},
|
26
|
+
"projections and inverse projections": function(hammerRetroazimuthal) {
|
27
|
+
assert.equalInverse(hammerRetroazimuthal, [ 0, 0], [480, 328.539816]);
|
28
|
+
assert.equalInverse(hammerRetroazimuthal, [ 0, -45], [480, 446.349540]);
|
29
|
+
assert.equalInverse(hammerRetroazimuthal, [ 0, 45], [480, 210.730091]);
|
30
|
+
assert.equalInverse(hammerRetroazimuthal, [-80, 15], [308.029420, 339.535421]);
|
31
|
+
assert.equalInverse(hammerRetroazimuthal, [ 1, 1], [482.367018, 325.925728]);
|
32
|
+
assert.equalInverse(hammerRetroazimuthal, [ 15, 45], [514.251164, 213.638684]);
|
33
|
+
assert.equalInverse(hammerRetroazimuthal, [120, 30], [672.322402, 83.443914]);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
});
|
38
|
+
|
39
|
+
suite.export(module);
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.lagrange");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"lagrange": {
|
10
|
+
"spacing(.5)": {
|
11
|
+
topic: d3.geo.lagrange,
|
12
|
+
"projections and inverse projections": function(lagrange) {
|
13
|
+
assert.equalInverse(lagrange, [ 0, 0], [480, 250]);
|
14
|
+
assert.equalInverse(lagrange, [ 0, -45], [480, 315.053600]);
|
15
|
+
assert.equalInverse(lagrange, [ 0, 45], [480, 184.946399]);
|
16
|
+
assert.equalInverse(lagrange, [ 0, 90], [480, -50]);
|
17
|
+
assert.equalInverse(lagrange, [ 0, 80], [480, 86.960158]);
|
18
|
+
assert.equalInverse(lagrange, [-90, 0], [355.735931, 250]);
|
19
|
+
assert.equalInverse(lagrange, [ 90, 0], [604.264068, 250]);
|
20
|
+
assert.equalInverse(lagrange, [-80, 15], [371.349124, 227.551283]);
|
21
|
+
assert.equalInverse(lagrange, [ 1, 1], [481.308980, 248.690919]);
|
22
|
+
assert.equalInverse(lagrange, [ 15, 45], [498.734660, 184.680127]);
|
23
|
+
assert.equalInverse(lagrange, [ 15, 80], [493.837895, 86.467244]);
|
24
|
+
assert.equalInverse(lagrange, [ 15, 89], [486.127550, 0.928863]);
|
25
|
+
assert.equalInverse(lagrange, [ 45, 89], [498.157041, -1.732667]);
|
26
|
+
assert.equalInverse(lagrange, [150, 89], [531.217097, -31.323054]);
|
27
|
+
assert.equalInverse(lagrange, [-150, 89], [428.782902, -31.323054]);
|
28
|
+
assert.equalInverse(lagrange, [-179, 89], [424.526070, -44.333441]);
|
29
|
+
assert.equalInverse(lagrange, [0, 89.9], [480, -32.784034]);
|
30
|
+
}
|
31
|
+
},
|
32
|
+
"spacing(.25)": {
|
33
|
+
topic: function() {
|
34
|
+
return d3.geo.lagrange().spacing(.25);
|
35
|
+
},
|
36
|
+
"projections and inverse projections": function(lagrange) {
|
37
|
+
assert.equalInverse(lagrange, [ 0, 0], [480, 250]);
|
38
|
+
assert.equalInverse(lagrange, [ 0, -45], [480, 282.918431]);
|
39
|
+
assert.equalInverse(lagrange, [ 0, 45], [480, 217.081568]);
|
40
|
+
assert.equalInverse(lagrange, [ 0, 90], [480, -50]);
|
41
|
+
assert.equalInverse(lagrange, [ 0, 80], [480, 161.363985]);
|
42
|
+
assert.equalInverse(lagrange, [-90, 0], [420.326289, 250]);
|
43
|
+
assert.equalInverse(lagrange, [ 90, 0], [539.673710, 250]);
|
44
|
+
assert.equalInverse(lagrange, [-80, 15], [427.161636, 239.763718]);
|
45
|
+
assert.equalInverse(lagrange, [ 1, 1], [480.654496, 249.345466]);
|
46
|
+
assert.equalInverse(lagrange, [ 15, 45], [489.702610, 217.046715]);
|
47
|
+
assert.equalInverse(lagrange, [ 15, 80], [488.962844, 161.277295]);
|
48
|
+
assert.equalInverse(lagrange, [ 15, 89], [487.041237, 90.333761]);
|
49
|
+
assert.equalInverse(lagrange, [ 45, 89], [501.132716, 89.349438]);
|
50
|
+
assert.equalInverse(lagrange, [150, 89], [550.729469, 77.687845]);
|
51
|
+
assert.equalInverse(lagrange, [-150, 89], [409.270530, 77.687845]);
|
52
|
+
assert.equalInverse(lagrange, [-179, 89], [395.481107, 71.952986]);
|
53
|
+
assert.equalInverse(lagrange, [0, 89.9], [480, 37.999854]);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
});
|
58
|
+
|
59
|
+
suite.export(module);
|
@@ -16,7 +16,7 @@ suite.addBatch({
|
|
16
16
|
assert.equalInverse(loximuthal, [ 0, 45], [480, 132.190275]);
|
17
17
|
assert.equalInverse(loximuthal, [-180, 0], [ 48.773559, 250]);
|
18
18
|
assert.equalInverse(loximuthal, [ 180, 0], [911.226440, 250]);
|
19
|
-
assert.equalInverse(loximuthal, [-179, 15], [69.
|
19
|
+
assert.equalInverse(loximuthal, [-179, 15], [ 69.464314, 210.730091]);
|
20
20
|
assert.equalInverse(loximuthal, [ 1, 1], [482.390500, 247.382006]);
|
21
21
|
}
|
22
22
|
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.modifiedStereographic");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"modifiedStereographic": {
|
10
|
+
topic: d3.geo.modifiedStereographic,
|
11
|
+
"projections and inverse projections": function(modifiedStereographic) {
|
12
|
+
assert.equalInverse(modifiedStereographic, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(modifiedStereographic, [ 0, -45], [480, 363.225114]);
|
14
|
+
assert.equalInverse(modifiedStereographic, [ 0, 45], [480, 136.774885]);
|
15
|
+
assert.equalInverse(modifiedStereographic, [-90, 0], [179.334000, 250]);
|
16
|
+
assert.equalInverse(modifiedStereographic, [ 90, 0], [780.666000, 250]);
|
17
|
+
assert.equalInverse(modifiedStereographic, [-80, 15], [244.261692, 178.493228]);
|
18
|
+
assert.equalInverse(modifiedStereographic, [ 1, 1], [482.420181, 247.579387]);
|
19
|
+
assert.equalInverse(modifiedStereographic, [ 15, 45], [508.846677, 134.854913]);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
suite.export(module);
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.peirceQuincuncial");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"peirceQuincuncial": {
|
10
|
+
topic: d3.geo.peirceQuincuncial,
|
11
|
+
"projections and inverse projections": function(peirceQuincuncial) {
|
12
|
+
assert.inDelta(peirceQuincuncial([0, 90]), [480, 250], 1e-6);
|
13
|
+
assert.equalInverse(peirceQuincuncial, [ 0, 0], [480, 585.709], 1e-2);
|
14
|
+
assert.equalInverse(peirceQuincuncial, [-90, 0], [144.290082, 250], 1e-5);
|
15
|
+
assert.equalInverse(peirceQuincuncial, [ 90, 0], [815.709915, 250], 1e-1);
|
16
|
+
assert.equalInverse(peirceQuincuncial, [ 45, 0], [647.854958, 417.854958]);
|
17
|
+
assert.equalInverse(peirceQuincuncial, [-80, 15], [282.302142, 290.470613]);
|
18
|
+
assert.equalInverse(peirceQuincuncial, [ 1, 1], [495.393500, 548.541114]);
|
19
|
+
assert.equalInverse(peirceQuincuncial, [ 15, 45], [507.756185, 352.529945]);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
suite.export(module);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.polyconic");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"polyconic": {
|
10
|
+
topic: d3.geo.polyconic,
|
11
|
+
"projections and inverse projections": function(polyconic) {
|
12
|
+
assert.equalInverse(polyconic, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(polyconic, [ 0, -45], [480, 367.809724]);
|
14
|
+
assert.equalInverse(polyconic, [ 0, 45], [480, 132.190275]);
|
15
|
+
assert.equalInverse(polyconic, [-90, 0], [244.380550, 250]);
|
16
|
+
assert.equalInverse(polyconic, [ 90, 0], [715.619449, 250]);
|
17
|
+
assert.equalInverse(polyconic, [-80, 15], [282.071605, 174.572089]);
|
18
|
+
assert.equalInverse(polyconic, [120, 15], [768.810227, 130.477707]);
|
19
|
+
assert.equalInverse(polyconic, [ 1, 1], [482.617595, 247.381607]);
|
20
|
+
assert.equalInverse(polyconic, [ 15, 45], [507.609690, 129.627397]);
|
21
|
+
assert.equalInverse(polyconic,[-179, 45], [359.533865,-107.184834]);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
suite.export(module);
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.rectangularPolyconic");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"rectangularPolyconic": {
|
10
|
+
"0° parallel": {
|
11
|
+
topic: d3.geo.rectangularPolyconic,
|
12
|
+
"projections and inverse projections": function(rectangularPolyconic) {
|
13
|
+
assert.equalInverse(rectangularPolyconic, [ 0, 0], [480, 250]);
|
14
|
+
assert.equalInverse(rectangularPolyconic, [ 0, -45], [480, 367.809724]);
|
15
|
+
assert.equalInverse(rectangularPolyconic, [ 0, 45], [480, 132.190275]);
|
16
|
+
assert.equalInverse(rectangularPolyconic, [-90, 0], [244.380550, 250]);
|
17
|
+
assert.equalInverse(rectangularPolyconic, [ 90, 0], [715.619449, 250]);
|
18
|
+
assert.equalInverse(rectangularPolyconic, [-80, 15], [284.093092, 175.331715]);
|
19
|
+
assert.equalInverse(rectangularPolyconic, [ 1, 1], [482.617595, 247.381607]);
|
20
|
+
assert.equalInverse(rectangularPolyconic, [ 15, 45], [507.532140, 129.641898]);
|
21
|
+
assert.equalInverse(rectangularPolyconic, [120, 45], [623.475113, 25.949753]);
|
22
|
+
assert.equalInverse(rectangularPolyconic, [150, 5], [866.178341, 192.852256]);
|
23
|
+
assert.equalInverse(rectangularPolyconic, [179, 5], [938.342281, 174.509780]);
|
24
|
+
assert.equalInverse(rectangularPolyconic, [179, 85], [491.937069, 8.894941]);
|
25
|
+
}
|
26
|
+
},
|
27
|
+
"30° parallel": {
|
28
|
+
topic: function() {
|
29
|
+
return d3.geo.rectangularPolyconic().parallel(30);
|
30
|
+
},
|
31
|
+
"projections and inverse projections": function(rectangularPolyconic) {
|
32
|
+
assert.equalInverse(rectangularPolyconic, [ 0, 0], [480, 250]);
|
33
|
+
assert.equalInverse(rectangularPolyconic, [ 0, -45], [480, 367.809724]);
|
34
|
+
assert.equalInverse(rectangularPolyconic, [ 0, 45], [480, 132.190275]);
|
35
|
+
assert.equalInverse(rectangularPolyconic, [-90, 0], [231.471862, 250]);
|
36
|
+
assert.equalInverse(rectangularPolyconic, [ 90, 0], [728.528137, 250]);
|
37
|
+
assert.equalInverse(rectangularPolyconic, [-80, 15], [276.290019, 172.350142]);
|
38
|
+
assert.equalInverse(rectangularPolyconic, [ 1, 1], [482.617611, 247.381607]);
|
39
|
+
assert.equalInverse(rectangularPolyconic, [ 15, 45], [507.570850, 129.634665]);
|
40
|
+
assert.equalInverse(rectangularPolyconic, [120, 45], [626.969384, 12.190275]);
|
41
|
+
assert.equalInverse(rectangularPolyconic, [150, 5], [930.583263, 176.642758]);
|
42
|
+
assert.equalInverse(rectangularPolyconic, [179, 5],[1055.344304, 137.492301]);
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
suite.export(module);
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.times");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"times": {
|
10
|
+
topic: d3.geo.times,
|
11
|
+
"projections and inverse projections": function(times) {
|
12
|
+
assert.equalInverse(times, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(times, [ 0, -45], [480, 356.066217]);
|
14
|
+
assert.equalInverse(times, [ 0, 45], [480, 143.933782]);
|
15
|
+
assert.equalInverse(times, [-90, 0], [304.505921, 250]);
|
16
|
+
assert.equalInverse(times, [ 90, 0], [655.494078, 250]);
|
17
|
+
assert.equalInverse(times, [-80, 15], [324.777008, 216.288205]);
|
18
|
+
assert.equalInverse(times, [ 1, 1], [481.949891, 247.765341]);
|
19
|
+
assert.equalInverse(times, [ 15, 45], [507.861496, 143.933782]);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
suite.export(module);
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.twoPointAzimuthal");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"twoPointAzimuthal": {
|
10
|
+
topic: d3.geo.twoPointAzimuthal,
|
11
|
+
"projections and inverse projections": function(twoPointAzimuthal) {
|
12
|
+
assert.equalInverse(twoPointAzimuthal, [ 0, 0], [ 480, 250]);
|
13
|
+
assert.equalInverse(twoPointAzimuthal, [ 0, -45], [ 480, 400]);
|
14
|
+
assert.equalInverse(twoPointAzimuthal, [ 0, 45], [ 480, 100]);
|
15
|
+
assert.equalInverse(twoPointAzimuthal, [-80, 15], [-370.692272, 18.541314]);
|
16
|
+
assert.equalInverse(twoPointAzimuthal, [ 1, 1], [ 482.618259, 247.381341]);
|
17
|
+
assert.equalInverse(twoPointAzimuthal, [ 15, 45], [ 520.192378, 94.708572]);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
});
|
21
|
+
|
22
|
+
suite.export(module);
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.twoPointEquidistant");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"twoPointEquidistant": {
|
10
|
+
topic: function() {
|
11
|
+
return d3.geo.twoPointEquidistant().points([[-158, 21.5], [-77, 39]]);
|
12
|
+
},
|
13
|
+
"projections and inverse projections": function(twoPointEquidistant) {
|
14
|
+
assert.equalInverse(twoPointEquidistant, [ 0, 0], [779.584187, 227.923736]);
|
15
|
+
assert.equalInverse(twoPointEquidistant, [ 0, -45], [681.938143, 512.400576]);
|
16
|
+
assert.equalInverse(twoPointEquidistant, [ 0, 45], [651.469553, 129.175958]);
|
17
|
+
assert.equalInverse(twoPointEquidistant, [-80, 15], [570.636740, 313.204406]);
|
18
|
+
assert.equalInverse(twoPointEquidistant, [ 1, 1], [778.820119, 219.170442]);
|
19
|
+
assert.equalInverse(twoPointEquidistant, [ 15, 45], [641.328901, 95.403073]);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
suite.export(module);
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require("./env");
|
2
|
+
|
3
|
+
var vows = require("vows"),
|
4
|
+
assert = require("assert");
|
5
|
+
|
6
|
+
var suite = vows.describe("d3.geo.vanDerGrinten2");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"vanDerGrinten2": {
|
10
|
+
topic: d3.geo.vanDerGrinten2,
|
11
|
+
"projections and inverse projections": function(vanDerGrinten2) {
|
12
|
+
assert.equalInverse(vanDerGrinten2, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(vanDerGrinten2, [ 0, -45], [480, 376.268082]);
|
14
|
+
assert.equalInverse(vanDerGrinten2, [ 0, 45], [480, 123.731917]);
|
15
|
+
assert.equalInverse(vanDerGrinten2, [-90, 0], [244.380550, 250]);
|
16
|
+
assert.equalInverse(vanDerGrinten2, [ 90, 0], [715.619449, 250]);
|
17
|
+
assert.equalInverse(vanDerGrinten2, [-80, 15], [272.324393, 202.707670]);
|
18
|
+
assert.equalInverse(vanDerGrinten2, [ 1, 1], [482.617913, 247.381844]);
|
19
|
+
assert.equalInverse(vanDerGrinten2, [ 15, 45], [516.432290, 122.918417]);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
suite.export(module);
|