{ "pandav:/bar.js": { "cubeCode": "Cube('pandav:/com/ml-bar-hori-capsule/3.0.20/bar',['pandav:/npm/bcore/0.0.22/event','pandav:/npm/dchart-bar-hori-stack-capsule/0.3.22','pandav:/npm/jquery/2.1.4','pandav:/npm/d3/3.5.12','pandav:/npm/lodash/4.17.11','pandav:/com/maliang-utils/0.0.21'],function(a,b,d){function e(a){return p.isNumber(a)&&!p.isNaN(a)&&p.isFinite(a)?a:null}function f(a){var b=a.chart.numericalLabel;return Object.assign({},b.textStyle,{emptyData:b.emptyData,pos:b.pos,show:b.show,dx:'right-outer'===b.pos?'0.15em':0})}function g(a,b){var d=p.cloneDeep(a),f={};f.show=d.isShow;var g=d.extent;if(null===e(p.toNumber(g.max))?'dataMax'===g.max?(f.maxAmount='dataMax',f.maxNeedNice=!1):(f.maxAmount=null,f.maxNeedNice=!0):(f.maxAmount=g.max,f.maxNeedNice=!1),null===e(p.toNumber(g.min))?'dataMin'===g.min?(f.minAmount='dataMin',f.minNeedNice=!1):(f.minAmount=null,f.minNeedNice=!0):(f.minAmount=g.min,f.minNeedNice=!1),d.label.format&&d.label.format.includes('%')){switch(d.label.format){case'%':f.tickFormat='.0f';break;case'.1%':f.tickFormat='.2f';break;case'.2%':default:f.tickFormat='.4f'}var h=o.format(d.label.format);f.format=d.label.format,f.label.format=function(a){return h(a.y&&a.y.value)}}else f.format=null,f.tickFormat=b.label.format||function(a){return a};var i=d.label.textarea;f.fontSize=i.fontSize||null,f.fontColor=i.color,f.fontStrokeWidth=i.fontStrokeWidth,f.fontWeight=i.fontWeight,f.fontFamily=i.fontFamily,f.textShow=d.label.show,f.assistLine=d.axisLine.show,f.assistLineColor=d.axisLine.color;var j=d.label.display;return f.ticks=j.amount||null,f.rotate=p.toNumber(j.angle),f.label=f.textShow&&j.unit||null,f.net=d.grid.show,f.netColor=d.grid.color,f}function h(a,b){var d=p.cloneDeep(a),e={};e.show=d.isShow,e.padding=[d.interval,d.boundaryGap];var f=d.label.textarea;e.fontSize=f.fontSize||null,e.fontColor=f.color,e.fontStrokeWidth=f.fontStrokeWidth,e.fontWeight=f.fontWeight,e.textShow=d.label.show,e.assistLine=d.axisLine.show,e.assistLineColor=d.axisLine.color,e.net=d.grid.show,e.netColor=d.grid.color;var g=d.label.display;return e.ticks=g.amount&&parseInt(g.amount)?parseInt(g.amount):b.length||null,e.rotate=p.toNumber(g.angle),e.label=e.textShow&&g.unit||null,e.dy=0===e.rotate?10:5,e}function i(a){if(a&&a.others&&a.others.animation){var b=a.others.animation,d={},e=b.enter,f=b.update,g=b.setting;return Object.assign(d,Object.assign({},e)),Object.assign(d,Object.assign({},f)),Object.assign(d,Object.assign({},g)),d.animation=b.show,d}return{}}function j(a){if(!a)return{};var b=p.cloneDeep(a),d=a.trigger,e=a.axisPointer,f=a.textStyle,g=a.bgBox;if(d&&d.action&&(b.triggerMethod=d.action),d&&d.type&&(b.trigger=d.type),a.beforeFormat&&(b.beforeFormat=a.beforeFormat),b.formatter='horiBarChart',void 0!==a.enterFocus&&(b.enterFocus=a.enterFocus),void 0!==a.hideDelay&&(b.hideDelay=a.hideDelay),e&&e._type&&(b.axisPointer=e._type),e&&e.lineStyle&&(b.lineStyle=e.lineStyle),f&&(b.color=f.color,b.fontSize=f.fontSize+'px',b.fontFamily=f.fontFamily,b.fontWeight=f.fontWeight),g){var h=g.offset,i=g.border,j=g.customSize;b.backgroundColor=g.backgroundColor,h&&void 0!==h.xOffset&&(b.xOffset=h.xOffset),h&&void 0!==h.yOffset&&(b.yOffset=h.yOffset),j&&(b.autoSize=!j.show,b.width=j.width,b.height=j.height),i&&(i.borderColor&&(b.borderColor=i.borderColor),void 0!==i.borderWidth&&(b.borderWidth=i.borderWidth))}return b}function k(a,b){var d=p.cloneDeep(a.chart);d.label=f(a);var e=a.axis.xaxis,k=a.axis.yaxis;d.xaxis=g(e,d),d.yaxis=h(k,b),d.series=p.clone(a.series.series),d.frame={color:a.chart.bar.color,thickness:a.chart.bar.thickness},d.paddingColor=a.chart.bar.paddingColor,d.thickness=a.chart.bar.thickness,d.color=a.chart.bar.color,d.hullPadding=a.chart.bar.hullPadding,d.background={show:!0,color:a.chart.bar.bgColor};var l=a.chart.margin,m=l.right,n=l.top;return d.margin.top=n?n:d.yaxis&&d.yaxis.label&&''!==d.yaxis.label&&3*d.yaxis.fontSize||0,d.margin.right=m?m:d.xaxis&&c.xaxis.label&&''!==d.xaxis.label&&2*(d.xaxis.label.length*d.xaxis.fontSize)||0,Object.assign(d,i(a)),a.others.tooltip&&(d.tooltip=j(a.others.tooltip,b)),d}var l=d('pandav:/npm/bcore/0.0.22/event'),m=d('pandav:/npm/dchart-bar-hori-stack-capsule/0.3.22'),n=d('pandav:/npm/jquery/2.1.4'),o=d('pandav:/npm/d3/3.5.12'),p=d('pandav:/npm/lodash/4.17.11'),q=d('pandav:/com/maliang-utils/0.0.21'),r=Symbol();return a.exports=l.extend(function(a,b){this.config={theme:{},chart:{background:'transparent',margin:{top:50,bottom:70,left:70,right:70,containLabel:!0},bar:{hullPadding:4}},axis:{xaxis:{tickSize:2},yaxis:{tickSize:2}},legend:{},series:[{value:'1',color:'#2F8FBE'}],tooltip:{show:!0,trigger:'item',triggerMethod:'hover',beforeFormat:null,formatter:'horiBarChart',enterFocus:!0,axisPointer:{show:!0,_type:'line',lineStyle:{color:'#f00',width:1,_type:'solid'}},hideDelay:300,textStyle:{color:'#fff',fontSize:14,fontFamily:'Microsoft Yahei',fontWeight:'normal'},bgBox:{color:'rgba(0, 0, 0, 0.65)',padding:10,xOffset:6,yOffset:10,customSize:{show:!1,width:300,height:150},borderColor:'#333',borderWidth:0}}},this.container=n(a),this.init(b)},{init:function(a){this.apis=a.apis;var b=this.mergeConfig(a);this.chart=new m(this.container[0],b.chart)},isSafeNumber:function(a){return p.isNumber(a)&&!p.isNaN(a)&&p.isFinite(a)?a:null},render:function(a,b){var d=this.mergeConfig(b);a=this.data(a,d),a&&a.length&&a&&this.chart.render(a,k(d,a)),this.updateStyle()},updateStyle:function(){var a=this.chart.el,b=this.config;if(a){a.select('.con-svg').style('background','transparent'),a.selectAll('.serie:not(.serie-single)').style('stroke',b.chart.bar.paddingColor||'transparent');var d=a.selectAll('.serie-label'),e=window.navigator&&window.navigator.userAgent,f=e&&/MSIE|Trident|Edge/.test(e);if(f){var g=a.select('.serie-bg'),h=g.node().getBBox().height;d.attr('transform','translate(0, '+h/2+')')}else d.style('dominant-baseline','middle');switch(b.chart.numericalLabel.pos){case'center':d.style('text-anchor','middle');break;case'left':d.style('text-anchor','start');break;case'right':d.style('text-anchor','end');break;case'right-outer':d.style('text-anchor','')}d.style('font-family',p.get(b,'chart.numericalLabel.textStyle.fontFamily','Microsoft Yahei'));var i=p.get(this.config,'axis.xaxis.label.format');if(i&&i.includes('%')){var j=o.format(''+i);a.selectAll('.axis1 .tick text').text(function(a){return p.isFunction(j)&&j(a)||a})}}},setColors:function(){},hasS:function(a){var b=0;return p.map(a,function(a){return void 0!==a.s&&b++}),b===a.length||0!==b&&!1},setOriginalData:function(a){this[r]=a},getOriginalData:function(){return this[r]},data:function(a,b){a&&this.setOriginalData(a),a||(a=this.getOriginalData());var d=b.chart.loadAmount||2e3;if(d&&(a=a.slice(0,d)),a&&(this.__data=p.cloneDeep(a)),!!this.__data)return this._data=this.hasS(this.__data)?q.threeD2Two(this.__data,'x','y','s',q.getSeriesValue(this.__data,'s')):p.cloneDeep(this.__data).map(function(a){return a.y={value:a.y,data:p.clone(a)},a}),this._data},mergeConfig:function(a){return a?(this.config.theme=p.defaultsDeep(a.theme||{},this.config.theme),this.setColors(),a.series&&(this.config.series=a.series),this.config=p.defaultsDeep(a||{},this.config),this.config):this.config},resize:function(a,b){this.config.chart.width=a,this.config.chart.height=b,this.render()},clear:function(){this.chart&&this.chart.empty()},destroy:function(){this.chart&&this.chart.off(),this.chart&&this.chart.destroy(),this._data=this.__data=null}}),a.exports});", "requires": [], "buildLevel": 2, "outputDir": "/com/ml-bar-hori-capsule/3.0.20", "outputPath": "/com/ml-bar-hori-capsule/3.0.20/bar.js", "fileName": "/bar.js" }, "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/ml-bar-hori-capsule/3.0.20',['pandav:/npm/bcore/0.0.22/event','pandav:/npm/jquery/2.1.4','pandav:/npm/lodash/4.17.11','pandav:/com/maliang-utils/0.0.21','pandav:/com/ml-bar-hori-capsule/3.0.20/bar','pandav:/com/legend/0.1.5','pandav:/com/ml-bar-hori-capsule/3.0.20/defaultConfig'],function(a,b,c){var d=c('pandav:/npm/bcore/0.0.22/event'),e=c('pandav:/npm/jquery/2.1.4'),f=c('pandav:/npm/lodash/4.17.11'),g=c('pandav:/com/maliang-utils/0.0.21'),h=c('pandav:/com/ml-bar-hori-capsule/3.0.20/bar'),i=c('pandav:/com/legend/0.1.5'),j=c('pandav:/com/ml-bar-hori-capsule/3.0.20/defaultConfig');return a.exports=d.extend(function(a,b){this.config=f.cloneDeep(j)||{theme:{},chart:{background:'transparent',margin:{top:36,bottom:10,left:20,right:40}},axis:{xaxis:{tickSize:2},yaxis:{tickSize:2}},legend:{innerStyle:{\"line-height\":1.3}},series:[{value:'1',color:'#2F8FBE'}],animation:{show:!0,animationDuration:1e3,animationEasing:'cubicInOut',animationDurationUpdate:300,animationUpdateFromPrevious:!0,animationAfterPreviousSeries:!1}},this.container=e(a).css('padding','10px 0'),this.chart=null,this.legend=null,this.init(b)},{init:function(a){var b=a&&a.options||a;this.apis=b.apis;var c=this.mergeConfig(b),d=c.chart.legend,g=d.layout.loc.split('-')[0];this.chartDom=e('
'),this.legendDom=e(''),'bottom'===g?(this.container.append(this.chartDom),this.container.append(this.legendDom)):(this.container.append(this.legendDom),this.container.append(this.chartDom)),this.legend=new i(this.legendDom[0],d),this.legend.render(c.series.series,d),this.chartDom.height(this.container.height()-(d.show&&this.legendDom.height()||0)),this.chart=new h(this.chartDom[0],f.cloneDeep(c)),this.legendDom.css('display',d.show&&'block'||'none'),this._bindEvent()},render:function(a,b){var c=b&&b.options||b,d=this.mergeConfig(c);if(a=this.data(a),a&&a.length){var e=g.conflictConfigWithData(d,a,[{configField:{type:'array',field:'serieName',parent:'series.series'},dataField:'s',priority:'config',newConfigField:'showName'}]);this.legend.render(e.series.series,e.chart.legend),this.config.chart.height=this.container.height()-(this.config.chart.legend.show&&this.legendDom.height()||0),this.chartDom.height(this.config.chart.height),a&&this.chart.render(a,e),this._cfg=e}},updateStyle:function(){},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){var c=b-(this.config.chart.legend.show&&this.legendDom.outerHeight()||0)-20;this.chartDom.height(b),this.mergeConfig({chart:{width:a,height:c}}),this.chart.resize(a,c)},updateLegendLayout:function(a){var b=this.config.chart.legend;if(b.show!==a.show&&(this.legendDom.css('display',a.show&&'block'||'none'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.height()||0)),a.show){if(b.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.height()||0)),JSON.stringify(b.layout.margin)!==JSON.stringify(a.layout.margin)){var c=a.layout.margin;this.legendDom.find('.legend-item').css('margin',c.vertiInterval+'px '+c.horiInterval+'px'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.height()||0)}var d=b.layout.loc.split('-')[0],e=a.layout.loc.split('-')[0];d!==e&&('top'===e?this.container[0].appendChild(this.chartDom[0]):'bottom'===e&&this.container[0].appendChild(this.legendDom[0]))}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))return!1;if(this._cfg){this.chart.chart.clearAllAnimation();var a=this._cfg.others.animation,b=a.update,c=a.enter,d=a.animationUpdateFromPrevious;b.animationUpdateFromPrevious=!1;var e=b.animationDurationUpdate;b.animationDurationUpdate=c.animationDuration,this.chart.render(this._data,this._cfg),b.animationDurationUpdate=e,b.animationUpdateFromPrevious=d}},clearAnimate:function(){this.chart&&this.chart.chart&&this.chart.chart.resumeToAnimationEnd()},_bindEvent:function(){var a=this;if(this.chart&&this.chart.chart){var b=this.chart.chart;['click'].forEach(function(c){b.on(c,function(b){var d=b.data;return a.emit(c,d)})})}},highlight:function(){var a=0