forked from d3/d3.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d3-dispatch.v0.2.min.js
1 lines (1 loc) · 1.11 KB
/
d3-dispatch.v0.2.min.js
1
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.d3_dispatch={})}(this,function(e){"use strict";function n(){return new t(arguments)}function t(e){function n(e){var n=(e+="").indexOf("."),t=e;if(n>=0?e=e.slice(0,n):t+=".",e&&!u.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}function t(e){return function(){for(var n,t=u[e],r=-1,i=t.length;++r<i;)(n=t[r].value)&&n.apply(this,arguments);return l}}var r,i=-1,o=e.length,u={},a={},l=this;for(l.on=function(e,t){if(e=n(e),arguments.length<2)return(t=a[e.name])&&t.value;if(e.type){var r,i=u[e.type],o=a[e.name];o&&(o.value=null,r=i.indexOf(o),u[e.type]=i=i.slice(0,r).concat(i.slice(r+1)),delete a[e.name]),t&&(t={value:t},a[e.name]=t,i.push(t))}else if(null==t)for(var f in u)(t=a[f+e.name])&&(t.value=null,i=u[f],r=i.indexOf(t),u[f]=i.slice(0,r).concat(i.slice(r+1)),delete a[t.name]);return l};++i<o;){if(r=e[i]+"",!r||r in l)throw new Error("illegal or duplicate type: "+r);u[r]=[],l[r]=t(r)}}n.prototype=t.prototype;var r="0.2.6";e.version=r,e.dispatch=n});