d3js-plugins-rails 0.0.6 → 0.0.7

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.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/d3js-plugins-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/d3/plugins/bullet/README.md +2 -2
  5. data/vendor/assets/javascripts/d3/plugins/bullet/bullet.js +52 -118
  6. data/vendor/assets/javascripts/d3/plugins/geo/projection/README.md +132 -0
  7. data/vendor/assets/javascripts/d3/plugins/geo/projection/eckert4.js +3 -3
  8. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg-polyconic.js +56 -0
  9. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg4.js +6 -0
  10. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg5.js +6 -0
  11. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg6.js +6 -0
  12. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg8.js +29 -0
  13. data/vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg9.js +6 -0
  14. data/vendor/assets/javascripts/d3/plugins/geo/projection/index.js +5 -0
  15. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/eckert4-test.js +26 -0
  16. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg4-test.js +28 -0
  17. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg5-test.js +28 -0
  18. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg6-test.js +28 -0
  19. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg8-test.js +28 -0
  20. data/vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg9-test.js +28 -0
  21. data.tar.gz.sig +0 -0
  22. metadata +14 -4
  23. metadata.gz.sig +0 -0
  24. data/vendor/assets/javascripts/d3/plugins/cie/README.md +0 -54
  25. data/vendor/assets/javascripts/d3/plugins/cie/cie.js +0 -155
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e01f5b6f83287492b9f81ae4857a2f30fffff20e
4
- data.tar.gz: c5bd529307c3c163f761097655e900c2e6f1cb66
3
+ metadata.gz: 69ce2ceee6f36bb08fb9ee50ff607b0389f9bb8b
4
+ data.tar.gz: 7dbb0681c618b08cf6c40d413ac3dec963ccc97a
5
5
  SHA512:
6
- metadata.gz: 8a7b3894a68fc08512e09a59671eb33bfb000e95c1b8ef14be165544f02b5d5b41756def0f3756e42ac6122166207bc0a6faca9a3aa04dfae442caf6e94889c0
7
- data.tar.gz: 393da2cb39599c594090a70320ece141421fc25b9bdcd9d5347f7f913e55d0d828fc326d2830391058d578a9e6670aa308f888f4cc016307f9577375007670e9
6
+ metadata.gz: eea205d85230dfe7b1a396eb38f29e86d179ea5e8f4a70cac34f3dd26466c2938ee21625c9862dea4a5bb6514a7a961a7429aa2e05e37364cc1799f6c86448ec
7
+ data.tar.gz: 410a1942fd9aff1a1229cd2f1becec315eb4b8d9d4a6f75753418dbb7a1212987b809a0d85edcec6d36a749196ce82a0cfc09d6c3037ccc2060f10df5cd5ed3f
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  module D3js
2
2
  module Plugins
3
3
  module Rails
4
- VERSION = "0.0.6"
4
+ VERSION = "0.0.7"
5
5
  D3_PLUGINS_VERSION = "37388598a7fd9865f6ffddeefcad16a5d039b4bb"
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  # Bullet Chart
2
2
 
3
- Demo: http://bl.ocks.org/4061961
3
+ [Demo](http://bl.ocks.org/mbostock/4061961) and [vertical version](http://bl.ocks.org/jasondavies/5452290).
4
4
 
5
5
  Designed by Stephen Few, a bullet chart “provides a rich display of data in a
6
6
  small space.” A variation on a bar chart, bullet charts compare a given
@@ -11,4 +11,4 @@ year ago). Layout inspired by
11
11
  Implementation based on work by
