Skip to content

Commit

Permalink
Merge branch '2.7.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 26, 2012
2 parents ad76418 + cc5de6d commit 303478b
Show file tree
Hide file tree
Showing 19 changed files with 307 additions and 5,433 deletions.
26 changes: 17 additions & 9 deletions d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ try {
d3_style_setProperty.call(this, name, value + "", priority);
};
}
d3 = {version: "2.7.2"}; // semver
d3 = {version: "2.7.3"}; // semver
var d3_array = d3_arraySlice; // conversion for NodeLists

function d3_arrayCopy(pseudoarray) {
Expand Down Expand Up @@ -419,7 +419,7 @@ d3.requote = function(s) {
var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
d3.round = function(x, n) {
return n
? Math.round(x * Math.pow(10, n)) * Math.pow(10, -n)
? Math.round(x * (n = Math.pow(10, n))) / n
: Math.round(x);
};
d3.xhr = function(url, mime, callback) {
Expand Down Expand Up @@ -2145,7 +2145,7 @@ d3_transitionPrototype.text = function(value) {
});
};
d3_transitionPrototype.remove = function() {
return this.each("end", function() {
return this.each("end.transition", function() {
var p;
if (!this.__transition__ && (p = this.parentNode)) p.removeChild(this);
});
Expand Down Expand Up @@ -2495,15 +2495,21 @@ function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
var u = [],
i = [],
j = 0,
n = domain.length;
k = domain.length - 1;

while (++j < n) {
// Handle descending domains.
if (domain[k] < domain[0]) {
domain = domain.slice().reverse();
range = range.slice().reverse();
}

while (++j <= k) {
u.push(uninterpolate(domain[j - 1], domain[j]));
i.push(interpolate(range[j - 1], range[j]));
}

return function(x) {
var j = d3.bisect(domain, x, 1, domain.length - 1) - 1;
var j = d3.bisect(domain, x, 1, k) - 1;
return i[j](u[j](x));
};
}
Expand Down Expand Up @@ -4016,8 +4022,8 @@ d3.svg.brush = function() {

g.each(function() {
var g = d3.select(this).on("mousedown.brush", down),
bg = g.selectAll(".background").data([,]),
fg = g.selectAll(".extent").data([,]),
bg = g.selectAll(".background").data([0]),
fg = g.selectAll(".extent").data([0]),
tz = g.selectAll(".resize").data(resizes, String),
e;

Expand All @@ -4039,9 +4045,11 @@ d3.svg.brush = function() {
.attr("width", 6)
.attr("height", 6)
.style("visibility", "hidden")
.style("pointer-events", brush.empty() ? "none" : "all")
.style("cursor", function(d) { return d3_svg_brushCursor[d]; });

// Update the resizers.
tz.style("pointer-events", brush.empty() ? "none" : "all");

// Remove any superfluous resizers.
tz.exit().remove();

Expand Down
8 changes: 4 additions & 4 deletions d3.layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -1773,26 +1773,26 @@ d3.layout.treemap = function() {
v = u ? round(row.area / u) : 0,
o;
if (u == rect.dx) { // horizontal subdivision
if (flush || v > rect.dy) v = v ? rect.dy : 0; // over+underflow
if (flush || v > rect.dy) v = rect.dy; // over+underflow
while (++i < n) {
o = row[i];
o.x = x;
o.y = y;
o.dy = v;
x += o.dx = v ? round(o.area / v) : 0;
x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);
}
o.z = true;
o.dx += rect.x + rect.dx - x; // rounding error
rect.y += v;
rect.dy -= v;
} else { // vertical subdivision
if (flush || v > rect.dx) v = v ? rect.dx : 0; // over+underflow
if (flush || v > rect.dx) v = rect.dx; // over+underflow
while (++i < n) {
o = row[i];
o.x = x;
o.y = y;
o.dx = v;
y += o.dy = v ? round(o.area / v) : 0;
y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);
}
o.z = false;
o.dy += rect.y + rect.dy - y; // rounding error
Expand Down
2 changes: 1 addition & 1 deletion d3.layout.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions d3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion d3.time.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ var d3_time_scaleSteps = [
864e5, // 1-day
1728e5, // 2-day
6048e5, // 1-week
1728e6, // 1-month
2592e6, // 1-month
7776e6, // 3-month
31536e6 // 1-year
];
Expand Down
2 changes: 1 addition & 1 deletion d3.time.min.js

Large diffs are not rendered by default.

5,233 changes: 0 additions & 5,233 deletions examples/zoom/dji.csv

This file was deleted.

124 changes: 124 additions & 0 deletions examples/zoom/sp500.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
date,price
Jan 2000,1394.46
Feb 2000,1366.42
Mar 2000,1498.58
Apr 2000,1452.43
May 2000,1420.6
Jun 2000,1454.6
Jul 2000,1430.83
Aug 2000,1517.68
Sep 2000,1436.51
Oct 2000,1429.4
Nov 2000,1314.95
Dec 2000,1320.28
Jan 2001,1366.01
Feb 2001,1239.94
Mar 2001,1160.33
Apr 2001,1249.46
May 2001,1255.82
Jun 2001,1224.38
Jul 2001,1211.23
Aug 2001,1133.58
Sep 2001,1040.94
Oct 2001,1059.78
Nov 2001,1139.45
Dec 2001,1148.08
Jan 2002,1130.2
Feb 2002,1106.73
Mar 2002,1147.39
Apr 2002,1076.92
May 2002,1067.14
Jun 2002,989.82
Jul 2002,911.62
Aug 2002,916.07
Sep 2002,815.28
Oct 2002,885.76
Nov 2002,936.31
Dec 2002,879.82
Jan 2003,855.7
Feb 2003,841.15
Mar 2003,848.18
Apr 2003,916.92
May 2003,963.59
Jun 2003,974.5
Jul 2003,990.31
Aug 2003,1008.01
Sep 2003,995.97
Oct 2003,1050.71
Nov 2003,1058.2
Dec 2003,1111.92
Jan 2004,1131.13
Feb 2004,1144.94
Mar 2004,1126.21
Apr 2004,1107.3
May 2004,1120.68
Jun 2004,1140.84
Jul 2004,1101.72
Aug 2004,1104.24
Sep 2004,1114.58
Oct 2004,1130.2
Nov 2004,1173.82
Dec 2004,1211.92
Jan 2005,1181.27
Feb 2005,1203.6
Mar 2005,1180.59
Apr 2005,1156.85
May 2005,1191.5
Jun 2005,1191.33
Jul 2005,1234.18
Aug 2005,1220.33
Sep 2005,1228.81
Oct 2005,1207.01
Nov 2005,1249.48
Dec 2005,1248.29
Jan 2006,1280.08
Feb 2006,1280.66
Mar 2006,1294.87
Apr 2006,1310.61
May 2006,1270.09
Jun 2006,1270.2
Jul 2006,1276.66
Aug 2006,1303.82
Sep 2006,1335.85
Oct 2006,1377.94
Nov 2006,1400.63
Dec 2006,1418.3
Jan 2007,1438.24
Feb 2007,1406.82
Mar 2007,1420.86
Apr 2007,1482.37
May 2007,1530.62
Jun 2007,1503.35
Jul 2007,1455.27
Aug 2007,1473.99
Sep 2007,1526.75
Oct 2007,1549.38
Nov 2007,1481.14
Dec 2007,1468.36
Jan 2008,1378.55
Feb 2008,1330.63
Mar 2008,1322.7
Apr 2008,1385.59
May 2008,1400.38
Jun 2008,1280
Jul 2008,1267.38
Aug 2008,1282.83
Sep 2008,1166.36
Oct 2008,968.75
Nov 2008,896.24
Dec 2008,903.25
Jan 2009,825.88
Feb 2009,735.09
Mar 2009,797.87
Apr 2009,872.81
May 2009,919.14
Jun 2009,919.32
Jul 2009,987.48
Aug 2009,1020.62
Sep 2009,1057.08
Oct 2009,1036.19
Nov 2009,1095.63
Dec 2009,1115.1
Jan 2010,1073.87
Feb 2010,1104.49
Mar 2010,1140.45
Loading

0 comments on commit 303478b

Please sign in to comment.