Skip to content
This repository
Browse code

Support for Sizzle.

D3 now supports Sizzle, preferring Sizzle to the native Selectors API if Sizzle
is available. Sizzle internally uses the native Selectors API and thus this
should have minimal performance implications; also, it allows you to use Sizzle
proprietary extensions such as ":first".

This commit also restricts the definition of the enter selection so that only
append and insert operations are defined. The other operations were generally
unsupported anyway, and it cleans up the code to have separate implementations
for insert and append. (I might enable additional operations in the future, such
as `filter`, `sort` and `each`, but this seems like a reasonable first pass.)
  • Loading branch information...
commit 8da80dcc994ef660198b5cf2b88343c429296847 1 parent c31590e
Mike Bostock authored February 17, 2011
121  d3.js
... ...
@@ -1,4 +1,4 @@
1  
-(function(){d3 = {version: "0.30.8"}; // semver
  1
+(function(){d3 = {version: "1.0.0"}; // semver
2 2
 if (!Date.now) Date.now = function() {
3 3
   return +new Date();
4 4
 };
@@ -923,20 +923,29 @@ function d3_hsl_rgb(h, s, l) {
923 923
 
924 924
   return d3_rgb(vv(h + 120), vv(h), vv(h - 120));
925 925
 }
  926
+var d3_select = function(s, n) { return n.querySelector(s); },
  927
+    d3_selectAll = function(s, n) { return d3_array(n.querySelectorAll(s)); };
  928
+
  929
+// Use Sizzle, if available.
  930
+if (typeof Sizzle == "function") {
  931
+  d3_select = function(s, n) { return Sizzle(s, n)[0]; };
  932
+  d3_selectAll = Sizzle;
  933
+}
  934
+
926 935
 var d3_root = d3_selection([[document]]);
927 936
 d3_root[0].parentNode = document.documentElement;
928 937
 
929 938
 // TODO fast singleton implementation!
930  
-d3.select = function(query) {
931  
-  return typeof query == "string"
932  
-      ? d3_root.select(query)
933  
-      : d3_selection([[query]]); // assume node
  939
+d3.select = function(selector) {
  940
+  return typeof selector == "string"
  941
+      ? d3_root.select(selector)
  942
+      : d3_selection([[selector]]); // assume node
934 943
 };
935 944
 
936  
-d3.selectAll = function(query) {
937  
-  return typeof query == "string"
938  
-      ? d3_root.selectAll(query)
939  
-      : d3_selection([d3_array(query)]); // assume node[]
  945
+d3.selectAll = function(selector) {
  946
+  return typeof selector == "string"
  947
+      ? d3_root.selectAll(selector)
  948
+      : d3_selection([d3_array(selector)]); // assume node[]
940 949
 };
941 950
 
942 951
 function d3_selection(groups) {
@@ -983,16 +992,16 @@ function d3_selection(groups) {
983 992
   }
984 993
 
985 994
   // TODO select(function)?
986  
-  groups.select = function(query) {
  995
+  groups.select = function(selector) {
987 996
     return select(function(node) {
988  
-      return node.querySelector(query);
  997
+      return d3_select(selector, node);
989 998
     });
990 999
   };
991 1000
 
992 1001
   // TODO selectAll(function)?
993  
-  groups.selectAll = function(query) {
  1002
+  groups.selectAll = function(selector) {
994 1003
     return selectAll(function(node) {
995  
-      return d3_array(node.querySelectorAll(query));
  1004
+      return d3_selectAll(selector, node);
996 1005
     });
997 1006
   };
998 1007
 
@@ -1035,18 +1044,7 @@ function d3_selection(groups) {
1035 1044
           nodeData;
1036 1045
 
1037 1046
       function enterNode(data) {
1038  
-        return {
1039  
-          __data__: data,
1040  
-          appendChild: function(a) {
1041  
-            return group.parentNode.appendChild(a);
1042  
-          },
1043  
-          insertBefore: function(a, b) {
1044  
-            return group.parentNode.insertBefore(a, b);
1045  
-          },
1046  
-          querySelector: function(a) {
1047  
-            return group.parentNode.querySelector(a);
1048  
-          }
1049  
-        };
  1047
+        return {__data__: data};
1050 1048
       }
1051 1049
 
1052 1050
       if (join) {
@@ -1137,7 +1135,7 @@ function d3_selection(groups) {
1137 1135
 
1138 1136
     var selection = d3_selection(update);
1139 1137
     selection.enter = function() {
1140  
-      return d3_selection(enter);
  1138
+      return d3_selectionEnter(enter);
1141 1139
     };
1142 1140
     selection.exit = function() {
1143 1141
       return d3_selection(exit);
@@ -1409,19 +1407,19 @@ function d3_selection(groups) {
1409 1407
     function insert(node) {
1410 1408
       return node.insertBefore(
1411 1409
           document.createElement(name),
1412  
-          node.querySelector(before));
  1410
+          d3_select(before, node));
1413 1411
     }
1414 1412
 
1415 1413
     function insertNS(node) {
1416 1414
       return node.insertBefore(
1417 1415
           document.createElementNS(name.space, name.local),
1418  
-          node.querySelector(before));
  1416
+          d3_select(before, node));
1419 1417
     }
1420 1418
 
1421 1419
     return select(name.local ? insertNS : insert);
1422 1420
   };
1423 1421
 
1424  
-  // TODO remove(query)?
  1422
+  // TODO remove(selector)?
1425 1423
   // TODO remove(node)?
1426 1424
   // TODO remove(function)?
1427 1425
   groups.remove = function() {
@@ -1486,6 +1484,71 @@ function d3_selection(groups) {
1486 1484
   return groups;
1487 1485
 }
1488 1486
 
  1487
+function d3_selectionEnter(groups) {
  1488
+
  1489
+  function select(select) {
  1490
+    var subgroups = [],
  1491
+        subgroup,
  1492
+        subnode,
  1493
+        group,
  1494
+        node;
  1495
+    for (var j = 0, m = groups.length; j < m; j++) {
  1496
+      group = groups[j];
  1497
+      subgroups.push(subgroup = []);
  1498
+      subgroup.parentNode = group.parentNode;
  1499
+      subgroup.parentData = group.parentData;
  1500
+      for (var i = 0, n = group.length; i < n; i++) {
  1501
+        if (node = group[i]) {
  1502
+          subgroup.push(subnode = select(group.parentNode));
  1503
+          subnode.__data__ = node.__data__;
  1504
+        } else {
  1505
+          subgroup.push(null);
  1506
+        }
  1507
+      }
  1508
+    }
  1509
+    return d3_selection(subgroups);
  1510
+  }
  1511
+
  1512
+  // TODO append(node)?
  1513
+  // TODO append(function)?
  1514
+  groups.append = function(name) {
  1515
+    name = d3.ns.qualify(name);
  1516
+
  1517
+    function append(node) {
  1518
+      return node.appendChild(document.createElement(name));
  1519
+    }
  1520
+
  1521
+    function appendNS(node) {
  1522
+      return node.appendChild(document.createElementNS(name.space, name.local));
  1523
+    }
  1524
+
  1525
+    return select(name.local ? appendNS : append);
  1526
+  };
  1527
+
  1528
+  // TODO insert(node, function)?
  1529
+  // TODO insert(function, string)?
  1530
+  // TODO insert(function, function)?
  1531
+  groups.insert = function(name, before) {
  1532
+    name = d3.ns.qualify(name);
  1533
+
  1534
+    function insert(node) {
  1535
+      return node.insertBefore(
  1536
+          document.createElement(name),
  1537
+          d3_select(before, node));
  1538
+    }
  1539
+
  1540
+    function insertNS(node) {
  1541
+      return node.insertBefore(
  1542
+          document.createElementNS(name.space, name.local),
  1543
+          d3_select(before, node));
  1544
+    }
  1545
+
  1546
+    return select(name.local ? insertNS : insert);
  1547
+  };
  1548
+
  1549
+  return groups;
  1550
+}
  1551
+
1489 1552
 function d3_selection_comparator(comparator) {
1490 1553
   if (!arguments.length) comparator = d3.ascending;
1491 1554
   return function(a, b) {
133  d3.min.js
... ...
@@ -1,66 +1,67 @@
1  
-(function(){function R(a){return Array.prototype.slice.call(a)}function v(a){return typeof a=="function"?a:function(){return a}}function D(a,b){return function(){var d=b.apply(a,arguments);return arguments.length?a:d}}function ua(a){return a==null}function da(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function ea(a,b){b=R(arguments);b[0]=this;a.apply(this,b);return this}function va(){var a={},b=[];a.add=function(d){for(var f=0;f<b.length;f++)if(b[f].listener==d)return a;b.push({listener:d,
2  
-on:true});return a};a.remove=function(d){for(var f=0;f<b.length;f++){var e=b[f];if(e.listener==d){e.on=false;b=b.slice(0,f).concat(b.slice(f+1));break}}return a};a.dispatch=function(){for(var d=b,f=0,e=d.length;f<e;f++){var c=d[f];c.on&&c.listener.apply(this,arguments)}};return a}function fa(a){return function(b){return 1-a(1-b)}}function ga(a){return function(b){return 0.5*(b<0.5?a(2*b):2-a(2-2*b))}}function wa(a){return a}function S(a){return function(b){return Math.pow(b,a)}}function xa(a){return 1-
3  
-Math.cos(a*Math.PI/2)}function ya(a){return a?Math.pow(2,10*(a-1))-0.0010:0}function za(a){return 1-Math.sqrt(1-a*a)}function Aa(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,d){return{r:a,g:b,b:d,toString:Ba}}function Ba(){return"#"+T(this.r)+T(this.g)+T(this.b)}function T(a){return a<16?"0"+a.toString(16):a.toString(16)}function U(a,b,d){var f=0,e=0,c=0,i,h;if(i=/([a-z]+)\((.*)\)/i.exec(a)){h=
4  
-i[2].split(",");switch(i[1]){case "hsl":return d(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case "rgb":return b(V(h[0]),V(h[1]),V(h[2]))}}if(d=G[a])return b(d.r,d.g,d.b);if(a!=null&&a.charAt(0)=="#"){if(a.length==4){f=a.charAt(1);f+=f;e=a.charAt(2);e+=e;c=a.charAt(3);c+=c}else if(a.length==7){f=a.substring(1,3);e=a.substring(3,5);c=a.substring(5,7)}f=parseInt(f,16);e=parseInt(e,16);c=parseInt(c,16)}return b(f,e,c)}function Ca(a,b,d){var f=Math.min(a/=255,b/=255,d/=255),e=Math.max(a,
5  
-b,d),c=e-f,i=(e+f)/2;if(c){f=i<0.5?c/(e+f):c/(2-e-f);a=a==e?(b-d)/c+(b<d?6:0):b==e?(d-a)/c+2:(a-b)/c+4;a*=60}else f=a=0;return W(a,f,i)}function V(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function W(a,b,d){return{h:a,s:b,l:d,toString:Da}}function Da(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function ha(a,b,d){function f(i){if(i>360)i-=360;else if(i<0)i+=360;if(i<60)return e+(c-e)*i/60;if(i<180)return c;if(i<240)return e+(c-e)*(240-i)/60;return e}
6  
-var e,c;a%=360;if(a<0)a+=360;b=b<0?0:b>1?1:b;d=d<0?0:d>1?1:d;c=d<=0.5?d*(1+b):d+b-d*b;e=2*d-c;return J(Math.round(f(a+120)*255),Math.round(f(a)*255),Math.round(f(a-120)*255))}function y(a){function b(e){for(var c=[],i,h,g,k,j=0,o=a.length;j<o;j++){g=a[j];c.push(i=[]);i.parentNode=g.parentNode;i.parentData=g.parentData;for(var p=0,l=g.length;p<l;p++)if(k=g[p]){i.push(h=e(k));if(h&&"__data__"in k)h.__data__=k.__data__}else i.push(null)}return y(c)}function d(e){for(var c=[],i,h,g,k=0,j=a.length;k<j;k++){h=
7  
-a[k];for(var o=0,p=h.length;o<p;o++)if(g=h[o]){c.push(i=e(g));i.parentNode=g;i.parentData=g.__data__}}return y(c)}function f(e){for(var c=0,i=a.length;c<i;c++)for(var h=a[c],g=0,k=h.length;g<k;g++){var j=h[g];if(j)return e.call(j,j.__data__,g)}return null}a.select=function(e){return b(function(c){return c.querySelector(e)})};a.selectAll=function(e){return d(function(c){return R(c.querySelectorAll(e))})};a.filter=function(e){for(var c=[],i,h,g,k=0,j=a.length;k<j;k++){h=a[k];c.push(i=[]);i.parentNode=
8  
-h.parentNode;i.parentData=h.parentData;for(var o=0,p=h.length;o<p;o++)if((g=h[o])&&e.call(g,g.__data__,o))i.push(g)}return y(c)};a.data=function(e,c){function i(l,n){function q(Ea){return{__data__:Ea,appendChild:function(H){return l.parentNode.appendChild(H)},insertBefore:function(H,Fa){return l.parentNode.insertBefore(H,Fa)},querySelector:function(H){return l.parentNode.querySelector(H)}}}var m=0,r=l.length,t=n.length,s=Math.min(r,t),u=Math.max(r,t),z=[],A=[],w=[],x,B;if(c){s={};u=[];var E;B=n.length;
9  
-for(m=0;m<r;m++){E=c.call(x=l[m],x.__data__,m);if(E in s)w[B++]=l[m];else{s[E]=x;u.push(E)}}for(m=0;m<t;m++){if(x=s[E=c.call(n,B=n[m],m)]){x.__data__=B;z[m]=x;A[m]=w[m]=null}else{A[m]=q(B);z[m]=w[m]=null}delete s[E]}for(m=0;m<r;m++)if(u[m]in s)w[m]=l[m]}else{for(;m<s;m++){x=l[m];B=n[m];if(x){x.__data__=B;z[m]=x;A[m]=w[m]=null}else{A[m]=q(B);z[m]=w[m]=null}}for(;m<t;m++){A[m]=q(n[m]);z[m]=w[m]=null}for(;m<u;m++){w[m]=l[m];A[m]=z[m]=null}}A.parentNode=z.parentNode=w.parentNode=l.parentNode;A.parentData=
10  
-z.parentData=w.parentData=l.parentData;h.push(A);g.push(z);k.push(w)}var h=[],g=[],k=[],j=-1,o=a.length,p;if(typeof e=="function")for(;++j<o;)i(p=a[j],e.call(p,p.parentData,j));else for(;++j<o;)i(p=a[j],e);j=y(g);j.enter=function(){return y(h)};j.exit=function(){return y(k)};return j};a.each=function(e){for(var c=0,i=a.length;c<i;c++)for(var h=a[c],g=0,k=h.length;g<k;g++){var j=h[g];j&&e.call(j,j.__data__,g)}return a};a.empty=function(){return!f(function(){return true})};a.node=function(){return f(function(){return this})};
11  
-a.attr=function(e,c){function i(){this.removeAttribute(e)}function h(){this.removeAttributeNS(e.space,e.local)}function g(){this.setAttribute(e,c)}function k(){this.setAttributeNS(e.space,e.local,c)}function j(){var p=c.apply(this,arguments);p==null?this.removeAttribute(e):this.setAttribute(e,p)}function o(){var p=c.apply(this,arguments);p==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,p)}e=d3.ns.qualify(e);if(arguments.length<2)return f(e.local?function(){return this.getAttributeNS(e.space,
12  
-e.local)}:function(){return this.getAttribute(e)});return a.each(c==null?e.local?h:i:typeof c=="function"?e.local?o:j:e.local?k:g)};a.classed=function(e,c){function i(){var j=this.className;k.lastIndex=0;if(!k.test(j))this.className=da(j+" "+e)}function h(){var j=da(this.className.replace(k," "));this.className=j.length?j:null}function g(){(c.apply(this,arguments)?i:h).call(this)}var k=RegExp("(^|\\s+)"+d3.requote(e)+"(\\s+|$)","g");if(arguments.length<2)return f(function(){k.lastIndex=0;return k.test(this.className)});
13  
-return a.each(typeof c=="function"?g:c?i:h)};a.style=function(e,c,i){function h(){this.style.removeProperty(e)}function g(){this.style.setProperty(e,c,i)}function k(){var j=c.apply(this,arguments);j==null?this.style.removeProperty(e):this.style.setProperty(e,j,i)}if(arguments.length<3)i=null;if(arguments.length<2)return f(function(){return window.getComputedStyle(this,null).getPropertyValue(e)});return a.each(c==null?h:typeof c=="function"?k:g)};a.property=function(e,c){function i(){delete this[e]}
14  
-function h(){this[e]=c}function g(){var k=c.apply(this,arguments);if(k==null)delete this[e];else this[e]=k}e=d3.ns.qualify(e);if(arguments.length<2)return f(function(){return this[e]});return a.each(c==null?i:typeof c=="function"?g:h)};a.text=function(e){function c(){this.appendChild(document.createTextNode(e))}function i(){var h=e.apply(this,arguments);h!=null&&this.appendChild(document.createTextNode(h))}if(arguments.length<1)return f(function(){return this.textContent});a.each(function(){for(;this.lastChild;)this.removeChild(this.lastChild)});
15  
-return e==null?a:a.each(typeof e=="function"?i:c)};a.html=function(e){function c(){this.innerHTML=e}function i(){this.innerHTML=e.apply(this,arguments)}if(arguments.length<1)return f(function(){return this.innerHTML});return a.each(typeof e=="function"?i:c)};a.append=function(e){function c(h){return h.appendChild(document.createElement(e))}function i(h){return h.appendChild(document.createElementNS(e.space,e.local))}e=d3.ns.qualify(e);return b(e.local?i:c)};a.insert=function(e,c){function i(g){return g.insertBefore(document.createElement(e),
16  
-g.querySelector(c))}function h(g){return g.insertBefore(document.createElementNS(e.space,e.local),g.querySelector(c))}e=d3.ns.qualify(e);return b(e.local?h:i)};a.remove=function(){return b(function(e){var c=e.parentNode;c.removeChild(e);return c})};a.sort=function(e){e=Ga.apply(this,arguments);for(var c=0,i=a.length;c<i;c++){var h=a[c];h.sort(e);for(var g=1,k=h.length,j=h[0];g<k;g++){var o=h[g];if(o){j&&j.parentNode.insertBefore(o,j.nextSibling);j=o}}}return a};a.on=function(e,c){var i=e.indexOf("."),
17  
-h=i==-1?e:e.substring(0,i),g="__on"+e;return a.each(function(k,j){function o(p){var l=d3.event;d3.event=p;try{c.call(this,k,j)}finally{d3.event=l}}this[g]&&this.removeEventListener(h,this[g],false);if(c)this.addEventListener(h,this[g]=o,false)})};a.transition=function(){return X(a)};a.call=ea;return a}function Ga(a){if(!arguments.length)a=d3.ascending;return function(b,d){return a(b&&b.__data__,d&&d.__data__)}}function X(a){function b(l){var n=true,q=-1;a.each(function(){if(g[++q]!=2){var m=(l-k[q])/
18  
-j[q],r=this.__transition__,t,s,u=c[q];if(m<1){n=false;if(m<0)return}else m=1;if(g[q]){if(!r||r.active!=f){g[q]=2;return}}else if(!r||r.active>f){g[q]=2;return}else{g[q]=1;h.start.dispatch.apply(this,arguments);u=c[q]={};r.active=f;for(s in e)u[s]=e[s].apply(this,arguments)}t=p(m);for(s in e)u[s].call(this,t);if(m==1){g[q]=2;if(r.active==f){m=r.owner;if(m==f){delete this.__transition__;i&&this.parentNode.removeChild(this)}Y=f;h.end.dispatch.apply(this,arguments);Y=0;r.owner=m}}}});return n}var d={},
19  
-f=Y||++Ha,e={},c=[],i=false,h=d3.dispatch("start","end"),g=[],k=[],j=[],o,p=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=f});d.delay=function(l){var n=Infinity,q=-1;if(typeof l=="function")a.each(function(){var m=k[++q]=+l.apply(this,arguments);if(m<n)n=m});else{n=+l;a.each(function(){k[++q]=n})}Ia(b,n);return d};d.duration=function(l){var n=-1;if(typeof l=="function"){o=0;a.each(function(){var q=j[++n]=+l.apply(this,arguments);if(q>o)o=q})}else{o=
20  
-+l;a.each(function(){j[++n]=o})}return d};d.ease=function(l){p=typeof l=="string"?d3.ease(l):l;return d};d.attrTween=function(l,n){function q(r,t){var s=n.call(this,r,t,this.getAttribute(l));return function(u){this.setAttribute(l,s(u))}}function m(r,t){var s=n.call(this,r,t,this.getAttributeNS(l.space,l.local));return function(u){this.setAttributeNS(l.space,l.local,s(u))}}e["attr."+l]=l.local?m:q;return d};d.attr=function(l,n){return d.attrTween(l,ia(n))};d.styleTween=function(l,n,q){if(arguments.length<
21  
-3)q=null;e["style."+l]=function(m,r){var t=n.call(this,m,r,window.getComputedStyle(this,null).getPropertyValue(l));return function(s){this.style.setProperty(l,t(s),q)}};return d};d.style=function(l,n,q){if(arguments.length<3)q=null;return d.styleTween(l,ia(n),q)};d.select=function(l){var n;l=X(a.select(l)).ease(p);n=-1;l.delay(function(){return k[++n]});n=-1;l.duration(function(){return j[++n]});return l};d.selectAll=function(l){var n;l=X(a.selectAll(l)).ease(p);n=-1;l.delay(function(q,m){return k[m?
22  
-n:++n]});n=-1;l.duration(function(q,m){return j[m?n:++n]});return l};d.remove=function(){i=true;return d};d.each=function(l,n){h[l].add(n);return d};d.call=ea;return d.delay(0).duration(250)}function ia(a){return typeof a=="function"?function(b,d,f){return d3.interpolate(f,String(a.call(this,b,d)))}:(a=String(a),function(b,d,f){return d3.interpolate(f,a)})}function Ia(a,b){var d=Date.now(),f=false,e=d+b,c=F;if(isFinite(b)){for(;c;){if(c.callback==a){c.then=d;c.delay=b;f=true}else{var i=c.then+c.delay;
23  
-if(i<e)e=i}c=c.next}f||(F={callback:a,then:d,delay:b,next:F});if(!K){clearTimeout(Z);Z=setTimeout(Ja,Math.max(24,e-d))}}}function Ja(){K=setInterval(Ka,24);Z=0}function Ka(){for(var a,b=Date.now(),d=F;d;){a=b-d.then;if(a>d.delay)d.flush=d.callback(a);d=d.next}a=null;for(b=F;b;)b=b.flush?a?a.next=b.next:F=b.next:(a=b).next;a||(K=clearInterval(K))}function La(a){return a.innerRadius}function Ma(a){return a.outerRadius}function ja(a){return a.startAngle}function ka(a){return a.endAngle}function $(a,
24  
-b,d,f){var e=[],c=-1,i=b.length,h=typeof d=="function",g=typeof f=="function",k;if(h&&g)for(;++c<i;)e.push([d.call(a,k=b[c],c),f.call(a,k,c)]);else if(h)for(;++c<i;)e.push([d.call(a,b[c],c),f]);else if(g)for(;++c<i;)e.push([d,f.call(a,b[c],c)]);else for(;++c<i;)e.push([d,f]);return e}function la(a){return a[0]}function ma(a){return a[1]}function I(a){var b=[],d=0,f=a.length,e=a[0];for(b.push(e[0],",",e[1]);++d<f;)b.push("L",(e=a[d])[0],",",e[1]);return b.join("")}function na(a,b){if(b.length<1||a.length!=
25  
-b.length&&a.length!=b.length+2)return I(a);var d=a.length!=b.length,f="",e=a[0],c=a[1],i=b[0],h=i,g=1;if(d){f+="Q"+(c[0]-i[0]*2/3)+","+(c[1]-i[1]*2/3)+","+c[0]+","+c[1];e=a[1];g=2}if(b.length>1){h=b[1];c=a[g];g++;f+="C"+(e[0]+i[0])+","+(e[1]+i[1])+","+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1];for(e=2;e<b.length;e++,g++){c=a[g];h=b[e];f+="S"+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1]}}if(d){d=a[g];f+="Q"+(c[0]+h[0]*2/3)+","+(c[1]+h[1]*2/3)+","+d[0]+","+d[1]}return f}function oa(a,b){for(var d=
26  
-[],f=(1-b)/2,e=a[0],c=a[1],i=a[2],h=2,g=a.length;++h<g;){d.push([f*(i[0]-e[0]),f*(i[1]-e[1])]);e=c;c=i;i=a[h]}d.push([f*(i[0]-e[0]),f*(i[1]-e[1])]);return d}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,d){a.push("C",C(pa,b),",",C(pa,d),",",C(qa,b),",",C(qa,d),",",C(M,b),",",C(M,d))}function Na(){return 0}function Oa(a){return a.source}function Pa(a){return a.target}function Qa(a){return a.radius}function Ra(){return 64}function Sa(){return"circle"}d3={version:"0.30.8"};
27  
-if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;return new b};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 d=0,f=a.length,e=a[0],c;if(arguments.length==1)for(;++d<f;){if(e>(c=a[d]))e=c}else for(e=b(a[0]);++d<f;)if(e>(c=b(a[d])))e=c;return e};d3.max=function(a,b){var d=0,f=a.length,e=a[0],c;if(arguments.length==1)for(;++d<f;){if(e<(c=a[d]))e=c}else for(e=
28  
-b(e);++d<f;)if(e<(c=b(a[d])))e=c;return e};d3.nest=function(){function a(c,i){if(c>=d.length)return e?e.call(b,i):f?i.sort(f):i;for(var h=-1,g=i.length,k=d[c],j,o=[],p,l={};++h<g;)if((j=k(p=i[h]))in l)l[j].push(p);else{l[j]=[p];o.push(j)}c++;h=-1;for(g=o.length;++h<g;){p=l[j=o[h]];l[j]=a(c,p)}return l}var b={},d=[],f,e;b.map=function(c){return a(0,c)};b.key=function(c){d.push(c);return b};b.sortKeys=function(){return b};b.sortValues=function(c){f=c;return b};b.rollup=function(c){e=c;return b};return b};
29  
-d3.keys=function(a){var b=[],d;for(d in a)b.push(d);return b};d3.values=function(a){var b=[],d;for(d in a)b.push(a[d]);return b};d3.entries=function(a){var b=[],d;for(d in a)b.push({key:d,value:a[d]});return b};d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.split=function(a,b){var d=[],f=[],e,c=-1,i=a.length;if(arguments.length<2)b=ua;for(;++c<i;)if(b.call(f,e=a[c],c))f=[];else{f.length||d.push(f);f.push(e)}return d};d3.range=function(a,b,d){if(arguments.length==1){b=a;a=0}if(d==
30  
-null)d=1;if((b-a)/d==Infinity)throw Error("infinite range");var f=[],e=-1,c;if(d<0)for(;(c=a+d*++e)>b;)f.push(c);else for(;(c=a+d*++e)<b;)f.push(c);return f};d3.requote=function(a){return a.replace(Ta,"\\$&")};var Ta=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,d){var f=new XMLHttpRequest;if(arguments.length<3)d=b;else b&&f.overrideMimeType(b);f.open("GET",a,true);f.onreadystatechange=function(){if(f.readyState==4)d(f.status<300?f:null)};f.send(null)};d3.text=function(a,b,d){if(arguments.length<
31  
-3){d=b;b=null}d3.xhr(a,b,function(f){d(f&&f.responseText)})};d3.json=function(a,b){d3.text(a,"application/json",function(d){b(d?JSON.parse(d):null)})};d3.html=function(a,b){d3.text(a,"text/html",function(d){if(d!=null){var f=document.createRange();f.selectNode(document.body);d=f.createContextualFragment(d)}b(d)})};d3.xml=function(a,b,d){if(arguments.length<3){d=b;b=null}d3.xhr(a,b,function(f){d(f&&f.responseXML)})};d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",
32  
-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,d=0,f=arguments.length;d<f;d++){b=arguments[d];a[b]=va(b)}return a};d3.format=function(a){a=Ua.exec(a);var b=a[1]||" ",d=ra[a[3]]||ra["-"],f=a[5],e=+a[6],c=a[7],i=a[8],h=a[9];if(i)i=i.substring(1);if(f)b="0";if(h=="d")i="0";return function(g){g=
33  
-+g;var k=g<0&&(g=-g);if(h=="d"&&g%1)return"";g=i?g.toFixed(i):""+g;if(c){for(var j=g.lastIndexOf("."),o=j>=0?g.substring(j):(j=g.length,""),p=[];j>0;)p.push(g.substring(j-=3,j+3));g=p.reverse().join(",")+o}k=(g=d(k,g)).length;if(k<e)g=Array(e-k+1).join(b)+g;return g}};var Ua=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,ra={"+":function(a,b){return(a?"−":"+")+b}," ":function(a,b){return(a?"−":" ")+b},"-":function(a,b){return a?"−"+b:b}},Va=S(2),Wa=S(3),Xa={linear:function(){return wa},
34  
-poly:S,quad:function(){return Va},cubic:function(){return Wa},sin:function(){return xa},exp:function(){return ya},circle:function(){return za},elastic:function(a,b){var d;if(arguments.length<2)b=0.45;if(arguments.length<1){a=1;d=b/4}else d=b/(2*Math.PI)*Math.asin(1/a);return function(f){return 1+a*Math.pow(2,10*-f)*Math.sin((f-d)*2*Math.PI/b)}},back:function(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}},bounce:function(){return Aa}},Ya={"in":function(a){return a},out:fa,"in-out":ga,
35  
-"out-in":function(a){return ga(fa(a))}};d3.ease=function(a){var b=a.indexOf("-"),d=b>=0?a.substring(0,b):a;b=b>=0?a.substring(b+1):"in";return Ya[b](Xa[d].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,
36  
-b)};d3.interpolateNumber=function(a,b){b-=a;return function(d){return a+b*d}};d3.interpolateRound=function(a,b){b-=a;return function(d){return Math.round(a+b*d)}};d3.interpolateString=function(a,b){var d,f,e=0,c=[],i=[],h,g;for(f=0;d=aa.exec(b);++f){d.index&&c.push(b.substring(e,d.index));i.push({i:c.length,x:d[0]});c.push(null);e=aa.lastIndex}e<b.length&&c.push(b.substring(e));f=0;for(h=i.length;(d=aa.exec(a))&&f<h;++f){g=i[f];if(g.x==d[0]){if(g.i)if(c[g.i+1]==null){c[g.i-1]+=g.x;c.splice(g.i,1);
37  
-for(d=f+1;d<h;++d)i[d].i--}else{c[g.i-1]+=g.x+c[g.i+1];c.splice(g.i,2);for(d=f+1;d<h;++d)i[d].i-=2}else if(c[g.i+1]==null)c[g.i]=g.x;else{c[g.i]=g.x+c[g.i+1];c.splice(g.i+1,1);for(d=f+1;d<h;++d)i[d].i--}i.splice(f,1);h--;f--}else g.x=d3.interpolateNumber(parseFloat(d[0]),parseFloat(g.x))}for(;f<h;){g=i.pop();if(c[g.i+1]==null)c[g.i]=g.x;else{c[g.i]=g.x+c[g.i+1];c.splice(g.i+1,1)}h--}if(c.length==1)return c[0]==null?i[0].x:function(){return b};return function(k){for(f=0;f<h;++f)c[(g=i[f]).i]=g.x(k);
38  
-return c.join("")}};d3.interpolateRgb=function(a,b){a=d3.rgb(a);b=d3.rgb(b);var d=a.r,f=a.g,e=a.b,c=b.r-d,i=b.g-f,h=b.b-e;return function(g){return"rgb("+Math.round(d+c*g)+","+Math.round(f+i*g)+","+Math.round(e+h*g)+")"}};d3.interpolateArray=function(a,b){var d=[],f=[],e=a.length,c=b.length,i=Math.min(a.length,b.length),h;for(h=0;h<i;++h)d.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)f[h]=a[h];for(;h<c;++h)f[h]=b[h];return function(g){for(h=0;h<i;++h)f[h]=d[h](g);return f}};d3.interpolateObject=function(a,
39  
-b){var d={},f={},e;for(e in a)if(e in b)d[e]=(e in Za||/\bcolor\b/.test(e)?d3.interpolateRgb:d3.interpolate)(a[e],b[e]);else f[e]=a[e];for(e in b)e in a||(f[e]=b[e]);return function(c){for(e in d)f[e]=d[e](c);return f}};var aa=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,Za={background:1,fill:1,stroke:1};d3.rgb=function(a,b,d){return arguments.length==1?U(""+a,J,ha):J(~~a,~~b,~~d)};var G={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",
40  
-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",
41  
-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",
42  
-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",
43  
-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",
44  
-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",
45  
-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"},ba;for(ba in G)G[ba]=U(G[ba],J,ha);d3.hsl=function(a,b,d){return arguments.length==1?U(""+a,Ca,W):W(+a,+b,+d)};var N=y([[document]]);N[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?N.select(a):
46  
-y([[a]])};d3.selectAll=function(a){return typeof a=="string"?N.selectAll(a):y([R(a)])};d3.transition=N.transition;var Ha=0,Y=0,F=null,Z=0,K;d3.scale={};d3.scale.linear=function(){function a(j){return k((j-d)*i)}function b(j){var o=Math.min(d,f),p=Math.max(d,f),l=p-o,n=Math.pow(10,Math.floor(Math.log(l/j)/Math.LN10));j=j/(l/n);if(j<=0.15)n*=10;else if(j<=0.35)n*=5;else if(j<=0.75)n*=2;return{start:Math.ceil(o/n)*n,stop:Math.floor(p/n)*n+n*0.5,step:n}}var d=0,f=1,e=0,c=1,i=1/(f-d),h=(f-d)/(c-e),g=d3.interpolate,
47  
-k=g(e,c);a.invert=function(j){return(j-e)*h+d};a.domain=function(j){if(!arguments.length)return[d,f];d=j[0];f=j[1];i=1/(f-d);h=(f-d)/(c-e);return a};a.range=function(j){if(!arguments.length)return[e,c];e=j[0];c=j[1];h=(f-d)/(c-e);k=g(e,c);return a};a.rangeRound=function(j){return a.range(j).interpolate(d3.interpolateRound)};a.interpolate=function(j){if(!arguments.length)return g;k=(g=j)(e,c);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,
48  
--Math.floor(Math.log(b(j).step)/Math.LN10+0.01));return d3.format(",."+j+"f")};return a};d3.scale.log=function(){function a(c){return(e?-Math.log(-c):Math.log(c))/Math.LN10}function b(c){return e?-Math.pow(10,-c):Math.pow(10,c)}function d(c){return f(a(c))}var f=d3.scale.linear(),e=false;d.invert=function(c){return b(f.invert(c))};d.domain=function(c){if(!arguments.length)return f.domain().map(b);e=(c[0]||c[1])<0;f.domain(c.map(a));return d};d.range=D(d,f.range);d.rangeRound=D(d,f.rangeRound);d.interpolate=
49  
-D(d,f.interpolate);d.ticks=function(){var c=f.domain(),i=[];if(c.every(isFinite)){var h=Math.floor(c[0]),g=Math.ceil(c[1]),k=b(c[0]);c=b(c[1]);if(e)for(i.push(b(h));h++<g;)for(var j=9;j>0;j--)i.push(b(h)*j);else{for(;h<g;h++)for(j=1;j<10;j++)i.push(b(h)*j);i.push(b(h))}for(h=0;i[h]<k;h++);for(g=i.length;i[g-1]>c;g--);i=i.slice(h,g)}return i};d.tickFormat=function(){return function(c){return c.toPrecision(1)}};return d};d3.scale.pow=function(){function a(g){return h?-Math.pow(-g,c):Math.pow(g,c)}function b(g){return h?
50  
--Math.pow(-g,i):Math.pow(g,i)}function d(g){return f(a(g))}var f=d3.scale.linear(),e=d3.scale.linear(),c=1,i=1/c,h=false;d.invert=function(g){return b(f.invert(g))};d.domain=function(g){if(!arguments.length)return f.domain().map(b);h=(g[0]||g[1])<0;f.domain(g.map(a));e.domain(g);return d};d.range=D(d,f.range);d.rangeRound=D(d,f.rangeRound);d.inteprolate=D(d,f.interpolate);d.ticks=e.ticks;d.tickFormat=e.tickFormat;d.exponent=function(g){if(!arguments.length)return c;var k=d.domain();c=g;i=1/g;return d.domain(k)};
51  
-return d};d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){function a(c){c=c in d?d[c]:d[c]=b.push(c)-1;return f[c%f.length]}var b=[],d={},f=[],e=0;a.domain=function(c){if(!arguments.length)return b;b=c;d={};for(var i=-1,h=-1,g=b.length;++i<g;){c=b[i];c in d||(d[c]=++h)}return a};a.range=function(c){if(!arguments.length)return f;f=c;return a};a.rangePoints=function(c,i){if(arguments.length<2)i=0;var h=c[0],g=c[1],k=(g-h)/(b.length-1+i);f=b.length==1?[(h+g)/
52  
-2]:d3.range(h+k*i/2,g+k/2,k);e=0;return a};a.rangeBands=function(c,i){if(arguments.length<2)i=0;var h=c[0],g=c[1],k=(g-h)/(b.length+i);f=d3.range(h+k*i,g,k);e=k*(1-i);return a};a.rangeRoundBands=function(c,i){if(arguments.length<2)i=0;var h=c[0],g=c[1],k=g-h,j=Math.floor(k/(b.length+i));f=d3.range(h+Math.round((k-(b.length-i)*j)/2),g,j);e=Math.round(j*(1-i));return a};a.rangeBand=function(){return e};return a};d3.scale.category10=function(){return d3.scale.ordinal().range($a)};d3.scale.category20=
53  
-function(){return d3.scale.ordinal().range(ab)};d3.scale.category20b=function(){return d3.scale.ordinal().range(bb)};d3.scale.category20c=function(){return d3.scale.ordinal().range(cb)};var $a=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],ab=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bb=
54  
-["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],cb=["#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 i=-1,h=c.length=e.length,g=f.length/h;++i<h;)c[i]=
55  
-f[~~(i*g)]}function b(i){if(isNaN(i=+i))return NaN;for(var h=0,g=c.length-1;h<=g;){var k=h+g>>1,j=c[k];if(j<i)h=k+1;else if(j>i)g=k-1;else return k}return g<0?0:g}function d(i){return e[b(i)]}var f=[],e=[],c=[];d.domain=function(i){if(!arguments.length)return f;f=i.filter(function(h){return!isNaN(h)}).sort(d3.ascending);a();return d};d.range=function(i){if(!arguments.length)return e;e=i;a();return d};d.quantiles=function(){return c};return d};d3.scale.quantize=function(){function a(i){return c[Math.max(0,
56  
-Math.min(e,Math.floor(f*(i-b))))]}var b=0,d=1,f=2,e=1,c=[0,1];a.domain=function(i){if(!arguments.length)return[b,d];b=i[0];d=i[1];f=c.length/(d-b);return a};a.range=function(i){if(!arguments.length)return c;c=i;f=c.length/(d-b);e=c.length-1;return a};return a};d3.svg={};d3.svg.arc=function(){function a(c,i){var h=b.call(this,c,i),g=d.call(this,c,i),k=f.call(this,c,i)+O,j=e.call(this,c,i)+O,o=j-k,p=o<Math.PI?"0":"1",l=Math.cos(k);k=Math.sin(k);var n=Math.cos(j);j=Math.sin(j);return o>=db?h?"M0,"+g+
57  
-"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+h+"A"+h+","+h+" 0 1,1 0,"+-h+"A"+h+","+h+" 0 1,1 0,"+h+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":h?"M"+g*l+","+g*k+"A"+g+","+g+" 0 "+p+",1 "+g*n+","+g*j+"L"+h*n+","+h*j+"A"+h+","+h+" 0 "+p+",0 "+h*l+","+h*k+"Z":"M"+g*l+","+g*k+"A"+g+","+g+" 0 "+p+",1 "+g*n+","+g*j+"L0,0Z"}var b=La,d=Ma,f=ja,e=ka;a.innerRadius=function(c){if(!arguments.length)return b;b=v(c);return a};a.outerRadius=function(c){if(!arguments.length)return d;
58  
-d=v(c);return a};a.startAngle=function(c){if(!arguments.length)return f;f=v(c);return a};a.endAngle=function(c){if(!arguments.length)return e;e=v(c);return a};return a};var O=-Math.PI/2,db=2*Math.PI-1.0E-6;d3.svg.line=function(){function a(i){return i.length<1?null:"M"+e($(this,i,b,d),c)}var b=la,d=ma,f="linear",e=P[f],c=0.7;a.x=function(i){if(!arguments.length)return b;b=i;return a};a.y=function(i){if(!arguments.length)return d;d=i;return a};a.interpolate=function(i){if(!arguments.length)return f;
59  
-e=P[f=i];return a};a.tension=function(i){if(!arguments.length)return c;c=i;return a};return a};var P={linear:I,basis:function(a){if(a.length<3)return I(a);var b=[],d=1,f=a.length,e=a[0],c=e[0],i=e[1],h=[c,c,c,(e=a[1])[0]],g=[i,i,i,e[1]];b.push(c,",",i);for(L(b,h,g);++d<f;){e=a[d];h.shift();h.push(e[0]);g.shift();g.push(e[1]);L(b,h,g)}for(d=-1;++d<2;){h.shift();h.push(e[0]);g.shift();g.push(e[1]);L(b,h,g)}return b.join("")},"basis-closed":function(a){for(var b,d=-1,f=a.length,e=f+4,c,i=[],h=[];++d<
60  
-4;){c=a[d%f];i.push(c[0]);h.push(c[1])}b=[C(M,i),",",C(M,h)];for(--d;++d<e;){c=a[d%f];i.shift();i.push(c[0]);h.shift();h.push(c[1]);L(b,i,h)}return b.join("")},cardinal:function(a,b){if(a.length<3)return I(a);return a[0]+na(a,oa(a,b))},"cardinal-closed":function(a,b){if(a.length<3)return I(a);return a[0]+na(a,oa([a[a.length-2]].concat(a,[a[1]]),b))}},pa=[0,2/3,1/3,0],qa=[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"+c($(this,h,b,f),i)+"L"+c($(this,
61  
-h,b,d).reverse(),i)+"Z"}var b=la,d=Na,f=ma,e="linear",c=P[e],i=0.7;a.x=function(h){if(!arguments.length)return b;b=h;return a};a.y0=function(h){if(!arguments.length)return d;d=h;return a};a.y1=function(h){if(!arguments.length)return f;f=h;return a};a.interpolate=function(h){if(!arguments.length)return e;c=P[e=h];return a};a.tension=function(h){if(!arguments.length)return i;i=h;return a};return a};d3.svg.chord=function(){function a(h,g){var k=b(this,d,h,g),j=b(this,f,h,g);return"M"+k.p0+("A"+k.r+","+
62  
-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,g,k,j){var o=g.call(h,k,j);g=e.call(h,o,j);k=c.call(h,o,j)+O;h=i.call(h,o,j)+O;return{r:g,a0:k,a1:h,p0:[g*Math.cos(k),g*Math.sin(k)],p1:[g*Math.cos(h),g*Math.sin(h)]}}var d=Oa,f=Pa,e=Qa,c=ja,i=ka;a.radius=function(h){if(!arguments.length)return e;e=v(h);return a};a.source=function(h){if(!arguments.length)return d;d=v(h);return a};a.target=function(h){if(!arguments.length)return f;
63  
-f=v(h);return a};a.startAngle=function(h){if(!arguments.length)return c;c=v(h);return a};a.endAngle=function(h){if(!arguments.length)return i;i=v(h);return a};return a};d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(ca<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),f=d[0][0].getScreenCTM();ca=!(f.f||f.e);d.remove()}if(ca){b.x=d3.event.pageX;b.y=d3.event.pageY}else{b.x=d3.event.clientX;
64  
-b.y=d3.event.clientY}b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var ca=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function a(f,e){return(sa[b.call(this,f,e)]||sa.circle)(d.call(this,f,e))}var b=Sa,d=Ra;a.type=function(f){if(!arguments.length)return b;b=v(f);return a};a.size=function(f){if(!arguments.length)return d;d=v(f);return a};return a};d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var sa={circle:function(a){a=
65  
-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*ta));var b=a*ta;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,"+
66  
-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),ta=Math.tan(30*Math.PI/180)})();
  1
