/*! * d3.chart - v0.3.0 * License: MIT * Date: 2016-01-23 */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3")):"function"==typeof define&&define.amd?define("d3.chart",["d3"],e):"object"==typeof exports?exports["d3.chart"]=e(require("d3")):t["d3.chart"]=e(t.d3)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var n;n=function(t,e,n){"use strict";var i=r(1),o=r(2),a=r(3);a(/^3\./.test(i.version),"d3.js version 3 is required"),r(4),i.chart=function(t){return 0===arguments.length?o:1===arguments.length?o[t]:o.extend.apply(o,arguments)},i.selection.prototype.chart=function(t,e){if(0===arguments.length)return this._chart;var r=o[t];return a(r,"No chart registered with name '"+t+"'"),new r(this,e)},i.selection.enter.prototype.chart=function(){return this._chart},i.transition.prototype.chart=i.selection.enter.prototype.chart,n.exports=i.chart}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))},function(e,r){e.exports=t},function(t,e,r){var n;n=function(t,e,n){"use strict";function i(t){var e,r,n,i;if(!t)return t;for(r=arguments.length,e=1;r>e;e++)if(n=arguments[e])for(i in n)t[i]=n[i];return t}var o=r(3),a=Object.hasOwnProperty,s=function(t,e){var r=this.constructor,n=r.__super__;n&&s.call(n,t,e),a.call(r.prototype,"initialize")&&this.initialize.apply(t,e)},c=function(t,e){var r=this.constructor,n=r.__super__;return this===t&&a.call(this,"transform")&&(e=this.transform(e)),a.call(r.prototype,"transform")&&(e=r.prototype.transform.call(t,e)),n&&(e=c.call(n,t,e)),e},h=function(t,e){this.base=t,this._layers={},this._attached={},this._events={},e&&e.transform&&(this.transform=e.transform),s.call(this,this,[e])};h.prototype.initialize=function(){},h.prototype.unlayer=function(t){var e=this.layer(t);return delete this._layers[t],delete e._chart,e},h.prototype.layer=function(t,e,r){var n;if(1===arguments.length)return this._layers[t];if(2===arguments.length){if("function"==typeof e.draw)return e._chart=this,this._layers[t]=e,this._layers[t];o(!1,"When reattaching a layer, the second argument must be a d3.chart layer")}return n=e.layer(r),this._layers[t]=n,e._chart=this,n},h.prototype.attach=function(t,e){return 1===arguments.length?this._attached[t]:(this._attached[t]=e,e)},h.prototype.transform=function(t){return t},h.prototype.draw=function(t){var e,r,n;t=c.call(this,this,t);for(e in this._layers)this._layers[e].draw(t);for(r in this._attached)n=this.demux?this.demux(r,t):t,this._attached[r].draw(n)},h.prototype.on=function(t,e,r){var n=this._events[t]||(this._events[t]=[]);return n.push({callback:e,context:r||this,_chart:this}),this},h.prototype.once=function(t,e,r){var n=this,i=function(){n.off(t,i),e.apply(this,arguments)};return this.on(t,i,r)},h.prototype.off=function(t,e,r){var n,i,o,a,s,c;if(0===arguments.length){for(t in this._events)this._events[t].length=0;return this}if(1===arguments.length)return o=this._events[t],o&&(o.length=0),this;for(n=t?[t]:Object.keys(this._events),s=0;s-1;--r)n[r].callback===e&&n.splice(r,1);return this._base},s.prototype.draw=function(t){var e,r,n,a,s,c,h,l,u;e=this.dataBind.call(this._base,t),o(e&&e.call===i.selection.prototype.call,"Invalid selection defined by `Layer#dataBind` method."),o(e.enter,"Layer selection not properly bound."),r=e.enter(),r._chart=this._base._chart,n=[{name:"update",selection:e},{name:"enter",selection:r,method:this.insert},{name:"merge",selection:e},{name:"exit",selection:e,method:e.exit}];for(var p=0,f=n.length;f>p;++p)if(h=n[p].name,a=n[p].selection,s=n[p].method,"function"==typeof s&&(a=s.call(a)),!a.empty()){if(o(a&&a.call===i.selection.prototype.call,"Invalid selection defined for '"+h+"' lifecycle event."),c=this._handlers[h])for(l=0,u=c.length;u>l;++l)a._chart=c[l].chart||this._base._chart,a.call(c[l].callback);if(c=this._handlers[h+":transition"],c&&c.length)for(a=a.transition(),l=0,u=c.length;u>l;++l)a._chart=c[l].chart||this._base._chart,a.call(c[l].callback)}},n.exports=s}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))}])}); //# sourceMappingURL=d3.chart.min.map