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