This commit is contained in:
Michael Bostock 2010-11-09 14:42:31 -08:00
Родитель fbdad9ca73
Коммит d21a500ea8
4 изменённых файлов: 12 добавлений и 12 удалений

4
d3.js поставляемый
Просмотреть файл

@ -1,4 +1,4 @@
d3 = {version: "0.15.2"}; // semver
d3 = {version: "0.15.3"}; // semver
if (!Date.now) Date.now = function() {
return +new Date();
};
@ -1295,7 +1295,7 @@ function d3_transition(groups) {
function styleTween(d, i) {
var f = tween.call(this, d, i, window.getComputedStyle(this, null).getPropertyValue(name));
return function(t) {
this.style.setProperty(name, i(t), priority);
this.style.setProperty(name, f(t), priority);
};
}

16
d3.min.js поставляемый
Просмотреть файл

@ -1,4 +1,4 @@
(function(){var p=null;d3={version:"0.15.2"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function d(){}d.prototype=a;return new d};function t(a){return Array.prototype.slice.call(a)}function B(a,d){d=t(arguments);d[0]=this;a.apply(this,d);return this}d3.range=function(a,d,e){if(arguments.length==1){d=a;a=0}if(e==p)e=1;if((d-a)/e==Infinity)throw Error("infinite range");var f=[],c=-1,b;if(e<0)for(;(b=a+e*++c)>d;)f.push(b);else for(;(b=a+e*++c)<d;)f.push(b);return f};
(function(){var p=null;d3={version:"0.15.3"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function d(){}d.prototype=a;return new d};function u(a){return Array.prototype.slice.call(a)}function B(a,d){d=u(arguments);d[0]=this;a.apply(this,d);return this}d3.range=function(a,d,e){if(arguments.length==1){d=a;a=0}if(e==p)e=1;if((d-a)/e==Infinity)throw Error("infinite range");var f=[],c=-1,b;if(e<0)for(;(b=a+e*++c)>d;)f.push(b);else for(;(b=a+e*++c)<d;)f.push(b);return f};
d3.text=function(a,d,e){var f=new XMLHttpRequest;if(arguments.length==3)f.overrideMimeType(d);else e=d;f.open("GET",a,true);f.onreadystatechange=function(){if(f.readyState==4)e(f.status<300&&f.responseText?f.responseText:p)};f.send(p)};d3.json=function(a,d){return d3.text(a,"application/json",function(e){d(e&&JSON.parse(e))})};
d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var d=a.indexOf(":");return d<0?a:{space:d3.ns.prefix[a.substring(0,d)],local:a.substring(d+1)}}};d3.dispatch=function(){for(var a={},d,e=0,f=arguments.length;e<f;e++){d=arguments[e];a[d]=D(d)}return a};
function D(){var a={},d=[];a.add=function(e){for(var f=0;f<d.length;f++)if(d[f].h==e)return a;d.push({h:e,on:true});return a};a.remove=function(e){for(var f=0;f<d.length;f++){var c=d[f];if(c.h==e){c.on=false;d=d.slice(0,f).concat(d.slice(f+1));break}}return a};a.dispatch=function(){for(var e=d,f=0,c=e.length;f<c;f++){var b=e[f];b.on&&b.h.apply(this,arguments)}};return a}
@ -19,11 +19,11 @@ ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#0
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},S;for(S in N)N[S]=P(N[S]);d3.hsl=function(a,d,e){a=Q(a,d,e);return"rgb("+a.d+","+a.c+","+a.b+")"};var U=T([[document]]);
U[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?U.select(a):T([[a]])};d3.selectAll=function(a){return typeof a=="string"?U.selectAll(a):T([t(a)])};
U[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?U.select(a):T([[a]])};d3.selectAll=function(a){return typeof a=="string"?U.selectAll(a):T([u(a)])};
function T(a){function d(c){for(var b=[],h,g,i,j,o=0,k=a.length;o<k;o++){i=a[o];b.push(h=[]);h.parentNode=i.parentNode;h.parentData=i.parentData;for(var l=0,n=i.length;l<n;l++)if(j=i[l]){h.push(g=c(j));if(g&&!g.__data__)g.__data__=j.__data__}else h.push(p)}return T(b)}function e(c){for(var b=[],h,g,i,j=0,o=a.length;j<o;j++){g=a[j];for(var k=0,l=g.length;k<l;k++)if(i=g[k]){b.push(h=c(i));h.parentNode=i;h.parentData=i.__data__}}return T(b)}function f(c){for(var b=0,h=a.length;b<h;b++)for(var g=a[b],
i=0,j=g.length;i<j;i++){var o=g[i];if(o)return c.call(o,o.__data__,i)}return p}a.select=function(c){return d(function(b){return b.querySelector(c)})};a.selectAll=function(c){return e(function(b){return t(b.querySelectorAll(c))})};a.filter=function(c){for(var b=[],h,g,i,j=0,o=a.length;j<o;j++){g=a[j];b.push(h=[]);h.parentNode=g.parentNode;h.parentData=g.parentData;for(var k=0,l=g.length;k<l;k++)if((i=g[k])&&c.call(i,i.__data__,k))h.push(i)}return T(b)};a.data=function(c,b){function h(n,q){function r(ia){return n.parentNode.appendChild(ia)}
var m=0,x=n.length,y=q.length,A=Math.min(x,y),F=Math.max(x,y),u=[],v=[],s=[],w,z;if(b){A={};F=[];var C;z=q.length;for(m=0;m<x;m++){C=b.nodeKey(w=n[m]);if(C in A)s[z++]=n[m];else{A[C]=w;F.push(C)}}for(m=0;m<y;m++){if(w=A[C=b.dataKey(z=q[m])]){w.__data__=z;u[m]=w;v[m]=s[m]=p}else{v[m]={appendChild:r,__data__:z};u[m]=s[m]=p}delete A[C]}for(m=0;m<x;m++)if(F[m]in A)s[m]=n[m]}else{for(;m<A;m++){w=n[m];z=q[m];if(w){w.__data__=z;u[m]=w;v[m]=s[m]=p}else{v[m]={appendChild:r,__data__:z};u[m]=s[m]=p}}for(;m<
y;m++){v[m]={appendChild:r,__data__:q[m]};u[m]=s[m]=p}for(;m<F;m++){s[m]=n[m];v[m]=u[m]=p}}v.parentNode=u.parentNode=s.parentNode=n.parentNode;v.parentData=u.parentData=s.parentData=n.parentData;o.push(v);k.push(u);l.push(s)}var g=-1,i=a.length,j,o=[],k=[],l=[];if(typeof b=="string")b=ja(b);if(typeof c=="function")for(;++g<i;)h(j=a[g],c.call(j,j.parentData,g));else for(;++g<i;)h(j=a[g],c);g=T(k);g.enter=function(n){return T(o).append(n)};g.exit=function(){return T(l)};return g};a.each=function(c){for(var b=
i=0,j=g.length;i<j;i++){var o=g[i];if(o)return c.call(o,o.__data__,i)}return p}a.select=function(c){return d(function(b){return b.querySelector(c)})};a.selectAll=function(c){return e(function(b){return u(b.querySelectorAll(c))})};a.filter=function(c){for(var b=[],h,g,i,j=0,o=a.length;j<o;j++){g=a[j];b.push(h=[]);h.parentNode=g.parentNode;h.parentData=g.parentData;for(var k=0,l=g.length;k<l;k++)if((i=g[k])&&c.call(i,i.__data__,k))h.push(i)}return T(b)};a.data=function(c,b){function h(n,q){function r(ia){return n.parentNode.appendChild(ia)}
var m=0,t=n.length,y=q.length,A=Math.min(t,y),F=Math.max(t,y),v=[],w=[],s=[],x,z;if(b){A={};F=[];var C;z=q.length;for(m=0;m<t;m++){C=b.nodeKey(x=n[m]);if(C in A)s[z++]=n[m];else{A[C]=x;F.push(C)}}for(m=0;m<y;m++){if(x=A[C=b.dataKey(z=q[m])]){x.__data__=z;v[m]=x;w[m]=s[m]=p}else{w[m]={appendChild:r,__data__:z};v[m]=s[m]=p}delete A[C]}for(m=0;m<t;m++)if(F[m]in A)s[m]=n[m]}else{for(;m<A;m++){x=n[m];z=q[m];if(x){x.__data__=z;v[m]=x;w[m]=s[m]=p}else{w[m]={appendChild:r,__data__:z};v[m]=s[m]=p}}for(;m<
y;m++){w[m]={appendChild:r,__data__:q[m]};v[m]=s[m]=p}for(;m<F;m++){s[m]=n[m];w[m]=v[m]=p}}w.parentNode=v.parentNode=s.parentNode=n.parentNode;w.parentData=v.parentData=s.parentData=n.parentData;o.push(w);k.push(v);l.push(s)}var g=-1,i=a.length,j,o=[],k=[],l=[];if(typeof b=="string")b=ja(b);if(typeof c=="function")for(;++g<i;)h(j=a[g],c.call(j,j.parentData,g));else for(;++g<i;)h(j=a[g],c);g=T(k);g.enter=function(n){return T(o).append(n)};g.exit=function(){return T(l)};return g};a.each=function(c){for(var b=
0,h=a.length;b<h;b++)for(var g=a[b],i=0,j=g.length;i<j;i++){var o=g[i];o&&c.call(o,o.__data__,i)}return a};a.attr=function(c,b){function h(){this.removeAttribute(c)}function g(){this.removeAttributeNS(c.space,c.local)}function i(){this.setAttribute(c,b)}function j(){this.setAttributeNS(c.space,c.local,b)}function o(){var l=b.apply(this,arguments);l==p?this.removeAttribute(c):this.setAttribute(c,l)}function k(){var l=b.apply(this,arguments);l==p?this.removeAttributeNS(c.space,c.local):this.setAttributeNS(c.space,
c.local,l)}c=d3.ns.qualify(c);if(arguments.length<2)return f(c.local?function(){return this.getAttributeNS(c.space,c.local)}:function(){return this.getAttribute(c)});return a.each(b==p?c.local?g:h:typeof b=="function"?c.local?k:o:c.local?j:i)};a.style=function(c,b,h){function g(){this.style.removeProperty(c)}function i(){this.style.setProperty(c,b,h)}function j(){var o=b.apply(this,arguments);o==p?this.style.removeProperty(c):this.style.setProperty(c,o,h)}if(arguments.length<3)h=p;if(arguments.length<
2)return f(function(){return window.getComputedStyle(this,p).getPropertyValue(c)});return a.each(b==p?g:typeof b=="function"?j:i)};a.property=function(c,b){function h(){delete this[c]}function g(){this[c]=b}function i(){var j=b.apply(this,arguments);if(j==p)delete this[c];else this[c]=j}c=d3.ns.qualify(c);if(arguments.length<2)return f(function(){return this[c]});return a.each(b==p?h:typeof b=="function"?i:g)};a.text=function(c){function b(){this.appendChild(document.createTextNode(c))}function h(){var g=
@ -31,9 +31,9 @@ c.apply(this,arguments);g!=p&&this.appendChild(document.createTextNode(g))}if(ar
function h(g){return g.appendChild(document.createElementNS(c.space,c.local))}c=d3.ns.qualify(c);return d(c.local?h:b)};a.remove=function(){return d(function(c){var b=c.parentNode;b.removeChild(c);return b})};a.sort=function(c){c=ka.apply(this,arguments);for(var b=0,h=a.length;b<h;b++){var g=a[b];g.sort(c);for(var i=1,j=g.length,o=g[0];i<j;i++){var k=g[i];if(k){o&&o.parentNode.insertBefore(k,o.nextSibling);o=k}}}return a};a.on=function(c,b){c="on"+c;return a.each(function(h,g){this[c]=function(i){d3.event=
i;try{b.call(this,h,g)}finally{d3.event=p}}})};a.transition=function(){return V(a)};a.call=B;return a}function ja(a){return{nodeKey:function(d){return d.getAttribute(a)},dataKey:function(d){return d[a]}}}function ka(a){arguments.length||(a=la);return function(d,e){return a(d&&d.__data__,e&&e.__data__)}}function la(a,d){return a<d?-1:a>d?1:0}d3.transition=U.transition;
function V(a){function d(k){var l=true,n=-1;a.each(function(){if(h[++n]!=2){var q=(k-g[n])/i[n],r,m=c[n];if(q<1){l=false;if(!(q<0)){if(h[n]){if(this.g!=e){h[n]=2;return}}else{h[n]=1;b.start.dispatch.apply(this,arguments);m=c[n]={};this.g=e;for(r in f)m[r]=f[r].apply(this,arguments)}q=o(q);for(r in f)m[r].call(this,q)}}else{h[n]=2;if(this.g==e){for(r in f)m[r].call(this,1);delete this.g;b.end.dispatch.apply(this,arguments)}}}});return l}var e={},f={},c=[],b=d3.dispatch("start","end"),h=[],g=[],i=[],
j,o=d3.ease("cubic-in-out");e.delay=function(k){var l=Infinity,n=-1;if(typeof k=="function")a.each(function(){var q=g[++n]=+k.apply(this,arguments);if(q<l)l=q});else{l=+k;a.each(function(){g[++n]=l})}ma(d,l);return e};e.duration=function(k){var l=-1;if(typeof k=="function"){j=0;a.each(function(){var n=i[++l]=+k.apply(this,arguments);if(n>j)j=n})}else{j=+k;a.each(function(){i[++l]=j})}return e};e.ease=function(k){o=typeof k=="string"?d3.ease(k):k;return e};e.attrTween=function(k,l){function n(r,m){var x=
l.call(this,r,m,this.getAttribute(k));return function(y){this.setAttribute(k,x(y))}}function q(r,m){var x=l.call(this,r,m,this.getAttributeNS(k.space,k.local));return function(y){this.setAttributeNS(k.space,k.local,x(y))}}f["attr."+k]=k.local?q:n;return e};e.attr=function(k,l){return e.attrTween(k,W(l))};e.styleTween=function(k,l,n){f["style."+k]=function(q,r){l.call(this,q,r,window.getComputedStyle(this,p).getPropertyValue(k));return function(m){this.style.setProperty(k,r(m),n)}};return e};e.style=
function(k,l,n){return e.styleTween(k,W(l),n)};e.select=function(k){var l;k=V(a.select(k)).ease(o);l=-1;k.delay(function(){return g[++l]});l=-1;k.duration(function(){return i[++l]});return k};e.selectAll=function(k){var l;k=V(a.selectAll(k)).ease(o);l=-1;k.delay(function(n,q){return g[q?l:++l]});l=-1;k.duration(function(n,q){return i[q?l:++l]});return k};e.each=function(k,l){b[k].add(l);return e};e.call=B;return e.delay(0).duration(250)}var X=p,Y=0,Z;
j,o=d3.ease("cubic-in-out");e.delay=function(k){var l=Infinity,n=-1;if(typeof k=="function")a.each(function(){var q=g[++n]=+k.apply(this,arguments);if(q<l)l=q});else{l=+k;a.each(function(){g[++n]=l})}ma(d,l);return e};e.duration=function(k){var l=-1;if(typeof k=="function"){j=0;a.each(function(){var n=i[++l]=+k.apply(this,arguments);if(n>j)j=n})}else{j=+k;a.each(function(){i[++l]=j})}return e};e.ease=function(k){o=typeof k=="string"?d3.ease(k):k;return e};e.attrTween=function(k,l){function n(r,m){var t=
l.call(this,r,m,this.getAttribute(k));return function(y){this.setAttribute(k,t(y))}}function q(r,m){var t=l.call(this,r,m,this.getAttributeNS(k.space,k.local));return function(y){this.setAttributeNS(k.space,k.local,t(y))}}f["attr."+k]=k.local?q:n;return e};e.attr=function(k,l){return e.attrTween(k,W(l))};e.styleTween=function(k,l,n){f["style."+k]=function(q,r){var m=l.call(this,q,r,window.getComputedStyle(this,p).getPropertyValue(k));return function(t){this.style.setProperty(k,m(t),n)}};return e};
e.style=function(k,l,n){return e.styleTween(k,W(l),n)};e.select=function(k){var l;k=V(a.select(k)).ease(o);l=-1;k.delay(function(){return g[++l]});l=-1;k.duration(function(){return i[++l]});return k};e.selectAll=function(k){var l;k=V(a.selectAll(k)).ease(o);l=-1;k.delay(function(n,q){return g[q?l:++l]});l=-1;k.duration(function(n,q){return i[q?l:++l]});return k};e.each=function(k,l){b[k].add(l);return e};e.call=B;return e.delay(0).duration(250)}var X=p,Y=0,Z;
function ma(a,d){var e=Date.now(),f=false,c=e+d,b=X;if(isFinite(d)){for(;b;){if(b.j==a){b.i=e;b.delay=d;f=true}else{var h=b.i+b.delay;if(h<c)c=h}b=b.next}f||(X={j:a,i:e,delay:d,next:X});if(!Z){clearTimeout(Y);Y=setTimeout(na,Math.max(24,c-e))}}}function na(){Z=setInterval(oa,24);Y=0}function oa(){for(var a,d=Date.now(),e=X;e;){a=d-e.i;if(a>e.delay)e.l=e.j(a);e=e.next}a=p;for(d=X;d;)d=d.l?a?a.next=d.next:X=d.next:(a=d).next;a||(Z=clearInterval(Z))}
function W(a){return typeof a=="function"?function(d,e,f){return d3.interpolate(f,a.call(this,d,e))}:function(d,e,f){return d3.interpolate(f,a)}}d3.scale={};
d3.scale.linear=function(){function a(j){return i((j-e)*h)}function d(j){var o=Math.min(e,f),k=Math.max(e,f),l=k-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(k/n)*n+n*0.5,k:n}}var e=0,f=1,c=0,b=1,h=1/(f-e),g=(f-e)/(b-c),i=d3.interpolate(c,b);a.invert=function(j){return(j-c)*g+e};a.domain=function(j){if(!arguments.length)return[e,f];e=j[0];f=j[1];h=1/(f-e);g=(f-e)/(b-c);return a};

Просмотреть файл

@ -1 +1 @@
d3 = {version: "0.15.2"}; // semver
d3 = {version: "0.15.3"}; // semver

Просмотреть файл

@ -122,7 +122,7 @@ function d3_transition(groups) {
function styleTween(d, i) {
var f = tween.call(this, d, i, window.getComputedStyle(this, null).getPropertyValue(name));
return function(t) {
this.style.setProperty(name, i(t), priority);
this.style.setProperty(name, f(t), priority);
};
}