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.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/d3js-plugins-rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/d3/plugins/LICENSE +1 -1
  5. data/vendor/assets/javascripts/d3/plugins/README.md +0 -14
  6. data/vendor/assets/javascripts/d3/plugins/geo/projection/README.md +1 -252
  7. data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/README.md +9 -0
  8. data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/interpolate-zoom-test.js +27 -0
  9. data/vendor/assets/javascripts/d3/plugins/interpolate-zoom/interpolate-zoom.js +18 -32
  10. data.tar.gz.sig +0 -0
  11. metadata +4 -140
  12. metadata.gz.sig +2 -5
  13. data/vendor/assets/javascripts/d3/plugins/.gitignore +0 -1
  14. data/vendor/assets/javascripts/d3/plugins/Makefile +0 -18
  15. data/vendor/assets/javascripts/d3/plugins/geo/projection/airy.js +0 -55
  16. data/vendor/assets/javascripts/d3/plugins/geo/projection/aitoff.js +0 -42
  17. data/vendor/assets/javascripts/d3/plugins/geo/projection/armadillo.js +0 -81
  18. data/vendor/assets/javascripts/d3/plugins/geo/projection/august.js +0 -36
  19. data/vendor/assets/javascripts/d3/plugins/geo/projection/baker.js +0 -30
  20. data/vendor/assets/javascripts/d3/plugins/geo/projection/berghaus.js +0 -76
  21. data/vendor/assets/javascripts/d3/plugins/geo/projection/boggs.js +0 -28
  22. data/vendor/assets/javascripts/d3/plugins/geo/projection/bonne.js +0 -30
  23. data/vendor/assets/javascripts/d3/plugins/geo/projection/bromley.js +0 -6
  24. data/vendor/assets/javascripts/d3/plugins/geo/projection/chamberlin.js +0 -116
  25. data/vendor/assets/javascripts/d3/plugins/geo/projection/collignon.js +0 -19
  26. data/vendor/assets/javascripts/d3/plugins/geo/projection/craig.js +0 -31
  27. data/vendor/assets/javascripts/d3/plugins/geo/projection/craster.js +0 -20
  28. data/vendor/assets/javascripts/d3/plugins/geo/projection/cylindrical-equal-area.js +0 -24
  29. data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert1.js +0 -20
  30. data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert2.js +0 -19
  31. data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert3.js +0 -19
  32. data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert4.js +0 -26
  33. data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert5.js +0 -19
  34. data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert6.js +0 -24
  35. data/vendor/assets/javascripts/d3/plugins/geo/projection/eisenlohr.js +0 -78
  36. data/vendor/assets/javascripts/d3/plugins/geo/projection/elliptic.js +0 -118
  37. data/vendor/assets/javascripts/d3/plugins/geo/projection/end.js +0 -1
  38. data/vendor/assets/javascripts/d3/plugins/geo/projection/fahey.js +0 -21
  39. data/vendor/assets/javascripts/d3/plugins/geo/projection/gall-stereographic.js +0 -19
  40. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg-polyconic.js +0 -56
  41. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg4.js +0 -6
  42. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg5.js +0 -6
  43. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg6.js +0 -6
  44. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg8.js +0 -29
  45. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg9.js +0 -6
  46. data/vendor/assets/javascripts/d3/plugins/geo/projection/gringorten.js +0 -150
  47. data/vendor/assets/javascripts/d3/plugins/geo/projection/guyou.js +0 -55
  48. data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer-retroazimuthal.js +0 -106
  49. data/vendor/assets/javascripts/d3/plugins/geo/projection/hammer.js +0 -53
  50. data/vendor/assets/javascripts/d3/plugins/geo/projection/hatano.js +0 -27
  51. data/vendor/assets/javascripts/d3/plugins/geo/projection/healpix.js +0 -85
  52. data/vendor/assets/javascripts/d3/plugins/geo/projection/hill.js +0 -66
  53. data/vendor/assets/javascripts/d3/plugins/geo/projection/homolosine.js +0 -18
  54. data/vendor/assets/javascripts/d3/plugins/geo/projection/hyperbolic.js +0 -22
  55. data/vendor/assets/javascripts/d3/plugins/geo/projection/index.js +0 -72
  56. data/vendor/assets/javascripts/d3/plugins/geo/projection/interrupt.js +0 -150
  57. data/vendor/assets/javascripts/d3/plugins/geo/projection/kavrayskiy7.js +0 -17
  58. data/vendor/assets/javascripts/d3/plugins/geo/projection/lagrange.js +0 -47
  59. data/vendor/assets/javascripts/d3/plugins/geo/projection/larrivee.js +0 -41
  60. data/vendor/assets/javascripts/d3/plugins/geo/projection/laskowski.js +0 -33
  61. data/vendor/assets/javascripts/d3/plugins/geo/projection/littrow.js +0 -23
  62. data/vendor/assets/javascripts/d3/plugins/geo/projection/loximuthal.js +0 -30
  63. data/vendor/assets/javascripts/d3/plugins/geo/projection/math.js +0 -26
  64. data/vendor/assets/javascripts/d3/plugins/geo/projection/miller.js +0 -17
  65. data/vendor/assets/javascripts/d3/plugins/geo/projection/modified-stereographic.js +0 -106
  66. data/vendor/assets/javascripts/d3/plugins/geo/projection/mollweide.js +0 -37
  67. data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-parabolic.js +0 -23
  68. data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-quartic.js +0 -25
  69. data/vendor/assets/javascripts/d3/plugins/geo/projection/mt-flat-polar-sinusoidal.js +0 -27
  70. data/vendor/assets/javascripts/d3/plugins/geo/projection/natural-earth.js +0 -24
  71. data/vendor/assets/javascripts/d3/plugins/geo/projection/nell-hammer.js +0 -22
  72. data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel1.js +0 -14
  73. data/vendor/assets/javascripts/d3/plugins/geo/projection/parallel2.js +0 -15
  74. data/vendor/assets/javascripts/d3/plugins/geo/projection/peirce-quincuncial.js +0 -7
  75. data/vendor/assets/javascripts/d3/plugins/geo/projection/polyconic.js +0 -31
  76. data/vendor/assets/javascripts/d3/plugins/geo/projection/projection.js +0 -4
  77. data/vendor/assets/javascripts/d3/plugins/geo/projection/quincuncial.js +0 -73
  78. data/vendor/assets/javascripts/d3/plugins/geo/projection/rectangular-polyconic.js +0 -41
  79. data/vendor/assets/javascripts/d3/plugins/geo/projection/robinson.js +0 -85
  80. data/vendor/assets/javascripts/d3/plugins/geo/projection/satellite.js +0 -70
  81. data/vendor/assets/javascripts/d3/plugins/geo/projection/sinu-mollweide.js +0 -20
  82. data/vendor/assets/javascripts/d3/plugins/geo/projection/sinusoidal.js +0 -17
  83. data/vendor/assets/javascripts/d3/plugins/geo/projection/start.js +0 -1
  84. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/airy-test.js +0 -25
  85. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/aitoff-test.js +0 -28
  86. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/armadillo-test.js +0 -30
  87. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/assert.js +0 -32
  88. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/august-test.js +0 -29
  89. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/baker-test.js +0 -28
  90. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/berghaus-test.js +0 -28
  91. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/boggs-test.js +0 -28
  92. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/bonne-test.js +0 -45
  93. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craig-test.js +0 -40
  94. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/craster-test.js +0 -27
  95. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/eckert4-test.js +0 -26
  96. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/eisenlohr-test.js +0 -36
  97. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/equirectangular-test.js +0 -96
  98. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/fahey-test.js +0 -27
  99. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg4-test.js +0 -28
  100. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg5-test.js +0 -28
  101. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg6-test.js +0 -28
  102. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg8-test.js +0 -28
  103. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg9-test.js +0 -28
  104. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/gringorten-test.js +0 -26
  105. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/guyou-test.js +0 -28
  106. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-retroazimuthal-test.js +0 -39
  107. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-test.js +0 -29
  108. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hatano-test.js +0 -27
  109. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/healpix-test.js +0 -26
  110. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/hill-test.js +0 -28
  111. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/lagrange-test.js +0 -59
  112. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/larrivee-test.js +0 -27
  113. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/laskowski-test.js +0 -28
  114. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/littrow-test.js +0 -26
  115. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/load.js +0 -20
  116. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/loximuthal-test.js +0 -27
  117. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/modified-stereographic-test.js +0 -26
  118. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mollweide-test.js +0 -28
  119. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-parabolic-test.js +0 -27
  120. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-quartic-test.js +0 -27
  121. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/mt-flat-polar-sinusoidal-test.js +0 -27
  122. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/natural-earth-test.js +0 -28
  123. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/peirce-quincuncial-test.js +0 -26
  124. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/polyconic-test.js +0 -28
  125. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/quartic-authalic-test.js +0 -0
  126. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/rectangular-polyconic-test.js +0 -48
  127. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/robinson-test.js +0 -28
  128. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/times-test.js +0 -26
  129. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-azimuthal-test.js +0 -24
  130. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/two-point-equidistant-test.js +0 -26
  131. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten2-test.js +0 -26
  132. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten3-test.js +0 -26
  133. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/van-der-grinten4-test.js +0 -32
  134. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wagner6-test.js +0 -27
  135. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/wiechel-test.js +0 -26
  136. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/winkel3-test.js +0 -28
  137. data/vendor/assets/javascripts/d3/plugins/geo/projection/times.js +0 -21
  138. data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-azimuthal.js +0 -47
  139. data/vendor/assets/javascripts/d3/plugins/geo/projection/two-point-equidistant.js +0 -83
  140. data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten.js +0 -43
  141. data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten2.js +0 -30
  142. data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten3.js +0 -26
  143. data/vendor/assets/javascripts/d3/plugins/geo/projection/van-der-grinten4.js +0 -56
  144. data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner4.js +0 -10
  145. data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner6.js +0 -17
  146. data/vendor/assets/javascripts/d3/plugins/geo/projection/wagner7.js +0 -24
  147. data/vendor/assets/javascripts/d3/plugins/geo/projection/wiechel.js +0 -28
  148. data/vendor/assets/javascripts/d3/plugins/geo/projection/winkel3.js +0 -41
  149. data/vendor/assets/javascripts/d3/plugins/package.json +0 -22