12
12
  [Clint Ivy](http://projects.instantcognition.com/protovis/bulletchart/),
13
13
  Jamie Love of [N-Squared Software](http://www.nsquaredsoftware.com/) and
14
- [Jason Davies](http://www.jasondavies.com/).
14
+ [Jason Davies](http://www.jasondavies.com/).
@@ -4,15 +4,15 @@
4
4
  // based on the work of Clint Ivy, Jamie Love, and Jason Davies.
5
5
  // http://projects.instantcognition.com/protovis/bulletchart/
6
6
  d3.bullet = function() {
7
- var orient = "left", // TODO top & bottom
7
+ var orient = "left",
8
8
  reverse = false,
9
- duration = 0,
9
+ vertical = false,
10
10
  ranges = bulletRanges,
11
11
  markers = bulletMarkers,
12
12
  measures = bulletMeasures,
13
13
  width = 380,
14
14
  height = 30,
15
- tickFormat = null;
15
+ xAxis = d3.svg.axis();
16
16
 
17
17
  // For each small multiple…
18
18
  function bullet(g) {
@@ -20,12 +20,25 @@ d3.bullet = function() {
20
20
  var rangez = ranges.call(this, d, i).slice().sort(d3.descending),
21
21
  markerz = markers.call(this, d, i).slice().sort(d3.descending),
22
22
  measurez = measures.call(this, d, i).slice().sort(d3.descending),
23
- g = d3.select(this);
23
+ g = d3.select(this),
24
+ extentX,
25
+ extentY;
26
+
27
+ var wrap = g.select("g.wrap");
28
+ if (wrap.empty()) wrap = g.append("g").attr("class", "wrap");
29
+
30
+ if (vertical) {
31
+ extentX = height, extentY = width;
32
+ wrap.attr("transform", "rotate(90)translate(0," + -width + ")");
33
+ } else {
34
+ extentX = width, extentY = height;
35
+ wrap.attr("transform", "translate(0)");
36
+ }
24
37
 
25
38
  // Compute the new x-scale.
26
39
  var x1 = d3.scale.linear()
27
40
  .domain([0, Math.max(rangez[0], markerz[0], measurez[0])])
28
- .range(reverse ? [width, 0] : [0, width]);
41
+ .range(reverse ? [extentX, 0] : [0, extentX]);
29
42
 
30
43
  // Retrieve the old x-scale, if this is an update.
31
44
  var x0 = this.__chart__ || d3.scale.linear()
@@ -40,177 +53,104 @@ d3.bullet = function() {
40
53
  w1 = bulletWidth(x1);
41
54
 
42
55
  // Update the range rects.
43
- var range = g.selectAll("rect.range")
56
+ var range = wrap.selectAll("rect.range")
44
57
  .data(rangez);
45
58
 
46
59
  range.enter().append("rect")
47
60
  .attr("class", function(d, i) { return "range s" + i; })
48
61
  .attr("width", w0)
49
- .attr("height", height)
62
+ .attr("height", extentY)
50
63
  .attr("x", reverse ? x0 : 0)
51
- .transition()
52
- .duration(duration)
53
- .attr("width", w1)
54
- .attr("x", reverse ? x1 : 0);
55
64
 
56
- range.transition()
57
- .duration(duration)
65
+ d3.transition(range)
58
66
  .attr("x", reverse ? x1 : 0)
59
67
  .attr("width", w1)
60
- .attr("height", height);
68
+ .attr("height", extentY);
61
69
 
62
70
  // Update the measure rects.
63
- var measure = g.selectAll("rect.measure")
71
+ var measure = wrap.selectAll("rect.measure")
64
72
  .data(measurez);
65
73
 
66
74
  measure.enter().append("rect")
67
75
  .attr("class", function(d, i) { return "measure s" + i; })
68
76
  .attr("width", w0)
69
- .attr("height", height / 3)
77
+ .attr("height", extentY / 3)
70
78
  .attr("x", reverse ? x0 : 0)
71
- .attr("y", height / 3)
72
- .transition()
73
- .duration(duration)
74
- .attr("width", w1)
75
- .attr("x", reverse ? x1 : 0);
79
+ .attr("y", extentY / 3);
76
80
 
77
- measure.transition()
78
- .duration(duration)
81
+ d3.transition(measure)
79
82
  .attr("width", w1)
80
- .attr("height", height / 3)
83
+ .attr("height", extentY / 3)
81
84
  .attr("x", reverse ? x1 : 0)
82
- .attr("y", height / 3);
85
+ .attr("y", extentY / 3);
83
86
 
84
87
  // Update the marker lines.
85
- var marker = g.selectAll("line.marker")
88
+ var marker = wrap.selectAll("line.marker")
86
89
  .data(markerz);
87
90
 
88
91
  marker.enter().append("line")
89
92
  .attr("class", "marker")
90
93
  .attr("x1", x0)
91
94
  .attr("x2", x0)
92
- .attr("y1", height / 6)
93
- .attr("y2", height * 5 / 6)
94
- .transition()
95
- .duration(duration)
96
- .attr("x1", x1)
97
- .attr("x2", x1);
95
+ .attr("y1", extentY / 6)
96
+ .attr("y2", extentY * 5 / 6);
98
97
 
99
- marker.transition()
100
- .duration(duration)
98
+ d3.transition(marker)
101
99
  .attr("x1", x1)
102
100
  .attr("x2", x1)
103
- .attr("y1", height / 6)
104
- .attr("y2", height * 5 / 6);
105
-
106
- // Compute the tick format.
107
- var format = tickFormat || x1.tickFormat(8);
108
-
109
- // Update the tick groups.
110
- var tick = g.selectAll("g.tick")
111
- .data(x1.ticks(8), function(d) {
112
- return this.textContent || format(d);
113
- });
114
-
115
- // Initialize the ticks with the old scale, x0.
116
- var tickEnter = tick.enter().append("g")
117
- .attr("class", "tick")
118
- .attr("transform", bulletTranslate(x0))
119
- .style("opacity", 1e-6);
120
-
121
- tickEnter.append("line")
122
- .attr("y1", height)
123
- .attr("y2", height * 7 / 6);
124
-
125
- tickEnter.append("text")
126
- .attr("text-anchor", "middle")
127
- .attr("dy", "1em")
128
- .attr("y", height * 7 / 6)
129
- .text(format);
130
-
131
- // Transition the entering ticks to the new scale, x1.
132
- tickEnter.transition()
133
- .duration(duration)
134
- .attr("transform", bulletTranslate(x1))
135
- .style("opacity", 1);
136
-
137
- // Transition the updating ticks to the new scale, x1.
138
- var tickUpdate = tick.transition()
139
- .duration(duration)
140
- .attr("transform", bulletTranslate(x1))
141
- .style("opacity", 1);
142
-
143
- tickUpdate.select("line")
144
- .attr("y1", height)
145
- .attr("y2", height * 7 / 6);
146
-
147
- tickUpdate.select("text")
148
- .attr("y", height * 7 / 6);
149
-
150
- // Transition the exiting ticks to the new scale, x1.
151
- tick.exit().transition()
152
- .duration(duration)
153
- .attr("transform", bulletTranslate(x1))
154
- .style("opacity", 1e-6)
155
- .remove();
101
+ .attr("y1", extentY / 6)
102
+ .attr("y2", extentY * 5 / 6);
103
+
104
+ var axis = g.selectAll("g.axis").data([0]);
105
+ axis.enter().append("g").attr("class", "axis");
106
+ axis.call(xAxis.scale(x1));
156
107
  });
157
108
  d3.timer.flush();
158
109
  }
159
110
 
160
111
  // left, right, top, bottom
161
- bullet.orient = function(x) {
112
+ bullet.orient = function(_) {
162
113
  if (!arguments.length) return orient;
163
- orient = x;
114
+ orient = _ + "";
164
115
  reverse = orient == "right" || orient == "bottom";
116
+ xAxis.orient((vertical = orient == "top" || orient == "bottom") ? "left" : "bottom");
165
117
  return bullet;
166
118
  };
167
119
 
168
120
  // ranges (bad, satisfactory, good)
169
- bullet.ranges = function(x) {
121
+ bullet.ranges = function(_) {
170
122
  if (!arguments.length) return ranges;
171
- ranges = x;
123
+ ranges = _;
172
124
  return bullet;
173
125
  };
174
126
 
175
127
  // markers (previous, goal)
176
- bullet.markers = function(x) {
128
+ bullet.markers = function(_) {
177
129
  if (!arguments.length) return markers;
178
- markers = x;
130
+ markers = _;
179
131
  return bullet;
180
132
  };
181
133
 
182
134
  // measures (actual, forecast)
183
- bullet.measures = function(x) {
135
+ bullet.measures = function(_) {
184
136
  if (!arguments.length) return measures;
185
- measures = x;
137
+ measures = _;
186
138
  return bullet;
187
139
  };
188
140
 
189
- bullet.width = function(x) {
141
+ bullet.width = function(_) {
190
142
  if (!arguments.length) return width;
191
- width = x;
143
+ width = +_;
192
144
  return bullet;
193
145
  };
194
146
 
195
- bullet.height = function(x) {
147
+ bullet.height = function(_) {
196
148
  if (!arguments.length) return height;
197
- height = x;
198
- return bullet;
199
- };
200
-
201
- bullet.tickFormat = function(x) {
202
- if (!arguments.length) return tickFormat;
203
- tickFormat = x;
204
- return bullet;
205
- };
206
-
207
- bullet.duration = function(x) {
208
- if (!arguments.length) return duration;
209
- duration = x;
149
+ height = +_;
210
150
  return bullet;
211
151
  };
212
152
 
213
- return bullet;
153
+ return d3.rebind(bullet, xAxis, "tickFormat");
214
154
  };
215
155
 
216
156
  function bulletRanges(d) {
@@ -225,12 +165,6 @@ function bulletMeasures(d) {
225
165
  return d.measures;
226
166
  }
227
167
 
228
- function bulletTranslate(x) {
229
- return function(d) {
230
- return "translate(" + x(d) + ",0)";
231
- };
232
- }
233
-
234
168
  function bulletWidth(x) {
235
169
  var x0 = x(0);
236
170
  return function(d) {
@@ -1,5 +1,132 @@
1
1
  # Extended Geographic Projections
2
2
 
3
+
4
+ <table class="highlight">
5
+ <tr height="146" valign="top">
6
+ <td>d3.geo.aitoff<br><a href="http://bl.ocks.org/3682698"><img src="https://raw.github.com/gist/3682698/thumbnail.png" width="202"></a></td>
7
+ <td class="gi">d3.geo.albers *<br><a href="http://bl.ocks.org/3734308"><img src="https://raw.github.com/gist/3734308/thumbnail.png" width="202"></a></td>
8
+ <td class="gi">d3.geo.albersUsa *<br><a href="http://bl.ocks.org/4090848"><img src="https://raw.github.com/gist/4090848/thumbnail.png" width="202"></a></td>
9
+ <td>d3.geo.armadillo<br><a href="http://bl.ocks.org/4463127"><img src="https://raw.github.com/gist/4463127/thumbnail.png" width="202"></a></td>
10
+ </tr>
11
+ <tr height="146" valign="top">
12
+ <td>d3.geo.august<br><a href="http://bl.ocks.org/3797581"><img src="https://raw.github.com/gist/3797581/thumbnail.png" width="202"></a></td>
13
+ <td class="gi">d3.geo.azimuthalEqualArea *<br><a href="http://bl.ocks.org/3757101"><img src="https://raw.github.com/gist/3757101/thumbnail.png" width="202"></a></td>
14
+ <td class="gi">d3.geo.azimuthalEquidistant *<br><a href="http://bl.ocks.org/3757110"><img src="https://raw.github.com/gist/3757110/thumbnail.png" width="202"></a></td>
15
+ <td>d3.geo.baker<br><a href="http://bl.ocks.org/4476279"><img src="https://raw.github.com/gist/4476279/thumbnail.png" width="202"></a></td>
16
+ </tr>
17
+ <tr height="146" valign="top">
18
+ <td>d3.geo.berghaus<br><a href="http://bl.ocks.org/4463049"><img src="https://raw.github.com/gist/4463049/thumbnail.png" width="202"></a></td>
19
+ <td>d3.geo.boggs<br><a href="http://bl.ocks.org/4481220"><img src="https://raw.github.com/gist/4481220/thumbnail.png" width="202"></a></td>
20
+ <td>d3.geo.bonne<br><a href="http://bl.ocks.org/3734313"><img src="https://raw.github.com/gist/3734313/thumbnail.png" width="202"></a></td>
21
+ <td>d3.geo.bromley<br><a href="http://bl.ocks.org/4487695"><img src="https://raw.github.com/gist/4487695/thumbnail.png" width="202"></a></td>
22
+ </tr>
23
+ <tr height="146" valign="top">
24
+ <td>d3.geo.collignon<br><a href="http://bl.ocks.org/3734316"><img src="https://raw.github.com/gist/3734316/thumbnail.png" width="202"></a></td>
25
+ <td class="gi">d3.geo.conicEqualArea *<br><a href="http://bl.ocks.org/3734308"><img src="https://raw.github.com/gist/3734308/thumbnail.png" width="202"></a></td>
26
+ <td class="gi">d3.geo.conicConformal *<br><a href="http://bl.ocks.org/3734321"><img src="https://raw.github.com/gist/3734321/thumbnail.png" width="202"></a></td>
27
+ <td class="gi">d3.geo.conicEquidistant *<br><a href="http://bl.ocks.org/3734317"><img src="https://raw.github.com/gist/3734317/thumbnail.png" width="202"></a></td>
28
+ </tr>
29
+ <tr height="146" valign="top">
30
+ <td>d3.geo.craig<br><a href="http://bl.ocks.org/4459466"><img src="https://raw.github.com/gist/4459466/thumbnail.png" width="202"></a></td>
31
+ <td>d3.geo.craster<br><a href="http://bl.ocks.org/4465118"><img src="https://raw.github.com/gist/4465118/thumbnail.png" width="202"></a></td>
32
+ <td>d3.geo.cylindricalEqualArea<br><a href="http://bl.ocks.org/3712408"><img src="https://raw.github.com/gist/3712408/thumbnail.png" width="202"></a></td>
33
+ <td>d3.geo.eckert1<br><a href="http://bl.ocks.org/3734322"><img src="https://raw.github.com/gist/3734322/thumbnail.png" width="202"></a></td>
34
+ </tr>
35
+ <tr height="146" valign="top">
36
+ <td>d3.geo.eckert2<br><a href="http://bl.ocks.org/3734324"><img src="https://raw.github.com/gist/3734324/thumbnail.png" width="202"></a></td>
37
+ <td>d3.geo.eckert3<br><a href="http://bl.ocks.org/3734325"><img src="https://raw.github.com/gist/3734325/thumbnail.png" width="202"></a></td>
38
+ <td>d3.geo.eckert4<br><a href="http://bl.ocks.org/3734327"><img src="https://raw.github.com/gist/3734327/thumbnail.png" width="202"></a></td>
39
+ <td>d3.geo.eckert5<br><a href="http://bl.ocks.org/3734328"><img src="https://raw.github.com/gist/3734328/thumbnail.png" width="202"></a></td>
40
+ </tr>
41
+ <tr height="146" valign="top">
42
+ <td>d3.geo.eckert6<br><a href="http://bl.ocks.org/3734329"><img src="https://raw.github.com/gist/3734329/thumbnail.png" width="202"></a></td>
43
+ <td>d3.geo.eisenlohr<br><a href="http://bl.ocks.org/3797585"><img src="https://raw.github.com/gist/3797585/thumbnail.png" width="202"></a></td>
44
+ <td class="gi">d3.geo.equirectangular *<br><a href="http://bl.ocks.org/3757119"><img src="https://raw.github.com/gist/3757119/thumbnail.png" width="202"></a></td>
45
+ <td>d3.geo.fahey<br><a href="http://bl.ocks.org/4731228"><img src="https://raw.github.com/gist/4731228/thumbnail.png" width="202"></a></td>
46
+ </tr>
47
+ <tr height="146" valign="top">
48
+ <td>d3.geo.gallStereographic<br><a href="http://bl.ocks.org/5234763"><img src="https://raw.github.com/gist/5234763/thumbnail.png" width="202"></a></td>
49
+ <td>d3.geo.ginzburg4<br><a href="http://bl.ocks.org/5288565"><img src="https://raw.github.com/gist/5288565/thumbnail.png" width="202"></a></td>
50
+ <td>d3.geo.ginzburg5<br><a href="http://bl.ocks.org/5288571"><img src="https://raw.github.com/gist/5288571/thumbnail.png" width="202"></a></td>
51
+ <td>d3.geo.ginzburg6<br><a href="http://bl.ocks.org/5288577"><img src="https://raw.github.com/gist/5288577/thumbnail.png" width="202"></a></td>
52
+ </tr>
53
+ <tr height="146" valign="top">
54
+ <td>d3.geo.ginzburg8<br><a href="http://bl.ocks.org/5288583"><img src="https://raw.github.com/gist/5288583/thumbnail.png" width="202"></a></td>
55
+ <td>d3.geo.ginzburg9<br><a href="http://bl.ocks.org/5288590"><img src="https://raw.github.com/gist/5288590/thumbnail.png" width="202"></a></td>
56
+ <td class="gi">d3.geo.gnomonic *<br><a href="http://bl.ocks.org/3757349"><img src="https://raw.github.com/gist/3757349/thumbnail.png" width="202"></a></td>
57
+ <td>d3.geo.gringorten<br><a href="http://bl.ocks.org/4362031"><img src="https://raw.github.com/gist/4362031/thumbnail.png" width="202"></a></td>
58
+ </tr>
59
+ <tr height="146" valign="top">
60
+ <td>d3.geo.guyou<br><a href="http://bl.ocks.org/3763867"><img src="https://raw.github.com/gist/3763867/thumbnail.png" width="202"></a></td>
61
+ <td>d3.geo.hammer<br><a href="http://bl.ocks.org/3712397"><img src="https://raw.github.com/gist/3712397/thumbnail.png" width="202"></a></td>
62
+ <td>d3.geo.hammerRetroazimuthal<br><a href="http://bl.ocks.org/4459130"><img src="https://raw.github.com/gist/4459130/thumbnail.png" width="202"></a></td>
63
+ <td>d3.geo.healpix<br><a href="http://bl.ocks.org/4463237"><img src="https://raw.github.com/gist/4463237/thumbnail.png" width="202"></a></td>
64
+ </tr>
65
+ <tr height="146" valign="top">
66
+ <td>d3.geo.hill<br><a href="http://bl.ocks.org/4479513"><img src="https://raw.github.com/gist/4479513/thumbnail.png" width="202"></a></td>
67
+ <td>d3.geo.homolosine<br><a href="http://bl.ocks.org/3734330"><img src="https://raw.github.com/gist/3734330/thumbnail.png" width="202"></a></td>
68
+ <td>d3.geo.kavrayskiy7<br><a href="http://bl.ocks.org/3710082"><img src="https://raw.github.com/gist/3710082/thumbnail.png" width="202"></a></td>
69
+ <td>d3.geo.lagrange<br><a href="http://bl.ocks.org/3797591"><img src="https://raw.github.com/gist/3797591/thumbnail.png" width="202"></a></td>
70
+ </tr>
71
+ <tr height="146" valign="top">
72
+ <td>d3.geo.larrivee<br><a href="http://bl.ocks.org/3719042"><img src="https://raw.github.com/gist/3719042/thumbnail.png" width="202"></a></td>
73
+ <td>d3.geo.laskowski<br><a href="http://bl.ocks.org/4489342"><img src="https://raw.github.com/gist/4489342/thumbnail.png" width="202"></a></td>
74
+ <td>d3.geo.littrow<br><a href="http://bl.ocks.org/4459071"><img src="https://raw.github.com/gist/4459071/thumbnail.png" width="202"></a></td>
75
+ <td>d3.geo.loximuthal<br><a href="http://bl.ocks.org/3867220"><img src="https://raw.github.com/gist/3867220/thumbnail.png" width="202"></a></td>
76
+ </tr>
77
+ <tr height="146" valign="top">
78
+ <td class="gi">d3.geo.mercator *<br><a href="http://bl.ocks.org/3757132"><img src="https://raw.github.com/gist/3757132/thumbnail.png" width="202"></a></td>
79
+ <td>d3.geo.miller<br><a href="http://bl.ocks.org/3734333"><img src="https://raw.github.com/gist/3734333/thumbnail.png" width="202"></a></td>
80
+ <td>d3.geo.modifiedStereographic<br><a href="http://www.jasondavies.com/maps/modified-stereographic/"><img src="http://www.jasondavies.com/maps/modified-stereographic/gs50/thumb.d3.png" width="202"></a></td>
81
+ <td>d3.geo.mollweide<br><a href="http://bl.ocks.org/3734336"><img src="https://raw.github.com/gist/3734336/thumbnail.png" width="202"></a></td>
82
+ </tr>
83
+ <tr height="146" valign="top">
84
+ <td>d3.geo.mtFlatPolarParabolic<br><a href="http://bl.ocks.org/4465130"><img src="https://raw.github.com/gist/4465130/thumbnail.png" width="202"></a></td>
85
+ <td>d3.geo.mtFlatPolarQuartic<br><a href="http://bl.ocks.org/4465137"><img src="https://raw.github.com/gist/4465137/thumbnail.png" width="202"></a></td>
86
+ <td>d3.geo.mtFlatPolarSinusoidal<br><a href="http://bl.ocks.org/4465140"><img src="https://raw.github.com/gist/4465140/thumbnail.png" width="202"></a></td>
87
+ <td>d3.geo.naturalEarth<br><a href="http://bl.ocks.org/4479477"><img src="https://raw.github.com/gist/4479477/thumbnail.png" width="202"></a></td>
88
+ </tr>
89
+ <tr height="146" valign="top">
90
+ <td>d3.geo.nellHammer<br><a href="http://bl.ocks.org/3734342"><img src="https://raw.github.com/gist/3734342/thumbnail.png" width="202"></a></td>
91
+ <td class="gi">d3.geo.orthographic *<br><a href="http://bl.ocks.org/3757125"><img src="https://raw.github.com/gist/3757125/thumbnail.png" width="202"></a></td>
92
+ <td>d3.geo.peirceQuincuncial<br><a href="http://bl.ocks.org/4310087"><img src="https://raw.github.com/gist/4310087/thumbnail.png" width="202"></a></td>
93
+ <td>d3.geo.polyconic<br><a href="http://bl.ocks.org/3734343"><img src="https://raw.github.com/gist/3734343/thumbnail.png" width="202"></a></td>
94
+ </tr>
95
+ <tr height="146" valign="top">
96
+ <td>d3.geo.polyhedron.butterfly<br><a href="http://bl.ocks.org/4458680"><img src="https://raw.github.com/gist/4458680/thumbnail.png" width="202"></a></td>
97
+ <td>d3.geo.polyhedron.waterman<br><a href="http://bl.ocks.org/4458497"><img src="https://raw.github.com/gist/4458497/thumbnail.png" width="202"></a></td>
98
+ <td>d3.geo.rectangularPolyconic<br><a href="http://bl.ocks.org/5230202"><img src="https://raw.github.com/gist/5230202/thumbnail.png" width="202"></a></td>
99
+ <td>d3.geo.robinson<br><a href="http://bl.ocks.org/3710566"><img src="https://raw.github.com/gist/3710566/thumbnail.png" width="202"></a></td>
100
+ </tr>
101
+ <tr height="146" valign="top">
102
+ <td>d3.geo.satellite<br><a href="http://bl.ocks.org/3790444"><img src="https://raw.github.com/gist/3790444/thumbnail.png" width="202"></a></td>
103
+ <td>d3.geo.sinuMollweide<br><a href="http://bl.ocks.org/4319903"><img src="https://raw.github.com/gist/4319903/thumbnail.png" width="202"></a></td>
104
+ <td>d3.geo.sinusoidal<br><a href="http://bl.ocks.org/3712399"><img src="https://raw.github.com/gist/3712399/thumbnail.png" width="202"></a></td>
105
+ <td class="gi">d3.geo.stereographic *<br><a href="http://bl.ocks.org/3757137"><img src="https://raw.github.com/gist/3757137/thumbnail.png" width="202"></a></td>
106
+ </tr>
107
+ <tr height="146" valign="top">
108
+ <td>d3.geo.times<br><a href="http://bl.ocks.org/5230564"><img src="https://raw.github.com/gist/5230564/thumbnail.png" width="202"></a></td>
109
+ <td>d3.geo.twoPointAzimuthal<br><a href="http://www.jasondavies.com/maps/two-point-azimuthal/"><img src="http://www.jasondavies.com/maps/two-point-azimuthal/thumb.d3.png" width="202"></a></td>
110
+ <td>d3.geo.twoPointEquidistant<br><a href="http://www.jasondavies.com/maps/two-point-equidistant/"><img src="http://www.jasondavies.com/maps/two-point-equidistant/thumb.d3.png" width="202"></a></td>
111
+ <td class="gi">d3.geo.transverseMercator *<br><a href="http://bl.ocks.org/5126418"><img src="https://raw.github.com/gist/5126418/thumbnail.png" width="202"></a></td>
112
+ </tr>
113
+ <tr height="146" valign="top">
114
+ <td>d3.geo.vanDerGrinten<br><a href="http://bl.ocks.org/3796831"><img src="https://raw.github.com/gist/3796831/thumbnail.png" width="202"></a></td>
115
+ <td>d3.geo.vanDerGrinten2<br><a href="http://bl.ocks.org/5230571"><img src="https://raw.github.com/gist/5230571/thumbnail.png" width="202"></a></td>
116
+ <td>d3.geo.vanDerGrinten3<br><a href="http://bl.ocks.org/5230580"><img src="https://raw.github.com/gist/5230580/thumbnail.png" width="202"></a></td>
117
+ <td>d3.geo.vanDerGrinten4<br><a href="http://bl.ocks.org/4489365"><img src="https://raw.github.com/gist/4489365/thumbnail.png" width="202"></a></td>
118
+ </tr>
119
+ <tr height="146" valign="top">
120
+ <td>d3.geo.wagner4<br><a href="http://bl.ocks.org/4487674"><img src="https://raw.github.com/gist/4487674/thumbnail.png" width="202"></a></td>
121
+ <td>d3.geo.wagner6<br><a href="http://bl.ocks.org/3710148"><img src="https://raw.github.com/gist/3710148/thumbnail.png" width="202"></a></td>
122
+ <td>d3.geo.wagner7<br><a href="http://bl.ocks.org/4465109"><img src="https://raw.github.com/gist/4465109/thumbnail.png" width="202"></a></td>
123
+ <td>d3.geo.wiechel<br><a href="http://bl.ocks.org/4463155"><img src="https://raw.github.com/gist/4463155/thumbnail.png" width="202"></a></td>
124
+ </tr>
125
+ <tr height="146" valign="top">
126
+ <td>d3.geo.winkel3<br><a href="http://bl.ocks.org/3682676"><img src="https://raw.github.com/gist/3682676/thumbnail.png" width="202"></a></td>
127
+ </tr>
128
+ </table>
129
+
3
130
  Projections:
4
131
 
5
132
  * d3.geo.aitoff - [Aitoff](http://bl.ocks.org/mbostock/3682698)
@@ -29,6 +156,11 @@ Projections:
29
156
  * d3.geo.equirectangular - [Equirectangular (Plate Carrée)](http://bl.ocks.org/mbostock/3757119)
30
157
  * d3.geo.fahey - [Fahey](http://bl.ocks.org/mbostock/4731228)
31
158
  * d3.geo.gallStereographic - [Gall’s stereographic](http://bl.ocks.org/mbostock/5234763)
159
+ * d3.geo.ginzburg4 - [Ginzburg IV](http://bl.ocks.org/mbostock/5288565)
160
+ * d3.geo.ginzburg5 - [Ginzburg V](http://bl.ocks.org/mbostock/5288571)
161
+ * d3.geo.ginzburg6 - [Ginzburg VI](http://bl.ocks.org/mbostock/5288577)
162
+ * d3.geo.ginzburg8 - [Ginzburg VIII](http://bl.ocks.org/mbostock/5288583)
163
+ * d3.geo.ginzburg9 - [Ginzburg IX](http://bl.ocks.org/mbostock/5288590)
32
164
  * d3.geo.gnomonic - [gnomonic](http://bl.ocks.org/mbostock/3757349)
33
165
  * d3.geo.gringorten - [Gringorten](http://bl.ocks.org/mbostock/4362031)
34
166
  * d3.geo.guyou - [Guyou hemisphere-in-a-square](http://bl.ocks.org/mbostock/3763867)
@@ -14,12 +14,12 @@ function eckert4(λ, φ) {
14
14
  }
15
15
 
16
16
  eckert4.invert = function(x, y) {
17
- var j = 2 * Math.sqrt(π / (4 + π)),
18
- k = asin(y / cy),
17
+ var A = .5 * y * Math.sqrt((4 + π) / π),
18
+ k = asin(A),
19
19
  c = Math.cos(k);
20
20
  return [
21
21
  x / (2 / Math.sqrt(π * (4 + π)) * (1 + c)),
22
- asin((k + y / j * (c + 2)) / (2 + π / 2))
22
+ asin((k + A * (c + 2)) / (2 + π / 2))
23
23
  ];
24
24
  };
25
25
 
@@ -0,0 +1,56 @@
1
+ import "math";
2
+
3
+ function ginzburgPolyconic(a, b, c, d, e, f, g, h) {
4
+ if (arguments.length < 8) h = 0;
5
+
6
+ function forward(λ, φ) {
7
+ if (!φ) return [a * λ / π, 0];
8
+ var φ2 = φ * φ,
9
+ xB = a + φ2 * (b + φ2 * (c + φ2 * d)),
10
+ yB = φ * (e - 1 + φ2 * (f - h + φ2 * g)),
11
+ m = (xB * xB + yB * yB) / (2 * yB),
12
+ α = λ * Math.asin(xB / m) / π;
13
+ return [m * Math.sin(α), φ * (1 + φ2 * h) + m * (1 - Math.cos(α))];
14
+ }
15
+
16
+ forward.invert = function(x, y) {
17
+ var λ = π * x / a,
18
+ φ = y,
19
+ δλ, δφ, i = 50;
20
+ do {
21
+ var φ2 = φ * φ,
22
+ xB = a + φ2 * (b + φ2 * (c + φ2 * d)),
23
+ yB = φ * (e - 1 + φ2 * (f - h + φ2 * g)),
24
+ p = xB * xB + yB * yB,
25
+ q = 2 * yB,
26
+ m = p / q,
27
+ m2 = m * m,
28
+ dαdλ = Math.asin(xB / m) / π,
29
+ α = λ * dαdλ;
30
+ xB2 = xB * xB,
31
+ dxBdφ = (2 * b + φ2 * (4 * c + φ2 * 6 * d)) * φ,
32
+ dyBdφ = e + φ2 * (3 * f + φ2 * 5 * g),
33
+ dpdφ = 2 * (xB * dxBdφ + yB * (dyBdφ - 1)),
34
+ dqdφ = 2 * (dyBdφ - 1),
35
+ dmdφ = (dpdφ * q - p * dqdφ) / (q * q),
36
+ cosα = Math.cos(α),
37
+ sinα = Math.sin(α),
38
+ mcosα = m * cosα,
39
+ msinα = m * sinα,
40
+ dαdφ = ((λ / π) * (1 / asqrt(1 - xB2 / m2)) * (dxBdφ * m - xB * dmdφ)) / m2,
41
+ fx = msinα - x,
42
+ fy = φ * (1 + φ2 * h) + m - mcosα - y,
43
+ δxδφ = dmdφ * sinα + mcosα * dαdφ,
44
+ δxδλ = mcosα * dαdλ,
45
+ δyδφ = 1 + dmdφ - (dmdφ * cosα - msinα * dαdφ),
46
+ δyδλ = msinα * dαdλ,
47
+ denominator = δxδφ * δyδλ - δyδφ * δxδλ;
48
+ if (!denominator) break;
49
+ λ -= δλ = (fy * δxδφ - fx * δyδφ) / denominator;
50
+ φ -= δφ = (fx * δyδλ - fy * δxδλ) / denominator;
51
+ } while ((Math.abs(δλ) > ε || Math.abs(δφ) > ε) && --i > 0);
52
+ return [λ, φ];
53
+ };
54
+
55
+ return forward;
56
+ }
@@ -0,0 +1,6 @@
1
+ import "projection";
2
+ import "ginzburg-polyconic";
3
+
4
+ var ginzburg4 = ginzburgPolyconic(2.8284, -1.6988, .75432, -.18071, 1.76003, -.38914, .042555);
5
+
6
+ (d3.geo.ginzburg4 = function() { return projection(ginzburg4); }).raw = ginzburg4;
@@ -0,0 +1,6 @@
1
+ import "projection";
2
+ import "ginzburg-polyconic";
3
+
4
+ var ginzburg5 = ginzburgPolyconic(2.583819, -.835827, .170354, -.038094, 1.543313, -.411435, .082742);
5
+
6
+ (d3.geo.ginzburg5 = function() { return projection(ginzburg5); }).raw = ginzburg5;
@@ -0,0 +1,6 @@
1
+ import "projection";
2
+ import "ginzburg-polyconic";
3
+
4
+ var ginzburg6 = ginzburgPolyconic(5 / 6 * π, -.62636, -.0344, 0, 1.3493, -.05524, 0, .045);
5
+
6
+ (d3.geo.ginzburg6 = function() { return projection(ginzburg6); }).raw = ginzburg6;
@@ -0,0 +1,29 @@
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;
@@ -0,0 +1,6 @@
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;
@@ -21,6 +21,11 @@ import "eckert6";
21
21
  import "eisenlohr";
22
22
  import "fahey";
23
23
  import "gall-stereographic";
24
+ import "ginzburg4";
25
+ import "ginzburg5";
26
+ import "ginzburg6";
27
+ import "ginzburg8";
28
+ import "ginzburg9";
24
29
  import "gringorten";
25
30
  import "guyou";
26
31
  import "hammer-retroazimuthal";
@@ -0,0 +1,26 @@
1
+ var vows = require("vows"),
2
+ assert = require("./assert"),
3
+ load = require("./load");
4
+
5
+ var suite = vows.describe("d3.geo.eckert4");
6
+
7
+ suite.addBatch({
8
+ "eckert4": {
9
+ topic: load("eckert4"),
10
+ "default": {
11
+ topic: function(geo) { return geo.eckert4(); },
12
+ "projections and inverse projections": function(eckert4) {
13
+ assert.equalInverse(eckert4, [ 0, 0], [480, 250]);
14
+ assert.equalInverse(eckert4, [ 0, -45], [480, 380.658311]);
15
+ assert.equalInverse(eckert4, [ 0, 45], [480, 119.341688]);
16
+ assert.equalInverse(eckert4, [-90, 0], [281.024935, 250]);
17
+ assert.equalInverse(eckert4, [ 90, 0], [678.975064, 250]);
18
+ assert.equalInverse(eckert4, [-80, 15], [305.548179, 203.818280]);
19
+ assert.equalInverse(eckert4, [ 1, 1], [482.210699, 246.899956]);
20
+ assert.equalInverse(eckert4, [ 15, 45], [509.086665, 119.341688]);
21
+ }
22
+ }
23
+ }
24
+ });
25
+
26
+ suite.export(module);
@@ -0,0 +1,28 @@
1
+ var vows = require("vows"),
2
+ assert = require("./assert"),
3
+ load = require("./load");
4
+
5
+ var suite = vows.describe("d3.geo.ginzburg4");
6
+
7
+ suite.addBatch({
8
+ "ginzburg4": {
9
+ topic: load("ginzburg4"),
10
+ "default": {
11
+ topic: function(geo) { return geo.ginzburg4(); },
12
+ "projections and inverse projections": function(ginzburg4) {
13
+ assert.equalInverse(ginzburg4, [ 0, 0], [480, 250]);
14
+ assert.equalInverse(ginzburg4, [ 0, -90], [480, 485.619449]);
15
+ assert.equalInverse(ginzburg4, [ 0, 90], [480, 14.380550]);
16
+ assert.equalInverse(ginzburg4, [ 0, -45], [480, 367.809724]);
17
+ assert.equalInverse(ginzburg4, [ 0, 45], [480, 132.190275]);
18
+ assert.equalInverse(ginzburg4, [-180, 0], [ 55.74, 250]);
19
+ assert.equalInverse(ginzburg4, [ 180, 0], [904.26, 250]);
20
+ assert.equalInverse(ginzburg4, [-179, 15], [ 74.930232, 182.241971]);
21
+ assert.equalInverse(ginzburg4, [-179, 80], [324.146655, 6.768973]);
22
+ assert.equalInverse(ginzburg4, [ 1, 1], [482.356603, 247.381944]);
23
+ }
24
+ }
25
+ }
26
+ });
27
+
28
+ suite.export(module);
@@ -0,0 +1,28 @@
1
+ var vows = require("vows"),
2
+ assert = require("./assert"),
3
+ load = require("./load");
4
+
5
+ var suite = vows.describe("d3.geo.ginzburg5");
6
+
7
+ suite.addBatch({
8
+ "ginzburg5": {
9
+ topic: load("ginzburg5"),
10
+ "default": {
11
+ topic: function(geo) { return geo.ginzburg5(); },
12
+ "projections and inverse projections": function(ginzburg5) {
13
+ assert.equalInverse(ginzburg5, [ 0, 0], [480, 250]);
14
+ assert.equalInverse(ginzburg5, [ 0, -90], [480, 485.619449]);
15
+ assert.equalInverse(ginzburg5, [ 0, 90], [480, 14.380550]);
16
+ assert.equalInverse(ginzburg5, [ 0, -45], [480, 367.809724]);
17
+ assert.equalInverse(ginzburg5, [ 0, 45], [480, 132.190275]);
18
+ assert.equalInverse(ginzburg5, [-180, 0], [92.4271500, 250]);
19
+ assert.equalInverse(ginzburg5, [ 180, 0], [867.572850, 250]);
20
+ assert.equalInverse(ginzburg5, [-179, 15], [103.000122, 190.710455]);
21
+ assert.equalInverse(ginzburg5, [-179, 80], [283.164027, 29.027751]);
22
+ assert.equalInverse(ginzburg5, [ 1, 1], [482.152989, 247.381962]);
23
+ }
24
+ }
25
+ }
26
+ });
27
+
28
+ suite.export(module);
@@ -0,0 +1,28 @@
1
+ var vows = require("vows"),
2
+ assert = require("./assert"),
3
+ load = require("./load");
4
+
5
+ var suite = vows.describe("d3.geo.ginzburg6");
6
+
7
+ suite.addBatch({
8
+ "ginzburg6": {
9
+ topic: load("ginzburg6"),
10
+ "default": {
11
+ topic: function(geo) { return geo.ginzburg6(); },
12
+ "projections and inverse projections": function(ginzburg6) {
13
+ assert.equalInverse(ginzburg6, [ 0, 0], [480, 250]);
14
+ assert.equalInverse(ginzburg6, [ 0, -90], [480, 511.780994], 1e-4);
15
+ assert.equalInverse(ginzburg6, [ 0, 90], [480, -11.780994], 1e-4);
16
+ assert.equalInverse(ginzburg6, [ 0, -45], [480, 371.079917], 1e-5);
17
+ assert.equalInverse(ginzburg6, [ 0, 45], [480, 128.920082], 1e-5);
18
+ assert.equalInverse(ginzburg6, [-180, 0], [ 87.300918, 250]);
19
+ assert.equalInverse(ginzburg6, [ 180, 0], [872.699081, 250]);
20
+ assert.equalInverse(ginzburg6, [-179, 15], [ 95.906977, 197.310730]);
21
+ assert.equalInverse(ginzburg6, [-179, 80], [291.096338, -9.687754]);
22
+ assert.equalInverse(ginzburg6, [ 1, 1], [482.181510, 247.381942]);
23
+ }
24
+ }
25
+ }
26
+ });
27
+
28
+ suite.export(module);
@@ -0,0 +1,28 @@
1
+ var vows = require("vows"),
2
+ assert = require("./assert"),
3
+ load = require("./load");
4
+
5
+ var suite = vows.describe("d3.geo.ginzburg8");
6
+
7
+ suite.addBatch({
8
+ "ginzburg8": {
9
+ topic: load("ginzburg8"),
10
+ "default": {
11
+ topic: function(geo) { return geo.ginzburg8(); },
12
+ "projections and inverse projections": function(ginzburg8) {
13
+ assert.equalInverse(ginzburg8, [ 0, 0], [480, 250]);
14
+ assert.equalInverse(ginzburg8, [ 0, -90], [480, 534.066756]);
15
+ assert.equalInverse(ginzburg8, [ 0, 90], [480, -34.066756]);
16
+ assert.equalInverse(ginzburg8, [ 0, -45], [480, 373.865637]);
17
+ assert.equalInverse(ginzburg8, [ 0, 45], [480, 126.134362]);
18
+ assert.equalInverse(ginzburg8, [-180, 0], [113.741324, 250]);
19
+ assert.equalInverse(ginzburg8, [ 180, 0], [846.258675, 250]);
20
+ assert.equalInverse(ginzburg8, [-179, 15], [118.882415, 210.505798], 1e-5);
21
+ assert.equalInverse(ginzburg8, [-179, 80], [230.428677, 6.534397]);
22
+ assert.equalInverse(ginzburg8, [ 1, 1], [482.277542, 247.381939]);
23
+ }
24
+ }
25
+ }
26
+ });
27
+
28
+ suite.export(module);
@@ -0,0 +1,28 @@
1
+ var vows = require("vows"),
2
+ assert = require("./assert"),
3
+ load = require("./load");
4
+
5
+ var suite = vows.describe("d3.geo.ginzburg9");
6
+
7
+ suite.addBatch({
8
+ "ginzburg9": {
9
+ topic: load("ginzburg9"),
10
+ "default": {
11
+ topic: function(geo) { return geo.ginzburg9(); },
12
+ "projections and inverse projections": function(ginzburg9) {
13
+ assert.equalInverse(ginzburg9, [ 0, 0], [480, 250]);
14
+ assert.equalInverse(ginzburg9, [ 0, -90], [480, 485.619449]);
15
+ assert.equalInverse(ginzburg9, [ 0, 90], [480, 14.380550]);
16
+ assert.equalInverse(ginzburg9, [ 0, -45], [480, 367.809724]);
17
+ assert.equalInverse(ginzburg9, [ 0, 45], [480, 132.190275]);
18
+ assert.equalInverse(ginzburg9, [-180, 0], [ 82.26, 250]);
19
+ assert.equalInverse(ginzburg9, [ 180, 0], [877.74, 250]);
20
+ assert.equalInverse(ginzburg9, [-179, 15], [ 92.158925, 197.003182]);
21
+ assert.equalInverse(ginzburg9, [-179, 80], [250.610739, -3.220862]);
22
+ assert.equalInverse(ginzburg9, [ 1, 1], [482.209480, 247.381976]);
23
+ }
24
+ }
25
+ }
26
+ });
27
+
28
+ suite.export(module);
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: d3js-plugins-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Gorodetsky
@@ -29,7 +29,7 @@ cert_chain:
29
29
  huM3+aQFhf3ji44P0XipQ3GsiF39ZRDA3MUe8jeuiHoq1vbmLrw0muYOH9jlTmCN
30
30
  soY91zInZJIkyNXJub8NKDuoUBKLvE5Ij89OFA==
31
31
  -----END CERTIFICATE-----
32
- date: 2013-03-27 00:00:00.000000000 Z
32
+ date: 2013-04-27 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: railties
@@ -76,8 +76,6 @@ files:
76
76
  - vendor/assets/javascripts/d3/plugins/bullet/bullet.js
77
77
  - vendor/assets/javascripts/d3/plugins/chernoff/README.md
78
78
  - vendor/assets/javascripts/d3/plugins/chernoff/chernoff.js
79
- - vendor/assets/javascripts/d3/plugins/cie/README.md
80
- - vendor/assets/javascripts/d3/plugins/cie/cie.js
81
79
  - vendor/assets/javascripts/d3/plugins/fisheye/README.md
82
80
  - vendor/assets/javascripts/d3/plugins/fisheye/fisheye.js
83
81
  - vendor/assets/javascripts/d3/plugins/force_labels/README.md
@@ -108,6 +106,12 @@ files:
108
106
  - vendor/assets/javascripts/d3/plugins/geo/projection/end.js
109
107
  - vendor/assets/javascripts/d3/plugins/geo/projection/fahey.js
110
108
  - vendor/assets/javascripts/d3/plugins/geo/projection/gall-stereographic.js
109
+ - vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg-polyconic.js
110
+ - vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg4.js
111
+ - vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg5.js
112
+ - vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg6.js
113
+ - vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg8.js
114
+ - vendor/assets/javascripts/d3/plugins/geo/projection/ginzburg9.js
111
115
  - vendor/assets/javascripts/d3/plugins/geo/projection/gringorten.js
112
116
  - vendor/assets/javascripts/d3/plugins/geo/projection/guyou.js
113
117
  - vendor/assets/javascripts/d3/plugins/geo/projection/hammer-retroazimuthal.js
@@ -156,9 +160,15 @@ files:
156
160
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/bonne-test.js
157
161
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/craig-test.js
158
162
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/craster-test.js
163
+ - vendor/assets/javascripts/d3/plugins/geo/projection/test/eckert4-test.js
159
164
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/eisenlohr-test.js
160
165
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/equirectangular-test.js
161
166
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/fahey-test.js
167
+ - vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg4-test.js
168
+ - vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg5-test.js
169
+ - vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg6-test.js
170
+ - vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg8-test.js
171
+ - vendor/assets/javascripts/d3/plugins/geo/projection/test/ginzburg9-test.js
162
172
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/gringorten-test.js
163
173
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/guyou-test.js
164
174
  - vendor/assets/javascripts/d3/plugins/geo/projection/test/hammer-retroazimuthal-test.js
metadata.gz.sig CHANGED
Binary file
@@ -1,54 +0,0 @@
1
- # d3.cie
2
-
3
- A plugin for CIE Lab and LCH color spaces. For an example, see
4
-
5
- * http://bl.ocks.org/3014589
6
-
7
- This plugin was incorporated into D3 2.10.0 on August 9, 2012 and can now be used directly as d3.hcl and d3.lab!
8
-
9
- ## Old Documentation
10
-
11
- To create a Lab color, use the `d3.cie.lab` constructor. To create an LCH color, use the `d3.cie.lch` constructor. For example, here are two ugly colors:
12
-
13
- ```js
14
- var green = d3.cie.lab(46.23, -51.70, 49.90),
15
- blue = d3.cie.lch(32.30, 133.81, -53.72);
16
- ```
17
-
18
- To convert from RGB to Lab (or LCH), simply specify an RGB color to the constructor. You can use the same technique to convert from HSV; D3 first converts the HSV color to RGB, and then then d3.cie plugin converts from RGB to Lab or LCH. The following three statements are equivalent:
19
-
20
- ```js
21
- var color = d3.cie.lab("#048F07");
22
- var color = d3.cie.lab("rgb(4,143,7)");
23
- var color = d3.cie.lab(d3.rgb(4, 143, 7));
24
- ```
25
-
26
- To convert from Lab (or LCH) to RGB, simply stringify the color. For example, you can pass a Lab color to [selection.attr](/mbostock/d3/wiki/Selections#wiki-attr) and [selection.style](/mbostock/d3/wiki/Selections#wiki-attr):
27
-
28
- ```js
29
- d3.select("body").style("background", d3.cie.lab(46.23, -51.70, 49.90));
30
- ```
31
-
32
- The Lab and LCH color classes support custom [brighter](/mbostock/d3/wiki/Colors#wiki-rgb_brighter) and [darker](/mbostock/d3/wiki/Colors#wiki-rgb_brighter) implementations that only modify the L (*lightness*) channel. This tends to produce better results than the RGB or HSL equivalents.
33
-
34
- The d3.cie plugin also lets you interpolates in Lab or LCH space. For example:
35
-
36
- ```js
37
- var x = d3.scale.linear()
38
- .domain([0, 100])
39
- .range(["brown", "steelblue"])
40
- .interpolate(d3.cie.interpolateLab);
41
- ```
42
-
43
- The d3.cie plugin does not support parsing CSS3-style color names for Lab and LCH, so you can't say `d3.rgb("lch(32, 133, -53")`; you must use the d3.cie.lab or d3.cie.lch constructors.
44
-
45
- ## Thank You
46
-
47
- Various people contributed and helped in implementing this plugin.
48
-
49
- * [Jeffery Heer](/jheer)
50
- * [Justin Cormack](/justincormack)
51
- * [Alex Gaynor](/alex)
52
- * [Jacob Rus](/jrus)
53
-
54
- If you like this, you might also like [Gregor Aisch](/gka)’s [Chroma.js](/gka/chroma.js).
@@ -1,155 +0,0 @@
1
- (function(d3) {
2
- var cie = d3.cie = {};
3
-
4
- cie.lab = function(l, a, b) {
5
- return arguments.length === 1
6
- ? (l instanceof Lab ? lab(l.l, l.a, l.b)
7
- : (l instanceof Lch ? lch_lab(l.l, l.c, l.h)
8
- : rgb_lab((l = d3.rgb(l)).r, l.g, l.b)))
9
- : lab(+l, +a, +b);
10
- };
11
-
12
- cie.lch = function(l, c, h) {
13
- return arguments.length === 1
14
- ? (l instanceof Lch ? lch(l.l, l.c, l.h)
15
- : (l instanceof Lab ? lab_lch(l.l, l.a, l.b)
16
- : lab_lch((l = rgb_lab((l = d3.rgb(l)).r, l.g, l.b)).l, l.a, l.b)))
17
- : lch(+l, +c, +h);
18
- };
19
-
20
- cie.interpolateLab = function(a, b) {
21
- a = cie.lab(a);
22
- b = cie.lab(b);
23
- var al = a.l,
24
- aa = a.a,
25
- ab = a.b,
26
- bl = b.l - al,
27
- ba = b.a - aa,
28
- bb = b.b - ab;
29
- return function(t) {
30
- return lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
31
- };
32
- };
33
-
34
- cie.interpolateLch = function(a, b) {
35
- a = cie.lch(a);
36
- b = cie.lch(b);
37
- var al = a.l,
38
- ac = a.c,
39
- ah = a.h,
40
- bl = b.l - al,
41
- bc = b.c - ac,
42
- bh = b.h - ah;
43
- if (bh > 180) bh -= 360; else if (bh < -180) bh += 360; // shortest path
44
- return function(t) {
45
- return lch_lab(al + bl * t, ac + bc * t, ah + bh * t) + "";
46
- };
47
- };
48
-
49
- function lab(l, a, b) {
50
- return new Lab(l, a, b);
51
- }
52
-
53
- function Lab(l, a, b) {
54
- this.l = l;
55
- this.a = a;
56
- this.b = b;
57
- }
58
-
59
- Lab.prototype.brighter = function(k) {
60
- return lab(Math.min(100, this.l + K * (arguments.length ? k : 1)), this.a, this.b);
61
- };
62
-
63
- Lab.prototype.darker = function(k) {
64
- return lab(Math.max(0, this.l - K * (arguments.length ? k : 1)), this.a, this.b);
65
- };
66
-
67
- Lab.prototype.rgb = function() {
68
- return lab_rgb(this.l, this.a, this.b);
69
- };
70
-
71
- Lab.prototype.toString = function() {
72
- return this.rgb() + "";
73
- };
74
-
75
- function lch(l, c, h) {
76
- return new Lch(l, c, h);
77
- }
78
-
79
- function Lch(l, c, h) {
80
- this.l = l;
81
- this.c = c;
82
- this.h = h;
83
- }
84
-
85
- Lch.prototype.brighter = function(k) {
86
- return lch(Math.min(100, this.l + K * (arguments.length ? k : 1)), this.c, this.h);
87
- };
88
-
89
- Lch.prototype.darker = function(k) {
90
- return lch(Math.max(0, this.l - K * (arguments.length ? k : 1)), this.c, this.h);
91
- };
92
-
93
- Lch.prototype.rgb = function() {
94
- return lch_lab(this.l, this.c, this.h).rgb();
95
- };
96
-
97
- Lch.prototype.toString = function() {
98
- return this.rgb() + "";
99
- };
100
-
101
- // Corresponds roughly to RGB brighter/darker
102
- var K = 18;
103
-
104
- // D65 standard referent
105
- var X = 0.950470, Y = 1, Z = 1.088830;
106
-
107
- function lab_rgb(l, a, b) {
108
- var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;
109
- x = lab_xyz(x) * X;
110
- y = lab_xyz(y) * Y;
111
- z = lab_xyz(z) * Z;
112
- return d3.rgb(
113
- xyz_rgb( 3.2404542 * x - 1.5371385 * y - 0.4985314 * z),
114
- xyz_rgb(-0.9692660 * x + 1.8760108 * y + 0.0415560 * z),
115
- xyz_rgb( 0.0556434 * x - 0.2040259 * y + 1.0572252 * z)
116
- );
117
- }
118
-
119
- function rgb_lab(r, g, b) {
120
- r = rgb_xyz(r);
121
- g = rgb_xyz(g);
122
- b = rgb_xyz(b);
123
- var x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / X),
124
- y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.0721750 * b) / Y),
125
- z = xyz_lab((0.0193339 * r + 0.1191920 * g + 0.9503041 * b) / Z);
126
- return lab(116 * y - 16, 500 * (x - y), 200 * (y - z));
127
- }
128
-
129
- function lab_lch(l, a, b) {
130
- var c = Math.sqrt(a * a + b * b),
131
- h = Math.atan2(b, a) / Math.PI * 180;
132
- return lch(l, c, h);
133
- }
134
-
135
- function lch_lab(l, c, h) {
136
- h = h * Math.PI / 180;
137
- return lab(l, Math.cos(h) * c, Math.sin(h) * c);
138
- }
139
-
140
- function lab_xyz(x) {
141
- return x > 0.206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
142
- }
143
-
144
- function xyz_lab(x) {
145
- return x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
146
- }
147
-
148
- function xyz_rgb(r) {
149
- return Math.round(255 * (r <= 0.00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - 0.055));
150
- }
151
-
152
- function rgb_xyz(r) {
153
- return (r /= 255) <= 0.04045 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
154
- }
155
- })(d3);