+(function(){function Q(a){return Array.prototype.slice.call(a)}function v(a){return typeof a=="function"?a:function(){return a}}function C(a,b){return function(){var d=b.apply(a,arguments);return arguments.length?a:d}}function ua(a){return a==null}function ca(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function da(a,b){b=Q(arguments);b[0]=this;a.apply(this,b);return this}function va(){var a={},b=[];a.add=function(d){for(var f=0;f<b.length;f++)if(b[f].listener==d)return a;b.push({listener:d,
  2
+on:true});return a};a.remove=function(d){for(var f=0;f<b.length;f++){var e=b[f];if(e.listener==d){e.on=false;b=b.slice(0,f).concat(b.slice(f+1));break}}return a};a.dispatch=function(){for(var d=b,f=0,e=d.length;f<e;f++){var c=d[f];c.on&&c.listener.apply(this,arguments)}};return a}function ea(a){return function(b){return 1-a(1-b)}}function fa(a){return function(b){return 0.5*(b<0.5?a(2*b):2-a(2-2*b))}}function wa(a){return a}function R(a){return function(b){return Math.pow(b,a)}}function xa(a){return 1-
  3
+Math.cos(a*Math.PI/2)}function ya(a){return a?Math.pow(2,10*(a-1))-0.0010:0}function za(a){return 1-Math.sqrt(1-a*a)}function Aa(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 I(a,b,d){return{r:a,g:b,b:d,toString:Ba}}function Ba(){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,d){var f=0,e=0,c=0,i,h;if(i=/([a-z]+)\((.*)\)/i.exec(a)){h=
  4
+i[2].split(",");switch(i[1]){case "hsl":return d(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(d=G[a])return b(d.r,d.g,d.b);if(a!=null&&a.charAt(0)=="#"){if(a.length==4){f=a.charAt(1);f+=f;e=a.charAt(2);e+=e;c=a.charAt(3);c+=c}else if(a.length==7){f=a.substring(1,3);e=a.substring(3,5);c=a.substring(5,7)}f=parseInt(f,16);e=parseInt(e,16);c=parseInt(c,16)}return b(f,e,c)}function Ca(a,b,d){var f=Math.min(a/=255,b/=255,d/=255),e=Math.max(a,
  5
+b,d),c=e-f,i=(e+f)/2;if(c){f=i<0.5?c/(e+f):c/(2-e-f);a=a==e?(b-d)/c+(b<d?6:0):b==e?(d-a)/c+2:(a-b)/c+4;a*=60}else f=a=0;return V(a,f,i)}function U(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function V(a,b,d){return{h:a,s:b,l:d,toString:Da}}function Da(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function ga(a,b,d){function f(i){if(i>360)i-=360;else if(i<0)i+=360;if(i<60)return e+(c-e)*i/60;if(i<180)return c;if(i<240)return e+(c-e)*(240-i)/60;return e}
  6
+var e,c;a%=360;if(a<0)a+=360;b=b<0?0:b>1?1:b;d=d<0?0:d>1?1:d;c=d<=0.5?d*(1+b):d+b-d*b;e=2*d-c;return I(Math.round(f(a+120)*255),Math.round(f(a)*255),Math.round(f(a-120)*255))}function y(a){function b(e){for(var c=[],i,h,g,k,j=0,o=a.length;j<o;j++){g=a[j];c.push(i=[]);i.parentNode=g.parentNode;i.parentData=g.parentData;for(var p=0,m=g.length;p<m;p++)if(k=g[p]){i.push(h=e(k));if(h&&"__data__"in k)h.__data__=k.__data__}else i.push(null)}return y(c)}function d(e){for(var c=[],i,h,g,k=0,j=a.length;k<j;k++){h=
  7
+a[k];for(var o=0,p=h.length;o<p;o++)if(g=h[o]){c.push(i=e(g));i.parentNode=g;i.parentData=g.__data__}}return y(c)}function f(e){for(var c=0,i=a.length;c<i;c++)for(var h=a[c],g=0,k=h.length;g<k;g++){var j=h[g];if(j)return e.call(j,j.__data__,g)}return null}a.select=function(e){return b(function(c){return D(e,c)})};a.selectAll=function(e){return d(function(c){return ha(e,c)})};a.filter=function(e){for(var c=[],i,h,g,k=0,j=a.length;k<j;k++){h=a[k];c.push(i=[]);i.parentNode=h.parentNode;i.parentData=
  8
+h.parentData;for(var o=0,p=h.length;o<p;o++)if((g=h[o])&&e.call(g,g.__data__,o))i.push(g)}return y(c)};a.data=function(e,c){function i(m,n){var l=0,q=m.length,r=n.length,t=Math.min(q,r),u=Math.max(q,r),s=[],z=[],w=[],x,A;if(c){t={};u=[];var E;A=n.length;for(l=0;l<q;l++){E=c.call(x=m[l],x.__data__,l);if(E in t)w[A++]=m[l];else{t[E]=x;u.push(E)}}for(l=0;l<r;l++){if(x=t[E=c.call(n,A=n[l],l)]){x.__data__=A;s[l]=x;z[l]=w[l]=null}else{z[l]={__data__:A};s[l]=w[l]=null}delete t[E]}for(l=0;l<q;l++)if(u[l]in
  9
+t)w[l]=m[l]}else{for(;l<t;l++){x=m[l];A=n[l];if(x){x.__data__=A;s[l]=x;z[l]=w[l]=null}else{z[l]={__data__:A};s[l]=w[l]=null}}for(;l<r;l++){z[l]={__data__:n[l]};s[l]=w[l]=null}for(;l<u;l++){w[l]=m[l];z[l]=s[l]=null}}z.parentNode=s.parentNode=w.parentNode=m.parentNode;z.parentData=s.parentData=w.parentData=m.parentData;h.push(z);g.push(s);k.push(w)}var h=[],g=[],k=[],j=-1,o=a.length,p;if(typeof e=="function")for(;++j<o;)i(p=a[j],e.call(p,p.parentData,j));else for(;++j<o;)i(p=a[j],e);j=y(g);j.enter=
  10
+function(){return Ea(h)};j.exit=function(){return y(k)};return j};a.each=function(e){for(var c=0,i=a.length;c<i;c++)for(var h=a[c],g=0,k=h.length;g<k;g++){var j=h[g];j&&e.call(j,j.__data__,g)}return a};a.empty=function(){return!f(function(){return true})};a.node=function(){return f(function(){return this})};a.attr=function(e,c){function i(){this.removeAttribute(e)}function h(){this.removeAttributeNS(e.space,e.local)}function g(){this.setAttribute(e,c)}function k(){this.setAttributeNS(e.space,e.local,
  11
+c)}function j(){var p=c.apply(this,arguments);p==null?this.removeAttribute(e):this.setAttribute(e,p)}function o(){var p=c.apply(this,arguments);p==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,p)}e=d3.ns.qualify(e);if(arguments.length<2)return f(e.local?function(){return this.getAttributeNS(e.space,e.local)}:function(){return this.getAttribute(e)});return a.each(c==null?e.local?h:i:typeof c=="function"?e.local?o:j:e.local?k:g)};a.classed=function(e,c){function i(){var j=
  12
+this.className;k.lastIndex=0;if(!k.test(j))this.className=ca(j+" "+e)}function h(){var j=ca(this.className.replace(k," "));this.className=j.length?j:null}function g(){(c.apply(this,arguments)?i:h).call(this)}var k=RegExp("(^|\\s+)"+d3.requote(e)+"(\\s+|$)","g");if(arguments.length<2)return f(function(){k.lastIndex=0;return k.test(this.className)});return a.each(typeof c=="function"?g:c?i:h)};a.style=function(e,c,i){function h(){this.style.removeProperty(e)}function g(){this.style.setProperty(e,c,
  13
+i)}function k(){var j=c.apply(this,arguments);j==null?this.style.removeProperty(e):this.style.setProperty(e,j,i)}if(arguments.length<3)i=null;if(arguments.length<2)return f(function(){return window.getComputedStyle(this,null).getPropertyValue(e)});return a.each(c==null?h:typeof c=="function"?k:g)};a.property=function(e,c){function i(){delete this[e]}function h(){this[e]=c}function g(){var k=c.apply(this,arguments);if(k==null)delete this[e];else this[e]=k}e=d3.ns.qualify(e);if(arguments.length<2)return f(function(){return this[e]});
  14
+return a.each(c==null?i:typeof c=="function"?g:h)};a.text=function(e){function c(){this.appendChild(document.createTextNode(e))}function i(){var h=e.apply(this,arguments);h!=null&&this.appendChild(document.createTextNode(h))}if(arguments.length<1)return f(function(){return this.textContent});a.each(function(){for(;this.lastChild;)this.removeChild(this.lastChild)});return e==null?a:a.each(typeof e=="function"?i:c)};a.html=function(e){function c(){this.innerHTML=e}function i(){this.innerHTML=e.apply(this,
  15
+arguments)}if(arguments.length<1)return f(function(){return this.innerHTML});return a.each(typeof e=="function"?i:c)};a.append=function(e){function c(h){return h.appendChild(document.createElement(e))}function i(h){return h.appendChild(document.createElementNS(e.space,e.local))}e=d3.ns.qualify(e);return b(e.local?i:c)};a.insert=function(e,c){function i(g){return g.insertBefore(document.createElement(e),D(c,g))}function h(g){return g.insertBefore(document.createElementNS(e.space,e.local),D(c,g))}e=
  16
+d3.ns.qualify(e);return b(e.local?h:i)};a.remove=function(){return b(function(e){var c=e.parentNode;c.removeChild(e);return c})};a.sort=function(e){e=Fa.apply(this,arguments);for(var c=0,i=a.length;c<i;c++){var h=a[c];h.sort(e);for(var g=1,k=h.length,j=h[0];g<k;g++){var o=h[g];if(o){j&&j.parentNode.insertBefore(o,j.nextSibling);j=o}}}return a};a.on=function(e,c){var i=e.indexOf("."),h=i==-1?e:e.substring(0,i),g="__on"+e;return a.each(function(k,j){function o(p){var m=d3.event;d3.event=p;try{c.call(this,
  17
+k,j)}finally{d3.event=m}}this[g]&&this.removeEventListener(h,this[g],false);if(c)this.addEventListener(h,this[g]=o,false)})};a.transition=function(){return W(a)};a.call=da;return a}function Ea(a){function b(d){for(var f=[],e,c,i,h,g=0,k=a.length;g<k;g++){i=a[g];f.push(e=[]);e.parentNode=i.parentNode;e.parentData=i.parentData;for(var j=0,o=i.length;j<o;j++)if(h=i[j]){e.push(c=d(i.parentNode));c.__data__=h.__data__}else e.push(null)}return y(f)}a.append=function(d){function f(c){return c.appendChild(document.createElement(d))}
  18
+function e(c){return c.appendChild(document.createElementNS(d.space,d.local))}d=d3.ns.qualify(d);return b(d.local?e:f)};a.insert=function(d,f){function e(i){return i.insertBefore(document.createElement(d),D(f,i))}function c(i){return i.insertBefore(document.createElementNS(d.space,d.local),D(f,i))}d=d3.ns.qualify(d);return b(d.local?c:e)};return a}function Fa(a){if(!arguments.length)a=d3.ascending;return function(b,d){return a(b&&b.__data__,d&&d.__data__)}}function W(a){function b(m){var n=true,l=
  19
+-1;a.each(function(){if(g[++l]!=2){var q=(m-k[l])/j[l],r=this.__transition__,t,u,s=c[l];if(q<1){n=false;if(q<0)return}else q=1;if(g[l]){if(!r||r.active!=f){g[l]=2;return}}else if(!r||r.active>f){g[l]=2;return}else{g[l]=1;h.start.dispatch.apply(this,arguments);s=c[l]={};r.active=f;for(u in e)s[u]=e[u].apply(this,arguments)}t=p(q);for(u in e)s[u].call(this,t);if(q==1){g[l]=2;if(r.active==f){q=r.owner;if(q==f){delete this.__transition__;i&&this.parentNode.removeChild(this)}X=f;h.end.dispatch.apply(this,
  20
+arguments);X=0;r.owner=q}}}});return n}var d={},f=X||++Ga,e={},c=[],i=false,h=d3.dispatch("start","end"),g=[],k=[],j=[],o,p=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=f});d.delay=function(m){var n=Infinity,l=-1;if(typeof m=="function")a.each(function(){var q=k[++l]=+m.apply(this,arguments);if(q<n)n=q});else{n=+m;a.each(function(){k[++l]=n})}Ha(b,n);return d};d.duration=function(m){var n=-1;if(typeof m=="function"){o=0;a.each(function(){var l=j[++n]=
  21
++m.apply(this,arguments);if(l>o)o=l})}else{o=+m;a.each(function(){j[++n]=o})}return d};d.ease=function(m){p=typeof m=="string"?d3.ease(m):m;return d};d.attrTween=function(m,n){function l(r,t){var u=n.call(this,r,t,this.getAttribute(m));return function(s){this.setAttribute(m,u(s))}}function q(r,t){var u=n.call(this,r,t,this.getAttributeNS(m.space,m.local));return function(s){this.setAttributeNS(m.space,m.local,u(s))}}e["attr."+m]=m.local?q:l;return d};d.attr=function(m,n){return d.attrTween(m,ia(n))};
  22
+d.styleTween=function(m,n,l){if(arguments.length<3)l=null;e["style."+m]=function(q,r){var t=n.call(this,q,r,window.getComputedStyle(this,null).getPropertyValue(m));return function(u){this.style.setProperty(m,t(u),l)}};return d};d.style=function(m,n,l){if(arguments.length<3)l=null;return d.styleTween(m,ia(n),l)};d.select=function(m){var n;m=W(a.select(m)).ease(p);n=-1;m.delay(function(){return k[++n]});n=-1;m.duration(function(){return j[++n]});return m};d.selectAll=function(m){var n;m=W(a.selectAll(m)).ease(p);
  23
+n=-1;m.delay(function(l,q){return k[q?n:++n]});n=-1;m.duration(function(l,q){return j[q?n:++n]});return m};d.remove=function(){i=true;return d};d.each=function(m,n){h[m].add(n);return d};d.call=da;return d.delay(0).duration(250)}function ia(a){return typeof a=="function"?function(b,d,f){return d3.interpolate(f,String(a.call(this,b,d)))}:(a=String(a),function(b,d,f){return d3.interpolate(f,a)})}function Ha(a,b){var d=Date.now(),f=false,e=d+b,c=F;if(isFinite(b)){for(;c;){if(c.callback==a){c.then=d;
  24
+c.delay=b;f=true}else{var i=c.then+c.delay;if(i<e)e=i}c=c.next}f||(F={callback:a,then:d,delay:b,next:F});if(!J){clearTimeout(Y);Y=setTimeout(Ia,Math.max(24,e-d))}}}function Ia(){J=setInterval(Ja,24);Y=0}function Ja(){for(var a,b=Date.now(),d=F;d;){a=b-d.then;if(a>d.delay)d.flush=d.callback(a);d=d.next}a=null;for(b=F;b;)b=b.flush?a?a.next=b.next:F=b.next:(a=b).next;a||(J=clearInterval(J))}function Ka(a){return a.innerRadius}function La(a){return a.outerRadius}function ja(a){return a.startAngle}function ka(a){return a.endAngle}
  25
+function Z(a,b,d,f){var e=[],c=-1,i=b.length,h=typeof d=="function",g=typeof f=="function",k;if(h&&g)for(;++c<i;)e.push([d.call(a,k=b[c],c),f.call(a,k,c)]);else if(h)for(;++c<i;)e.push([d.call(a,b[c],c),f]);else if(g)for(;++c<i;)e.push([d,f.call(a,b[c],c)]);else for(;++c<i;)e.push([d,f]);return e}function la(a){return a[0]}function ma(a){return a[1]}function H(a){var b=[],d=0,f=a.length,e=a[0];for(b.push(e[0],",",e[1]);++d<f;)b.push("L",(e=a[d])[0],",",e[1]);return b.join("")}function na(a,b){if(b.length<
  26
+1||a.length!=b.length&&a.length!=b.length+2)return H(a);var d=a.length!=b.length,f="",e=a[0],c=a[1],i=b[0],h=i,g=1;if(d){f+="Q"+(c[0]-i[0]*2/3)+","+(c[1]-i[1]*2/3)+","+c[0]+","+c[1];e=a[1];g=2}if(b.length>1){h=b[1];c=a[g];g++;f+="C"+(e[0]+i[0])+","+(e[1]+i[1])+","+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1];for(e=2;e<b.length;e++,g++){c=a[g];h=b[e];f+="S"+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1]}}if(d){d=a[g];f+="Q"+(c[0]+h[0]*2/3)+","+(c[1]+h[1]*2/3)+","+d[0]+","+d[1]}return f}function oa(a,
  27
+b){for(var d=[],f=(1-b)/2,e=a[0],c=a[1],i=a[2],h=2,g=a.length;++h<g;){d.push([f*(i[0]-e[0]),f*(i[1]-e[1])]);e=c;c=i;i=a[h]}d.push([f*(i[0]-e[0]),f*(i[1]-e[1])]);return d}function B(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function K(a,b,d){a.push("C",B(pa,b),",",B(pa,d),",",B(qa,b),",",B(qa,d),",",B(L,b),",",B(L,d))}function Ma(){return 0}function Na(a){return a.source}function Oa(a){return a.target}function Pa(a){return a.radius}function Qa(){return 64}function Ra(){return"circle"}d3=
  28
+{version:"1.0.0"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;return new b};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 d=0,f=a.length,e=a[0],c;if(arguments.length==1)for(;++d<f;){if(e>(c=a[d]))e=c}else for(e=b(a[0]);++d<f;)if(e>(c=b(a[d])))e=c;return e};d3.max=function(a,b){var d=0,f=a.length,e=a[0],c;if(arguments.length==1)for(;++d<f;){if(e<
  29
+(c=a[d]))e=c}else for(e=b(e);++d<f;)if(e<(c=b(a[d])))e=c;return e};d3.nest=function(){function a(c,i){if(c>=d.length)return e?e.call(b,i):f?i.sort(f):i;for(var h=-1,g=i.length,k=d[c],j,o=[],p,m={};++h<g;)if((j=k(p=i[h]))in m)m[j].push(p);else{m[j]=[p];o.push(j)}c++;h=-1;for(g=o.length;++h<g;){p=m[j=o[h]];m[j]=a(c,p)}return m}var b={},d=[],f,e;b.map=function(c){return a(0,c)};b.key=function(c){d.push(c);return b};b.sortKeys=function(){return b};b.sortValues=function(c){f=c;return b};b.rollup=function(c){e=
  30
+c;return b};return b};d3.keys=function(a){var b=[],d;for(d in a)b.push(d);return b};d3.values=function(a){var b=[],d;for(d in a)b.push(a[d]);return b};d3.entries=function(a){var b=[],d;for(d in a)b.push({key:d,value:a[d]});return b};d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.split=function(a,b){var d=[],f=[],e,c=-1,i=a.length;if(arguments.length<2)b=ua;for(;++c<i;)if(b.call(f,e=a[c],c))f=[];else{f.length||d.push(f);f.push(e)}return d};d3.range=function(a,b,d){if(arguments.length==
  31
+1){b=a;a=0}if(d==null)d=1;if((b-a)/d==Infinity)throw Error("infinite range");var f=[],e=-1,c;if(d<0)for(;(c=a+d*++e)>b;)f.push(c);else for(;(c=a+d*++e)<b;)f.push(c);return f};d3.requote=function(a){return a.replace(Sa,"\\$&")};var Sa=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,d){var f=new XMLHttpRequest;if(arguments.length<3)d=b;else b&&f.overrideMimeType(b);f.open("GET",a,true);f.onreadystatechange=function(){if(f.readyState==4)d(f.status<300?f:null)};f.send(null)};d3.text=function(a,b,
  32
+d){if(arguments.length<3){d=b;b=null}d3.xhr(a,b,function(f){d(f&&f.responseText)})};d3.json=function(a,b){d3.text(a,"application/json",function(d){b(d?JSON.parse(d):null)})};d3.html=function(a,b){d3.text(a,"text/html",function(d){if(d!=null){var f=document.createRange();f.selectNode(document.body);d=f.createContextualFragment(d)}b(d)})};d3.xml=function(a,b,d){if(arguments.length<3){d=b;b=null}d3.xhr(a,b,function(f){d(f&&f.responseXML)})};d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",
  33
+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,d=0,f=arguments.length;d<f;d++){b=arguments[d];a[b]=va(b)}return a};d3.format=function(a){a=Ta.exec(a);var b=a[1]||" ",d=ra[a[3]]||ra["-"],f=a[5],e=+a[6],c=a[7],i=a[8],h=a[9];if(i)i=i.substring(1);if(f)b="0";if(h=="d")i="0";return function(g){g=
  34
++g;var k=g<0&&(g=-g);if(h=="d"&&g%1)return"";g=i?g.toFixed(i):""+g;if(c){for(var j=g.lastIndexOf("."),o=j>=0?g.substring(j):(j=g.length,""),p=[];j>0;)p.push(g.substring(j-=3,j+3));g=p.reverse().join(",")+o}k=(g=d(k,g)).length;if(k<e)g=Array(e-k+1).join(b)+g;return g}};var Ta=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,ra={"+":function(a,b){return(a?"−":"+")+b}," ":function(a,b){return(a?"−":" ")+b},"-":function(a,b){return a?"−"+b:b}},Ua=R(2),Va=R(3),Wa={linear:function(){return wa},
  35
+poly:R,quad:function(){return Ua},cubic:function(){return Va},sin:function(){return xa},exp:function(){return ya},circle:function(){return za},elastic:function(a,b){var d;if(arguments.length<2)b=0.45;if(arguments.length<1){a=1;d=b/4}else d=b/(2*Math.PI)*Math.asin(1/a);return function(f){return 1+a*Math.pow(2,10*-f)*Math.sin((f-d)*2*Math.PI/b)}},back:function(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}},bounce:function(){return Aa}},Xa={"in":function(a){return a},out:ea,"in-out":fa,
  36
+"out-in":function(a){return fa(ea(a))}};d3.ease=function(a){var b=a.indexOf("-"),d=b>=0?a.substring(0,b):a;b=b>=0?a.substring(b+1):"in";return Xa[b](Wa[d].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,
  37
+b)};d3.interpolateNumber=function(a,b){b-=a;return function(d){return a+b*d}};d3.interpolateRound=function(a,b){b-=a;return function(d){return Math.round(a+b*d)}};d3.interpolateString=function(a,b){var d,f,e=0,c=[],i=[],h,g;for(f=0;d=$.exec(b);++f){d.index&&c.push(b.substring(e,d.index));i.push({i:c.length,x:d[0]});c.push(null);e=$.lastIndex}e<b.length&&c.push(b.substring(e));f=0;for(h=i.length;(d=$.exec(a))&&f<h;++f){g=i[f];if(g.x==d[0]){if(g.i)if(c[g.i+1]==null){c[g.i-1]+=g.x;c.splice(g.i,1);for(d=
  38
+f+1;d<h;++d)i[d].i--}else{c[g.i-1]+=g.x+c[g.i+1];c.splice(g.i,2);for(d=f+1;d<h;++d)i[d].i-=2}else if(c[g.i+1]==null)c[g.i]=g.x;else{c[g.i]=g.x+c[g.i+1];c.splice(g.i+1,1);for(d=f+1;d<h;++d)i[d].i--}i.splice(f,1);h--;f--}else g.x=d3.interpolateNumber(parseFloat(d[0]),parseFloat(g.x))}for(;f<h;){g=i.pop();if(c[g.i+1]==null)c[g.i]=g.x;else{c[g.i]=g.x+c[g.i+1];c.splice(g.i+1,1)}h--}if(c.length==1)return c[0]==null?i[0].x:function(){return b};return function(k){for(f=0;f<h;++f)c[(g=i[f]).i]=g.x(k);return c.join("")}};
  39
