Permalink
Browse files

Merge branch 'release'

  • Loading branch information...
2 parents 0f2846e + 978a3ce commit 5d05154ae620d5450eaafa9788970fe891fe681e @mbostock mbostock committed May 7, 2011
View
@@ -150,13 +150,17 @@ d3.geom.js: \
tests: \
tests/test-append.test \
tests/test-attr.test \
+ tests/test-classed.test \
tests/test-call.test \
tests/test-csv-parse.test \
tests/test-format.test \
tests/test-insert.test \
tests/test-interpolate.test \
+ tests/test-keys.test \
tests/test-nest.test \
tests/test-remove.test \
+ tests/test-rgb.test \
+ tests/test-hsl.test \
tests/test-time-format.test \
tests/test-time-parse.test \
tests/test-transition.test \
View
@@ -69,7 +69,7 @@ d3.behavior.zoom = function() {
}
// adjust zoom level
- if (e.type == "dblclick") {
+ if (e.type === "dblclick") {
z = e.shiftKey ? Math.ceil(z - 1) : Math.floor(z + 1);
} else {
var delta = (e.wheelDelta / 120 || -e.detail) * .1;
@@ -80,7 +80,7 @@ d3.behavior.zoom = function() {
if ((since > 9) && (Math.abs(e.wheelDelta) / since >= 50)) bug40441 = 1;
bug40441Last = now;
}
- if (bug40441 == 1) delta *= .03;
+ if (bug40441 === 1) delta *= .03;
z += delta;
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -231,6 +231,7 @@ d3.chart.box = function() {
.style("opacity", 1e-6)
.remove();
});
+ d3.timer.flush();
}
box.width = function(x) {
@@ -456,6 +457,7 @@ d3.chart.bullet = function() {
.attr("opacity", 1e-6)
.remove();
});
+ d3.timer.flush();
}
// left, right, top, bottom
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -30,25 +30,25 @@ d3.csv.parseRows = function(text, f) {
/** @private Returns the next token. */
function token() {
- if (re.lastIndex == text.length) return EOF; // special case: end of file
+ if (re.lastIndex === text.length) return EOF; // special case: end of file
if (eol) { eol = false; return EOL; } // special case: end of line
// special case: quotes
var j = re.lastIndex;
- if (text.charCodeAt(j) == 34) {
+ if (text.charCodeAt(j) === 34) {
var i = j;
while (i++ < text.length) {
- if (text.charCodeAt(i) == 34) {
- if (text.charCodeAt(i + 1) != 34) break;
+ if (text.charCodeAt(i) === 34) {
+ if (text.charCodeAt(i + 1) !== 34) break;
i++;
}
}
re.lastIndex = i + 2;
var c = text.charCodeAt(i + 1);
- if (c == 13) {
+ if (c === 13) {
eol = true;
- if (text.charCodeAt(i + 2) == 10) re.lastIndex++;
- } else if (c == 10) {
+ if (text.charCodeAt(i + 2) === 10) re.lastIndex++;
+ } else if (c === 10) {
eol = true;
}
return text.substring(j + 1, i).replace(/""/g, "\"");
@@ -57,7 +57,7 @@ d3.csv.parseRows = function(text, f) {
// common case
var m = re.exec(text);
if (m) {
- eol = m[0].charCodeAt(0) != 44;
+ eol = m[0].charCodeAt(0) !== 44;
return text.substring(j, m.index);
}
re.lastIndex = text.length;
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -154,7 +154,7 @@ d3.geo.path = function() {
projection = d3.geo.albersUsa();
function path(d, i) {
- if (typeof pointRadius == "function") {
+ if (typeof pointRadius === "function") {
pointCircle = d3_path_circle(pointRadius.apply(this, arguments));
}
return d3_geo_pathType(pathTypes, d);
@@ -405,7 +405,7 @@ d3.geo.path = function() {
};
path.pointRadius = function(x) {
- if (typeof x == "function") pointRadius = x;
+ if (typeof x === "function") pointRadius = x;
else {
pointRadius = +x;
pointCircle = d3_path_circle(pointRadius);
View
@@ -29,12 +29,12 @@ d3.geom.contour = function(grid, start) {
if (grid(x, y )) i += 8;
// determine next direction
- if (i == 6) {
- dx = pdy == -1 ? -1 : 1;
+ if (i === 6) {
+ dx = pdy === -1 ? -1 : 1;
dy = 0;
- } else if (i == 9) {
+ } else if (i === 9) {
dx = 0;
- dy = pdx == 1 ? -1 : 1;
+ dy = pdx === 1 ? -1 : 1;
} else {
dx = d3_geom_contourDx[i];
dy = d3_geom_contourDy[i];
@@ -68,15 +68,16 @@ function d3_geom_contourStart(grid) {
if (grid(x,y)) {
return [x,y];
}
- if (x == 0) {
+ if (x === 0) {
x = y + 1;
y = 0;
} else {
x = x - 1;
y = y + 1;
}
}
-}/**
+}
+/**
* Computes the 2D convex hull of a set of points using Graham's scanning
* algorithm. The algorithm has been implemented as described in Cormen,
* Leiserson, and Rivest's Introduction to Algorithms. The running time of
@@ -105,7 +106,7 @@ d3.geom.hull = function(vertices) {
// calculate polar angles from ref point and sort
for (i=0; i<len; ++i) {
- if (i == h) continue;
+ if (i === h) continue;
y1 = vertices[i][1] - vertices[h][1];
x1 = vertices[i][0] - vertices[h][0];
points.push({angle: Math.atan2(y1, x1), index: i});
@@ -142,7 +143,7 @@ d3.geom.hull = function(vertices) {
// initialize the stack
stack.push(h);
for (i=0, j=0; i<2; ++j) {
- if (points[j].index != -1) {
+ if (points[j].index !== -1) {
stack.push(points[j].index);
i++;
}
@@ -151,7 +152,7 @@ d3.geom.hull = function(vertices) {
// do graham's scan
for (; j<plen; ++j) {
- if (points[j].index == -1) continue; // skip tossed out points
+ if (points[j].index === -1) continue; // skip tossed out points
while (!d3_geom_hullCCW(stack[sp-2], stack[sp-1], points[j].index, vertices)) {
--sp;
}
@@ -173,7 +174,8 @@ function d3_geom_hullCCW(i1, i2, i3, v) {
t = v[i2]; c = t[0]; d = t[1];
t = v[i3]; e = t[0]; f = t[1];
return ((f-b)*(c-a) - (d-b)*(e-a)) > 0;
-}// Note: requires coordinates to be counterclockwise and convex!
+}
+// Note: requires coordinates to be counterclockwise and convex!
d3.geom.polygon = function(coordinates) {
coordinates.area = function() {
@@ -281,14 +283,14 @@ d3.geom.voronoi = function(vertices) {
x2,
y1,
y2;
- if (e.a == 1 && e.b >= 0) {
+ if (e.a === 1 && e.b >= 0) {
s1 = e.ep.r;
s2 = e.ep.l;
} else {
s1 = e.ep.l;
s2 = e.ep.r;
}
- if (e.a == 1) {
+ if (e.a === 1) {
y1 = s1 ? s1.y : -1e6;
x1 = e.c - e.b * y1;
y2 = s2 ? s2.y : 1e6;
@@ -463,8 +465,8 @@ function d3_voronoi_tessellate(vertices, callback) {
e = e2;
}
var rightOfSite = (xint >= e.region.r.x);
- if ((rightOfSite && (el.side == "l")) ||
- (!rightOfSite && (el.side == "r"))) {
+ if ((rightOfSite && (el.side === "l")) ||
+ (!rightOfSite && (el.side === "r"))) {
return null;
}
return {
@@ -478,13 +480,13 @@ function d3_voronoi_tessellate(vertices, callback) {
topsite = e.region.r,
rightOfSite = (p.x > topsite.x);
- if (rightOfSite && (he.side == "l")) {
+ if (rightOfSite && (he.side === "l")) {
return 1;
}
- if (!rightOfSite && (he.side == "r")) {
+ if (!rightOfSite && (he.side === "r")) {
return 0;
}
- if (e.a == 1) {
+ if (e.a === 1) {
var dyp = p.y - topsite.y,
dxp = p.x - topsite.x,
fast = 0,
@@ -519,7 +521,7 @@ function d3_voronoi_tessellate(vertices, callback) {
above = (t1 * t1) > (t2 * t2 + t3 * t3);
}
- return he.side == "l" ? above : !above;
+ return he.side === "l" ? above : !above;
},
endPoint: function(edge, side, site) {
@@ -559,7 +561,7 @@ function d3_voronoi_tessellate(vertices, callback) {
ls.splice(i, 1);
},
- empty: function() { return EventQueue.list.length == 0; },
+ empty: function() { return EventQueue.list.length === 0; },
nextEvent: function(he) {
for (var i=0, ls=EventQueue.list, l=ls.length; i<l; ++i) {
Oops, something went wrong.

0 comments on commit 5d05154

Please sign in to comment.