');
+ ChartAPI.Data.getData($.getJSON(settings), null, function (settings) {
+ settings.$container = $container;
+ ChartAPI.Build_(settings).trigger('APPEND');
+ });
+ } else {
+ $container = ChartAPI.Build_(settings).trigger('APPEND');
+ }
+ return $container;
+ };
+
+ /**
+ * internal method for building graph|slider|list objects
+ * @param {Object} settings
+ * @param {=jQuery} jQuery object to attach graph|slider|list object
+ */
+ ChartAPI.Build_ = function (settings) {
+ var $container, $graphContainer, $sliderContainer, $listContainer, dataRangeTarget, sliderUpdateTarget, sliderAmountTarget;
+
+ $container = settings.$container || $('
');
+
+ sliderUpdateTarget = [];
+
+ if (settings.graph) {
+ $graphContainer = new ChartAPI.Graph(settings.graph, settings.range);
+ sliderUpdateTarget.push($graphContainer);
+ }
+
+ if (settings.list) {
+ $listContainer = new ChartAPI.List(settings.list, settings.range);
+ if (settings.list.data) {
+ sliderUpdateTarget.push($listContainer);
+ }
+ }
+
+ if (settings.graph && settings.graph.type !== 'donut') {
+ dataRangeTarget = $graphContainer;
+ sliderAmountTarget = [$graphContainer];
+ } else {
+ dataRangeTarget = $listContainer;
+ sliderAmountTarget = [$listContainer];
+ }
+
+ var isSmartPhone = function () {
+ var userAgent = window.navigator ? window.navigator.userAgent : '';
+ return (/android|iphone|ipod|ipad/i).test(userAgent);
+ };
+
+ if (settings.slider && (settings.slider.force || !isSmartPhone())) {
+ $sliderContainer = new ChartAPI.Slider(settings.slider, settings.range, dataRangeTarget, sliderUpdateTarget, sliderAmountTarget);
+ }
+
+ $container.on('APPEND', function () {
+ if ($graphContainer) {
+ $graphContainer.trigger('APPEND_TO', [$container]);
+ }
+ if ($sliderContainer) {
+ $sliderContainer.trigger('BUILD_SLIDER')
+ .trigger('APPEND_TO', [$container]);
+ }
+ if ($listContainer) {
+ $listContainer.trigger('APPEND_TO', [$container]);
+ }
+ });
+
+ $container.on('GET_CONTAINER', function (e, type, callback) {
+ callback({
+ 'graph': $graphContainer,
+ 'slider': $sliderContainer,
+ 'list': $listContainer
+ }[type]);
+ });
+
+ return $container;
+ };
+
+
+ return ChartAPI;
+ })(this, jQuery);
+
return MT.ChartAPI;
}));
diff --git a/lib/core/amd/mtchart.core.amd.min.js b/lib/core/amd/mtchart.core.amd.min.js
index eeab9cb..304b018 100644
--- a/lib/core/amd/mtchart.core.amd.min.js
+++ b/lib/core/amd/mtchart.core.amd.min.js
@@ -1,2 +1,2 @@
-(function(t,e){if("object"==typeof exports){var a=require("jquery");module.exports=e(a)}else"function"==typeof define&&define.amd&&define(["jquery"],e)})(this,function(){(function(t,e){"use strict";var a=e,r={},n=t.MT=t.MT||{};n.ChartAPI=r;r.Data={};r.Data.getData=function(t,e,r,n){var i,o,s,h;t&&t.done(function(t){i||(i="string"==typeof t?""+t:a.isArray(t)?a.map(t,function(t){return a.extend({},t)}):a.extend({},t));r(i)}).fail(function(t){o={404:"Data is not found",403:"Data is forbidden to access"};s="Some error occured in the data fetching process";h=t.status?"error-"+t.status:"error-unknown";n&&(n.$errormsg=a('
'+(o[t.status]||s)+"
").appendTo(e))}).always(function(){n&&n.$progress&&n.$progress.parent().length>0&&n.$progress.remove()}).progress(function(){!n||n.$progress&&0!==n.$progress.parent().length||(n.$progress=a('
fetching data...
').appendTo(e))})};r.Data.filterData=function(t,e,n,i,o,s){var h,l={};o=o||1;a.each(t,function(t,c){var p,u;p=r.Date.parse(c.x);if(p&&p>=n&&e>=p)if(s){u=r.Date.createId(p,"daily");l[u]=c}else{"weekly"===i&&(p=r.Date.getWeekStartday(p));u=r.Date.createId(p,i);if(l[u])for(t=0;o>t;t++){h=t?"y"+t:"y";l[u][h]=parseInt(l[u][h],10)+parseInt(c[h],10)}else l[u]=a.extend({},c)}});return l};r.Date={};r.Date.getWeekStartday=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()-t.getDay())};r.Date.zeroPadArray=function(t,e){var r;({yearly:function(){r=[t.getFullYear()]},monthly:function(){r=[t.getFullYear(),t.getMonth()+1]},quarter:function(){r=[t.getFullYear(),t.getMonth()+1]},weekly:function(){r=[t.getFullYear(),t.getMonth()+1,t.getDate()-t.getDay()]},daily:function(){r=[t.getFullYear(),t.getMonth()+1,t.getDate()]},hourly:function(){r=[t.getFullYear(),t.getMonth()+1,t.getDate(),t.getHours()]}})[e]();return a.map(r,function(t){t=""+t;return 1===t.length?"0"+t:t})};r.Date.createId=function(t,e){return r.Date.zeroPadArray(t,e).join("")};r.Date.createXLabel=function(t,e){var a,n,i=r.Date.zeroPadArray(t,e);if("hourly"===e){a=i.pop();n=i.join("-")+" "+a+":00"}else n=i.join("-");return n};r.Date.parse=function(t){var e;e=!t||t instanceof Date?t||null:"number"==typeof t?new Date(t):new Date(Date.parse(""+t));if(e&&/NaN|Invalid Date/.test(""+e)){e=t.replace(/-/g,"/").split("+")[0];if(1===e.split("/").length){e=t.match(/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/);e=[e[1],e[2],e[3]].join("/")}2===e.split("/").length&&(e+="/01");e=a.each(e.split("/"),function(t,e){return 1===e.length?"0"+e:e}).join("/");e=new Date(Date.parse(e))}return e};r.Date.calcDate=function(t,e,a,r){var n,i,o,s;n=t.getFullYear();i=t.getMonth();o=t.getDate();s=0;e-=1;r=r?-1:1;({yearly:function(){n+=r*e},monthly:function(){i+=r*e},quarter:function(){i+=4*r*e},weekly:function(){o=o+7*r*e-t.getDay()},daily:function(){o+=r*e},hourly:function(){s=t.getHours()+r*e}})[a]();return new Date(n,i,o,s)};r.Range={};r.Range.factory=function(t){var e;t=t||{};t.maxLength=t.maxLength||90;t.dataType=t.dataType||"timeline";t.isTimeline=r.Range.isTimeline(t.dataType);e=t.isTimeline?r.Range.calcDate:r.Range.calcNum;return e(t.start,t.end,t.length,t.maxLength,t.unit,t.dataType,t.autoSized)};r.Range.generate=r.Range.factory;r.Range.isTimeline=function(t){return!t||"timeline"===t};r.Range.calcDate=function(t,e,n,i,o,s,h){o=o||"monthly";n=n||("hourly"===o?24:10);if(h){var l=a(window).width();i=Math.min(Math.ceil(.021875*l),i);n=i}t=r.Date.parse(t);e=r.Date.parse(e);t||e||(e=r.Range.getEndDate(new Date,o));t||(t=r.Range.getStartDate(r.Date.calcDate(e,n,o,!0),o));e||(e=r.Range.getEndDate(r.Date.calcDate(t,n,o,!1),o));e>new Date&&(e=new Date);t>e&&(t=e);n=r.Range.getLength(t,e,o);if(n>i){n=i;t=r.Date.calcDate(e,n,o,!0)}return{start:t,end:e,length:n,maxLength:i,unit:o,dataType:s,max:r.Range.getEndDate(e,o),min:r.Range.getStartDate(t,o),isTimeline:!0}};r.Range.calcNum=function(t,e,r,n,i,o,s){r=r||10;if(s){var h=a(window).width();n=Math.min(Math.ceil(.021875*h),n);r=Math.min(r,n)}if(!t&&!e){t=0;e=r-1}t=parseInt(t,10)||(0===t?0:null);e=parseInt(e,10)||(0===e?0:null);if(null===t){t=e-r;0>t&&(t=0)}null===e&&(e=t+r);t>e&&(t=e);r=e-t+1;if(r>n){r=n;t=e-n}return{start:t,end:e,length:r,maxLength:n,dataType:o,unit:null,max:e,min:t,isTimeline:!1}};r.Range.getStartDate=function(t,e){var a,r=t.getFullYear(),n=t.getMonth(),i=t.getDate();({yearly:function(){a=new Date(r,0,1,0,0,0)},monthly:function(){a=new Date(r,n,1,0,0,0)},quarter:function(){a=new Date(r,n,1,0,0,0)},weekly:function(){a=new Date(r,n,i-t.getDay(),0,0,0)},daily:function(){a=new Date(r,n,i,0,0,0)},hourly:function(){a=new Date(r,n,i,t.getHours(),0,0)}})[e]();return a};r.Range.getEndDate=function(t,e){var a,r=t.getFullYear(),n=t.getMonth(),i=t.getDate();({yearly:function(){a=new Date(r,11,31,23,59,59)},monthly:function(){a=new Date(new Date(r,n+1,1,0,0,0).valueOf()-1)},quarter:function(){a=new Date(new Date(r,n+1,1,0,0,0).valueOf()-1)},weekly:function(){a=new Date(r,n,i-t.getDay()+6,23,59,59)},daily:function(){a=new Date(r,n,i,23,59,59)},hourly:function(){a=new Date(r,n,i,t.getHours(),0,0)}})[e]();return new Date>a?a:new Date};r.Range.getNextDate=function(t,e,a,r){var n,i=t.getFullYear(),o=t.getMonth(),s=t.getDate();({yearly:function(t){n=new Date(i+t,0,1)},monthly:function(t){n=new Date(i,o+t,1)},quarter:function(t){n=new Date(i,o+4*t,1)},weekly:function(e){n=new Date(i,o,s+7*e-t.getDay())},daily:function(t){n=new Date(i,o,s+t)},hourly:function(e){n=new Date(i,o,s,t.getHours()+e)}})[r](a);return e>n?n:null};r.Range.getDataRange=function(t,e){var n,i,o;if(e){n=a.map(t,function(t){return r.Date.parse(t.x).valueOf()});i=Math.max.apply(null,n);o=Math.min.apply(null,n)}else{o=0;i=t.length-1}return{max:i,min:o}};r.Range.getLength=function(t,e,a){var n;({yearly:function(){n=Math.ceil(e.getFullYear()-t.getFullYear())},monthly:function(){n=Math.ceil(12*e.getFullYear()+e.getMonth()-(12*t.getFullYear()+t.getMonth()))},quarter:function(){n=Math.ceil((12*e.getFullYear()+e.getMonth()-(12*t.getFullYear()+t.getMonth()))/4)},weekly:function(){n=Math.ceil((r.Date.getWeekStartday(e)-r.Date.getWeekStartday(t))/6048e5)},daily:function(){n=Math.ceil((e-t)/864e5)},hourly:function(){n=Math.ceil((e-t)/36e5)}})[a]();return n>0?n+1:1};r.Graph=function(t,a){this.config=e.extend({type:"morris.bar",staticPath:"",data:"graph.json"},t);this.config.id="graph-"+(new Date).valueOf()+Math.floor(100*Math.random());this.config.yLength=parseInt(this.config.yLength,10)||1;this.range=r.Range.generate(a);if("string"==typeof this.config.data)this.origData_=e.getJSON(this.config.staticPath+this.config.data);else{this.origData_=e.Deferred();this.origData_.resolve(this.config.data)}this.graphData={};this.graphData[this.range.unit]=e.Deferred();this.getData(e.proxy(function(t){this.graphData[this.range.unit].resolve(this.generateGraphData(t))},this));this.$graphContainer=e('
');this.$graphContainer.on("UPDATE",e.proxy(function(t,a,r){this.update_(a,r);return e(this.$graphContainer)},this));this.$graphContainer.on("REMOVE",e.proxy(function(){this.remove_()},this));var n=e(window).width();this.updateFunc=e.proxy(function(){if(n&&n!==e(window).width()){n=e(window).width();this.update_()}},this);t.autoResize&&e(window).on("orientationchange debouncedresize",this.updateFunc);this.$graphContainer.on("GET_DATA_RANGE",e.proxy(function(t,a){e.proxy(this.getData(e.proxy(function(t){a(r.Range.getDataRange(t,this.range.isTimeline))},this),this));return e(this.$graphContainer)},this));this.$graphContainer.on("GET_LABEL",e.proxy(function(t,a,r){e.proxy(this.getData(e.proxy(function(t){r(this.getDataLabelByIndex(a,t))},this),this));return e(this.$graphContainer)},this));this.$graphContainer.on("APPEND_TO",e.proxy(function(t,a){this.$graphContainer.appendTo(a);this.graphData[this.range.unit].done(e.proxy(function(t){var a;a=this.range.isTimeline?e.grep(t,e.proxy(function(t){return this.range.start<=t.timestamp&&t.timestamp<=this.range.end},this)):t.slice(this.range.min,this.range.max+1);this.draw_(a)},this));return e(this.$graphContainer)},this));return this.$graphContainer};r.Graph.prototype.getData=function(t){r.Data.getData(this.origData_,this.$graphContainer,t,this)};r.Graph.prototype.getDataLabelByIndex=function(t,a){var r=this.config.dataLabel||"x";return e.map(t,function(t){return a[t][r]})};r.Graph.prototype.getTotalCount_=function(t,a){var r=0,n="y"+(a||"");e.each(t,function(t,e){r+=parseInt(e[n]||e.value||0,10)});return r};r.Graph.prototype.getDelta_=function(t,e){var a,r,n,i,o=t.length;i="y"+(e||"");a=t[o-1];r=t[o-2];n=r&&a&&r[i]?a[i]-r[i]:a[i];return void 0===n?"":n};r.Graph.presetColors=function(){return["#6AAC2B","#FFBE00","#CF6DD3","#8F2CFF","#2D85FF","#5584D4","#5ED2B8","#9CCF41","#F87085","#2C8087","#8EEC6A","#FFE700","#FF5E19","#FF4040","#976BD6","#503D99","#395595"]};r.Graph.getChartColors=function(t,e){var a={reverse:function(t){return t.reverse()},shuffle:function(t){var e,a,r,n;r=t.length;for(e=0;r>e;e++){a=Math.floor(Math.random()*r);n=t[e];t[e]=t[a];t[a]=n}return t},def:function(t){return t}};return a[e||"def"](t||r.Graph.presetColors())};r.Graph.cachedChartColors={};r.Graph.getCachedChartColors=function(t,e,a){return r.Graph.cachedChartColors[t]=r.Graph.cachedChartColors[t]||r.Graph.getChartColors(e,a)};r.Graph.prototype.draw_=function(t){var a=this.config.type.split("."),n=a[0],i=a[1],o=this.config;if(o.label)if(this.labelTemplate)this.generateLabel(this.labelTemplate);else if(o.label.template){var s=o.label.template;if(window.require&&"function"==typeof require){var h=o.label.type;require([h+"!"+o.staticPath+s],e.proxy(function(t){this.labelTemplate=t;this.generateLabel(t)},this))}else{var l=e.get(o.staticPath+s,"text");r.Data.getData(l,this.$graphContainer,e.proxy(function(t){this.labelTemplate=t;this.generateLabel(t)},this))}}else{this.labelTemplate='
';this.generateLabel(this.labelTemplate)}if(o.fallback&&o.fallback.test&&!r.Graph.test[o.fallback.test]()){a=o.fallback.type.split(".");n=a[0];i=a[1];o=e.extend(o,o.fallback)}o.chartColors&&"string"==typeof o.chartColors&&(o.chartColors=o.chartColors.split(","));this.graphObject=r.Graph[n][i](t,o,this.range,this.$graphContainer)};r.Graph.test={};r.Graph.test.canvas=function(){var t=document.createElement("canvas");return t.getContext&&t.getContext("2d")};r.Graph.test.svg=function(){var t={svg:"http://www.w3.org/2000/svg"};return!!document.createElementNS&&!!document.createElementNS(t.svg,"svg").createSVGRect};r.Graph.test.vml=function(){var t,e=r.Graph.test.svg();if(!e){var a=document.body.appendChild(document.createElement("div"));a.innerHTML='
';var n=a.firstChild;n.style.behavior="url(#default#VML)";t=n?"object"==typeof n.adj:!0;a.parentNode.removeChild(a)}return e||t};r.Graph.prototype.generateLabel=function(t){var a,n=this.config.label.template&&this.config.label.data?this.config.label.data:{},i=this.config.label.yLength||this.config.yLength,o=e.proxy(function(){this.labels=new r.Graph.Labels(this.$graphContainer,i,t);this.getData(e.proxy(function(t){for(var e=0;i>e;e++){this.config.label.hideTotalCount||this.labels.getTotalObject(e).createTotalCount(this.getTotalCount_(t,e));!this.config.label.hideDeltaCount&&this.range.isTimeline&&this.labels.getTotalObject(e).createDeltaCount(this.getDelta_(t,e))}},this))},this);if(n&&"string"==typeof n)a=e.getJSON(this.config.staticPath+n);else{a=e.Deferred();a.resolve(n)}a.done(function(e){if(t&&"function"==typeof t){t=t(e);o()}else if(window._){t=_.template(t,e);o()}else{t=t;o()}})};r.Graph.prototype.update_=function(t,a){var n=this;t=t||[];this.graphObject&&this.graphObject.remove&&this.graphObject.remove();this.labels&&this.labels.remove();this.range=r.Range.generate({start:t[0]||this.range.start,end:t[1]||this.range.end,length:null,maxLength:this.range.maxLength,unit:a||this.range.unit,dataType:this.range.dataType,autoSized:this.range.autoSized});this.graphData[this.range.unit].done(e.proxy(function(t){var a;a=n.range.isTimeline?e.grep(t,e.proxy(function(t){return this.range.min<=t.timestamp&&t.timestamp<=this.range.max},this)):t.slice(this.range.min,this.range.max+1);this.draw_(a)},this))};r.Graph.prototype.remove_=function(){this.config.autoResize&&e(window).off("orientationchange debouncedresize",this.updateFunc);this.graphObject&&this.graphObject.remove&&this.graphObject.remove();this.labels&&this.labels.remove();this.$graphContainer.remove()};r.Graph.prototype.generateGraphData=function(t){var a,n,i,o,s,h,l,c=this.range,p=c.start,u=c.end,g=c.unit,d=c.length,f=[],y=this.config.yLength||1;if(this.range.isTimeline){var m=r.Range.getDataRange(t,this.range.isTimeline);p=new Date(Math.min(this.range.min,m.min));u=new Date(Math.max(this.range.max,m.max));d=r.Range.getLength(p,u,g);s=r.Data.filterData(t,m.max,m.min,g,y);for(a=0;d>a;a++){i=r.Range.getNextDate(p,u,a,g);if(!i)break;o=r.Date.createId(i,g);h={timestamp:i.valueOf(),x:r.Date.createXLabel(i,g)};for(n=0;y>n;n++){l="y"+(n||"");h[l]=s[o]?s[o][l]||0:0}f.push(h)}}else f=t;"morris.donut"===this.config.type&&e.each(f,function(t,a){e.extend(a,{label:a.xLabel||a.x,value:a.y})});return f};r.Graph.Labels=function(t,a,n){var i,o;this.$labelContainer=e('
');n&&e('
').html(n).prependTo(this.$labelContainer);this.totals={};for(i=0;a>i;i++){o="y"+(i||"");this.totals[o]=new r.Graph.Labels.Total(this.$labelContainer,i)}this.$labelContainer.appendTo(t)};r.Graph.Labels.prototype.remove=function(){this.$labelContainer.remove()};r.Graph.Labels.prototype.getTotalObject=function(t){return this.totals["y"+(t||"")]};r.Graph.Labels.Total=function(t,e){this.index=e;this.$totalContainer=a('
').appendTo(t)};r.Graph.Labels.Total.prototype.createTotalCount=function(t){a('
"+t+" ").appendTo(this.$totalContainer)};r.Graph.Labels.Total.prototype.createDeltaCount=function(t){var e=t?0>t?"minus ":"plus ":"zero ";a('
('+t+")").appendTo(this.$totalContainer)};r.Graph.css={};r.Graph.css.Base=function(t,a){this.len=t.length;this.$graphEl=e('
')};r.Graph.css.Base.prototype.remove=function(){this.$graphEl.remove()};r.Graph.css.Base.prototype.horizontalBar=function(t,a,n,i){a.width&&this.$graphEl.css({width:a.width,"max-width":"100%",margin:"0 auto"});for(var o,s,h,l,c,p,u=a.barColor||r.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod)[1],g=a.barBackgroundColor||"#f0f0f0",d=a.dateColor||"#999999",f=a.dateColorSaturday||d,y=a.dateColorSunday||d,m=a.labelColor||"#999999",v=parseInt(a.barWidth,10)||30,D=parseInt(a.barMarginLeft,10)||30,C=parseInt(a.barInterval,10)||5,b=parseInt(a.labelSize,10)||.45*v,x=parseInt(a.dateLabelSize,10)||b,w=function(){return e('
')},T=e.map(t,function(t){return parseInt(t.y,10)}),L=e.map(t,function(t){return{value:""+parseInt(t.x.substr(t.x.lastIndexOf("-")+1),10),weekday:r.Date.parse(t.x)?r.Date.parse(t.x).getDay():null}}),$=Math.max.apply(null,T)||1,G=a.yLabel||T,M=this.len;M>0;){M-=1;o=Math.floor(100*(T[M]/$))-15;s=w();h=s.find(".css-graph-bar-background");h.css({"background-color":g});if(a.showDate){p=s.find(".css-graph-date");p.text(L[M].value).css({color:d,"font-size":x+"px","line-height":v+"px"});6===L[M].weekday?p.addClass("saturday").css({color:f}):0===L[M].weekday&&p.addClass("sunday").css({color:y});s.find(".css-graph-bar-container").css({"margin-left":D+"px"})}l=s.find(".css-graph-bar");l.css({width:o+"%","background-color":u});c=s.find(".css-graph-bar-count");c.text(G[M]).css({color:m,"font-size":b+"px","line-height":v+"px"});s.appendTo(this.$graphEl)}this.$graphEl.appendTo(i)};r.Graph.css.Base.prototype.ratioHorizontalBar=function(t,a,n,i){var o,s,h,l,c,p,u,g,d,f,y,m,v=a.yLength,D=parseInt(a.barWidth,10)||30,C=parseInt(a.barMarginLeft,10)||30,b=parseInt(a.barInterval,10)||5,x=parseInt(a.labelSize,10)||.45*D,w=a.dateColor||"#999999",T=a.barColors||r.Graph.getCachedChartColors(a.id,null,a.chartColorsMethod),L=a.labelColors,$=a.labelClasses;for(o=0;this.len>o;o++){h=t[o];l=[];c=0;m=0;for(s=0;v>s;s++){l.push(h["y"+(s||"")]);c+=parseInt(h["y"+(s||"")],10)}p=e('
').appendTo(this.$graphEl);if(a.showDate&&h.x){d=""+parseInt(h.x.substr(h.x.lastIndexOf("-")+1),10);f=e('
'+d+"
").appendTo(p)}u=e('
').appendTo(p);a.showDate&&u.css({"margin-left":C+"px"});for(s=0;v>s;s++){y=Math.floor(1e3*(l[s]/c))/10;if(y){v===s&&(y=100-m);m+=y;g=e('
');g.css({width:y+"%","background-color":T[s]});a.showCount&&g.text(l[s]);$&&$[s]&&g.addClass($[s]);L&&L[s]&&g.css({color:L[s]});g.appendTo(u)}}u.appendTo(p)}this.$graphEl.appendTo(i)};r.Graph.css.horizontalBar=r.Graph.css.ratioHorizontalBar=function(t,e,a,n){var i=new r.Graph.css.Base(t,e,a,n),o=e.type.slice(e.type.lastIndexOf(".")+1);i[o](t,e,a,n);return i};r.Graph.easel={};r.Graph.easel.Base=function(t,a,r,n){this.data=t;this.config=a;this.range=r;this.$container=n;if(window.createjs||"function"!=typeof window.require){var i=parseInt(a.width||n.width(),10);i?this.buildCanvas(createjs):setTimeout(e.proxy(function(){this.buildCanvas(createjs)},this),100)}else require(["easeljs"],e.proxy(function(){this.buildCanvas(createjs)},this))};r.Graph.easel.Base.prototype.buildCanvas=function(t){this.width=parseInt(this.config.width||this.$container.width(),10)||300;this.height=parseInt(this.config.height||this.$container.height(),10)||300;this.$canvas=e('