+d3.interpolateRgb=function(a,b){a=d3.rgb(a);b=d3.rgb(b);var d=a.r,f=a.g,e=a.b,c=b.r-d,i=b.g-f,h=b.b-e;return function(g){return"rgb("+Math.round(d+c*g)+","+Math.round(f+i*g)+","+Math.round(e+h*g)+")"}};d3.interpolateArray=function(a,b){var d=[],f=[],e=a.length,c=b.length,i=Math.min(a.length,b.length),h;for(h=0;h<i;++h)d.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)f[h]=a[h];for(;h<c;++h)f[h]=b[h];return function(g){for(h=0;h<i;++h)f[h]=d[h](g);return f}};d3.interpolateObject=function(a,b){var d={},
  40
+f={},e;for(e in a)if(e in b)d[e]=(e in Ya||/\bcolor\b/.test(e)?d3.interpolateRgb:d3.interpolate)(a[e],b[e]);else f[e]=a[e];for(e in b)e in a||(f[e]=b[e]);return function(c){for(e in d)f[e]=d[e](c);return f}};var $=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,Ya={background:1,fill:1,stroke:1};d3.rgb=function(a,b,d){return arguments.length==1?T(""+a,I,ga):I(~~a,~~b,~~d)};var G={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",
  41
+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",
  42
+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",
  43
+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",
  44
+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",
  45
+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",
  46
+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"},aa;for(aa in G)G[aa]=T(G[aa],I,ga);d3.hsl=function(a,b,d){return arguments.length==1?T(""+a,Ca,V):V(+a,+b,+d)};var D=function(a,b){return b.querySelector(a)},ha=function(a,b){return Q(b.querySelectorAll(a))};if(typeof Sizzle=="function"){D=function(a,
  47
+b){return Sizzle(a,b)[0]};ha=Sizzle}var M=y([[document]]);M[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?M.select(a):y([[a]])};d3.selectAll=function(a){return typeof a=="string"?M.selectAll(a):y([Q(a)])};d3.transition=M.transition;var Ga=0,X=0,F=null,Y=0,J;d3.scale={};d3.scale.linear=function(){function a(j){return k((j-d)*i)}function b(j){var o=Math.min(d,f),p=Math.max(d,f),m=p-o,n=Math.pow(10,Math.floor(Math.log(m/j)/Math.LN10));j=j/(m/n);if(j<=0.15)n*=
  48
+10;else if(j<=0.35)n*=5;else if(j<=0.75)n*=2;return{start:Math.ceil(o/n)*n,stop:Math.floor(p/n)*n+n*0.5,step:n}}var d=0,f=1,e=0,c=1,i=1/(f-d),h=(f-d)/(c-e),g=d3.interpolate,k=g(e,c);a.invert=function(j){return(j-e)*h+d};a.domain=function(j){if(!arguments.length)return[d,f];d=j[0];f=j[1];i=1/(f-d);h=(f-d)/(c-e);return a};a.range=function(j){if(!arguments.length)return[e,c];e=j[0];c=j[1];h=(f-d)/(c-e);k=g(e,c);return a};a.rangeRound=function(j){return a.range(j).interpolate(d3.interpolateRound)};a.interpolate=
  49
+function(j){if(!arguments.length)return g;k=(g=j)(e,c);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(c){return(e?-Math.log(-c):Math.log(c))/Math.LN10}function b(c){return e?-Math.pow(10,-c):Math.pow(10,c)}function d(c){return f(a(c))}var f=d3.scale.linear(),e=false;d.invert=function(c){return b(f.invert(c))};
  50
+d.domain=function(c){if(!arguments.length)return f.domain().map(b);e=(c[0]||c[1])<0;f.domain(c.map(a));return d};d.range=C(d,f.range);d.rangeRound=C(d,f.rangeRound);d.interpolate=C(d,f.interpolate);d.ticks=function(){var c=f.domain(),i=[];if(c.every(isFinite)){var h=Math.floor(c[0]),g=Math.ceil(c[1]),k=b(c[0]);c=b(c[1]);if(e)for(i.push(b(h));h++<g;)for(var j=9;j>0;j--)i.push(b(h)*j);else{for(;h<g;h++)for(j=1;j<10;j++)i.push(b(h)*j);i.push(b(h))}for(h=0;i[h]<k;h++);for(g=i.length;i[g-1]>c;g--);i=i.slice(h,
  51
+g)}return i};d.tickFormat=function(){return function(c){return c.toPrecision(1)}};return d};d3.scale.pow=function(){function a(g){return h?-Math.pow(-g,c):Math.pow(g,c)}function b(g){return h?-Math.pow(-g,i):Math.pow(g,i)}function d(g){return f(a(g))}var f=d3.scale.linear(),e=d3.scale.linear(),c=1,i=1/c,h=false;d.invert=function(g){return b(f.invert(g))};d.domain=function(g){if(!arguments.length)return f.domain().map(b);h=(g[0]||g[1])<0;f.domain(g.map(a));e.domain(g);return d};d.range=C(d,f.range);
  52
+d.rangeRound=C(d,f.rangeRound);d.inteprolate=C(d,f.interpolate);d.ticks=e.ticks;d.tickFormat=e.tickFormat;d.exponent=function(g){if(!arguments.length)return c;var k=d.domain();c=g;i=1/g;return d.domain(k)};return d};d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){function a(c){c=c in d?d[c]:d[c]=b.push(c)-1;return f[c%f.length]}var b=[],d={},f=[],e=0;a.domain=function(c){if(!arguments.length)return b;b=c;d={};for(var i=-1,h=-1,g=b.length;++i<g;){c=b[i];c in
  53
+d||(d[c]=++h)}return a};a.range=function(c){if(!arguments.length)return f;f=c;return a};a.rangePoints=function(c,i){if(arguments.length<2)i=0;var h=c[0],g=c[1],k=(g-h)/(b.length-1+i);f=b.length==1?[(h+g)/2]:d3.range(h+k*i/2,g+k/2,k);e=0;return a};a.rangeBands=function(c,i){if(arguments.length<2)i=0;var h=c[0],g=c[1],k=(g-h)/(b.length+i);f=d3.range(h+k*i,g,k);e=k*(1-i);return a};a.rangeRoundBands=function(c,i){if(arguments.length<2)i=0;var h=c[0],g=c[1],k=g-h,j=Math.floor(k/(b.length+i));f=d3.range(h+
  54
+Math.round((k-(b.length-i)*j)/2),g,j);e=Math.round(j*(1-i));return a};a.rangeBand=function(){return e};return a};d3.scale.category10=function(){return d3.scale.ordinal().range(Za)};d3.scale.category20=function(){return d3.scale.ordinal().range($a)};d3.scale.category20b=function(){return d3.scale.ordinal().range(ab)};d3.scale.category20c=function(){return d3.scale.ordinal().range(bb)};var Za=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],$a=["#1f77b4",
  55
+"#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],ab=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bb=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b",
  56
+"#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function a(){for(var i=-1,h=c.length=e.length,g=f.length/h;++i<h;)c[i]=f[~~(i*g)]}function b(i){if(isNaN(i=+i))return NaN;for(var h=0,g=c.length-1;h<=g;){var k=h+g>>1,j=c[k];if(j<i)h=k+1;else if(j>i)g=k-1;else return k}return g<0?0:g}function d(i){return e[b(i)]}var f=[],e=[],c=[];d.domain=function(i){if(!arguments.length)return f;f=i.filter(function(h){return!isNaN(h)}).sort(d3.ascending);
  57
+a();return d};d.range=function(i){if(!arguments.length)return e;e=i;a();return d};d.quantiles=function(){return c};return d};d3.scale.quantize=function(){function a(i){return c[Math.max(0,Math.min(e,Math.floor(f*(i-b))))]}var b=0,d=1,f=2,e=1,c=[0,1];a.domain=function(i){if(!arguments.length)return[b,d];b=i[0];d=i[1];f=c.length/(d-b);return a};a.range=function(i){if(!arguments.length)return c;c=i;f=c.length/(d-b);e=c.length-1;return a};return a};d3.svg={};d3.svg.arc=function(){function a(c,i){var h=
  58
+b.call(this,c,i),g=d.call(this,c,i),k=f.call(this,c,i)+N,j=e.call(this,c,i)+N,o=j-k,p=o<Math.PI?"0":"1",m=Math.cos(k);k=Math.sin(k);var n=Math.cos(j);j=Math.sin(j);return o>=cb?h?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+h+"A"+h+","+h+" 0 1,1 0,"+-h+"A"+h+","+h+" 0 1,1 0,"+h+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":h?"M"+g*m+","+g*k+"A"+g+","+g+" 0 "+p+",1 "+g*n+","+g*j+"L"+h*n+","+h*j+"A"+h+","+h+" 0 "+p+",0 "+h*m+","+h*k+"Z":"M"+g*m+","+g*k+"A"+
  59
+g+","+g+" 0 "+p+",1 "+g*n+","+g*j+"L0,0Z"}var b=Ka,d=La,f=ja,e=ka;a.innerRadius=function(c){if(!arguments.length)return b;b=v(c);return a};a.outerRadius=function(c){if(!arguments.length)return d;d=v(c);return a};a.startAngle=function(c){if(!arguments.length)return f;f=v(c);return a};a.endAngle=function(c){if(!arguments.length)return e;e=v(c);return a};return a};var N=-Math.PI/2,cb=2*Math.PI-1.0E-6;d3.svg.line=function(){function a(i){return i.length<1?null:"M"+e(Z(this,i,b,d),c)}var b=la,d=ma,f="linear",
  60
+e=O[f],c=0.7;a.x=function(i){if(!arguments.length)return b;b=i;return a};a.y=function(i){if(!arguments.length)return d;d=i;return a};a.interpolate=function(i){if(!arguments.length)return f;e=O[f=i];return a};a.tension=function(i){if(!arguments.length)return c;c=i;return a};return a};var O={linear:H,basis:function(a){if(a.length<3)return H(a);var b=[],d=1,f=a.length,e=a[0],c=e[0],i=e[1],h=[c,c,c,(e=a[1])[0]],g=[i,i,i,e[1]];b.push(c,",",i);for(K(b,h,g);++d<f;){e=a[d];h.shift();h.push(e[0]);g.shift();
  61
+g.push(e[1]);K(b,h,g)}for(d=-1;++d<2;){h.shift();h.push(e[0]);g.shift();g.push(e[1]);K(b,h,g)}return b.join("")},"basis-closed":function(a){for(var b,d=-1,f=a.length,e=f+4,c,i=[],h=[];++d<4;){c=a[d%f];i.push(c[0]);h.push(c[1])}b=[B(L,i),",",B(L,h)];for(--d;++d<e;){c=a[d%f];i.shift();i.push(c[0]);h.shift();h.push(c[1]);K(b,i,h)}return b.join("")},cardinal:function(a,b){if(a.length<3)return H(a);return a[0]+na(a,oa(a,b))},"cardinal-closed":function(a,b){if(a.length<3)return H(a);return a[0]+na(a,oa([a[a.length-
  62
+2]].concat(a,[a[1]]),b))}},pa=[0,2/3,1/3,0],qa=[0,1/3,2/3,0],L=[0,1/6,2/3,1/6];d3.svg.area=function(){function a(h){return h.length<1?null:"M"+c(Z(this,h,b,f),i)+"L"+c(Z(this,h,b,d).reverse(),i)+"Z"}var b=la,d=Ma,f=ma,e="linear",c=O[e],i=0.7;a.x=function(h){if(!arguments.length)return b;b=h;return a};a.y0=function(h){if(!arguments.length)return d;d=h;return a};a.y1=function(h){if(!arguments.length)return f;f=h;return a};a.interpolate=function(h){if(!arguments.length)return e;c=O[e=h];return a};a.tension=
  63
+function(h){if(!arguments.length)return i;i=h;return a};return a};d3.svg.chord=function(){function a(h,g){var k=b(this,d,h,g),j=b(this,f,h,g);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,g,k,j){var o=g.call(h,k,j);g=e.call(h,o,j);k=c.call(h,o,j)+N;h=i.call(h,o,j)+N;return{r:g,a0:k,a1:h,p0:[g*Math.cos(k),g*Math.sin(k)],p1:[g*Math.cos(h),g*Math.sin(h)]}}var d=Na,f=Oa,e=Pa,c=ja,i=
  64
+ka;a.radius=function(h){if(!arguments.length)return e;e=v(h);return a};a.source=function(h){if(!arguments.length)return d;d=v(h);return a};a.target=function(h){if(!arguments.length)return f;f=v(h);return a};a.startAngle=function(h){if(!arguments.length)return c;c=v(h);return a};a.endAngle=function(h){if(!arguments.length)return i;i=v(h);return a};return a};d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(ba<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position",
  65
+"absolute").style("top",0).style("left",0),f=d[0][0].getScreenCTM();ba=!(f.f||f.e);d.remove()}if(ba){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 ba=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function a(f,e){return(sa[b.call(this,f,e)]||sa.circle)(d.call(this,f,e))}var b=Ra,d=Qa;a.type=function(f){if(!arguments.length)return b;b=v(f);return a};a.size=function(f){if(!arguments.length)return d;
  66
+d=v(f);return a};return a};d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var sa={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*ta));var b=a*ta;return"M0,"+-a+"L"+b+",0 0,"+a+" "+-b+",0Z"},square:function(a){a=Math.sqrt(a)/
  67
+2;return"M"+-a+","+-a+"L"+a+","+-a+" "+a+","+a+" "+-a+","+a+"Z"},"triangle-down":function(a){a=Math.sqrt(a/P);var b=a*P/2;return"M0,"+b+"L"+a+","+-b+" "+-a+","+-b+"Z"},"triangle-up":function(a){a=Math.sqrt(a/P);var b=a*P/2;return"M0,"+-b+"L"+a+","+b+" "+-a+","+b+"Z"}},P=Math.sqrt(3),ta=Math.tan(30*Math.PI/180)})();
27  examples/sizzle/sizzle.html
... ...
@@ -0,0 +1,27 @@
  1
