Browse files

Add bullet example. Update to 1.9.

  • Loading branch information...
1 parent 1147061 commit 68c9bdba52e05301381d289d5cdcf73b8d16cc1e @mbostock mbostock committed Apr 9, 2011
View
23 _includes/Makefile
@@ -1,6 +1,8 @@
SRC_FILES = \
../d3.js \
../d3.min.js \
+ ../d3.chart.js \
+ ../d3.chart.min.js \
../d3.csv.js \
../d3.csv.min.js \
../d3.geo.js \
@@ -45,7 +47,10 @@ EX_FILES = \
../ex/stack.js \
../ex/voronoi.css \
../ex/voronoi.js \
- ../ex/sunburst.js
+ ../ex/sunburst.js \
+ ../ex/bullet.js \
+ ../ex/bullet.css \
+ ../ex/bullets.json
INCLUDE_FILES = \
cartogram.js \
@@ -60,7 +65,9 @@ INCLUDE_FILES = \
stream_layers.js \
stack.js \
voronoi.js \
- sunburst.js
+ sunburst.js \
+ bullet.js \
+ bullets.json
.PHONY all: $(SRC_FILES) $(EX_FILES) $(INCLUDE_FILES)
@@ -76,6 +83,18 @@ $(SRC_FILES):
@rm -rf $@
git cat-file blob master:examples/calendar/calendar.css > $@
+../ex/bullet.js bullet.js:
+ @rm -rf $@
+ git cat-file blob master:examples/bullet/bullet.js > $@
+
+../ex/bullet.css:
+ @rm -rf $@
+ git cat-file blob master:examples/bullet/bullet.css > $@
+
+../ex/bullets.json bullets.json:
+ @rm -rf $@
+ git cat-file blob master:examples/bullet/bullets.json > $@
+
../ex/cartogram.css:
@rm -rf $@
git cat-file blob master:examples/cartogram/cartogram.css > $@
View
53 _includes/bullet.js
@@ -0,0 +1,53 @@
+var w = 960,
+ h = 50,
+ m = [5, 40, 20, 120]; // top right bottom left
+
+var chart = d3.chart.bullet()
+ .width(w - m[1] - m[3])
+ .height(h - m[0] - m[2])
+ .duration(1000);
+
+d3.json("bullets.json", function(data) {
+
+ var vis = d3.select("#chart").selectAll("svg")
+ .data(data)
+ .enter().append("svg:svg")
+ .attr("class", "bullet")
+ .attr("width", w)
+ .attr("height", h)
+ .append("svg:g")
+ .attr("transform", "translate(" + m[3] + "," + m[0] + ")")
+ .call(chart);
+
+ var title = vis.append("svg:g")
+ .attr("text-anchor", "end")
+ .attr("transform", "translate(-6," + (h - m[0] - m[2]) / 2 + ")");
+
+ title.append("svg:text")
+ .attr("class", "title")
+ .text(function(d) { return d.title; });
+
+ title.append("svg:text")
+ .attr("class", "subtitle")
+ .attr("dy", "1em")
+ .text(function(d) { return d.subtitle; });
+
+ window.transition = function() {
+ vis.map(randomize).call(chart);
+ };
+});
+
+function randomize(d) {
+ if (!d.randomizer) d.randomizer = randomizer(d);
+ d.ranges = d.ranges.map(d.randomizer);
+ d.markers = d.markers.map(d.randomizer);
+ d.measures = d.measures.map(d.randomizer);
+ return d;
+}
+
+function randomizer(d) {
+ var k = d3.max(d.ranges) * .2;
+ return function(d) {
+ return Math.max(0, d + k * (Math.random() - .5));
+ };
+}
View
7 _includes/bullets.json
@@ -0,0 +1,7 @@
+[
+ {"title":"Revenue","subtitle":"US$, in thousands","ranges":[150,225,300],"measures":[220,270],"markers":[250]},
+ {"title":"Profit","subtitle":"%","ranges":[20,25,30],"measures":[21,23],"markers":[26]},
+ {"title":"Order Size","subtitle":"US$, average","ranges":[350,500,600],"measures":[100,320],"markers":[550]},
+ {"title":"New Customers","subtitle":"count","ranges":[1400,2000,2500],"measures":[1000,1650],"markers":[2100]},
+ {"title":"Satisfaction","subtitle":"out of 5","ranges":[3.5,4.25,5],"measures":[3.2,4.7],"markers":[4.4]}
+]
View
20 _includes/cartogram.js
@@ -1,17 +1,17 @@
-var data; // loaded asynchronously
+// Ratio of Obese (BMI >= 30) in U.S. Adults, CDC 2008
+var data = [
+ , .187, .198, , .133, .175, .151, , .1, .125, .171, , .172, .133, , .108,
+ .142, .167, .201, .175, .159, .169, .177, .141, .163, .117, .182, .153, .195,
+ .189, .134, .163, .133, .151, .145, .13, .139, .169, .164, .175, .135, .152,
+ .169, , .132, .167, .139, .184, .159, .14, .146, .157, , .139, .183, .16, .143
+];
var svg = d3.select("#chart")
.append("svg:svg");
d3.json("us-states.json", function(json) {
var path = d3.geo.path();
- // Synthesize a random data variable to visualize…
- // Note: This has a baked-in sqrt transform!
- json.features.forEach(function(f) {
- f.properties.value = Math.sqrt(.2 + .8 * Math.random());
- });
-
// A thick black stroke for the exterior.
svg.append("svg:g")
.attr("class", "black")
@@ -39,10 +39,12 @@ d3.json("us-states.json", function(json) {
x = centroid[0],
y = centroid[1];
return "translate(" + x + "," + y + ")"
- + "scale(" + d.properties.value + ")"
+ + "scale(" + Math.sqrt(data[+d.id] * 5 || 0) + ")"
+ "translate(" + -x + "," + -y + ")";
})
- .attr("stroke-width", function(d) { return 1 / d.properties.value; })
+ .attr("stroke-width", function(d) {
+ return 1 / Math.sqrt(data[+d.id] * 5);
+ })
.attr("d", path);
});
View
1 _includes/treemap.js
@@ -45,7 +45,6 @@ d3.json("flare.json", function(json) {
});
});
-
function cell() {
this
.style("left", function(d) { return d.x + "px"; })
View
2 _layouts/api.html
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
- <script type="text/javascript" src="../d3.js?1.8.3"></script>
+ <script type="text/javascript" src="../d3.js?1.9.0"></script>
<style type="text/css">
@import url("../style.css?1.6.0");
View
2 _layouts/default.html
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
- <script type="text/javascript" src="d3.js?1.8.3"></script>
+ <script type="text/javascript" src="d3.js?1.9.0"></script>
<style type="text/css">
@import url("style.css?1.6.0");
View
2 _layouts/ex.html
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
- <script type="text/javascript" src="../d3.js?1.8.3"></script>
+ <script type="text/javascript" src="../d3.js?1.9.0"></script>
<style type="text/css">
@import url("../style.css?1.6.0");
View
2 _layouts/tutorial.html
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>d3.js{% if page.title %} ~ {{ page.title }}{% endif %}</title>
- <script type="text/javascript" src="../d3.js?1.8.3"></script>
+ <script type="text/javascript" src="../d3.js?1.9.0"></script>
<style type="text/css">
@import url("../style.css?1.6.0");
View
BIN bullet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
240 d3.chart.js
@@ -0,0 +1,240 @@
+(function(){d3.chart = {};
+// ranges (bad, satisfactory, good)
+// measures (actual, forecast)
+// markers (previous, goal)
+
+/*
+ * Chart design based on the recommendations of Stephen Few. Implementation
+ * based on the work of Clint Ivy, Jamie Love, and Jason Davies.
+ * http://projects.instantcognition.com/protovis/bulletchart/
+ */
+
+d3.chart.bullet = function() {
+ var orient = "left", // TODO top & bottom
+ reverse = false,
+ duration = 0,
+ ranges = d3_chart_bulletRanges,
+ markers = d3_chart_bulletMarkers,
+ measures = d3_chart_bulletMeasures,
+ width = 380,
+ height = 30,
+ tickFormat = null;
+
+ // For each small multiple…
+ function bullet(g) {
+ g.each(function(d, i) {
+ var rangez = ranges.call(this, d, i).slice().sort(d3.descending),
+ markerz = markers.call(this, d, i).slice().sort(d3.descending),
+ measurez = measures.call(this, d, i).slice().sort(d3.descending),
+ g = d3.select(this);
+
+ // Compute the new x-scale.
+ var x1 = d3.scale.linear()
+ .domain([0, Math.max(rangez[0], markerz[0], measurez[0])])
+ .range(reverse ? [width, 0] : [0, width]);
+
+ // Retrieve the old x-scale, if this is an update.
+ var x0 = this.__chart__ || d3.scale.linear()
+ .domain([0, Infinity])
+ .range(x1.range());
+
+ // Stash the new scale.
+ this.__chart__ = x1;
+
+ // Derive width-scales from the x-scales.
+ var w0 = d3_chart_bulletWidth(x0),
+ w1 = d3_chart_bulletWidth(x1);
+
+ // Update the range rects.
+ var range = g.selectAll("rect.range")
+ .data(rangez);
+
+ range.enter().append("svg:rect")
+ .attr("class", function(d, i) { return "range s" + i; })
+ .attr("width", w0)
+ .attr("height", height)
+ .attr("x", reverse ? x0 : 0)
+ .transition()
+ .duration(duration)
+ .attr("width", w1)
+ .attr("x", reverse ? x1 : 0);
+
+ range.transition()
+ .duration(duration)
+ .attr("x", reverse ? x1 : 0)
+ .attr("width", w1)
+ .attr("height", height);
+
+ // Update the measure rects.
+ var measure = g.selectAll("rect.measure")
+ .data(measurez);
+
+ measure.enter().append("svg:rect")
+ .attr("class", function(d, i) { return "measure s" + i; })
+ .attr("width", w0)
+ .attr("height", height / 3)
+ .attr("x", reverse ? x0 : 0)
+ .attr("y", height / 3)
+ .transition()
+ .duration(duration)
+ .attr("width", w1)
+ .attr("x", reverse ? x1 : 0);
+
+ measure.transition()
+ .duration(duration)
+ .attr("width", w1)
+ .attr("height", height / 3)
+ .attr("x", reverse ? x1 : 0)
+ .attr("y", height / 3);
+
+ // Update the marker lines.
+ var marker = g.selectAll("line.marker")
+ .data(markerz);
+
+ marker.enter().append("svg:line")
+ .attr("class", "marker")
+ .attr("x1", x0)
+ .attr("x2", x0)
+ .attr("y1", height / 6)
+ .attr("y2", height * 5 / 6)
+ .transition()
+ .duration(duration)
+ .attr("x1", x1)
+ .attr("x2", x1);
+
+ marker.transition()
+ .duration(duration)
+ .attr("x1", x1)
+ .attr("x2", x1)
+ .attr("y1", height / 6)
+ .attr("y2", height * 5 / 6);
+
+ // Compute the tick format.
+ var format = tickFormat || x1.tickFormat(8);
+
+ // Update the tick groups.
+ var tick = g.selectAll("g.tick")
+ .data(x1.ticks(8), format);
+
+ // Initialize the ticks with the old scale, x0.
+ var tickEnter = tick.enter().append("svg:g")
+ .attr("class", "tick")
+ .attr("transform", d3_chart_bulletTranslate(x0))
+ .attr("opacity", 1e-6);
+
+ tickEnter.append("svg:line")
+ .attr("y1", height)
+ .attr("y2", height * 7 / 6);
+
+ tickEnter.append("svg:text")
+ .attr("text-anchor", "middle")
+ .attr("dy", "1em")
+ .attr("y", height * 7 / 6)
+ .text(format);
+
+ // Transition the entering ticks to the new scale, x1.
+ tickEnter.transition()
+ .duration(duration)
+ .attr("transform", d3_chart_bulletTranslate(x1))
+ .attr("opacity", 1);
+
+ // Transition the updating ticks to the new scale, x1.
+ var tickUpdate = tick.transition()
+ .duration(duration)
+ .attr("transform", d3_chart_bulletTranslate(x1))
+ .attr("opacity", 1);
+
+ tickUpdate.select("line")
+ .attr("y1", height)
+ .attr("y2", height * 7 / 6);
+
+ tickUpdate.select("text")
+ .attr("y", height * 7 / 6);
+
+ // Transition the exiting ticks to the new scale, x1.
+ tick.exit().transition()
+ .duration(duration)
+ .attr("transform", d3_chart_bulletTranslate(x1))
+ .attr("opacity", 1e-6)
+ .remove();
+ });
+ }
+
+ // left, right, top, bottom
+ bullet.orient = function(x) {
+ if (!arguments.length) return orient;
+ orient = x;
+ reverse = orient == "right" || orient == "bottom";
+ return bullet;
+ };
+
+ bullet.ranges = function(x) {
+ if (!arguments.length) return ranges;
+ ranges = x;
+ return bullet;
+ };
+
+ bullet.markers = function(x) {
+ if (!arguments.length) return markers;
+ markers = x;
+ return bullet;
+ };
+
+ bullet.measures = function(x) {
+ if (!arguments.length) return measures;
+ measures = x;
+ return bullet;
+ };
+
+ bullet.width = function(x) {
+ if (!arguments.length) return width;
+ width = x;
+ return bullet;
+ };
+
+ bullet.height = function(x) {
+ if (!arguments.length) return height;
+ height = x;
+ return bullet;
+ };
+
+ bullet.tickFormat = function(x) {
+ if (!arguments.length) return tickFormat;
+ tickFormat = x;
+ return bullet;
+ };
+
+ bullet.duration = function(x) {
+ if (!arguments.length) return duration;
+ duration = x;
+ return bullet;
+ };
+
+ return bullet;
+};
+
+function d3_chart_bulletRanges(d) {
+ return d.ranges;
+}
+
+function d3_chart_bulletMarkers(d) {
+ return d.markers;
+}
+
+function d3_chart_bulletMeasures(d) {
+ return d.measures;
+}
+
+function d3_chart_bulletTranslate(x) {
+ return function(d) {
+ return "translate(" + x(d) + ",0)";
+ };
+}
+
+function d3_chart_bulletWidth(x) {
+ var x0 = x(0);
+ return function(d) {
+ return Math.abs(x(d) - x0);
+ };
+}
+})()
View
1 d3.chart.min.js
@@ -0,0 +1 @@
+(function(){function e(a){var b=a(0);return function(c){return Math.abs(a(c)-b)}}function d(a){return function(b){return"translate("+a(b)+",0)"}}function c(a){return a.measures}function b(a){return a.markers}function a(a){return a.ranges}d3.chart={},d3.chart.bullet=function(){function o(a){a.each(function(a,b){var c=i.call(this,a,b).slice().sort(d3.descending),f=j.call(this,a,b).slice().sort(d3.descending),o=k.call(this,a,b).slice().sort(d3.descending),p=d3.select(this),q=d3.scale.linear().domain([0,Math.max(c[0],f[0],o[0])]).range(g?[l,0]:[0,l]),r=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(q.range());this.__chart__=q;var s=e(r),t=e(q),u=p.selectAll("rect.range").data(c);u.enter().append("svg:rect").attr("class",function(a,b){return"range s"+b}).attr("width",s).attr("height",m).attr("x",g?r:0).transition().duration(h).attr("width",t).attr("x",g?q:0),u.transition().duration(h).attr("x",g?q:0).attr("width",t).attr("height",m);var v=p.selectAll("rect.measure").data(o);v.enter().append("svg:rect").attr("class",function(a,b){return"measure s"+b}).attr("width",s).attr("height",m/3).attr("x",g?r:0).attr("y",m/3).transition().duration(h).attr("width",t).attr("x",g?q:0),v.transition().duration(h).attr("width",t).attr("height",m/3).attr("x",g?q:0).attr("y",m/3);var w=p.selectAll("line.marker").data(f);w.enter().append("svg:line").attr("class","marker").attr("x1",r).attr("x2",r).attr("y1",m/6).attr("y2",m*5/6).transition().duration(h).attr("x1",q).attr("x2",q),w.transition().duration(h).attr("x1",q).attr("x2",q).attr("y1",m/6).attr("y2",m*5/6);var x=n||q.tickFormat(8),y=p.selectAll("g.tick").data(q.ticks(8),x),z=y.enter().append("svg:g").attr("class","tick").attr("transform",d(r)).attr("opacity",1e-6);z.append("svg:line").attr("y1",m).attr("y2",m*7/6),z.append("svg:text").attr("text-anchor","middle").attr("dy","1em").attr("y",m*7/6).text(x),z.transition().duration(h).attr("transform",d(q)).attr("opacity",1);var A=y.transition().duration(h).attr("transform",d(q)).attr("opacity",1);A.select("line").attr("y1",m).attr("y2",m*7/6),A.select("text").attr("y",m*7/6),y.exit().transition().duration(h).attr("transform",d(q)).attr("opacity",1e-6).remove()})}var f="left",g=!1,h=0,i=a,j=b,k=c,l=380,m=30,n=null;o.orient=function(a){if(!arguments.length)return f;f=a,g=f=="right"||f=="bottom";return o},o.ranges=function(a){if(!arguments.length)return i;i=a;return o},o.markers=function(a){if(!arguments.length)return j;j=a;return o},o.measures=function(a){if(!arguments.length)return k;k=a;return o},o.width=function(a){if(!arguments.length)return l;l=a;return o},o.height=function(a){if(!arguments.length)return m;m=a;return o},o.tickFormat=function(a){if(!arguments.length)return n;n=a;return o},o.duration=function(a){if(!arguments.length)return h;h=a;return o};return o}})()
View
4 d3.csv.min.js
@@ -1,3 +1 @@
-(function(){function n(a){return a.map(o).join(",")}function o(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}d3.csv=function(a,c){d3.text(a,"text/csv",function(d){c(d&&d3.csv.parse(d))})};d3.csv.parse=function(a){var c;return d3.csv.parseRows(a,function(d,k){if(k){for(var f={},g=-1,e=c.length;++g<e;)f[c[g]]=d[g];return f}else{c=d;return null}})};d3.csv.parseRows=function(a,c){function d(){if(e.lastIndex==a.length)return f;if(h){h=false;return k}var i=e.lastIndex;if(a.charCodeAt(i)==34){for(var b=
-i;b++<a.length;)if(a.charCodeAt(b)==34){if(a.charCodeAt(b+1)!=34)break;b++}e.lastIndex=b+2;var m=a.charCodeAt(b+1);if(m==13){h=true;a.charCodeAt(b+2)==10&&e.lastIndex++}else if(m==10)h=true;return a.substring(i+1,b).replace(/""/g,'"')}if(b=e.exec(a)){h=b[0].charCodeAt(0)!=44;return a.substring(i,b.index)}e.lastIndex=a.length;return a.substring(i)}for(var k={},f={},g=[],e=/\r\n|[,\r\n]/g,p=0,j,h;(j=d())!==f;){for(var l=[];j!==k&&j!==f;){l.push(j);j=d()}c&&!(l=c(l,p++))||g.push(l)}return g};d3.csv.format=
-function(a){return a.map(n).join("\n")}})();
+(function(){function b(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}function a(a){return a.map(b).join(",")}d3.csv=function(a,b){d3.text(a,"text/csv",function(a){b(a&&d3.csv.parse(a))})},d3.csv.parse=function(a){var b;return d3.csv.parseRows(a,function(a,c){if(c){var d={},e=-1,f=b.length;while(++e<f)d[b[e]]=a[e];return d}b=a;return null})},d3.csv.parseRows=function(a,b){function j(){if(f.lastIndex==a.length)return d;if(i){i=!1;return c}var b=f.lastIndex;if(a.charCodeAt(b)==34){var e=b;while(e++<a.length)if(a.charCodeAt(e)==34){if(a.charCodeAt(e+1)!=34)break;e++}f.lastIndex=e+2;var g=a.charCodeAt(e+1);g==13?(i=!0,a.charCodeAt(e+2)==10&&f.lastIndex++):g==10&&(i=!0);return a.substring(b+1,e).replace(/""/g,'"')}var h=f.exec(a);if(h){i=h[0].charCodeAt(0)!=44;return a.substring(b,h.index)}f.lastIndex=a.length;return a.substring(b)}var c={},d={},e=[],f=/\r\n|[,\r\n]/g,g=0,h,i;while((h=j())!==d){var k=[];while(h!==c&&h!==d)k.push(h),h=j();if(b&&!(k=b(k,g++)))continue;e.push(k)}return e},d3.csv.format=function(b){return b.map(a).join("\n")}})()
View
12 d3.geo.min.js
@@ -1,11 +1 @@
-(function(){function v(b){return"m0,"+b+"a"+b+","+b+" 0 1,1 0,"+-2*b+"a"+b+","+b+" 0 1,1 0,"+ +2*b+"z"}function u(){return 0}function q(b,d){return d&&d.type in b?b[d.type](d):""}function w(b,d){if(b.type in y)y[b.type](b,d)}function z(b,d){for(var g=b.coordinates,e=0,k=g.length;e<k;e++)d.apply(null,g[e])}d3.geo={};d3.geo.albers=function(){function b(a){var c=l*(r*a[0]-i);a=Math.sqrt(p-2*l*Math.sin(r*a[1]))/l;return[k*a*Math.sin(c)+h[0],k*(a*Math.cos(c)-s)+h[1]]}function d(){var a=r*e[0],c=r*e[1],
-f=r*g[1],j=Math.sin(a);a=Math.cos(a);i=r*g[0];l=0.5*(j+Math.sin(c));p=a*a+2*l*j;s=Math.sqrt(p-2*l*Math.sin(f))/l;return b}var g=[-98,38],e=[29.5,45.5],k=1E3,h=[480,250],i,l,p,s;b.origin=function(a){if(!arguments.length)return g;g=[+a[0],+a[1]];return d()};b.parallels=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return d()};b.scale=function(a){if(!arguments.length)return k;k=+a;return b};b.translate=function(a){if(!arguments.length)return h;h=[+a[0],+a[1]];return b};return d()};d3.geo.albersUsa=
-function(){function b(h){var i=h[0],l=h[1];return(l<25?i<-100?e:k:l>50?g:d)(h)}var d=d3.geo.albers(),g=d3.geo.albers().origin([-160,60]).parallels([55,65]),e=d3.geo.albers().origin([-160,20]).parallels([8,18]),k=d3.geo.albers().origin([-60,10]).parallels([8,18]);b.scale=function(h){if(!arguments.length)return d.scale();d.scale(h);g.scale(h*0.6);e.scale(h);k.scale(h*1.5);return b.translate(d.translate())};b.translate=function(h){if(!arguments.length)return d.translate();var i=d.scale()/1E3,l=h[0],
-p=h[1];d.translate(h);g.translate([l-400*i,p+170*i]);e.translate([l-190*i,p+200*i]);k.translate([l+580*i,p+430*i]);return b};return b.scale(d.scale())};var r=Math.PI/180;d3.geo.mercator=function(){function b(e){return[d*(e[0]/360)+g[0],d*Math.max(-0.5,Math.min(0.5,-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360))/360))+g[1]]}var d=500,g=[480,250];b.scale=function(e){if(!arguments.length)return d;d=+e;return b};b.translate=function(e){if(!arguments.length)return g;g=[+e[0],+e[1]];return b};
-return b};d3.geo.path=function(){function b(a){if(typeof k=="function")h=v(k.apply(this,arguments));return q(l,a)}function d(a){return i(a).join(",")}function g(a){for(var c=Math.abs(d3.geom.polygon(a[0].map(i)).area()),f=0,j=a.length;++f<j;)c-=Math.abs(d3.geom.polygon(a[f].map(i)).area());return c}function e(a){for(var c=d3.geom.polygon(a[0].map(i)),f=c.centroid(1),j=f[0],m=f[1],n=Math.abs(c.area()),o=0,t=a.length;++o<t;){c=d3.geom.polygon(a[o].map(i));f=c.centroid(1);j-=f[0];m-=f[1];n-=Math.abs(c.area())}return[j,
-m,6*n]}var k=4.5,h=v(k),i=d3.geo.albersUsa(),l={FeatureCollection:function(a){var c=[];a=a.features;for(var f=-1,j=a.length;++f<j;)c.push(q(l,a[f].geometry));return c.join("")},Feature:function(a){return q(l,a.geometry)},Point:function(a){return"M"+d(a.coordinates)+h},MultiPoint:function(a){var c=[];a=a.coordinates;for(var f=-1,j=a.length;++f<j;)c.push("M",d(a[f]),h);return c.join("")},LineString:function(a){var c=["M"];a=a.coordinates;for(var f=-1,j=a.length;++f<j;)c.push(d(a[f]),"L");c.pop();return c.join("")},
-MultiLineString:function(a){var c=[];a=a.coordinates;for(var f=-1,j=a.length,m,n,o;++f<j;){m=a[f];n=-1;o=m.length;for(c.push("M");++n<o;)c.push(d(m[n]),"L");c.pop()}return c.join("")},Polygon:function(a){var c=[];a=a.coordinates;for(var f=-1,j=a.length,m,n,o;++f<j;){m=a[f];n=-1;o=m.length;for(c.push("M");++n<o;)c.push(d(m[n]),"L");c[c.length-1]="Z"}return c.join("")},MultiPolygon:function(a){var c=[];a=a.coordinates;for(var f=-1,j=a.length,m,n,o,t,x,A;++f<j;){m=a[f];n=-1;for(o=m.length;++n<o;){t=
-m[n];x=-1;A=t.length-1;for(c.push("M");++x<A;)c.push(d(t[x]),"L");c[c.length-1]="Z"}}return c.join("")},GeometryCollection:function(a){var c=[];a=a.geometries;for(var f=-1,j=a.length;++f<j;)c.push(q(l,a[f]));return c.join("")}},p={FeatureCollection:function(a){var c=0;a=a.features;for(var f=-1,j=a.length;++f<j;)c+=q(p,a[f]);return c},Feature:function(a){return q(p,a.geometry)},Point:u,MultiPoint:u,LineString:u,MultiLineString:u,Polygon:function(a){return g(a.coordinates)},MultiPolygon:function(a){var c=
-0;a=a.coordinates;for(var f=-1,j=a.length;++f<j;)c+=g(a[f]);return c},GeometryCollection:function(a){var c=0;a=a.geometries;for(var f=-1,j=a.length;++f<j;)c+=q(p,a[f]);return c}},s={Feature:function(a){return q(s,a.geometry)},Polygon:function(a){a=e(a.coordinates);return[a[0]/a[2],a[1]/a[2]]},MultiPolygon:function(a){a=a.coordinates;for(var c,f=0,j=0,m=0,n=-1,o=a.length;++n<o;){c=e(a[n]);f+=c[0];j+=c[1];m+=c[2]}return[f/m,j/m]}};b.projection=function(a){i=a;return b};b.area=function(a){return q(p,
-a)};b.centroid=function(a){return q(s,a)};b.pointRadius=function(a){if(typeof a=="function")k=a;else{k=+a;h=v(k)}return b};return b};d3.geo.bounds=function(b){var d=Infinity,g=Infinity,e=-Infinity,k=-Infinity;w(b,function(h,i){if(h<d)d=h;if(h>e)e=h;if(i<g)g=i;if(i>k)k=i});return[[d,g],[e,k]]};var y={Feature:function(b,d){w(b.geometry,d)},FeatureCollection:function(b,d){for(var g=b.features,e=0,k=g.length;e<k;e++)w(g[e].geometry,d)},LineString:z,MultiLineString:function(b,d){for(var g=b.coordinates,
-e=0,k=g.length;e<k;e++)for(var h=g[e],i=0,l=h.length;i<l;i++)d.apply(null,h[i])},MultiPoint:z,MultiPolygon:function(b,d){for(var g=b.coordinates,e=0,k=g.length;e<k;e++)for(var h=g[e][0],i=0,l=h.length;i<l;i++)d.apply(null,h[i])},Point:function(b,d){d.apply(null,b.coordinates)},Polygon:function(b,d){for(var g=b.coordinates[0],e=0,k=g.length;e<k;e++)d.apply(null,g[e])}}})();
+(function(){function m(a,b){for(var c=a.coordinates[0],d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function l(a,b){b.apply(null,a.coordinates)}function k(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d][0],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function j(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function i(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function h(a,b){for(var c=a.features,d=0,f=c.length;d<f;d++)e(c[d].geometry,b)}function g(a,b){e(a.geometry,b)}function e(a,b){a.type in f&&f[a.type](a,b)}function d(a,b){return b&&b.type in a?a[b.type](b):""}function c(){return 0}function b(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+ -2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}d3.geo={},d3.geo.albers=function(){function k(){var d=a*c[0],e=a*c[1],k=a*b[1],l=Math.sin(d),m=Math.cos(d);f=a*b[0],g=.5*(l+Math.sin(e)),h=m*m+2*g*l,i=Math.sqrt(h-2*g*Math.sin(k))/g;return j}function j(b){var c=g*(a*b[0]-f),j=Math.sqrt(h-2*g*Math.sin(a*b[1]))/g;return[d*j*Math.sin(c)+e[0],d*(j*Math.cos(c)-i)+e[1]]}var b=[-98,38],c=[29.5,45.5],d=1e3,e=[480,250],f,g,h,i;j.origin=function(a){if(!arguments.length)return b;b=[+a[0],+a[1]];return k()},j.parallels=function(a){if(!arguments.length)return c;c=[+a[0],+a[1]];return k()},j.scale=function(a){if(!arguments.length)return d;d=+a;return j},j.translate=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return j};return k()},d3.geo.albersUsa=function(){function e(e){var f=e[0],g=e[1];return(g<25?f<-100?c:d:g>50?b:a)(e)}var a=d3.geo.albers(),b=d3.geo.albers().origin([-160,60]).parallels([55,65]),c=d3.geo.albers().origin([-160,20]).parallels([8,18]),d=d3.geo.albers().origin([-60,10]).parallels([8,18]);e.scale=function(f){if(!arguments.length)return a.scale();a.scale(f),b.scale(f*.6),c.scale(f),d.scale(f*1.5);return e.translate(a.translate())},e.translate=function(f){if(!arguments.length)return a.translate();var g=a.scale()/1e3,h=f[0],i=f[1];a.translate(f),b.translate([h-400*g,i+170*g]),c.translate([h-190*g,i+200*g]),d.translate([h+580*g,i+430*g]);return e};return e.scale(a.scale())};var a=Math.PI/180;d3.geo.mercator=function(){function c(c){var d=c[0]/360,e=-180/Math.PI*Math.log(Math.tan(Math.PI/4+c[1]*Math.PI/360))/360;return[a*d+b[0],a*Math.max(-0.5,Math.min(.5,e))+b[1]]}var a=500,b=[480,250];c.scale=function(b){if(!arguments.length)return a;a=+b;return c},c.translate=function(a){if(!arguments.length)return b;b=[+a[0],+a[1]];return c};return c},d3.geo.path=function(){function n(a){return Math.abs(d3.geom.polygon(a.map(f)).area())}function l(a){var b=d3.geom.polygon(a[0].map(f)),c=b.centroid(1),d=c[0],e=c[1],g=Math.abs(b.area()),h=0,i=a.length;while(++h<i)b=d3.geom.polygon(a[h].map(f)),c=b.centroid(1),d-=c[0],e-=c[1],g-=Math.abs(b.area());return[d,e,6*g]}function k(a){var b=n(a[0]),c=0,d=a.length;while(++c<d)b-=n(a[c]);return b}function h(a){return f(a).join(",")}function g(c,f){typeof a=="function"&&(e=b(a.apply(this,arguments)));return d(i,c)}var a=4.5,e=b(a),f=d3.geo.albersUsa(),i={FeatureCollection:function(a){var b=[],c=a.features,e=-1,f=c.length;while(++e<f)b.push(d(i,c[e].geometry));return b.join("")},Feature:function(a){return d(i,a.geometry)},Point:function(a){return"M"+h(a.coordinates)+e},MultiPoint:function(a){var b=[],c=a.coordinates,d=-1,f=c.length;while(++d<f)b.push("M",h(c[d]),e);return b.join("")},LineString:function(a){var b=["M"],c=a.coordinates,d=-1,e=c.length;while(++d<e)b.push(h(c[d]),"L");b.pop();return b.join("")},MultiLineString:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,g,i;while(++d<e){f=c[d],g=-1,i=f.length,b.push("M");while(++g<i)b.push(h(f[g]),"L");b.pop()}return b.join("")},Polygon:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,g,i;while(++d<e){f=c[d],g=-1,i=f.length,b.push("M");while(++g<i)b.push(h(f[g]),"L");b[b.length-1]="Z"}return b.join("")},MultiPolygon:function(a){var b=[],c=a.coordinates,d=-1,e=c.length,f,g,i,j,k,l;while(++d<e){f=c[d],g=-1,i=f.length;while(++g<i){j=f[g],k=-1,l=j.length-1,b.push("M");while(++k<l)b.push(h(j[k]),"L");b[b.length-1]="Z"}}return b.join("")},GeometryCollection:function(a){var b=[],c=a.geometries,e=-1,f=c.length;while(++e<f)b.push(d(i,c[e]));return b.join("")}},j={FeatureCollection:function(a){var b=0,c=a.features,e=-1,f=c.length;while(++e<f)b+=d(j,c[e]);return b},Feature:function(a){return d(j,a.geometry)},Point:c,MultiPoint:c,LineString:c,MultiLineString:c,Polygon:function(a){return k(a.coordinates)},MultiPolygon:function(a){var b=0,c=a.coordinates,d=-1,e=c.length;while(++d<e)b+=k(c[d]);return b},GeometryCollection:function(a){var b=0,c=a.geometries,e=-1,f=c.length;while(++e<f)b+=d(j,c[e]);return b}},m={Feature:function(a){return d(m,a.geometry)},Polygon:function(a){var b=l(a.coordinates);return[b[0]/b[2],b[1]/b[2]]},MultiPolygon:function(a){var b=0,c=a.coordinates,d,e=0,f=0,g=0,h=-1,i=c.length;while(++h<i)d=l(c[h]),e+=d[0],f+=d[1],g+=d[2];return[e/g,f/g]}};g.projection=function(a){f=a;return g},g.area=function(a){return d(j,a)},g.centroid=function(a){return d(m,a)},g.pointRadius=function(c){typeof c=="function"?a=c:(a=+c,e=b(a));return g};return g},d3.geo.bounds=function(a){var b=Infinity,c=Infinity,d=-Infinity,f=-Infinity;e(a,function(a,e){a<b&&(b=a),a>d&&(d=a),e<c&&(c=e),e>f&&(f=e)});return[[b,c],[d,f]]};var f={Feature:g,FeatureCollection:h,LineString:i,MultiLineString:j,MultiPoint:i,MultiPolygon:k,Point:l,Polygon:m}})()
View
16 d3.geom.min.js
@@ -1,15 +1 @@
-(function(){function E(c,g,d,a){var f,b,e;c=a[c];f=c[0];b=c[1];c=a[g];g=c[0];e=c[1];c=a[d];return(c[1]-b)*(g-f)-(e-b)*(c[0]-f)>0}function A(c,g,d){return(d[0]-g[0])*(c[1]-g[1])<(d[1]-g[1])*(c[0]-g[0])}function C(c,g,d,a){var f=c[0],b=d[0];c=c[1];var e=d[1];d=g[0]-f;var l=a[0]-b;g=g[1]-c;a=a[1]-e;b=(l*(c-e)-a*(f-b))/(a*d-l*g);return[f+b*d,c+b*g]}function D(c,g){var d={list:c.map(function(h,i){return{index:i,x:h[0],y:h[1]}}).sort(function(h,i){return h.y<i.y?-1:h.y>i.y?1:h.x<i.x?-1:h.x>i.x?1:0}),bottomSite:null},
-a={list:[],leftEnd:null,rightEnd:null,init:function(){a.leftEnd=a.createHalfEdge(null,"l");a.rightEnd=a.createHalfEdge(null,"l");a.leftEnd.r=a.rightEnd;a.rightEnd.l=a.leftEnd;a.list.unshift(a.leftEnd,a.rightEnd)},createHalfEdge:function(h,i){return{edge:h,side:i,vertex:null,l:null,r:null}},insert:function(h,i){i.l=h;i.r=h.r;h.r.l=i;h.r=i},leftBound:function(h){var i=a.leftEnd;do i=i.r;while(i!=a.rightEnd&&f.rightOf(i,h));return i=i.l},del:function(h){h.l.r=h.r;h.r.l=h.l;h.edge=null},right:function(h){return h.r},
-left:function(h){return h.l},leftRegion:function(h){return h.edge==null?d.bottomSite:h.edge.region[h.side]},rightRegion:function(h){return h.edge==null?d.bottomSite:h.edge.region[B[h.side]]}},f={bisect:function(h,i){var j={region:{l:h,r:i},ep:{l:null,r:null}},m=i.x-h.x,r=i.y-h.y;j.c=h.x*m+h.y*r+(m*m+r*r)*0.5;if((m>0?m:-m)>(r>0?r:-r)){j.a=1;j.b=r/m;j.c/=m}else{j.b=1;j.a=m/r;j.c/=r}return j},intersect:function(h,i){var j=h.edge,m=i.edge;if(!j||!m||j.region.r==m.region.r)return null;var r=j.a*m.b-j.b*
-m.a;if(Math.abs(r)<1.0E-10)return null;var u=(j.c*m.b-m.c*j.b)/r;r=(m.c*j.a-j.c*m.a)/r;var w=j.region.r,y=m.region.r;if(w.y<y.y||w.y==y.y&&w.x<y.x)w=h;else{w=i;j=m}if((j=u>=j.region.r.x)&&w.side=="l"||!j&&w.side=="r")return null;return{x:u,y:r}},rightOf:function(h,i){var j=h.edge,m=j.region.r,r=i.x>m.x;if(r&&h.side=="l")return 1;if(!r&&h.side=="r")return 0;if(j.a==1){var u=i.y-m.y,w=i.x-m.x,y=0,x=0;if(!r&&j.b<0||r&&j.b>=0)x=y=u>=j.b*w;else{x=i.x+i.y*j.b>j.c;if(j.b<0)x=!x;x||(y=1)}if(!y){m=m.x-j.region.l.x;
-x=j.b*(w*w-u*u)<m*u*(1+2*w/m+j.b*j.b);if(j.b<0)x=!x}}else{w=j.c-j.a*i.x;j=i.y-w;u=i.x-m.x;m=w-m.y;x=j*j>u*u+m*m}return h.side=="l"?x:!x},endPoint:function(h,i,j){h.ep[i]=j;h.ep[B[i]]&&g(h)},distance:function(h,i){var j=h.x-i.x,m=h.y-i.y;return Math.sqrt(j*j+m*m)}},b={list:[],insert:function(h,i,j){h.vertex=i;h.ystar=i.y+j;j=0;for(var m=b.list,r=m.length;j<r;j++){var u=m[j];if(!(h.ystar>u.ystar||h.ystar==u.ystar&&i.x>u.vertex.x))break}m.splice(j,0,h)},del:function(h){for(var i=0,j=b.list,m=j.length;i<
-m&&j[i]!=h;++i);j.splice(i,1)},empty:function(){return b.list.length==0},nextEvent:function(h){for(var i=0,j=b.list,m=j.length;i<m;++i)if(j[i]==h)return j[i+1];return null},min:function(){var h=b.list[0];return{x:h.vertex.x,y:h.ystar}},extractMin:function(){return b.list.shift()}};a.init();d.bottomSite=d.list.shift();for(var e=d.list.shift(),l,k,o,p,s,n,t,q,v;;){b.empty()||(l=b.min());if(e&&(b.empty()||e.y<l.y||e.y==l.y&&e.x<l.x)){k=a.leftBound(e);o=a.right(k);t=a.rightRegion(k);v=f.bisect(t,e);n=
-a.createHalfEdge(v,"l");a.insert(k,n);if(q=f.intersect(k,n)){b.del(k);b.insert(k,q,f.distance(q,e))}k=n;n=a.createHalfEdge(v,"r");a.insert(k,n);(q=f.intersect(n,o))&&b.insert(n,q,f.distance(q,e));e=d.list.shift()}else if(b.empty())break;else{k=b.extractMin();p=a.left(k);o=a.right(k);s=a.right(o);t=a.leftRegion(k);n=a.rightRegion(o);q=k.vertex;f.endPoint(k.edge,k.side,q);f.endPoint(o.edge,o.side,q);a.del(k);b.del(o);a.del(o);k="l";if(t.y>n.y){k=t;t=n;n=k;k="r"}v=f.bisect(t,n);n=a.createHalfEdge(v,
-k);a.insert(p,n);f.endPoint(v,B[k],q);if(q=f.intersect(p,n)){b.del(p);b.insert(p,q,f.distance(q,t))}(q=f.intersect(n,s))&&b.insert(n,q,f.distance(q,t))}}for(k=a.right(a.leftEnd);k!=a.rightEnd;k=a.right(k))g(k.edge)}function z(c,g,d,a,f,b){if(!c(g,d,a,f,b)){var e=(d+f)*0.5,l=(a+b)*0.5;g=g.nodes;g[0]&&z(c,g[0],d,a,e,l);g[1]&&z(c,g[1],e,a,f,l);g[2]&&z(c,g[2],d,l,e,b);g[3]&&z(c,g[3],e,l,f,b)}}d3.geom={};d3.geom.contour=function(c,g){var d;if(!(d=g))a:{for(var a=d=0;;){if(c(d,a)){d=[d,a];break a}if(d==
-0){d=a+1;a=0}else{d-=1;a+=1}}d=void 0}a=[];var f=d[0],b=d[1],e=0,l=0,k=NaN,o=NaN;l=0;do{l=0;if(c(f-1,b-1))l+=1;if(c(f,b-1))l+=2;if(c(f-1,b))l+=4;if(c(f,b))l+=8;if(l==6){e=o==-1?-1:1;l=0}else if(l==9){e=0;l=k==1?-1:1}else{e=F[l];l=G[l]}if(e!=k&&l!=o){a.push([f,b]);k=e;o=l}f+=e;b+=l}while(d[0]!=f||d[1]!=b);return a};var F=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],G=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(c){if(c.length<3)return[];var g=c.length,d=g-1,a=[],f=[],b,e=0,l,k,o,p,s,n,
-t;for(b=1;b<g;++b)if(c[b][1]<c[e][1])e=b;else if(c[b][1]==c[e][1])e=c[b][0]<c[e][0]?b:e;for(b=0;b<g;++b)if(b!=e){k=c[b][1]-c[e][1];l=c[b][0]-c[e][0];a.push({angle:Math.atan2(k,l),index:b})}a.sort(function(q,v){return q.angle-v.angle});t=a[0].angle;n=a[0].index;s=0;for(b=1;b<d;++b){g=a[b].index;if(t==a[b].angle){l=c[n][0]-c[e][0];k=c[n][1]-c[e][1];o=c[g][0]-c[e][0];p=c[g][1]-c[e][1];if(l*l+k*k>=o*o+p*p)a[b].index=-1;else{a[s].index=-1;t=a[b].angle;s=b;n=g}}else{t=a[b].angle;s=b;n=g}}f.push(e);for(g=
-b=0;b<2;++g)if(a[g].index!=-1){f.push(a[g].index);b++}for(e=f.length;g<d;++g)if(a[g].index!=-1){for(;!E(f[e-2],f[e-1],a[g].index,c);)--e;f[e++]=a[g].index}d=[];for(b=0;b<e;++b)d.push(c[f[b]]);return d};d3.geom.polygon=function(c){c.area=function(){for(var g=0,d=c.length,a=c[d-1][0]*c[0][1],f=c[d-1][1]*c[0][0];++g<d;){a+=c[g-1][0]*c[g][1];f+=c[g-1][1]*c[g][0]}return(f-a)*0.5};c.centroid=function(g){var d=-1,a=c.length-1,f=0,b=0,e,l,k;for(arguments.length||(g=1/(6*c.area()));++d<a;){e=c[d];l=c[d+1];
-k=e[0]*l[1]-l[0]*e[1];f+=(e[0]+l[0])*k;b+=(e[1]+l[1])*k}return[f*g,b*g]};c.clip=function(g){for(var d,a=-1,f=c.length,b,e,l=c[f-1],k,o,p;++a<f;){d=g.slice();g.length=0;k=c[a];o=d[(e=d.length)-1];for(b=-1;++b<e;){p=d[b];if(A(p,l,k)){A(o,l,k)||g.push(C(o,p,l,k));g.push(p)}else A(o,l,k)&&g.push(C(o,p,l,k));o=p}l=k}return g};return c};d3.geom.voronoi=function(c){var g=c.map(function(){return[]});D(c,function(d){var a,f,b,e;if(d.a==1&&d.b>=0){a=d.ep.r;f=d.ep.l}else{a=d.ep.l;f=d.ep.r}if(d.a==1){b=a?a.y:
--1E6;a=d.c-d.b*b;e=f?f.y:1E6;f=d.c-d.b*e}else{a=a?a.x:-1E6;b=d.c-d.a*a;f=f?f.x:1E6;e=d.c-d.a*f}a=[a,b];f=[f,e];g[d.region.l.index].push(a,f);g[d.region.r.index].push(a,f)});return g.map(function(d,a){var f=c[a][0],b=c[a][1];d.forEach(function(e){e.angle=Math.atan2(e[0]-f,e[1]-b)});return d.sort(function(e,l){return e.angle-l.angle}).filter(function(e,l){return!l||e.angle-d[l-1].angle>1.0E-10})})};var B={l:"r",r:"l"};d3.geom.delaunay=function(c){var g=c.map(function(){return[]}),d=[];D(c,function(a){g[a.region.l.index].push(c[a.region.r.index])});
-g.forEach(function(a,f){var b=c[f],e=b[0],l=b[1];a.forEach(function(p){p.angle=Math.atan2(p[0]-e,p[1]-l)});a.sort(function(p,s){return p.angle-s.angle});for(var k=0,o=a.length-1;k<o;k++)d.push([b,a[k],a[k+1]])});return d};d3.geom.quadtree=function(c){function g(s,n,t,q,v,h){if(!(isNaN(n[0])||isNaN(n[1])))if(s.leaf){var i=s.point;if(i){if(!(Math.abs(i[0]-n[0])+Math.abs(i[1]-n[1])<0.01)){s.point=null;d(s,i,t,q,v,h)}d(s,n,t,q,v,h)}else s.point=n}else d(s,n,t,q,v,h)}function d(s,n,t,q,v,h){var i=(t+v)*
-0.5,j=(q+h)*0.5,m=n[0]>=i,r=n[1]>=j,u=(r<<1)+m;s.leaf=false;s=s.nodes[u]||(s.nodes[u]={leaf:true,nodes:[],point:null});if(m)t=i;else v=i;if(r)q=j;else h=j;g(s,n,t,q,v,h)}for(var a,f=-1,b=c.length,e=Number.POSITIVE_INFINITY,l=e,k=Number.NEGATIVE_INFINITY,o=k;++f<b;){a=c[f];if(a[0]<e)e=a[0];if(a[1]<l)l=a[1];if(a[0]>k)k=a[0];if(a[1]>o)o=a[1]}a=k-e;f=o-l;if(a>f)o=l+a;else k=e+f;var p={leaf:true,nodes:[],point:null};for(f=-1;++f<b;)g(p,c[f],e,l,k,o);p.visit=function(s){z(s,p,e,l,k,o)};return p}})();
+(function(){function j(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=(c+e)*.5,h=(d+f)*.5,i=b.nodes;i[0]&&j(a,i[0],c,d,g,h),i[1]&&j(a,i[1],g,d,e,h),i[2]&&j(a,i[2],c,h,g,f),i[3]&&j(a,i[3],g,h,e,f)}}function i(){return{leaf:!0,nodes:[],point:null}}function h(a,b){var c={list:a.map(function(a,b){return{index:b,x:a[0],y:a[1]}}).sort(function(a,b){return a.y<b.y?-1:a.y>b.y?1:a.x<b.x?-1:a.x>b.x?1:0}),bottomSite:null},d={list:[],leftEnd:null,rightEnd:null,init:function(){d.leftEnd=d.createHalfEdge(null,"l"),d.rightEnd=d.createHalfEdge(null,"l"),d.leftEnd.r=d.rightEnd,d.rightEnd.l=d.leftEnd,d.list.unshift(d.leftEnd,d.rightEnd)},createHalfEdge:function(a,b){return{edge:a,side:b,vertex:null,l:null,r:null}},insert:function(a,b){b.l=a,b.r=a.r,a.r.l=b,a.r=b},leftBound:function(a){var b=d.leftEnd;do b=b.r;while(b!=d.rightEnd&&e.rightOf(b,a));b=b.l;return b},del:function(a){a.l.r=a.r,a.r.l=a.l,a.edge=null},right:function(a){return a.r},left:function(a){return a.l},leftRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[a.side]},rightRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[g[a.side]]}},e={bisect:function(a,b){var c={region:{l:a,r:b},ep:{l:null,r:null}},d=b.x-a.x,e=b.y-a.y,f=d>0?d:-d,g=e>0?e:-e;c.c=a.x*d+a.y*e+(d*d+e*e)*.5,f>g?(c.a=1,c.b=e/d,c.c/=d):(c.b=1,c.a=d/e,c.c/=e);return c},intersect:function(a,b){var c=a.edge,d=b.edge;if(!c||!d||c.region.r==d.region.r)return null;var e=c.a*d.b-c.b*d.a;if(Math.abs(e)<1e-10)return null;var f=(c.c*d.b-d.c*c.b)/e,g=(d.c*c.a-c.c*d.a)/e,h=c.region.r,i=d.region.r,j,k;h.y<i.y||h.y==i.y&&h.x<i.x?(j=a,k=c):(j=b,k=d);var l=f>=k.region.r.x;if(l&&j.side=="l"||!l&&j.side=="r")return null;return{x:f,y:g}},rightOf:function(a,b){var c=a.edge,d=c.region.r,e=b.x>d.x;if(e&&a.side=="l")return 1;if(!e&&a.side=="r")return 0;if(c.a==1){var f=b.y-d.y,g=b.x-d.x,h=0,i=0;!e&&c.b<0||e&&c.b>=0?i=h=f>=c.b*g:(i=b.x+b.y*c.b>c.c,c.b<0&&(i=!i),i||(h=1));if(!h){var j=d.x-c.region.l.x;i=c.b*(g*g-f*f)<j*f*(1+2*g/j+c.b*c.b),c.b<0&&(i=!i)}}else{var k=c.c-c.a*b.x,l=b.y-k,m=b.x-d.x,n=k-d.y;i=l*l>m*m+n*n}return a.side=="l"?i:!i},endPoint:function(a,c,d){a.ep[c]=d;!a.ep[g[c]]||b(a)},distance:function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}},f={list:[],insert:function(a,b,c){a.vertex=b,a.ystar=b.y+c;for(var d=0,e=f.list,g=e.length;d<g;d++){var h=e[d];if(a.ystar>h.ystar||a.ystar==h.ystar&&b.x>h.vertex.x)continue;break}e.splice(d,0,a)},del:function(a){for(var b=0,c=f.list,d=c.length;b<d&&c[b]!=a;++b);c.splice(b,1)},empty:function(){return f.list.length==0},nextEvent:function(a){for(var b=0,c=f.list,d=c.length;b<d;++b)if(c[b]==a)return c[b+1];return null},min:function(){var a=f.list[0];return{x:a.vertex.x,y:a.ystar}},extractMin:function(){return f.list.shift()}};d.init(),c.bottomSite=c.list.shift();var h=c.list.shift(),i,j,k,l,m,n,o,p,q,r,s,t,u;for(;;){f.empty()||(i=f.min());if(h&&(f.empty()||h.y<i.y||h.y==i.y&&h.x<i.x))j=d.leftBound(h),k=d.right(j),o=d.rightRegion(j),t=e.bisect(o,h),n=d.createHalfEdge(t,"l"),d.insert(j,n),r=e.intersect(j,n),r&&(f.del(j),f.insert(j,r,e.distance(r,h))),j=n,n=d.createHalfEdge(t,"r"),d.insert(j,n),r=e.intersect(n,k),r&&f.insert(n,r,e.distance(r,h)),h=c.list.shift();else if(!f.empty())j=f.extractMin(),l=d.left(j),k=d.right(j),m=d.right(k),o=d.leftRegion(j),p=d.rightRegion(k),s=j.vertex,e.endPoint(j.edge,j.side,s),e.endPoint(k.edge,k.side,s),d.del(j),f.del(k),d.del(k),u="l",o.y>p.y&&(q=o,o=p,p=q,u="r"),t=e.bisect(o,p),n=d.createHalfEdge(t,u),d.insert(l,n),e.endPoint(t,g[u],s),r=e.intersect(l,n),r&&(f.del(l),f.insert(l,r,e.distance(r,o))),r=e.intersect(n,m),r&&f.insert(n,r,e.distance(r,o));else break}for(j=d.right(d.leftEnd);j!=d.rightEnd;j=d.right(j))b(j.edge)}function f(a,b,c,d){var e=a[0],f=b[0],g=c[0],h=d[0],i=a[1],j=b[1],k=c[1],l=d[1],m=e-g,n=f-e,o=h-g,p=i-k,q=j-i,r=l-k,s=(o*p-r*m)/(r*n-o*q);return[e+s*n,i+s*q]}function e(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function d(a,b,c,d){var e,f,g,h,i,j,k;e=d[a],f=e[0],g=e[1],e=d[b],h=e[0],i=e[1],e=d[c],j=e[0],k=e[1];return(k-g)*(h-f)-(i-g)*(j-f)>0}function c(a){var b=0,c=0;for(;;){if(a(b,c))return[b,c];b==0?(b=c+1,c=0):(b=b-1,c=c+1)}}d3.geom={},d3.geom.contour=function(d,e){var f=e||c(d),g=[],h=f[0],i=f[1],j=0,k=0,l=NaN,m=NaN,n=0;do n=0,d(h-1,i-1)&&(n+=1),d(h,i-1)&&(n+=2),d(h-1,i)&&(n+=4),d(h,i)&&(n+=8),n==6?(j=m==-1?-1:1,k=0):n==9?(j=0,k=l==1?-1:1):(j=a[n],k=b[n]),j!=l&&k!=m&&(g.push([h,i]),l=j,m=k),h+=j,i+=k;while(f[0]!=h||f[1]!=i);return g};var a=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],b=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(a){if(a.length<3)return[];var b=a.length,c=b-1,e=[],f=[],g,h,i=0,j,k,l,m,n,o,p,q;for(g=1;g<b;++g)a[g][1]<a[i][1]?i=g:a[g][1]==a[i][1]&&(i=a[g][0]<a[i][0]?g:i);for(g=0;g<b;++g){if(g==i)continue;k=a[g][1]-a[i][1],j=a[g][0]-a[i][0],e.push({angle:Math.atan2(k,j),index:g})}e.sort(function(a,b){return a.angle-b.angle}),p=e[0].angle,o=e[0].index,n=0;for(g=1;g<c;++g)h=e[g].index,p==e[g].angle?(j=a[o][0]-a[i][0],k=a[o][1]-a[i][1],l=a[h][0]-a[i][0],m=a[h][1]-a[i][1],j*j+k*k>=l*l+m*m?e[g].index=-1:(e[n].index=-1,p=e[g].angle,n=g,o=h)):(p=e[g].angle,n=g,o=h);f.push(i);for(g=0,h=0;g<2;++h)e[h].index!=-1&&(f.push(e[h].index),g++);q=f.length;for(;h<c;++h){if(e[h].index==-1)continue;while(!d(f[q-2],f[q-1],e[h].index,a))--q;f[q++]=e[h].index}var r=[];for(g=0;g<q;++g)r.push(a[f[g]]);return r},d3.geom.polygon=function(a){a.area=function(){var b=0,c=a.length,d=a[c-1][0]*a[0][1],e=a[c-1][1]*a[0][0];while(++b<c)d+=a[b-1][0]*a[b][1],e+=a[b-1][1]*a[b][0];return(e-d)*.5},a.centroid=function(b){var c=-1,d=a.length-1,e=0,f=0,g,h,i;arguments.length||(b=1/(6*a.area()));while(++c<d)g=a[c],h=a[c+1],i=g[0]*h[1]-h[0]*g[1],e+=(g[0]+h[0])*i,f+=(g[1]+h[1])*i;return[e*b,f*b]},a.clip=function(b){var c,d=-1,g=a.length,h,i,j=a[g-1],k,l,m;while(++d<g){c=b.slice(),b.length=0,k=a[d],l=c[(i=c.length)-1],h=-1;while(++h<i)m=c[h],e(m,j,k)?(e(l,j,k)||b.push(f(l,m,j,k)),b.push(m)):e(l,j,k)&&b.push(f(l,m,j,k)),l=m;j=k}return b};return a},d3.geom.voronoi=function(a){var b=a.map(function(){return[]});h(a,function(a){var c,d,e,f,g,h;a.a==1&&a.b>=0?(c=a.ep.r,d=a.ep.l):(c=a.ep.l,d=a.ep.r),a.a==1?(g=c?c.y:-1e6,e=a.c-a.b*g,h=d?d.y:1e6,f=a.c-a.b*h):(e=c?c.x:-1e6,g=a.c-a.a*e,f=d?d.x:1e6,h=a.c-a.a*f);var i=[e,g],j=[f,h];b[a.region.l.index].push(i,j),b[a.region.r.index].push(i,j)});return b.map(function(b,c){var d=a[c][0],e=a[c][1];b.forEach(function(a){a.angle=Math.atan2(a[0]-d,a[1]-e)});return b.sort(function(a,b){return a.angle-b.angle}).filter(function(a,c){return!c||a.angle-b[c-1].angle>1e-10})})};var g={l:"r",r:"l"};d3.geom.delaunay=function(a){var b=a.map(function(){return[]}),c=[];h(a,function(c){b[c.region.l.index].push(a[c.region.r.index])}),b.forEach(function(b,d){var e=a[d],f=e[0],g=e[1];b.forEach(function(a){a.angle=Math.atan2(a[0]-f,a[1]-g)}),b.sort(function(a,b){return a.angle-b.angle});for(var h=0,i=b.length-1;h<i;h++)c.push([e,b[h],b[h+1]])});return c},d3.geom.quadtree=function(a){function n(a,b,c,d,e,f){var g=(c+e)*.5,h=(d+f)*.5,j=b[0]>=g,k=b[1]>=h,l=(k<<1)+j;a.leaf=!1,a=a.nodes[l]||(a.nodes[l]=i()),j?c=g:e=g,k?d=h:f=h,m(a,b,c,d,e,f)}function m(a,b,c,d,e,f){if(!isNaN(b[0])&&!isNaN(b[1]))if(a.leaf){var g=a.point;g?Math.abs(g[0]-b[0])+Math.abs(g[1]-b[1])<.01?n(a,b,c,d,e,f):(a.point=null,n(a,g,c,d,e,f),n(a,b,c,d,e,f)):a.point=b}else n(a,b,c,d,e,f)}var b,c=-1,d=a.length,e=Number.POSITIVE_INFINITY,f=e,g=Number.NEGATIVE_INFINITY,h=g;while(++c<d)b=a[c],b[0]<e&&(e=b[0]),b[1]<f&&(f=b[1]),b[0]>g&&(g=b[0]),b[1]>h&&(h=b[1]);var k=g-e,l=h-f;k>l?h=f+k:g=e+l;var o=i();c=-1;while(++c<d)m(o,a[c],e,f,g,h);o.visit=function(a){j(a,o,e,f,g,h)};return o}})()
View
45 d3.js
@@ -1,4 +1,4 @@
-(function(){d3 = {version: "1.8.3"}; // semver
+(function(){d3 = {version: "1.9.0"}; // semver
if (!Date.now) Date.now = function() {
return +new Date();
};
@@ -197,9 +197,7 @@ function d3_collapse(s) {
}
//
// Note: assigning to the arguments array simultaneously changes the value of
-// the corresponding argument! However, the Google Closure compiler doesn't
-// realize this, and so can optimize-away our attempt to avoid side-effects.
-// This fix by Jason Davies has been tested to survive minimization.
+// the corresponding argument!
//
// TODO The `this` argument probably shouldn't be the first argument to the
// callback, anyway, since it's redundant. However, that will require a major
@@ -1035,7 +1033,6 @@ function d3_selection(groups) {
group = groups[j];
subgroups.push(subgroup = []);
subgroup.parentNode = group.parentNode;
- subgroup.parentData = group.parentData;
for (var i = 0, n = group.length; i < n; i++) {
if (node = group[i]) {
subgroup.push(subnode = select(node));
@@ -1059,7 +1056,6 @@ function d3_selection(groups) {
if (node = group[i]) {
subgroups.push(subgroup = selectAll(node));
subgroup.parentNode = node;
- subgroup.parentData = node.__data__;
}
}
}
@@ -1090,7 +1086,6 @@ function d3_selection(groups) {
group = groups[j];
subgroups.push(subgroup = []);
subgroup.parentNode = group.parentNode;
- subgroup.parentData = group.parentData;
for (var i = 0, n = group.length; i < n; i++) {
if ((node = group[i]) && filter.call(node, node.__data__, i)) {
subgroup.push(node);
@@ -1130,25 +1125,20 @@ function d3_selection(groups) {
node,
nodeData;
- function enterNode(data) {
- return {__data__: data};
- }
-
if (join) {
var nodeByKey = {},
- exitData = [],
keys = [],
key,
j = groupData.length;
for (i = 0; i < n; i++) {
key = join.call(node = group[i], node.__data__, i);
if (key in nodeByKey) {
- exitNodes[j++] = group[i];
+ exitNodes[j++] = group[i]; // duplicate key
} else {
nodeByKey[key] = node;
- keys.push(key);
}
+ keys.push(key);
}
for (i = 0; i < m; i++) {
@@ -1158,7 +1148,7 @@ function d3_selection(groups) {
updateNodes[i] = node;
enterNodes[i] = exitNodes[i] = null;
} else {
- enterNodes[i] = enterNode(nodeData),
+ enterNodes[i] = d3_selection_enterNode(nodeData);
updateNodes[i] = exitNodes[i] = null;
}
delete nodeByKey[key];
@@ -1178,12 +1168,12 @@ function d3_selection(groups) {
updateNodes[i] = node;
enterNodes[i] = exitNodes[i] = null;
} else {
- enterNodes[i] = enterNode(nodeData);
+ enterNodes[i] = d3_selection_enterNode(nodeData);
updateNodes[i] = exitNodes[i] = null;
}
}
for (; i < m; i++) {
- enterNodes[i] = enterNode(groupData[i]);
+ enterNodes[i] = d3_selection_enterNode(groupData[i]);
updateNodes[i] = exitNodes[i] = null;
}
for (; i < n1; i++) {
@@ -1197,11 +1187,6 @@ function d3_selection(groups) {
= exitNodes.parentNode
= group.parentNode;
- enterNodes.parentData
- = updateNodes.parentData
- = exitNodes.parentData
- = group.parentData;
-
enter.push(enterNodes);
update.push(updateNodes);
exit.push(exitNodes);
@@ -1212,7 +1197,7 @@ function d3_selection(groups) {
group;
if (typeof data == "function") {
while (++i < n) {
- bind(group = groups[i], data.call(group, group.parentData, i));
+ bind(group = groups[i], data.call(group, group.parentNode.__data__, i));
}
} else {
while (++i < n) {
@@ -1510,10 +1495,9 @@ function d3_selection(groups) {
// TODO remove(node)?
// TODO remove(function)?
groups.remove = function() {
- return select(function(node) {
- var parent = node.parentNode;
- parent.removeChild(node);
- return parent;
+ return groups.each(function() {
+ var parent = this.parentNode;
+ if (parent) parent.removeChild(this);
});
};
@@ -1583,7 +1567,6 @@ function d3_selectionEnter(groups) {
group = groups[j];
subgroups.push(subgroup = []);
subgroup.parentNode = group.parentNode;
- subgroup.parentData = group.parentData;
for (var i = 0, n = group.length; i < n; i++) {
if (node = group[i]) {
subgroup.push(subnode = select(group.parentNode));
@@ -1642,6 +1625,10 @@ function d3_selection_comparator(comparator) {
return comparator(a && a.__data__, b && b.__data__);
};
}
+
+function d3_selection_enterNode(data) {
+ return {__data__: data};
+}
d3.transition = d3_root.transition;
var d3_transitionId = 0,
@@ -2067,7 +2054,7 @@ d3.scale.log = function() {
j = Math.ceil(d[1]),
u = pow(d[0]),
v = pow(d[1]);
- if (n) {
+ if (log === d3_scale_logn) {
ticks.push(pow(i));
for (; i++ < j;) for (var k = 9; k > 0; k--) ticks.push(pow(i) * k);
} else {
View
18 d3.layout.min.js
@@ -1,17 +1 @@
-(function(){function A(g){return g.reduce(B,0)}function C(g){for(var l=1,i=0,k=g[0].y,m,h=g.length;l<h;++l)if((m=g[l].y)>k){i=l;k=m}return i}function B(g,l){return g+l.y}function D(g){return g.children}function E(g){return g.value}function F(g,l){return l.value-g.value}d3.layout={};d3.layout.chord=function(){function g(){var e={},c=[],p=d3.range(b),o=[],q,r,u,s,t;k=[];m=[];q=0;for(s=-1;++s<b;){r=0;for(t=-1;++t<b;)r+=h[s][t];c.push(r);o.push(d3.range(b));q+=r}n&&p.sort(function(z,x){return n(c[z],
-c[x])});f&&o.forEach(function(z,x){z.sort(function(G,H){return f(h[x][G],h[x][H])})});q=(2*Math.PI-j*b)/q;r=0;for(s=-1;++s<b;){u=r;for(t=-1;++t<b;){var v=p[s],w=o[s][t],y=h[v][w];e[v+"-"+w]={index:v,subindex:w,startAngle:r,endAngle:r+=y*q,value:y}}m.push({index:v,startAngle:u,endAngle:r,value:(r-u)/q});r+=j}for(s=-1;++s<b;)for(t=s-1;++t<b;){p=e[s+"-"+t];o=e[t+"-"+s];if(p.value||o.value)k.push({source:p,target:o})}a&&l()}function l(){k.sort(function(e,c){e=Math.min(e.source.value,e.target.value);c=
-Math.min(c.source.value,c.target.value);return a(e,c)})}var i={},k,m,h,b,j=0,n,f,a;i.matrix=function(e){if(!arguments.length)return h;b=(h=e)&&h.length;k=m=null;return i};i.padding=function(e){if(!arguments.length)return j;j=e;k=m=null;return i};i.sortGroups=function(e){if(!arguments.length)return n;n=e;k=m=null;return i};i.sortSubgroups=function(e){if(!arguments.length)return f;f=e;k=null;return i};i.sortChords=function(e){if(!arguments.length)return a;a=e;k&&l();return i};i.chords=function(){k||
-g();return k};i.groups=function(){m||g();return m};return i};d3.layout.force=function(){function g(){var f=n.length,a,e,c,p,o,q,r;for(a=0;a<f;++a){e=n[a];c=e.source;p=e.target;q=p.x-c.x;r=p.y-c.y;if(o=Math.sqrt(q*q+r*r)){o=m/(e.distance*e.distance)*(o-h*e.distance)/o;q*=o;r*=o;if(!p.fixed){p.x-=q;p.y-=r}if(!c.fixed){c.x+=q;c.y+=r}}}i.tick.dispatch({type:"tick"});return(m*=0.99)<0.0050}var l={},i=d3.dispatch("tick"),k=[1,1],m=0.5,h=30,b,j,n;l.on=function(f,a){i[f].add(a);return l};l.nodes=function(f){if(!arguments.length)return b;
-b=f;return l};l.links=function(f){if(!arguments.length)return j;j=f;return l};l.size=function(f){if(!arguments.length)return k;k=f;return l};l.distance=function(f){if(!arguments.length)return h;h=f;return l};l.start=function(){var f,a,e,c=b.length;e=j.length;var p=k[0],o=k[1],q=[];for(f=0;f<c;++f){a=b[f];a.x=a.x||Math.random()*p;a.y=a.y||Math.random()*o;a.fixed=0;q[f]=[];for(a=0;a<c;++a)q[f][a]=Infinity;q[f][f]=0}for(f=0;f<e;++f){a=j[f];q[a.source][a.target]=1;q[a.target][a.source]=1;a.source=b[a.source];
-a.target=b[a.target]}for(e=0;e<c;++e)for(f=0;f<c;++f)for(a=0;a<c;++a)q[f][a]=Math.min(q[f][a],q[f][e]+q[e][a]);n=[];for(f=0;f<c;++f)for(a=f+1;a<c;++a)n.push({source:b[f],target:b[a],distance:q[f][a]*q[f][a]});n.sort(function(r,u){return r.distance-u.distance});d3.timer(g);return l};l.resume=function(){m=0.1;d3.timer(g);return l};l.stop=function(){m=0;return l};l.drag=function(){function f(){if(a){var c=d3.svg.mouse(e);a.x=c[0];a.y=c[1];l.resume()}}var a,e;this.on("mouseover",function(c){c.fixed=true}).on("mouseout",
-function(c){if(c!=a)c.fixed=false}).on("mousedown",function(c){(a=c).fixed=true;e=this;d3.event.preventDefault()});d3.select(window).on("mousemove",f).on("mouseup",function(){if(a){f();a.fixed=false;a=e=null}});return l};return l};d3.layout.partition=function(){function g(h,b,j,n){var f=h.children;h.x=b;h.y=h.depth*n;h.dx=j;h.dy=n;if(f){var a=-1,e=f.length,c;for(j/=h.value;++a<e;){g(c=f[a],b,h=c.value*j,n);b+=h}}}function l(h){h=h.children;var b=0;if(h)for(var j=-1,n=h.length;++j<n;)b=Math.max(b,
-l(h[j]));return 1+b}function i(h,b){var j=k.call(this,h,b);g(j[0],0,m[0],m[1]/l(j[0]));return j}var k=d3.layout.hierarchy(),m=[1,1];i.sort=d3.rebind(i,k.sort);i.children=d3.rebind(i,k.children);i.value=d3.rebind(i,k.value);i.size=function(h){if(!arguments.length)return m;m=h;return i};return i};d3.layout.pie=function(){function g(h){var b=+(typeof k=="function"?k.apply(this,arguments):k),j=(typeof m=="function"?m.apply(this,arguments):m)-k,n=d3.range(h.length);i!=null&&n.sort(function(e,c){return i(h[e],
-h[c])});var f=h.map(l);j/=f.reduce(function(e,c){return e+c},0);var a=n.map(function(e){return{value:d=f[e],startAngle:b,endAngle:b+=d*j}});return h.map(function(e,c){return a[n[c]]})}var l=Number,i=null,k=0,m=2*Math.PI;g.value=function(h){if(!arguments.length)return l;l=h;return g};g.sort=function(h){if(!arguments.length)return i;i=h;return g};g.startAngle=function(h){if(!arguments.length)return k;k=h;return g};g.endAngle=function(h){if(!arguments.length)return m;m=h;return g};return g};d3.layout.stack=
-function(){function g(k){var m=k.length,h=k[0].length,b,j,n,f=I[l](k);J[i](k,f);for(j=0;j<h;++j){b=1;for(n=k[f[0]][j].y0;b<m;++b)k[f[b]][j].y0=n+=k[f[b-1]][j].y}return k}var l="default",i="zero";g.order=function(k){if(!arguments.length)return l;l=k;return g};g.offset=function(k){if(!arguments.length)return i;i=k;return g};return g};var I={"inside-out":function(g){var l=g.length,i,k=g.map(C),m=g.map(A),h=d3.range(l).sort(function(a,e){return k[a]-k[e]}),b=0,j=0,n=[],f=[];for(g=0;g<l;g++){i=h[g];if(b<
-j){b+=m[i];n.push(i)}else{j+=m[i];f.push(i)}}return f.reverse().concat(n)},reverse:function(g){return d3.range(g.length).reverse()},"default":function(g){return d3.range(g.length)}},J={silhouette:function(g,l){var i=g.length,k=g[0].length,m=[],h=0,b,j,n;for(j=0;j<k;++j){for(n=b=0;b<i;b++)n+=g[b][j].y;if(n>h)h=n;m.push(n)}j=0;for(b=l[0];j<k;++j)g[b][j].y0=(h-m[j])/2},wiggle:function(g,l){var i=g.length,k=g[0],m=k.length,h,b,j,n,f,a=l[0],e,c,p,o,q,r;g[a][0].y0=q=r=0;for(b=1;b<m;++b){for(e=h=0;h<i;++h)e+=
-g[h][b].y;c=h=0;for(o=k[b].x-k[b-1].x;h<i;++h){j=0;n=l[h];for(p=(g[n][b].y-g[n][b-1].y)/(2*o);j<h;++j)p+=(g[f=l[j]][b].y-g[f][b-1].y)/o;c+=p*g[n][b].y}g[a][b].y0=q-=e?c/e*o:0;if(q<r)r=q}for(b=0;b<m;++b)g[a][b].y0-=r},zero:function(g,l){for(var i=0,k=g[0].length,m=l[0];i<k;++i)g[m][i].y0=0}};d3.layout.hierarchy=function(){function g(b,j,n){var f=m.call(i,b,j),a={depth:j,data:b};n.push(a);if(f){b=-1;var e=f.length,c=a.children=[],p=0;for(j+=1;++b<e;){d=g(f[b],j,n);if(d.value>0){c.push(d);p+=d.value;
-d.parent=a}}k&&c.sort(k);a.value=p}else a.value=h.call(i,b,j);return a}function l(b,j){var n=b.children,f=0;if(n)for(var a=-1,e=n.length,c=j+1;++a<e;)f+=l(n[a],c);else f=h.call(i,b.data,j);return b.value=f}function i(b){var j=[];g(b,0,j);return j}var k=F,m=D,h=E;i.sort=function(b){if(!arguments.length)return k;k=b;return i};i.children=function(b){if(!arguments.length)return m;m=b;return i};i.value=function(b){if(!arguments.length)return h;h=b;return i};i.revalue=function(b){l(b,0);return b};return i};
-d3.layout.treemap=function(){function g(a,e){var c=a.children;a.area=a.value*e;if(c)for(var p=-1,o=c.length;++p<o;)g(c[p],e)}function l(a){if(a.children){var e={x:a.x,y:a.y,dx:a.dx,dy:a.dy},c=[],p=a.children.slice(),o,q=Infinity,r=Math.min(e.dx,e.dy);for(c.area=0;(o=p.length)>0;){c.push(o=p[o-1]);c.area+=o.area;o=r;for(var u=c.area,s=void 0,t=0,v=Infinity,w=-1,y=c.length;++w<y;){s=c[w].area;if(s<v)v=s;if(s>t)t=s}u*=u;o*=o;if((o=Math.max(o*t/u,u/(o*v)))<=q){p.pop();q=o}else{c.area-=c.pop().area;k(c,
-r,e,false);r=Math.min(e.dx,e.dy);c.length=c.area=0;q=Infinity}}if(c.length){k(c,r,e,true);c.length=c.area=0}a.children.forEach(l)}}function i(a){if(a.children){var e={x:a.x,y:a.y,dx:a.dx,dy:a.dy},c=a.children.slice(),p,o=[];for(o.area=0;p=c.pop();){o.push(p);o.area+=p.area;if(p.z!=null){k(o,p.z?e.dx:e.dy,e,!c.length);o.length=o.area=0}}a.children.forEach(i)}}function k(a,e,c,p){var o=-1,q=a.length,r=c.x,u=c.y,s=e?b(a.area/e):0,t;if(e==c.dx){if(p||s>c.dy)s=c.dy;for(;++o<q;){t=a[o];t.x=r;t.y=u;t.dy=
-s;r+=t.dx=b(t.area/s)}t.z=true;t.dx+=c.x+c.dx-r;c.y+=s;c.dy-=s}else{if(p||s>c.dx)s=c.dx;for(;++o<q;){t=a[o];t.x=r;t.y=u;t.dx=s;u+=t.dy=b(t.area/s)}t.z=false;t.dy+=c.y+c.dy-u;c.x+=s;c.dx-=s}}function m(a){a=f||h(a);var e=a[0];e.x=0;e.y=0;e.dx=j[0];e.dy=j[1];f&&h.revalue(e);g(e,j[0]*j[1]/e.value);(f?i:l)(e);if(n)f=a;return a}var h=d3.layout.hierarchy(),b=Math.round,j=[1,1],n=false,f;m.sort=d3.rebind(m,h.sort);m.children=d3.rebind(m,h.children);m.value=d3.rebind(m,h.value);m.size=function(a){if(!arguments.length)return j;
-j=a;return m};m.round=function(a){if(!arguments.length)return b!=Number;b=a?Math.round:Number;return m};m.sticky=function(a){if(!arguments.length)return n;n=a;f=null;return m};return m}})();
+(function(){function i(a,b){return b.value-a.value}function h(a){return a.value}function g(a){return a.children}function f(a,b){return a+b.y}function e(a){var b=1,c=0,d=a[0].y,e,f=a.length;for(;b<f;++b)(e=a[b].y)>d&&(c=b,d=e);return c}function c(a){return a.reduce(f,0)}d3.layout={},d3.layout.chord=function(){function k(){b.sort(function(a,b){a=Math.min(a.source.value,a.target.value),b=Math.min(b.source.value,b.target.value);return i(a,b)})}function j(){var a={},j=[],l=d3.range(e),m=[],o,p,q,r,s;b=[],c=[],o=0,r=-1;while(++r<e){p=0,s=-1;while(++s<e)p+=d[r][s];j.push(p),m.push(d3.range(e)),o+=p}g&&l.sort(function(a,b){return g(j[a],j[b])}),h&&m.forEach(function(a,b){a.sort(function(a,c){return h(d[b][a],d[b][c])})}),o=(2*Math.PI-f*e)/o,p=0,r=-1;while(++r<e){q=p,s=-1;while(++s<e){var t=l[r],u=m[r][s],v=d[t][u];a[t+"-"+u]={index:t,subindex:u,startAngle:p,endAngle:p+=v*o,value:v}}c.push({index:t,startAngle:q,endAngle:p,value:(p-q)/o}),p+=f}r=-1;while(++r<e){s=r-1;while(++s<e){var w=a[r+"-"+s],x=a[s+"-"+r];(w.value||x.value)&&b.push({source:w,target:x})}}i&&k()}var a={},b,c,d,e,f=0,g,h,i;a.matrix=function(f){if(!arguments.length)return d;e=(d=f)&&d.length,b=c=null;return a},a.padding=function(d){if(!arguments.length)return f;f=d,b=c=null;return a},a.sortGroups=function(d){if(!arguments.length)return g;g=d,b=c=null;return a},a.sortSubgroups=function(c){if(!arguments.length)return h;h=c,b=null;return a},a.sortChords=function(c){if(!arguments.length)return i;i=c,b&&k();return a},a.chords=function(){b||j();return b},a.groups=function(){c||j();return c};return a},d3.layout.force=function(){function j(){var a=i.length,c,f,g,h,j,k,l;for(c=0;c<a;++c){f=i[c],g=f.source,h=f.target,k=h.x-g.x,l=h.y-g.y;if(j=Math.sqrt(k*k+l*l))j=d/(f.distance*f.distance)*(j-e*f.distance)/j,k*=j,l*=j,h.fixed||(h.x-=k,h.y-=l),g.fixed||(g.x+=k,g.y+=l)}b.tick.dispatch({type:"tick"});return(d*=.99)<.005}var a={},b=d3.dispatch("tick"),c=[1,1],d=.5,e=30,f,g,h,i;a.on=function(c,d){b[c].add(d);return a},a.nodes=function(b){if(!arguments.length)return g;g=b;return a},a.links=function(b){if(!arguments.length)return h;h=b;return a},a.size=function(b){if(!arguments.length)return c;c=b;return a},a.distance=function(b){if(!arguments.length)return e;e=b;return a},a.start=function(){var b,d,e,f=g.length,k=h.length,l=c[0],m=c[1],n,o=[];for(b=0;b<f;++b){n=g[b],n.x=n.x||Math.random()*l,n.y=n.y||Math.random()*m,n.fixed=0,o[b]=[];for(d=0;d<f;++d)o[b][d]=Infinity;o[b][b]=0}for(b=0;b<k;++b)n=h[b],o[n.source][n.target]=1,o[n.target][n.source]=1,n.source=g[n.source],n.target=g[n.target];for(e=0;e<f;++e)for(b=0;b<f;++b)for(d=0;d<f;++d)o[b][d]=Math.min(o[b][d],o[b][e]+o[e][d]);i=[];for(b=0;b<f;++b)for(d=b+1;d<f;++d)i.push({source:g[b],target:g[d],distance:o[b][d]*o[b][d]});i.sort(function(a,b){return a.distance-b.distance}),d3.timer(j);return a},a.resume=function(){d=.1,d3.timer(j);return a},a.stop=function(){d=0;return a},a.drag=function(){function f(){!b||(e(),b.fixed=!1,b=c=null)}function e(){if(!!b){var d=d3.svg.mouse(c);b.x=d[0],b.y=d[1],a.resume()}}function d(a){(b=a).fixed=!0,c=this,d3.event.preventDefault()}var b,c;this.on("mouseover",function(a){a.fixed=!0}).on("mouseout",function(a){a!=b&&(a.fixed=!1)}).on("mousedown",d),d3.select(window).on("mousemove",e).on("mouseup",f);return a};return a},d3.layout.partition=function(){function e(e,f){var g=a.call(this,e,f);c(g[0],0,b[0],b[1]/d(g[0]));return g}function d(a){var b=a.children,c=0;if(b){var e=-1,f=b.length;while(++e<f)c=Math.max(c,d(b[e]))}return 1+c}function c(a,b,d,e){var f=a.children;a.x=b,a.y=a.depth*e,a.dx=d,a.dy=e;if(f){var g=-1,h=f.length,i,j;d/=a.value;while(++g<h)c(i=f[g],b,j=i.value*d,e),b+=j}}var a=d3.layout.hierarchy(),b=[1,1];e.sort=d3.rebind(e,a.sort),e.children=d3.rebind(e,a.children),e.value=d3.rebind(e,a.value),e.size=function(a){if(!arguments.length)return b;b=a;return e};return e},d3.layout.pie=function(){function f(f,g){var h=+(typeof c=="function"?c.apply(this,arguments):c),i=(typeof e=="function"?e.apply(this,arguments):e)-c,j=d3.range(f.length);b!=null&&j.sort(function(a,c){return b(f[a],f[c])});var k=f.map(a);i/=k.reduce(function(a,b){return a+b},0);var l=j.map(function(a){return{value:d=k[a],startAngle:h,endAngle:h+=d*i}});return f.map(function(a,b){return l[j[b]]})}var a=Number,b=null,c=0,e=2*Math.PI;f.value=function(b){if(!arguments.length)return a;a=b;return f},f.sort=function(a){if(!arguments.length)return b;b=a;return f},f.startAngle=function(a){if(!arguments.length)return c;c=a;return f},f.endAngle=function(a){if(!arguments.length)return e;e=a;return f};return f},d3.layout.stack=function(){function e(e){var f=e.length,g=e[0].length,h,i,j,k=a[c](e);b[d](e,k);for(i=0;i<g;++i)for(h=1,j=e[k[0]][i].y0;h<f;++h)e[k[h]][i].y0=j+=e[k[h-1]][i].y;return e}var c="default",d="zero";e.order=function(a){if(!arguments.length)return c;c=a;return e},e.offset=function(a){if(!arguments.length)return d;d=a;return e};return e};var a={"inside-out":function(a){var b=a.length,d,f,g=a.map(e),h=a.map(c),i=d3.range(b).sort(function(a,b){return g[a]-g[b]}),j=0,k=0,l=[],m=[];for(d=0;d<b;d++)f=i[d],j<k?(j+=h[f],l.push(f)):(k+=h[f],m.push(f));return m.reverse().concat(l)},reverse:function(a){return d3.range(a.length).reverse()},"default":function(a){return d3.range(a.length)}},b={silhouette:function(a,b){var c=a.length,d=a[0].length,e=[],f=0,g,h,i;for(h=0;h<d;++h){for(g=0,i=0;g<c;g++)i+=a[g][h].y;i>f&&(f=i),e.push(i)}for(h=0,g=b[0];h<d;++h)a[g][h].y0=(f-e[h])/2},wiggle:function(a,b){var c=a.length,d=a[0],e=d.length,f=0,g,h,i,j,k,l=b[0],m,n,o,p,q,r;a[l][0].y0=q=r=0;for(h=1;h<e;++h){for(g=0,m=0;g<c;++g)m+=a[g][h].y;for(g=0,n=0,p=d[h].x-d[h-1].x;g<c;++g){for(i=0,j=b[g],o=(a[j][h].y-a[j][h-1].y)/(2*p);i<g;++i)o+=(a[k=b[i]][h].y-a[k][h-1].y)/p;n+=o*a[j][h].y}a[l][h].y0=q-=m?n/m*p:0,q<r&&(r=q)}for(h=0;h<e;++h)a[l][h].y0-=r},zero:function(a,b){var c=0,d=a[0].length,e=b[0];for(;c<d;++c)a[e][c].y0=0}};d3.layout.hierarchy=function(){function j(a){var b=[];e(a,0,b);return b}function f(a,b){var d=a.children,e=0;if(d){var g=-1,h=d.length,i=b+1;while(++g<h)e+=f(d[g],i)}else e=c.call(j,a.data,b);return a.value=e}function e(f,g,h){var i=b.call(j,f,g),k={depth:g,data:f};h.push(k);if(i){var l=-1,m=i.length,n=k.children=[],o=0,p=g+1;while(++l<m)d=e(i[l],p,h),d.value>0&&(n.push(d),o+=d.value,d.parent=k);a&&n.sort(a),k.value=o}else k.value=c.call(j,f,g);return k}var a=i,b=g,c=h;j.sort=function(b){if(!arguments.length)return a;a=b;return j},j.children=function(a){if(!arguments.length)return b;b=a;return j},j.value=function(a){if(!arguments.length)return c;c=a;return j},j.revalue=function(a){f(a,0);return a};return j},d3.layout.treemap=function(){function k(b){var i=e||a(b),j=i[0];j.x=0,j.y=0,j.dx=c[0],j.dy=c[1],e&&a.revalue(j),f(j,c[0]*c[1]/j.value),(e?h:g)(j),d&&(e=i);return i}function j(a,c,d,e){var f=-1,g=a.length,h=d.x,i=d.y,j=c?b(a.area/c):0,k;if(c==d.dx){if(e||j>d.dy)j=d.dy;while(++f<g)k=a[f],k.x=h,k.y=i,k.dy=j,h+=k.dx=b(k.area/j);k.z=!0,k.dx+=d.x+d.dx-h,d.y+=j,d.dy-=j}else{if(e||j>d.dx)j=d.dx;while(++f<g)k=a[f],k.x=h,k.y=i,k.dx=j,i+=k.dy=b(k.area/j);k.z=!1,k.dy+=d.y+d.dy-i,d.x+=j,d.dx-=j}}function i(a,b){var c=a.area,d,e=0,f=Infinity,g=-1,h=a.length;while(++g<h)d=a[g].area,d<f&&(f=d),d>e&&(e=d);c*=c,b*=b;return Math.max(b*e/c,c/(b*f))}function h(a){if(!!a.children){var b={x:a.x,y:a.y,dx:a.dx,dy:a.dy},c=a.children.slice(),d,e=[];e.area=0;while(d=c.pop())e.push(d),e.area+=d.area,d.z!=null&&(j(e,d.z?b.dx:b.dy,b,!c.length),e.length=e.area=0);a.children.forEach(h)}}function g(a){if(!!a.children){var b={x:a.x,y:a.y,dx:a.dx,dy:a.dy},c=[],d=a.children.slice(),e,f=Infinity,h,k=Math.min(b.dx,b.dy),l;c.area=0;while((l=d.length)>0)c.push(e=d[l-1]),c.area+=e.area,(h=i(c,k))<=f?(d.pop(),f=h):(c.area-=c.pop().area,j(c,k,b,!1),k=Math.min(b.dx,b.dy),c.length=c.area=0,f=Infinity);c.length&&(j(c,k,b,!0),c.length=c.area=0),a.children.forEach(g)}}function f(a,b){var c=a.children;a.area=a.value*b;if(c){var d=-1,e=c.length;while(++d<e)f(c[d],b)}}var a=d3.layout.hierarchy(),b=Math.round,c=[1,1],d=!1,e;k.sort=d3.rebind(k,a.sort),k.children=d3.rebind(k,a.children),k.value=d3.rebind(k,a.value),k.size=function(a){if(!arguments.length)return c;c=a;return k},k.round=function(a){if(!arguments.length)return b!=Number;b=a?Math.round:Number;return k},k.sticky=function(a){if(!arguments.length)return d;d=a,e=null;return k};return k}})()
View
72 d3.min.js
@@ -1,70 +1,2 @@
-(function(){function za(a){for(var b=-1,c=a.length,g=[];++b<c;)g.push(a[b]);return g}function w(a){return typeof a=="function"?a:function(){return a}}function Aa(a){return a==null}function ea(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function fa(a){a.apply(this,(arguments[0]=this,arguments));return this}function Ba(){var a={},b=[];a.add=function(c){for(var g=0;g<b.length;g++)if(b[g].listener==c)return a;b.push({listener:c,on:true});return a};a.remove=function(c){for(var g=0;g<b.length;g++){var e=
-b[g];if(e.listener==c){e.on=false;b=b.slice(0,g).concat(b.slice(g+1));break}}return a};a.dispatch=function(){for(var c=b,g=0,e=c.length;g<e;g++){var d=c[g];d.on&&d.listener.apply(this,arguments)}};return a}function ga(a){for(var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),g=[];b>0;)g.push(a.substring(b-=3,b+3));return g.reverse().join(",")+c}function ha(a){return function(b){return 1-a(1-b)}}function ia(a){return function(b){return 0.5*(b<0.5?a(2*b):2-a(2-2*b))}}function Ca(a){return a}
-function R(a){return function(b){return Math.pow(b,a)}}function Da(a){return 1-Math.cos(a*Math.PI/2)}function Ea(a){return a?Math.pow(2,10*(a-1))-0.0010:0}function Fa(a){return 1-Math.sqrt(1-a*a)}function Ga(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375}function J(a,b,c){return{r:a,g:b,b:c,toString:Ha}}function Ha(){return"#"+S(this.r)+S(this.g)+S(this.b)}function S(a){return a<16?"0"+a.toString(16):a.toString(16)}
-function T(a,b,c){var g=0,e=0,d=0,f,h;if(f=/([a-z]+)\((.*)\)/i.exec(a)){h=f[2].split(",");switch(f[1]){case "hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case "rgb":return b(U(h[0]),U(h[1]),U(h[2]))}}if(c=G[a])return b(c.r,c.g,c.b);if(a!=null&&a.charAt(0)=="#"){if(a.length==4){g=a.charAt(1);g+=g;e=a.charAt(2);e+=e;d=a.charAt(3);d+=d}else if(a.length==7){g=a.substring(1,3);e=a.substring(3,5);d=a.substring(5,7)}g=parseInt(g,16);e=parseInt(e,16);d=parseInt(d,16)}return b(g,
-e,d)}function Ia(a,b,c){var g=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),d=e-g,f=(e+g)/2;if(d){g=f<0.5?d/(e+g):d/(2-e-g);a=a==e?(b-c)/d+(b<c?6:0):b==e?(c-a)/d+2:(a-b)/d+4;a*=60}else g=a=0;return V(a,g,f)}function U(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function V(a,b,c){return{h:a,s:b,l:c,toString:Ja}}function Ja(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function W(a,b,c){function g(f){if(f>360)f-=360;else if(f<0)f+=360;if(f<60)return e+
-(d-e)*f/60;if(f<180)return d;if(f<240)return e+(d-e)*(240-f)/60;return e}var e,d;a%=360;if(a<0)a+=360;b=b<0?0:b>1?1:b;c=c<0?0:c>1?1:c;d=c<=0.5?c*(1+b):c+b-c*b;e=2*c-d;return J(Math.round(g(a+120)*255),Math.round(g(a)*255),Math.round(g(a-120)*255))}function z(a){function b(e){for(var d=[],f,h,i,k,j=0,p=a.length;j<p;j++){i=a[j];d.push(f=[]);f.parentNode=i.parentNode;f.parentData=i.parentData;for(var q=0,m=i.length;q<m;q++)if(k=i[q]){f.push(h=e(k));if(h&&"__data__"in k)h.__data__=k.__data__}else f.push(null)}return z(d)}
-function c(e){for(var d=[],f,h,i,k=0,j=a.length;k<j;k++){h=a[k];for(var p=0,q=h.length;p<q;p++)if(i=h[p]){d.push(f=e(i));f.parentNode=i;f.parentData=i.__data__}}return z(d)}function g(e){for(var d=0,f=a.length;d<f;d++)for(var h=a[d],i=0,k=h.length;i<k;i++){var j=h[i];if(j)return e.call(j,j.__data__,i)}return null}a.select=function(e){return b(function(d){return D(e,d)})};a.selectAll=function(e){return c(function(d){return ja(e,d)})};a.filter=function(e){for(var d=[],f,h,i,k=0,j=a.length;k<j;k++){h=
-a[k];d.push(f=[]);f.parentNode=h.parentNode;f.parentData=h.parentData;for(var p=0,q=h.length;p<q;p++)if((i=h[p])&&e.call(i,i.__data__,p))f.push(i)}return z(d)};a.map=function(e){for(var d,f,h=0,i=a.length;h<i;h++){d=a[h];for(var k=0,j=d.length;k<j;k++)if(f=d[k])f.__data__=e.call(f,f.__data__,k)}return a};a.data=function(e,d){function f(m,o){var l=0,r=m.length,s=o.length,u=Math.min(r,s),v=Math.max(r,s),t=[],A=[],x=[],y,B;if(d){u={};v=[];var E;B=o.length;for(l=0;l<r;l++){E=d.call(y=m[l],y.__data__,
-l);if(E in u)x[B++]=m[l];else{u[E]=y;v.push(E)}}for(l=0;l<s;l++){if(y=u[E=d.call(o,B=o[l],l)]){y.__data__=B;t[l]=y;A[l]=x[l]=null}else{A[l]={__data__:B};t[l]=x[l]=null}delete u[E]}for(l=0;l<r;l++)if(v[l]in u)x[l]=m[l]}else{for(;l<u;l++){y=m[l];B=o[l];if(y){y.__data__=B;t[l]=y;A[l]=x[l]=null}else{A[l]={__data__:B};t[l]=x[l]=null}}for(;l<s;l++){A[l]={__data__:o[l]};t[l]=x[l]=null}for(;l<v;l++){x[l]=m[l];A[l]=t[l]=null}}A.parentNode=t.parentNode=x.parentNode=m.parentNode;A.parentData=t.parentData=x.parentData=
-m.parentData;h.push(A);i.push(t);k.push(x)}var h=[],i=[],k=[],j=-1,p=a.length,q;if(typeof e=="function")for(;++j<p;)f(q=a[j],e.call(q,q.parentData,j));else for(;++j<p;)f(q=a[j],e);j=z(i);j.enter=function(){return Ka(h)};j.exit=function(){return z(k)};return j};a.each=function(e){for(var d=0,f=a.length;d<f;d++)for(var h=a[d],i=0,k=h.length;i<k;i++){var j=h[i];j&&e.call(j,j.__data__,i)}return a};a.empty=function(){return!g(function(){return true})};a.node=function(){return g(function(){return this})};
-a.attr=function(e,d){function f(){this.removeAttribute(e)}function h(){this.removeAttributeNS(e.space,e.local)}function i(){this.setAttribute(e,d)}function k(){this.setAttributeNS(e.space,e.local,d)}function j(){var q=d.apply(this,arguments);q==null?this.removeAttribute(e):this.setAttribute(e,q)}function p(){var q=d.apply(this,arguments);q==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,q)}e=d3.ns.qualify(e);if(arguments.length<2)return g(e.local?function(){return this.getAttributeNS(e.space,
-e.local)}:function(){return this.getAttribute(e)});return a.each(d==null?e.local?h:f:typeof d=="function"?e.local?p:j:e.local?k:i)};a.classed=function(e,d){function f(){var j=this.className;k.lastIndex=0;if(!k.test(j))this.className=ea(j+" "+e)}function h(){var j=ea(this.className.replace(k," "));this.className=j.length?j:null}function i(){(d.apply(this,arguments)?f:h).call(this)}var k=RegExp("(^|\\s+)"+d3.requote(e)+"(\\s+|$)","g");if(arguments.length<2)return g(function(){k.lastIndex=0;return k.test(this.className)});
-return a.each(typeof d=="function"?i:d?f:h)};a.style=function(e,d,f){function h(){this.style.removeProperty(e)}function i(){this.style.setProperty(e,d,f)}function k(){var j=d.apply(this,arguments);j==null?this.style.removeProperty(e):this.style.setProperty(e,j,f)}if(arguments.length<3)f=null;if(arguments.length<2)return g(function(){return window.getComputedStyle(this,null).getPropertyValue(e)});return a.each(d==null?h:typeof d=="function"?k:i)};a.property=function(e,d){function f(){delete this[e]}
-function h(){this[e]=d}function i(){var k=d.apply(this,arguments);if(k==null)delete this[e];else this[e]=k}e=d3.ns.qualify(e);if(arguments.length<2)return g(function(){return this[e]});return a.each(d==null?f:typeof d=="function"?i:h)};a.text=function(e){function d(){this.appendChild(document.createTextNode(e))}function f(){var h=e.apply(this,arguments);h!=null&&this.appendChild(document.createTextNode(h))}if(arguments.length<1)return g(function(){return this.textContent});a.each(function(){for(;this.lastChild;)this.removeChild(this.lastChild)});
-return e==null?a:a.each(typeof e=="function"?f:d)};a.html=function(e){function d(){this.innerHTML=e}function f(){this.innerHTML=e.apply(this,arguments)}if(arguments.length<1)return g(function(){return this.innerHTML});return a.each(typeof e=="function"?f:d)};a.append=function(e){function d(h){return h.appendChild(document.createElement(e))}function f(h){return h.appendChild(document.createElementNS(e.space,e.local))}e=d3.ns.qualify(e);return b(e.local?f:d)};a.insert=function(e,d){function f(i){return i.insertBefore(document.createElement(e),
-D(d,i))}function h(i){return i.insertBefore(document.createElementNS(e.space,e.local),D(d,i))}e=d3.ns.qualify(e);return b(e.local?h:f)};a.remove=function(){return b(function(e){var d=e.parentNode;d.removeChild(e);return d})};a.sort=function(e){e=La.apply(this,arguments);for(var d=0,f=a.length;d<f;d++){var h=a[d];h.sort(e);for(var i=1,k=h.length,j=h[0];i<k;i++){var p=h[i];if(p){j&&j.parentNode.insertBefore(p,j.nextSibling);j=p}}}return a};a.on=function(e,d){var f=e.indexOf("."),h=f==-1?e:e.substring(0,
-f),i="__on"+e;return a.each(function(k,j){function p(q){var m=d3.event;d3.event=q;try{d.call(this,k,j)}finally{d3.event=m}}this[i]&&this.removeEventListener(h,this[i],false);if(d)this.addEventListener(h,this[i]=p,false)})};a.transition=function(){return X(a)};a.call=fa;return a}function Ka(a){function b(c){for(var g=[],e,d,f,h,i=0,k=a.length;i<k;i++){f=a[i];g.push(e=[]);e.parentNode=f.parentNode;e.parentData=f.parentData;for(var j=0,p=f.length;j<p;j++)if(h=f[j]){e.push(d=c(f.parentNode));d.__data__=
-h.__data__}else e.push(null)}return z(g)}a.append=function(c){function g(d){return d.appendChild(document.createElement(c))}function e(d){return d.appendChild(document.createElementNS(c.space,c.local))}c=d3.ns.qualify(c);return b(c.local?e:g)};a.insert=function(c,g){function e(f){return f.insertBefore(document.createElement(c),D(g,f))}function d(f){return f.insertBefore(document.createElementNS(c.space,c.local),D(g,f))}c=d3.ns.qualify(c);return b(c.local?d:e)};return a}function La(a){if(!arguments.length)a=
-d3.ascending;return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function X(a){function b(m){var o=true,l=-1;a.each(function(){if(i[++l]!=2){var r=(m-k[l])/j[l],s=this.__transition__,u,v,t=d[l];if(r<1){o=false;if(r<0)return}else r=1;if(i[l]){if(!s||s.active!=g){i[l]=2;return}}else if(!s||s.active>g){i[l]=2;return}else{i[l]=1;h.start.dispatch.apply(this,arguments);t=d[l]={};s.active=g;for(v in e)t[v]=e[v].apply(this,arguments)}u=q(r);for(v in e)t[v].call(this,u);if(r==1){i[l]=2;if(s.active==
-g){r=s.owner;if(r==g){delete this.__transition__;f&&this.parentNode.removeChild(this)}Y=g;h.end.dispatch.apply(this,arguments);Y=0;s.owner=r}}}});return o}var c={},g=Y||++Ma,e={},d=[],f=false,h=d3.dispatch("start","end"),i=[],k=[],j=[],p,q=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=g});c.delay=function(m){var o=Infinity,l=-1;if(typeof m=="function")a.each(function(){var r=k[++l]=+m.apply(this,arguments);if(r<o)o=r});else{o=+m;a.each(function(){k[++l]=
-o})}ka(b,o);return c};c.duration=function(m){var o=-1;if(typeof m=="function"){p=0;a.each(function(){var l=j[++o]=+m.apply(this,arguments);if(l>p)p=l})}else{p=+m;a.each(function(){j[++o]=p})}return c};c.ease=function(m){q=typeof m=="function"?m:d3.ease.apply(d3,arguments);return c};c.attrTween=function(m,o){function l(s,u){var v=o.call(this,s,u,this.getAttribute(m));return function(t){this.setAttribute(m,v(t))}}function r(s,u){var v=o.call(this,s,u,this.getAttributeNS(m.space,m.local));return function(t){this.setAttributeNS(m.space,
-m.local,v(t))}}e["attr."+m]=m.local?r:l;return c};c.attr=function(m,o){return c.attrTween(m,la(o))};c.styleTween=function(m,o,l){if(arguments.length<3)l=null;e["style."+m]=function(r,s){var u=o.call(this,r,s,window.getComputedStyle(this,null).getPropertyValue(m));return function(v){this.style.setProperty(m,u(v),l)}};return c};c.style=function(m,o,l){if(arguments.length<3)l=null;return c.styleTween(m,la(o),l)};c.select=function(m){var o;m=X(a.select(m)).ease(q);o=-1;m.delay(function(){return k[++o]});
-o=-1;m.duration(function(){return j[++o]});return m};c.selectAll=function(m){var o;m=X(a.selectAll(m)).ease(q);o=-1;m.delay(function(l,r){return k[r?o:++o]});o=-1;m.duration(function(l,r){return j[r?o:++o]});return m};c.remove=function(){f=true;return c};c.each=function(m,o){h[m].add(o);return c};c.call=fa;return c.delay(0).duration(250)}function la(a){return typeof a=="function"?function(b,c,g){return d3.interpolate(g,String(a.call(this,b,c)))}:(a=String(a),function(b,c,g){return d3.interpolate(g,
-a)})}function ka(a,b){var c=Date.now(),g=false,e=c+b,d=F;if(isFinite(b)){for(;d;){if(d.callback==a){d.then=c;d.delay=b;g=true}else{var f=d.then+d.delay;if(f<e)e=f}d=d.next}g||(F={callback:a,then:c,delay:b,next:F});if(!K){clearTimeout(Z);Z=setTimeout(Na,Math.max(24,e-c))}}}function Na(){K=1;Z=0;ma(na)}function na(){for(var a,b=Date.now(),c=F;c;){a=b-c.then;if(a>c.delay)c.flush=c.callback(a);c=c.next}a=null;for(b=F;b;)b=b.flush?a?a.next=b.next:F=b.next:(a=b).next;a||(K=0);K&&ma(na)}function $(a){return Math.log(a)/
-Math.LN10}function oa(a){return-Math.log(-a)/Math.LN10}function Oa(a){return function(b){return Math.pow(b,a)}}function Pa(a){return function(b){return-Math.pow(-b,a)}}function Qa(a){return a.innerRadius}function Ra(a){return a.outerRadius}function pa(a){return a.startAngle}function qa(a){return a.endAngle}function aa(a,b,c,g){var e=[],d=-1,f=b.length,h=typeof c=="function",i=typeof g=="function",k;if(h&&i)for(;++d<f;)e.push([c.call(a,k=b[d],d),g.call(a,k,d)]);else if(h)for(;++d<f;)e.push([c.call(a,
-b[d],d),g]);else if(i)for(;++d<f;)e.push([c,g.call(a,b[d],d)]);else for(;++d<f;)e.push([c,g]);return e}function ra(a){return a[0]}function sa(a){return a[1]}function H(a){var b=[],c=0,g=a.length,e=a[0];for(b.push(e[0],",",e[1]);++c<g;)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function ta(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return H(a);var c=a.length!=b.length,g="",e=a[0],d=a[1],f=b[0],h=f,i=1;if(c){g+="Q"+(d[0]-f[0]*2/3)+","+(d[1]-f[1]*2/3)+","+d[0]+","+d[1];e=a[1];
-i=2}if(b.length>1){h=b[1];d=a[i];i++;g+="C"+(e[0]+f[0])+","+(e[1]+f[1])+","+(d[0]-h[0])+","+(d[1]-h[1])+","+d[0]+","+d[1];for(e=2;e<b.length;e++,i++){d=a[i];h=b[e];g+="S"+(d[0]-h[0])+","+(d[1]-h[1])+","+d[0]+","+d[1]}}if(c){c=a[i];g+="Q"+(d[0]+h[0]*2/3)+","+(d[1]+h[1]*2/3)+","+c[0]+","+c[1]}return g}function ua(a,b){for(var c=[],g=(1-b)/2,e=a[0],d=a[1],f=a[2],h=2,i=a.length;++h<i;){c.push([g*(f[0]-e[0]),g*(f[1]-e[1])]);e=d;d=f;f=a[h]}c.push([g*(f[0]-e[0]),g*(f[1]-e[1])]);return c}function C(a,b){return a[0]*
-b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function L(a,b,c){a.push("C",C(va,b),",",C(va,c),",",C(wa,b),",",C(wa,c),",",C(M,b),",",C(M,c))}function Sa(){return 0}function Ta(a){return a.source}function Ua(a){return a.target}function Va(a){return a.radius}function Wa(){return 64}function Xa(){return"circle"}d3={version:"1.8.3"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;return new b};var N=function(a){return Array.prototype.slice.call(a)};
-try{N(document.documentElement.childNodes)}catch(jb){N=za}d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}};d3.ascending=function(a,b){return a<b?-1:a>b?1:0};d3.descending=function(a,b){return b<a?-1:b>a?1:0};d3.min=function(a,b){var c=0,g=a.length,e=a[0],d;if(arguments.length==1)for(;++c<g;){if(e>(d=a[c]))e=d}else for(e=b(a[0]);++c<g;)if(e>(d=b(a[c])))e=d;return e};d3.max=function(a,b){var c=0,g=a.length,e=a[0],d;if(arguments.length==1)for(;++c<g;){if(e<
-(d=a[c]))e=d}else for(e=b(e);++c<g;)if(e<(d=b(a[c])))e=d;return e};d3.nest=function(){function a(h,i){if(i>=g.length)return f?f.call(c,h):d?h.sort(d):h;for(var k=-1,j=h.length,p=g[i++],q,m,o={};++k<j;)if((q=p(m=h[k]))in o)o[q].push(m);else o[q]=[m];for(q in o)o[q]=a(o[q],i);return o}function b(h,i){if(i>=g.length)return h;var k=[],j=e[i++],p;for(p in h)k.push({key:p,values:b(h[p],i)});j&&k.sort(function(q,m){return j(q.key,m.key)});return k}var c={},g=[],e=[],d,f;c.map=function(h){return a(h,0)};
-c.entries=function(h){return b(a(h,0),0)};c.key=function(h){g.push(h);return c};c.sortKeys=function(h){e[g.length-1]=h;return c};c.sortValues=function(h){d=h;return c};c.rollup=function(h){f=h;return c};return c};d3.keys=function(a){var b=[],c;for(c in a)b.push(c);return b};d3.values=function(a){var b=[],c;for(c in a)b.push(a[c]);return b};d3.entries=function(a){var b=[],c;for(c in a)b.push({key:c,value:a[c]});return b};d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.split=function(a,
-b){var c=[],g=[],e,d=-1,f=a.length;if(arguments.length<2)b=Aa;for(;++d<f;)if(b.call(g,e=a[d],d))g=[];else{g.length||c.push(g);g.push(e)}return c};d3.range=function(a,b,c){if(arguments.length==1){b=a;a=0}if(c==null)c=1;if((b-a)/c==Infinity)throw Error("infinite range");var g=[],e=-1,d;if(c<0)for(;(d=a+c*++e)>b;)g.push(d);else for(;(d=a+c*++e)<b;)g.push(d);return g};d3.requote=function(a){return a.replace(Ya,"\\$&")};var Ya=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var g=new XMLHttpRequest;
-if(arguments.length<3)c=b;else b&&g.overrideMimeType&&g.overrideMimeType(b);g.open("GET",a,true);g.onreadystatechange=function(){if(g.readyState==4)c(g.status<300?g:null)};g.send(null)};d3.text=function(a,b,c){if(arguments.length<3){c=b;b=null}d3.xhr(a,b,function(g){c(g&&g.responseText)})};d3.json=function(a,b){d3.text(a,"application/json",function(c){b(c?JSON.parse(c):null)})};d3.html=function(a,b){d3.text(a,"text/html",function(c){if(c!=null){var g=document.createRange();g.selectNode(document.body);
-c=g.createContextualFragment(c)}b(c)})};d3.xml=function(a,b,c){if(arguments.length<3){c=b;b=null}d3.xhr(a,b,function(g){c(g&&g.responseXML)})};d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}};d3.dispatch=function(){for(var a={},
-b,c=0,g=arguments.length;c<g;c++){b=arguments[c];a[b]=Ba(b)}return a};d3.format=function(a){a=Za.exec(a);var b=a[1]||" ",c=a[3]||"",g=a[5],e=+a[6],d=a[7],f=a[8],h=a[9];if(f)f=f.substring(1);if(g){b="0";if(d)e-=Math.floor((e-1)/4)}if(h=="d")f="0";return function(i){i=+i;var k=i<0&&(i=-i)?"":c;if(h=="d"&&i%1)return"";i=f?i.toFixed(f):""+i;if(g){var j=i.length+k.length;if(j<e)i=Array(e-j+1).join(b)+i;if(d)i=ga(i);i=k+i}else{if(d)i=ga(i);i=k+i;j=i.length;if(j<e)i=Array(e-j+1).join(b)+i}return i}};var Za=
-/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,$a=R(2),ab=R(3),bb={linear:function(){return Ca},poly:R,quad:function(){return $a},cubic:function(){return ab},sin:function(){return Da},exp:function(){return Ea},circle:function(){return Fa},elastic:function(a,b){var c;if(arguments.length<2)b=0.45;if(arguments.length<1){a=1;c=b/4}else c=b/(2*Math.PI)*Math.asin(1/a);return function(g){return 1+a*Math.pow(2,10*-g)*Math.sin((g-c)*2*Math.PI/b)}},back:function(a){a||(a=1.70158);
-return function(b){return b*b*((a+1)*b-a)}},bounce:function(){return Ga}},cb={"in":function(a){return a},out:ha,"in-out":ia,"out-in":function(a){return ia(ha(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a;b=b>=0?a.substring(b+1):"in";return cb[b](bb[c].apply(null,Array.prototype.slice.call(arguments,1)))};d3.event=null;d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in G||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),
-b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)};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,g,e=0,d=[],f=[],h,i;for(g=0;c=ba.exec(b);++g){c.index&&d.push(b.substring(e,c.index));f.push({i:d.length,x:c[0]});d.push(null);e=ba.lastIndex}e<b.length&&d.push(b.substring(e));
-g=0;for(h=f.length;(c=ba.exec(a))&&g<h;++g){i=f[g];if(i.x==c[0]){if(i.i)if(d[i.i+1]==null){d[i.i-1]+=i.x;d.splice(i.i,1);for(c=g+1;c<h;++c)f[c].i--}else{d[i.i-1]+=i.x+d[i.i+1];d.splice(i.i,2);for(c=g+1;c<h;++c)f[c].i-=2}else if(d[i.i+1]==null)d[i.i]=i.x;else{d[i.i]=i.x+d[i.i+1];d.splice(i.i+1,1);for(c=g+1;c<h;++c)f[c].i--}f.splice(g,1);h--;g--}else i.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(i.x))}for(;g<h;){i=f.pop();if(d[i.i+1]==null)d[i.i]=i.x;else{d[i.i]=i.x+d[i.i+1];d.splice(i.i+1,1)}h--}if(d.length==
-1)return d[0]==null?f[0].x:function(){return b};return function(k){for(g=0;g<h;++g)d[(i=f[g]).i]=i.x(k);return d.join("")}};d3.interpolateRgb=function(a,b){a=d3.rgb(a);b=d3.rgb(b);var c=a.r,g=a.g,e=a.b,d=b.r-c,f=b.g-g,h=b.b-e;return function(i){return"rgb("+Math.round(c+d*i)+","+Math.round(g+f*i)+","+Math.round(e+h*i)+")"}};d3.interpolateHsl=function(a,b){a=d3.hsl(a);b=d3.hsl(b);var c=a.h,g=a.s,e=a.l,d=b.h-c,f=b.s-g,h=b.l-e;return function(i){return W(c+d*i,g+f*i,e+h*i).toString()}};d3.interpolateArray=
-function(a,b){var c=[],g=[],e=a.length,d=b.length,f=Math.min(a.length,b.length),h;for(h=0;h<f;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)g[h]=a[h];for(;h<d;++h)g[h]=b[h];return function(i){for(h=0;h<f;++h)g[h]=c[h](i);return g}};d3.interpolateObject=function(a,b){var c={},g={},e;for(e in a)if(e in b)c[e]=(e in db||/\bcolor\b/.test(e)?d3.interpolateRgb:d3.interpolate)(a[e],b[e]);else g[e]=a[e];for(e in b)e in a||(g[e]=b[e]);return function(d){for(e in c)g[e]=c[e](d);return g}};var ba=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,
-db={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?T(""+a,J,W):J(~~a,~~b,~~c)};var G={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",
-darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",
-firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",
-lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",
-mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",
-rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},
-ca;for(ca in G)G[ca]=T(G[ca],J,W);d3.hsl=function(a,b,c){return arguments.length==1?T(""+a,Ia,V):V(+a,+b,+c)};var D=function(a,b){return b.querySelector(a)},ja=function(a,b){return N(b.querySelectorAll(a))};if(typeof Sizzle=="function"){D=function(a,b){return Sizzle(a,b)[0]};ja=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))}}var O=z([[document]]);O[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?O.select(a):z([[a]])};d3.selectAll=function(a){return typeof a==
-"string"?O.selectAll(a):z([N(a)])};d3.transition=O.transition;var Ma=0,Y=0,F=null,Z=0,K;d3.timer=function(a){ka(a,0)};var ma=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={};d3.scale.linear=function(){function a(j){return k((j-c)*f)}function b(j){var p=Math.min(c,g),q=Math.max(c,g),m=q-p,o=Math.pow(10,Math.floor(Math.log(m/j)/Math.LN10));j/=m/o;
-if(j<=0.15)o*=10;else if(j<=0.35)o*=5;else if(j<=0.75)o*=2;return{start:Math.ceil(p/o)*o,stop:Math.floor(q/o)*o+o*0.5,step:o}}var c=0,g=1,e=0,d=1,f=1,h=1,i=d3.interpolate,k=i(e,d);a.invert=function(j){return(j-e)*h+c};a.domain=function(j){if(!arguments.length)return[c,g];c=+j[0];g=+j[1];f=1/(g-c);h=(g-c)/(d-e);return a};a.range=function(j){if(!arguments.length)return[e,d];e=j[0];d=j[1];h=(g-c)/(d-e);k=i(e,d);return a};a.rangeRound=function(j){return a.range(j).interpolate(d3.interpolateRound)};a.interpolate=
-function(j){if(!arguments.length)return i;k=(i=j)(e,d);return a};a.ticks=function(j){j=b(j);return d3.range(j.start,j.stop,j.step)};a.tickFormat=function(j){j=Math.max(0,-Math.floor(Math.log(b(j).step)/Math.LN10+0.01));return d3.format(",."+j+"f")};return a};d3.scale.log=function(){function a(e){return b(c(e))}var b=d3.scale.linear(),c=$,g=c.pow;a.invert=function(e){return g(b.invert(e))};a.domain=function(e){if(!arguments.length)return b.domain().map(g);c=(e[0]||e[1])<0?oa:$;g=c.pow;b.domain(e.map(c));
-return a};a.range=d3.rebind(a,b.range);a.rangeRound=d3.rebind(a,b.rangeRound);a.interpolate=d3.rebind(a,b.interpolate);a.ticks=function(){var e=b.domain(),d=[];if(e.every(isFinite)){var f=Math.floor(e[0]),h=Math.ceil(e[1]),i=g(e[0]);e=g(e[1]);if(n)for(d.push(g(f));f++<h;)for(var k=9;k>0;k--)d.push(g(f)*k);else{for(;f<h;f++)for(k=1;k<10;k++)d.push(g(f)*k);d.push(g(f))}for(f=0;d[f]<i;f++);for(h=d.length;d[h-1]>e;h--);d=d.slice(f,h)}return d};a.tickFormat=function(){return function(e){return e.toPrecision(1)}};
-return a};$.pow=function(a){return Math.pow(10,a)};oa.pow=function(a){return-Math.pow(10,-a)};d3.scale.pow=function(){function a(f){return b(e(f))}var b=d3.scale.linear(),c=d3.scale.linear(),g=1,e=Number,d=e;a.invert=function(f){return d(b.invert(f))};a.domain=function(f){if(!arguments.length)return b.domain().map(d);var h=(f[0]||f[1])<0?Pa:Oa;e=h(g);d=h(1/g);b.domain(f.map(e));c.domain(f);return a};a.range=d3.rebind(a,b.range);a.rangeRound=d3.rebind(a,b.rangeRound);a.interpolate=d3.rebind(a,b.interpolate);
-a.ticks=c.ticks;a.tickFormat=c.tickFormat;a.exponent=function(f){if(!arguments.length)return g;var h=a.domain();g=f;return a.domain(h)};return a};d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){function a(d){d=d in c?c[d]:c[d]=b.push(d)-1;return g[d%g.length]}var b=[],c={},g=[],e=0;a.domain=function(d){if(!arguments.length)return b;b=d;c={};for(var f=-1,h=-1,i=b.length;++f<i;){d=b[f];d in c||(c[d]=++h)}return a};a.range=function(d){if(!arguments.length)return g;
-g=d;return a};a.rangePoints=function(d,f){if(arguments.length<2)f=0;var h=d[0],i=d[1],k=(i-h)/(b.length-1+f);g=b.length==1?[(h+i)/2]:d3.range(h+k*f/2,i+k/2,k);e=0;return a};a.rangeBands=function(d,f){if(arguments.length<2)f=0;var h=d[0],i=d[1],k=(i-h)/(b.length+f);g=d3.range(h+k*f,i,k);e=k*(1-f);return a};a.rangeRoundBands=function(d,f){if(arguments.length<2)f=0;var h=d[0],i=d[1],k=i-h,j=Math.floor(k/(b.length+f));g=d3.range(h+Math.round((k-(b.length-f)*j)/2),i,j);e=Math.round(j*(1-f));return a};
-a.rangeBand=function(){return e};return a};d3.scale.category10=function(){return d3.scale.ordinal().range(eb)};d3.scale.category20=function(){return d3.scale.ordinal().range(fb)};d3.scale.category20b=function(){return d3.scale.ordinal().range(gb)};d3.scale.category20c=function(){return d3.scale.ordinal().range(hb)};var eb=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],fb=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896",
-"#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],gb=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],hb=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696",
-"#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function a(){for(var f=-1,h=d.length=e.length,i=g.length/h;++f<h;)d[f]=g[~~(f*i)]}function b(f){if(isNaN(f=+f))return NaN;for(var h=0,i=d.length-1;h<=i;){var k=h+i>>1,j=d[k];if(j<f)h=k+1;else if(j>f)i=k-1;else return k}return i<0?0:i}function c(f){return e[b(f)]}var g=[],e=[],d=[];c.domain=function(f){if(!arguments.length)return g;g=f.filter(function(h){return!isNaN(h)}).sort(d3.ascending);a();return c};c.range=function(f){if(!arguments.length)return e;
-e=f;a();return c};c.quantiles=function(){return d};return c};d3.scale.quantize=function(){function a(f){return d[Math.max(0,Math.min(e,Math.floor(g*(f-b))))]}var b=0,c=1,g=2,e=1,d=[0,1];a.domain=function(f){if(!arguments.length)return[b,c];b=f[0];c=f[1];g=d.length/(c-b);return a};a.range=function(f){if(!arguments.length)return d;d=f;g=d.length/(c-b);e=d.length-1;return a};return a};d3.svg={};d3.svg.arc=function(){function a(){var d=b.apply(this,arguments),f=c.apply(this,arguments),h=g.apply(this,
-arguments)+I,i=e.apply(this,arguments)+I,k=i-h,j=k<Math.PI?"0":"1",p=Math.cos(h);h=Math.sin(h);var q=Math.cos(i);i=Math.sin(i);return k>=ib?d?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+d+"A"+d+","+d+" 0 1,1 0,"+-d+"A"+d+","+d+" 0 1,1 0,"+d+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":d?"M"+f*p+","+f*h+"A"+f+","+f+" 0 "+j+",1 "+f*q+","+f*i+"L"+d*q+","+d*i+"A"+d+","+d+" 0 "+j+",0 "+d*p+","+d*h+"Z":"M"+f*p+","+f*h+"A"+f+","+f+" 0 "+j+",1 "+f*q+","+f*i+
-"L0,0Z"}var b=Qa,c=Ra,g=pa,e=qa;a.innerRadius=function(d){if(!arguments.length)return b;b=w(d);return a};a.outerRadius=function(d){if(!arguments.length)return c;c=w(d);return a};a.startAngle=function(d){if(!arguments.length)return g;g=w(d);return a};a.endAngle=function(d){if(!arguments.length)return e;e=w(d);return a};a.centroid=function(){var d=(b.apply(this,arguments)+c.apply(this,arguments))/2,f=(g.apply(this,arguments)+e.apply(this,arguments))/2+I;return[Math.cos(f)*d,Math.sin(f)*d]};return a};
-var I=-Math.PI/2,ib=2*Math.PI-1.0E-6;d3.svg.line=function(){function a(f){return f.length<1?null:"M"+e(aa(this,f,b,c),d)}var b=ra,c=sa,g="linear",e=P[g],d=0.7;a.x=function(f){if(!arguments.length)return b;b=f;return a};a.y=function(f){if(!arguments.length)return c;c=f;return a};a.interpolate=function(f){if(!arguments.length)return g;e=P[g=f];return a};a.tension=function(f){if(!arguments.length)return d;d=f;return a};return a};var P={linear:H,"step-before":function(a){var b=[],c=0,g=a.length,e=a[0];
-for(b.push(e[0],",",e[1]);++c<g;)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")},"step-after":function(a){var b=[],c=0,g=a.length,e=a[0];for(b.push(e[0],",",e[1]);++c<g;)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")},basis:function(a){if(a.length<3)return H(a);var b=[],c=1,g=a.length,e=a[0],d=e[0],f=e[1],h=[d,d,d,(e=a[1])[0]],i=[f,f,f,e[1]];b.push(d,",",f);for(L(b,h,i);++c<g;){e=a[c];h.shift();h.push(e[0]);i.shift();i.push(e[1]);L(b,h,i)}for(c=-1;++c<2;){h.shift();h.push(e[0]);i.shift();
-i.push(e[1]);L(b,h,i)}return b.join("")},"basis-closed":function(a){for(var b,c=-1,g=a.length,e=g+4,d,f=[],h=[];++c<4;){d=a[c%g];f.push(d[0]);h.push(d[1])}b=[C(M,f),",",C(M,h)];for(--c;++c<e;){d=a[c%g];f.shift();f.push(d[0]);h.shift();h.push(d[1]);L(b,f,h)}return b.join("")},cardinal:function(a,b){return a.length<3?H(a):a[0]+ta(a,ua(a,b))},"cardinal-closed":function(a,b){return a.length<3?H(a):a[0]+ta(a,ua([a[a.length-2]].concat(a,[a[1]]),b))}},va=[0,2/3,1/3,0],wa=[0,1/3,2/3,0],M=[0,1/6,2/3,1/6];
-d3.svg.area=function(){function a(h){return h.length<1?null:"M"+d(aa(this,h,b,g),f)+"L"+d(aa(this,h,b,c).reverse(),f)+"Z"}var b=ra,c=Sa,g=sa,e="linear",d=P[e],f=0.7;a.x=function(h){if(!arguments.length)return b;b=h;return a};a.y0=function(h){if(!arguments.length)return c;c=h;return a};a.y1=function(h){if(!arguments.length)return g;g=h;return a};a.interpolate=function(h){if(!arguments.length)return e;d=P[e=h];return a};a.tension=function(h){if(!arguments.length)return f;f=h;return a};return a};d3.svg.chord=
-function(){function a(h,i){var k=b(this,c,h,i),j=b(this,g,h,i);return"M"+k.p0+("A"+k.r+","+k.r+" 0 0,1 "+k.p1)+(k.a0==j.a0&&k.a1==j.a1?"Q 0,0 "+k.p0:"Q 0,0 "+j.p0+("A"+j.r+","+j.r+" 0 0,1 "+j.p1)+("Q 0,0 "+k.p0))+"Z"}function b(h,i,k,j){var p=i.call(h,k,j);i=e.call(h,p,j);k=d.call(h,p,j)+I;h=f.call(h,p,j)+I;return{r:i,a0:k,a1:h,p0:[i*Math.cos(k),i*Math.sin(k)],p1:[i*Math.cos(h),i*Math.sin(h)]}}var c=Ta,g=Ua,e=Va,d=pa,f=qa;a.radius=function(h){if(!arguments.length)return e;e=w(h);return a};a.source=
-function(h){if(!arguments.length)return c;c=w(h);return a};a.target=function(h){if(!arguments.length)return g;g=w(h);return a};a.startAngle=function(h){if(!arguments.length)return d;d=w(h);return a};a.endAngle=function(h){if(!arguments.length)return f;f=w(h);return a};return a};d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(da<0&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),
-g=c[0][0].getScreenCTM();da=!(g.f||g.e);c.remove()}if(da){b.x=d3.event.pageX;b.y=d3.event.pageY}else{b.x=d3.event.clientX;b.y=d3.event.clientY}b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var da=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function a(g,e){return(xa[b.call(this,g,e)]||xa.circle)(c.call(this,g,e))}var b=Xa,c=Wa;a.type=function(g){if(!arguments.length)return b;b=w(g);return a};a.size=function(g){if(!arguments.length)return c;c=w(g);return a};return a};
-d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var xa={circle:function(a){a=Math.sqrt(a/Math.PI);return"M0,"+a+"A"+a+","+a+" 0 1,1 0,"+-a+"A"+a+","+a+" 0 1,1 0,"+a+"Z"},cross:function(a){a=Math.sqrt(a/5)/2;return"M"+-3*a+","+-a+"H"+-a+"V"+-3*a+"H"+a+"V"+-a+"H"+3*a+"V"+a+"H"+a+"V"+3*a+"H"+-a+"V"+a+"H"+-3*a+"Z"},diamond:function(a){a=Math.sqrt(a/(2*ya));var b=a*ya;return"M0,"+-a+"L"+b+",0 0,"+a+" "+-b+",0Z"},square:function(a){a=Math.sqrt(a)/2;return"M"+-a+","+
--a+"L"+a+","+-a+" "+a+","+a+" "+-a+","+a+"Z"},"triangle-down":function(a){a=Math.sqrt(a/Q);var b=a*Q/2;return"M0,"+b+"L"+a+","+-b+" "+-a+","+-b+"Z"},"triangle-up":function(a){a=Math.sqrt(a/Q);var b=a*Q/2;return"M0,"+-b+"L"+a+","+b+" "+-a+","+b+"Z"}},Q=Math.sqrt(3),ya=Math.tan(30*Math.PI/180)})();
+(function(){function bU(){return"circle"}function bT(){return 64}function bR(a){return a.endAngle}function bQ(a){return a.startAngle}function bP(a){return a.radius}function bO(a){return a.target}function bN(a){return a.source}function bM(){return 0}function bL(a,b,c){a.push("C",bH(bI,b),",",bH(bI,c),",",bH(bJ,b),",",bH(bJ,c),",",bH(bK,b),",",bH(bK,c))}function bH(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bG(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bH(bK,g),",",bH(bK,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bL(b,g,h);return b.join("")}function bF(a){if(a.length<3)return by(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bL(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bL(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bL(b,h,i);return b.join("")}function bE(a,b){var c=[],d=(1-b)/2,e=a[0],f=a[1],g=a[2],h=2,i=a.length;while(++h<i)c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]),e=f,f=g,g=a[h];c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bD(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return by(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){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;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bC(a,b,c){return a.length<3?by(a):a[0]+bD(a,bE(a,b))}function bB(a,b){return a.length<3?by(a):a[0]+bD(a,bE([a[a.length-2]].concat(a,[a[1]]),b))}function bA(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bz(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function by(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bw(a){return a[1]}function bv(a){return a[0]}function bu(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bt(a){return a.endAngle}function bs(a){return a.startAngle}function br(a){return a.outerRadius}function bq(a){return a.innerRadius}function bj(a){return function(b){return-Math.pow(-b,a)}}function bi(a){return function(b){return Math.pow(b,a)}}function bh(a){return-Math.log(-a)/Math.LN10}function bg(a){return Math.log(a)/Math.LN10}function be(){var a=null,b=$;while(b)b=b.flush?a?a.next=b.next:$=b.next:(a=b).next;a||(ba=0)}function bd(){var a,b=Date.now(),c=null,d=$;while(d)a=b-d.then,a>d.delay&&(d.flush=d.callback(a)),d=(c=d).next;be(),ba&&bf(bd)}function bc(){ba=1,_=0,bf(bd)}function bb(a,b){var c=Date.now(),d=!1,e=c+b,f,g=$;if(!!isFinite(b)){while(g){if(g.callback==a)g.then=c,g.delay=b,d=!0;else{var h=g.then+g.delay;h<e&&(e=h)}f=g,g=g.next}d||($={callback:a,then:c,delay:b,next:$}),ba||(clearTimeout(_),_=setTimeout(bc,Math.max(24,e-c)))}}function Z(a){return typeof a=="function"?function(b,c,d){return d3.interpolate(d,String(a.call(this,b,c)))}:(a=String(a),function(b,c,d){return d3.interpolate(d,a)})}function Y(a){function n(b){var h=!0,l=-1;a.each(function(){if(i[++l]!=2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){h=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!=c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,g.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)q[p]=d[p].apply(this,arguments)}o=m(a);for(p in d)q[p].call(this,o);if(a==1){i[l]=2;if(n.active==c){var r=n.owner;r==c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),X=c,g.end.dispatch.apply(this,arguments),X=0,n.owner=r}}}});return h}var b={},c=X||++W,d={},e=[],f=!1,g=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),bb(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,Z(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,Z(c),d)},b.select=function(b){var c,d=Y(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=Y(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){g[a].add(c);return b},b.call=h;return b.delay(0).duration(250)}function V(a){return{__data__:a}}function U(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function T(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return S(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),P(c,b))}function d(b){return b.insertBefore(document.createElement(a),P(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function S(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return S(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return S(c)}a.select=function(a){return b(function(b){return P(a,b)})},a.selectAll=function(a){return c(function(b){return Q(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return S(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=V(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=V(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=V(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=S(e);k.enter=function(){return T(d)},k.exit=function(){return S(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?f:h).call(this)}function h(){var a=g(this.className.replace(e," "));this.className=a.length?a:null}function f(){var a=this.className;e.lastIndex=0,e.test(a)||(this.className=g(a+" "+b))}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){e.lastIndex=0;return e.test(this.className)});return a.each(typeof c=="function"?i:c?f:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e=null);if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function f(){var a=b.apply(this,arguments);a!=null&&this.appendChild(document.createTextNode(a))}function e(){this.appendChild(document.createTextNode(b))}function c(){while(this.lastChild)this.removeChild(this.lastChild)}if(arguments.length<1)return d(function(){return this.textContent});a.each(c);return b==null?a:a.each(typeof b=="function"?f:e)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),P(c,b))}function d(b){return b.insertBefore(document.createElement(a),P(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=U.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c){var d=b.indexOf("."),e=d==-1?b:b.substring(0,d),f="__on"+b;return a.each(function(a,b){function d(d){var e=d3.event;d3.event=d;try{c.call(this,a,b)}finally{d3.event=e}}this[f]&&this.removeEventListener(e,this[f],!1),c&&this.addEventListener(e,this[f]=d,!1)})},a.transition=function(){return Y(a)},a.call=h;return a}function O(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return 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 E(g(a+120),g(a),g(a-120))}function N(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function M(a,b,c){return{h:a,s:b,l:c,toString:N}}function J(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function I(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<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return M(g,h,i)}function H(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(J(h[0]),J(h[1]),J(h[2]))}}if(i=K[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)=="#"&&(a.length==4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length==7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function G(a){return a<16?"0"+a.toString(16):a.toString(16)}function F(){return"#"+G(this.r)+G(this.g)+G(this.b)}function E(a,b,c){return{r:a,g:b,b:c,toString:F}}function D(a){return a in C||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function z(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function y(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function x(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function w(a){return 1-Math.sqrt(1-a*a)}function v(a){return a?Math.pow(2,10*(a-1))-.001:0}function u(a){return 1-Math.cos(a*Math.PI/2)}function t(a){return function(b){return Math.pow(b,a)}}function s(a){return a}function r(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function q(a){return function(b){return 1-a(1-b)}}function l(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 j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){a.apply(this,(arguments[0]=this,arguments));return this}function g(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function f(a){return a==null}function e(a){return typeof a=="function"?a:function(){return a}}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.9.0"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:0},d3.descending=function(a,b){return b<a?-1:b>a?1:0},d3.min=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e>(f=a[c])&&(e=f);else{e=b(a[0]);while(++c<d)e>(f=b(a[c]))&&(e=f)}return e},d3.max=function(a,b){var c=0,d=a.length,e=a[0],f;if(arguments.length==1)while(++c<d)e<(f=a[c])&&(e=f);else{e=b(e);while(++c<d)e<(f=b(a[c]))&&(e=f)}return e},d3.nest=function(){function g(a,d){if(d>=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(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,g=-1,h=a.length;arguments.length<2&&(b=f);while(++g<h)b.call(d,e=a[g],g)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length==1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState==4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9];h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4))),i=="d"&&(h="0");return function(a){var b=+a,j=b<0&&(b=-b)?"−":d;if(i=="d"&&b%1)return"";h?a=b.toFixed(h):a=""+b;if(e){var k=a.length+j.length;k<f&&(a=Array(f-k+1).join(c)+a),g&&(a=l(a)),a=j+a}else{g&&(a=l(a)),a=j+a;var k=a.length;k<f&&(a=Array(f-k+1).join(c)+a)}return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,m=t(2),n=t(3),o={linear:function(){return s},poly:t,quad:function(){return m},cubic:function(){return n},sin:function(){return u},exp:function(){return v},circle:function(){return w},elastic:x,back:y,bounce:function(){return z}},p={"in":function(a){return a},out:q,"in-out":r,"out-in":function(a){return r(q(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 p[d](o[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in K||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)},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;for(d=0;c=A.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=A.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=A.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length==1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return O(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=D(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var A=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,B=/[-+]?\d*\.?\d*(?:[eE][-]?\d+)?(.*)/,C={background:1,fill:1,stroke:1};d3.rgb=function(a,b,c){return arguments.length==1?H(""+a,E,O):E(~~a,~~b,~~c)};var K={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var L in K)K[L]=H(K[L],E,O);d3.hsl=function(a,b,c){return arguments.length==1?H(""+a,I,M):M(+a,+b,+c)};var P=function(a,b){return b.querySelector(a)},Q=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(P=function(a,b){return Sizzle(a,b)[0]},Q=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var R=S([[document]]);R[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?R.select(a):S([[a]])},d3.selectAll=function(b){return typeof b=="string"?R.selectAll(b):S([a(b)])},d3.transition=R.transition;var W=0,X=0,$=null,_=0,ba;d3.timer=function(a){bb(a,0)};var bf=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function j(c){var d=Math.min(a,b),e=Math.max(a,b),f=e-d,g=Math.pow(10,Math.floor(Math.log(f/c)/Math.LN10)),h=c/(f/g);h<=.15?g*=10:h<=.35?g*=5:h<=.75&&(g*=2);return{start:Math.ceil(d/g)*g,stop:Math.floor(e/g)*g+g*.5,step:g}}function i(b){return h((b-a)*e)}var a=0,b=1,c=0,d=1,e=1,f=1,g=d3.interpolate,h=g(c,d);i.invert=function(b){return(b-c)*f+a},i.domain=function(g){if(!arguments.length)return[a,b];a=+g[0],b=+g[1],e=1/(b-a),f=(b-a)/(d-c);return i},i.range=function(e){if(!arguments.length)return[c,d];c=e[0],d=e[1],f=(b-a)/(d-c),h=g(c,d);return i},i.rangeRound=function(a){return i.range(a).interpolate(d3.interpolateRound)},i.interpolate=function(a){if(!arguments.length)return g;h=(g=a)(c,d);return i},i.ticks=function(a){var b=j(a);return d3.range(b.start,b.stop,b.step)},i.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(j(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")};return i},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bg,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?bh:bg,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bh){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bg.pow=function(a){return Math.pow(10,a)},bh.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bj:bi;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(bk)},d3.scale.category20=function(){return d3.scale.ordinal().range(bl)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bm)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bn)};var bk=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bl=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bm=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bn=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function f(a){return b[e(a)]}function e(a){if(isNaN(a=+a))return NaN;var b=0,d=c.length-1;while(b<=d){var e=b+d>>1,f=c[e];if(f<a)b=e+1;else if(f>a)d=e-1;else return e}return d<0?0:d}function d(){var d=-1,e=c.length=b.length,f=a.length/e;while(++d<e)c[d]=a[~~(d*f)]}var a=[],b=[],c=[];f.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return f},f.range=function(a){if(!arguments.length)return b;b=a,d();return f},f.quantiles=function(){return c};return f},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function f(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bo,h=d.apply(this,arguments)+bo,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bp?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,1 0,"+ -e+"A"+e+","+e+" 0 1,1 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=bq,b=br,c=bs,d=bt;f.innerRadius=function(b){if(!arguments.length)return a;a=e(b);return f},f.outerRadius=function(a){if(!arguments.length)return b;b=e(a);return f},f.startAngle=function(a){if(!arguments.length)return c;c=e(a);return f},f.endAngle=function(a){if(!arguments.length)return d;d=e(a);return f},f.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bo;return[Math.cos(f)*e,Math.sin(f)*e]};return f};var bo=-Math.PI/2,bp=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(bu(this,c,a,b),e)}var a=bv,b=bw,c="linear",d=bx[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bx[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bx={linear:by,"step-before":bz,"step-after":bA,basis:bF,"basis-closed":bG,cardinal:bC,"cardinal-closed":bB},bI=[0,2/3,1/3,0],bJ=[0,1/3,2/3,0],bK=[0,1/6,2/3,1/6];d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(bu(this,d,a,c),f)+"L"+e(bu(this
+,d,a,b).reverse(),f)+"Z"}var a=bv,b=bM,c=bw,d="linear",e=bx[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bx[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function k(a,b,c,d){return"Q 0,0 "+d}function j(a,b){return"A"+a+","+a+" 0 0,1 "+b}function i(a,b){return a.a0==b.a0&&a.a1==b.a1}function h(a,b,e,g){var h=b.call(a,e,g),i=c.call(a,h,g),j=d.call(a,h,g)+bo,k=f.call(a,h,g)+bo;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 g(c,d){var e=h(this,a,c,d),f=h(this,b,c,d);return"M"+e.p0+j(e.r,e.p1)+(i(e,f)?k(e.r,e.p1,e.r,e.p0):k(e.r,e.p1,f.r,f.p0)+j(f.r,f.p1)+k(f.r,f.p1,e.r,e.p0))+"Z"}var a=bN,b=bO,c=bP,d=bs,f=bt;g.radius=function(a){if(!arguments.length)return c;c=e(a);return g},g.source=function(b){if(!arguments.length)return a;a=e(b);return g},g.target=function(a){if(!arguments.length)return b;b=e(a);return g},g.startAngle=function(a){if(!arguments.length)return d;d=e(a);return g},g.endAngle=function(a){if(!arguments.length)return f;f=e(a);return g};return g},d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(bS<0&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),d=c[0][0].getScreenCTM();bS=!d.f&&!d.e,c.remove()}bS?(b.x=d3.event.pageX,b.y=d3.event.pageY):(b.x=d3.event.clientX,b.y=d3.event.clientY),b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var bS=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function c(c,d){return(bV[a.call(this,c,d)]||bV.circle)(b.call(this,c,d))}var a=bU,b=bT;c.type=function(b){if(!arguments.length)return a;a=e(b);return c},c.size=function(a){if(!arguments.length)return b;b=e(a);return c};return c},d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var bV={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*bX)),c=b*bX;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/bW),c=b*bW/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/bW),c=b*bW/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}},bW=Math.sqrt(3),bX=Math.tan(30*Math.PI/180)})()
View
9 d3.time.min.js
@@ -1,8 +1 @@
-(function(){function j(a,b,c,f){for(var d,h=0,i=b.length,k=c.length;h<i;){if(f>=k)return-1;d=b.charCodeAt(h++);if(d==37){d=t[b.charAt(h++)];if(!d||(f=d(a,c,f))<0)return-1}else if(d!=c.charCodeAt(f++))return-1}return f}function m(a,b,c){e.lastIndex=0;return(b=e.exec(b.substring(c,c+2)))?(a.setDate(+b[0]),c+b[0].length):-1}function n(a,b,c){e.lastIndex=0;return(b=e.exec(b.substring(c,c+2)))?(a.setHours(+b[0]),c+b[0].length):-1}d3.time={};d3.time.format=function(a){function b(f){for(var d=[],h=-1,i=
-0,k,o;++h<c;)if(a.charCodeAt(h)==37){d.push(a.substring(i,h),(o=l[k=a.charAt(++h)])?o(f):k);i=h+1}d.push(a.substring(i,h));return d.join("")}var c=a.length;b.parse=function(f){var d=new Date(1900,0,1);if(j(d,a,f,0)!=f.length)return null;if(d.hour12){f=d.getHours()%12;d.setHours(d.hour12pm?f+12:f)}delete d.hour12;delete d.hour12pm;return d};b.toString=function(){return a};return b};var g=d3.format("02d"),u=d3.format("03d"),v=d3.format("04d"),w=d3.format("2d"),l={a:function(a){return p[a.getDay()].substring(0,
-3)},A:function(a){return p[a.getDay()]},b:function(a){return q[a.getMonth()].substring(0,3)},B:function(a){return q[a.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(a){return g(a.getDate())},e:function(a){return w(a.getDate())},H:function(a){return g(a.getHours())},I:function(a){return g(a.getHours()%12||12)},j:function(a){return u(1+~~((a-new Date(a.getFullYear(),0,1))/864E5))},m:function(a){return g(a.getMonth()+1)},M:function(a){return g(a.getMinutes())},p:function(a){return a.getHours()>=
-12?"PM":"AM"},S:function(a){return g(a.getSeconds())},U:function(a){var b=new Date(a.getFullYear(),0,1);return g(~~(((a-b)/864E5+b.getDay())/7))},w:function(a){return a.getDay()},W:function(a){var b=new Date(a.getFullYear(),0,1);return g(~~(((a-b)/864E5+(b.getDay()+6)%7)/7))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(a){return g(a.getYear()%100)},Y:function(a){return v(a.getFullYear()%1E4)},Z:function(a){a=a.getTimezoneOffset();var b=Math.abs(a)%60;return(a>0?"-":"+")+g(~~(Math.abs(a)/
-60))+g(b)},"%":function(){return"%"}},t={a:function(a,b,c){return b.substring(c,c+=3).toLowerCase()in x?c:-1},A:function(a,b,c){r.lastIndex=0;return(a=r.exec(b.substring(c,c+10)))?c+a[0].length:-1},b:function(a,b,c){b=y[b.substring(c,c+=3).toLowerCase()];return b==null?-1:(a.setMonth(b),c)},B:function(a,b,c){s.lastIndex=0;return(b=s.exec(b.substring(c,c+12)))?(a.setMonth(z[b[0].toLowerCase()]),c+b[0].length):-1},c:function(a,b,c){return j(a,l.c.toString(),b,c)},d:m,e:m,H:n,I:function(a,b,c){a.hour12=
-true;return n(a,b,c)},m:function(a,b,c){e.lastIndex=0;return(b=e.exec(b.substring(c,c+2)))?(a.setMonth(b[0]-1),c+b[0].length):-1},M:function(a,b,c){e.lastIndex=0;return(b=e.exec(b.substring(c,c+2)))?(a.setMinutes(+b[0]),c+b[0].length):-1},p:function(a,b,c){b=A[b.substring(c,c+=2).toLowerCase()];return b==null?-1:(a.hour12pm=b,c)},S:function(a,b,c){e.lastIndex=0;return(b=e.exec(b.substring(c,c+2)))?(a.setSeconds(+b[0]),c+b[0].length):-1},x:function(a,b,c){return j(a,l.x.toString(),b,c)},X:function(a,
-b,c){return j(a,l.X.toString(),b,c)},y:function(a,b,c){e.lastIndex=0;return(b=e.exec(b.substring(c,c+2)))?(a.setFullYear(~~((new Date).getFullYear()/1E3)*1E3+ +b[0]),c+b[0].length):-1},Y:function(a,b,c){e.lastIndex=0;return(b=e.exec(b.substring(c,c+4)))?(a.setFullYear(b[0]),c+b[0].length):-1}},x={sun:3,mon:3,tue:3,wed:3,thu:3,fri:3,sat:3},r=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/ig,p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],y={jan:0,feb:1,mar:2,
-apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},s=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig,z={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},q=["January","February","March","April","May","June","July","August","September","October","November","December"],e=/\s*\d+/,A={am:0,pm:1}})();
+(function(){function K(a){var c=a.getTimezoneOffset(),d=c>0?"-":"+",e=~~(Math.abs(c)/60),f=Math.abs(c)%60;return d+b(e)+b(f)}function J(a){var c=new Date(a.getFullYear(),0,1);return b(~~(((a-c)/864e5+(c.getDay()+6)%7)/7))}function I(a){var c=new Date(a.getFullYear(),0,1);return b(~~(((a-c)/864e5+c.getDay())/7))}function H(a){return c(1+~~((a-new Date(a.getFullYear(),0,1))/864e5))}function F(a,b,c){var d=G[b.substring(c,c+=2).toLowerCase()];return d==null?-1:(a.hour12pm=d,c)}function D(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setSeconds(+d[0]),c+=d[0].length):-1}function C(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setMinutes(+d[0]),c+=d[0].length):-1}function B(a,b,c){a.hour12=!0;return A(a,b,c)}function A(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setHours(+d[0]),c+=d[0].length):-1}function z(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setDate(+d[0]),c+=d[0].length):-1}function y(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setMonth(d[0]-1),c+=d[0].length):-1}function x(){return~~((new Date).getFullYear()/1e3)*1e3}function w(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setFullYear(x()+ +d[0]),c+=d[0].length):-1}function v(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+4));return d?(a.setFullYear(d[0]),c+=d[0].length):-1}function u(b,c,d){return a(b,f.X.toString(),c,d)}function t(b,c,d){return a(b,f.x.toString(),c,d)}function s(b,c,d){return a(b,f.c.toString(),c,d)}function o(a,b,c){p.lastIndex=0;var d=p.exec(b.substring(c,c+12));return d?(a.setMonth(q[d[0].toLowerCase()]),c+=d[0].length):-1}function m(a,b,c){var d=n[b.substring(c,c+=3).toLowerCase()];return d==null?-1:(a.setMonth(d),c)}function j(a,b,c){k.lastIndex=0;var d=k.exec(b.substring(c,c+10));return d?c+=d[0].length:-1}function h(a,b,c){return b.substring(c,c+=3).toLowerCase()in i?c:-1}function a(a,b,c,d){var e,f,h=0,i=b.length,j=c.length;while(h<i){if(d>=j)return-1;e=b.charCodeAt(h++);if(e==37){f=g[b.charAt(h++)];if(!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}d3.time={},d3.time.format=function(b){function d(a){var d=[],e=-1,g=0,h,i;while(++e<c)b.charCodeAt(e)==37&&(d.push(b.substring(g,e),(i=f[h=b.charAt(++e)])?i(a):h),g=e+1);d.push(b.substring(g,e));return d.join("")}var c=b.length;d.parse=function(c){var d=new Date(1900,0,1),e=a(d,b,c,0);if(e!=c.length)return null;if(d.hour12){var f=d.getHours()%12;d.setHours(d.hour12pm?f+12:f)}delete d.hour12,delete d.hour12pm;return d},d.toString=function(){return b};return d};var b=d3.format("02d"),c=d3.format("03d"),d=d3.format("04d"),e=d3.format("2d"),f={a:function(a){return l[a.getDay()].substring(0,3)},A:function(a){return l[a.getDay()]},b:function(a){return r[a.getMonth()].substring(0,3)},B:function(a){return r[a.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(a){return b(a.getDate())},e:function(a){return e(a.getDate())},H:function(a){return b(a.getHours())},I:function(a){return b(a.getHours()%12||12)},j:H,m:function(a){return b(a.getMonth()+1)},M:function(a){return b(a.getMinutes())},p:function(a){return a.getHours()>=12?"PM":"AM"},S:function(a){return b(a.getSeconds())},U:I,w:function(a){return a.getDay()},W:J,x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(a){return b(a.getYear()%100)},Y:function(a){return d(a.getFullYear()%1e4)},Z:K,"%":function(a){return"%"}},g={a:h,A:j,b:m,B:o,c:s,d:z,e:z,H:A,I:B,m:y,M:C,p:F,S:D,x:t,X:u,y:w,Y:v},i={sun:3,mon:3,tue:3,wed:3,thu:3,fri:3,sat:3},k=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/ig,l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},p=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig,q={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},r=["January","February","March","April","May","June","July","August","September","October","November","December"],E=/\s*\d+/,G={am:0,pm:1}})()
View
10 ex/bullet.css
@@ -0,0 +1,10 @@
+.bullet { font: 10px sans-serif; }
+.bullet .marker { stroke: #000; stroke-width: 2px; }
+.bullet .tick line { stroke: #666; stroke-width: .5px; }
+.bullet .range.s0 { fill: #eee; }
+.bullet .range.s1 { fill: #ddd; }
+.bullet .range.s2 { fill: #ccc; }
+.bullet .measure.s0 { fill: lightsteelblue; }
+.bullet .measure.s1 { fill: steelblue; }
+.bullet .title { font-size: 14px; font-weight: bold; }
+.bullet .subtitle { fill: #999; }
View
53 ex/bullet.js
@@ -0,0 +1,53 @@
+var w = 960,
+ h = 50,
+ m = [5, 40, 20, 120]; // top right bottom left
+
+var chart = d3.chart.bullet()
+ .width(w - m[1] - m[3])
+ .height(h - m[0] - m[2])
+ .duration(1000);
+
+d3.json("bullets.json", function(data) {
+
+ var vis = d3.select("#chart").selectAll("svg")
+ .data(data)
+ .enter().append("svg:svg")
+ .attr("class", "bullet")
+ .attr("width", w)
+ .attr("height", h)
+ .append("svg:g")
+ .attr("transform", "translate(" + m[3] + "," + m[0] + ")")
+ .call(chart);
+
+ var title = vis.append("svg:g")
+ .attr("text-anchor", "end")
+ .attr("transform", "translate(-6," + (h - m[0] - m[2]) / 2 + ")");
+
+ title.append("svg:text")
+ .attr("class", "title")
+ .text(function(d) { return d.title; });
+
+ title.append("svg:text")
+ .attr("class", "subtitle")
+ .attr("dy", "1em")
+ .text(function(d) { return d.subtitle; });
+
+ window.transition = function() {
+ vis.map(randomize).call(chart);
+ };
+});
+
+function randomize(d) {
+ if (!d.randomizer) d.randomizer = randomizer(d);
+ d.ranges = d.ranges.map(d.randomizer);
+ d.markers = d.markers.map(d.randomizer);
+ d.measures = d.measures.map(d.randomizer);
+ return d;
+}
+
+function randomizer(d) {
+ var k = d3.max(d.ranges) * .2;
+ return function(d) {
+ return Math.max(0, d + k * (Math.random() - .5));
+ };
+}
View
29 ex/bullet.markdown
@@ -0,0 +1,29 @@
+---
+layout: ex
+title: Bullet Charts
+---
+
+# Bullet Charts
+
+<div class="gallery" id="chart">
+ <button class="first last" onclick="transition()">
+ Update
+ </button><p/>
+</div>
+
+<link type="text/css" rel="stylesheet" href="button.css"/>
+<link type="text/css" rel="stylesheet" href="bullet.css"/>
+<script type="text/javascript" src="../d3.chart.js?1.9.0"> </script>
+<script type="text/javascript" src="bullet.js"> </script>
+
+Layout inspired by [Stephen Few](http://www.perceptualedge.com/articles/misc/Bullet_Graph_Design_Spec.pdf).
+Implementation based on work by [Clint Ivy](http://projects.instantcognition.com/protovis/bulletchart/),
+Jamie Love of [N-Squared Software](http://www.nsquaredsoftware.com/) and
+[Jason Davies](http://www.jasondavies.com/). The "update" button randomizes the values slightly to
+demonstrate transitions.
+
+### Source Code
+
+{% highlight js linenos %}
+{% include bullet.js %}
+{% endhighlight %}
View
7 ex/bullets.json
@@ -0,0 +1,7 @@
+[
+ {"title":"Revenue","subtitle":"US$, in thousands","ranges":[150,225,300],"measures":[220,270],"markers":[250]},
+ {"title":"Profit","subtitle":"%","ranges":[20,25,30],"measures":[21,23],"markers":[26]},
+ {"title":"Order Size","subtitle":"US$, average","ranges":[350,500,600],"measures":[100,320],"markers":[550]},
+ {"title":"New Customers","subtitle":"count","ranges":[1400,2000,2500],"measures":[1000,1650],"markers":[2100]},
+ {"title":"Satisfaction","subtitle":"out of 5","ranges":[3.5,4.25,5],"measures":[3.2,4.7],"markers":[4.4]}
+]
View
4 ex/calendar.markdown
@@ -8,8 +8,8 @@ title: Calendar View
<div class="gallery" id="chart"> </div>
<link type="text/css" rel="stylesheet" href="calendar.css"/>
<link type="text/css" rel="stylesheet" href="colorbrewer.css"/>
-<script type="text/javascript" src="../d3.csv.js?1.8.3"> </script>
-<script type="text/javascript" src="../d3.time.js?1.8.3"> </script>
+<script type="text/javascript" src="../d3.csv.js?1.9.0"> </script>
+<script type="text/javascript" src="../d3.time.js?1.9.0"> </script>
<script type="text/javascript" src="calendar.js"> </script>
<script type="text/javascript" src="dji.js"> </script>
View
20 ex/cartogram.js
@@ -1,17 +1,17 @@
-var data; // loaded asynchronously
+// Ratio of Obese (BMI >= 30) in U.S. Adults, CDC 2008
+var data = [
+ , .187, .198, , .133, .175, .151, , .1, .125, .171, , .172, .133, , .108,
+ .142, .167, .201, .175, .159, .169, .177, .141, .163, .117, .182, .153, .195,
+ .189, .134, .163, .133, .151, .145, .13, .139, .169, .164, .175, .135, .152,
+ .169, , .132, .167, .139, .184, .159, .14, .146, .157, , .139, .183, .16, .143
+];
var svg = d3.select("#chart")
.append("svg:svg");
d3.json("us-states.json", function(json) {
var path = d3.geo.path();
- // Synthesize a random data variable to visualize…
- // Note: This has a baked-in sqrt transform!
- json.features.forEach(function(f) {
- f.properties.value = Math.sqrt(.2 + .8 * Math.random());
- });
-
// A thick black stroke for the exterior.
svg.append("svg:g")
.attr("class", "black")
@@ -39,10 +39,12 @@ d3.json("us-states.json", function(json) {
x = centroid[0],
y = centroid[1];
return "translate(" + x + "," + y + ")"
- + "scale(" + d.properties.value + ")"
+ + "scale(" + Math.sqrt(data[+d.id] * 5 || 0) + ")"
+ "translate(" + -x + "," + -y + ")";
})
- .attr("stroke-width", function(d) { return 1 / d.properties.value; })
+ .attr("stroke-width", function(d) {
+ return 1 / Math.sqrt(data[+d.id] * 5);
+ })
.attr("d", path);
});
View
4 ex/cartogram.markdown
@@ -7,8 +7,8 @@ title: Non-Contiguous Cartogram
<div class="gallery" id="chart"> </div>
<link type="text/css" rel="stylesheet" href="cartogram.css"/>
-<script type="text/javascript" src="../d3.geo.js?1.8.3"> </script>
-<script type="text/javascript" src="../d3.geom.js?1.8.3"> </script>
+<script type="text/javascript" src="../d3.geo.js?1.9.0"> </script>
+<script type="text/javascript" src="../d3.geom.js?1.9.0"> </script>
<script type="text/javascript" src="cartogram.js"> </script>
Inspired by [Zachary Johnson](http://indiemaps.com/blog/2011/02/noncontiguous-cartograms-in-openlayers-and-polymaps/).
View
2 ex/chord.markdown
@@ -7,7 +7,7 @@ title: Chord Diagram
<div id="chart"> </div>
<link type="text/css" rel="stylesheet" href="chord.css"/>
-<script type="text/javascript" src="../d3.layout.js?1.8.3"> </script>
+<script type="text/javascript" src="../d3.layout.js?1.9.0"> </script>
<script type="text/javascript" src="chord.js"> </script>
Layout inspired by [Martin Krzywinski](http://mkweb.bcgsc.ca/)'s beautiful
View
2 ex/choropleth.markdown
@@ -8,7 +8,7 @@ title: Choropleth
<div class="gallery" id="chart"> </div>
<link type="text/css" rel="stylesheet" href="choropleth.css"/>
<link type="text/css" rel="stylesheet" href="colorbrewer.css"/>
-<script type="text/javascript" src="../d3.geo.js?1.8.3"> </script>
+<script type="text/javascript" src="../d3.geo.js?1.9.0"> </script>
<script type="text/javascript" src="choropleth.js"> </script>
Choropleth design invented by [Charles Dupin](http://en.wikipedia.org/wiki/Charles_Dupin).
View
2 ex/force.markdown
@@ -7,7 +7,7 @@ title: Force-Directed Graph
<div class="gallery" id="chart"> </div>
<link type="text/css" rel="stylesheet" href="force.css"/>
-<script type="text/javascript" src="../d3.layout.js?1.8.3"> </script>
+<script type="text/javascript" src="../d3.layout.js?1.9.0"> </script>
<script type="text/javascript" src="force.js"> </script>
Layout algorithm inspired by [Tim Dwyer](http://www.csse.monash.edu.au/~tdwyer/) and
View
13 ex/index.markdown
@@ -131,6 +131,19 @@ title: Examples
interaction!</p>
</div>
+<div class="list">
+ <a href="bullet.html">
+ <img src="../bullet.png"/>
+ </a>
+ <h4><a href="bullet.html">Bullet Charts</a></h4>
+
+ <p>Designed by Stephen Few, a bullet chart &ldquo;provides a rich display of
+ data in a small space.&rdquo; A variation on a bar chart, bullet charts
+ compare a given quantitative measure (such as profit or revenue)
+ against qualitative ranges (e.g., poor, satisfactory, good) and
+ related markers (e.g., the same measure a year ago).</p>
+</div>
+
</div>
<br clear="left"/>
View
2 ex/stack.markdown
@@ -16,7 +16,7 @@ title: Stacked Bars
<link type="text/css" rel="stylesheet" href="stack.css"/>
<link type="text/css" rel="stylesheet" href="button.css"/>
-<script type="text/javascript" src="../d3.layout.js?1.8.3"> </script>
+<script type="text/javascript" src="../d3.layout.js?1.9.0"> </script>
<script type="text/javascript" src="stream_layers.js"> </script>
<script type="text/javascript" src="stack.js"> </script>
View
2 ex/stream.markdown
@@ -13,7 +13,7 @@ title: Streamgraph
<link type="text/css" rel="stylesheet" href="stream.css"/>
<link type="text/css" rel="stylesheet" href="button.css"/>
-<script type="text/javascript" src="../d3.layout.js?1.8.3"> </script>
+<script type="text/javascript" src="../d3.layout.js?1.9.0"> </script>
<script type="text/javascript" src="stream_layers.js"> </script>
<script type="text/javascript" src="stream.js"> </script>