Skip to content

Commit 661d8f7

Browse files
committed
Update to 2.2.0.
1 parent 49ba8be commit 661d8f7

27 files changed

Lines changed: 137 additions & 88 deletions

_layouts/api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="content-type" content="text/html;charset=utf-8">
55
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
6-
<script type="text/javascript" src="../d3.js?2.1.3"></script>
6+
<script type="text/javascript" src="../d3.js?2.2.0"></script>
77
<style type="text/css">
88

99
@import url("../style.css?1.10.0");

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="content-type" content="text/html;charset=utf-8">
55
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
6-
<script type="text/javascript" src="d3.js?2.1.3"></script>
6+
<script type="text/javascript" src="d3.js?2.2.0"></script>
77
<style type="text/css">
88

99
@import url("style.css?1.10.0");

_layouts/ex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="content-type" content="text/html;charset=utf-8">
55
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
6-
<script type="text/javascript" src="../d3.js?2.1.3"></script>
6+
<script type="text/javascript" src="../d3.js?2.2.0"></script>
77
<style type="text/css">
88

99
@import url("../style.css?1.10.0");

_layouts/tutorial.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="content-type" content="text/html;charset=utf-8">
55
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
6-
<script type="text/javascript" src="../d3.js?2.1.3"></script>
6+
<script type="text/javascript" src="../d3.js?2.2.0"></script>
77
<style type="text/css">
88

99
@import url("../style.css?1.10.0");

d3.geo.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,42 @@ d3.geo.albersUsa = function() {
197197
};
198198

199199
var d3_radians = Math.PI / 180;
200+
d3.geo.equirectangular = function() {
201+
var scale = 500,
202+
translate = [480, 250];
203+
204+
function equirectangular(coordinates) {
205+
var x = coordinates[0] / 360,
206+
y = -coordinates[1] / 360;
207+
return [
208+
scale * x + translate[0],
209+
scale * y + translate[1]
210+
];
211+
}
212+
213+
equirectangular.invert = function(coordinates) {
214+
var x = (coordinates[0] - translate[0]) / scale,
215+
y = (coordinates[1] - translate[1]) / scale;
216+
return [
217+
360 * x,
218+
-360 * y
219+
];
220+
};
221+
222+
equirectangular.scale = function(x) {
223+
if (!arguments.length) return scale;
224+
scale = +x;
225+
return equirectangular;
226+
};
227+
228+
equirectangular.translate = function(x) {
229+
if (!arguments.length) return translate;
230+
translate = [+x[0], +x[1]];
231+
return equirectangular;
232+
};
233+
234+
return equirectangular;
235+
};
200236
d3.geo.mercator = function() {
201237
var scale = 500,
202238
translate = [480, 250];

d3.geo.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

d3.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ try {
1010
d3_style_setProperty.call(this, name, value + "", priority);
1111
};
1212
}
13-
d3 = {version: "2.1.3"}; // semver
13+
d3 = {version: "2.2.0"}; // semver
1414
var d3_arraySubclass = [].__proto__?
1515

1616
// Until ECMAScript supports array subclassing, prototype injection works well.
@@ -2775,33 +2775,30 @@ var d3_svg_lineInterpolators = {
27752775

27762776
// Linear interpolation; generates "L" commands.
27772777
function d3_svg_lineLinear(points) {
2778-
var path = [],
2779-
i = 0,
2778+
var i = 0,
27802779
n = points.length,
2781-
p = points[0];
2782-
path.push(p[0], ",", p[1]);
2780+
p = points[0],
2781+
path = [p[0], ",", p[1]];
27832782
while (++i < n) path.push("L", (p = points[i])[0], ",", p[1]);
27842783
return path.join("");
27852784
}
27862785

27872786
// Step interpolation; generates "H" and "V" commands.
27882787
function d3_svg_lineStepBefore(points) {
2789-
var path = [],
2790-
i = 0,
2788+
var i = 0,
27912789
n = points.length,
2792-
p = points[0];
2793-
path.push(p[0], ",", p[1]);
2790+
p = points[0],
2791+
path = [p[0], ",", p[1]];
27942792
while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
27952793
return path.join("");
27962794
}
27972795

27982796
// Step interpolation; generates "H" and "V" commands.
27992797
function d3_svg_lineStepAfter(points) {
2800-
var path = [],
2801-
i = 0,
2798+
var i = 0,
28022799
n = points.length,
2803-
p = points[0];
2804-
path.push(p[0], ",", p[1]);
2800+
p = points[0],
2801+
path = [p[0], ",", p[1]];
28052802
while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
28062803
return path.join("");
28072804
}
@@ -2899,15 +2896,14 @@ function d3_svg_lineCardinalTangents(points, tension) {
28992896
// B-spline interpolation; generates "C" commands.
29002897
function d3_svg_lineBasis(points) {
29012898
if (points.length < 3) return d3_svg_lineLinear(points);
2902-
var path = [],
2903-
i = 1,
2899+
var i = 1,
29042900
n = points.length,
29052901
pi = points[0],
29062902
x0 = pi[0],
29072903
y0 = pi[1],
29082904
px = [x0, x0, x0, (pi = points[1])[0]],
2909-
py = [y0, y0, y0, pi[1]];
2910-
path.push(x0, ",", y0);
2905+
py = [y0, y0, y0, pi[1]],
2906+
path = [x0, ",", y0];
29112907
d3_svg_lineBasisBezier(path, px, py);
29122908
while (++i < n) {
29132909
pi = points[i];

0 commit comments

Comments
 (0)