+<!DOCTYPE html>
  2
+<html>
  3
+  <head>
  4
+    <title>Sizzle</title>
  5
+    <script type="text/javascript" src="../../lib/sizzle/sizzle.js"></script>
  6
+    <script type="text/javascript" src="../../d3.js"></script>
  7
+    <style type="text/css">
  8
+
  9
+body {
  10
+  margin: 2em;
  11
+  text-align: center;
  12
+  font: 300 36px helvetica neue;
  13
+}
  14
+
  15
+    </style>
  16
+  </head>
  17
+  <body>
  18
+    Sizzle.js disabled.
  19
+    <script type="text/javascript">
  20
+
  21
+// The :first psuedo-class is a custom Sizzle extension.
  22
+d3.select("body:first")
  23
+    .html("Sizzle.js enabled!");
  24
+
  25
+    </script>
  26
+  </body>
  27
+</html>
1  examples/stream/stack.html
@@ -2,6 +2,7 @@
2 2
 <html>
3 3
   <head>
4 4
     <title>Stacked Bar Chart</title>
  5
+    <script type="text/javascript" src="../../lib/sizzle/sizzle.js"></script>
5 6
     <script type="text/javascript" src="../../d3.js"></script>
6 7
     <script type="text/javascript" src="../../d3.layout.js"></script>
