{ "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/ml-line-double/3.0.19',['pandav:/npm/bcore/0.0.22/event','pandav:/npm/lodash/4.17.11','pandav:/com/ml-line-double/3.0.19/line','pandav:/com/legend/0.1.5','pandav:/com/ml-line-double/3.0.19/defaultConfig','pandav:/npm/jquery/2.1.4'],function(a,b,c){function d(a){if(!a||!a.series)return[];var b=a.series,c=b.series1,d=b.series2,e=[];return c&&e.push({showName:c.serieName,color:c.line.color}),d&&e.push({showName:d.serieName,color:d.line.color}),e}var e=c('pandav:/npm/bcore/0.0.22/event'),f=c('pandav:/npm/lodash/4.17.11'),g=c('pandav:/com/ml-line-double/3.0.19/line'),h=c('pandav:/com/legend/0.1.5'),i=c('pandav:/com/ml-line-double/3.0.19/defaultConfig'),j=c('pandav:/npm/jquery/2.1.4');return a.exports=e.extend(function(a,b){this.config=f.cloneDeep(i),this.container=j(a).css('padding','10px 0'),this.chart=null,this.legend=null,this.init(b)},{init:function(a){this.apis=a.apis;var b=this.mergeConfig(a),c=b.chart.legend,e=c.layout.loc.split('-')[0];this.chartDom=j('
'),this.legendDom=j(''),'bottom'===e?(this.container.append(this.chartDom),this.container.append(this.legendDom)):(this.container.append(this.legendDom),this.container.append(this.chartDom)),this.legend=new h(this.legendDom[0],c),this.legend.render(d(b),c),this.chartDom.height(this.container.height()-(c.show&&this.legendDom.height()||0)),this.chart=new g(this.chartDom[0],f.cloneDeep(b)),this.legendDom.css('display',c.show&&'block'||'none'),this._bindEvent()},render:function(a,b){var c=this.mergeConfig(b&&(b.options||b));a=this.data(a),a&&a.length&&(this.legend.render(d(c),c.chart.legend),this.chartDom.height(this.container.height()-(c.chart.legend.show&&this.legendDom.height()||0)),a&&this.chart.render(a,c),this._cfg=c)},updateStyle:function(){},updateOptions:function(a){var b=a&&(a.options||a),c=b.chart.legend,d=this.config.chart.legend;f.isEqual(c,d)||this.updateLegendLayout(c,!0),this.render(null,a)},setColors:function(){},data:function(a){return a&&(this._data=f.clone(a)),this._data.length&&this._data.forEach(function(a){a.y=f.toNumber(a.y)}),this._data},mergeConfig:function(a){return a?(this.config.theme=f.defaultsDeep(a.theme||{},this.config.theme),this.setColors(),a.series&&(this.config.series=a.series),this.config=f.defaultsDeep(a||{},this.config),this.config):this.config},resize:function(a,b){this.chart.resize(a,b-(this.config.chart.legend.show&&this.legendDom.outerHeight()||0)-20)},updateLegendLayout:function(a,b){var c=this.config.chart.legend;if(c.show!==a.show&&(this.legendDom.css('display',a.show&&'block'||'none'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)),c.textarea.fontSize!==a.textarea.fontSize&&(this.legendDom.find('.legend-item').css('fontSize',a.textarea.fontSize),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)),JSON.stringify(c.layout.margin)!==JSON.stringify(a.layout.margin)){var d=a.layout.margin;this.legendDom.find('.legend-item').css('margin',d.vertiInterval+'px '+d.horiInterval+'px'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)}var e=c.layout.loc.split('-')[0],f=a.layout.loc.split('-')[0];e!==f&&('top'===f?this.container[0].appendChild(this.chartDom[0]):'bottom'===f&&this.container[0].appendChild(this.legendDom[0])),b||this.render(null,{chart:{legend:a}})},clear:function(){this.chart&&this.chart.clear(),this.legend&&f.isFunction(this.legend.clear)&&this.legend.clear()},destroy:function(){this.chart&&this.chart.destroy(),this.chart=null,this.legend&&this.legend.destroy(),this.legend=null,this.chartDom=null,this.legendDom=null,this.container&&this.container.empty(),this._data=null},startAnimate:function(){if(!(this.chart&&this.chart.chart&&this.chart.chart))return!1;if(this._cfg){this.chart.chart.clearAllAnimation();var a=this._cfg.animation;if(a&&a.animationUpdateFromPrevious){var b=a.animationUpdateFromPrevious;a.animationUpdateFromPrevious=!1;var c=a.animationDurationUpdate;a.animationDurationUpdate=a.animationDuration,this.chart.render(),a.animationDurationUpdate=c,a.animationUpdateFromPrevious=b}}},clearAnimate:function(){this.chart&&this.chart.chart&&this.chart.chart.resumeToAnimationEnd()},_bindEvent:function(){if(this.chart&&this.chart.chart){var a=this.chart.chart,b=this;['click'].forEach(function(c){a.on(c,function(a){var d=a.data;return b.emit(c,d)})})}},highlight:function(){var a=0