d3js-plugins-rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +28 -0
- data/Rakefile +1 -0
- data/d3js-plugins-rails.gemspec +21 -0
- data/lib/d3js-plugins-rails/version.rb +7 -0
- data/lib/d3js-plugins-rails.rb +10 -0
- data/vendor/assets/javascripts/d3/plugins/.gitignore +1 -0
- data/vendor/assets/javascripts/d3/plugins/LICENSE +26 -0
- data/vendor/assets/javascripts/d3/plugins/Makefile +87 -0
- data/vendor/assets/javascripts/d3/plugins/README.md +19 -0
- data/vendor/assets/javascripts/d3/plugins/box/box.js +301 -0
- data/vendor/assets/javascripts/d3/plugins/bullet/README.md +14 -0
- data/vendor/assets/javascripts/d3/plugins/bullet/bullet.js +241 -0
- data/vendor/assets/javascripts/d3/plugins/chernoff/README.md +15 -0
- data/vendor/assets/javascripts/d3/plugins/chernoff/chernoff.js +176 -0
- data/vendor/assets/javascripts/d3/plugins/cie/README.md +54 -0
- data/vendor/assets/javascripts/d3/plugins/cie/cie.js +155 -0
- data/vendor/assets/javascripts/d3/plugins/fisheye/README.md +43 -0
- data/vendor/assets/javascripts/d3/plugins/fisheye/fisheye.js +85 -0
- data/vendor/assets/javascripts/d3/plugins/force_labels/README.md +29 -0
- data/vendor/assets/javascripts/d3/plugins/force_labels/force_labels.js +56 -0
- data/vendor/assets/javascripts/d3/plugins/geo/polyhedron/README.md +7 -0
- data/vendor/assets/javascripts/d3/plugins/geo/polyhedron/polyhedron.js +436 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/README.md +107 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/aitoff.js +40 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/armadillo.js +79 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/august.js +15 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/baker.js +28 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/berghaus.js +60 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/boggs.js +27 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/bonne.js +29 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/bromley.js +5 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/collignon.js +17 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/conic-conformal.js +29 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/conic-equidistant.js +27 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/craig.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/craster.js +18 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/cylindrical-equal-area.js +23 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert1.js +18 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js +17 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert3.js +17 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert4.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert5.js +17 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js +22 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/eisenlohr.js +16 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/end.js +1 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/gringorten.js +111 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/guyou.js +46 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer-retroazimuthal.js +75 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer.js +51 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hatano.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/healpix.js +64 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/hill.js +64 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/homolosine.js +17 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/interrupt.js +111 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/kavrayskiy7.js +15 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/lagrange.js +27 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/larrivee.js +39 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/laskowski.js +31 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/littrow.js +21 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/loximuthal.js +29 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/miller.js +15 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mollweide.js +35 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-parabolic.js +21 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-quartic.js +23 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-sinusoidal.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/natural-earth.js +22 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/nell-hammer.js +20 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel1.js +12 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel2.js +13 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/peirce-quincuncial.js +14 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/polyconic.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/projection.js +29 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/robinson.js +83 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/satellite.js +68 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/sinu-mollweide.js +19 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/sinusoidal.js +15 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/start.js +1 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/aitoff-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js +28 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/baker-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/boggs-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/bonne-test.js +45 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craig-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craster-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/env.js +32 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/equirectangular-test.js +97 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-test.js +29 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hatano-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hill-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/larrivee-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/laskowski-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/littrow-test.js +24 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/loximuthal-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mollweide-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-parabolic-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-quartic-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-sinusoidal-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/natural-earth-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/quartic-authalic-test.js +0 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/robinson-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wagner6-test.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/test/winkel3-test.js +26 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten.js +41 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten4.js +22 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner4.js +9 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner6.js +15 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner7.js +22 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/wiechel.js +14 -0
- data/vendor/assets/javascripts/d3/plugins/geo/projection/winkel3.js +40 -0
- data/vendor/assets/javascripts/d3/plugins/geo/tile/README.md +6 -0
- data/vendor/assets/javascripts/d3/plugins/geo/tile/tile.js +53 -0
- data/vendor/assets/javascripts/d3/plugins/geodesic/README.md +3 -0
- data/vendor/assets/javascripts/d3/plugins/geodesic/geodesic.js +130 -0
- data/vendor/assets/javascripts/d3/plugins/geom/contour/README.md +5 -0
- data/vendor/assets/javascripts/d3/plugins/geom/contour/contour.js +72 -0
- data/vendor/assets/javascripts/d3/plugins/graph/README.md +148 -0
- data/vendor/assets/javascripts/d3/plugins/graph/data/cities-matrix.json +37 -0
- data/vendor/assets/javascripts/d3/plugins/graph/data/cities.csv +36 -0
- data/vendor/assets/javascripts/d3/plugins/graph/data/miserables.json +338 -0
- data/vendor/assets/javascripts/d3/plugins/graph/graph.js +161 -0
- data/vendor/assets/javascripts/d3/plugins/graph/index.html +37 -0
- data/vendor/assets/javascripts/d3/plugins/hexbin/README.md +58 -0
- data/vendor/assets/javascripts/d3/plugins/hexbin/hexbin.js +96 -0
- data/vendor/assets/javascripts/d3/plugins/hive/README.md +5 -0
- data/vendor/assets/javascripts/d3/plugins/hive/hive.js +80 -0
- data/vendor/assets/javascripts/d3/plugins/horizon/README.md +11 -0
- data/vendor/assets/javascripts/d3/plugins/horizon/horizon.js +192 -0
- data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/README.md +11 -0
- data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/interpolate-zoom.js +75 -0
- data/vendor/assets/javascripts/d3/plugins/jsonp/README.md +26 -0
- data/vendor/assets/javascripts/d3/plugins/jsonp/jsonp.js +25 -0
- data/vendor/assets/javascripts/d3/plugins/keybinding/README.md +17 -0
- data/vendor/assets/javascripts/d3/plugins/keybinding/keybinding.js +120 -0
- data/vendor/assets/javascripts/d3/plugins/longscroll/README.md +10 -0
- data/vendor/assets/javascripts/d3/plugins/longscroll/longscroll.js +75 -0
- data/vendor/assets/javascripts/d3/plugins/package.json +20 -0
- data/vendor/assets/javascripts/d3/plugins/qq/README.md +3 -0
- data/vendor/assets/javascripts/d3/plugins/qq/qq.js +249 -0
- data/vendor/assets/javascripts/d3/plugins/rollup/README.md +5 -0
- data/vendor/assets/javascripts/d3/plugins/rollup/rollup.js +131 -0
- data/vendor/assets/javascripts/d3/plugins/sankey/README.md +17 -0
- data/vendor/assets/javascripts/d3/plugins/sankey/sankey.js +292 -0
- data/vendor/assets/javascripts/d3/plugins/simplify/README.md +6 -0
- data/vendor/assets/javascripts/d3/plugins/simplify/simplify-test.js +193 -0
- data/vendor/assets/javascripts/d3/plugins/simplify/simplify.js +446 -0
- data/vendor/assets/javascripts/d3/plugins/superformula/superformula.js +98 -0
- data/vendor/assets/javascripts/d3/plugins/urlencode/urlencode-test.js +68 -0
- data/vendor/assets/javascripts/d3/plugins/urlencode/urlencode.js +37 -0
- metadata +218 -0
@@ -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.larrivee");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"larrivee": {
|
10
|
+
topic: d3.geo.larrivee,
|
11
|
+
"projections and inverse projections": function(larrivee) {
|
12
|
+
assert.equalInverse(larrivee, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(larrivee, [ 0, -90], [480, 583.216220]);
|
14
|
+
assert.equalInverse(larrivee, [ 0, 90], [480, -83.216220]);
|
15
|
+
assert.equalInverse(larrivee, [ 0, -45], [480, 377.516326]);
|
16
|
+
assert.equalInverse(larrivee, [ 0, 45], [480, 122.483673]);
|
17
|
+
assert.equalInverse(larrivee, [-180, 0], [ 8.761101, 250]);
|
18
|
+
assert.equalInverse(larrivee, [ 180, 0], [951.238898, 250]);
|
19
|
+
assert.equalInverse(larrivee, [-179, 15], [ 15.405661, 204.340225]);
|
20
|
+
assert.equalInverse(larrivee, [ 1, 1], [482.617894, 247.381895]);
|
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.laskowski");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"laskowski": {
|
10
|
+
topic: d3.geo.laskowski,
|
11
|
+
"projections and inverse projections": function(laskowski) {
|
12
|
+
assert.equalInverse(laskowski, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(laskowski, [ 0, -90], [480, 474.160635]);
|
14
|
+
assert.equalInverse(laskowski, [ 0, 90], [480, 25.839364]);
|
15
|
+
assert.equalInverse(laskowski, [ 0, -45], [480, 373.320127]);
|
16
|
+
assert.equalInverse(laskowski, [ 0, 45], [480, 126.679872]);
|
17
|
+
assert.equalInverse(laskowski, [-180, 0], [ 20.290432, 250]);
|
18
|
+
assert.equalInverse(laskowski, [ 180, 0], [939.709567, 250]);
|
19
|
+
assert.equalInverse(laskowski, [-179, 15], [ 31.276812, 179.551316]);
|
20
|
+
assert.equalInverse(laskowski, [ 1, 1], [482.553846, 247.371809]);
|
21
|
+
assert.equalInverse(laskowski, [ 45, 87], [525.904925, 26.307624]);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
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.littrow");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"littrow": {
|
10
|
+
topic: d3.geo.littrow,
|
11
|
+
"projections and inverse projections": function(littrow) {
|
12
|
+
assert.equalInverse(littrow, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(littrow, [ 0, -45], [480, 400]);
|
14
|
+
assert.equalInverse(littrow, [ 0, 45], [480, 100]);
|
15
|
+
assert.equalInverse(littrow, [-90, 0], [330, 250]);
|
16
|
+
assert.equalInverse(littrow, [ 90, 0], [630, 250]);
|
17
|
+
assert.equalInverse(littrow, [-80, 15], [327.067798, 243.020666]);
|
18
|
+
assert.equalInverse(littrow, [ 1, 1], [482.618259, 247.382139]);
|
19
|
+
assert.equalInverse(littrow, [ 15, 45], [534.903810, 105.111126]);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
});
|
23
|
+
|
24
|
+
suite.export(module);
|
@@ -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.loximuthal");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"loximuthal": {
|
10
|
+
topic: d3.geo.loximuthal,
|
11
|
+
"projections and inverse projections": function(loximuthal) {
|
12
|
+
assert.equalInverse(loximuthal, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(loximuthal, [ 0, -90], [480, 485.619449]);
|
14
|
+
assert.equalInverse(loximuthal, [ 0, 90], [480, 14.380550]);
|
15
|
+
assert.equalInverse(loximuthal, [ 0, -45], [480, 367.809724]);
|
16
|
+
assert.equalInverse(loximuthal, [ 0, 45], [480, 132.190275]);
|
17
|
+
assert.equalInverse(loximuthal, [-180, 0], [ 48.773559, 250]);
|
18
|
+
assert.equalInverse(loximuthal, [ 180, 0], [911.226440, 250]);
|
19
|
+
assert.equalInverse(loximuthal, [-179, 15], [69.4643149, 210.730091]);
|
20
|
+
assert.equalInverse(loximuthal, [ 1, 1], [482.390500, 247.382006]);
|
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.mollweide");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"mollweide": {
|
10
|
+
topic: d3.geo.mollweide,
|
11
|
+
"projections and inverse projections": function(mollweide) {
|
12
|
+
assert.equalInverse(mollweide, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(mollweide, [ 0, -90], [480, 462.132034]);
|
14
|
+
assert.equalInverse(mollweide, [ 0, 90], [480, 37.867965]);
|
15
|
+
assert.equalInverse(mollweide, [ 0, -45], [480, 375.591020]);
|
16
|
+
assert.equalInverse(mollweide, [ 0, 45], [480, 124.408979]);
|
17
|
+
assert.equalInverse(mollweide, [-180, 0], [ 55.735931, 250]);
|
18
|
+
assert.equalInverse(mollweide, [ 180, 0], [904.264068, 250]);
|
19
|
+
assert.equalInverse(mollweide, [-179, 15], [ 67.028260, 206.573390]);
|
20
|
+
assert.equalInverse(mollweide, [ 1, 1], [482.356801, 247.092196]);
|
21
|
+
assert.equalInverse(mollweide, [ 45, 87], [495.642877, 40.187699]);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
suite.export(module);
|
@@ -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.mtFlatPolarParabolic");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"mtFlatPolarParabolic": {
|
10
|
+
topic: d3.geo.mtFlatPolarParabolic,
|
11
|
+
"projections and inverse projections": function(mtFlatPolarParabolic) {
|
12
|
+
assert.equalInverse(mtFlatPolarParabolic, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(mtFlatPolarParabolic, [ 0, -90], [480, 458.309522]);
|
14
|
+
assert.equalInverse(mtFlatPolarParabolic, [ 0, 90], [480, 41.690477]);
|
15
|
+
assert.equalInverse(mtFlatPolarParabolic, [ 0, -45], [480, 374.430617]);
|
16
|
+
assert.equalInverse(mtFlatPolarParabolic, [ 0, 45], [480, 125.569382]);
|
17
|
+
assert.equalInverse(mtFlatPolarParabolic, [-180, 0], [ 43.717556, 250]);
|
18
|
+
assert.equalInverse(mtFlatPolarParabolic, [ 180, 0], [916.282443, 250]);
|
19
|
+
assert.equalInverse(mtFlatPolarParabolic, [-179, 15], [ 58.080254, 207.678319]);
|
20
|
+
assert.equalInverse(mtFlatPolarParabolic, [ 1, 1], [482.423493, 247.172271]);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
});
|
24
|
+
|
25
|
+
suite.export(module);
|
@@ -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.mtFlatPolarQuartic");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"mtFlatPolarQuartic": {
|
10
|
+
topic: d3.geo.mtFlatPolarQuartic,
|
11
|
+
"projections and inverse projections": function(mtFlatPolarQuartic) {
|
12
|
+
assert.equalInverse(mtFlatPolarQuartic, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(mtFlatPolarQuartic, [ 0, -90], [480, 448.848144]);
|
14
|
+
assert.equalInverse(mtFlatPolarQuartic, [ 0, 90], [480, 51.151855]);
|
15
|
+
assert.equalInverse(mtFlatPolarQuartic, [ 0, -45], [480, 371.001020]);
|
16
|
+
assert.equalInverse(mtFlatPolarQuartic, [ 0, 45], [480, 128.998979]);
|
17
|
+
assert.equalInverse(mtFlatPolarQuartic, [-180, 0], [146.783779, 250]);
|
18
|
+
assert.equalInverse(mtFlatPolarQuartic, [ 180, 0], [813.216220, 250]);
|
19
|
+
assert.equalInverse(mtFlatPolarQuartic, [-179, 15], [155.997702, 208.275733]);
|
20
|
+
assert.equalInverse(mtFlatPolarQuartic, [ 1, 1], [481.851018, 247.207163]);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
});
|
24
|
+
|
25
|
+
suite.export(module);
|
data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-sinusoidal-test.js
ADDED
@@ -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.mtFlatPolarSinusoidal");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"mtFlatPolarSinusoidal": {
|
10
|
+
topic: d3.geo.mtFlatPolarSinusoidal,
|
11
|
+
"projections and inverse projections": function(mtFlatPolarSinusoidal) {
|
12
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [ 0, -90], [480, 465.967909]);
|
14
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [ 0, 90], [480, 34.032090]);
|
15
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [ 0, -45], [480, 377.345812]);
|
16
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [ 0, 45], [480, 122.654187]);
|
17
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [-180, 0], [ 48.064181, 250]);
|
18
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [ 180, 0], [911.935818, 250]);
|
19
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [-179, 15], [ 64.236235, 207.185461]);
|
20
|
+
assert.equalInverse(mtFlatPolarSinusoidal, [ 1, 1], [482.399298, 247.143795]);
|
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.naturalEarth");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"naturalEarth": {
|
10
|
+
topic: d3.geo.naturalEarth,
|
11
|
+
"projections and inverse projections": function(naturalEarth) {
|
12
|
+
assert.equalInverse(naturalEarth, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(naturalEarth, [ 0, -90], [480, 463.358576]);
|
14
|
+
assert.equalInverse(naturalEarth, [ 0, 90], [480, 36.641423]);
|
15
|
+
assert.equalInverse(naturalEarth, [ 0, -45], [480, 368.957709]);
|
16
|
+
assert.equalInverse(naturalEarth, [ 0, 45], [480, 131.042290]);
|
17
|
+
assert.equalInverse(naturalEarth, [-180, 0], [ 69.692291, 250]);
|
18
|
+
assert.equalInverse(naturalEarth, [ 180, 0], [890.307708, 250]);
|
19
|
+
assert.equalInverse(naturalEarth, [-179, 15], [ 76.241138, 210.406263]);
|
20
|
+
assert.equalInverse(naturalEarth, [ 1, 1], [482.279382, 247.363076]);
|
21
|
+
assert.equalInverse(naturalEarth, [ 45, 87], [541.511740, 38.772664]);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
suite.export(module);
|
File without changes
|
@@ -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.robinson");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"robinson": {
|
10
|
+
topic: d3.geo.robinson,
|
11
|
+
"projections and inverse projections": function(robinson) {
|
12
|
+
assert.equalInverse(robinson, [ 1, 1], [482.617847, 247.036246]);
|
13
|
+
assert.equalInverse(robinson, [ 45, 87], [545.397120, 14.047945]);
|
14
|
+
assert.equalInverse(robinson, [ 0, 0], [480, 250]);
|
15
|
+
assert.equalInverse(robinson, [ 0, -90], [480, 489.012369]);
|
16
|
+
assert.equalInverse(robinson, [ 0, 90], [480, 10.987630]);
|
17
|
+
assert.equalInverse(robinson, [ 0, -45], [480, 383.153790]);
|
18
|
+
assert.equalInverse(robinson, [ 0, 45], [480, 116.846209]);
|
19
|
+
assert.equalInverse(robinson, [-180, 0], [ 8.761101, 250]);
|
20
|
+
assert.equalInverse(robinson, [ 180, 0], [951.238898, 250]);
|
21
|
+
assert.equalInverse(robinson, [-179, 15], [ 16.065304, 205.543699]);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
suite.export(module);
|
@@ -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.wagner6");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"wagner6": {
|
10
|
+
topic: d3.geo.wagner6,
|
11
|
+
"projections and inverse projections": function(wagner6) {
|
12
|
+
assert.equalInverse(wagner6, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(wagner6, [ 0, -90], [480, 485.619449]);
|
14
|
+
assert.equalInverse(wagner6, [ 0, 90], [480, 14.380550]);
|
15
|
+
assert.equalInverse(wagner6, [ 0, -45], [480, 367.809724]);
|
16
|
+
assert.equalInverse(wagner6, [ 0, 45], [480, 132.190275]);
|
17
|
+
assert.equalInverse(wagner6, [-180, 0], [ 8.761101, 250]);
|
18
|
+
assert.equalInverse(wagner6, [ 180, 0], [951.238898, 250]);
|
19
|
+
assert.equalInverse(wagner6, [-179, 15], [16.2862562, 210.730091]);
|
20
|
+
assert.equalInverse(wagner6, [ 1, 1], [482.617872, 247.382006]);
|
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.winkel3");
|
7
|
+
|
8
|
+
suite.addBatch({
|
9
|
+
"winkel3": {
|
10
|
+
topic: d3.geo.winkel3,
|
11
|
+
"projections and inverse projections": function(winkel3) {
|
12
|
+
assert.equalInverse(winkel3, [ 0, 0], [480, 250]);
|
13
|
+
assert.equalInverse(winkel3, [ 0, -90], [480, 485.619449]);
|
14
|
+
assert.equalInverse(winkel3, [ 0, 90], [480, 14.380550]);
|
15
|
+
assert.equalInverse(winkel3, [ 0, -45], [480, 367.809724]);
|
16
|
+
assert.equalInverse(winkel3, [ 0, 45], [480, 132.190275]);
|
17
|
+
assert.equalInverse(winkel3, [-180, 0], [ 94.380550, 250]);
|
18
|
+
assert.equalInverse(winkel3, [ 180, 0], [865.619449, 250]);
|
19
|
+
assert.equalInverse(winkel3, [-179, 15], [104.464309, 200.036192]);
|
20
|
+
assert.equalInverse(winkel3, [ 1, 1], [482.142197, 247.381989]);
|
21
|
+
assert.equalInverse(winkel3, [ 45, 87], [522.079049, 21.958321]);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
suite.export(module);
|
@@ -0,0 +1,41 @@
|
|
1
|
+
function vanDerGrinten(λ, φ) {
|
2
|
+
if (Math.abs(φ) < ε) return [λ, 0];
|
3
|
+
var sinθ = Math.abs(2 * φ / π),
|
4
|
+
θ = asin(sinθ);
|
5
|
+
if (Math.abs(λ) < ε || Math.abs(Math.abs(φ) - π / 2) < ε) return [0, sgn(φ) * π * Math.tan(θ / 2)];
|
6
|
+
var cosθ = Math.cos(θ),
|
7
|
+
A = Math.abs(π / λ - λ / π) / 2,
|
8
|
+
A2 = A * A,
|
9
|
+
G = cosθ / (sinθ + cosθ - 1),
|
10
|
+
P = G * (2 / sinθ - 1),
|
11
|
+
P2 = P * P,
|
12
|
+
P2_A2 = P2 + A2,
|
13
|
+
G_P2 = G - P2,
|
14
|
+
Q = A2 + G;
|
15
|
+
return [
|
16
|
+
sgn(λ) * π * (A * G_P2 + Math.sqrt(A2 * G_P2 * G_P2 - P2_A2 * (G * G - P2))) / P2_A2,
|
17
|
+
sgn(φ) * π * (P * Q - A * Math.sqrt((A2 + 1) * P2_A2 - Q * Q)) / P2_A2
|
18
|
+
];
|
19
|
+
}
|
20
|
+
|
21
|
+
vanDerGrinten.invert = function(x, y) {
|
22
|
+
if (Math.abs(y) < ε) return [x, 0];
|
23
|
+
if (Math.abs(x) < ε) return [0, π / 2 * Math.sin(2 * Math.atan(y / π))];
|
24
|
+
var x2 = (x /= π) * x,
|
25
|
+
y2 = (y /= π) * y,
|
26
|
+
x2_y2 = x2 + y2,
|
27
|
+
z = x2_y2 * x2_y2,
|
28
|
+
c1 = -Math.abs(y) * (1 + x2_y2),
|
29
|
+
c2 = c1 - 2 * y2 + x2,
|
30
|
+
c3 = -2 * c1 + 1 + 2 * y2 + z,
|
31
|
+
d = y2 / c3 + (2 * c2 * c2 * c2 / (c3 * c3 * c3) - 9 * c1 * c2 / (c3 * c3)) / 27,
|
32
|
+
a1 = (c1 - c2 * c2 / (3 * c3)) / c3,
|
33
|
+
m1 = 2 * Math.sqrt(-a1 / 3),
|
34
|
+
θ1 = acos(3 * d / (a1 * m1)) / 3;
|
35
|
+
return [
|
36
|
+
π * (x2_y2 - 1 + Math.sqrt(1 + 2 * (x2 - y2) + z)) / (2 * x),
|
37
|
+
sgn(y) * π * (-m1 * Math.cos(θ1 + π / 3) - c2 / (3 * c3))
|
38
|
+
];
|
39
|
+
};
|
40
|
+
|
41
|
+
(d3.geo.vanDerGrinten = function() { return projection(vanDerGrinten); }).raw = vanDerGrinten;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
function vanDerGrinten4(λ, φ) {
|
2
|
+
if (!φ) return [λ, 0];
|
3
|
+
var φ0 = Math.abs(φ);
|
4
|
+
if (!λ || φ0 === π / 2) return [0, φ];
|
5
|
+
var t,
|
6
|
+
B = 2 * φ0 / π,
|
7
|
+
B2 = B * B,
|
8
|
+
C = (8 * B - B2 * (B2 + 2) - 5) / (2 * B2 * (B - 1)),
|
9
|
+
C2 = C * C,
|
10
|
+
BC = B * C,
|
11
|
+
B_C2 = B2 + C2 + 2 * BC,
|
12
|
+
D = sgn(Math.abs(λ) - π / 2) * Math.sqrt((t = (t = 2 * λ / π) + 1 / t) * t - 4),
|
13
|
+
D2 = D * D,
|
14
|
+
F = B_C2 * (B2 + C2 * D2 - 1) + (1 - B2) * (B2 * ((t = B + 3 * C) * t + 4 * C2) + 12 * BC * C2 + 4 * C2 * C2),
|
15
|
+
x1 = (D * (B_C2 + C2 - 1) + 2 * Math.sqrt(F)) / (4 * B_C2 + D2);
|
16
|
+
return [
|
17
|
+
sgn(λ) * π * x1 / 2,
|
18
|
+
sgn(φ) * π / 2 * Math.sqrt(1 + D * Math.abs(x1) - x1 * x1)
|
19
|
+
];
|
20
|
+
}
|
21
|
+
|
22
|
+
(d3.geo.vanDerGrinten4 = function() { return projection(vanDerGrinten4); }).raw = vanDerGrinten4;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// @import mollweide
|
2
|
+
|
3
|
+
var wagner4 = (function() {
|
4
|
+
var A = 4 * π + 3 * Math.sqrt(3),
|
5
|
+
B = 2 * Math.sqrt(2 * π * Math.sqrt(3) / A);
|
6
|
+
return mollweideBromley(B * Math.sqrt(3) / π, B, A / 6);
|
7
|
+
})();
|
8
|
+
|
9
|
+
(d3.geo.wagner4 = function() { return projection(wagner4); }).raw = wagner4;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
function wagner6(λ, φ) {
|
2
|
+
return [
|
3
|
+
λ * Math.sqrt(1 - 3 * φ * φ / (π * π)),
|
4
|
+
φ
|
5
|
+
];
|
6
|
+
}
|
7
|
+
|
8
|
+
wagner6.invert = function(x, y) {
|
9
|
+
return [
|
10
|
+
x / Math.sqrt(1 - 3 * y * y / (π * π)),
|
11
|
+
y
|
12
|
+
];
|
13
|
+
};
|
14
|
+
|
15
|
+
(d3.geo.wagner6 = function() { return projection(wagner6); }).raw = wagner6;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
function wagner7(λ, φ) {
|
2
|
+
var s = .90631 * Math.sin(φ),
|
3
|
+
c0 = Math.sqrt(1 - s * s),
|
4
|
+
c1 = Math.sqrt(2 / (1 + c0 * Math.cos(λ /= 3)));
|
5
|
+
return [
|
6
|
+
2.66723 * c0 * c1 * Math.sin(λ),
|
7
|
+
1.24104 * s * c1
|
8
|
+
];
|
9
|
+
}
|
10
|
+
|
11
|
+
wagner7.invert = function(x, y) {
|
12
|
+
var t1 = x / 2.66723,
|
13
|
+
t2 = y / 1.24104,
|
14
|
+
p = Math.sqrt(t1 * t1 + t2 * t2),
|
15
|
+
c = 2 * asin(p / 2);
|
16
|
+
return [
|
17
|
+
3 * Math.atan2(x * Math.tan(c), 2.66723 * p),
|
18
|
+
p && asin(y * Math.sin(c) / (1.24104 * 0.90631 * p))
|
19
|
+
];
|
20
|
+
};
|
21
|
+
|
22
|
+
(d3.geo.wagner7 = function() { return projection(wagner7); }).raw = wagner7;
|