7 8
     <script type="text/javascript" src="stream.js"></script>
6,883  lib/jquery/jquery.js
6883 additions, 0 deletions not shown
24  lib/sizzle/LICENSE
... ...
@@ -0,0 +1,24 @@
  1
+Copyright (c) 2009, John Resig
  2
+All rights reserved.
  3
+
  4
+Redistribution and use in source and binary forms, with or without
  5
+modification, are permitted provided that the following conditions are met:
  6
+    * Redistributions of source code must retain the above copyright
  7
+      notice, this list of conditions and the following disclaimer.
  8
+    * Redistributions in binary form must reproduce the above copyright
  9
+      notice, this list of conditions and the following disclaimer in the
  10
+      documentation and/or other materials provided with the distribution.
  11
+    * Neither the name of the <organization> nor the
  12
+      names of its contributors may be used to endorse or promote products
  13
+      derived from this software without specific prior written permission.
  14
+
  15
+THIS SOFTWARE IS PROVIDED BY John Resig ''AS IS'' AND ANY
  16
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18
+DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
  19
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  22
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1,376  lib/sizzle/sizzle.js
... ...
@@ -0,0 +1,1376 @@
  1
+/*!
  2
+ * Sizzle CSS Selector Engine
  3
+ *  Copyright 2011, The Dojo Foundation
  4
+ *  Released under the MIT, BSD, and GPL Licenses.
  5
+ *  More information: http://sizzlejs.com/
  6
+ */
  7
