d3js-plugins-rails 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Gemfile +3 -1
- data/README.md +11 -0
- data/certs/bai.pem +20 -0
- data/d3js-plugins-rails.gemspec +4 -0
- data/lib/d3js-plugins-rails/version.rb +2 -2
- data/vendor/assets/javascripts/d3/plugins/Makefile +10 -87
- data/vendor/assets/javascripts/d3/plugins/geo/projection/README.md +1 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/aitoff.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/armadillo.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/august.js +3 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/baker.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/berghaus.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/boggs.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/bonne.js +3 -2
- data/vendor/assets/javascripts/d3/plugins/geo/projection/bromley.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/collignon.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/conic-conformal.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/conic-equal-area.js +29 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/conic-equidistant.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/craig.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/craster.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/cylindrical-equal-area.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert1.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert3.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert4.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert5.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eisenlohr.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/elliptic.js +3 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/fahey.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/gringorten.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/guyou.js +3 -2
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer-retroazimuthal.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hatano.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/healpix.js +4 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hill.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/homolosine.js +4 -3
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hyperbolic.js +22 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/index.js +68 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/interrupt.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/kavrayskiy7.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/lagrange.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/larrivee.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/laskowski.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/littrow.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/loximuthal.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/math.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/miller.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/modified-stereographic.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mollweide.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-parabolic.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-quartic.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-sinusoidal.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/natural-earth.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/nell-hammer.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel1.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel2.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/peirce-quincuncial.js +3 -2
- data/vendor/assets/javascripts/d3/plugins/geo/projection/polyconic.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/projection.js +1 -47
- data/vendor/assets/javascripts/d3/plugins/geo/projection/quincuncial.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/rectangular-polyconic.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/robinson.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/satellite.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/sinu-mollweide.js +3 -2
- data/vendor/assets/javascripts/d3/plugins/geo/projection/sinusoidal.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/aitoff-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js +19 -17
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/{env.js → assert.js} +2 -3
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/august-test.js +18 -16
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/baker-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/berghaus-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/boggs-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/bonne-test.js +9 -9
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craig-test.js +6 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craster-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/eisenlohr-test.js +25 -23
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/equirectangular-test.js +2 -3
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/fahey-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/gringorten-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/guyou-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-retroazimuthal-test.js +6 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-test.js +5 -5
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hatano-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/healpix-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hill-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/lagrange-test.js +6 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/larrivee-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/laskowski-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/littrow-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/load.js +20 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/loximuthal-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/modified-stereographic-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mollweide-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-parabolic-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-quartic-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-sinusoidal-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/natural-earth-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/peirce-quincuncial-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/polyconic-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/rectangular-polyconic-test.js +6 -6
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/robinson-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/times-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/transverse-mercator-test.js +29 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-azimuthal-test.js +13 -11
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-equidistant-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten2-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten3-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten4-test.js +21 -19
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wagner6-test.js +16 -14
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wiechel-test.js +15 -13
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/winkel3-test.js +17 -15
- data/vendor/assets/javascripts/d3/plugins/geo/projection/times.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/transverse-mercator.js +19 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-azimuthal.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-equidistant.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten2.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten3.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten4.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner4.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner6.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner7.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wiechel.js +2 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/winkel3.js +2 -1
- data/vendor/assets/javascripts/d3/plugins/hexbin/hexbin.js +9 -4
- data/vendor/assets/javascripts/d3/plugins/package.json +4 -2
- data/vendor/assets/javascripts/d3/plugins/simplify/simplify-test.js +1 -1
- data/vendor/assets/javascripts/d3/plugins/urlencode/urlencode-test.js +1 -1
- metadata +42 -16
- metadata.gz.sig +0 -0
@@ -1,20 +1,22 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.twoPointAzimuthal");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"twoPointAzimuthal": {
|
10
|
-
topic:
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
topic: load("two-point-azimuthal"),
|
10
|
+
"default": {
|
11
|
+
topic: function(geo) { return geo.twoPointAzimuthal(); },
|
12
|
+
"projections and inverse projections": function(twoPointAzimuthal) {
|
13
|
+
assert.equalInverse(twoPointAzimuthal, [ 0, 0], [ 480, 250]);
|
14
|
+
assert.equalInverse(twoPointAzimuthal, [ 0, -45], [ 480, 400]);
|
15
|
+
assert.equalInverse(twoPointAzimuthal, [ 0, 45], [ 480, 100]);
|
16
|
+
assert.equalInverse(twoPointAzimuthal, [-80, 15], [-370.692272, 18.541314]);
|
17
|
+
assert.equalInverse(twoPointAzimuthal, [ 1, 1], [ 482.618259, 247.381341]);
|
18
|
+
assert.equalInverse(twoPointAzimuthal, [ 15, 45], [ 520.192378, 94.708572]);
|
19
|
+
}
|
18
20
|
}
|
19
21
|
}
|
20
22
|
});
|
@@ -1,22 +1,24 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.twoPointEquidistant");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"twoPointEquidistant": {
|
10
|
-
topic:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
topic: load("two-point-equidistant"),
|
10
|
+
"default": {
|
11
|
+
topic: function(geo) {
|
12
|
+
return geo.twoPointEquidistant().points([[-158, 21.5], [-77, 39]]);
|
13
|
+
},
|
14
|
+
"projections and inverse projections": function(twoPointEquidistant) {
|
15
|
+
assert.equalInverse(twoPointEquidistant, [ 0, 0], [779.584187, 227.923736]);
|
16
|
+
assert.equalInverse(twoPointEquidistant, [ 0, -45], [681.938143, 512.400576]);
|
17
|
+
assert.equalInverse(twoPointEquidistant, [ 0, 45], [651.469553, 129.175958]);
|
18
|
+
assert.equalInverse(twoPointEquidistant, [-80, 15], [570.636740, 313.204406]);
|
19
|
+
assert.equalInverse(twoPointEquidistant, [ 1, 1], [778.820119, 219.170442]);
|
20
|
+
assert.equalInverse(twoPointEquidistant, [ 15, 45], [641.328901, 95.403073]);
|
21
|
+
}
|
20
22
|
}
|
21
23
|
}
|
22
24
|
});
|
@@ -1,22 +1,24 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.vanDerGrinten2");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"vanDerGrinten2": {
|
10
|
-
topic:
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
topic: load("van-der-grinten2"),
|
10
|
+
"default": {
|
11
|
+
topic: function(geo) { return geo.vanDerGrinten2(); },
|
12
|
+
"projections and inverse projections": function(vanDerGrinten2) {
|
13
|
+
assert.equalInverse(vanDerGrinten2, [ 0, 0], [480, 250]);
|
14
|
+
assert.equalInverse(vanDerGrinten2, [ 0, -45], [480, 376.268082]);
|
15
|
+
assert.equalInverse(vanDerGrinten2, [ 0, 45], [480, 123.731917]);
|
16
|
+
assert.equalInverse(vanDerGrinten2, [-90, 0], [244.380550, 250]);
|
17
|
+
assert.equalInverse(vanDerGrinten2, [ 90, 0], [715.619449, 250]);
|
18
|
+
assert.equalInverse(vanDerGrinten2, [-80, 15], [272.324393, 202.707670]);
|
19
|
+
assert.equalInverse(vanDerGrinten2, [ 1, 1], [482.617913, 247.381844]);
|
20
|
+
assert.equalInverse(vanDerGrinten2, [ 15, 45], [516.432290, 122.918417]);
|
21
|
+
}
|
20
22
|
}
|
21
23
|
}
|
22
24
|
});
|
@@ -1,22 +1,24 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.vanDerGrinten3");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"vanDerGrinten3": {
|
10
|
-
topic:
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
topic: load("van-der-grinten3"),
|
10
|
+
"default": {
|
11
|
+
topic: function(geo) { return geo.vanDerGrinten3(); },
|
12
|
+
"projections and inverse projections": function(vanDerGrinten3) {
|
13
|
+
assert.equalInverse(vanDerGrinten3, [ 0, 0], [480, 250]);
|
14
|
+
assert.equalInverse(vanDerGrinten3, [ 0, -45], [480, 376.268082]);
|
15
|
+
assert.equalInverse(vanDerGrinten3, [ 0, 45], [480, 123.731917]);
|
16
|
+
assert.equalInverse(vanDerGrinten3, [-90, 0], [244.380550, 250]);
|
17
|
+
assert.equalInverse(vanDerGrinten3, [ 90, 0], [715.619449, 250]);
|
18
|
+
assert.equalInverse(vanDerGrinten3, [-80, 15], [271.793387, 210.453529]);
|
19
|
+
assert.equalInverse(vanDerGrinten3, [ 1, 1], [482.617913, 247.381925]);
|
20
|
+
assert.equalInverse(vanDerGrinten3, [ 15, 45], [516.468521, 123.731917]);
|
21
|
+
}
|
20
22
|
}
|
21
23
|
}
|
22
24
|
});
|
@@ -1,28 +1,30 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.vanDerGrinten4");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"vanDerGrinten4": {
|
10
|
-
topic:
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
+
}
|
26
28
|
}
|
27
29
|
}
|
28
30
|
});
|
@@ -1,23 +1,25 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.wagner6");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"wagner6": {
|
10
|
-
topic:
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
+
}
|
21
23
|
}
|
22
24
|
}
|
23
25
|
});
|
@@ -1,22 +1,24 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.wiechel");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"wiechel": {
|
10
|
-
topic:
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
+
}
|
20
22
|
}
|
21
23
|
}
|
22
24
|
});
|
@@ -1,24 +1,26 @@
|
|
1
|
-
require("./env");
|
2
|
-
|
3
1
|
var vows = require("vows"),
|
4
|
-
assert = require("assert")
|
2
|
+
assert = require("./assert"),
|
3
|
+
load = require("./load");
|
5
4
|
|
6
5
|
var suite = vows.describe("d3.geo.winkel3");
|
7
6
|
|
8
7
|
suite.addBatch({
|
9
8
|
"winkel3": {
|
10
|
-
topic:
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
+
}
|
22
24
|
}
|
23
25
|
}
|
24
26
|
});
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import "projection";
|
2
|
+
import "hyperbolic";
|
3
|
+
|
4
|
+
function transverseMercator(λ, φ) {
|
5
|
+
var B = Math.cos(φ) * Math.sin(λ);
|
6
|
+
return [
|
7
|
+
.5 * Math.log((1 + B) / (1 - B)),
|
8
|
+
Math.atan2(Math.tan(φ), Math.cos(λ))
|
9
|
+
];
|
10
|
+
}
|
11
|
+
|
12
|
+
transverseMercator.invert = function(x, y) {
|
13
|
+
return [
|
14
|
+
Math.atan2(sinh(x), Math.cos(y)),
|
15
|
+
asin(Math.sin(y) / cosh(x))
|
16
|
+
];
|
17
|
+
};
|
18
|
+
|
19
|
+
(d3.geo.transverseMercator = function() { return projection(transverseMercator); }).raw = transverseMercator;
|
@@ -66,14 +66,19 @@ d3.hexbin = function() {
|
|
66
66
|
return "m" + hexagon(radius).join("l") + "z";
|
67
67
|
};
|
68
68
|
|
69
|
-
hexbin.
|
70
|
-
var
|
69
|
+
hexbin.centers = function() {
|
70
|
+
var centers = [];
|
71
71
|
for (var y = 0, odd = false; y < height + r; y += dy, odd = !odd) {
|
72
72
|
for (var x = odd ? dx / 2 : 0; x < width; x += dx) {
|
73
|
-
|
73
|
+
centers.push([x, y]);
|
74
74
|
}
|
75
75
|
}
|
76
|
-
return
|
76
|
+
return centers;
|
77
|
+
};
|
78
|
+
|
79
|
+
hexbin.mesh = function() {
|
80
|
+
var fragment = hexagon(r).slice(0, 4).join("l");
|
81
|
+
return hexbin.centers().map(function(p) { return "M" + p + "m" + fragment; }).join("");
|
77
82
|
};
|
78
83
|
|
79
84
|
hexbin.size = function(_) {
|