@@ -1,29 +0,0 @@
1
- import "projection";
2
-
3
- function ginzburg8(λ, φ) {
4
- var λ2 = λ * λ,
5
- φ2 = φ * φ;
6
- return [
7
- λ * (1 - .162388 * φ2) * (.87 - .000952426 * λ2 * λ2),
8
- φ * (1 + φ2 / 12)
9
- ];
10
- }
11
-
12
- ginzburg8.invert = function(x, y) {
13
- var λ = x,
14
- φ = y,
15
- i = 50, δ;
16
- do {
17
- var φ2 = φ * φ;
18
- φ -= δ = (φ * (1 + φ2 / 12) - y) / (1 + φ2 / 4);
19
- } while (Math.abs(δ) > ε && --i > 0);
20
- i = 50;
21
- x /= 1 - .162388 * φ2;
22
- do {
23
- var λ4 = (λ4 = λ * λ) * λ4;
24
- λ -= δ = (λ * (.87 - .000952426 * λ4) - x) / (.87 - .00476213 * λ4);
25
- } while (Math.abs(δ) > ε && --i > 0);
26
- return [λ, φ];
27
- };
28
-
29
- (d3.geo.ginzburg8 = function() { return projection(ginzburg8); }).raw = ginzburg8;
@@ -1,6 +0,0 @@
1
- import "projection";
2
- import "ginzburg-polyconic";
3
-
4
- var ginzburg9 = ginzburgPolyconic(2.6516, -.76534, .19123, -.047094, 1.36289, -.13965, .031762);
5
-
6
- (d3.geo.ginzburg9 = function() { return projection(ginzburg9); }).raw = ginzburg9;
@@ -1,150 +0,0 @@
1
- import "projection";
2
- import "quincuncial";
3
-
4
- function gringorten(λ, φ) {
5
- var sλ = sgn(λ),
6
- sφ = sgn(φ),
7
- cosφ = Math.cos(φ),
8
- x = Math.cos(λ) * cosφ,
9
- y = Math.sin(λ) * cosφ,
10
- z = Math.sin(sφ * φ);
11
-
12
- λ = Math.abs(Math.atan2(y, z));
13
- φ = asin(x);
14
-
15
- if (Math.abs(λ - π / 2) > ε) λ %= π / 2;
16
- var point = gringortenHexadecant(λ > π / 4 ? π / 2 - λ : λ, φ);
17
-
18
- if (λ > π / 4) z = point[0], point[0] = -point[1], point[1] = -z;
19
-
20
- return (point[0] *= sλ, point[1] *= -sφ, point);
21
- }
22
-
23
- gringorten.invert = function(x, y) {
24
- var sx = sgn(x),
25
- sy = sgn(y),
26
- x0 = -sx * x,
27
- y0 = -sy * y,
28
- t = y0 / x0 < 1,
29
- p = gringortenHexadecantInvert(t ? y0 : x0, t ? x0 : y0),
30
- λ = p[0],
31
- φ = p[1];
32
-
33
- if (t) λ = -π / 2 - λ;
34
-
35
- var cosφ = Math.cos(φ),
36
- x = Math.cos(λ) * cosφ,
37
- y = Math.sin(λ) * cosφ,
38
- z = Math.sin(φ);
39
-
40
- return [sx * (Math.atan2(y, -z) + π), sy * asin(x)];
41
- };
42
-
43
- function gringortenHexadecant(λ, φ) {
44
- if (φ === π / 2) return [0, 0];
45
-
46
- var sinφ = Math.sin(φ),
47
- r = sinφ * sinφ,
48
- r2 = r * r,
49
- j = 1 + r2,
50
- k = 1 + 3 * r2,
51
- q = 1 - r2,
52
- z = asin(1 / Math.sqrt(j)),
53
- v = q + r * j * z,
54
- p2 = (1 - sinφ) / v,
55
- p = Math.sqrt(p2),
56
- a2 = p2 * j,
57
- a = Math.sqrt(a2),
58
- h = p * q;
59
- if (λ === 0) return [0, -(h + r * a)];
60
-
61
- var cosφ = Math.cos(φ),
62
- secφ = 1 / cosφ,
63
- drdφ = 2 * sinφ * cosφ,
64
- dvdφ = (-3 * r + z * k) * drdφ,
65
- dp2dφ = (-v * cosφ - (1 - sinφ) * dvdφ) / (v * v),
66
- dpdφ = (.5 * dp2dφ) / p,
67
- dhdφ = q * dpdφ - 2 * r * p * drdφ,
68
- dra2dφ = r * j * dp2dφ + p2 * k * drdφ,
69
- μ = -secφ * drdφ,
70
- ν = -secφ * dra2dφ,
71
- ζ = -2 * secφ * dhdφ,
72
- Λ = 4 * λ / π;
73
-
74
- if (λ > .222 * π || φ < π / 4 && λ > .175 * π) {
75
- // Slower but accurate bisection method.
76
- var x = (h + r * asqrt(a2 * (1 + r2) - h * h)) / (1 + r2);
77
- if (λ > π / 4) return [x, x];
78
-
79
- var x1 = x,
80
- x0 = .5 * x,
81
- i = 50;
82
- x = .5 * (x0 + x1);
83
- do {
84
- var g = Math.sqrt(a2 - x * x),
85
- f = (x * (ζ + μ * g) + ν * asin(x / a)) - Λ;
86
- if (!f) break;
87
- if (f < 0) x0 = x;
88
- else x1 = x;
89
- x = .5 * (x0 + x1);
90
- } while (Math.abs(x1 - x0) > ε && --i > 0);
91
- } else {
92
- // Newton-Raphson.
93
- var x = ε, i = 25, δ;
94
- do {
95
- var x2 = x * x,
96
- g = asqrt(a2 - x2),
97
- ζμg = ζ + μ * g,
98
- f = x * ζμg + ν * asin(x / a) - Λ,
99
- df = ζμg + (ν - μ * x2) / g;
100
- x -= δ = g ? f / df : 0;
101
- } while (Math.abs(δ) > ε && --i > 0);
102
- }
103
- return [x, -h - r * asqrt(a2 - x * x)];
104
- }
105
-
106
- function gringortenHexadecantInvert(x, y) {
107
- var x0 = 0,
108
- x1 = 1,
109
- r = .5,
110
- i = 50;
111
-
112
- while (true) {
113
- var r2 = r * r,
114
- sinφ = Math.sqrt(r),
115
- z = Math.asin(1 / Math.sqrt(1 + r2)),
116
- v = (1 - r2) + r * (1 + r2) * z,
117
- p2 = (1 - sinφ) / v,
118
- p = Math.sqrt(p2),
119
- a2 = p2 * (1 + r2),
120
- h = p * (1 - r2),
121
- g2 = a2 - x * x,
122
- g = Math.sqrt(g2),
123
- y0 = y + h + r * g;
124
-
125
- if (Math.abs(x1 - x0) < ε2 || --i === 0 || y0 === 0) break;
126
-
127
- if (y0 > 0) x0 = r;
128
- else x1 = r;
129
-
130
- r = .5 * (x0 + x1);
131
- }
132
-
133
- if (!i) return null;
134
-
135
- var φ = Math.asin(sinφ),
136
- cosφ = Math.cos(φ),
137
- secφ = 1 / cosφ,
138
- drdφ = 2 * sinφ * cosφ,
139
- dvdφ = (-3 * r + z * (1 + 3 * r2)) * drdφ,
140
- dp2dφ = (-v * cosφ - (1 - sinφ) * dvdφ) / (v * v),
141
- dpdφ = .5 * dp2dφ / p,
142
- dhdφ = (1 - r2) * dpdφ - 2 * r * p * drdφ,
143
- ζ = -2 * secφ * dhdφ,
144
- μ = -secφ * drdφ,
145
- ν = -secφ * (r * (1 + r2) * dp2dφ + p2 * (1 + 3 * r2) * drdφ);
146
-
147
- return [π / 4 * (x * (ζ + μ * g) + ν * Math.asin(x / Math.sqrt(a2))), φ];
148
- }
149
-
150
- d3.geo.gringorten = quincuncialProjection(gringorten);
@@ -1,55 +0,0 @@
1
- import "projection";
2
- import "elliptic";
3
- import "quincuncial";
4
-
5
- // √k' tn(½K - w) = exp(-ζ).
6
- function guyou(λ, φ) {
7
-
8
- var k_ = (Math.SQRT2 - 1) / (Math.SQRT2 + 1),
9
- k = Math.sqrt(1 - k_ * k_),
10
- K = ellipticF(π / 2, k * k),
11
- f = -1;
12
-
13
- var ψ = Math.log(Math.tan(π / 4 + Math.abs(φ) / 2)),
14
- r = Math.exp(f * ψ) / Math.sqrt(k_),
15
- at = guyouComplexAtan(r * Math.cos(f * λ), r * Math.sin(f * λ)),
16
- t = ellipticFi(at[0], at[1], k * k);
17
-
18
- return [-t[1], sgn(φ) * (.5 * K - t[0])];
19
- }
20
-
21
- function guyouComplexAtan(x, y) {
22
- var x2 = x * x,
23
- y_1 = y + 1,
24
- t = 1 - x2 - y * y;
25
- return [
26
- sgn(x) * π / 4 - .5 * Math.atan2(t, 2 * x),
27
- -.25 * Math.log(t * t + 4 * x2) + .5 * Math.log(y_1 * y_1 + x2)
28
- ];
29
- }
30
-
31
- function guyouComplexDivide(a, b) {
32
- var denominator = b[0] * b[0] + b[1] * b[1];
33
- return [
34
- (a[0] * b[0] + a[1] * b[1]) / denominator,
35
- (a[1] * b[0] - a[0] * b[1]) / denominator
36
- ];
37
- }
38
-
39
- guyou.invert = function(x, y) {
40
- var k_ = (Math.SQRT2 - 1) / (Math.SQRT2 + 1),
41
- k = Math.sqrt(1 - k_ * k_),
42
- K = ellipticF(π / 2, k * k),
43
- f = -1;
44
-
45
- var j = ellipticJi(.5 * K - y, -x, k * k),
46
- tn = guyouComplexDivide(j[0], j[1]),
47
- λ = Math.atan2(tn[1], tn[0]) / f;
48
-
49
- return [
50
- λ,
51
- 2 * Math.atan(Math.exp(.5 / f * Math.log(k_ * tn[0] * tn[0] + k_ * tn[1] * tn[1]))) - π / 2
52
- ];
53
- };
54
-
55
- d3.geo.guyou = quincuncialProjection(guyou);
@@ -1,106 +0,0 @@
1
- import "projection";
2
-
3
- function hammerRetroazimuthal(φ0) {
4
- var sinφ0 = Math.sin(φ0),
5
- cosφ0 = Math.cos(φ0),
6
- rotate = hammerRetroazimuthalRotation(φ0);
7
- rotate.invert = hammerRetroazimuthalRotation(-φ0);
8
-
9
- function forward(λ, φ) {
10
- var p = rotate(λ, φ);
11
- λ = p[0], φ = p[1];
12
- var sinφ = Math.sin(φ),
13
- cosφ = Math.cos(φ),
14
- cosλ = Math.cos(λ),
15
- z = acos(sinφ0 * sinφ + cosφ0 * cosφ * cosλ),
16
- sinz = Math.sin(z),
17
- K = Math.abs(sinz) > ε ? z / sinz : 1;
18
- return [
19
- K * cosφ0 * Math.sin(λ),
20
- (Math.abs(λ) > π / 2 ? K : -K) // rotate for back hemisphere
21
- * (sinφ0 * cosφ - cosφ0 * sinφ * cosλ)
22
- ];
23
- }
24
-
25
- forward.invert = function(x, y) {
26
- var ρ = Math.sqrt(x * x + y * y),
27
- sinz = -Math.sin(ρ),
28
- cosz = Math.cos(ρ),
29
- a = ρ * cosz,
30
- b = -y * sinz,
31
- c = ρ * sinφ0,
32
- d = asqrt(a * a + b * b - c * c),
33
- φ = Math.atan2(a * c + b * d, b * c - a * d),
34
- λ = (ρ > π / 2 ? -1 : 1) * Math.atan2(x * sinz, ρ * Math.cos(φ) * cosz + y * Math.sin(φ) * sinz);
35
- return rotate.invert(λ, φ);
36
- };
37
-
38
- return forward;
39
- }
40
-
41
- // Latitudinal rotation by φ0.
42
- // Temporary hack until D3 supports arbitrary small-circle clipping origins.
43
- function hammerRetroazimuthalRotation(φ0) {
44
- var sinφ0 = Math.sin(φ0),
45
- cosφ0 = Math.cos(φ0);
46
-
47
- return function(λ, φ) {
48
- var cosφ = Math.cos(φ),
49
- x = Math.cos(λ) * cosφ,
50
- y = Math.sin(λ) * cosφ,
51
- z = Math.sin(φ);
52
- return [
53
- Math.atan2(y, x * cosφ0 - z * sinφ0),
54
- asin(z * cosφ0 + x * sinφ0)
55
- ];
56
- };
57
- }
58
-
59
- function hammerRetroazimuthalProjection() {
60
- var φ0 = 0,
61
- m = projectionMutator(hammerRetroazimuthal),
62
- p = m(φ0),
63
- rotate_ = p.rotate,
64
- stream_ = p.stream,
65
- circle = d3.geo.circle();
66
-
67
- p.parallel = function(_) {
68
- if (!arguments.length) return φ0 / π * 180;
69
- var r = p.rotate();
70
- return m(φ0 = _ * π / 180).rotate(r);
71
- };
72
-
73
- // Temporary hack; see hammerRetroazimuthalRotation.
74
- p.rotate = function(_) {
75
- if (!arguments.length) return (_ = rotate_.call(p), _[1] += φ0 / π * 180, _);
76
- rotate_.call(p, [_[0], _[1] - φ0 / π * 180]);
77
- circle.origin([-_[0], -_[1]]);
78
- return p;
79
- };
80
-
81
- p.stream = function(stream) {
82
- stream = stream_(stream);
83
- stream.sphere = function() {
84
- stream.polygonStart();
85
- var ε = 1e-2,
86
- ring = circle.angle(90 - ε)().coordinates[0],
87
- n = ring.length - 1,
88
- i = -1,
89
- p;
90
- stream.lineStart();
91
- while (++i < n) stream.point((p = ring[i])[0], p[1]);
92
- stream.lineEnd();
93
- ring = circle.angle(90 + ε)().coordinates[0];
94
- n = ring.length - 1;
95
- stream.lineStart();
96
- while (--i >= 0) stream.point((p = ring[i])[0], p[1]);
97
- stream.lineEnd();
98
- stream.polygonEnd();
99
- };
100
- return stream;
101
- };
102
-
103
- return p;
104
- }
105
-
106
- (d3.geo.hammerRetroazimuthal = hammerRetroazimuthalProjection).raw = hammerRetroazimuthal;
@@ -1,53 +0,0 @@
1
- import "projection";
2
-
3
- var hammerAzimuthalEqualArea = d3.geo.azimuthalEqualArea.raw;
4
-
5
- function hammer(A, B) {
6
- if (arguments.length < 2) B = A;
7
- if (B === 1) return hammerAzimuthalEqualArea;
8
- if (B === Infinity) return hammerQuarticAuthalic;
9
-
10
- function forward(λ, φ) {
11
- var coordinates = hammerAzimuthalEqualArea(λ / B, φ);
12
- coordinates[0] *= A;
13
- return coordinates;
14
- }
15
-
16
- forward.invert = function(x, y) {
17
- var coordinates = hammerAzimuthalEqualArea.invert(x / A, y);
18
- coordinates[0] *= B;
19
- return coordinates;
20
- };
21
-
22
- return forward;
23
- }
24
-
25
- function hammerProjection() {
26
- var B = 2,
27
- m = projectionMutator(hammer),
28
- p = m(B);
29
-
30
- p.coefficient = function(_) {
31
- if (!arguments.length) return B;
32
- return m(B = +_);
33
- };
34
-
35
- return p;
36
- }
37
-
38
- function hammerQuarticAuthalic(λ, φ) {
39
- return [
40
- λ * Math.cos(φ) / Math.cos(φ /= 2),
41
- 2 * Math.sin(φ)
42
- ];
43
- }
44
-
45
- hammerQuarticAuthalic.invert = function(x, y) {
46
- var φ = 2 * asin(y / 2);
47
- return [
48
- x * Math.cos(φ / 2) / Math.cos(φ),
49
- φ
50
- ];
51
- };
52
-
53
- (d3.geo.hammer = hammerProjection).raw = hammer;
@@ -1,27 +0,0 @@
1
- import "projection";
2
-
3
- function hatano(λ, φ) {
4
- var c = Math.sin(φ) * (φ < 0 ? 2.43763 : 2.67595);
5
- for (var i = 0, δ; i < 20; i++) {
6
- φ -= δ = (φ + Math.sin(φ) - c) / (1 + Math.cos(φ));
7
- if (Math.abs(δ) < ε) break;
8
- }
9
- return [
10
- .85 * λ * Math.cos(φ *= .5),
11
- Math.sin(φ) * (φ < 0 ? 1.93052 : 1.75859)
12
- ];
13
- }
14
-
15
- hatano.invert = function(x, y) {
16
- var θ = Math.abs(θ = y * (y < 0 ? .51799515156538134803 : .56863737426006061674)) > 1 - ε
17
- ? θ > 0 ? π / 2 : -π / 2
18
- : asin(θ);
19
- return [
20
- 1.17647058823529411764 * x / Math.cos(θ),
21
- Math.abs(θ = ((θ += θ) + Math.sin(θ)) * (y < 0 ? .41023453108141924738 : .37369906014686373063)) > 1 - ε
22
- ? θ > 0 ? π / 2 : -π / 2
23
- : asin(θ)
24
- ];
25
- };
26
-
27
- (d3.geo.hatano = function() { return projection(hatano); }).raw = hatano;
@@ -1,85 +0,0 @@
1
- import "projection";
2
- import "collignon";
3
- import "cylindrical-equal-area";
4
-
5
- var healpixParallel = 41 + 48 / 36 + 37 / 3600; // TODO automate
6
-
7
- function healpix(h) {
8
- var lambert = d3.geo.cylindricalEqualArea.raw(0),
9
- φ0 = healpixParallel * π / 180,
10
- dx0 = 2 * π,
11
- dx1 = d3.geo.collignon.raw(π, φ0)[0] - d3.geo.collignon.raw(-π, φ0)[0],
12
- y0 = lambert(0, φ0)[1],
13
- y1 = d3.geo.collignon.raw(0, φ0)[1],
14
- dy1 = d3.geo.collignon.raw(0, π / 2)[1] - y1,
15
- k = 2 * π / h;
16
-
17
- function forward(λ, φ) {
18
- var point,
19
- φ2 = Math.abs(φ);
20
- if (φ2 > φ0) {
21
- var i = Math.min(h - 1, Math.max(0, Math.floor((λ + π) / k)));
22
- λ += π * (h - 1) / h - i * k;
23
- point = d3.geo.collignon.raw(λ, φ2);
24
- point[0] = point[0] * dx0 / dx1 - dx0 * (h - 1) / (2 * h) + i * dx0 / h;
25
- point[1] = y0 + (point[1] - y1) * 4 * dy1 / dx0;
26
- if (φ < 0) point[1] = -point[1];
27
- } else {
28
- point = lambert(λ, φ);
29
- }
30
- point[0] /= 2;
31
- return point;
32
- }
33
-
34
- forward.invert = function(x, y) {
35
- x *= 2;
36
- var y2 = Math.abs(y);
37
- if (y2 > y0) {
38
- var i = Math.min(h - 1, Math.max(0, Math.floor((x + π) / k)));
39
- x = (x + π * (h - 1) / h - i * k) * dx1 / dx0;
40
- var point = d3.geo.collignon.raw.invert(x, .25 * (y2 - y0) * dx0 / dy1 + y1);
41
- point[0] -= π * (h - 1) / h - i * k;
42
- if (y < 0) point[1] = -point[1];
43
- return point;
44
- }
45
- return lambert.invert(x, y);
46
- };
47
-
48
- return forward;
49
- }
50
-
51
- function healpixProjection() {
52
- var n = 2,
53
- m = projectionMutator(healpix),
54
- p = m(n),
55
- stream_ = p.stream;
56
-
57
- p.lobes = function(_) {
58
- if (!arguments.length) return n;
59
- return m(n = +_);
60
- };
61
-
62
- p.stream = function(stream) {
63
- var rotate = p.rotate(),
64
- rotateStream = stream_(stream),
65
- sphereStream = (p.rotate([0, 0]), stream_(stream));
66
- p.rotate(rotate);
67
- rotateStream.sphere = function() { d3.geo.stream(sphere(), sphereStream); };
68
- return rotateStream;
69
- };
70
-
71
- function sphere() {
72
- var step = 180 / n;
73
- return {
74
- type: "Polygon",
75
- coordinates: [
76
- d3.range(-180, 180 + step / 2, step).map(function(x, i) { return [x, i & 1 ? 90 - 1e-6 : healpixParallel]; })
77
- .concat(d3.range(180, -180 - step / 2, -step).map(function(x, i) { return [x, i & 1 ? -90 + 1e-6 : -healpixParallel]; }))
78
- ]
79
- };
80
- }
81
-
82
- return p;
83
- }
84
-
85
- (d3.geo.healpix = healpixProjection).raw = healpix;
@@ -1,66 +0,0 @@
1
- import "projection";
2
-
3
- function hill(K) {
4
- var L = 1 + K,
5
- sinβ = Math.sin(1 / L),
6
- β = asin(sinβ),
7
- A = 2 * Math.sqrt(π / (B = π + 4 * β * L)),
8
- B,
9
- ρ0 = .5 * A * (L + Math.sqrt(K * (2 + K))),
10
- K2 = K * K,
11
- L2 = L * L;
12
-
13
- function forward(λ, φ) {
14
- var t = 1 - Math.sin(φ),
15
- ρ,
16
- ω;
17
- if (t && t < 2) {
18
- var θ = π / 2 - φ, i = 25, δ;
19
- do {
20
- var sinθ = Math.sin(θ),
21
- cosθ = Math.cos(θ),
22
- β_β1 = β + Math.atan2(sinθ, L - cosθ),
23
- C = 1 + L2 - 2 * L * cosθ;
24
- θ -= δ = (θ - K2 * β - L * sinθ + C * β_β1 - .5 * t * B) / (2 * L * sinθ * β_β1);
25
- } while (Math.abs(δ) > ε2 && --i > 0);
26
- ρ = A * Math.sqrt(C);
27
- ω = λ * β_β1 / π;
28
- } else {
29
- ρ = A * (K + t);
30
- ω = λ * β / π;
31
- }
32
- return [
33
- ρ * Math.sin(ω),
34
- ρ0 - ρ * Math.cos(ω)
35
- ];
36
- };
37
-
38
- forward.invert = function(x, y) {
39
- var ρ2 = x * x + (y -= ρ0) * y,
40
- cosθ = (1 + L2 - ρ2 / (A * A)) / (2 * L),
41
- θ = acos(cosθ),
42
- sinθ = Math.sin(θ),
43
- β_β1 = β + Math.atan2(sinθ, L - cosθ);
44
- return [
45
- asin(x / Math.sqrt(ρ2)) * π / β_β1,
46
- asin(1 - 2 * (θ - K2 * β - L * sinθ + (1 + L2 - 2 * L * cosθ) * β_β1) / B)
47
- ];
48
- };
49
-
50
- return forward;
51
- }
52
-
53
- function hillProjection() {
54
- var K = 1,
55
- m = projectionMutator(hill),
56
- p = m(K);
57
-
58
- p.ratio = function(_) {
59
- if (!arguments.length) return K;
60
- return m(K = +_);
61
- };
62
-
63
- return p;
64
- }
65
-
66
- (d3.geo.hill = hillProjection).raw = hill;
@@ -1,18 +0,0 @@
1
- import "projection";
2
- import "mollweide";
3
- import "sinusoidal";
4
- import "sinu-mollweide";
5
-
6
- function homolosine(λ, φ) {
7
- return Math.abs(φ) > sinuMollweideφ
8
- ? (λ = mollweide(λ, φ), λ[1] -= φ > 0 ? sinuMollweideY : -sinuMollweideY, λ)
9
- : sinusoidal(λ, φ);
10
- }
11
-
12
- homolosine.invert = function(x, y) {
13
- return Math.abs(y) > sinuMollweideφ
14
- ? mollweide.invert(x, y + (y > 0 ? sinuMollweideY : -sinuMollweideY))
15
- : sinusoidal.invert(x, y);
16
- };
17
-
18
- (d3.geo.homolosine = function() { return projection(homolosine); }).raw = homolosine;
@@ -1,22 +0,0 @@
1
- import "math";
2
-
3
- function tanh(x) {
4
- x = Math.exp(2 * x);
5
- return (x - 1) / (x + 1);
6
- }
7
-
8
- function sinh(x) {
9
- return .5 * (Math.exp(x) - Math.exp(-x));
10
- }
11
-
12
- function cosh(x) {
13
- return .5 * (Math.exp(x) + Math.exp(-x));
14
- }
15
-
16
- function arsinh(x) {
17
- return Math.log(x + asqrt(x * x + 1));
18
- }
19
-
20
- function arcosh(x) {
21
- return Math.log(x + asqrt(x * x - 1));
22
- }
@@ -1,72 +0,0 @@
1
- import "start";
2
- import "interrupt";
3
- import "airy";
4
- import "aitoff";
5
- import "armadillo";
6
- import "august";
7
- import "baker";
8
- import "berghaus";
9
- import "boggs";
10
- import "bonne";
11
- import "bromley";
12
- import "chamberlin";
13
- import "collignon";
14
- import "craig";
15
- import "craster";
16
- import "cylindrical-equal-area";
17
- import "eckert1";
18
- import "eckert2";
19
- import "eckert3";
20
- import "eckert4";
21
- import "eckert5";
22
- import "eckert6";
23
- import "eisenlohr";
24
- import "fahey";
25
- import "gall-stereographic";
26
- import "ginzburg4";
27
- import "ginzburg5";
28
- import "ginzburg6";
29
- import "ginzburg8";
30
- import "ginzburg9";
31
- import "gringorten";
32
- import "guyou";
33
- import "hammer-retroazimuthal";
34
- import "hammer";
35
- import "hatano";
36
- import "healpix";
37
- import "hill";
38
- import "homolosine";
39
- import "kavrayskiy7";
40
- import "lagrange";
41
- import "larrivee";
42
- import "laskowski";
43
- import "littrow";
44
- import "loximuthal";
45
- import "miller";
46
- import "modified-stereographic";
47
- import "mollweide";
48
- import "mt-flat-polar-parabolic";
49
- import "mt-flat-polar-quartic";
50
- import "mt-flat-polar-sinusoidal";
51
- import "natural-earth";
52
- import "nell-hammer";
53
- import "peirce-quincuncial";
54
- import "polyconic";
55
- import "rectangular-polyconic";
56
- import "robinson";
57
- import "satellite";
58
- import "sinusoidal";
59
- import "sinu-mollweide";
60
- import "times";
61
- import "two-point-azimuthal";
62
- import "two-point-equidistant";
63
- import "van-der-grinten";
64
- import "van-der-grinten2";
65
- import "van-der-grinten3";
66
- import "van-der-grinten4";
67
- import "wagner4";
68
- import "wagner6";
69
- import "wagner7";
70
- import "wiechel";
71
- import "winkel3";
72
- import "end";