+(function(){
  8
+
  9
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  10
+	done = 0,
  11
+	toString = Object.prototype.toString,
  12
+	hasDuplicate = false,
  13
+	baseHasDuplicate = true;
  14
+
  15
+// Here we check if the JavaScript engine is using some sort of
  16
+// optimization where it does not always call our comparision
  17
+// function. If that is the case, discard the hasDuplicate value.
  18
+//   Thus far that includes Google Chrome.
  19
+[0, 0].sort(function() {
  20
+	baseHasDuplicate = false;
  21
+	return 0;
  22
+});
  23
+
  24
+var Sizzle = function( selector, context, results, seed ) {
  25
+	results = results || [];
  26
+	context = context || document;
  27
+
  28
+	var origContext = context;
  29
+
  30
+	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
  31
+		return [];
  32
+	}
  33
+	
  34
+	if ( !selector || typeof selector !== "string" ) {
  35
+		return results;
  36
+	}
  37
+
  38
+	var m, set, checkSet, extra, ret, cur, pop, i,
  39
+		prune = true,
  40
+		contextXML = Sizzle.isXML( context ),
  41
+		parts = [],
  42
+		soFar = selector;
  43
+	
  44
+	// Reset the position of the chunker regexp (start from head)
  45
+	do {
  46
+		chunker.exec( "" );
  47
+		m = chunker.exec( soFar );
  48
+
  49
+		if ( m ) {
  50
+			soFar = m[3];
  51
+		
  52
+			parts.push( m[1] );
  53
+		
  54
+			if ( m[2] ) {
  55
+				extra = m[3];
  56
+				break;
  57
+			}
  58
+		}
  59
+	} while ( m );
  60
+
  61
+	if ( parts.length > 1 && origPOS.exec( selector ) ) {
  62
+
  63
+		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
  64
+			set = posProcess( parts[0] + parts[1], context );
  65
+
  66
+		} else {
  67
+			set = Expr.relative[ parts[0] ] ?
  68
+				[ context ] :
  69
+				Sizzle( parts.shift(), context );
  70
+
  71
+			while ( parts.length ) {
  72
+				selector = parts.shift();
  73
+
  74
+				if ( Expr.relative[ selector ] ) {
  75
+					selector += parts.shift();
  76
+				}
  77
+				
  78
+				set = posProcess( selector, set );
  79
+			}
  80
+		}
  81
+
  82
+	} else {
  83
+		// Take a shortcut and set the context if the root selector is an ID
  84
+		// (but not if it'll be faster if the inner selector is an ID)
  85
+		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
  86
+				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
  87
+
  88
+			ret = Sizzle.find( parts.shift(), context, contextXML );
  89
+			context = ret.expr ?
  90
+				Sizzle.filter( ret.expr, ret.set )[0] :
  91
+				ret.set[0];
  92
+		}
  93
+
  94
+		if ( context ) {
  95
+			ret = seed ?
  96
+				{ expr: parts.pop(), set: makeArray(seed) } :
  97
+				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
  98
+
  99
+			set = ret.expr ?
  100
+				Sizzle.filter( ret.expr, ret.set ) :
  101
+				ret.set;
  102
+
  103
+			if ( parts.length > 0 ) {
  104
+				checkSet = makeArray( set );
  105
+
  106
+			} else {
  107
+				prune = false;
  108
+			}
  109
+
  110
+			while ( parts.length ) {
  111
+				cur = parts.pop();
  112
+				pop = cur;
  113
+
  114
+				if ( !Expr.relative[ cur ] ) {
  115
+					cur = "";
  116
+				} else {
  117
+					pop = parts.pop();
  118
+				}
  119
+
  120
+				if ( pop == null ) {
  121
+					pop = context;
  122
+				}
  123
+
  124
+				Expr.relative[ cur ]( checkSet, pop, contextXML );
  125
+			}
  126
+
  127
+		} else {
  128
+			checkSet = parts = [];
  129
+		}
  130
+	}
  131
