Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Nov 30, 2011
2 parents 817358a + 33ab885 commit fe671a7
Show file tree
Hide file tree
Showing 108 changed files with 535 additions and 529 deletions.
28 changes: 14 additions & 14 deletions d3.js
Expand Up @@ -10,7 +10,7 @@ try {
d3_style_setProperty.call(this, name, value + "", priority);
};
}
d3 = {version: "2.6.0"}; // semver
d3 = {version: "2.6.1"}; // semver
var d3_array = d3_arraySlice; // conversion for NodeLists

function d3_arrayCopy(pseudoarray) {
Expand Down Expand Up @@ -977,9 +977,9 @@ function d3_interpolateByName(n) {
d3.interpolators = [
d3.interpolateObject,
function(a, b) { return (b instanceof Array) && d3.interpolateArray(a, b); },
function(a, b) { return (typeof b === "string") && d3.interpolateString(a + "", b); },
function(a, b) { return (typeof b === "string" ? b in d3_rgb_names || /^(#|rgb\(|hsl\()/.test(b) : b instanceof d3_Rgb || b instanceof d3_Hsl) && d3.interpolateRgb(a + "", b); },
function(a, b) { return (typeof b === "number") && d3.interpolateNumber(+a, b); }
function(a, b) { return (typeof a === "string" || typeof b === "string") && d3.interpolateString(a + "", b + ""); },
function(a, b) { return (typeof b === "string" ? b in d3_rgb_names || /^(#|rgb\(|hsl\()/.test(b) : b instanceof d3_Rgb || b instanceof d3_Hsl) && d3.interpolateRgb(a, b); },
function(a, b) { return !isNaN(a = +a) && !isNaN(b = +b) && d3.interpolateNumber(a, b); }
];
function d3_uninterpolateNumber(a, b) {
b = b - (a = +a) ? 1 / (b - a) : 0;
Expand Down Expand Up @@ -2542,7 +2542,7 @@ function d3_scale_log(linear, log) {
if (arguments.length < 2) format = d3_scale_logFormat;
if (arguments.length < 1) return format;
var k = n / scale.ticks().length,
f = log === d3_scale_logn ? (e = -1e-15, Math.floor) : (e = 1e-15, Math.ceil),
f = log === d3_scale_logn ? (e = -1e-12, Math.floor) : (e = 1e-12, Math.ceil),
e;
return function(d) {
return d / pow(f(log(d) + e)) < k ? format(d) : "";
Expand Down Expand Up @@ -3646,7 +3646,7 @@ function d3_svg_mousePoint(container, e) {
var point = (container.ownerSVGElement || container).createSVGPoint();
if ((d3_mouse_bug44083 < 0) && (window.scrollX || window.scrollY)) {
var svg = d3.select(document.body)
.append("svg:svg")
.append("svg")
.style("position", "absolute")
.style("top", 0)
.style("left", 0);
Expand Down Expand Up @@ -3807,30 +3807,30 @@ d3.svg.axis = function() {
// Minor ticks.
var subticks = d3_svg_axisSubdivide(scale, ticks, tickSubdivide),
subtick = g.selectAll(".minor").data(subticks, String),
subtickEnter = subtick.enter().insert("svg:line", "g").attr("class", "tick minor").style("opacity", 1e-6),
subtickEnter = subtick.enter().insert("line", "g").attr("class", "tick minor").style("opacity", 1e-6),
subtickExit = transition(subtick.exit()).style("opacity", 1e-6).remove(),
subtickUpdate = transition(subtick).style("opacity", 1);

// Major ticks.
var tick = g.selectAll("g").data(ticks, String),
tickEnter = tick.enter().insert("svg:g", "path").style("opacity", 1e-6),
tickEnter = tick.enter().insert("g", "path").style("opacity", 1e-6),
tickExit = transition(tick.exit()).style("opacity", 1e-6).remove(),
tickUpdate = transition(tick).style("opacity", 1),
tickTransform;

// Domain.
var range = d3_scaleRange(scale),
path = g.selectAll(".domain").data([0]),
pathEnter = path.enter().append("svg:path").attr("class", "domain"),
pathEnter = path.enter().append("path").attr("class", "domain"),
pathUpdate = transition(path);

// Stash a snapshot of the new scale, and retrieve the old snapshot.
var scale1 = scale.copy(),
scale0 = this.__chart__ || scale1;
this.__chart__ = scale1;

tickEnter.append("svg:line").attr("class", "tick");
tickEnter.append("svg:text");
tickEnter.append("line").attr("class", "tick");
tickEnter.append("text");
tickUpdate.select("text").text(tickFormat);

switch (orient) {
Expand Down Expand Up @@ -3991,19 +3991,19 @@ d3.svg.brush = function() {
e;

// An invisible, mouseable area for starting a new brush.
bg.enter().append("svg:rect")
bg.enter().append("rect")
.attr("class", "background")
.style("visibility", "hidden")
.style("pointer-events", "all")
.style("cursor", "crosshair");

// The visible brush extent; style this as you like!
fg.enter().append("svg:rect")
fg.enter().append("rect")
.attr("class", "extent")
.style("cursor", "move");

// More invisible rects for resizing the extent.
tz.enter().append("svg:rect")
tz.enter().append("rect")
.attr("class", function(d) { return "resize " + d; })
.attr("width", 6)
.attr("height", 6)
Expand Down
4 changes: 2 additions & 2 deletions d3.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/albers/albers.html
Expand Up @@ -47,18 +47,18 @@ <h3>Albers Projection</h3>
path = d3.geo.path().projection(xy);

d3.select("body")
.append("svg:svg")
.append("svg:g")
.append("svg")
.append("g")
.attr("id", "states");

d3.json("../data/us-states.json", function(collection) {
d3.select("#states")
.selectAll("path")
.data(collection.features)
.enter().append("svg:path")
.enter().append("path")
.attr("d", path);
d3.select("#states")
.append("svg:circle")
.append("circle")
.attr("r", 10)
.attr("transform", "translate(" + xy(xy.origin()).join(",") + ")")
});
Expand Down
8 changes: 4 additions & 4 deletions examples/area/area-radial.html
Expand Up @@ -23,21 +23,21 @@
var r = 960 / 2,
data = d3.range(361).map(function(i) { return .8 + Math.sin(i / 20 * Math.PI) / 6; });

var svg = d3.select("body").append("svg:svg")
var svg = d3.select("body").append("svg")
.data([data])
.attr("width", r * 2)
.attr("height", r * 2)
.append("svg:g")
.append("g")
.attr("transform", "translate(" + r + "," + r + ")");

svg.append("svg:path")
svg.append("path")
.attr("class", "area")
.attr("d", d3.svg.area.radial()
.innerRadius(r / 2)
.outerRadius(function(d) { return r * d; })
.angle(function(d, i) { return i / 180 * Math.PI; }));

svg.append("svg:path")
svg.append("path")
.attr("class", "line")
.attr("d", d3.svg.line.radial()
.radius(function(d) { return r * d; })
Expand Down
20 changes: 10 additions & 10 deletions examples/area/area.html
Expand Up @@ -48,61 +48,61 @@
y = d3.scale.linear().domain([0, 1]).range([h, 0]);

var vis = d3.select("body")
.append("svg:svg")
.append("svg")
.data([data])
.attr("width", w + p * 2)
.attr("height", h + p * 2)
.append("svg:g")
.append("g")
.attr("transform", "translate(" + p + "," + p + ")");

var rules = vis.selectAll("g.rule")
.data(x.ticks(10))
.enter().append("svg:g")
.enter().append("g")
.attr("class", "rule");

rules.append("svg:line")
rules.append("line")
.attr("x1", x)
.attr("x2", x)
.attr("y1", 0)
.attr("y2", h - 1);

rules.append("svg:line")
rules.append("line")
.attr("class", function(d) { return d ? null : "axis"; })
.attr("y1", y)
.attr("y2", y)
.attr("x1", 0)
.attr("x2", w + 1);

rules.append("svg:text")
rules.append("text")
.attr("x", x)
.attr("y", h + 3)
.attr("dy", ".71em")
.attr("text-anchor", "middle")
.text(x.tickFormat(10));

rules.append("svg:text")
rules.append("text")
.attr("y", y)
.attr("x", -3)
.attr("dy", ".35em")
.attr("text-anchor", "end")
.text(y.tickFormat(10));

vis.append("svg:path")
vis.append("path")
.attr("class", "area")
.attr("d", d3.svg.area()
.x(function(d) { return x(d.x); })
.y0(h - 1)
.y1(function(d) { return y(d.y); }));

vis.append("svg:path")
vis.append("path")
.attr("class", "line")
.attr("d", d3.svg.line()
.x(function(d) { return x(d.x); })
.y(function(d) { return y(d.y); }));

vis.selectAll("circle.area")
.data(data)
.enter().append("svg:circle")
.enter().append("circle")
.attr("class", "area")
.attr("cx", function(d) { return x(d.x); })
.attr("cy", function(d) { return y(d.y); })
Expand Down
8 changes: 4 additions & 4 deletions examples/axis/axis-alternating.html
Expand Up @@ -29,18 +29,18 @@
x = d3.scale.linear().domain([.05, .95]).range([0, w]),
y = d3.scale.linear().range([0, h]);

var svg = d3.select("body").append("svg:svg")
var svg = d3.select("body").append("svg")
.attr("width", w + m[1] + m[3])
.attr("height", h + m[0] + m[2])
.append("svg:g")
.append("g")
.attr("transform", "translate(" + m[3] + "," + m[0] + ")");

svg.append("svg:g")
svg.append("g")
.attr("class", "x minor")
.attr("transform", "translate(0," + h + ")")
.call(d3.svg.axis().scale(x).tickSubdivide(2).tickSize(-6));

svg.append("svg:g")
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + h + ")")
.call(d3.svg.axis().scale(x));
Expand Down
10 changes: 5 additions & 5 deletions examples/axis/axis-ggplot2.html
Expand Up @@ -43,22 +43,22 @@
x = d3.scale.linear().domain([.05, .95]).range([0, w]),
y = d3.scale.linear().range([0, h]);

var svg = d3.select("body").append("svg:svg")
var svg = d3.select("body").append("svg")
.attr("width", w + m[1] + m[3])
.attr("height", h + m[0] + m[2])
.append("svg:g")
.append("g")
.attr("transform", "translate(" + m[3] + "," + m[0] + ")");

svg.append("svg:rect")
svg.append("rect")
.attr("width", w)
.attr("height", h);

svg.append("svg:g")
svg.append("g")
.attr("class", "x grid")
.attr("transform", "translate(0," + h + ")")
.call(d3.svg.axis().scale(x).tickSubdivide(1).tickSize(-h));

svg.append("svg:g")
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + h + ")")
.call(d3.svg.axis().scale(x));
Expand Down
12 changes: 6 additions & 6 deletions examples/axis/axis-multiples.html
Expand Up @@ -82,30 +82,30 @@
// Add an SVG element for each symbol, with the desired dimensions and margin.
var svg = d3.select("body").selectAll("svg")
.data(symbols)
.enter().append("svg:svg")
.enter().append("svg")
.attr("width", w + m[1] + m[3])
.attr("height", h + m[0] + m[2])
.append("svg:g")
.append("g")
.attr("transform", "translate(" + m[3] + "," + m[0] + ")");

// Add the area path elements. Note: the y-domain is set per element.
svg.append("svg:path")
svg.append("path")
.attr("class", "area")
.attr("d", function(d) { y.domain([0, d.maxPrice]); return area(d.values); });

// Add the x-axis.
svg.append("svg:g")
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + h + ")")
.call(xAxis);

// Add the line path elements. Note: the y-domain is set per element.
svg.append("svg:path")
svg.append("path")
.attr("class", "line")
.attr("d", function(d) { y.domain([0, d.maxPrice]); return line(d.values); });

// Add a small label for the symbol name.
svg.append("svg:text")
svg.append("text")
.attr("x", w - 6)
.attr("y", h - 6)
.attr("text-anchor", "end")
Expand Down
12 changes: 6 additions & 6 deletions examples/axis/axis-orientations.html
Expand Up @@ -34,26 +34,26 @@
var yAxis = d3.svg.axis()
.scale(y);

var svg = d3.select("body").append("svg:svg")
var svg = d3.select("body").append("svg")
.attr("width", w + m[1] + m[3])
.attr("height", h + m[0] + m[2])
.append("svg:g")
.append("g")
.attr("transform", "translate(" + m[3] + "," + m[0] + ")");

svg.append("svg:g")
svg.append("g")
.attr("class", "bottom axis")
.attr("transform", "translate(0," + h + ")")
.call(xAxis.orient("bottom"));

svg.append("svg:g")
svg.append("g")
.attr("class", "top axis")
.call(xAxis.orient("top"));

svg.append("svg:g")
svg.append("g")
.attr("class", "left axis")
.call(yAxis.orient("left"));

svg.append("svg:g")
svg.append("g")
.attr("class", "right axis")
.attr("transform", "translate(" + w + ",0)")
.call(yAxis.orient("right"));
Expand Down
18 changes: 9 additions & 9 deletions examples/axis/axis-transition.html
Expand Up @@ -91,45 +91,45 @@
y.domain([0, d3.max(values, function(d) { return d.price; })]);

// Add an SVG element with the desired dimensions and margin.
var svg = d3.select("body").append("svg:svg")
var svg = d3.select("body").append("svg")
.attr("width", w + m[1] + m[3])
.attr("height", h + m[0] + m[2])
.append("svg:g")
.append("g")
.attr("transform", "translate(" + m[3] + "," + m[0] + ")");

// Add the clip path.
svg.append("svg:clipPath")
svg.append("clipPath")
.attr("id", "clip")
.append("svg:rect")
.append("rect")
.attr("width", w)
.attr("height", h);

// Add the area path.
svg.append("svg:path")
svg.append("path")
.attr("class", "area")
.attr("clip-path", "url(#clip)")
.attr("d", area(values));

// Add the x-axis.
svg.append("svg:g")
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + h + ")")
.call(xAxis);

// Add the y-axis.
svg.append("svg:g")
svg.append("g")
.attr("class", "y axis")
.attr("transform", "translate(" + w + ",0)")
.call(yAxis);

// Add the line path.
svg.append("svg:path")
svg.append("path")
.attr("class", "line")
.attr("clip-path", "url(#clip)")
.attr("d", line(values));

// Add a small label for the symbol name.
svg.append("svg:text")
svg.append("text")
.attr("x", w - 6)
.attr("y", h - 6)
.attr("text-anchor", "end")
Expand Down

0 comments on commit fe671a7

Please sign in to comment.