From d9abb069ec5976414982a2c344d7e55413224a22 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 14 Oct 2011 10:03:06 -0500 Subject: Update d3 JS resources to latest version This fixes an issue I discovered in attribute transition values in IE. Signed-off-by: Dan McGee --- media/d3.js | 270 ++++++++++++++++++++++++++++++++++--------------- media/d3.layout.js | 113 +++++++++++---------- media/d3.layout.min.js | 2 +- media/d3.min.js | 4 +- 4 files changed, 251 insertions(+), 138 deletions(-) diff --git a/media/d3.js b/media/d3.js index 9b77bec..23edb6b 100644 --- a/media/d3.js +++ b/media/d3.js @@ -10,7 +10,7 @@ try { d3_style_setProperty.call(this, name, value + "", priority); }; } -d3 = {version: "2.3.0"}; // semver +d3 = {version: "2.4.3"}; // semver var d3_array = d3_arraySlice; // conversion for NodeLists function d3_arrayCopy(pseudoarray) { @@ -59,6 +59,24 @@ d3.ascending = function(a, b) { d3.descending = function(a, b) { return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; }; +d3.mean = function(array, f) { + var n = array.length, + a, + m = 0, + i = -1, + j = 0; + if (arguments.length === 1) { + while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j; + } else { + while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j; + } + return j ? m : undefined; +}; +d3.median = function(array, f) { + if (arguments.length > 1) array = array.map(f); + array = array.filter(d3_number); + return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined; +}; d3.min = function(array, f) { var i = -1, n = array.length, @@ -87,6 +105,9 @@ d3.max = function(array, f) { } return a; }; +function d3_number(x) { + return x != null && !isNaN(x); +} d3.sum = function(array, f) { var s = 0, n = array.length, @@ -472,10 +493,11 @@ d3.format = function(specifier) { comma = match[7], precision = match[8], type = match[9], - percentage = false, + scale = 1, + suffix = "", integer = false; - if (precision) precision = precision.substring(1); + if (precision) precision = +precision.substring(1); if (zfill) { fill = "0"; // TODO align = "="; @@ -484,22 +506,36 @@ d3.format = function(specifier) { switch (type) { case "n": comma = true; type = "g"; break; - case "%": percentage = true; type = "f"; break; - case "p": percentage = true; type = "r"; break; - case "d": integer = true; precision = "0"; break; + case "%": scale = 100; suffix = "%"; type = "f"; break; + case "p": scale = 100; suffix = "%"; type = "r"; break; + case "d": integer = true; precision = 0; break; + case "s": scale = -1; type = "r"; break; } + // If no precision is specified for r, fallback to general notation. + if (type == "r" && !precision) type = "g"; + type = d3_format_types[type] || d3_format_typeDefault; return function(value) { - var number = percentage ? value * 100 : +value, - negative = (number < 0) && (number = -number) ? "\u2212" : sign; // Return the empty string for floats formatted as ints. - if (integer && (number % 1)) return ""; + if (integer && (value % 1)) return ""; - // Convert the input value to the desired precision. - value = type(number, precision); + // Convert negative to positive, and record the sign prefix. + var negative = (value < 0) && (value = -value) ? "\u2212" : sign; + + // Apply the scale, computing it from the value's exponent for si format. + if (scale < 0) { + var prefix = d3.formatPrefix(value, precision); + value *= prefix.scale; + suffix = prefix.symbol; + } else { + value *= scale; + } + + // Convert to the desired precision. + value = type(value, precision); // If the fill character is 0, the sign and group is applied after the fill. if (zfill) { @@ -516,9 +552,8 @@ d3.format = function(specifier) { var length = value.length; if (length < width) value = new Array(width - length + 1).join(fill) + value; } - if (percentage) value += "%"; - return value; + return value + suffix; }; }; @@ -529,12 +564,13 @@ var d3_format_types = { g: function(x, p) { return x.toPrecision(p); }, e: function(x, p) { return x.toExponential(p); }, f: function(x, p) { return x.toFixed(p); }, - r: function(x, p) { - var n = x ? 1 + Math.floor(1e-15 + Math.log(x) / Math.LN10) : 1; - return d3.round(x, p - n).toFixed(Math.max(0, Math.min(20, p - n))); - } + r: function(x, p) { return d3.round(x, p = d3_format_precision(x, p)).toFixed(Math.max(0, Math.min(20, p))); } }; +function d3_format_precision(x, p) { + return p - (x ? 1 + Math.floor(Math.log(x + Math.pow(10, 1 + Math.floor(Math.log(x) / Math.LN10) - p)) / Math.LN10) : 1); +} + function d3_format_typeDefault(x) { return x + ""; } @@ -547,6 +583,26 @@ function d3_format_group(value) { while (i > 0) t.push(value.substring(i -= 3, i + 3)); return t.reverse().join(",") + f; } +var d3_formatPrefixes = ["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(d3_formatPrefix); + +d3.formatPrefix = function(value, precision) { + var i = 0; + if (value) { + if (value < 0) value *= -1; + if (precision) value = d3.round(value, d3_format_precision(value, precision)); + i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10); + i = Math.max(-24, Math.min(24, Math.floor((i <= 0 ? i + 1 : i - 1) / 3) * 3)); + } + return d3_formatPrefixes[8 + i / 3]; +}; + +function d3_formatPrefix(d, i) { + return { + scale: Math.pow(10, (8 - i) * 3), + symbol: d + }; +} + /* * TERMS OF USE - EASING EQUATIONS * @@ -780,10 +836,10 @@ d3.interpolateRgb = function(a, b) { bg = b.g - ag, bb = b.b - ab; return function(t) { - return "rgb(" + Math.round(ar + br * t) - + "," + Math.round(ag + bg * t) - + "," + Math.round(ab + bb * t) - + ")"; + return "#" + + d3_rgb_hex(Math.round(ar + br * t)) + + d3_rgb_hex(Math.round(ag + bg * t)) + + d3_rgb_hex(Math.round(ab + bb * t)); }; }; @@ -867,7 +923,8 @@ function d3_uninterpolateClamp(a, b) { } d3.rgb = function(r, g, b) { return arguments.length === 1 - ? d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) + ? (r instanceof d3_Rgb ? d3_rgb(r.r, r.g, r.b) + : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb)) : d3_rgb(~~r, ~~g, ~~b); }; @@ -892,17 +949,17 @@ d3_Rgb.prototype.brighter = function(k) { if (g && g < i) g = i; if (b && b < i) b = i; return d3_rgb( - Math.min(255, Math.floor(r / k)), - Math.min(255, Math.floor(g / k)), - Math.min(255, Math.floor(b / k))); + Math.min(255, Math.floor(r / k)), + Math.min(255, Math.floor(g / k)), + Math.min(255, Math.floor(b / k))); }; d3_Rgb.prototype.darker = function(k) { k = Math.pow(0.7, arguments.length ? k : 1); return d3_rgb( - Math.max(0, Math.floor(k * this.r)), - Math.max(0, Math.floor(k * this.g)), - Math.max(0, Math.floor(k * this.b))); + Math.floor(k * this.r), + Math.floor(k * this.g), + Math.floor(k * this.b)); }; d3_Rgb.prototype.hsl = function() { @@ -914,7 +971,9 @@ d3_Rgb.prototype.toString = function() { }; function d3_rgb_hex(v) { - return v < 0x10 ? "0" + v.toString(16) : v.toString(16); + return v < 0x10 + ? "0" + Math.max(0, v).toString(16) + : Math.min(255, v).toString(16); } function d3_rgb_parse(format, rgb, hsl) { @@ -1151,7 +1210,8 @@ for (var d3_rgb_name in d3_rgb_names) { } d3.hsl = function(h, s, l) { return arguments.length === 1 - ? d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) + ? (h instanceof d3_Hsl ? d3_hsl(h.h, h.s, h.l) + : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl)) : d3_hsl(+h, +s, +l); }; @@ -1180,7 +1240,7 @@ d3_Hsl.prototype.rgb = function() { }; d3_Hsl.prototype.toString = function() { - return "hsl(" + this.h + "," + this.s * 100 + "%," + this.l * 100 + "%)"; + return this.rgb().toString(); }; function d3_hsl_rgb(h, s, l) { @@ -1331,6 +1391,21 @@ d3_selectionPrototype.attr = function(name, value) { : (name.local ? attrConstantNS : attrConstant))); }; d3_selectionPrototype.classed = function(name, value) { + var names = name.split(d3_selection_classedWhitespace), + n = names.length, + i = -1; + if (arguments.length > 1) { + while (++i < n) d3_selection_classed.call(this, names[i], value); + return this; + } else { + while (++i < n) if (!d3_selection_classed.call(this, names[i])) return false; + return true; + } +}; + +var d3_selection_classedWhitespace = /\s+/g; + +function d3_selection_classed(name, value) { var re = new RegExp("(^|\\s+)" + d3.requote(name) + "(\\s+|$)", "g"); // If no value is specified, return the first value. @@ -1375,7 +1450,7 @@ d3_selectionPrototype.classed = function(name, value) { ? classedFunction : value ? classedAdd : classedRemove); -}; +} d3_selectionPrototype.style = function(name, value, priority) { if (arguments.length < 3) priority = ""; @@ -1856,10 +1931,28 @@ function d3_transition(groups, id) { return groups; } +var d3_transitionRemove = {}; + +function d3_transitionNull(d, i, a) { + return a != "" && d3_transitionRemove; +} + function d3_transitionTween(b) { - return typeof b === "function" - ? function(d, i, a) { var v = b.call(this, d, i) + ""; return a != v && d3.interpolate(a, v); } - : (b = b + "", function(d, i, a) { return a != b && d3.interpolate(a, b); }); + + function transitionFunction(d, i, a) { + var v = b.call(this, d, i); + return v == null + ? a != "" && d3_transitionRemove + : a != v && d3.interpolate(a, v); + } + + function transitionString(d, i, a) { + return a != b && d3.interpolate(a, b); + } + + return typeof b === "function" ? transitionFunction + : b == null ? d3_transitionNull + : (b += "", transitionString); } var d3_transitionPrototype = [], @@ -1899,6 +1992,7 @@ d3_transitionPrototype.select = function(selector) { d3_transitionPrototype.selectAll = function(selector) { var subgroups = [], subgroup, + subnodes, node; if (typeof selector !== "function") selector = d3_selection_selectorAll(selector); @@ -1906,9 +2000,10 @@ d3_transitionPrototype.selectAll = function(selector) { for (var j = -1, m = this.length; ++j < m;) { for (var group = this[j], i = -1, n = group.length; ++i < n;) { if (node = group[i]) { - subgroups.push(subgroup = selector.call(node.node, node.node.__data__, i)); - for (var k = -1, o = subgroup.length; ++k < o;) { - subgroup[k] = {node: subgroup[k], delay: node.delay, duration: node.duration}; + subnodes = selector.call(node.node, node.node.__data__, i); + subgroups.push(subgroup = []); + for (var k = -1, o = subnodes.length; ++k < o;) { + subgroup.push({node: subnodes[k], delay: node.delay, duration: node.duration}); } } } @@ -1920,24 +2015,24 @@ d3_transitionPrototype.attr = function(name, value) { return this.attrTween(name, d3_transitionTween(value)); }; -d3_transitionPrototype.attrTween = function(name, tween) { - name = d3.ns.qualify(name); +d3_transitionPrototype.attrTween = function(nameNS, tween) { + var name = d3.ns.qualify(nameNS); function attrTween(d, i) { var f = tween.call(this, d, i, this.getAttribute(name)); - return f && function(t) { - this.setAttribute(name, f(t)); - }; + return f === d3_transitionRemove + ? (this.removeAttribute(name), null) + : f && function(t) { this.setAttribute(name, f(t)); }; } function attrTweenNS(d, i) { var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local)); - return f && function(t) { - this.setAttributeNS(name.space, name.local, f(t)); - }; + return f === d3_transitionRemove + ? (this.removeAttributeNS(name.space, name.local), null) + : f && function(t) { this.setAttributeNS(name.space, name.local, f(t)); }; } - return this.tween("attr." + name, name.local ? attrTweenNS : attrTween); + return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween); }; d3_transitionPrototype.style = function(name, value, priority) { if (arguments.length < 3) priority = ""; @@ -1948,9 +2043,9 @@ d3_transitionPrototype.styleTween = function(name, tween, priority) { if (arguments.length < 3) priority = ""; return this.tween("style." + name, function(d, i) { var f = tween.call(this, d, i, window.getComputedStyle(this, null).getPropertyValue(name)); - return f && function(t) { - this.style.setProperty(name, f(t), priority); - }; + return f === d3_transitionRemove + ? (this.style.removeProperty(name), null) + : f && function(t) { this.style.setProperty(name, f(t), priority); }; }); }; d3_transitionPrototype.text = function(value) { @@ -2113,9 +2208,12 @@ function d3_scale_nice(domain, nice) { dx = x0; x0 = x1; x1 = dx; } - nice = nice(x1 - x0); - domain[i0] = nice.floor(x0); - domain[i1] = nice.ceil(x1); + if (dx = x1 - x0) { + nice = nice(dx); + domain[i0] = nice.floor(x0); + domain[i1] = nice.ceil(x1); + } + return domain; } @@ -3147,16 +3245,17 @@ function d3_svg_area(projection) { x1 = d3_svg_lineX, y0 = 0, y1 = d3_svg_lineY, - interpolate = "linear", - interpolator = d3_svg_lineInterpolators[interpolate], + interpolate, + i0, + i1, tension = .7; function area(d) { if (d.length < 1) return null; var points0 = d3_svg_linePoints(this, d, x0, y0), points1 = d3_svg_linePoints(this, d, x0 === x1 ? d3_svg_areaX(points0) : x1, y0 === y1 ? d3_svg_areaY(points0) : y1); - return "M" + interpolator(projection(points1), tension) - + "L" + interpolator(projection(points0.reverse()), tension) + return "M" + i0(projection(points1), tension) + + "L" + i1(projection(points0.reverse()), tension) + "Z"; } @@ -3198,7 +3297,8 @@ function d3_svg_area(projection) { area.interpolate = function(x) { if (!arguments.length) return interpolate; - interpolator = d3_svg_lineInterpolators[interpolate = x]; + i0 = d3_svg_lineInterpolators[interpolate = x]; + i1 = i0.reverse || i0; return area; }; @@ -3208,9 +3308,12 @@ function d3_svg_area(projection) { return area; }; - return area; + return area.interpolate("linear"); } +d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter; +d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore; + d3.svg.area = function() { return d3_svg_area(Object); }; @@ -3545,6 +3648,20 @@ d3.svg.axis = function() { selection.each(function(d, i, j) { var g = d3.select(this); + // If selection is a transition, create subtransitions. + var transition = selection.delay ? function(o) { + var id = d3_transitionInheritId; + try { + d3_transitionInheritId = selection.id; + return o.transition() + .delay(selection[j][i].delay) + .duration(selection[j][i].duration) + .ease(selection.ease()); + } finally { + d3_transitionInheritId = id; + } + } : Object; + // Ticks. var ticks = scale.ticks.apply(scale, tickArguments_), tickFormat = tickFormat_ == null ? scale.tickFormat.apply(scale, tickArguments_) : tickFormat_; @@ -3580,37 +3697,33 @@ d3.svg.axis = function() { switch (orient) { case "bottom": { tickTransform = d3_svg_axisX; - subtickUpdate.attr("y2", tickMinorSize); - tickEnter.select("text").attr("dy", ".71em").attr("text-anchor", "middle"); - tickUpdate.select("line").attr("y2", tickMajorSize); - tickUpdate.select("text").attr("y", Math.max(tickMajorSize, 0) + tickPadding); + subtickUpdate.attr("x2", 0).attr("y2", tickMinorSize); + tickUpdate.select("line").attr("x2", 0).attr("y2", tickMajorSize); + tickUpdate.select("text").attr("x", 0).attr("y", Math.max(tickMajorSize, 0) + tickPadding).attr("dy", ".71em").attr("text-anchor", "middle"); pathUpdate.attr("d", "M" + range[0] + "," + tickEndSize + "V0H" + range[1] + "V" + tickEndSize); break; } case "top": { tickTransform = d3_svg_axisX; - subtickUpdate.attr("y2", -tickMinorSize); - tickEnter.select("text").attr("text-anchor", "middle"); - tickUpdate.select("line").attr("y2", -tickMajorSize); - tickUpdate.select("text").attr("y", -(Math.max(tickMajorSize, 0) + tickPadding)); + subtickUpdate.attr("x2", 0).attr("y2", -tickMinorSize); + tickUpdate.select("line").attr("x2", 0).attr("y2", -tickMajorSize); + tickUpdate.select("text").attr("x", 0).attr("y", -(Math.max(tickMajorSize, 0) + tickPadding)).attr("dy", "0em").attr("text-anchor", "middle"); pathUpdate.attr("d", "M" + range[0] + "," + -tickEndSize + "V0H" + range[1] + "V" + -tickEndSize); break; } case "left": { tickTransform = d3_svg_axisY; - subtickUpdate.attr("x2", -tickMinorSize); - tickEnter.select("text").attr("dy", ".32em").attr("text-anchor", "end"); - tickUpdate.select("line").attr("x2", -tickMajorSize); - tickUpdate.select("text").attr("x", -(Math.max(tickMajorSize, 0) + tickPadding)); + subtickUpdate.attr("x2", -tickMinorSize).attr("y2", 0); + tickUpdate.select("line").attr("x2", -tickMajorSize).attr("y2", 0); + tickUpdate.select("text").attr("x", -(Math.max(tickMajorSize, 0) + tickPadding)).attr("y", 0).attr("dy", ".32em").attr("text-anchor", "end"); pathUpdate.attr("d", "M" + -tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + -tickEndSize); break; } case "right": { tickTransform = d3_svg_axisY; - subtickUpdate.attr("x2", tickMinorSize); - tickEnter.select("text").attr("dy", ".32em"); - tickUpdate.select("line").attr("x2", tickMajorSize); - tickUpdate.select("text").attr("x", Math.max(tickMajorSize, 0) + tickPadding); + subtickUpdate.attr("x2", tickMinorSize).attr("y2", 0); + tickUpdate.select("line").attr("x2", tickMajorSize).attr("y2", 0); + tickUpdate.select("text").attr("x", Math.max(tickMajorSize, 0) + tickPadding).attr("y", 0).attr("dy", ".32em").attr("text-anchor", "start"); pathUpdate.attr("d", "M" + tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + tickEndSize); break; } @@ -3623,13 +3736,6 @@ d3.svg.axis = function() { subtickEnter.call(tickTransform, scale0); subtickUpdate.call(tickTransform, scale); subtickExit.call(tickTransform, scale); - - function transition(o) { - return selection.delay ? o.transition() - .delay(selection[j][i].delay) - .duration(selection[j][i].duration) - .ease(selection.ease()) : o; - } }); } diff --git a/media/d3.layout.js b/media/d3.layout.js index bcfddc0..2bfb9d3 100644 --- a/media/d3.layout.js +++ b/media/d3.layout.js @@ -560,9 +560,9 @@ d3.layout.partition = function() { node.y = node.depth * dy; node.dx = dx; node.dy = dy; - if (children) { + if (children && (n = children.length)) { var i = -1, - n = children.length, + n, c, d; dx = node.value ? dx / node.value : 0; @@ -576,9 +576,9 @@ d3.layout.partition = function() { function depth(node) { var children = node.children, d = 0; - if (children) { + if (children && (n = children.length)) { var i = -1, - n = children.length; + n; while (++i < n) d = Math.max(d, depth(children[i])); } return 1 + d; @@ -1477,9 +1477,9 @@ d3.layout.tree = function() { function secondWalk(node, x) { node.x = node._tree.prelim + x; var children = node.children; - if (children) { + if (children && (n = children.length)) { var i = -1, - n = children.length; + n; x += node._tree.mod; while (++i < n) { secondWalk(children[i], x); @@ -1584,18 +1584,21 @@ function d3_layout_treeSeparation(a, b) { // } function d3_layout_treeLeft(node) { - return node.children ? node.children[0] : node._tree.thread; + var children = node.children; + return children && children.length ? children[0] : node._tree.thread; } function d3_layout_treeRight(node) { - return node.children ? node.children[node.children.length - 1] : node._tree.thread; + var children = node.children, + n; + return children && (n = children.length) ? children[n - 1] : node._tree.thread; } function d3_layout_treeSearch(node, compare) { var children = node.children; - if (children) { + if (children && (n = children.length)) { var child, - n = children.length, + n, i = -1; while (++i < n) { if (compare(child = d3_layout_treeSearch(children[i], compare), node) > 0) { @@ -1621,11 +1624,11 @@ function d3_layout_treeDeepest(a, b) { function d3_layout_treeVisitAfter(node, callback) { function visit(node, previousSibling) { var children = node.children; - if (children) { + if (children && (n = children.length)) { var child, previousChild = null, i = -1, - n = children.length; + n; while (++i < n) { child = children[i]; visit(child, previousChild); @@ -1693,57 +1696,61 @@ d3.layout.treemap = function() { // Recursively arranges the specified node's children into squarified rows. function squarify(node) { - if (!node.children) return; - var rect = pad(node), - row = [], - children = node.children.slice(), // copy-on-write - child, - best = Infinity, // the best row score so far - score, // the current row score - u = Math.min(rect.dx, rect.dy), // initial orientation - n; - scale(children, rect.dx * rect.dy / node.value); - row.area = 0; - while ((n = children.length) > 0) { - row.push(child = children[n - 1]); - row.area += child.area; - if ((score = worst(row, u)) <= best) { // continue with this orientation - children.pop(); - best = score; - } else { // abort, and try a different orientation - row.area -= row.pop().area; - position(row, u, rect, false); - u = Math.min(rect.dx, rect.dy); + var children = node.children; + if (children && children.length) { + var rect = pad(node), + row = [], + remaining = children.slice(), // copy-on-write + child, + best = Infinity, // the best row score so far + score, // the current row score + u = Math.min(rect.dx, rect.dy), // initial orientation + n; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while ((n = remaining.length) > 0) { + row.push(child = remaining[n - 1]); + row.area += child.area; + if ((score = worst(row, u)) <= best) { // continue with this orientation + remaining.pop(); + best = score; + } else { // abort, and try a different orientation + row.area -= row.pop().area; + position(row, u, rect, false); + u = Math.min(rect.dx, rect.dy); + row.length = row.area = 0; + best = Infinity; + } + } + if (row.length) { + position(row, u, rect, true); row.length = row.area = 0; - best = Infinity; } + children.forEach(squarify); } - if (row.length) { - position(row, u, rect, true); - row.length = row.area = 0; - } - node.children.forEach(squarify); } // Recursively resizes the specified node's children into existing rows. // Preserves the existing layout! function stickify(node) { - if (!node.children) return; - var rect = pad(node), - children = node.children.slice(), // copy-on-write - child, - row = []; - scale(children, rect.dx * rect.dy / node.value); - row.area = 0; - while (child = children.pop()) { - row.push(child); - row.area += child.area; - if (child.z != null) { - position(row, child.z ? rect.dx : rect.dy, rect, !children.length); - row.length = row.area = 0; + var children = node.children; + if (children && children.length) { + var rect = pad(node), + remaining = children.slice(), // copy-on-write + child, + row = []; + scale(remaining, rect.dx * rect.dy / node.value); + row.area = 0; + while (child = remaining.pop()) { + row.push(child); + row.area += child.area; + if (child.z != null) { + position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length); + row.length = row.area = 0; + } } + children.forEach(stickify); } - node.children.forEach(stickify); } // Computes the score for the specified row, as the worst aspect ratio. diff --git a/media/d3.layout.min.js b/media/d3.layout.min.js index e49c8c7..c7016b5 100644 --- a/media/d3.layout.min.js +++ b/media/d3.layout.min.js @@ -1 +1 @@ -(function(){function bc(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];e<0&&(c+=e/2,e=0),f<0&&(d+=f/2,f=0);return{x:c,y:d,dx:e,dy:f}}function bb(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function ba(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function _(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function $(a){var b=0,c=0,d=a.children,e=d.length,f;while(--e>=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function Z(a,b){function c(a,d){var e=a.children;if(e){var f,g=null,h=-1,i=e.length;while(++h0&&(a=d)}return a}function U(a){return a.children?a.children[a.children.length-1]:a._tree.thread}function T(a){return a.children?a.children[0]:a._tree.thread}function S(a,b){return a.parent==b.parent?1:2}function R(a){var b=a.children,c;return b&&(c=b.length)?R(b[c-1]):a}function Q(a){var b=a.children;return b&&b.length?Q(b[0]):a}function P(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function O(a){return 1+d3.max(a,function(a){return a.y})}function N(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=Math.sqrt(e*e+f*f),i=Math.max(-1,Math.min(1,(d*d+h*h-g*g)/(2*d*h))),j=Math.acos(i),k=i*(d/=h),l=Math.sin(j)*d;c.x=a.x+k*e+l*f,c.y=a.y+k*f-l*e}else c.x=a.x+d,c.y=a.y}function M(a,b,c,d){var e=a.children;a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d;if(e){var f=-1,g=e.length;while(++f1){h=a[1],h.x=h.r,h.y=0,l(h);if(f>2){i=a[2],N(g,h,i),l(i),F(g,i),g._pack_prev=i,F(i,h),h=g._pack_next;for(var m=3;m0?(G(g,j),h=j,m--):(G(j,h),g=j,m--)}}}var q=(b+c)/2,r=(d+e)/2,s=0;for(var m=0;m.001}function G(a,b){a._pack_next=b,b._pack_prev=a}function F(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function E(a,b){return a.value-b.value}function C(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function B(a,b){return b.value-a.value}function A(a){return a.value}function z(a){return a.children}function y(a,b){a.sort=d3.rebind(a,b.sort),a.children=d3.rebind(a,b.children),a.links=C,a.value=d3.rebind(a,b.value),a.nodes=function(b){D=!0;return(a.nodes=a)(b)};return a}function x(a){return[d3.min(a),d3.max(a)]}function w(a,b){var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];while(++c<=b)f[c]=e*c+d;return f}function v(a,b){return w(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function u(a,b){return a+b[1]}function t(a){return a.reduce(u,0)}function s(a){var b=1,c=0,d=a[0][1],e,f=a.length;for(;bd&&(c=b,d=e);return c}function p(a,b,c){a.y0=b,a.y=c}function o(a){return a.y}function n(a){return a.x}function m(a){return 1}function l(a){return 20}function k(a,b,c){var d=0,e=0;a.charge=0;if(!a.leaf){var f=a.nodes,g=f.length,h=-1,i;while(++he&&(e=h),d.push(h)}for(g=0;g=i[0]&&o<=i[1]&&(k=g[d3.bisect(j,o,1,m)-1],k.y+=n,k.push(e[f]));return g}var a=!0,b=Number,c=x,d=v;e.value=function(a){if(!arguments.length)return b;b=a;return e},e.range=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.bins=function(a){if(!arguments.length)return d;d=typeof a=="number"?function(b){return w(b,a)}:d3.functor(a);return e},e.frequency=function(b){if(!arguments.length)return a;a=!!b;return e};return e},d3.layout.hierarchy=function(){function g(a){var b=[];e(a,0,b);return b}function f(a,b){var d=a.children,e=0;if(d&&(i=d.length)){var h=-1,i,j=b+1;while(++h0&&(_(ba(g,a,d),a,m),i+=m,j+=m),k+=g._tree.mod,i+=e._tree.mod,l+=h._tree.mod,j+=f._tree.mod;g&&!U(f)&&(f._tree.thread=g,f._tree.mod+=k-j),e&&!T(h)&&(h._tree.thread=e,h._tree.mod+=i-l,d=a)}return d}function i(a,b){a.x=a._tree.prelim+b;var c=a.children;if(c){var d=-1,e=c.length;b+=a._tree.mod;while(++dd.dy)j=j?d.dy:0;while(++fd.dx)j=j?d.dx:0;while(++fe&&(e=d)}c*=c,b*=b;return c?Math.max(b*e*h/c,c/(b*f*h)):Infinity}function k(a){if(!!a.children){var b=e(a),c=a.children.slice(),d,f=[];i(c,b.dx*b.dy/a.value),f.area=0;while(d=c.pop())f.push(d),f.area+=d.area,d.z!=null&&(m(f,d.z?b.dx:b.dy,b,!c.length),f.length=f.area=0);a.children.forEach(k)}}function j(a){if(!!a.children){var b=e(a),c=[],d=a.children.slice(),f,g=Infinity,h,k=Math.min(b.dx,b.dy),n;i(d,b.dx*b.dy/a.value),c.area=0;while((n=d.length)>0)c.push(f=d[n-1]),c.area+=f.area,(h=l(c,k))<=g?(d.pop(),g=h):(c.area-=c.pop().area,m(c,k,b,!1),k=Math.min(b.dx,b.dy),c.length=c.area=0,g=Infinity);c.length&&(m(c,k,b,!0),c.length=c.area=0),a.children.forEach(j)}}function i(a,b){var c=-1,d=a.length,e,f;while(++c=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function Z(a,b){function c(a,d){var e=a.children;if(e&&(i=e.length)){var f,g=null,h=-1,i;while(++h0&&(a=d)}return a}function U(a){var b=a.children,c;return b&&(c=b.length)?b[c-1]:a._tree.thread}function T(a){var b=a.children;return b&&b.length?b[0]:a._tree.thread}function S(a,b){return a.parent==b.parent?1:2}function R(a){var b=a.children,c;return b&&(c=b.length)?R(b[c-1]):a}function Q(a){var b=a.children;return b&&b.length?Q(b[0]):a}function P(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function O(a){return 1+d3.max(a,function(a){return a.y})}function N(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=Math.sqrt(e*e+f*f),i=Math.max(-1,Math.min(1,(d*d+h*h-g*g)/(2*d*h))),j=Math.acos(i),k=i*(d/=h),l=Math.sin(j)*d;c.x=a.x+k*e+l*f,c.y=a.y+k*f-l*e}else c.x=a.x+d,c.y=a.y}function M(a,b,c,d){var e=a.children;a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d;if(e){var f=-1,g=e.length;while(++f1){h=a[1],h.x=h.r,h.y=0,l(h);if(f>2){i=a[2],N(g,h,i),l(i),F(g,i),g._pack_prev=i,F(i,h),h=g._pack_next;for(var m=3;m0?(G(g,j),h=j,m--):(G(j,h),g=j,m--)}}}var q=(b+c)/2,r=(d+e)/2,s=0;for(var m=0;m.001}function G(a,b){a._pack_next=b,b._pack_prev=a}function F(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function E(a,b){return a.value-b.value}function C(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function B(a,b){return b.value-a.value}function A(a){return a.value}function z(a){return a.children}function y(a,b){a.sort=d3.rebind(a,b.sort),a.children=d3.rebind(a,b.children),a.links=C,a.value=d3.rebind(a,b.value),a.nodes=function(b){D=!0;return(a.nodes=a)(b)};return a}function x(a){return[d3.min(a),d3.max(a)]}function w(a,b){var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];while(++c<=b)f[c]=e*c+d;return f}function v(a,b){return w(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function u(a,b){return a+b[1]}function t(a){return a.reduce(u,0)}function s(a){var b=1,c=0,d=a[0][1],e,f=a.length;for(;bd&&(c=b,d=e);return c}function p(a,b,c){a.y0=b,a.y=c}function o(a){return a.y}function n(a){return a.x}function m(a){return 1}function l(a){return 20}function k(a,b,c){var d=0,e=0;a.charge=0;if(!a.leaf){var f=a.nodes,g=f.length,h=-1,i;while(++he&&(e=h),d.push(h)}for(g=0;g=i[0]&&o<=i[1]&&(k=g[d3.bisect(j,o,1,m)-1],k.y+=n,k.push(e[f]));return g}var a=!0,b=Number,c=x,d=v;e.value=function(a){if(!arguments.length)return b;b=a;return e},e.range=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.bins=function(a){if(!arguments.length)return d;d=typeof a=="number"?function(b){return w(b,a)}:d3.functor(a);return e},e.frequency=function(b){if(!arguments.length)return a;a=!!b;return e};return e},d3.layout.hierarchy=function(){function g(a){var b=[];e(a,0,b);return b}function f(a,b){var d=a.children,e=0;if(d&&(i=d.length)){var h=-1,i,j=b+1;while(++h0&&(_(ba(g,a,d),a,m),i+=m,j+=m),k+=g._tree.mod,i+=e._tree.mod,l+=h._tree.mod,j+=f._tree.mod;g&&!U(f)&&(f._tree.thread=g,f._tree.mod+=k-j),e&&!T(h)&&(h._tree.thread=e,h._tree.mod+=i-l,d=a)}return d}function i(a,b){a.x=a._tree.prelim+b;var c=a.children;if(c&&(e=c.length)){var d=-1,e;b+=a._tree.mod;while(++dd.dy)j=j?d.dy:0;while(++fd.dx)j=j?d.dx:0;while(++fe&&(e=d)}c*=c,b*=b;return c?Math.max(b*e*h/c,c/(b*f*h)):Infinity}function k(a){var b=a.children;if(b&&b.length){var c=e(a),d=b.slice(),f,g=[];i(d,c.dx*c.dy/a.value),g.area=0;while(f=d.pop())g.push(f),g.area+=f.area,f.z!=null&&(m(g,f.z?c.dx:c.dy,c,!d.length),g.length=g.area=0);b.forEach(k)}}function j(a){var b=a.children;if(b&&b.length){var c=e(a),d=[],f=b.slice(),g,h=Infinity,k,n=Math.min(c.dx,c.dy),o;i(f,c.dx*c.dy/a.value),d.area=0;while((o=f.length)>0)d.push(g=f[o-1]),d.area+=g.area,(k=l(d,n))<=h?(f.pop(),h=k):(d.area-=d.pop().area,m(d,n,c,!1),n=Math.min(c.dx,c.dy),d.length=d.area=0,h=Infinity);d.length&&(m(d,n,c,!0),d.length=d.area=0),b.forEach(j)}}function i(a,b){var c=-1,d=a.length,e,f;while(++c1){var d=bu(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function ct(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cs(e,f);while(++b1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j0;j--)e.push(c(f)*j)}else{for(;fi;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=bG);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===bI?(h=-1e-15,Math.floor):(h=1e-15,Math.ceil),h;return function(a){return a/c(g(b(a)+h))=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=br()-b;d>24?(isFinite(d)&&(clearTimeout(bp),bp=setTimeout(bq,d)),bo=0):(bo=1,bs(bq))}function bm(a){for(var b=0,c=this.length;b0)k[--g].call(l,f);if(c>=1){r(),bk=b,d.end.dispatch.call(l,h,i),bk=0;return 1}}function p(a){if(o.active>b)return r();o.active=b;for(var e in c)(e=c[e].call(l,h,i))&&k.push(e);d.start.dispatch.call(l,h,i),q(a)||d3.timer(q,0,f);return 1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,f)});return 1},0,f);return a}function be(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bc(a){h(a,bd);return a}function bb(a){return{__data__:a}}function ba(a){return function(){return Z(a,this)}}function _(a){return function(){return Y(a,this)}}function X(a){h(a,$);return a}function W(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);return a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return M(g(a+120),g(a),g(a-120))}function V(a,b,c){this.h=a,this.s=b,this.l=c}function U(a,b,c){return new V(a,b,c)}function R(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function Q(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b=1?1:a(b)}}function r(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function q(a){return a+""}function n(a){var b={},c=[];b.add=function(a){for(var d=0;db?1:a>=b?0:NaN},d3.descending=function(a,b){return ba?1:b>=a?0:NaN},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++cf&&(e=f)}else{while(++cf&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++ce&&(e=f)}else{while(++ce&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f>1;a[e]>1;b0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++hb)d.push(f);else while((f=a+c*++e)=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,p={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=a?1+Math.floor(1e-15+Math.log(a)/Math.LN10):1;return d3.round(a,b-c).toFixed(Math.max(0,Math.min(20,b-c)))}},s=A(2),t=A(3),u={linear:function(){return z},poly:A,quad:function(){return s},cubic:function(){return t},sin:function(){return B},exp:function(){return C},circle:function(){return D},elastic:E,back:F,bounce:function(){return G}},v={"in":function(a){return a},out:x,"in-out":y,"out-in":function(a){return y(x(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return w(v[d](u[c].apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;H.lastIndex=0;for(d=0;c=H.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=H.lastIndex;f0&&(a=a.substring(0,e));return arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},$.each=function(a){for(var b=-1,c=this.length;++b=bT?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bU,b=bV,c=bW,d=bX;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bS;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bS=-Math.PI/2,bT=2*Math.PI-1e-6;d3.svg.line=function(){return bY(Object)};var ca={linear:cb,"step-before":cc,"step-after":cd,basis:cj,"basis-open":ck,"basis-closed":cl,bundle:cm,cardinal:cg,"cardinal-open":ce,"cardinal-closed":cf,monotone:cv},co=[0,2/3,1/3,0],cp=[0,1/3,2/3,0],cq=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=bY(cw);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},d3.svg.area=function(){return cx(Object)},d3.svg.area.radial=function(){var a=cx(cw);a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1;return a},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bS,k=e.call(a,h,g)+bS;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=cA,b=cB,c=cC,d=bW,e=bX;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cA,b=cB,c=cF;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cF,c=a.projection;a.projection=function(a){return arguments.length?c(cG(b=a)):b};return a},d3.svg.mouse=function(a){return cI(a,d3.event)};var cH=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a){var b=d3.event.touches;return b?d(b).map(function(b){var c=cI(a,b);c.identifier=b.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(cL[a.call(this,c,d)]||cL.circle)(b.call(this,c,d))}var a=cK,b=cJ;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var cL={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cN)),c=b*cN;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cM),c=b*cM/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cM),c=b*cM/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cL);var cM=Math.sqrt(3),cN=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){function F(a){return j.delay?a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease()):a}var n=d3.select(this),o=a.ticks.apply(a,g),p=h==null?a.tickFormat.apply(a,g):h,q=cQ(a,o,i),r=n.selectAll(".minor").data(q,String),s=r.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),t=F(r.exit()).style("opacity",1e-6).remove(),u=F(r).style("opacity",1),v=n.selectAll("g").data(o,String),w=v.enter().insert("svg:g","path").style("opacity",1e-6),x=F(v.exit()).style("opacity",1e-6).remove(),y=F(v).style("opacity",1),z,A=bu(a.range()),B=n.selectAll(".domain").data([0]),C=B.enter().append("svg:path").attr("class","domain"),D=F(B),E=this.__chart__||a;this.__chart__=a.copy(),w.append("svg:line").attr("class","tick"),w.append("svg:text"),y.select("text").text(p);switch(b){case"bottom":z=cO,u.attr("y2",d),w.select("text").attr("dy",".71em").attr("text-anchor","middle"),y.select("line").attr("y2",c),y.select("text").attr("y",Math.max(c,0)+f),D.attr("d","M"+A[0]+","+e+"V0H"+A[1]+"V"+e);break;case"top":z=cO,u.attr("y2",-d),w.select("text").attr("text-anchor","middle"),y.select("line").attr("y2",-c),y.select("text").attr("y",-(Math.max(c,0)+f)),D.attr("d","M"+A[0]+","+ -e+"V0H"+A[1]+"V"+ -e);break;case"left":z=cP,u.attr("x2",-d),w.select("text").attr("dy",".32em").attr("text-anchor","end"),y.select("line").attr("x2",-c),y.select("text").attr("x",-(Math.max(c,0)+f)),D.attr("d","M"+ -e+","+A[0]+"H0V"+A[1]+"H"+ -e);break;case"right":z=cP,u.attr("x2",d),w.select("text").attr("dy",".32em"),y.select("line").attr("x2",c),y.select("text").attr("x",Math.max(c,0)+f),D.attr("d","M"+e+","+A[0]+"H0V"+A[1]+"H"+e)}w.call(z,E),y.call(z,a),x.call(z,a),s.call(z,E),u.call(z,a),t.call(z,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;j.scale=function(b){if(!arguments.length)return a;a=b;return j},j.orient=function(a){if(!arguments.length)return b;b=a;return j},j.ticks=function(){if(!arguments.length)return g;g=arguments;return j},j.tickFormat=function(a){if(!arguments.length)return h;h=a;return j},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c;return j},j.tickPadding=function(a){if(!arguments.length)return f;f=+a;return j},j.tickSubdivide=function(a){if(!arguments.length)return i;i=+a;return j};return j},d3.behavior={},d3.behavior.drag=function(){function d(){c.apply(this,arguments),cY("dragstart")}function c(){cR=a,cS=d3.event.target,cV=cZ((cT=this).parentNode),cW=0,cU=arguments}function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",c$).on("touchmove.drag",c$).on("mouseup.drag",c_,!0).on("touchend.drag",c_,!0).on("click.drag",da,!0)}var a=d3.dispatch("drag","dragstart","dragend");b.on=function(c,d){a[c].add(d);return b};return b};var cR,cS,cT,cU,cV,cW,cX;d3.behavior.zoom=function(){function h(){d.apply(this,arguments);var b=dr(),c,e=Date.now();b.length===1&&e-dg<300&&dw(1+Math.floor(a[2]),c=b[0],df[c.identifier]),dg=e}function g(){d.apply(this,arguments);var b=d3.svg.mouse(dk);dw(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,dp(b))}function f(){d.apply(this,arguments),de||(de=dp(d3.svg.mouse(dk))),dw(dq()+a[2],d3.svg.mouse(dk),de)}function e(){d.apply(this,arguments),dd=dp(d3.svg.mouse(dk)),dm=!1,d3.event.preventDefault(),window.focus()}function d(){dh=a,di=b.zoom.dispatch,dj=d3.event.target,dk=this,dl=arguments}function c(){this.on("mousedown.zoom",e).on("mousewheel.zoom",f).on("DOMMouseScroll.zoom",f).on("dblclick.zoom",g).on("touchstart.zoom",h),d3.select(window).on("mousemove.zoom",dt).on("mouseup.zoom",du).on("touchmove.zoom",ds).on("touchend.zoom",dr).on("click.zoom",dv,!0)}var a=[0,0,0],b=d3.dispatch("zoom");c.on=function(a,d){b[a].add(d);return c};return c};var dc,dd,de,df={},dg=0,dh,di,dj,dk,dl,dm,dn})() \ No newline at end of file +(function(){function dE(a,b,c){function i(a,b){var c=a.__domain||(a.__domain=a.domain()),d=a.range().map(function(a){return(a-b)/h});a.domain(c).domain(d.map(a.invert))}var d=Math.pow(2,(dq[2]=a)-c[2]),e=dq[0]=b[0]-d*c[0],f=dq[1]=b[1]-d*c[1],g=d3.event,h=Math.pow(2,a);d3.event={scale:h,translate:[e,f],transform:function(a,b){a&&i(a,e),b&&i(b,f)}};try{dr.apply(dt,du)}finally{d3.event=g}g.preventDefault()}function dD(){dw&&ds===d3.event.target&&(d3.event.stopPropagation(),d3.event.preventDefault(),dw=!1,ds=null)}function dC(){dl&&(dv&&ds===d3.event.target&&(dw=!0),dB(),dl=null)}function dB(){dm=null,dl&&(dv=!0,dE(dq[2],d3.svg.mouse(dt),dl))}function dA(){var a=d3.svg.touches(dt);switch(a.length){case 1:var b=a[0];dE(dq[2],b,dn[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=dn[c.identifier],g=dn[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];dE(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function dz(){var a=d3.svg.touches(dt),b=-1,c=a.length,d;while(++b1){var d=bC(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cB(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cA(e,f);while(++b1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j0;j--)e.push(c(f)*j)}else{for(;fi;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=bO);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===bQ?(h=-1e-15,Math.floor):(h=1e-15,Math.ceil),h;return function(a){return a/c(g(b(a)+h))=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bz()-b;d>24?(isFinite(d)&&(clearTimeout(bx),bx=setTimeout(by,d)),bw=0):(bw=1,bA(by))}function bu(a){for(var b=0,c=this.length;b0)k[--g].call(l,f);if(c>=1){r(),bs=b,d.end.dispatch.call(l,h,i),bs=0;return 1}}function p(a){if(o.active>b)return r();o.active=b;for(var e in c)(e=c[e].call(l,h,i))&&k.push(e);d.start.dispatch.call(l,h,i),q(a)||d3.timer(q,0,f);return 1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,f)});return 1},0,f);return a}function bk(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bi(a){h(a,bj);return a}function bh(a){return{__data__:a}}function bg(a,b){function h(){(b.apply(this,arguments)?f:g).call(this)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=m(e.replace(c," ")),d?b.baseVal=e:this.className=e}function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=m(e+" "+a),d?b.baseVal=e:this.className=e)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;c.lastIndex=0;return c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function be(a){return function(){return bb(a,this)}}function bd(a){return function(){return ba(a,this)}}function _(a){h(a,bc);return a}function $(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);return a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return Q(g(a+120),g(a),g(a-120))}function Z(a,b,c){this.h=a,this.s=b,this.l=c}function Y(a,b,c){return new Z(a,b,c)}function V(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function U(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b=1?1:a(b)}}function v(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function t(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function s(a){return a+""}function r(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function o(a){var b={},c=[];b.add=function(a){for(var d=0;db?1:a>=b?0:NaN},d3.descending=function(a,b){return ba?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f1&&(a=a.map(b)),a=a.filter(j);return a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++cf&&(e=f)}else{while(++cf&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++ce&&(e=f)}else{while(++ce&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f>1;a[e]>1;b0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++hb)d.push(f);else while((f=a+c*++e)=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,q={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=r(a,b)).toFixed(Math.max(0,Math.min(20,b)))}},u=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(v);d3.formatPrefix=function(a,b){var c=0;a&&(a<0&&(a*=-1),b&&(a=d3.round(a,r(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3)));return u[8+c/3]};var w=E(2),x=E(3),y={linear:function(){return D},poly:E,quad:function(){return w},cubic:function(){return x},sin:function(){return F},exp:function(){return G},circle:function(){return H},elastic:I,back:J,bounce:function(){return K}},z={"in":function(a){return a},out:B,"in-out":C,"out-in":function(a){return C(B(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return A(z[d](y[c].apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}},d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;L.lastIndex=0;for(d=0;c=L.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=L.lastIndex;f1){while(++e0&&(a=a.substring(0,e));return arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},bc.each=function(a){for(var b=-1,c=this.length;++b=b_?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=ca,b=cb,c=cc,d=cd;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+b$;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var b$=-Math.PI/2,b_=2*Math.PI-1e-6;d3.svg.line=function(){return ce(Object)};var ci={linear:cj,"step-before":ck,"step-after":cl,basis:cr,"basis-open":cs,"basis-closed":ct,bundle:cu,cardinal:co,"cardinal-open":cm,"cardinal-closed":cn,monotone:cD},cw=[0,2/3,1/3,0],cx=[0,1/3,2/3,0],cy=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=ce(cE);a.radius=a.x,delete a.x,a.angle=a.y,delete a.y;return a},ck.reverse=cl,cl.reverse=ck,d3.svg.area=function(){return cF(Object)},d3.svg.area.radial=function(){var a=cF(cE);a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1;return a},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+b$,k=e.call(a,h,g)+b$;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=cI,b=cJ,c=cK,d=cc,e=cd;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cI,b=cJ,c=cN;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cN,c=a.projection;a.projection=function(a){return arguments.length?c(cO(b=a)):b};return a},d3.svg.mouse=function(a){return cQ(a,d3.event)};var cP=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a){var b=d3.event.touches;return b?d(b).map(function(b){var c=cQ(a,b);c.identifier=b.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(cT[a.call(this,c,d)]||cT.circle)(b.call(this,c,d))}var a=cS,b=cR;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var cT={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*cV)),c=b*cV;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cU),c=b*cU/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cU),c=b*cU/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(cT);var cU=Math.sqrt(3),cV=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){var n=d3.select(this),o=j.delay?function(a){var b=bs;try{bs=j.id;return a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease())}finally{bs=b}}:Object,p=a.ticks.apply(a,g),q=h==null?a.tickFormat.apply(a,g):h,r=cY(a,p,i),s=n.selectAll(".minor").data(r,String),t=s.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),u=o(s.exit()).style("opacity",1e-6).remove(),v=o(s).style("opacity",1),w=n.selectAll("g").data(p,String),x=w.enter().insert("svg:g","path").style("opacity",1e-6),y=o(w.exit()).style("opacity",1e-6).remove(),z=o(w).style("opacity",1),A,B=bC(a.range()),C=n.selectAll(".domain").data([0]),D=C.enter().append("svg:path").attr("class","domain"),E=o(C),F=this.__chart__||a;this.__chart__=a.copy(),x.append("svg:line").attr("class","tick"),x.append("svg:text"),z.select("text").text(q);switch(b){case"bottom":A=cW,v.attr("x2",0).attr("y2",d),z.select("line").attr("x2",0).attr("y2",c),z.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+e+"V0H"+B[1]+"V"+e);break;case"top":A=cW,v.attr("x2",0).attr("y2",-d),z.select("line").attr("x2",0).attr("y2",-c),z.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+ -e+"V0H"+B[1]+"V"+ -e);break;case"left":A=cX,v.attr("x2",-d).attr("y2",0),z.select("line").attr("x2",-c).attr("y2",0),z.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),E.attr("d","M"+ -e+","+B[0]+"H0V"+B[1]+"H"+ -e);break;case"right":A=cX,v.attr("x2",d).attr("y2",0),z.select("line").attr("x2",c).attr("y2",0),z.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),E.attr("d","M"+e+","+B[0]+"H0V"+B[1]+"H"+e)}x.call(A,F),z.call(A,a),y.call(A,a),t.call(A,F),v.call(A,a),u.call(A,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;j.scale=function(b){if(!arguments.length)return a;a=b;return j},j.orient=function(a){if(!arguments.length)return b;b=a;return j},j.ticks=function(){if(!arguments.length)return g;g=arguments;return j},j.tickFormat=function(a){if(!arguments.length)return h;h=a;return j},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c;return j},j.tickPadding=function(a){if(!arguments.length)return f;f=+a;return j},j.tickSubdivide=function(a){if(!arguments.length)return i;i=+a;return j};return j},d3.behavior={},d3.behavior.drag=function(){function d(){c.apply(this,arguments),de("dragstart")}function c(){cZ=a,c$=d3.event.target,db=df((c_=this).parentNode),dc=0,da=arguments}function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",dg).on("touchmove.drag",dg).on("mouseup.drag",dh,!0).on("touchend.drag",dh,!0).on("click.drag",di,!0)}var a=d3.dispatch("drag","dragstart","dragend");b.on=function(c,d){a[c].add(d);return b};return b};var cZ,c$,c_,da,db,dc,dd;d3.behavior.zoom=function(){function h(){d.apply(this,arguments);var b=dz(),c,e=Date.now();b.length===1&&e-dp<300&&dE(1+Math.floor(a[2]),c=b[0],dn[c.identifier]),dp=e}function g(){d.apply(this,arguments);var b=d3.svg.mouse(dt);dE(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,dx(b))}function f(){d.apply(this,arguments),dm||(dm=dx(d3.svg.mouse(dt))),dE(dy()+a[2],d3.svg.mouse(dt),dm)}function e(){d.apply(this,arguments),dl=dx(d3.svg.mouse(dt)),dv=!1,d3.event.preventDefault(),window.focus()}function d(){dq=a,dr=b.zoom.dispatch,ds=d3.event.target,dt=this,du=arguments}function c(){this.on("mousedown.zoom",e).on("mousewheel.zoom",f).on("DOMMouseScroll.zoom",f).on("dblclick.zoom",g).on("touchstart.zoom",h),d3.select(window).on("mousemove.zoom",dB).on("mouseup.zoom",dC).on("touchmove.zoom",dA).on("touchend.zoom",dz).on("click.zoom",dD,!0)}var a=[0,0,0],b=d3.dispatch("zoom");c.on=function(a,d){b[a].add(d);return c};return c};var dk,dl,dm,dn={},dp=0,dq,dr,ds,dt,du,dv,dw})() \ No newline at end of file -- cgit v1.2.3-24-g4f1b