+
  132
+	if ( !checkSet ) {
  133
+		checkSet = set;
  134
+	}
  135
+
  136
+	if ( !checkSet ) {
  137
+		Sizzle.error( cur || selector );
  138
+	}
  139
+
  140
+	if ( toString.call(checkSet) === "[object Array]" ) {
  141
+		if ( !prune ) {
  142
+			results.push.apply( results, checkSet );
  143
+
  144
+		} else if ( context && context.nodeType === 1 ) {
  145
+			for ( i = 0; checkSet[i] != null; i++ ) {
  146
+				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
  147
+					results.push( set[i] );
  148
+				}
  149
+			}
  150
+
  151
+		} else {
  152
+			for ( i = 0; checkSet[i] != null; i++ ) {
  153
+				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
  154
+					results.push( set[i] );
  155
+				}
  156
+			}
  157
+		}
  158
+
  159
+	} else {
  160
+		makeArray( checkSet, results );
  161
+	}
  162
+
  163
+	if ( extra ) {
  164
+		Sizzle( extra, origContext, results, seed );
  165
+		Sizzle.uniqueSort( results );
  166
+	}
  167
+
  168
+	return results;
  169
+};
  170
+
  171
+Sizzle.uniqueSort = function( results ) {
  172
+	if ( sortOrder ) {
  173
+		hasDuplicate = baseHasDuplicate;
  174
+		results.sort( sortOrder );
  175
+
  176
+		if ( hasDuplicate ) {
  177
+			for ( var i = 1; i < results.length; i++ ) {
  178
+				if ( results[i] === results[ i - 1 ] ) {
  179
+					results.splice( i--, 1 );
  180
+				}
  181
+			}
  182
+		}
  183
+	}
  184
+
  185
+	return results;
  186
+};
  187
+
  188
+Sizzle.matches = function( expr, set ) {
  189
+	return Sizzle( expr, null, null, set );
  190
+};
  191
+
  192
+Sizzle.matchesSelector = function( node, expr ) {
  193
+	return Sizzle( expr, null, null, [node] ).length > 0;
  194
+};
  195
+
  196
+Sizzle.find = function( expr, context, isXML ) {
  197
+	var set;
  198
+
  199
+	if ( !expr ) {
  200
+		return [];
  201
+	}
  202
+
  203
+	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
  204
+		var match,
  205
+			type = Expr.order[i];
  206
+		
  207
+		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
  208
+			var left = match[1];
  209
+			match.splice( 1, 1 );
  210
+
  211
+			if ( left.substr( left.length - 1 ) !== "\\" ) {
  212
+				match[1] = (match[1] || "").replace(/\\/g, "");
  213
+				set = Expr.find[ type ]( match, context, isXML );
  214
+
  215
+				if ( set != null ) {
  216
+					expr = expr.replace( Expr.match[ type ], "" );
  217
+					break;
  218
+				}
  219
+			}
  220
+		}
  221
+	}
  222
+
  223
+	if ( !set ) {
  224
+		set = typeof context.getElementsByTagName !== "undefined" ?
  225
+			context.getElementsByTagName( "*" ) :
  226
+			[];
  227
+	}
  228
+
  229
+	return { set: set, expr: expr };
  230
+};
  231
+
  232
+Sizzle.filter = function( expr, set, inplace, not ) {
  233
+	var match, anyFound,
  234
+		old = expr,
  235
+		result = [],
  236
+		curLoop = set,
  237
+		isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
  238
+
  239
+	while ( expr && set.length ) {
  240
+		for ( var type in Expr.filter ) {
  241
+			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
  242
+				var found, item,
  243
+					filter = Expr.filter[ type ],
  244
+					left = match[1];
  245
+
  246
+				anyFound = false;
  247
+
  248
+				match.splice(1,1);
  249
+
  250
+				if ( left.substr( left.length - 1 ) === "\\" ) {
  251
+					continue;
  252
+				}
  253
+
  254
+				if ( curLoop === result ) {
  255
+					result = [];
  256
+				}
  257
+
  258
+				if ( Expr.preFilter[ type ] ) {
  259
+					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
  260
+
  261
+					if ( !match ) {
  262
+						anyFound = found = true;
  263
+
  264
+					} else if ( match === true ) {
  265
+						continue;
  266
+					}
  267
+				}
  268
+
  269
+				if ( match ) {
  270
+					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
  271
+						if ( item ) {
  272
+							found = filter( item, match, i, curLoop );
  273
+							var pass = not ^ !!found;
  274
+
  275
+							if ( inplace && found != null ) {
  276
+								if ( pass ) {
  277
+									anyFound = true;
  278
+
  279
+								} else {
  280
+									curLoop[i] = false;
  281
+								}
  282
+
  283
+							} else if ( pass ) {
  284
+								result.push( item );
  285
+								anyFound = true;
  286
+							}
  287
+						}
  288
+					}
  289
+				}
  290
+
  291
+				if ( found !== undefined ) {
  292
+					if ( !inplace ) {
  293
+						curLoop = result;
  294
+					}
  295
+
  296
+					expr = expr.replace( Expr.match[ type ], "" );
  297
+
  298
+					if ( !anyFound ) {
  299
+						return [];
  300
+					}
  301
+
  302
+					break;
  303
+				}
  304
+			}
  305
+		}
  306
+
  307
+		// Improper expression
  308
+		if ( expr === old ) {
  309
+			if ( anyFound == null ) {
  310
+				Sizzle.error( expr );
  311
+
  312
+			} else {
  313
+				break;
  314
+			}
  315
+		}
  316
+
  317
+		old = expr;
  318
+	}
  319
+
  320
+	return curLoop;
  321
+};
  322
+
  323
+Sizzle.error = function( msg ) {
  324
+	throw "Syntax error, unrecognized expression: " + msg;
  325
+};
  326
+
  327
+var Expr = Sizzle.selectors = {
  328
+	order: [ "ID", "NAME", "TAG" ],
  329
+
  330
+	match: {
  331
+		ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  332
+		CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  333
+		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
  334
+		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
  335
+		TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
  336
+		CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
  337
+		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
  338
+		PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
  339
+	},
  340
+
  341
+	leftMatch: {},
  342
+
  343
+	attrMap: {
  344
+		"class": "className",
  345
+		"for": "htmlFor"
  346
+	},
  347
+
  348
+	attrHandle: {
  349
+		href: function( elem ) {
  350
+			return elem.getAttribute( "href" );
  351
+		}
  352
+	},
  353
+
  354
+	relative: {
  355
+		"+": function(checkSet, part){
  356
+			var isPartStr = typeof part === "string",
  357
+				isTag = isPartStr && !/\W/.test( part ),
  358
+				isPartStrNotTag = isPartStr && !isTag;
  359
+
  360
+			if ( isTag ) {
  361
+				part = part.toLowerCase();
  362
+			}
  363
+
  364
+			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
  365
+				if ( (elem = checkSet[i]) ) {
  366
+					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
  367
+
  368
+					checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
  369
+						elem || false :
  370
+						elem === part;
  371
+				}
  372
+			}
  373
+
  374
+			if ( isPartStrNotTag ) {
  375
+				Sizzle.filter( part, checkSet, true );
  376
+			}
  377
+		},
  378
+
  379
+		">": function( checkSet, part ) {
  380
+			var elem,
  381
+				isPartStr = typeof part === "string",
  382
+				i = 0,
  383
+				l = checkSet.length;
  384
+
  385
+			if ( isPartStr && !/\W/.test( part ) ) {
  386
+				part = part.toLowerCase();
  387
+
  388
+				for ( ; i < l; i++ ) {
  389
+					elem = checkSet[i];
  390
+
  391
+					if ( elem ) {
  392
+						var parent = elem.parentNode;
  393
+						checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
  394
+					}
  395
+				}
  396
+
  397
+			} else {
  398
+				for ( ; i < l; i++ ) {
  399
+					elem = checkSet[i];
  400
+
  401
+					if ( elem ) {
  402
+						checkSet[i] = isPartStr ?
  403
+							elem.parentNode :
  404
+							elem.parentNode === part;
  405
+					}
  406
+				}
  407
+
  408
+				if ( isPartStr ) {
  409
+					Sizzle.filter( part, checkSet, true );
  410
+				}
  411
+			}
  412
+		},
  413
+
  414
+		"": function(checkSet, part, isXML){
  415
+			var nodeCheck,
  416
+				doneName = done++,
  417
+				checkFn = dirCheck;
  418
+
  419
+			if ( typeof part === "string" && !/\W/.test(part) ) {
  420
+				part = part.toLowerCase();
  421
+				nodeCheck = part;
  422
+				checkFn = dirNodeCheck;
  423
+			}
  424
+
  425
+			checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
  426
+		},
  427
+
  428
+		"~": function( checkSet, part, isXML ) {
  429
+			var nodeCheck,
  430
+				doneName = done++,
  431
+				checkFn = dirCheck;
  432
+
  433
+			if ( typeof part === "string" && !/\W/.test( part ) ) {
  434
+				part = part.toLowerCase();
  435
+				nodeCheck = part;
  436
+				checkFn = dirNodeCheck;
  437
+			}
  438
+
  439
+			checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
  440
+		}
  441
+	},
  442
+
  443
+	find: {
  444
+		ID: function( match, context, isXML ) {
  445
+			if ( typeof context.getElementById !== "undefined" && !isXML ) {
  446
+				var m = context.getElementById(match[1]);
  447
+				// Check parentNode to catch when Blackberry 4.6 returns
  448
+				// nodes that are no longer in the document #6963
  449
+				return m && m.parentNode ? [m] : [];
  450
+			}
  451
+		},
  452
+
  453
+		NAME: function( match, context ) {
  454
+			if ( typeof context.getElementsByName !== "undefined" ) {
  455
+				var ret = [],
  456
+					results = context.getElementsByName( match[1] );
  457
+
  458
+				for ( var i = 0, l = results.length; i < l; i++ ) {
  459
+					if ( results[i].getAttribute("name") === match[1] ) {
  460
+						ret.push( results[i] );
  461
+					}
  462
+				}
  463
+
  464
+				return ret.length === 0 ? null : ret;
  465
+			}
  466
+		},
  467
+
  468
+		TAG: function( match, context ) {
  469
+			if ( typeof context.getElementsByTagName !== "undefined" ) {
  470
+				return context.getElementsByTagName( match[1] );
  471
+			}
  472
+		}
  473
+	},
  474
+	preFilter: {
  475
+		CLASS: function( match, curLoop, inplace, result, not, isXML ) {
  476
+			match = " " + match[1].replace(/\\/g, "") + " ";
  477
+
  478
+			if ( isXML ) {
  479
+				return match;
  480
+			}
  481
+
  482
+			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
  483
+				if ( elem ) {
  484
+					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
  485
+						if ( !inplace ) {
  486
+							result.push( elem );
  487
+						}
  488
+
  489
+					} else if ( inplace ) {
  490
+						curLoop[i] = false;
  491
+					}
  492
+				}
  493
+			}
  494
+
  495
+			return false;
  496
+		},
  497
+
  498
+		ID: function( match ) {
  499
+			return match[1].replace(/\\/g, "");
  500
+		},
  501
+
  502
+		TAG: function( match, curLoop ) {
  503
+			return match[1].toLowerCase();
  504
+		},
  505
+
  506
+		CHILD: function( match ) {
  507
+			if ( match[1] === "nth" ) {
  508
+				if ( !match[2] ) {
  509
+					Sizzle.error( match[0] );
  510
+				}
  511
+
  512
+				match[2] = match[2].replace(/^\+|\s*/g, '');
  513
+
  514
+				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
  515
+				var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
  516
+					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
  517
+					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
  518
+
  519
+				// calculate the numbers (first)n+(last) including if they are negative
  520
+				match[2] = (test[1] + (test[2] || 1)) - 0;
  521
+				match[3] = test[3] - 0;
  522
+			}
  523
+			else if ( match[2] ) {
  524
+				Sizzle.error( match[0] );
  525
+			}
  526
+
  527
+			// TODO: Move to normal caching system
  528
+			match[0] = done++;
  529
+
  530
+			return match;
  531
+		},
  532
+
  533
+		ATTR: function( match, curLoop, inplace, result, not, isXML ) {
  534
+			var name = match[1] = match[1].replace(/\\/g, "");
  535
+			
  536
+			if ( !isXML && Expr.attrMap[name] ) {
  537
+				match[1] = Expr.attrMap[name];
  538
+			}
  539
+
  540
+			// Handle if an un-quoted value was used
  541
+			match[4] = ( match[4] || match[5] || "" ).replace(/\\/g, "");
  542
+
  543
+			if ( match[2] === "~=" ) {
  544
+				match[4] = " " + match[4] + " ";
  545
+			}
  546
+
  547
+			return match;
  548
+		},
  549
+
  550
+		PSEUDO: function( match, curLoop, inplace, result, not ) {
  551
+			if ( match[1] === "not" ) {
  552
+				// If we're dealing with a complex expression, or a simple one
  553
+				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
  554
+					match[3] = Sizzle(match[3], null, null, curLoop);
  555
+
  556
+				} else {
  557
+					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
  558
+
  559
+					if ( !inplace ) {
  560
+						result.push.apply( result, ret );
  561
+					}
  562
+
  563
+					return false;
  564
+				}
  565
+
  566
+			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
  567
+				return true;
  568
+			}
  569
+			
  570
+			return match;
  571
+		},
  572
+
  573
+		POS: function( match ) {
  574
+			match.unshift( true );
  575
+
  576
+			return match;
  577
+		}
  578
+	},
  579
+	
  580
+	filters: {
  581
+		enabled: function( elem ) {
  582
+			return elem.disabled === false && elem.type !== "hidden";
  583
+		},
  584
+
  585
+		disabled: function( elem ) {
  586
+			return elem.disabled === true;
  587
+		},
  588
+
  589
+		checked: function( elem ) {
  590
+			return elem.checked === true;
  591
+		},
  592
+		
  593
+		selected: function( elem ) {
  594
+			// Accessing this property makes selected-by-default
  595
+			// options in Safari work properly
  596
+			elem.parentNode.selectedIndex;
  597
+			
  598
+			return elem.selected === true;
  599
+		},
  600
+
  601
+		parent: function( elem ) {
  602
+			return !!elem.firstChild;
  603
+		},
  604
+
  605
+		empty: function( elem ) {
  606
+			return !elem.firstChild;
  607
+		},
  608
+
  609
+		has: function( elem, i, match ) {
  610
+			return !!Sizzle( match[3], elem ).length;
  611
+		},
  612
+
  613
+		header: function( elem ) {
  614
+			return (/h\d/i).test( elem.nodeName );
  615
+		},
  616
+
  617
+		text: function( elem ) {
  618
+			return "text" === elem.type;
  619
+		},
  620
+		radio: function( elem ) {
  621
+			return "radio" === elem.type;
  622
+		},
  623
+
  624
+		checkbox: function( elem ) {
  625
+			return "checkbox" === elem.type;
  626
+		},
  627
+
  628
+		file: function( elem ) {
  629
+			return "file" === elem.type;
  630
+		},
  631
+		password: function( elem ) {
  632
+			return "password" === elem.type;
  633
+		},
  634
+
  635
+		submit: function( elem ) {
  636
+			return "submit" === elem.type;
  637
+		},
  638
+
  639
+		image: function( elem ) {
  640
+			return "image" === elem.type;
  641
+		},
  642
+
  643
+		reset: function( elem ) {
  644
+			return "reset" === elem.type;
  645
+		},
  646
+
  647
+		button: function( elem ) {
  648
+			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
  649
+		},
  650
+
  651
+		input: function( elem ) {
  652
+			return (/input|select|textarea|button/i).test( elem.nodeName );
  653
+		}
  654
+	},
  655
+	setFilters: {
  656
+		first: function( elem, i ) {
  657
+			return i === 0;
  658
+		},
  659
+
  660
+		last: function( elem, i, match, array ) {
  661
+			return i === array.length - 1;
  662
+		},
  663
+
  664
+		even: function( elem, i ) {
  665
+			return i % 2 === 0;
  666
+		},
  667
+
  668
+		odd: function( elem, i ) {
  669
+			return i % 2 === 1;
  670
+		},
  671
+
  672
+		lt: function( elem, i, match ) {
  673
+			return i < match[3] - 0;
  674
+		},
  675
+
  676
+		gt: function( elem, i, match ) {
  677
+			return i > match[3] - 0;
  678
+		},
  679
+
  680
+		nth: function( elem, i, match ) {
  681
+			return match[3] - 0 === i;
  682
+		},
  683
+
  684
+		eq: function( elem, i, match ) {