(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i1&&arguments[1]!==undefined?arguments[1]:false;if(!option||(0,_typeof2["default"])(option)!=="object"){console.error("setOption Missing parameters!");return false}if(animationEnd)this.render.graphs.forEach(function(graph){return graph.animationEnd()});var optionCloned=(0,_util.deepClone)(option,true);(0,_core.mergeColor)(this,optionCloned);(0,_core.grid)(this,optionCloned);(0,_core.axis)(this,optionCloned);(0,_core.radarAxis)(this,optionCloned);(0,_core.title)(this,optionCloned);(0,_core.bar)(this,optionCloned);(0,_core.line)(this,optionCloned);(0,_core.pie)(this,optionCloned);(0,_core.radar)(this,optionCloned);(0,_core.gauge)(this,optionCloned);(0,_core.legend)(this,optionCloned);this.option=option;this.render.launchAnimation()};Charts.prototype.resize=function(){var container=this.container,canvas=this.canvas,render=this.render,option=this.option;var clientWidth=container.clientWidth,clientHeight=container.clientHeight;canvas.setAttribute("width",clientWidth);canvas.setAttribute("height",clientHeight);render.area=[clientWidth,clientHeight];this.setOption(option)}},{"../core":20,"../extend/index":28,"@babel/runtime/helpers/classCallCheck":34,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/typeof":43,"@jiaminghi/c-render":52,"@jiaminghi/c-render/lib/plugin/util":54}],3:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.doUpdate=doUpdate;exports.Updater=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var Updater=function Updater(config,series){(0,_classCallCheck2["default"])(this,Updater);var chart=config.chart,key=config.key,getGraphConfig=config.getGraphConfig;if(typeof getGraphConfig!=="function"){console.warn("Updater need function getGraphConfig!");return}if(!chart[key])this.graphs=chart[key]=[];Object.assign(this,config);this.update(series)};exports.Updater=Updater;Updater.prototype.update=function(series){var _this=this;var graphs=this.graphs,beforeUpdate=this.beforeUpdate;delRedundanceGraph(this,series);if(!series.length)return;var beforeUpdateType=(0,_typeof2["default"])(beforeUpdate);series.forEach(function(seriesItem,i){if(beforeUpdateType==="function")beforeUpdate(graphs,seriesItem,i,_this);var cache=graphs[i];if(cache){changeGraphs(cache,seriesItem,i,_this)}else{addGraphs(graphs,seriesItem,i,_this)}})};function delRedundanceGraph(updater,series){var graphs=updater.graphs,render=updater.chart.render;var cacheGraphNum=graphs.length;var needGraphNum=series.length;if(cacheGraphNum>needGraphNum){var needDelGraphs=graphs.splice(needGraphNum);needDelGraphs.forEach(function(item){return item.forEach(function(g){return render.delGraph(g)})})}}function changeGraphs(cache,seriesItem,i,updater){var getGraphConfig=updater.getGraphConfig,render=updater.chart.render,beforeChange=updater.beforeChange;var configs=getGraphConfig(seriesItem,updater);balanceGraphsNum(cache,configs,render);cache.forEach(function(graph,j){var config=configs[j];if(typeof beforeChange==="function")beforeChange(graph,config);updateGraphConfigByKey(graph,config)})}function balanceGraphsNum(graphs,graphConfig,render){var cacheGraphNum=graphs.length;var needGraphNum=graphConfig.length;if(needGraphNum>cacheGraphNum){var lastCacheGraph=graphs.slice(-1)[0];var needAddGraphNum=needGraphNum-cacheGraphNum;var needAddGraphs=new Array(needAddGraphNum).fill(0).map(function(foo){return render.clone(lastCacheGraph)});graphs.push.apply(graphs,(0,_toConsumableArray2["default"])(needAddGraphs))}else if(needGraphNum0&&arguments[0]!==undefined?arguments[0]:{},chart=_ref.chart,series=_ref.series,key=_ref.key,getGraphConfig=_ref.getGraphConfig,getStartGraphConfig=_ref.getStartGraphConfig,beforeChange=_ref.beforeChange,beforeUpdate=_ref.beforeUpdate,afterAddGraph=_ref.afterAddGraph;if(chart[key]){chart[key].update(series)}else{chart[key]=new Updater({chart:chart,key:key,getGraphConfig:getGraphConfig,getStartGraphConfig:getStartGraphConfig,beforeChange:beforeChange,beforeUpdate:beforeUpdate,afterAddGraph:afterAddGraph},series)}}},{"@babel/runtime/helpers/classCallCheck":34,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/toConsumableArray":42,"@babel/runtime/helpers/typeof":43}],4:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.yAxisConfig=exports.xAxisConfig=void 0;var xAxisConfig={name:"",show:true,position:"bottom",nameGap:15,nameLocation:"end",nameTextStyle:{fill:"#333",fontSize:10},min:"20%",max:"20%",interval:null,minInterval:null,maxInterval:null,boundaryGap:null,splitNumber:5,axisLine:{show:true,style:{stroke:"#333",lineWidth:1}},axisTick:{show:true,style:{stroke:"#333",lineWidth:1}},axisLabel:{show:true,formatter:null,style:{fill:"#333",fontSize:10,rotate:0}},splitLine:{show:false,style:{stroke:"#d4d4d4",lineWidth:1}},rLevel:-20,animationCurve:"easeOutCubic",animationFrame:50};exports.xAxisConfig=xAxisConfig;var yAxisConfig={name:"",show:true,position:"left",nameGap:15,nameLocation:"end",nameTextStyle:{fill:"#333",fontSize:10},min:"20%",max:"20%",interval:null,minInterval:null,maxInterval:null,boundaryGap:null,splitNumber:5,axisLine:{show:true,style:{stroke:"#333",lineWidth:1}},axisTick:{show:true,style:{stroke:"#333",lineWidth:1}},axisLabel:{show:true,formatter:null,style:{fill:"#333",fontSize:10,rotate:0}},splitLine:{show:true,style:{stroke:"#d4d4d4",lineWidth:1}},rLevel:-20,animationCurve:"easeOutCubic",animationFrame:50};exports.yAxisConfig=yAxisConfig},{}],5:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.barConfig=void 0;var barConfig={show:true,name:"",stack:"",shapeType:"normal",echelonOffset:10,barWidth:"auto",barGap:"30%",barCategoryGap:"20%",xAxisIndex:0,yAxisIndex:0,data:[],backgroundBar:{show:false,width:"auto",style:{fill:"rgba(200, 200, 200, .4)"}},label:{show:false,position:"top",offset:[0,-10],formatter:null,style:{fontSize:10}},gradient:{color:[],local:true},barStyle:{},independentColor:false,independentColors:[],rLevel:0,animationCurve:"easeOutCubic",animationFrame:50};exports.barConfig=barConfig},{}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.colorConfig=void 0;var colorConfig=["#37a2da","#32c5e9","#67e0e3","#9fe6b8","#ffdb5c","#ff9f7f","#fb7293","#e062ae","#e690d1","#e7bcf3","#9d96f5","#8378ea","#96bfff"];exports.colorConfig=colorConfig},{}],7:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.gaugeConfig=void 0;var gaugeConfig={show:true,name:"",radius:"60%",center:["50%","50%"],startAngle:-(Math.PI/4)*5,endAngle:Math.PI/4,min:0,max:100,splitNum:5,arcLineWidth:15,data:[],dataItemStyle:{},axisTick:{show:true,tickLength:6,style:{stroke:"#999",lineWidth:1}},axisLabel:{show:true,data:[],formatter:null,labelGap:5,style:{}},pointer:{show:true,valueIndex:0,style:{scale:[1,1],fill:"#fb7293"}},details:{show:false,formatter:null,offset:[0,0],valueToFixed:0,position:"center",style:{fontSize:20,fontWeight:"bold",textAlign:"center",textBaseline:"middle"}},backgroundArc:{show:true,style:{stroke:"#e0e0e0"}},rLevel:10,animationCurve:"easeOutCubic",animationFrame:50};exports.gaugeConfig=gaugeConfig},{}],8:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.gridConfig=void 0;var gridConfig={left:"10%",right:"10%",top:60,bottom:60,style:{fill:"rgba(0, 0, 0, 0)"},rLevel:-30,animationCurve:"easeOutCubic",animationFrame:30};exports.gridConfig=gridConfig},{}],9:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.changeDefaultConfig=changeDefaultConfig;Object.defineProperty(exports,"colorConfig",{enumerable:true,get:function get(){return _color.colorConfig}});Object.defineProperty(exports,"gridConfig",{enumerable:true,get:function get(){return _grid.gridConfig}});Object.defineProperty(exports,"xAxisConfig",{enumerable:true,get:function get(){return _axis.xAxisConfig}});Object.defineProperty(exports,"yAxisConfig",{enumerable:true,get:function get(){return _axis.yAxisConfig}});Object.defineProperty(exports,"titleConfig",{enumerable:true,get:function get(){return _title.titleConfig}});Object.defineProperty(exports,"lineConfig",{enumerable:true,get:function get(){return _line.lineConfig}});Object.defineProperty(exports,"barConfig",{enumerable:true,get:function get(){return _bar.barConfig}});Object.defineProperty(exports,"pieConfig",{enumerable:true,get:function get(){return _pie.pieConfig}});Object.defineProperty(exports,"radarAxisConfig",{enumerable:true,get:function get(){return _radarAxis.radarAxisConfig}});Object.defineProperty(exports,"radarConfig",{enumerable:true,get:function get(){return _radar.radarConfig}});Object.defineProperty(exports,"gaugeConfig",{enumerable:true,get:function get(){return _gauge.gaugeConfig}});Object.defineProperty(exports,"legendConfig",{enumerable:true,get:function get(){return _legend.legendConfig}});exports.keys=void 0;var _color=require("./color");var _grid=require("./grid");var _axis=require("./axis");var _title=require("./title");var _line=require("./line");var _bar=require("./bar");var _pie=require("./pie");var _radarAxis=require("./radarAxis");var _radar=require("./radar");var _gauge=require("./gauge");var _legend=require("./legend");var _util=require("../util");var allConfig={colorConfig:_color.colorConfig,gridConfig:_grid.gridConfig,xAxisConfig:_axis.xAxisConfig,yAxisConfig:_axis.yAxisConfig,titleConfig:_title.titleConfig,lineConfig:_line.lineConfig,barConfig:_bar.barConfig,pieConfig:_pie.pieConfig,radarAxisConfig:_radarAxis.radarAxisConfig,radarConfig:_radar.radarConfig,gaugeConfig:_gauge.gaugeConfig,legendConfig:_legend.legendConfig};function changeDefaultConfig(key,config){if(!allConfig["".concat(key,"Config")]){console.warn("Change default config Error - Invalid key!");return}(0,_util.deepMerge)(allConfig["".concat(key,"Config")],config)}var keys=["color","title","legend","xAxis","yAxis","grid","radarAxis","line","bar","pie","radar","gauge"];exports.keys=keys},{"../util":30,"./axis":4,"./bar":5,"./color":6,"./gauge":7,"./grid":8,"./legend":10,"./line":11,"./pie":12,"./radar":13,"./radarAxis":14,"./title":15}],10:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.legendConfig=void 0;var legendConfig={show:true,orient:"horizontal",left:"auto",right:"auto",top:"auto",bottom:"auto",itemGap:10,iconWidth:25,iconHeight:10,selectAble:true,data:[],textStyle:{fontFamily:"Arial",fontSize:13,fill:"#000"},iconStyle:{},textUnselectedStyle:{fontFamily:"Arial",fontSize:13,fill:"#999"},iconUnselectedStyle:{fill:"#999"},rLevel:20,animationCurve:"easeOutCubic",animationFrame:50};exports.legendConfig=legendConfig},{}],11:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.lineConfig=void 0;var lineConfig={show:true,name:"",stack:"",smooth:false,xAxisIndex:0,yAxisIndex:0,data:[],lineStyle:{lineWidth:1},linePoint:{show:true,radius:2,style:{fill:"#fff",lineWidth:1}},lineArea:{show:false,gradient:[],style:{opacity:.5}},label:{show:false,position:"top",offset:[0,-10],formatter:null,style:{fontSize:10}},rLevel:10,animationCurve:"easeOutCubic",animationFrame:50};exports.lineConfig=lineConfig},{}],12:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.pieConfig=void 0;var pieConfig={show:true,name:"",radius:"50%",center:["50%","50%"],startAngle:-Math.PI/2,roseType:false,roseSort:true,roseIncrement:"auto",data:[],insideLabel:{show:false,formatter:"{percent}%",style:{fontSize:10,fill:"#fff",textAlign:"center",textBaseline:"middle"}},outsideLabel:{show:true,formatter:"{name}",style:{fontSize:11},labelLineBendGap:"20%",labelLineEndLength:50,labelLineStyle:{lineWidth:1}},pieStyle:{},percentToFixed:0,rLevel:10,animationDelayGap:60,animationCurve:"easeOutCubic",startAnimationCurve:"easeOutBack",animationFrame:50};exports.pieConfig=pieConfig},{}],13:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.radarConfig=void 0;var radarConfig={show:true,name:"",data:[],radarStyle:{lineWidth:1},point:{show:true,radius:2,style:{fill:"#fff"}},label:{show:true,offset:[0,0],labelGap:5,formatter:null,style:{fontSize:10}},rLevel:10,animationCurve:"easeOutCubic",animationFrane:50};exports.radarConfig=radarConfig},{}],14:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.radarAxisConfig=void 0;var radarAxisConfig={show:true,center:["50%","50%"],radius:"65%",startAngle:-Math.PI/2,splitNum:5,polygon:false,axisLabel:{show:true,labelGap:15,color:[],style:{fill:"#333"}},axisLine:{show:true,color:[],style:{stroke:"#999",lineWidth:1}},splitLine:{show:true,color:[],style:{stroke:"#d4d4d4",lineWidth:1}},splitArea:{show:false,color:["#f5f5f5","#e6e6e6"],style:{}},rLevel:-10,animationCurve:"easeOutCubic",animationFrane:50};exports.radarAxisConfig=radarAxisConfig},{}],15:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.titleConfig=void 0;var titleConfig={show:true,text:"",offset:[0,-20],style:{fill:"#333",fontSize:17,fontWeight:"bold",textAlign:"center",textBaseline:"bottom"},rLevel:20,animationCurve:"easeOutCubic",animationFrame:50};exports.titleConfig=titleConfig},{}],16:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.axis=axis;var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _updater=require("../class/updater.class");var _config=require("../config");var _util=require("../util");var _util2=require("@jiaminghi/c-render/lib/plugin/util");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};var xAxis=option.xAxis,yAxis=option.yAxis,series=option.series;var allAxis=[];if(xAxis&&yAxis&&series){allAxis=getAllAxis(xAxis,yAxis);allAxis=mergeDefaultAxisConfig(allAxis);allAxis=allAxis.filter(function(_ref){var show=_ref.show;return show});allAxis=mergeDefaultBoundaryGap(allAxis);allAxis=calcAxisLabelData(allAxis,series);allAxis=setAxisPosition(allAxis);allAxis=calcAxisLinePosition(allAxis,chart);allAxis=calcAxisTickPosition(allAxis,chart);allAxis=calcAxisNamePosition(allAxis,chart);allAxis=calcSplitLinePosition(allAxis,chart)}(0,_updater.doUpdate)({chart:chart,series:allAxis,key:"axisLine",getGraphConfig:getLineConfig});(0,_updater.doUpdate)({chart:chart,series:allAxis,key:"axisTick",getGraphConfig:getTickConfig});(0,_updater.doUpdate)({chart:chart,series:allAxis,key:"axisLabel",getGraphConfig:getLabelConfig});(0,_updater.doUpdate)({chart:chart,series:allAxis,key:"axisName",getGraphConfig:getNameConfig});(0,_updater.doUpdate)({chart:chart,series:allAxis,key:"splitLine",getGraphConfig:getSplitLineConfig});chart.axisData=allAxis}function getAllAxis(xAxis,yAxis){var allXAxis=[],allYAxis=[];if(xAxis instanceof Array){var _allXAxis;(_allXAxis=allXAxis).push.apply(_allXAxis,(0,_toConsumableArray2["default"])(xAxis))}else{allXAxis.push(xAxis)}if(yAxis instanceof Array){var _allYAxis;(_allYAxis=allYAxis).push.apply(_allYAxis,(0,_toConsumableArray2["default"])(yAxis))}else{allYAxis.push(yAxis)}allXAxis.splice(2);allYAxis.splice(2);allXAxis=allXAxis.map(function(axis,i){return _objectSpread({},axis,{index:i,axis:"x"})});allYAxis=allYAxis.map(function(axis,i){return _objectSpread({},axis,{index:i,axis:"y"})});return[].concat((0,_toConsumableArray2["default"])(allXAxis),(0,_toConsumableArray2["default"])(allYAxis))}function mergeDefaultAxisConfig(allAxis){var xAxis=allAxis.filter(function(_ref2){var axis=_ref2.axis;return axis==="x"});var yAxis=allAxis.filter(function(_ref3){var axis=_ref3.axis;return axis==="y"});xAxis=xAxis.map(function(axis){return(0,_util.deepMerge)((0,_util2.deepClone)(_config.xAxisConfig),axis)});yAxis=yAxis.map(function(axis){return(0,_util.deepMerge)((0,_util2.deepClone)(_config.yAxisConfig),axis)});return[].concat((0,_toConsumableArray2["default"])(xAxis),(0,_toConsumableArray2["default"])(yAxis))}function mergeDefaultBoundaryGap(allAxis){var valueAxis=allAxis.filter(function(_ref4){var data=_ref4.data;return data==="value"});var labelAxis=allAxis.filter(function(_ref5){var data=_ref5.data;return data!=="value"});valueAxis.forEach(function(axis){if(typeof axis.boundaryGap==="boolean")return;axis.boundaryGap=false});labelAxis.forEach(function(axis){if(typeof axis.boundaryGap==="boolean")return;axis.boundaryGap=true});return[].concat((0,_toConsumableArray2["default"])(valueAxis),(0,_toConsumableArray2["default"])(labelAxis))}function calcAxisLabelData(allAxis,series){var valueAxis=allAxis.filter(function(_ref6){var data=_ref6.data;return data==="value"});var labelAxis=allAxis.filter(function(_ref7){var data=_ref7.data;return data instanceof Array});valueAxis=calcValueAxisLabelData(valueAxis,series);labelAxis=calcLabelAxisLabelData(labelAxis);return[].concat((0,_toConsumableArray2["default"])(valueAxis),(0,_toConsumableArray2["default"])(labelAxis))}function calcValueAxisLabelData(valueAxis,series){return valueAxis.map(function(axis){var minMaxValue=getValueAxisMaxMinValue(axis,series);var _getTrueMinMax=getTrueMinMax(axis,minMaxValue),_getTrueMinMax2=(0,_slicedToArray2["default"])(_getTrueMinMax,2),min=_getTrueMinMax2[0],max=_getTrueMinMax2[1];var interval=getValueInterval(min,max,axis);var formatter=axis.axisLabel.formatter;var label=[];if(minMaxValue[0]===minMaxValue[1]){label=minMaxValue}else if(min<0&&max>0){label=getValueAxisLabelFromZero(min,max,interval)}else{label=getValueAxisLabelFromMin(min,max,interval)}label=label.map(function(l){return parseFloat(l.toFixed(2))});return _objectSpread({},axis,{maxValue:label.slice(-1)[0],minValue:label[0],label:getAfterFormatterLabel(label,formatter)})})}function getValueAxisMaxMinValue(axis,series){series=series.filter(function(_ref8){var show=_ref8.show,type=_ref8.type;if(show===false)return false;if(type==="pie")return false;return true});if(series.length===0)return[0,0];var index=axis.index,axisType=axis.axis;series=mergeStackData(series);var axisName=axisType+"Axis";var valueSeries=series.filter(function(s){return s[axisName]===index});if(!valueSeries.length)valueSeries=series;return getSeriesMinMaxValue(valueSeries)}function getSeriesMinMaxValue(series){if(!series)return;var minValue=Math.min.apply(Math,(0,_toConsumableArray2["default"])(series.map(function(_ref9){var data=_ref9.data;return Math.min.apply(Math,(0,_toConsumableArray2["default"])((0,_util.filterNonNumber)(data)))})));var maxValue=Math.max.apply(Math,(0,_toConsumableArray2["default"])(series.map(function(_ref10){var data=_ref10.data;return Math.max.apply(Math,(0,_toConsumableArray2["default"])((0,_util.filterNonNumber)(data)))})));return[minValue,maxValue]}function mergeStackData(series){var seriesCloned=(0,_util2.deepClone)(series,true);series.forEach(function(item,i){var data=(0,_util.mergeSameStackData)(item,series);seriesCloned[i].data=data});return seriesCloned}function getTrueMinMax(_ref11,_ref12){var min=_ref11.min,max=_ref11.max,axis=_ref11.axis;var _ref13=(0,_slicedToArray2["default"])(_ref12,2),minValue=_ref13[0],maxValue=_ref13[1];var minType=(0,_typeof2["default"])(min),maxType=(0,_typeof2["default"])(max);if(!testMinMaxType(min)){min=axisConfig[axis+"AxisConfig"].min;minType="string"}if(!testMinMaxType(max)){max=axisConfig[axis+"AxisConfig"].max;maxType="string"}if(minType==="string"){min=parseInt(minValue-abs(minValue*parseFloat(min)/100));var lever=getValueLever(min);min=parseFloat((min/lever-.1).toFixed(1))*lever}if(maxType==="string"){max=parseInt(maxValue+abs(maxValue*parseFloat(max)/100));var _lever=getValueLever(max);max=parseFloat((max/_lever+.1).toFixed(1))*_lever}return[min,max]}function getValueLever(value){var valueString=abs(value).toString();var valueLength=valueString.length;var firstZeroIndex=valueString.replace(/0*$/g,"").indexOf("0");var pow10Num=valueLength-1;if(firstZeroIndex!==-1)pow10Num-=firstZeroIndex;return pow(10,pow10Num)}function testMinMaxType(val){var valType=(0,_typeof2["default"])(val);var isValidString=valType==="string"&&/^\d+%$/.test(val);var isValidNumber=valType==="number";return isValidString||isValidNumber}function getValueAxisLabelFromZero(min,max,interval){var negative=[],positive=[];var currentNegative=0,currentPositive=0;do{negative.push(currentNegative-=interval)}while(currentNegative>min);do{positive.push(currentPositive+=interval)}while(currentPositive1)valueInterval=parseInt(valueInterval.toString().replace(/\d$/,"0"));if(valueInterval===0)valueInterval=1;if(typeof minInterval==="number"&&valueIntervalmaxInterval)return maxInterval;return valueInterval}function setAxisPosition(allAxis){var xAxis=allAxis.filter(function(_ref14){var axis=_ref14.axis;return axis==="x"});var yAxis=allAxis.filter(function(_ref15){var axis=_ref15.axis;return axis==="y"});if(xAxis[0]&&!xAxis[0].position)xAxis[0].position=_config.xAxisConfig.position;if(xAxis[1]&&!xAxis[1].position){xAxis[1].position=xAxis[0].position==="bottom"?"top":"bottom"}if(yAxis[0]&&!yAxis[0].position)yAxis[0].position=_config.yAxisConfig.position;if(yAxis[1]&&!yAxis[1].position){yAxis[1].position=yAxis[0].position==="left"?"right":"left"}return[].concat((0,_toConsumableArray2["default"])(xAxis),(0,_toConsumableArray2["default"])(yAxis))}function calcAxisLinePosition(allAxis,chart){var _chart$gridArea=chart.gridArea,x=_chart$gridArea.x,y=_chart$gridArea.y,w=_chart$gridArea.w,h=_chart$gridArea.h;allAxis=allAxis.map(function(axis){var position=axis.position;var linePosition=[];if(position==="left"){linePosition=[[x,y],[x,y+h]].reverse()}else if(position==="right"){linePosition=[[x+w,y],[x+w,y+h]].reverse()}else if(position==="top"){linePosition=[[x,y],[x+w,y]]}else if(position==="bottom"){linePosition=[[x,y+h],[x+w,y+h]]}return _objectSpread({},axis,{linePosition:linePosition})});return allAxis}function calcAxisTickPosition(allAxis,chart){return allAxis.map(function(axisItem){var axis=axisItem.axis,linePosition=axisItem.linePosition,position=axisItem.position,label=axisItem.label,boundaryGap=axisItem.boundaryGap;if(typeof boundaryGap!=="boolean")boundaryGap=axisConfig[axis+"AxisConfig"].boundaryGap;var labelNum=label.length;var _linePosition=(0,_slicedToArray2["default"])(linePosition,2),_linePosition$=(0,_slicedToArray2["default"])(_linePosition[0],2),startX=_linePosition$[0],startY=_linePosition$[1],_linePosition$2=(0,_slicedToArray2["default"])(_linePosition[1],2),endX=_linePosition$2[0],endY=_linePosition$2[1];var gapLength=axis==="x"?endX-startX:endY-startY;var gap=gapLength/(boundaryGap?labelNum:labelNum-1);var tickPosition=new Array(labelNum).fill(0).map(function(foo,i){if(axis==="x"){return[startX+gap*(boundaryGap?i+.5:i),startY]}return[startX,startY+gap*(boundaryGap?i+.5:i)]});var tickLinePosition=getTickLinePosition(axis,boundaryGap,position,tickPosition,gap);return _objectSpread({},axisItem,{tickPosition:tickPosition,tickLinePosition:tickLinePosition,tickGap:gap})})}function getTickLinePosition(axisType,boundaryGap,position,tickPosition,gap){var index=axisType==="x"?1:0;var plus=5;if(axisType==="x"&&position==="top")plus=-5;if(axisType==="y"&&position==="left")plus=-5;var tickLinePosition=tickPosition.map(function(lineStart){var lineEnd=(0,_util2.deepClone)(lineStart);lineEnd[index]+=plus;return[(0,_util2.deepClone)(lineStart),lineEnd]});if(!boundaryGap)return tickLinePosition;index=axisType==="x"?0:1;plus=gap/2;tickLinePosition.forEach(function(_ref16){var _ref17=(0,_slicedToArray2["default"])(_ref16,2),lineStart=_ref17[0],lineEnd=_ref17[1];lineStart[index]+=plus;lineEnd[index]+=plus});return tickLinePosition}function calcAxisNamePosition(allAxis,chart){return allAxis.map(function(axisItem){var nameGap=axisItem.nameGap,nameLocation=axisItem.nameLocation,position=axisItem.position,linePosition=axisItem.linePosition;var _linePosition2=(0,_slicedToArray2["default"])(linePosition,2),lineStart=_linePosition2[0],lineEnd=_linePosition2[1];var namePosition=(0,_toConsumableArray2["default"])(lineStart);if(nameLocation==="end")namePosition=(0,_toConsumableArray2["default"])(lineEnd);if(nameLocation==="center"){namePosition[0]=(lineStart[0]+lineEnd[0])/2;namePosition[1]=(lineStart[1]+lineEnd[1])/2}var index=0;if(position==="top"&&nameLocation==="center")index=1;if(position==="bottom"&&nameLocation==="center")index=1;if(position==="left"&&nameLocation!=="center")index=1;if(position==="right"&&nameLocation!=="center")index=1;var plus=nameGap;if(position==="top"&&nameLocation!=="end")plus*=-1;if(position==="left"&&nameLocation!=="start")plus*=-1;if(position==="bottom"&&nameLocation==="start")plus*=-1;if(position==="right"&&nameLocation==="end")plus*=-1;namePosition[index]+=plus;return _objectSpread({},axisItem,{namePosition:namePosition})})}function calcSplitLinePosition(allAxis,chart){var _chart$gridArea2=chart.gridArea,w=_chart$gridArea2.w,h=_chart$gridArea2.h;return allAxis.map(function(axisItem){var tickLinePosition=axisItem.tickLinePosition,position=axisItem.position,boundaryGap=axisItem.boundaryGap;var index=0,plus=w;if(position==="top"||position==="bottom")index=1;if(position==="top"||position==="bottom")plus=h;if(position==="right"||position==="bottom")plus*=-1;var splitLinePosition=tickLinePosition.map(function(_ref18){var _ref19=(0,_slicedToArray2["default"])(_ref18,1),startPoint=_ref19[0];var endPoint=(0,_toConsumableArray2["default"])(startPoint);endPoint[index]+=plus;return[(0,_toConsumableArray2["default"])(startPoint),endPoint]});if(!boundaryGap)splitLinePosition.shift();return _objectSpread({},axisItem,{splitLinePosition:splitLinePosition})})}function getLineConfig(axisItem){var animationCurve=axisItem.animationCurve,animationFrame=axisItem.animationFrame,rLevel=axisItem.rLevel;return[{name:"polyline",index:rLevel,visible:axisItem.axisLine.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getLineShape(axisItem),style:getLineStyle(axisItem)}]}function getLineShape(axisItem){var linePosition=axisItem.linePosition;return{points:linePosition}}function getLineStyle(axisItem){return axisItem.axisLine.style}function getTickConfig(axisItem){var animationCurve=axisItem.animationCurve,animationFrame=axisItem.animationFrame,rLevel=axisItem.rLevel;var shapes=getTickShapes(axisItem);var style=getTickStyle(axisItem);return shapes.map(function(shape){return{name:"polyline",index:rLevel,visible:axisItem.axisTick.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:style}})}function getTickShapes(axisItem){var tickLinePosition=axisItem.tickLinePosition;return tickLinePosition.map(function(points){return{points:points}})}function getTickStyle(axisItem){return axisItem.axisTick.style}function getLabelConfig(axisItem){var animationCurve=axisItem.animationCurve,animationFrame=axisItem.animationFrame,rLevel=axisItem.rLevel;var shapes=getLabelShapes(axisItem);var styles=getLabelStyle(axisItem,shapes);return shapes.map(function(shape,i){return{name:"text",index:rLevel,visible:axisItem.axisLabel.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:styles[i],setGraphCenter:function setGraphCenter(){return void 0}}})}function getLabelShapes(axisItem){var label=axisItem.label,tickPosition=axisItem.tickPosition,position=axisItem.position;return tickPosition.map(function(point,i){return{position:getLabelRealPosition(point,position),content:label[i].toString()}})}function getLabelRealPosition(points,position){var index=0,plus=10;if(position==="top"||position==="bottom")index=1;if(position==="top"||position==="left")plus=-10;points=(0,_util2.deepClone)(points);points[index]+=plus;return points}function getLabelStyle(axisItem,shapes){var position=axisItem.position;var style=axisItem.axisLabel.style;var align=getAxisLabelRealAlign(position);style=(0,_util.deepMerge)(align,style);var styles=shapes.map(function(_ref20){var position=_ref20.position;return _objectSpread({},style,{graphCenter:position})});return styles}function getAxisLabelRealAlign(position){if(position==="left")return{textAlign:"right",textBaseline:"middle"};if(position==="right")return{textAlign:"left",textBaseline:"middle"};if(position==="top")return{textAlign:"center",textBaseline:"bottom"};if(position==="bottom")return{textAlign:"center",textBaseline:"top"}}function getNameConfig(axisItem){var animationCurve=axisItem.animationCurve,animationFrame=axisItem.animationFrame,rLevel=axisItem.rLevel;return[{name:"text",index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,shape:getNameShape(axisItem),style:getNameStyle(axisItem)}]}function getNameShape(axisItem){var name=axisItem.name,namePosition=axisItem.namePosition;return{content:name,position:namePosition}}function getNameStyle(axisItem){var nameLocation=axisItem.nameLocation,position=axisItem.position,style=axisItem.nameTextStyle;var align=getNameRealAlign(position,nameLocation);return(0,_util.deepMerge)(align,style)}function getNameRealAlign(position,location){if(position==="top"&&location==="start"||position==="bottom"&&location==="start"||position==="left"&&location==="center")return{textAlign:"right",textBaseline:"middle"};if(position==="top"&&location==="end"||position==="bottom"&&location==="end"||position==="right"&&location==="center")return{textAlign:"left",textBaseline:"middle"};if(position==="top"&&location==="center"||position==="left"&&location==="end"||position==="right"&&location==="end")return{textAlign:"center",textBaseline:"bottom"};if(position==="bottom"&&location==="center"||position==="left"&&location==="start"||position==="right"&&location==="start")return{textAlign:"center",textBaseline:"top"}}function getSplitLineConfig(axisItem){var animationCurve=axisItem.animationCurve,animationFrame=axisItem.animationFrame,rLevel=axisItem.rLevel;var shapes=getSplitLineShapes(axisItem);var style=getSplitLineStyle(axisItem);return shapes.map(function(shape){return{name:"polyline",index:rLevel,visible:axisItem.splitLine.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:style}})}function getSplitLineShapes(axisItem){var splitLinePosition=axisItem.splitLinePosition;return splitLinePosition.map(function(points){return{points:points}})}function getSplitLineStyle(axisItem){return axisItem.splitLine.style}},{"../class/updater.class":3,"../config":9,"../util":30,"@babel/runtime/helpers/defineProperty":35,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42,"@babel/runtime/helpers/typeof":43,"@jiaminghi/c-render/lib/plugin/util":54}],17:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.bar=bar;var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _updater=require("../class/updater.class");var _config=require("../config");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _util2=require("../util");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};var xAxis=option.xAxis,yAxis=option.yAxis,series=option.series;var bars=[];if(xAxis&&yAxis&&series){bars=(0,_util2.initNeedSeries)(series,_config.barConfig,"bar");bars=setBarAxis(bars,chart);bars=setBarPositionData(bars,chart);bars=calcBarsPosition(bars,chart)}(0,_updater.doUpdate)({chart:chart,series:bars.slice(-1),key:"backgroundBar",getGraphConfig:getBackgroundBarConfig});bars.reverse();(0,_updater.doUpdate)({chart:chart,series:bars,key:"bar",getGraphConfig:getBarConfig,getStartGraphConfig:getStartBarConfig,beforeUpdate:beforeUpdateBar});(0,_updater.doUpdate)({chart:chart,series:bars,key:"barLabel",getGraphConfig:getLabelConfig})}function setBarAxis(bars,chart){var axisData=chart.axisData;bars.forEach(function(bar){var xAxisIndex=bar.xAxisIndex,yAxisIndex=bar.yAxisIndex;if(typeof xAxisIndex!=="number")xAxisIndex=0;if(typeof yAxisIndex!=="number")yAxisIndex=0;var xAxis=axisData.find(function(_ref){var axis=_ref.axis,index=_ref.index;return"".concat(axis).concat(index)==="x".concat(xAxisIndex)});var yAxis=axisData.find(function(_ref2){var axis=_ref2.axis,index=_ref2.index;return"".concat(axis).concat(index)==="y".concat(yAxisIndex)});var axis=[xAxis,yAxis];var valueAxisIndex=axis.findIndex(function(_ref3){var data=_ref3.data;return data==="value"});bar.valueAxis=axis[valueAxisIndex];bar.labelAxis=axis[1-valueAxisIndex]});return bars}function setBarPositionData(bars,chart){var labelBarGroup=groupBarByLabelAxis(bars);labelBarGroup.forEach(function(group){setBarIndex(group);setBarNum(group);setBarCategoryWidth(group,chart);setBarWidthAndGap(group);setBarAllWidthAndGap(group)});return bars}function setBarIndex(bars){var stacks=getBarStack(bars);stacks=stacks.map(function(stack){return{stack:stack,index:-1}});var currentIndex=0;bars.forEach(function(bar){var stack=bar.stack;if(!stack){bar.barIndex=currentIndex;currentIndex++}else{var stackData=stacks.find(function(_ref4){var s=_ref4.stack;return s===stack});if(stackData.index===-1){stackData.index=currentIndex;currentIndex++}bar.barIndex=stackData.index}})}function groupBarByLabelAxis(bars){var labelAxis=bars.map(function(_ref5){var _ref5$labelAxis=_ref5.labelAxis,axis=_ref5$labelAxis.axis,index=_ref5$labelAxis.index;return axis+index});labelAxis=(0,_toConsumableArray2["default"])(new Set(labelAxis));return labelAxis.map(function(axisIndex){return bars.filter(function(_ref6){var _ref6$labelAxis=_ref6.labelAxis,axis=_ref6$labelAxis.axis,index=_ref6$labelAxis.index;return axis+index===axisIndex})})}function getBarStack(bars){var stacks=[];bars.forEach(function(_ref7){var stack=_ref7.stack;if(stack)stacks.push(stack)});return(0,_toConsumableArray2["default"])(new Set(stacks))}function setBarNum(bars){var barNum=(0,_toConsumableArray2["default"])(new Set(bars.map(function(_ref8){var barIndex=_ref8.barIndex;return barIndex}))).length;bars.forEach(function(bar){return bar.barNum=barNum})}function setBarCategoryWidth(bars){var lastBar=bars.slice(-1)[0];var barCategoryGap=lastBar.barCategoryGap,tickGap=lastBar.labelAxis.tickGap;var barCategoryWidth=0;if(typeof barCategoryGap==="number"){barCategoryWidth=barCategoryGap}else{barCategoryWidth=(1-parseInt(barCategoryGap)/100)*tickGap}bars.forEach(function(bar){return bar.barCategoryWidth=barCategoryWidth})}function setBarWidthAndGap(bars){var _bars$slice$=bars.slice(-1)[0],barCategoryWidth=_bars$slice$.barCategoryWidth,barWidth=_bars$slice$.barWidth,barGap=_bars$slice$.barGap,barNum=_bars$slice$.barNum;var widthAndGap=[];if(typeof barWidth==="number"||barWidth!=="auto"){widthAndGap=getBarWidthAndGapWithPercentOrNumber(barCategoryWidth,barWidth,barGap,barNum)}else if(barWidth==="auto"){widthAndGap=getBarWidthAndGapWidthAuto(barCategoryWidth,barWidth,barGap,barNum)}var _widthAndGap=widthAndGap,_widthAndGap2=(0,_slicedToArray2["default"])(_widthAndGap,2),width=_widthAndGap2[0],gap=_widthAndGap2[1];bars.forEach(function(bar){bar.barWidth=width;bar.barGap=gap})}function getBarWidthAndGapWithPercentOrNumber(barCategoryWidth,barWidth,barGap){var width=0,gap=0;if(typeof barWidth==="number"){width=barWidth}else{width=parseInt(barWidth)/100*barCategoryWidth}if(typeof barGap==="number"){gap=barGap}else{gap=parseInt(barGap)/100*width}return[width,gap]}function getBarWidthAndGapWidthAuto(barCategoryWidth,barWidth,barGap,barNum){var width=0,gap=0;var barItemWidth=barCategoryWidth/barNum;if(typeof barGap==="number"){gap=barGap;width=barItemWidth-gap}else{var percent=10+parseInt(barGap)/10;if(percent===0){width=barItemWidth*2;gap=-width}else{width=barItemWidth/percent*10;gap=barItemWidth-width}}return[width,gap]}function setBarAllWidthAndGap(bars){var _bars$slice$2=bars.slice(-1)[0],barGap=_bars$slice$2.barGap,barWidth=_bars$slice$2.barWidth,barNum=_bars$slice$2.barNum;var barAllWidthAndGap=(barGap+barWidth)*barNum-barGap;bars.forEach(function(bar){return bar.barAllWidthAndGap=barAllWidthAndGap})}function calcBarsPosition(bars,chart){bars=calcBarValueAxisCoordinate(bars);bars=calcBarLabelAxisCoordinate(bars);bars=eliminateNullBarLabelAxis(bars);bars=keepSameNumBetweenBarAndData(bars);return bars}function calcBarLabelAxisCoordinate(bars){return bars.map(function(bar){var labelAxis=bar.labelAxis,barAllWidthAndGap=bar.barAllWidthAndGap,barGap=bar.barGap,barWidth=bar.barWidth,barIndex=bar.barIndex;var tickGap=labelAxis.tickGap,tickPosition=labelAxis.tickPosition,axis=labelAxis.axis;var coordinateIndex=axis==="x"?0:1;var barLabelAxisPos=tickPosition.map(function(tick,i){var barCategoryStartPos=tickPosition[i][coordinateIndex]-tickGap/2;var barItemsStartPos=barCategoryStartPos+(tickGap-barAllWidthAndGap)/2;return barItemsStartPos+(barIndex+.5)*barWidth+barIndex*barGap});return _objectSpread({},bar,{barLabelAxisPos:barLabelAxisPos})})}function calcBarValueAxisCoordinate(bars){return bars.map(function(bar){var data=(0,_util2.mergeSameStackData)(bar,bars);data=eliminateNonNumberData(bar,data);var _bar$valueAxis=bar.valueAxis,axis=_bar$valueAxis.axis,minValue=_bar$valueAxis.minValue,maxValue=_bar$valueAxis.maxValue,linePosition=_bar$valueAxis.linePosition;var startPos=getValuePos(minValue,maxValue,minValue<0?0:minValue,linePosition,axis);var endPos=data.map(function(v){return getValuePos(minValue,maxValue,v,linePosition,axis)});var barValueAxisPos=endPos.map(function(p){return[startPos,p]});return _objectSpread({},bar,{barValueAxisPos:barValueAxisPos})})}function eliminateNonNumberData(barItem,barData){var data=barItem.data;return barData.map(function(v,i){return typeof data[i]==="number"?v:null}).filter(function(d){return d!==null})}function eliminateNullBarLabelAxis(bars){return bars.map(function(bar){var barLabelAxisPos=bar.barLabelAxisPos,data=bar.data;data.forEach(function(d,i){if(typeof d==="number")return;barLabelAxisPos[i]=null});return _objectSpread({},bar,{barLabelAxisPos:barLabelAxisPos.filter(function(p){return p!==null})})})}function keepSameNumBetweenBarAndData(bars){bars.forEach(function(bar){var data=bar.data,barLabelAxisPos=bar.barLabelAxisPos,barValueAxisPos=bar.barValueAxisPos;var dataNum=data.filter(function(d){return typeof d==="number"}).length;var axisPosNum=barLabelAxisPos.length;if(axisPosNum>dataNum){barLabelAxisPos.splice(dataNum);barValueAxisPos.splice(dataNum)}});return bars}function getValuePos(min,max,value,linePosition,axis){if(typeof value!=="number")return null;var valueMinus=max-min;var coordinateIndex=axis==="x"?0:1;var posMinus=linePosition[1][coordinateIndex]-linePosition[0][coordinateIndex];var percent=(value-min)/valueMinus;if(valueMinus===0)percent=0;var pos=percent*posMinus;return pos+linePosition[0][coordinateIndex]}function getBackgroundBarConfig(barItem){var animationCurve=barItem.animationCurve,animationFrame=barItem.animationFrame,rLevel=barItem.rLevel;var shapes=getBackgroundBarShapes(barItem);var style=getBackgroundBarStyle(barItem);return shapes.map(function(shape){return{name:"rect",index:rLevel,visible:barItem.backgroundBar.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:style}})}function getBackgroundBarShapes(barItem){var labelAxis=barItem.labelAxis,valueAxis=barItem.valueAxis;var tickPosition=labelAxis.tickPosition;var axis=valueAxis.axis,linePosition=valueAxis.linePosition;var width=getBackgroundBarWidth(barItem);var haltWidth=width/2;var posIndex=axis==="x"?0:1;var centerPos=tickPosition.map(function(p){return p[1-posIndex]});var _ref9=[linePosition[0][posIndex],linePosition[1][posIndex]],start=_ref9[0],end=_ref9[1];return centerPos.map(function(center){if(axis==="x"){return{x:start,y:center-haltWidth,w:end-start,h:width}}else{return{x:center-haltWidth,y:end,w:width,h:start-end}}})}function getBackgroundBarWidth(barItem){var barAllWidthAndGap=barItem.barAllWidthAndGap,barCategoryWidth=barItem.barCategoryWidth,backgroundBar=barItem.backgroundBar;var width=backgroundBar.width;if(typeof width==="number")return width;if(width==="auto")return barAllWidthAndGap;return parseInt(width)/100*barCategoryWidth}function getBackgroundBarStyle(barItem){return barItem.backgroundBar.style}function getBarConfig(barItem){var barLabelAxisPos=barItem.barLabelAxisPos,animationCurve=barItem.animationCurve,animationFrame=barItem.animationFrame,rLevel=barItem.rLevel;var name=getBarName(barItem);return barLabelAxisPos.map(function(foo,i){return{name:name,index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,shape:getBarShape(barItem,i),style:getBarStyle(barItem,i)}})}function getBarName(barItem){var shapeType=barItem.shapeType;if(shapeType==="leftEchelon"||shapeType==="rightEchelon")return"polyline";return"rect"}function getBarShape(barItem,i){var shapeType=barItem.shapeType;if(shapeType==="leftEchelon"){return getLeftEchelonShape(barItem,i)}else if(shapeType==="rightEchelon"){return getRightEchelonShape(barItem,i)}else{return getNormalBarShape(barItem,i)}}function getLeftEchelonShape(barItem,i){var barValueAxisPos=barItem.barValueAxisPos,barLabelAxisPos=barItem.barLabelAxisPos,barWidth=barItem.barWidth,echelonOffset=barItem.echelonOffset;var _barValueAxisPos$i=(0,_slicedToArray2["default"])(barValueAxisPos[i],2),start=_barValueAxisPos$i[0],end=_barValueAxisPos$i[1];var labelAxisPos=barLabelAxisPos[i];var halfWidth=barWidth/2;var valueAxis=barItem.valueAxis.axis;var points=[];if(valueAxis==="x"){points[0]=[end,labelAxisPos-halfWidth];points[1]=[end,labelAxisPos+halfWidth];points[2]=[start,labelAxisPos+halfWidth];points[3]=[start+echelonOffset,labelAxisPos-halfWidth];if(end-start1&&arguments[1]!==undefined?arguments[1]:{};var series=option.series;if(!series)series=[];var gauges=(0,_util2.initNeedSeries)(series,_gauge.gaugeConfig,"gauge");gauges=calcGaugesCenter(gauges,chart);gauges=calcGaugesRadius(gauges,chart);gauges=calcGaugesDataRadiusAndLineWidth(gauges,chart);gauges=calcGaugesDataAngles(gauges,chart);gauges=calcGaugesDataGradient(gauges,chart);gauges=calcGaugesAxisTickPosition(gauges,chart);gauges=calcGaugesLabelPositionAndAlign(gauges,chart);gauges=calcGaugesLabelData(gauges,chart);gauges=calcGaugesDetailsPosition(gauges,chart);gauges=calcGaugesDetailsContent(gauges,chart);(0,_updater.doUpdate)({chart:chart,series:gauges,key:"gaugeAxisTick",getGraphConfig:getAxisTickConfig});(0,_updater.doUpdate)({chart:chart,series:gauges,key:"gaugeAxisLabel",getGraphConfig:getAxisLabelConfig});(0,_updater.doUpdate)({chart:chart,series:gauges,key:"gaugeBackgroundArc",getGraphConfig:getBackgroundArcConfig,getStartGraphConfig:getStartBackgroundArcConfig});(0,_updater.doUpdate)({chart:chart,series:gauges,key:"gaugeArc",getGraphConfig:getArcConfig,getStartGraphConfig:getStartArcConfig,beforeChange:beforeChangeArc});(0,_updater.doUpdate)({chart:chart,series:gauges,key:"gaugePointer",getGraphConfig:getPointerConfig,getStartGraphConfig:getStartPointerConfig});(0,_updater.doUpdate)({chart:chart,series:gauges,key:"gaugeDetails",getGraphConfig:getDetailsConfig})}function calcGaugesCenter(gauges,chart){var area=chart.render.area;gauges.forEach(function(gaugeItem){var center=gaugeItem.center;center=center.map(function(pos,i){if(typeof pos==="number")return pos;return parseInt(pos)/100*area[i]});gaugeItem.center=center});return gauges}function calcGaugesRadius(gauges,chart){var area=chart.render.area;var maxRadius=Math.min.apply(Math,(0,_toConsumableArray2["default"])(area))/2;gauges.forEach(function(gaugeItem){var radius=gaugeItem.radius;if(typeof radius!=="number"){radius=parseInt(radius)/100*maxRadius}gaugeItem.radius=radius});return gauges}function calcGaugesDataRadiusAndLineWidth(gauges,chart){var area=chart.render.area;var maxRadius=Math.min.apply(Math,(0,_toConsumableArray2["default"])(area))/2;gauges.forEach(function(gaugeItem){var radius=gaugeItem.radius,data=gaugeItem.data,arcLineWidth=gaugeItem.arcLineWidth;data.forEach(function(item){var arcRadius=item.radius,lineWidth=item.lineWidth;if(!arcRadius)arcRadius=radius;if(typeof arcRadius!=="number")arcRadius=parseInt(arcRadius)/100*maxRadius;item.radius=arcRadius;if(!lineWidth)lineWidth=arcLineWidth;item.lineWidth=lineWidth})});return gauges}function calcGaugesDataAngles(gauges,chart){gauges.forEach(function(gaugeItem){var startAngle=gaugeItem.startAngle,endAngle=gaugeItem.endAngle,data=gaugeItem.data,min=gaugeItem.min,max=gaugeItem.max;var angleMinus=endAngle-startAngle;var valueMinus=max-min;data.forEach(function(item){var value=item.value;var itemAngle=Math.abs((value-min)/valueMinus*angleMinus);item.startAngle=startAngle;item.endAngle=startAngle+itemAngle})});return gauges}function calcGaugesDataGradient(gauges,chart){gauges.forEach(function(gaugeItem){var data=gaugeItem.data;data.forEach(function(item){var color=item.color,gradient=item.gradient;if(!gradient||!gradient.length)gradient=color;if(!(gradient instanceof Array))gradient=[gradient];item.gradient=gradient})});return gauges}function calcGaugesAxisTickPosition(gauges,chart){gauges.forEach(function(gaugeItem){var startAngle=gaugeItem.startAngle,endAngle=gaugeItem.endAngle,splitNum=gaugeItem.splitNum,center=gaugeItem.center,radius=gaugeItem.radius,arcLineWidth=gaugeItem.arcLineWidth,axisTick=gaugeItem.axisTick;var tickLength=axisTick.tickLength,lineWidth=axisTick.style.lineWidth;var angles=endAngle-startAngle;var outerRadius=radius-arcLineWidth/2;var innerRadius=outerRadius-tickLength;var angleGap=angles/(splitNum-1);var arcLength=2*Math.PI*radius*angles/(Math.PI*2);var offset=Math.ceil(lineWidth/2)/arcLength*angles;gaugeItem.tickAngles=[];gaugeItem.tickInnerRadius=[];gaugeItem.tickPosition=new Array(splitNum).fill(0).map(function(foo,i){var angle=startAngle+angleGap*i;if(i===0)angle+=offset;if(i===splitNum-1)angle-=offset;gaugeItem.tickAngles[i]=angle;gaugeItem.tickInnerRadius[i]=innerRadius;return[_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([outerRadius,angle])),_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([innerRadius,angle]))]})});return gauges}function calcGaugesLabelPositionAndAlign(gauges,chart){gauges.forEach(function(gaugeItem){var center=gaugeItem.center,tickInnerRadius=gaugeItem.tickInnerRadius,tickAngles=gaugeItem.tickAngles,labelGap=gaugeItem.axisLabel.labelGap;var position=tickAngles.map(function(angle,i){return _util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([tickInnerRadius[i]-labelGap,tickAngles[i]]))});var align=position.map(function(_ref){var _ref2=(0,_slicedToArray2["default"])(_ref,2),x=_ref2[0],y=_ref2[1];return{textAlign:x>center[0]?"right":"left",textBaseline:y>center[1]?"bottom":"top"}});gaugeItem.labelPosition=position;gaugeItem.labelAlign=align});return gauges}function calcGaugesLabelData(gauges,chart){gauges.forEach(function(gaugeItem){var axisLabel=gaugeItem.axisLabel,min=gaugeItem.min,max=gaugeItem.max,splitNum=gaugeItem.splitNum;var data=axisLabel.data,formatter=axisLabel.formatter;var valueGap=(max-min)/(splitNum-1);var value=new Array(splitNum).fill(0).map(function(foo,i){return parseInt(min+valueGap*i)});var formatterType=(0,_typeof2["default"])(formatter);data=(0,_util2.deepMerge)(value,data).map(function(v,i){var label=v;if(formatterType==="string"){label=formatter.replace("{value}",v)}if(formatterType==="function"){label=formatter({value:v,index:i})}return label});axisLabel.data=data});return gauges}function calcGaugesDetailsPosition(gauges,chart){gauges.forEach(function(gaugeItem){var data=gaugeItem.data,details=gaugeItem.details,center=gaugeItem.center;var position=details.position,offset=details.offset;var detailsPosition=data.map(function(_ref3){var startAngle=_ref3.startAngle,endAngle=_ref3.endAngle,radius=_ref3.radius;var point=null;if(position==="center"){point=center}else if(position==="start"){point=_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([radius,startAngle]))}else if(position==="end"){point=_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([radius,endAngle]))}return getOffsetedPoint(point,offset)});gaugeItem.detailsPosition=detailsPosition});return gauges}function calcGaugesDetailsContent(gauges,chart){gauges.forEach(function(gaugeItem){var data=gaugeItem.data,details=gaugeItem.details;var formatter=details.formatter;var formatterType=(0,_typeof2["default"])(formatter);var contents=data.map(function(dataItem){var content=dataItem.value;if(formatterType==="string"){content=formatter.replace("{value}","{nt}");content=content.replace("{name}",dataItem.name)}if(formatterType==="function")content=formatter(dataItem);return content.toString()});gaugeItem.detailsContent=contents});return gauges}function getOffsetedPoint(_ref4,_ref5){var _ref6=(0,_slicedToArray2["default"])(_ref4,2),x=_ref6[0],y=_ref6[1];var _ref7=(0,_slicedToArray2["default"])(_ref5,2),ox=_ref7[0],oy=_ref7[1];return[x+ox,y+oy]}function getAxisTickConfig(gaugeItem){var tickPosition=gaugeItem.tickPosition,animationCurve=gaugeItem.animationCurve,animationFrame=gaugeItem.animationFrame,rLevel=gaugeItem.rLevel;return tickPosition.map(function(foo,i){return{name:"polyline",index:rLevel,visible:gaugeItem.axisTick.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getAxisTickShape(gaugeItem,i),style:getAxisTickStyle(gaugeItem,i)}})}function getAxisTickShape(gaugeItem,i){var tickPosition=gaugeItem.tickPosition;return{points:tickPosition[i]}}function getAxisTickStyle(gaugeItem,i){var style=gaugeItem.axisTick.style;return style}function getAxisLabelConfig(gaugeItem){var labelPosition=gaugeItem.labelPosition,animationCurve=gaugeItem.animationCurve,animationFrame=gaugeItem.animationFrame,rLevel=gaugeItem.rLevel;return labelPosition.map(function(foo,i){return{name:"text",index:rLevel,visible:gaugeItem.axisLabel.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getAxisLabelShape(gaugeItem,i),style:getAxisLabelStyle(gaugeItem,i)}})}function getAxisLabelShape(gaugeItem,i){var labelPosition=gaugeItem.labelPosition,data=gaugeItem.axisLabel.data;return{content:data[i].toString(),position:labelPosition[i]}}function getAxisLabelStyle(gaugeItem,i){var labelAlign=gaugeItem.labelAlign,axisLabel=gaugeItem.axisLabel;var style=axisLabel.style;return(0,_util2.deepMerge)(_objectSpread({},labelAlign[i]),style)}function getBackgroundArcConfig(gaugeItem){var animationCurve=gaugeItem.animationCurve,animationFrame=gaugeItem.animationFrame,rLevel=gaugeItem.rLevel;return[{name:"arc",index:rLevel,visible:gaugeItem.backgroundArc.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getGaugeBackgroundArcShape(gaugeItem),style:getGaugeBackgroundArcStyle(gaugeItem)}]}function getGaugeBackgroundArcShape(gaugeItem){var startAngle=gaugeItem.startAngle,endAngle=gaugeItem.endAngle,center=gaugeItem.center,radius=gaugeItem.radius;return{rx:center[0],ry:center[1],r:radius,startAngle:startAngle,endAngle:endAngle}}function getGaugeBackgroundArcStyle(gaugeItem){var backgroundArc=gaugeItem.backgroundArc,arcLineWidth=gaugeItem.arcLineWidth;var style=backgroundArc.style;return(0,_util2.deepMerge)({lineWidth:arcLineWidth},style)}function getStartBackgroundArcConfig(gaugeItem){var config=getBackgroundArcConfig(gaugeItem)[0];var shape=_objectSpread({},config.shape);shape.endAngle=config.shape.startAngle;config.shape=shape;return[config]}function getArcConfig(gaugeItem){var data=gaugeItem.data,animationCurve=gaugeItem.animationCurve,animationFrame=gaugeItem.animationFrame,rLevel=gaugeItem.rLevel;return data.map(function(foo,i){return{name:"agArc",index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,shape:getGaugeArcShape(gaugeItem,i),style:getGaugeArcStyle(gaugeItem,i)}})}function getGaugeArcShape(gaugeItem,i){var data=gaugeItem.data,center=gaugeItem.center,gradientEndAngle=gaugeItem.endAngle;var _data$i=data[i],radius=_data$i.radius,startAngle=_data$i.startAngle,endAngle=_data$i.endAngle,localGradient=_data$i.localGradient;if(localGradient)gradientEndAngle=endAngle;return{rx:center[0],ry:center[1],r:radius,startAngle:startAngle,endAngle:endAngle,gradientEndAngle:gradientEndAngle}}function getGaugeArcStyle(gaugeItem,i){var data=gaugeItem.data,dataItemStyle=gaugeItem.dataItemStyle;var _data$i2=data[i],lineWidth=_data$i2.lineWidth,gradient=_data$i2.gradient;gradient=gradient.map(function(c){return(0,_color.getRgbaValue)(c)});return(0,_util2.deepMerge)({lineWidth:lineWidth,gradient:gradient},dataItemStyle)}function getStartArcConfig(gaugeItem){var configs=getArcConfig(gaugeItem);configs.map(function(config){var shape=_objectSpread({},config.shape);shape.endAngle=config.shape.startAngle;config.shape=shape});return configs}function beforeChangeArc(graph,config){var graphGradient=graph.style.gradient;var cacheNum=graphGradient.length;var needNum=config.style.gradient.length;if(cacheNum>needNum){graphGradient.splice(needNum)}else{var last=graphGradient.slice(-1)[0];graphGradient.push.apply(graphGradient,(0,_toConsumableArray2["default"])(new Array(needNum-cacheNum).fill(0).map(function(foo){return(0,_toConsumableArray2["default"])(last)})))}}function getPointerConfig(gaugeItem){var animationCurve=gaugeItem.animationCurve,animationFrame=gaugeItem.animationFrame,center=gaugeItem.center,rLevel=gaugeItem.rLevel;return[{name:"polyline",index:rLevel,visible:gaugeItem.pointer.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getPointerShape(gaugeItem),style:getPointerStyle(gaugeItem),setGraphCenter:function setGraphCenter(foo,graph){graph.style.graphCenter=center}}]}function getPointerShape(gaugeItem){var center=gaugeItem.center;return{points:getPointerPoints(center),close:true}}function getPointerStyle(gaugeItem){var startAngle=gaugeItem.startAngle,endAngle=gaugeItem.endAngle,min=gaugeItem.min,max=gaugeItem.max,data=gaugeItem.data,pointer=gaugeItem.pointer,center=gaugeItem.center;var valueIndex=pointer.valueIndex,style=pointer.style;var value=data[valueIndex]?data[valueIndex].value:0;var angle=(value-min)/(max-min)*(endAngle-startAngle)+startAngle+Math.PI/2;return(0,_util2.deepMerge)({rotate:(0,_util2.radianToAngle)(angle),scale:[1,1],graphCenter:center},style)}function getPointerPoints(_ref8){var _ref9=(0,_slicedToArray2["default"])(_ref8,2),x=_ref9[0],y=_ref9[1];var point1=[x,y-40];var point2=[x+5,y];var point3=[x,y+10];var point4=[x-5,y];return[point1,point2,point3,point4]}function getStartPointerConfig(gaugeItem){var startAngle=gaugeItem.startAngle;var config=getPointerConfig(gaugeItem)[0];config.style.rotate=(0,_util2.radianToAngle)(startAngle+Math.PI/2);return[config]}function getDetailsConfig(gaugeItem){var detailsPosition=gaugeItem.detailsPosition,animationCurve=gaugeItem.animationCurve,animationFrame=gaugeItem.animationFrame,rLevel=gaugeItem.rLevel;var visible=gaugeItem.details.show;return detailsPosition.map(function(foo,i){return{name:"numberText",index:rLevel,visible:visible,animationCurve:animationCurve,animationFrame:animationFrame,shape:getDetailsShape(gaugeItem,i),style:getDetailsStyle(gaugeItem,i)}})}function getDetailsShape(gaugeItem,i){var detailsPosition=gaugeItem.detailsPosition,detailsContent=gaugeItem.detailsContent,data=gaugeItem.data,details=gaugeItem.details;var position=detailsPosition[i];var content=detailsContent[i];var dataValue=data[i].value;var toFixed=details.valueToFixed;return{number:[dataValue],content:content,position:position,toFixed:toFixed}}function getDetailsStyle(gaugeItem,i){var details=gaugeItem.details,data=gaugeItem.data;var style=details.style;var color=data[i].color;return(0,_util2.deepMerge)({fill:color},style)}},{"../class/updater.class":3,"../config/gauge":7,"../util":30,"@babel/runtime/helpers/defineProperty":35,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42,"@babel/runtime/helpers/typeof":43,"@jiaminghi/c-render/lib/plugin/util":54,"@jiaminghi/color":56}],19:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.grid=grid;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _updater=require("../class/updater.class");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _config=require("../config");var _util2=require("../util");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};var grid=option.grid;grid=(0,_util2.deepMerge)((0,_util.deepClone)(_config.gridConfig,true),grid||{});(0,_updater.doUpdate)({chart:chart,series:[grid],key:"grid",getGraphConfig:getGridConfig})}function getGridConfig(gridItem,updater){var animationCurve=gridItem.animationCurve,animationFrame=gridItem.animationFrame,rLevel=gridItem.rLevel;var shape=getGridShape(gridItem,updater);var style=getGridStyle(gridItem);updater.chart.gridArea=_objectSpread({},shape);return[{name:"rect",index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:style}]}function getGridShape(gridItem,updater){var _updater$chart$render=(0,_slicedToArray2["default"])(updater.chart.render.area,2),w=_updater$chart$render[0],h=_updater$chart$render[1];var left=getNumberValue(gridItem.left,w);var right=getNumberValue(gridItem.right,w);var top=getNumberValue(gridItem.top,h);var bottom=getNumberValue(gridItem.bottom,h);var width=w-left-right;var height=h-top-bottom;return{x:left,y:top,w:width,h:height}}function getNumberValue(val,all){if(typeof val==="number")return val;if(typeof val!=="string")return 0;return all*parseInt(val)/100}function getGridStyle(gridItem){var style=gridItem.style;return style}},{"../class/updater.class":3,"../config":9,"../util":30,"@babel/runtime/helpers/defineProperty":35,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@jiaminghi/c-render/lib/plugin/util":54}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"mergeColor",{enumerable:true,get:function get(){return _mergeColor.mergeColor}});Object.defineProperty(exports,"title",{enumerable:true,get:function get(){return _title.title}});Object.defineProperty(exports,"grid",{enumerable:true,get:function get(){return _grid.grid}});Object.defineProperty(exports,"axis",{enumerable:true,get:function get(){return _axis.axis}});Object.defineProperty(exports,"line",{enumerable:true,get:function get(){return _line.line}});Object.defineProperty(exports,"bar",{enumerable:true,get:function get(){return _bar.bar}});Object.defineProperty(exports,"pie",{enumerable:true,get:function get(){return _pie.pie}});Object.defineProperty(exports,"radarAxis",{enumerable:true,get:function get(){return _radarAxis.radarAxis}});Object.defineProperty(exports,"radar",{enumerable:true,get:function get(){return _radar.radar}});Object.defineProperty(exports,"gauge",{enumerable:true,get:function get(){return _gauge.gauge}});Object.defineProperty(exports,"legend",{enumerable:true,get:function get(){return _legend.legend}});var _mergeColor=require("./mergeColor");var _title=require("./title");var _grid=require("./grid");var _axis=require("./axis");var _line=require("./line");var _bar=require("./bar");var _pie=require("./pie");var _radarAxis=require("./radarAxis");var _radar=require("./radar");var _gauge=require("./gauge");var _legend=require("./legend")},{"./axis":16,"./bar":17,"./gauge":18,"./grid":19,"./legend":21,"./line":22,"./mergeColor":23,"./pie":24,"./radar":25,"./radarAxis":26,"./title":27}],21:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.legend=legend;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _updater=require("../class/updater.class");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _config=require("../config");var _util2=require("../util");function legend(chart){var option=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var legend=option.legend;if(legend){legend=(0,_util2.deepMerge)((0,_util.deepClone)(_config.legendConfig,true),legend);legend=initLegendData(legend);legend=filterInvalidData(legend,option,chart);legend=calcLegendTextWidth(legend,chart);legend=calcLegendPosition(legend,chart);legend=[legend]}else{legend=[]}(0,_updater.doUpdate)({chart:chart,series:legend,key:"legendIcon",getGraphConfig:getIconConfig});(0,_updater.doUpdate)({chart:chart,series:legend,key:"legendText",getGraphConfig:getTextConfig})}function initLegendData(legend){var data=legend.data;legend.data=data.map(function(item){var itemType=(0,_typeof2["default"])(item);if(itemType==="string"){return{name:item}}else if(itemType==="object"){return item}return{name:""}});return legend}function filterInvalidData(legend,option,chart){var series=option.series;var legendStatus=chart.legendStatus;var data=legend.data.filter(function(item){var name=item.name;var result=series.find(function(_ref){var sn=_ref.name;return name===sn});if(!result)return false;if(!item.color)item.color=result.color;if(!item.icon)item.icon=result.type;return item});if(!legendStatus||legendStatus.length!==legend.data.length)legendStatus=new Array(legend.data.length).fill(true);data.forEach(function(item,i){return item.status=legendStatus[i]});legend.data=data;chart.legendStatus=legendStatus;return legend}function calcLegendTextWidth(legend,chart){var ctx=chart.render.ctx;var data=legend.data,textStyle=legend.textStyle,textUnselectedStyle=legend.textUnselectedStyle;data.forEach(function(item){var status=item.status,name=item.name;item.textWidth=getTextWidth(ctx,name,status?textStyle:textUnselectedStyle)});return legend}function getTextWidth(ctx,text,style){ctx.font=getFontConfig(style);return ctx.measureText(text).width}function getFontConfig(style){var fontFamily=style.fontFamily,fontSize=style.fontSize;return"".concat(fontSize,"px ").concat(fontFamily)}function calcLegendPosition(legend,chart){var orient=legend.orient;if(orient==="vertical"){calcVerticalPosition(legend,chart)}else{calcHorizontalPosition(legend,chart)}return legend}function calcHorizontalPosition(legend,chart){var iconHeight=legend.iconHeight,itemGap=legend.itemGap;var lines=calcDefaultHorizontalPosition(legend,chart);var xOffsets=lines.map(function(line){return getHorizontalXOffset(line,legend,chart)});var yOffset=getHorizontalYOffset(legend,chart);var align={textAlign:"left",textBaseline:"middle"};lines.forEach(function(line,i){return line.forEach(function(item){var iconPosition=item.iconPosition,textPosition=item.textPosition;var xOffset=xOffsets[i];var realYOffset=yOffset+i*(itemGap+iconHeight);item.iconPosition=mergeOffset(iconPosition,[xOffset,realYOffset]);item.textPosition=mergeOffset(textPosition,[xOffset,realYOffset]);item.align=align})})}function calcDefaultHorizontalPosition(legend,chart){var data=legend.data,iconWidth=legend.iconWidth;var w=chart.render.area[0];var startIndex=0;var lines=[[]];data.forEach(function(item,i){var beforeWidth=getBeforeWidth(startIndex,i,legend);var endXPos=beforeWidth+iconWidth+5+item.textWidth;if(endXPos>=w){startIndex=i;beforeWidth=getBeforeWidth(startIndex,i,legend);lines.push([])}item.iconPosition=[beforeWidth,0];item.textPosition=[beforeWidth+iconWidth+5,0];lines.slice(-1)[0].push(item)});return lines}function getBeforeWidth(startIndex,currentIndex,legend){var data=legend.data,iconWidth=legend.iconWidth,itemGap=legend.itemGap;var beforeItem=data.slice(startIndex,currentIndex);return(0,_util2.mulAdd)(beforeItem.map(function(_ref2){var textWidth=_ref2.textWidth;return textWidth}))+(currentIndex-startIndex)*(itemGap+5+iconWidth)}function getHorizontalXOffset(data,legend,chart){var left=legend.left,right=legend.right,iconWidth=legend.iconWidth,itemGap=legend.itemGap;var w=chart.render.area[0];var dataNum=data.length;var allWidth=(0,_util2.mulAdd)(data.map(function(_ref3){var textWidth=_ref3.textWidth;return textWidth}))+dataNum*(5+iconWidth)+(dataNum-1)*itemGap;var horizontal=[left,right].findIndex(function(pos){return pos!=="auto"});if(horizontal===-1){return(w-allWidth)/2}else if(horizontal===0){if(typeof left==="number")return left;return parseInt(left)/100*w}else{if(typeof right!=="number")right=parseInt(right)/100*w;return w-(allWidth+right)}}function getHorizontalYOffset(legend,chart){var top=legend.top,bottom=legend.bottom,iconHeight=legend.iconHeight;var h=chart.render.area[1];var vertical=[top,bottom].findIndex(function(pos){return pos!=="auto"});var halfIconHeight=iconHeight/2;if(vertical===-1){var _chart$gridArea=chart.gridArea,y=_chart$gridArea.y,height=_chart$gridArea.h;return y+height+45-halfIconHeight}else if(vertical===0){if(typeof top==="number")return top-halfIconHeight;return parseInt(top)/100*h-halfIconHeight}else{if(typeof bottom!=="number")bottom=parseInt(bottom)/100*h;return h-bottom-halfIconHeight}}function mergeOffset(_ref4,_ref5){var _ref6=(0,_slicedToArray2["default"])(_ref4,2),x=_ref6[0],y=_ref6[1];var _ref7=(0,_slicedToArray2["default"])(_ref5,2),ox=_ref7[0],oy=_ref7[1];return[x+ox,y+oy]}function calcVerticalPosition(legend,chart){var _getVerticalXOffset=getVerticalXOffset(legend,chart),_getVerticalXOffset2=(0,_slicedToArray2["default"])(_getVerticalXOffset,2),isRight=_getVerticalXOffset2[0],xOffset=_getVerticalXOffset2[1];var yOffset=getVerticalYOffset(legend,chart);calcDefaultVerticalPosition(legend,isRight);var align={textAlign:"left",textBaseline:"middle"};legend.data.forEach(function(item){var textPosition=item.textPosition,iconPosition=item.iconPosition;item.textPosition=mergeOffset(textPosition,[xOffset,yOffset]);item.iconPosition=mergeOffset(iconPosition,[xOffset,yOffset]);item.align=align})}function getVerticalXOffset(legend,chart){var left=legend.left,right=legend.right;var w=chart.render.area[0];var horizontal=[left,right].findIndex(function(pos){return pos!=="auto"});if(horizontal===-1){return[true,w-10]}else{var offset=[left,right][horizontal];if(typeof offset!=="number")offset=parseInt(offset)/100*w;return[Boolean(horizontal),offset]}}function getVerticalYOffset(legend,chart){var iconHeight=legend.iconHeight,itemGap=legend.itemGap,data=legend.data,top=legend.top,bottom=legend.bottom;var h=chart.render.area[1];var dataNum=data.length;var allHeight=dataNum*iconHeight+(dataNum-1)*itemGap;var vertical=[top,bottom].findIndex(function(pos){return pos!=="auto"});if(vertical===-1){return(h-allHeight)/2}else{var offset=[top,bottom][vertical];if(typeof offset!=="number")offset=parseInt(offset)/100*h;if(vertical===1)offset=h-offset-allHeight;return offset}}function calcDefaultVerticalPosition(legend,isRight){var data=legend.data,iconWidth=legend.iconWidth,iconHeight=legend.iconHeight,itemGap=legend.itemGap;var halfIconHeight=iconHeight/2;data.forEach(function(item,i){var textWidth=item.textWidth;var yPos=(iconHeight+itemGap)*i+halfIconHeight;var iconXPos=isRight?0-iconWidth:0;var textXpos=isRight?iconXPos-5-textWidth:iconWidth+5;item.iconPosition=[iconXPos,yPos];item.textPosition=[textXpos,yPos]})}function getIconConfig(legendItem,updater){var data=legendItem.data,selectAble=legendItem.selectAble,animationCurve=legendItem.animationCurve,animationFrame=legendItem.animationFrame,rLevel=legendItem.rLevel;return data.map(function(item,i){return(0,_defineProperty2["default"])({name:item.icon==="line"?"lineIcon":"rect",index:rLevel,visible:legendItem.show,hover:selectAble,click:selectAble,animationCurve:animationCurve,animationFrame:animationFrame,shape:getIconShape(legendItem,i),style:getIconStyle(legendItem,i)},"click",createClickCallBack(legendItem,i,updater))})}function getIconShape(legendItem,i){var data=legendItem.data,iconWidth=legendItem.iconWidth,iconHeight=legendItem.iconHeight;var _data$i$iconPosition=(0,_slicedToArray2["default"])(data[i].iconPosition,2),x=_data$i$iconPosition[0],y=_data$i$iconPosition[1];var halfIconHeight=iconHeight/2;return{x:x,y:y-halfIconHeight,w:iconWidth,h:iconHeight}}function getIconStyle(legendItem,i){var data=legendItem.data,iconStyle=legendItem.iconStyle,iconUnselectedStyle=legendItem.iconUnselectedStyle;var _data$i=data[i],status=_data$i.status,color=_data$i.color;var style=status?iconStyle:iconUnselectedStyle;return(0,_util2.deepMerge)({fill:color},style)}function getTextConfig(legendItem,updater){var data=legendItem.data,selectAble=legendItem.selectAble,animationCurve=legendItem.animationCurve,animationFrame=legendItem.animationFrame,rLevel=legendItem.rLevel;return data.map(function(foo,i){return{name:"text",index:rLevel,visible:legendItem.show,hover:selectAble,animationCurve:animationCurve,animationFrame:animationFrame,hoverRect:getTextHoverRect(legendItem,i),shape:getTextShape(legendItem,i),style:getTextStyle(legendItem,i),click:createClickCallBack(legendItem,i,updater)}})}function getTextShape(legendItem,i){var _legendItem$data$i=legendItem.data[i],textPosition=_legendItem$data$i.textPosition,name=_legendItem$data$i.name;return{content:name,position:textPosition}}function getTextStyle(legendItem,i){var textStyle=legendItem.textStyle,textUnselectedStyle=legendItem.textUnselectedStyle;var _legendItem$data$i2=legendItem.data[i],status=_legendItem$data$i2.status,align=_legendItem$data$i2.align;var style=status?textStyle:textUnselectedStyle;return(0,_util2.deepMerge)((0,_util.deepClone)(style,true),align)}function getTextHoverRect(legendItem,i){var textStyle=legendItem.textStyle,textUnselectedStyle=legendItem.textUnselectedStyle;var _legendItem$data$i3=legendItem.data[i],status=_legendItem$data$i3.status,_legendItem$data$i3$t=(0,_slicedToArray2["default"])(_legendItem$data$i3.textPosition,2),x=_legendItem$data$i3$t[0],y=_legendItem$data$i3$t[1],textWidth=_legendItem$data$i3.textWidth;var style=status?textStyle:textUnselectedStyle;var fontSize=style.fontSize;return[x,y-fontSize/2,textWidth,fontSize]}function createClickCallBack(legendItem,index,updater){var name=legendItem.data[index].name;return function(){var _updater$chart=updater.chart,legendStatus=_updater$chart.legendStatus,option=_updater$chart.option;var status=!legendStatus[index];var change=option.series.find(function(_ref9){var sn=_ref9.name;return sn===name});change.show=status;legendStatus[index]=status;updater.chart.setOption(option)}}},{"../class/updater.class":3,"../config":9,"../util":30,"@babel/runtime/helpers/defineProperty":35,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/typeof":43,"@jiaminghi/c-render/lib/plugin/util":54}],22:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.line=line;var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _updater=require("../class/updater.class");var _config=require("../config");var _bezierCurve=_interopRequireDefault(require("@jiaminghi/bezier-curve"));var _util=require("../util");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};var xAxis=option.xAxis,yAxis=option.yAxis,series=option.series;var lines=[];if(xAxis&&yAxis&&series){lines=(0,_util.initNeedSeries)(series,_config.lineConfig,"line");lines=calcLinesPosition(lines,chart)}(0,_updater.doUpdate)({chart:chart,series:lines,key:"lineArea",getGraphConfig:getLineAreaConfig,getStartGraphConfig:getStartLineAreaConfig,beforeUpdate:beforeUpdateLineAndArea,beforeChange:beforeChangeLineAndArea});(0,_updater.doUpdate)({chart:chart,series:lines,key:"line",getGraphConfig:getLineConfig,getStartGraphConfig:getStartLineConfig,beforeUpdate:beforeUpdateLineAndArea,beforeChange:beforeChangeLineAndArea});(0,_updater.doUpdate)({chart:chart,series:lines,key:"linePoint",getGraphConfig:getPointConfig,getStartGraphConfig:getStartPointConfig});(0,_updater.doUpdate)({chart:chart,series:lines,key:"lineLabel",getGraphConfig:getLabelConfig})}function calcLinesPosition(lines,chart){var axisData=chart.axisData;return lines.map(function(lineItem){var lineData=(0,_util.mergeSameStackData)(lineItem,lines);lineData=mergeNonNumber(lineItem,lineData);var lineAxis=getLineAxis(lineItem,axisData);var linePosition=getLinePosition(lineData,lineAxis);var lineFillBottomPos=getLineFillBottomPos(lineAxis);return _objectSpread({},lineItem,{linePosition:linePosition.filter(function(p){return p}),lineFillBottomPos:lineFillBottomPos})})}function mergeNonNumber(lineItem,lineData){var data=lineItem.data;return lineData.map(function(v,i){return typeof data[i]==="number"?v:null})}function getLineAxis(line,axisData){var xAxisIndex=line.xAxisIndex,yAxisIndex=line.yAxisIndex;var xAxis=axisData.find(function(_ref){var axis=_ref.axis,index=_ref.index;return axis==="x"&&index===xAxisIndex});var yAxis=axisData.find(function(_ref2){var axis=_ref2.axis,index=_ref2.index;return axis==="y"&&index===yAxisIndex});return[xAxis,yAxis]}function getLinePosition(lineData,lineAxis){var valueAxisIndex=lineAxis.findIndex(function(_ref3){var data=_ref3.data;return data==="value"});var valueAxis=lineAxis[valueAxisIndex];var labelAxis=lineAxis[1-valueAxisIndex];var linePosition=valueAxis.linePosition,axis=valueAxis.axis;var tickPosition=labelAxis.tickPosition;var tickNum=tickPosition.length;var valueAxisPosIndex=axis==="x"?0:1;var valueAxisStartPos=linePosition[0][valueAxisPosIndex];var valueAxisEndPos=linePosition[1][valueAxisPosIndex];var valueAxisPosMinus=valueAxisEndPos-valueAxisStartPos;var maxValue=valueAxis.maxValue,minValue=valueAxis.minValue;var valueMinus=maxValue-minValue;var position=new Array(tickNum).fill(0).map(function(foo,i){var v=lineData[i];if(typeof v!=="number")return null;var valuePercent=(v-minValue)/valueMinus;if(valueMinus===0)valuePercent=0;return valuePercent*valueAxisPosMinus+valueAxisStartPos});return position.map(function(vPos,i){if(i>=tickNum||typeof vPos!=="number")return null;var pos=[vPos,tickPosition[i][1-valueAxisPosIndex]];if(valueAxisPosIndex===0)return pos;pos.reverse();return pos})}function getLineFillBottomPos(lineAxis){var valueAxis=lineAxis.find(function(_ref4){var data=_ref4.data;return data==="value"});var axis=valueAxis.axis,linePosition=valueAxis.linePosition,minValue=valueAxis.minValue,maxValue=valueAxis.maxValue;var changeIndex=axis==="x"?0:1;var changeValue=linePosition[0][changeIndex];if(minValue<0&&maxValue>0){var valueMinus=maxValue-minValue;var posMinus=Math.abs(linePosition[0][changeIndex]-linePosition[1][changeIndex]);var offset=Math.abs(minValue)/valueMinus*posMinus;if(axis==="y")offset*=-1;changeValue+=offset}return{changeIndex:changeIndex,changeValue:changeValue}}function getLineAreaConfig(lineItem){var animationCurve=lineItem.animationCurve,animationFrame=lineItem.animationFrame,lineFillBottomPos=lineItem.lineFillBottomPos,rLevel=lineItem.rLevel;return[{name:getLineGraphName(lineItem),index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,visible:lineItem.lineArea.show,lineFillBottomPos:lineFillBottomPos,shape:getLineAndAreaShape(lineItem),style:getLineAreaStyle(lineItem),drawed:lineAreaDrawed}]}function getLineAndAreaShape(lineItem){var linePosition=lineItem.linePosition;return{points:linePosition}}function getLineAreaStyle(lineItem){var lineArea=lineItem.lineArea,color=lineItem.color;var gradient=lineArea.gradient,style=lineArea.style;var fillColor=[style.fill||color];var gradientColor=(0,_util.deepMerge)(fillColor,gradient);if(gradientColor.length===1)gradientColor.push(gradientColor[0]);var gradientParams=getGradientParams(lineItem);style=_objectSpread({},style,{stroke:"rgba(0, 0, 0, 0)"});return(0,_util.deepMerge)({gradientColor:gradientColor,gradientParams:gradientParams,gradientType:"linear",gradientWith:"fill"},style)}function getGradientParams(lineItem){var lineFillBottomPos=lineItem.lineFillBottomPos,linePosition=lineItem.linePosition;var changeIndex=lineFillBottomPos.changeIndex,changeValue=lineFillBottomPos.changeValue;var mainPos=linePosition.map(function(p){return p[changeIndex]});var maxPos=Math.max.apply(Math,(0,_toConsumableArray2["default"])(mainPos));var minPos=Math.min.apply(Math,(0,_toConsumableArray2["default"])(mainPos));var beginPos=maxPos;if(changeIndex===1)beginPos=minPos;if(changeIndex===1){return[0,beginPos,0,changeValue]}else{return[beginPos,0,changeValue,0]}}function lineAreaDrawed(_ref5,_ref6){var lineFillBottomPos=_ref5.lineFillBottomPos,shape=_ref5.shape;var ctx=_ref6.ctx;var points=shape.points;var changeIndex=lineFillBottomPos.changeIndex,changeValue=lineFillBottomPos.changeValue;var linePoint1=(0,_toConsumableArray2["default"])(points[points.length-1]);var linePoint2=(0,_toConsumableArray2["default"])(points[0]);linePoint1[changeIndex]=changeValue;linePoint2[changeIndex]=changeValue;ctx.lineTo.apply(ctx,(0,_toConsumableArray2["default"])(linePoint1));ctx.lineTo.apply(ctx,(0,_toConsumableArray2["default"])(linePoint2));ctx.closePath();ctx.fill()}function getStartLineAreaConfig(lineItem){var config=getLineAreaConfig(lineItem)[0];var style=_objectSpread({},config.style);style.opacity=0;config.style=style;return[config]}function beforeUpdateLineAndArea(graphs,lineItem,i,updater){var cache=graphs[i];if(!cache)return;var currentName=getLineGraphName(lineItem);var render=updater.chart.render;var name=cache[0].name;var delAll=currentName!==name;if(!delAll)return;cache.forEach(function(g){return render.delGraph(g)});graphs[i]=null}function beforeChangeLineAndArea(graph,config){var points=config.shape.points;var graphPoints=graph.shape.points;var graphPointsNum=graphPoints.length;var pointsNum=points.length;if(pointsNum>graphPointsNum){var lastPoint=graphPoints.slice(-1)[0];var newAddPoints=new Array(pointsNum-graphPointsNum).fill(0).map(function(foo){return(0,_toConsumableArray2["default"])(lastPoint)});graphPoints.push.apply(graphPoints,(0,_toConsumableArray2["default"])(newAddPoints))}else if(pointsNum1&&arguments[1]!==undefined?arguments[1]:false;if(!smooth)return(0,_util.getPolylineLength)(points);var curve=polylineToBezierCurve(points);return getBezierCurveLength(curve)}function getStartLineConfig(lineItem){var lineDash=lineItem.lineStyle.lineDash;var config=getLineConfig(lineItem)[0];var realLineDash=config.style.lineDash;if(lineDash){realLineDash=[0,0]}else{realLineDash=(0,_toConsumableArray2["default"])(realLineDash).reverse()}config.style.lineDash=realLineDash;return[config]}function getPointConfig(lineItem){var animationCurve=lineItem.animationCurve,animationFrame=lineItem.animationFrame,rLevel=lineItem.rLevel;var shapes=getPointShapes(lineItem);var style=getPointStyle(lineItem);return shapes.map(function(shape){return{name:"circle",index:rLevel+2,visible:lineItem.linePoint.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:style}})}function getPointShapes(lineItem){var linePosition=lineItem.linePosition,radius=lineItem.linePoint.radius;return linePosition.map(function(_ref7){var _ref8=(0,_slicedToArray2["default"])(_ref7,2),rx=_ref8[0],ry=_ref8[1];return{r:radius,rx:rx,ry:ry}})}function getPointStyle(lineItem){var color=lineItem.color,style=lineItem.linePoint.style;return(0,_util.deepMerge)({stroke:color},style)}function getStartPointConfig(lineItem){var configs=getPointConfig(lineItem);configs.forEach(function(config){config.shape.r=.1});return configs}function getLabelConfig(lineItem){var animationCurve=lineItem.animationCurve,animationFrame=lineItem.animationFrame,rLevel=lineItem.rLevel;var shapes=getLabelShapes(lineItem);var style=getLabelStyle(lineItem);return shapes.map(function(shape,i){return{name:"text",index:rLevel+3,visible:lineItem.label.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:style}})}function getLabelShapes(lineItem){var contents=formatterLabel(lineItem);var position=getLabelPosition(lineItem);return contents.map(function(content,i){return{content:content,position:position[i]}})}function getLabelPosition(lineItem){var linePosition=lineItem.linePosition,lineFillBottomPos=lineItem.lineFillBottomPos,label=lineItem.label;var position=label.position,offset=label.offset;var changeIndex=lineFillBottomPos.changeIndex,changeValue=lineFillBottomPos.changeValue;return linePosition.map(function(pos){if(position==="bottom"){pos=(0,_toConsumableArray2["default"])(pos);pos[changeIndex]=changeValue}if(position==="center"){var bottom=(0,_toConsumableArray2["default"])(pos);bottom[changeIndex]=changeValue;pos=getCenterLabelPoint(pos,bottom)}return getOffsetedPoint(pos,offset)})}function getOffsetedPoint(_ref9,_ref10){var _ref11=(0,_slicedToArray2["default"])(_ref9,2),x=_ref11[0],y=_ref11[1];var _ref12=(0,_slicedToArray2["default"])(_ref10,2),ox=_ref12[0],oy=_ref12[1];return[x+ox,y+oy]}function getCenterLabelPoint(_ref13,_ref14){var _ref15=(0,_slicedToArray2["default"])(_ref13,2),ax=_ref15[0],ay=_ref15[1];var _ref16=(0,_slicedToArray2["default"])(_ref14,2),bx=_ref16[0],by=_ref16[1];return[(ax+bx)/2,(ay+by)/2]}function formatterLabel(lineItem){var data=lineItem.data,formatter=lineItem.label.formatter;data=data.filter(function(d){return typeof d==="number"}).map(function(d){return d.toString()});if(!formatter)return data;var type=(0,_typeof2["default"])(formatter);if(type==="string")return data.map(function(d){return formatter.replace("{value}",d)});if(type==="function")return data.map(function(value,index){return formatter({value:value,index:index})});return data}function getLabelStyle(lineItem){var color=lineItem.color,style=lineItem.label.style;return(0,_util.deepMerge)({fill:color},style)}},{"../class/updater.class":3,"../config":9,"../util":30,"@babel/runtime/helpers/defineProperty":35,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42,"@babel/runtime/helpers/typeof":43,"@jiaminghi/bezier-curve":47}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.mergeColor=mergeColor;var _config=require("../config");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _util2=require("../util");function mergeColor(chart){var option=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var defaultColor=(0,_util.deepClone)(_config.colorConfig,true);var color=option.color,series=option.series;if(!series)series=[];if(!color)color=[];option.color=color=(0,_util2.deepMerge)(defaultColor,color);if(!series.length)return;var colorNum=color.length;series.forEach(function(item,i){if(item.color)return;item.color=color[i%colorNum]});var pies=series.filter(function(_ref){var type=_ref.type;return type==="pie"});pies.forEach(function(pie){return pie.data.forEach(function(di,i){return di.color=color[i%colorNum]})});var gauges=series.filter(function(_ref2){var type=_ref2.type;return type==="gauge"});gauges.forEach(function(gauge){return gauge.data.forEach(function(di,i){return di.color=color[i%colorNum]})});var barWithIndependentColor=series.filter(function(_ref3){var type=_ref3.type,independentColor=_ref3.independentColor;return type==="bar"&&independentColor});barWithIndependentColor.forEach(function(bar){if(bar.independentColors)return;bar.independentColors=color})}},{"../config":9,"../util":30,"@jiaminghi/c-render/lib/plugin/util":54}],24:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.pie=pie;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _updater=require("../class/updater.class");var _pie=require("../config/pie");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _util2=require("../util");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};var series=option.series;if(!series)series=[];var pies=(0,_util2.initNeedSeries)(series,_pie.pieConfig,"pie");pies=calcPiesCenter(pies,chart);pies=calcPiesRadius(pies,chart);pies=calcRosePiesRadius(pies,chart);pies=calcPiesPercent(pies);pies=calcPiesAngle(pies,chart);pies=calcPiesInsideLabelPos(pies);pies=calcPiesEdgeCenterPos(pies);pies=calcPiesOutSideLabelPos(pies);(0,_updater.doUpdate)({chart:chart,series:pies,key:"pie",getGraphConfig:getPieConfig,getStartGraphConfig:getStartPieConfig,beforeChange:beforeChangePie});(0,_updater.doUpdate)({chart:chart,series:pies,key:"pieInsideLabel",getGraphConfig:getInsideLabelConfig});(0,_updater.doUpdate)({chart:chart,series:pies,key:"pieOutsideLabelLine",getGraphConfig:getOutsideLabelLineConfig,getStartGraphConfig:getStartOutsideLabelLineConfig});(0,_updater.doUpdate)({chart:chart,series:pies,key:"pieOutsideLabel",getGraphConfig:getOutsideLabelConfig,getStartGraphConfig:getStartOutsideLabelConfig})}function calcPiesCenter(pies,chart){var area=chart.render.area;pies.forEach(function(pie){var center=pie.center;center=center.map(function(pos,i){if(typeof pos==="number")return pos;return parseInt(pos)/100*area[i]});pie.center=center});return pies}function calcPiesRadius(pies,chart){var maxRadius=Math.min.apply(Math,(0,_toConsumableArray2["default"])(chart.render.area))/2;pies.forEach(function(pie){var radius=pie.radius,data=pie.data;radius=getNumberRadius(radius,maxRadius);data.forEach(function(item){var itemRadius=item.radius;if(!itemRadius)itemRadius=radius;itemRadius=getNumberRadius(itemRadius,maxRadius);item.radius=itemRadius});pie.radius=radius});return pies}function getNumberRadius(radius,maxRadius){if(!(radius instanceof Array))radius=[0,radius];radius=radius.map(function(r){if(typeof r==="number")return r;return parseInt(r)/100*maxRadius});return radius}function calcRosePiesRadius(pies,chart){var rosePie=pies.filter(function(_ref){var roseType=_ref.roseType;return roseType});rosePie.forEach(function(pie){var radius=pie.radius,data=pie.data,roseSort=pie.roseSort;var roseIncrement=getRoseIncrement(pie);var dataCopy=(0,_toConsumableArray2["default"])(data);data=sortData(data);data.forEach(function(item,i){item.radius[1]=radius[1]-roseIncrement*i});if(roseSort){data.reverse()}else{pie.data=dataCopy}pie.roseIncrement=roseIncrement});return pies}function sortData(data){return data.sort(function(_ref2,_ref3){var a=_ref2.value;var b=_ref3.value;if(a===b)return 0;if(a>b)return-1;if(a1&&arguments[1]!==undefined?arguments[1]:0;var stringNumber=number.toString();var splitedNumber=stringNumber.split(".");var decimal=splitedNumber[1]||"0";var fixedDecimal=decimal.slice(0,toFixed);splitedNumber[1]=fixedDecimal;return parseFloat(splitedNumber.join("."))}function getDataSum(data){return(0,_util2.mulAdd)(data.map(function(_ref6){var value=_ref6.value;return value}))}function calcPiesAngle(pies){pies.forEach(function(pie){var start=pie.startAngle,data=pie.data;data.forEach(function(item,i){var _getDataAngle=getDataAngle(data,i),_getDataAngle2=(0,_slicedToArray2["default"])(_getDataAngle,2),startAngle=_getDataAngle2[0],endAngle=_getDataAngle2[1];item.startAngle=start+startAngle;item.endAngle=start+endAngle})});return pies}function getDataAngle(data,i){var fullAngle=Math.PI*2;var needAddData=data.slice(0,i+1);var percentSum=(0,_util2.mulAdd)(needAddData.map(function(_ref7){var percent=_ref7.percent;return percent}));var percent=data[i].percent;var startPercent=percentSum-percent;return[fullAngle*startPercent/100,fullAngle*percentSum/100]}function calcPiesInsideLabelPos(pies){pies.forEach(function(pieItem){var data=pieItem.data;data.forEach(function(item){item.insideLabelPos=getPieInsideLabelPos(pieItem,item)})});return pies}function getPieInsideLabelPos(pieItem,dataItem){var center=pieItem.center;var startAngle=dataItem.startAngle,endAngle=dataItem.endAngle,_dataItem$radius=(0,_slicedToArray2["default"])(dataItem.radius,2),ir=_dataItem$radius[0],or=_dataItem$radius[1];var radius=(ir+or)/2;var angle=(startAngle+endAngle)/2;return _util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([radius,angle]))}function calcPiesEdgeCenterPos(pies){pies.forEach(function(pie){var data=pie.data,center=pie.center;data.forEach(function(item){var startAngle=item.startAngle,endAngle=item.endAngle,radius=item.radius;var centerAngle=(startAngle+endAngle)/2;var pos=_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([radius[1],centerAngle]));item.edgeCenterPos=pos})});return pies}function calcPiesOutSideLabelPos(pies){pies.forEach(function(pieItem){var leftPieDataItems=getLeftOrRightPieDataItems(pieItem);var rightPieDataItems=getLeftOrRightPieDataItems(pieItem,false);leftPieDataItems=sortPiesFromTopToBottom(leftPieDataItems);rightPieDataItems=sortPiesFromTopToBottom(rightPieDataItems);addLabelLineAndAlign(leftPieDataItems,pieItem);addLabelLineAndAlign(rightPieDataItems,pieItem,false)});return pies}function getLabelLineBendRadius(pieItem){var labelLineBendGap=pieItem.outsideLabel.labelLineBendGap;var maxRadius=getPieMaxRadius(pieItem);if(typeof labelLineBendGap!=="number"){labelLineBendGap=parseInt(labelLineBendGap)/100*maxRadius}return labelLineBendGap+maxRadius}function getPieMaxRadius(pieItem){var data=pieItem.data;var radius=data.map(function(_ref8){var _ref8$radius=(0,_slicedToArray2["default"])(_ref8.radius,2),foo=_ref8$radius[0],r=_ref8$radius[1];return r});return Math.max.apply(Math,(0,_toConsumableArray2["default"])(radius))}function getLeftOrRightPieDataItems(pieItem){var left=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var data=pieItem.data,center=pieItem.center;var centerXPos=center[0];return data.filter(function(_ref9){var edgeCenterPos=_ref9.edgeCenterPos;var xPos=edgeCenterPos[0];if(left)return xPos<=centerXPos;return xPos>centerXPos})}function sortPiesFromTopToBottom(dataItem){dataItem.sort(function(_ref10,_ref11){var _ref10$edgeCenterPos=(0,_slicedToArray2["default"])(_ref10.edgeCenterPos,2),t=_ref10$edgeCenterPos[0],ay=_ref10$edgeCenterPos[1];var _ref11$edgeCenterPos=(0,_slicedToArray2["default"])(_ref11.edgeCenterPos,2),tt=_ref11$edgeCenterPos[0],by=_ref11$edgeCenterPos[1];if(ay>by)return 1;if(ay2&&arguments[2]!==undefined?arguments[2]:true;var center=pieItem.center,outsideLabel=pieItem.outsideLabel;var radius=getLabelLineBendRadius(pieItem);dataItem.forEach(function(item){var edgeCenterPos=item.edgeCenterPos,startAngle=item.startAngle,endAngle=item.endAngle;var labelLineEndLength=outsideLabel.labelLineEndLength;var angle=(startAngle+endAngle)/2;var bendPoint=_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(center).concat([radius,angle]));var endPoint=(0,_toConsumableArray2["default"])(bendPoint);endPoint[0]+=labelLineEndLength*(left?-1:1);item.labelLine=[edgeCenterPos,bendPoint,endPoint];item.labelLineLength=(0,_util2.getPolylineLength)(item.labelLine);item.align={textAlign:"left",textBaseline:"middle"};if(left)item.align.textAlign="right"})}function getPieConfig(pieItem){var data=pieItem.data,animationCurve=pieItem.animationCurve,animationFrame=pieItem.animationFrame,rLevel=pieItem.rLevel;return data.map(function(foo,i){return{name:"pie",index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,shape:getPieShape(pieItem,i),style:getPieStyle(pieItem,i)}})}function getStartPieConfig(pieItem){var animationDelayGap=pieItem.animationDelayGap,startAnimationCurve=pieItem.startAnimationCurve;var configs=getPieConfig(pieItem);configs.forEach(function(config,i){config.animationCurve=startAnimationCurve;config.animationDelay=i*animationDelayGap;config.shape.or=config.shape.ir});return configs}function beforeChangePie(graph){graph.animationDelay=0}function getPieShape(pieItem,i){var center=pieItem.center,data=pieItem.data;var dataItem=data[i];var radius=dataItem.radius,startAngle=dataItem.startAngle,endAngle=dataItem.endAngle;return{startAngle:startAngle,endAngle:endAngle,ir:radius[0],or:radius[1],rx:center[0],ry:center[1]}}function getPieStyle(pieItem,i){var pieStyle=pieItem.pieStyle,data=pieItem.data;var dataItem=data[i];var color=dataItem.color;return(0,_util2.deepMerge)({fill:color},pieStyle)}function getInsideLabelConfig(pieItem){var animationCurve=pieItem.animationCurve,animationFrame=pieItem.animationFrame,data=pieItem.data,rLevel=pieItem.rLevel;return data.map(function(foo,i){return{name:"text",index:rLevel,visible:pieItem.insideLabel.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getInsideLabelShape(pieItem,i),style:getInsideLabelStyle(pieItem,i)}})}function getInsideLabelShape(pieItem,i){var insideLabel=pieItem.insideLabel,data=pieItem.data;var formatter=insideLabel.formatter;var dataItem=data[i];var formatterType=(0,_typeof2["default"])(formatter);var label="";if(formatterType==="string"){label=formatter.replace("{name}",dataItem.name);label=label.replace("{percent}",dataItem.percent);label=label.replace("{value}",dataItem.value)}if(formatterType==="function"){label=formatter(dataItem)}return{content:label,position:dataItem.insideLabelPos}}function getInsideLabelStyle(pieItem,i){var style=pieItem.insideLabel.style;return style}function getOutsideLabelLineConfig(pieItem){var animationCurve=pieItem.animationCurve,animationFrame=pieItem.animationFrame,data=pieItem.data,rLevel=pieItem.rLevel;return data.map(function(foo,i){return{name:"polyline",index:rLevel,visible:pieItem.outsideLabel.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getOutsideLabelLineShape(pieItem,i),style:getOutsideLabelLineStyle(pieItem,i)}})}function getStartOutsideLabelLineConfig(pieItem){var data=pieItem.data;var configs=getOutsideLabelLineConfig(pieItem);configs.forEach(function(config,i){config.style.lineDash=[0,data[i].labelLineLength]});return configs}function getOutsideLabelLineShape(pieItem,i){var data=pieItem.data;var dataItem=data[i];return{points:dataItem.labelLine}}function getOutsideLabelLineStyle(pieItem,i){var outsideLabel=pieItem.outsideLabel,data=pieItem.data;var labelLineStyle=outsideLabel.labelLineStyle;var color=data[i].color;return(0,_util2.deepMerge)({stroke:color,lineDash:[data[i].labelLineLength,0]},labelLineStyle)}function getOutsideLabelConfig(pieItem){var animationCurve=pieItem.animationCurve,animationFrame=pieItem.animationFrame,data=pieItem.data,rLevel=pieItem.rLevel;return data.map(function(foo,i){return{name:"text",index:rLevel,visible:pieItem.outsideLabel.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getOutsideLabelShape(pieItem,i),style:getOutsideLabelStyle(pieItem,i)}})}function getStartOutsideLabelConfig(pieItem){var data=pieItem.data;var configs=getOutsideLabelConfig(pieItem);configs.forEach(function(config,i){config.shape.position=data[i].labelLine[1]});return configs}function getOutsideLabelShape(pieItem,i){var outsideLabel=pieItem.outsideLabel,data=pieItem.data;var formatter=outsideLabel.formatter;var _data$i=data[i],labelLine=_data$i.labelLine,name=_data$i.name,percent=_data$i.percent,value=_data$i.value;var formatterType=(0,_typeof2["default"])(formatter);var label="";if(formatterType==="string"){label=formatter.replace("{name}",name);label=label.replace("{percent}",percent);label=label.replace("{value}",value)}if(formatterType==="function"){label=formatter(data[i])}return{content:label,position:labelLine[2]}}function getOutsideLabelStyle(pieItem,i){var outsideLabel=pieItem.outsideLabel,data=pieItem.data;var _data$i2=data[i],color=_data$i2.color,align=_data$i2.align;var style=outsideLabel.style;return(0,_util2.deepMerge)(_objectSpread({fill:color},align),style)}},{"../class/updater.class":3,"../config/pie":12,"../util":30,"@babel/runtime/helpers/defineProperty":35,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42,"@babel/runtime/helpers/typeof":43,"@jiaminghi/c-render/lib/plugin/util":54}],25:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.radar=radar;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _updater=require("../class/updater.class");var _index=require("../config/index");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _color=require("@jiaminghi/color");var _util2=require("../util");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&arguments[1]!==undefined?arguments[1]:{};var series=option.series;if(!series)series=[];var radars=(0,_util2.initNeedSeries)(series,_index.radarConfig,"radar");radars=calcRadarPosition(radars,chart);radars=calcRadarLabelPosition(radars,chart);radars=calcRadarLabelAlign(radars,chart);(0,_updater.doUpdate)({chart:chart,series:radars,key:"radar",getGraphConfig:getRadarConfig,getStartGraphConfig:getStartRadarConfig,beforeChange:beforeChangeRadar});(0,_updater.doUpdate)({chart:chart,series:radars,key:"radarPoint",getGraphConfig:getPointConfig,getStartGraphConfig:getStartPointConfig});(0,_updater.doUpdate)({chart:chart,series:radars,key:"radarLabel",getGraphConfig:getLabelConfig})}function calcRadarPosition(radars,chart){var radarAxis=chart.radarAxis;if(!radarAxis)return[];var indicator=radarAxis.indicator,axisLineAngles=radarAxis.axisLineAngles,radius=radarAxis.radius,centerPos=radarAxis.centerPos;radars.forEach(function(radarItem){var data=radarItem.data;radarItem.dataRadius=[];radarItem.radarPosition=indicator.map(function(_ref,i){var max=_ref.max,min=_ref.min;var v=data[i];if(typeof max!=="number")max=v;if(typeof min!=="number")min=0;if(typeof v!=="number")v=min;var dataRadius=(v-min)/(max-min)*radius;radarItem.dataRadius[i]=dataRadius;return _util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(centerPos).concat([dataRadius,axisLineAngles[i]]))})});return radars}function calcRadarLabelPosition(radars,chart){var radarAxis=chart.radarAxis;if(!radarAxis)return[];var centerPos=radarAxis.centerPos,axisLineAngles=radarAxis.axisLineAngles;radars.forEach(function(radarItem){var dataRadius=radarItem.dataRadius,label=radarItem.label;var labelGap=label.labelGap;radarItem.labelPosition=dataRadius.map(function(r,i){return _util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(centerPos).concat([r+labelGap,axisLineAngles[i]]))})});return radars}function calcRadarLabelAlign(radars,chart){var radarAxis=chart.radarAxis;if(!radarAxis)return[];var _radarAxis$centerPos=(0,_slicedToArray2["default"])(radarAxis.centerPos,2),x=_radarAxis$centerPos[0],y=_radarAxis$centerPos[1];radars.forEach(function(radarItem){var labelPosition=radarItem.labelPosition;var labelAlign=labelPosition.map(function(_ref2){var _ref3=(0,_slicedToArray2["default"])(_ref2,2),lx=_ref3[0],ly=_ref3[1];var textAlign=lx>x?"left":"right";var textBaseline=ly>y?"top":"bottom";return{textAlign:textAlign,textBaseline:textBaseline}});radarItem.labelAlign=labelAlign});return radars}function getRadarConfig(radarItem){var animationCurve=radarItem.animationCurve,animationFrame=radarItem.animationFrame,rLevel=radarItem.rLevel;return[{name:"polyline",index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,shape:getRadarShape(radarItem),style:getRadarStyle(radarItem)}]}function getStartRadarConfig(radarItem,updater){var centerPos=updater.chart.radarAxis.centerPos;var config=getRadarConfig(radarItem)[0];var pointNum=config.shape.points.length;var points=new Array(pointNum).fill(0).map(function(foo){return(0,_toConsumableArray2["default"])(centerPos)});config.shape.points=points;return[config]}function getRadarShape(radarItem){var radarPosition=radarItem.radarPosition;return{points:radarPosition,close:true}}function getRadarStyle(radarItem){var radarStyle=radarItem.radarStyle,color=radarItem.color;var colorRgbaValue=(0,_color.getRgbaValue)(color);colorRgbaValue[3]=.5;var radarDefaultColor={stroke:color,fill:(0,_color.getColorFromRgbValue)(colorRgbaValue)};return(0,_util2.deepMerge)(radarDefaultColor,radarStyle)}function beforeChangeRadar(graph,_ref4){var shape=_ref4.shape;var graphPoints=graph.shape.points;var graphPointsNum=graphPoints.length;var pointsNum=shape.points.length;if(pointsNum>graphPointsNum){var lastPoint=graphPoints.slice(-1)[0];var newAddPoints=new Array(pointsNum-graphPointsNum).fill(0).map(function(foo){return(0,_toConsumableArray2["default"])(lastPoint)});graphPoints.push.apply(graphPoints,(0,_toConsumableArray2["default"])(newAddPoints))}else if(pointsNum1&&arguments[1]!==undefined?arguments[1]:{};var radar=option.radar;var radarAxis=[];if(radar){radarAxis=mergeRadarAxisDefaultConfig(radar);radarAxis=calcRadarAxisCenter(radarAxis,chart);radarAxis=calcRadarAxisRingRadius(radarAxis,chart);radarAxis=calcRadarAxisLinePosition(radarAxis);radarAxis=calcRadarAxisAreaRadius(radarAxis);radarAxis=calcRadarAxisLabelPosition(radarAxis);radarAxis=[radarAxis]}var radarAxisForUpdate=radarAxis;if(radarAxis.length&&!radarAxis[0].show)radarAxisForUpdate=[];(0,_updater.doUpdate)({chart:chart,series:radarAxisForUpdate,key:"radarAxisSplitArea",getGraphConfig:getSplitAreaConfig,beforeUpdate:beforeUpdateSplitArea,beforeChange:beforeChangeSplitArea});(0,_updater.doUpdate)({chart:chart,series:radarAxisForUpdate,key:"radarAxisSplitLine",getGraphConfig:getSplitLineConfig,beforeUpdate:beforeUpdateSplitLine,beforeChange:beforeChangeSplitLine});(0,_updater.doUpdate)({chart:chart,series:radarAxisForUpdate,key:"radarAxisLine",getGraphConfig:getAxisLineConfig});(0,_updater.doUpdate)({chart:chart,series:radarAxisForUpdate,key:"radarAxisLable",getGraphConfig:getAxisLabelConfig});chart.radarAxis=radarAxis[0]}function mergeRadarAxisDefaultConfig(radar){return(0,_util2.deepMerge)((0,_util.deepClone)(_index.radarAxisConfig),radar)}function calcRadarAxisCenter(radarAxis,chart){var area=chart.render.area;var center=radarAxis.center;radarAxis.centerPos=center.map(function(v,i){if(typeof v==="number")return v;return parseInt(v)/100*area[i]});return radarAxis}function calcRadarAxisRingRadius(radarAxis,chart){var area=chart.render.area;var splitNum=radarAxis.splitNum,radius=radarAxis.radius;var maxRadius=Math.min.apply(Math,(0,_toConsumableArray2["default"])(area))/2;if(typeof radius!=="number")radius=parseInt(radius)/100*maxRadius;var splitGap=radius/splitNum;radarAxis.ringRadius=new Array(splitNum).fill(0).map(function(foo,i){return splitGap*(i+1)});radarAxis.radius=radius;return radarAxis}function calcRadarAxisLinePosition(radarAxis){var indicator=radarAxis.indicator,centerPos=radarAxis.centerPos,radius=radarAxis.radius,startAngle=radarAxis.startAngle;var fullAngle=Math.PI*2;var indicatorNum=indicator.length;var indicatorGap=fullAngle/indicatorNum;var angles=new Array(indicatorNum).fill(0).map(function(foo,i){return indicatorGap*i+startAngle});radarAxis.axisLineAngles=angles;radarAxis.axisLinePosition=angles.map(function(g){return _util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(centerPos).concat([radius,g]))});return radarAxis}function calcRadarAxisAreaRadius(radarAxis){var ringRadius=radarAxis.ringRadius;var subRadius=ringRadius[0]/2;radarAxis.areaRadius=ringRadius.map(function(r){return r-subRadius});return radarAxis}function calcRadarAxisLabelPosition(radarAxis){var axisLineAngles=radarAxis.axisLineAngles,centerPos=radarAxis.centerPos,radius=radarAxis.radius,axisLabel=radarAxis.axisLabel;radius+=axisLabel.labelGap;radarAxis.axisLabelPosition=axisLineAngles.map(function(angle){return _util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(centerPos).concat([radius,angle]))});return radarAxis}function getSplitAreaConfig(radarAxis){var areaRadius=radarAxis.areaRadius,polygon=radarAxis.polygon,animationCurve=radarAxis.animationCurve,animationFrame=radarAxis.animationFrame,rLevel=radarAxis.rLevel;var name=polygon?"regPolygon":"ring";return areaRadius.map(function(foo,i){return{name:name,index:rLevel,visible:radarAxis.splitArea.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getSplitAreaShape(radarAxis,i),style:getSplitAreaStyle(radarAxis,i)}})}function getSplitAreaShape(radarAxis,i){var polygon=radarAxis.polygon,areaRadius=radarAxis.areaRadius,indicator=radarAxis.indicator,centerPos=radarAxis.centerPos;var indicatorNum=indicator.length;var shape={rx:centerPos[0],ry:centerPos[1],r:areaRadius[i]};if(polygon)shape.side=indicatorNum;return shape}function getSplitAreaStyle(radarAxis,i){var splitArea=radarAxis.splitArea,ringRadius=radarAxis.ringRadius,axisLineAngles=radarAxis.axisLineAngles,polygon=radarAxis.polygon,centerPos=radarAxis.centerPos;var color=splitArea.color,style=splitArea.style;style=_objectSpread({fill:"rgba(0, 0, 0, 0)"},style);var lineWidth=ringRadius[0]-0;if(polygon){var point1=_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(centerPos).concat([ringRadius[0],axisLineAngles[0]]));var point2=_util.getCircleRadianPoint.apply(void 0,(0,_toConsumableArray2["default"])(centerPos).concat([ringRadius[0],axisLineAngles[1]]));lineWidth=(0,_util2.getPointToLineDistance)(centerPos,point1,point2)}style=(0,_util2.deepMerge)((0,_util.deepClone)(style,true),{lineWidth:lineWidth});if(!color.length)return style;var colorNum=color.length;return(0,_util2.deepMerge)(style,{stroke:color[i%colorNum]})}function beforeUpdateSplitArea(graphs,radarAxis,i,updater){var cache=graphs[i];if(!cache)return;var render=updater.chart.render;var polygon=radarAxis.polygon;var name=cache[0].name;var currentName=polygon?"regPolygon":"ring";var delAll=currentName!==name;if(!delAll)return;cache.forEach(function(g){return render.delGraph(g)});graphs[i]=null}function beforeChangeSplitArea(graph,config){var side=config.shape.side;if(typeof side!=="number")return;graph.shape.side=side}function getSplitLineConfig(radarAxis){var ringRadius=radarAxis.ringRadius,polygon=radarAxis.polygon,animationCurve=radarAxis.animationCurve,animationFrame=radarAxis.animationFrame,rLevel=radarAxis.rLevel;var name=polygon?"regPolygon":"ring";return ringRadius.map(function(foo,i){return{name:name,index:rLevel,animationCurve:animationCurve,animationFrame:animationFrame,visible:radarAxis.splitLine.show,shape:getSplitLineShape(radarAxis,i),style:getSplitLineStyle(radarAxis,i)}})}function getSplitLineShape(radarAxis,i){var ringRadius=radarAxis.ringRadius,centerPos=radarAxis.centerPos,indicator=radarAxis.indicator,polygon=radarAxis.polygon;var shape={rx:centerPos[0],ry:centerPos[1],r:ringRadius[i]};var indicatorNum=indicator.length;if(polygon)shape.side=indicatorNum;return shape}function getSplitLineStyle(radarAxis,i){var splitLine=radarAxis.splitLine;var color=splitLine.color,style=splitLine.style;style=_objectSpread({fill:"rgba(0, 0, 0, 0)"},style);if(!color.length)return style;var colorNum=color.length;return(0,_util2.deepMerge)(style,{stroke:color[i%colorNum]})}function beforeUpdateSplitLine(graphs,radarAxis,i,updater){var cache=graphs[i];if(!cache)return;var render=updater.chart.render;var polygon=radarAxis.polygon;var name=cache[0].name;var currenName=polygon?"regPolygon":"ring";var delAll=currenName!==name;if(!delAll)return;cache.forEach(function(g){return render.delGraph(g)});graphs[i]=null}function beforeChangeSplitLine(graph,config){var side=config.shape.side;if(typeof side!=="number")return;graph.shape.side=side}function getAxisLineConfig(radarAxis){var axisLinePosition=radarAxis.axisLinePosition,animationCurve=radarAxis.animationCurve,animationFrame=radarAxis.animationFrame,rLevel=radarAxis.rLevel;return axisLinePosition.map(function(foo,i){return{name:"polyline",index:rLevel,visible:radarAxis.axisLine.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getAxisLineShape(radarAxis,i),style:getAxisLineStyle(radarAxis,i)}})}function getAxisLineShape(radarAxis,i){var centerPos=radarAxis.centerPos,axisLinePosition=radarAxis.axisLinePosition;var points=[centerPos,axisLinePosition[i]];return{points:points}}function getAxisLineStyle(radarAxis,i){var axisLine=radarAxis.axisLine;var color=axisLine.color,style=axisLine.style;if(!color.length)return style;var colorNum=color.length;return(0,_util2.deepMerge)(style,{stroke:color[i%colorNum]})}function getAxisLabelConfig(radarAxis){var axisLabelPosition=radarAxis.axisLabelPosition,animationCurve=radarAxis.animationCurve,animationFrame=radarAxis.animationFrame,rLevel=radarAxis.rLevel;return axisLabelPosition.map(function(foo,i){return{name:"text",index:rLevel,visible:radarAxis.axisLabel.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:getAxisLableShape(radarAxis,i),style:getAxisLableStyle(radarAxis,i)}})}function getAxisLableShape(radarAxis,i){var axisLabelPosition=radarAxis.axisLabelPosition,indicator=radarAxis.indicator;return{content:indicator[i].name,position:axisLabelPosition[i]}}function getAxisLableStyle(radarAxis,i){var axisLabel=radarAxis.axisLabel,_radarAxis$centerPos=(0,_slicedToArray2["default"])(radarAxis.centerPos,2),x=_radarAxis$centerPos[0],y=_radarAxis$centerPos[1],axisLabelPosition=radarAxis.axisLabelPosition;var color=axisLabel.color,style=axisLabel.style;var _axisLabelPosition$i=(0,_slicedToArray2["default"])(axisLabelPosition[i],2),labelXpos=_axisLabelPosition$i[0],labelYPos=_axisLabelPosition$i[1];var textAlign=labelXpos>x?"left":"right";var textBaseline=labelYPos>y?"top":"bottom";style=(0,_util2.deepMerge)({textAlign:textAlign,textBaseline:textBaseline},style);if(!color.length)return style;var colorNum=color.length;return(0,_util2.deepMerge)(style,{fill:color[i%colorNum]})}},{"../class/updater.class":3,"../config/index":9,"../util":30,"@babel/runtime/helpers/defineProperty":35,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42,"@jiaminghi/c-render/lib/plugin/util":54}],27:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.title=title;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _updater=require("../class/updater.class");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _config=require("../config");var _util2=require("../util");function title(chart){var option=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var title=[];if(option.title){title[0]=(0,_util2.deepMerge)((0,_util.deepClone)(_config.titleConfig,true),option.title)}(0,_updater.doUpdate)({chart:chart,series:title,key:"title",getGraphConfig:getTitleConfig})}function getTitleConfig(titleItem,updater){var animationCurve=_config.titleConfig.animationCurve,animationFrame=_config.titleConfig.animationFrame,rLevel=_config.titleConfig.rLevel;var shape=getTitleShape(titleItem,updater);var style=getTitleStyle(titleItem);return[{name:"text",index:rLevel,visible:titleItem.show,animationCurve:animationCurve,animationFrame:animationFrame,shape:shape,style:style}]}function getTitleShape(titleItem,updater){var offset=titleItem.offset,text=titleItem.text;var _updater$chart$gridAr=updater.chart.gridArea,x=_updater$chart$gridAr.x,y=_updater$chart$gridAr.y,w=_updater$chart$gridAr.w;var _offset=(0,_slicedToArray2["default"])(offset,2),ox=_offset[0],oy=_offset[1];return{content:text,position:[x+w/2+ox,y+oy]}}function getTitleStyle(titleItem){var style=titleItem.style;return style}},{"../class/updater.class":3,"../config":9,"../util":30,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@jiaminghi/c-render/lib/plugin/util":54}],28:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _cRender=require("@jiaminghi/c-render");var _util=require("@jiaminghi/c-render/lib/plugin/util");var _color=require("@jiaminghi/color");var _index=require("../util/index");var pie={shape:{rx:0,ry:0,ir:0,or:0,startAngle:0,endAngle:0,clockWise:true},validator:function validator(_ref){var shape=_ref.shape;var keys=["rx","ry","ir","or","startAngle","endAngle"];if(keys.find(function(key){return typeof shape[key]!=="number"})){console.error("Pie shape configuration is abnormal!");return false}return true},draw:function draw(_ref2,_ref3){var ctx=_ref2.ctx;var shape=_ref3.shape;ctx.beginPath();var rx=shape.rx,ry=shape.ry,ir=shape.ir,or=shape.or,startAngle=shape.startAngle,endAngle=shape.endAngle,clockWise=shape.clockWise;rx=parseInt(rx)+.5;ry=parseInt(ry)+.5;ctx.arc(rx,ry,ir>0?ir:0,startAngle,endAngle,!clockWise);var connectPoint1=(0,_util.getCircleRadianPoint)(rx,ry,or,endAngle).map(function(p){return parseInt(p)+.5});var connectPoint2=(0,_util.getCircleRadianPoint)(rx,ry,ir,startAngle).map(function(p){return parseInt(p)+.5});ctx.lineTo.apply(ctx,(0,_toConsumableArray2["default"])(connectPoint1));ctx.arc(rx,ry,or>0?or:0,endAngle,startAngle,clockWise);ctx.lineTo.apply(ctx,(0,_toConsumableArray2["default"])(connectPoint2));ctx.closePath();ctx.stroke();ctx.fill()}};var agArc={shape:{rx:0,ry:0,r:0,startAngle:0,endAngle:0,gradientStartAngle:null,gradientEndAngle:null},validator:function validator(_ref4){var shape=_ref4.shape;var keys=["rx","ry","r","startAngle","endAngle"];if(keys.find(function(key){return typeof shape[key]!=="number"})){console.error("AgArc shape configuration is abnormal!");return false}return true},draw:function draw(_ref5,_ref6){var ctx=_ref5.ctx;var shape=_ref6.shape,style=_ref6.style;var gradient=style.gradient;gradient=gradient.map(function(cv){return(0,_color.getColorFromRgbValue)(cv)});if(gradient.length===1){gradient=[gradient[0],gradient[0]]}var gradientArcNum=gradient.length-1;var gradientStartAngle=shape.gradientStartAngle,gradientEndAngle=shape.gradientEndAngle,startAngle=shape.startAngle,endAngle=shape.endAngle,r=shape.r,rx=shape.rx,ry=shape.ry;if(gradientStartAngle===null)gradientStartAngle=startAngle;if(gradientEndAngle===null)gradientEndAngle=endAngle;var angleGap=(gradientEndAngle-gradientStartAngle)/gradientArcNum;if(angleGap===Math.PI*2)angleGap=Math.PI*2-.001;for(var i=0;iendAngle){arcEndAngle=endAngle;doBreak=true}ctx.arc(rx,ry,r,arcStartAngle,arcEndAngle);ctx.strokeStyle=color;ctx.stroke();if(doBreak)break}}};var numberText={shape:{number:[],content:"",position:[0,0],toFixed:0},validator:function validator(_ref7){var shape=_ref7.shape;var number=shape.number,content=shape.content,position=shape.position;if(!(number instanceof Array)||typeof content!=="string"||!(position instanceof Array)){console.error("NumberText shape configuration is abnormal!");return false}return true},draw:function draw(_ref8,_ref9){var ctx=_ref8.ctx;var shape=_ref9.shape;ctx.beginPath();var number=shape.number,content=shape.content,position=shape.position,toFixed=shape.toFixed;var textSegments=content.split("{nt}");var lastSegmentIndex=textSegments.length-1;var textString="";textSegments.forEach(function(t,i){var currentNumber=number[i];if(i===lastSegmentIndex)currentNumber="";if(typeof currentNumber==="number")currentNumber=currentNumber.toFixed(toFixed);textString+=t+(currentNumber||"")});ctx.closePath();ctx.strokeText.apply(ctx,[textString].concat((0,_toConsumableArray2["default"])(position)));ctx.fillText.apply(ctx,[textString].concat((0,_toConsumableArray2["default"])(position)))}};var lineIcon={shape:{x:0,y:0,w:0,h:0},validator:function validator(_ref10){var shape=_ref10.shape;var x=shape.x,y=shape.y,w=shape.w,h=shape.h;if(typeof x!=="number"||typeof y!=="number"||typeof w!=="number"||typeof h!=="number"){console.error("lineIcon shape configuration is abnormal!");return false}return true},draw:function draw(_ref11,_ref12){var ctx=_ref11.ctx;var shape=_ref12.shape;ctx.beginPath();var x=shape.x,y=shape.y,w=shape.w,h=shape.h;var halfH=h/2;ctx.strokeStyle=ctx.fillStyle;ctx.moveTo(x,y+halfH);ctx.lineTo(x+w,y+halfH);ctx.lineWidth=1;ctx.stroke();ctx.beginPath();var radius=halfH-5*2;if(radius<=0)radius=3;ctx.arc(x+w/2,y+halfH,radius,0,Math.PI*2);ctx.lineWidth=5;ctx.stroke();ctx.fillStyle="#fff";ctx.fill()},hoverCheck:function hoverCheck(position,_ref13){var shape=_ref13.shape;var x=shape.x,y=shape.y,w=shape.w,h=shape.h;return(0,_util.checkPointIsInRect)(position,x,y,w,h)},setGraphCenter:function setGraphCenter(e,_ref14){var shape=_ref14.shape,style=_ref14.style;var x=shape.x,y=shape.y,w=shape.w,h=shape.h;style.graphCenter=[x+w/2,y+h/2]}};(0,_cRender.extendNewGraph)("pie",pie);(0,_cRender.extendNewGraph)("agArc",agArc);(0,_cRender.extendNewGraph)("numberText",numberText);(0,_cRender.extendNewGraph)("lineIcon",lineIcon)},{"../util/index":30,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/toConsumableArray":42,"@jiaminghi/c-render":52,"@jiaminghi/c-render/lib/plugin/util":54,"@jiaminghi/color":56}],29:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"changeDefaultConfig",{enumerable:true,get:function get(){return _config.changeDefaultConfig}});exports["default"]=void 0;var _charts=_interopRequireDefault(require("./class/charts.class"));var _config=require("./config");var _default=_charts["default"];exports["default"]=_default},{"./class/charts.class":2,"./config":9,"@babel/runtime/helpers/interopRequireDefault":36}],30:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.filterNonNumber=filterNonNumber;exports.deepMerge=deepMerge;exports.mulAdd=mulAdd;exports.mergeSameStackData=mergeSameStackData;exports.getTwoPointDistance=getTwoPointDistance;exports.getLinearGradientColor=getLinearGradientColor;exports.getPolylineLength=getPolylineLength;exports.getPointToLineDistance=getPointToLineDistance;exports.initNeedSeries=initNeedSeries;exports.radianToAngle=radianToAngle;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _util=require("@jiaminghi/c-render/lib/plugin/util");function filterNonNumber(array){return array.filter(function(n){return typeof n==="number"})}function deepMerge(target,merged){for(var key in merged){if(target[key]&&(0,_typeof2["default"])(target[key])==="object"){deepMerge(target[key],merged[key]);continue}if((0,_typeof2["default"])(merged[key])==="object"){target[key]=(0,_util.deepClone)(merged[key],true);continue}target[key]=merged[key]}return target}function mulAdd(nums){nums=filterNonNumber(nums);return nums.reduce(function(all,num){return all+num},0)}function mergeSameStackData(item,series){var stack=item.stack;if(!stack)return(0,_toConsumableArray2["default"])(item.data);var stacks=series.filter(function(_ref){var s=_ref.stack;return s===stack});var index=stacks.findIndex(function(_ref2){var d=_ref2.data;return d===item.data});var datas=stacks.splice(0,index+1).map(function(_ref3){var data=_ref3.data;return data});var dataLength=datas[0].length;return new Array(dataLength).fill(0).map(function(foo,i){return mulAdd(datas.map(function(d){return d[i]}))})}function getTwoPointDistance(pointOne,pointTwo){var minusX=Math.abs(pointOne[0]-pointTwo[0]);var minusY=Math.abs(pointOne[1]-pointTwo[1]);return Math.sqrt(minusX*minusX+minusY*minusY)}function getLinearGradientColor(ctx,begin,end,color){if(!ctx||!begin||!end||!color.length)return;var colors=color;typeof colors==="string"&&(colors=[color,color]);var linearGradientColor=ctx.createLinearGradient.apply(ctx,(0,_toConsumableArray2["default"])(begin).concat((0,_toConsumableArray2["default"])(end)));var colorGap=1/(colors.length-1);colors.forEach(function(c,i){return linearGradientColor.addColorStop(colorGap*i,c)});return linearGradientColor}function getPolylineLength(points){var lineSegments=new Array(points.length-1).fill(0).map(function(foo,i){return[points[i],points[i+1]]});var lengths=lineSegments.map(function(item){return getTwoPointDistance.apply(void 0,(0,_toConsumableArray2["default"])(item))});return mulAdd(lengths)}function getPointToLineDistance(point,linePointOne,linePointTwo){var a=getTwoPointDistance(point,linePointOne);var b=getTwoPointDistance(point,linePointTwo);var c=getTwoPointDistance(linePointOne,linePointTwo);return.5*Math.sqrt((a+b+c)*(a+b-c)*(a+c-b)*(b+c-a))/c}function initNeedSeries(series,config,type){series=series.filter(function(_ref4){var st=_ref4.type;return st===type});series=series.map(function(item){return deepMerge((0,_util.deepClone)(config,true),item)});return series.filter(function(_ref5){var show=_ref5.show;return show})}function radianToAngle(radian){return radian/Math.PI*180}},{"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/toConsumableArray":42,"@babel/runtime/helpers/typeof":43,"@jiaminghi/c-render/lib/plugin/util":54}],31:[function(require,module,exports){function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}module.exports=_arrayWithHoles},{}],32:[function(require,module,exports){function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i1&&arguments[1]!==undefined?arguments[1]:5;var segmentsNum=bezierCurve.length-1;var startPoint=bezierCurve[0];var endPoint=bezierCurve[segmentsNum][2];var segments=bezierCurve.slice(1);var getSegmentTPointFuns=segments.map(function(seg,i){var beginPoint=i===0?startPoint:segments[i-1][2];return createGetBezierCurveTPointFun.apply(void 0,[beginPoint].concat((0,_toConsumableArray2["default"])(seg)))});var segmentPointsNum=new Array(segmentsNum).fill(defaultSegmentPointsNum);var segmentPoints=getSegmentPointsByNum(getSegmentTPointFuns,segmentPointsNum);var result=calcUniformPointsByIteration(segmentPoints,getSegmentTPointFuns,segments,precision);result.segmentPoints.push(endPoint);return result}function createGetBezierCurveTPointFun(beginPoint,controlPoint1,controlPoint2,endPoint){return function(t){var tSubed1=1-t;var tSubed1Pow3=pow(tSubed1,3);var tSubed1Pow2=pow(tSubed1,2);var tPow3=pow(t,3);var tPow2=pow(t,2);return[beginPoint[0]*tSubed1Pow3+3*controlPoint1[0]*t*tSubed1Pow2+3*controlPoint2[0]*tPow2*tSubed1+endPoint[0]*tPow3,beginPoint[1]*tSubed1Pow3+3*controlPoint1[1]*t*tSubed1Pow2+3*controlPoint2[1]*tPow2*tSubed1+endPoint[1]*tPow3]}}function getTwoPointDistance(_ref,_ref2){var _ref3=(0,_slicedToArray2["default"])(_ref,2),ax=_ref3[0],ay=_ref3[1];var _ref4=(0,_slicedToArray2["default"])(_ref2,2),bx=_ref4[0],by=_ref4[1];return sqrt(pow(ax-bx,2)+pow(ay-by,2))}function getNumsSum(nums){return nums.reduce(function(sum,num){return sum+num},0)}function getSegmentPointsDistance(segmentPoints){return segmentPoints.map(function(points,i){return new Array(points.length-1).fill(0).map(function(temp,j){return getTwoPointDistance(points[j],points[j+1])})})}function getSegmentPointsByNum(getSegmentTPointFuns,segmentPointsNum){return getSegmentTPointFuns.map(function(getSegmentTPointFun,i){var tGap=1/segmentPointsNum[i];return new Array(segmentPointsNum[i]).fill("").map(function(foo,j){return getSegmentTPointFun(j*tGap)})})}function getAllDeviations(segmentPointsDistance,avgLength){return segmentPointsDistance.map(function(seg){return seg.map(function(s){return abs(s-avgLength)})}).map(function(seg){return getNumsSum(seg)}).reduce(function(total,v){return total+v},0)}function calcUniformPointsByIteration(segmentPoints,getSegmentTPointFuns,segments,precision){var rounds=4;var cycles=1;var _loop=function _loop(){var totalPointsNum=segmentPoints.reduce(function(total,seg){return total+seg.length},0);segmentPoints.forEach(function(seg,i){return seg.push(segments[i][2])});var segmentPointsDistance=getSegmentPointsDistance(segmentPoints);var lineSegmentNum=segmentPointsDistance.reduce(function(total,seg){return total+seg.length},0);var segmentlength=segmentPointsDistance.map(function(seg){return getNumsSum(seg)});var totalLength=getNumsSum(segmentlength);var avgLength=totalLength/lineSegmentNum;var allDeviations=getAllDeviations(segmentPointsDistance,avgLength);if(allDeviations<=precision)return"break";totalPointsNum=ceil(avgLength/precision*totalPointsNum*1.1);var segmentPointsNum=segmentlength.map(function(length){return ceil(length/totalLength*totalPointsNum)});segmentPoints=getSegmentPointsByNum(getSegmentTPointFuns,segmentPointsNum);totalPointsNum=segmentPoints.reduce(function(total,seg){return total+seg.length},0);var segmentPointsForLength=JSON.parse(JSON.stringify(segmentPoints));segmentPointsForLength.forEach(function(seg,i){return seg.push(segments[i][2])});segmentPointsDistance=getSegmentPointsDistance(segmentPointsForLength);lineSegmentNum=segmentPointsDistance.reduce(function(total,seg){return total+seg.length},0);segmentlength=segmentPointsDistance.map(function(seg){return getNumsSum(seg)});totalLength=getNumsSum(segmentlength);avgLength=totalLength/lineSegmentNum;var stepSize=1/totalPointsNum/10;getSegmentTPointFuns.forEach(function(getSegmentTPointFun,i){var currentSegmentPointsNum=segmentPointsNum[i];var t=new Array(currentSegmentPointsNum).fill("").map(function(foo,j){return j/segmentPointsNum[i]});for(var r=0;r1)t[j]=1;if(t[j]<0)t[j]=0;segmentPoints[i][j]=getSegmentTPointFun(t[j])}}});rounds*=4;cycles++};do{var _ret=_loop();if(_ret==="break")break}while(rounds<=1025);segmentPoints=segmentPoints.reduce(function(all,seg){return all.concat(seg)},[]);return{segmentPoints:segmentPoints,cycles:cycles,rounds:rounds}}function bezierCurveToPolyline(bezierCurve){var precision=arguments.length>1&&arguments[1]!==undefined?arguments[1]:5;if(!bezierCurve){console.error("bezierCurveToPolyline: Missing parameters!");return false}if(!(bezierCurve instanceof Array)){console.error("bezierCurveToPolyline: Parameter bezierCurve must be an array!");return false}if(typeof precision!=="number"){console.error("bezierCurveToPolyline: Parameter precision must be a number!");return false}var _abstractBezierCurveT=abstractBezierCurveToPolyline(bezierCurve,precision),segmentPoints=_abstractBezierCurveT.segmentPoints;return segmentPoints}function getBezierCurveLength(bezierCurve){var precision=arguments.length>1&&arguments[1]!==undefined?arguments[1]:5;if(!bezierCurve){console.error("getBezierCurveLength: Missing parameters!");return false}if(!(bezierCurve instanceof Array)){console.error("getBezierCurveLength: Parameter bezierCurve must be an array!");return false}if(typeof precision!=="number"){console.error("getBezierCurveLength: Parameter precision must be a number!");return false}var _abstractBezierCurveT2=abstractBezierCurveToPolyline(bezierCurve,precision),segmentPoints=_abstractBezierCurveT2.segmentPoints;var pointsDistance=getSegmentPointsDistance([segmentPoints])[0];var length=getNumsSum(pointsDistance);return length}var _default=bezierCurveToPolyline;exports["default"]=_default},{"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42}],46:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));function polylineToBezierCurve(polyline){var close=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var offsetA=arguments.length>2&&arguments[2]!==undefined?arguments[2]:.25;var offsetB=arguments.length>3&&arguments[3]!==undefined?arguments[3]:.25;if(!(polyline instanceof Array)){console.error("polylineToBezierCurve: Parameter polyline must be an array!");return false}if(polyline.length<=2){console.error("polylineToBezierCurve: Converting to a curve requires at least 3 points!");return false}var startPoint=polyline[0];var bezierCurveLineNum=polyline.length-1;var bezierCurvePoints=new Array(bezierCurveLineNum).fill(0).map(function(foo,i){return[].concat((0,_toConsumableArray2["default"])(getBezierCurveLineControlPoints(polyline,i,close,offsetA,offsetB)),[polyline[i+1]])});if(close)closeBezierCurve(bezierCurvePoints,startPoint);bezierCurvePoints.unshift(polyline[0]);return bezierCurvePoints}function getBezierCurveLineControlPoints(polyline,index){var close=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var offsetA=arguments.length>3&&arguments[3]!==undefined?arguments[3]:.25;var offsetB=arguments.length>4&&arguments[4]!==undefined?arguments[4]:.25;var pointNum=polyline.length;if(pointNum<3||index>=pointNum)return;var beforePointIndex=index-1;if(beforePointIndex<0)beforePointIndex=close?pointNum+beforePointIndex:0;var afterPointIndex=index+1;if(afterPointIndex>=pointNum)afterPointIndex=close?afterPointIndex-pointNum:pointNum-1;var afterNextPointIndex=index+2;if(afterNextPointIndex>=pointNum)afterNextPointIndex=close?afterNextPointIndex-pointNum:pointNum-1;var pointBefore=polyline[beforePointIndex];var pointMiddle=polyline[index];var pointAfter=polyline[afterPointIndex];var pointAfterNext=polyline[afterNextPointIndex];return[[pointMiddle[0]+offsetA*(pointAfter[0]-pointBefore[0]),pointMiddle[1]+offsetA*(pointAfter[1]-pointBefore[1])],[pointAfter[0]-offsetB*(pointAfterNext[0]-pointMiddle[0]),pointAfter[1]-offsetB*(pointAfterNext[1]-pointMiddle[1])]]}function closeBezierCurve(bezierCurve,startPoint){var firstSubCurve=bezierCurve[0];var lastSubCurve=bezierCurve.slice(-1)[0];bezierCurve.push([getSymmetryPoint(lastSubCurve[1],lastSubCurve[2]),getSymmetryPoint(firstSubCurve[0],startPoint),startPoint]);return bezierCurve}function getSymmetryPoint(point,centerPoint){var _point=(0,_slicedToArray2["default"])(point,2),px=_point[0],py=_point[1];var _centerPoint=(0,_slicedToArray2["default"])(centerPoint,2),cx=_centerPoint[0],cy=_centerPoint[1];var minusX=cx-px;var minusY=cy-py;return[cx+minusX,cy+minusY]}var _default=polylineToBezierCurve;exports["default"]=_default},{"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42}],47:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"bezierCurveToPolyline",{enumerable:true,get:function get(){return _bezierCurveToPolyline.bezierCurveToPolyline}});Object.defineProperty(exports,"getBezierCurveLength",{enumerable:true,get:function get(){return _bezierCurveToPolyline.getBezierCurveLength}});Object.defineProperty(exports,"polylineToBezierCurve",{enumerable:true,get:function get(){return _polylineToBezierCurve["default"]}});exports["default"]=void 0;var _bezierCurveToPolyline=require("./core/bezierCurveToPolyline");var _polylineToBezierCurve=_interopRequireDefault(require("./core/polylineToBezierCurve"));var _default={bezierCurveToPolyline:_bezierCurveToPolyline.bezierCurveToPolyline,getBezierCurveLength:_bezierCurveToPolyline.getBezierCurveLength,polylineToBezierCurve:_polylineToBezierCurve["default"]};exports["default"]=_default},{"./core/bezierCurveToPolyline":45,"./core/polylineToBezierCurve":46,"@babel/runtime/helpers/interopRequireDefault":36}],48:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _color=_interopRequireDefault(require("@jiaminghi/color"));var _bezierCurve=_interopRequireDefault(require("@jiaminghi/bezier-curve"));var _util=require("../plugin/util");var _graphs=_interopRequireDefault(require("../config/graphs"));var _graph=_interopRequireDefault(require("./graph.class"));function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable});keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i0&&arguments[0]!==undefined?arguments[0]:{};var name=config.name;if(!name){console.error("add Missing parameters!");return}var graphConfig=_graphs["default"].get(name);if(!graphConfig){console.warn("No corresponding graph configuration found!");return}var graph=new _graph["default"](graphConfig,config);if(!graph.validator(graph))return;graph.render=this;this.graphs.push(graph);this.sortGraphsByIndex();this.drawAllGraph();return graph};CRender.prototype.sortGraphsByIndex=function(){var graphs=this.graphs;graphs.sort(function(a,b){if(a.index>b.index)return 1;if(a.index===b.index)return 0;if(a.index1&&arguments[1]!==undefined?arguments[1]:undefined;if(!attrName||change===undefined)return false;var isObject=(0,_typeof2["default"])(this[attrName])==="object";if(isObject)change=(0,_util.deepClone)(change,true);var render=this.render;if(attrName==="style"){this.style.update(change)}else if(isObject){Object.assign(this[attrName],change)}else{this[attrName]=change}if(attrName==="index")render.sortGraphsByIndex();render.drawAllGraph()};Graph.prototype.animation=function(){var _ref2=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(attrName,change){var wait,changeRoot,changeKeys,beforeState,animationFrame,animationCurve,animationDelay,animationFrameState,render,_args2=arguments;return _regenerator["default"].wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:wait=_args2.length>2&&_args2[2]!==undefined?_args2[2]:false;if(!(attrName!=="shape"&&attrName!=="style")){_context2.next=4;break}console.error("Only supported shape and style animation!");return _context2.abrupt("return");case 4:change=(0,_util.deepClone)(change,true);if(attrName==="style")this.style.colorProcessor(change);changeRoot=this[attrName];changeKeys=Object.keys(change);beforeState={};changeKeys.forEach(function(key){return beforeState[key]=changeRoot[key]});animationFrame=this.animationFrame,animationCurve=this.animationCurve,animationDelay=this.animationDelay;animationFrameState=(0,_transition["default"])(animationCurve,beforeState,change,animationFrame,true);this.animationRoot.push(changeRoot);this.animationKeys.push(changeKeys);this.animationFrameState.push(animationFrameState);if(!wait){_context2.next=17;break}return _context2.abrupt("return");case 17:if(!(animationDelay>0)){_context2.next=20;break}_context2.next=20;return delay(animationDelay);case 20:render=this.render;return _context2.abrupt("return",new Promise(function(){var _ref3=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(resolve){return _regenerator["default"].wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return render.launchAnimation();case 2:resolve();case 3:case"end":return _context.stop()}}},_callee)}));return function(_x3){return _ref3.apply(this,arguments)}}()));case 22:case"end":return _context2.stop()}}},_callee2,this)}));return function(_x,_x2){return _ref2.apply(this,arguments)}}();Graph.prototype.turnNextAnimationFrame=function(timeStamp){var animationDelay=this.animationDelay,animationRoot=this.animationRoot,animationKeys=this.animationKeys,animationFrameState=this.animationFrameState,animationPause=this.animationPause;if(animationPause)return;if(Date.now()-timeStamp1&&arguments[1]!==undefined?arguments[1]:false;var processor=reverse?_color.getColorFromRgbValue:_color.getRgbaValue;var colorProcessorKeys=["fill","stroke","shadowColor"];var allKeys=Object.keys(style);var colorKeys=allKeys.filter(function(key){return colorProcessorKeys.find(function(k){return k===key})});colorKeys.forEach(function(key){return style[key]=processor(style[key])});var gradientColor=style.gradientColor,colors=style.colors;if(gradientColor)style.gradientColor=gradientColor.map(function(c){return processor(c)});if(colors){var colorsKeys=Object.keys(colors);colorsKeys.forEach(function(key){return colors[key]=processor(colors[key])})}};Style.prototype.initStyle=function(ctx){initTransform(ctx,this);initGraphStyle(ctx,this);initGradient(ctx,this)};function initTransform(ctx,style){ctx.save();var graphCenter=style.graphCenter,rotate=style.rotate,scale=style.scale,translate=style.translate;if(!(graphCenter instanceof Array))return;ctx.translate.apply(ctx,(0,_toConsumableArray2["default"])(graphCenter));if(rotate)ctx.rotate(rotate*Math.PI/180);if(scale instanceof Array)ctx.scale.apply(ctx,(0,_toConsumableArray2["default"])(scale));if(translate)ctx.translate.apply(ctx,(0,_toConsumableArray2["default"])(translate));ctx.translate(-graphCenter[0],-graphCenter[1])}var autoSetStyleKeys=["lineCap","lineJoin","lineDashOffset","shadowOffsetX","shadowOffsetY","lineWidth","textAlign","textBaseline"];function initGraphStyle(ctx,style){var fill=style.fill,stroke=style.stroke,shadowColor=style.shadowColor,opacity=style.opacity;autoSetStyleKeys.forEach(function(key){if(key||typeof key==="number")ctx[key]=style[key]});fill=(0,_toConsumableArray2["default"])(fill);stroke=(0,_toConsumableArray2["default"])(stroke);shadowColor=(0,_toConsumableArray2["default"])(shadowColor);fill[3]*=opacity;stroke[3]*=opacity;shadowColor[3]*=opacity;ctx.fillStyle=(0,_color.getColorFromRgbValue)(fill);ctx.strokeStyle=(0,_color.getColorFromRgbValue)(stroke);ctx.shadowColor=(0,_color.getColorFromRgbValue)(shadowColor);var lineDash=style.lineDash,shadowBlur=style.shadowBlur;if(lineDash){lineDash=lineDash.map(function(v){return v>=0?v:0});ctx.setLineDash(lineDash)}if(typeof shadowBlur==="number")ctx.shadowBlur=shadowBlur>0?shadowBlur:.001;var fontStyle=style.fontStyle,fontVarient=style.fontVarient,fontWeight=style.fontWeight,fontSize=style.fontSize,fontFamily=style.fontFamily;ctx.font=fontStyle+" "+fontVarient+" "+fontWeight+" "+fontSize+"px"+" "+fontFamily}function initGradient(ctx,style){if(!gradientValidator(style))return;var gradientColor=style.gradientColor,gradientParams=style.gradientParams,gradientType=style.gradientType,gradientWith=style.gradientWith,gradientStops=style.gradientStops,opacity=style.opacity;gradientColor=gradientColor.map(function(color){var colorOpacity=color[3]*opacity;var clonedColor=(0,_toConsumableArray2["default"])(color);clonedColor[3]=colorOpacity;return clonedColor});gradientColor=gradientColor.map(function(c){return(0,_color.getColorFromRgbValue)(c)});if(gradientStops==="auto")gradientStops=getAutoColorStops(gradientColor);var gradient=ctx["create".concat(gradientType.slice(0,1).toUpperCase()+gradientType.slice(1),"Gradient")].apply(ctx,(0,_toConsumableArray2["default"])(gradientParams));gradientStops.forEach(function(stop,i){return gradient.addColorStop(stop,gradientColor[i])});ctx["".concat(gradientWith,"Style")]=gradient}function gradientValidator(style){var gradientColor=style.gradientColor,gradientParams=style.gradientParams,gradientType=style.gradientType,gradientWith=style.gradientWith,gradientStops=style.gradientStops;if(!gradientColor||!gradientParams)return false;if(gradientColor.length===1){console.warn("The gradient needs to provide at least two colors");return false}if(gradientType!=="linear"&&gradientType!=="radial"){console.warn("GradientType only supports linear or radial, current value is "+gradientType);return false}var gradientParamsLength=gradientParams.length;if(gradientType==="linear"&&gradientParamsLength!==4||gradientType==="radial"&&gradientParamsLength!==6){console.warn("The expected length of gradientParams is "+(gradientType==="linear"?"4":"6"));return false}if(gradientWith!=="fill"&&gradientWith!=="stroke"){console.warn("GradientWith only supports fill or stroke, current value is "+gradientWith);return false}if(gradientStops!=="auto"&&!(gradientStops instanceof Array)){console.warn("gradientStops only supports 'auto' or Number Array ([0, .5, 1]), current value is "+gradientStops);return false}return true}function getAutoColorStops(color){var stopGap=1/(color.length-1);return color.map(function(foo,i){return stopGap*i})}Style.prototype.restoreTransform=function(ctx){ctx.restore()};Style.prototype.update=function(change){this.colorProcessor(change);Object.assign(this,change)};Style.prototype.getStyle=function(){var clonedStyle=(0,_util.deepClone)(this,true);this.colorProcessor(clonedStyle,true);return clonedStyle}},{"../plugin/util":54,"@babel/runtime/helpers/classCallCheck":34,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/toConsumableArray":42,"@jiaminghi/color":56}],51:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.extendNewGraph=extendNewGraph;exports["default"]=exports.text=exports.bezierCurve=exports.smoothline=exports.polyline=exports.regPolygon=exports.sector=exports.arc=exports.ring=exports.rect=exports.ellipse=exports.circle=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _bezierCurve2=_interopRequireDefault(require("@jiaminghi/bezier-curve"));var _util=require("../plugin/util");var _canvas=require("../plugin/canvas");var polylineToBezierCurve=_bezierCurve2["default"].polylineToBezierCurve,bezierCurveToPolyline=_bezierCurve2["default"].bezierCurveToPolyline;var circle={shape:{rx:0,ry:0,r:0},validator:function validator(_ref){var shape=_ref.shape;var rx=shape.rx,ry=shape.ry,r=shape.r;if(typeof rx!=="number"||typeof ry!=="number"||typeof r!=="number"){console.error("Circle shape configuration is abnormal!");return false}return true},draw:function draw(_ref2,_ref3){var ctx=_ref2.ctx;var shape=_ref3.shape;ctx.beginPath();var rx=shape.rx,ry=shape.ry,r=shape.r;ctx.arc(rx,ry,r>0?r:.01,0,Math.PI*2);ctx.fill();ctx.stroke();ctx.closePath()},hoverCheck:function hoverCheck(position,_ref4){var shape=_ref4.shape;var rx=shape.rx,ry=shape.ry,r=shape.r;return(0,_util.checkPointIsInCircle)(position,rx,ry,r)},setGraphCenter:function setGraphCenter(e,_ref5){var shape=_ref5.shape,style=_ref5.style;var rx=shape.rx,ry=shape.ry;style.graphCenter=[rx,ry]},move:function move(_ref6,_ref7){var movementX=_ref6.movementX,movementY=_ref6.movementY;var shape=_ref7.shape;this.attr("shape",{rx:shape.rx+movementX,ry:shape.ry+movementY})}};exports.circle=circle;var ellipse={shape:{rx:0,ry:0,hr:0,vr:0},validator:function validator(_ref8){var shape=_ref8.shape;var rx=shape.rx,ry=shape.ry,hr=shape.hr,vr=shape.vr;if(typeof rx!=="number"||typeof ry!=="number"||typeof hr!=="number"||typeof vr!=="number"){console.error("Ellipse shape configuration is abnormal!");return false}return true},draw:function draw(_ref9,_ref10){var ctx=_ref9.ctx;var shape=_ref10.shape;ctx.beginPath();var rx=shape.rx,ry=shape.ry,hr=shape.hr,vr=shape.vr;ctx.ellipse(rx,ry,hr>0?hr:.01,vr>0?vr:.01,0,0,Math.PI*2);ctx.fill();ctx.stroke();ctx.closePath()},hoverCheck:function hoverCheck(position,_ref11){var shape=_ref11.shape;var rx=shape.rx,ry=shape.ry,hr=shape.hr,vr=shape.vr;var a=Math.max(hr,vr);var b=Math.min(hr,vr);var c=Math.sqrt(a*a-b*b);var leftFocusPoint=[rx-c,ry];var rightFocusPoint=[rx+c,ry];var distance=(0,_util.getTwoPointDistance)(position,leftFocusPoint)+(0,_util.getTwoPointDistance)(position,rightFocusPoint);return distance<=2*a},setGraphCenter:function setGraphCenter(e,_ref12){var shape=_ref12.shape,style=_ref12.style;var rx=shape.rx,ry=shape.ry;style.graphCenter=[rx,ry]},move:function move(_ref13,_ref14){var movementX=_ref13.movementX,movementY=_ref13.movementY;var shape=_ref14.shape;this.attr("shape",{rx:shape.rx+movementX,ry:shape.ry+movementY})}};exports.ellipse=ellipse;var rect={shape:{x:0,y:0,w:0,h:0},validator:function validator(_ref15){var shape=_ref15.shape;var x=shape.x,y=shape.y,w=shape.w,h=shape.h;if(typeof x!=="number"||typeof y!=="number"||typeof w!=="number"||typeof h!=="number"){console.error("Rect shape configuration is abnormal!");return false}return true},draw:function draw(_ref16,_ref17){var ctx=_ref16.ctx;var shape=_ref17.shape;ctx.beginPath();var x=shape.x,y=shape.y,w=shape.w,h=shape.h;ctx.rect(x,y,w,h);ctx.fill();ctx.stroke();ctx.closePath()},hoverCheck:function hoverCheck(position,_ref18){var shape=_ref18.shape;var x=shape.x,y=shape.y,w=shape.w,h=shape.h;return(0,_util.checkPointIsInRect)(position,x,y,w,h)},setGraphCenter:function setGraphCenter(e,_ref19){var shape=_ref19.shape,style=_ref19.style;var x=shape.x,y=shape.y,w=shape.w,h=shape.h;style.graphCenter=[x+w/2,y+h/2]},move:function move(_ref20,_ref21){var movementX=_ref20.movementX,movementY=_ref20.movementY;var shape=_ref21.shape;this.attr("shape",{x:shape.x+movementX,y:shape.y+movementY})}};exports.rect=rect;var ring={shape:{rx:0,ry:0,r:0},validator:function validator(_ref22){var shape=_ref22.shape;var rx=shape.rx,ry=shape.ry,r=shape.r;if(typeof rx!=="number"||typeof ry!=="number"||typeof r!=="number"){console.error("Ring shape configuration is abnormal!");return false}return true},draw:function draw(_ref23,_ref24){var ctx=_ref23.ctx;var shape=_ref24.shape;ctx.beginPath();var rx=shape.rx,ry=shape.ry,r=shape.r;ctx.arc(rx,ry,r>0?r:.01,0,Math.PI*2);ctx.stroke();ctx.closePath()},hoverCheck:function hoverCheck(position,_ref25){var shape=_ref25.shape,style=_ref25.style;var rx=shape.rx,ry=shape.ry,r=shape.r;var lineWidth=style.lineWidth;var halfLineWidth=lineWidth/2;var minDistance=r-halfLineWidth;var maxDistance=r+halfLineWidth;var distance=(0,_util.getTwoPointDistance)(position,[rx,ry]);return distance>=minDistance&&distance<=maxDistance},setGraphCenter:function setGraphCenter(e,_ref26){var shape=_ref26.shape,style=_ref26.style;var rx=shape.rx,ry=shape.ry;style.graphCenter=[rx,ry]},move:function move(_ref27,_ref28){var movementX=_ref27.movementX,movementY=_ref27.movementY;var shape=_ref28.shape;this.attr("shape",{rx:shape.rx+movementX,ry:shape.ry+movementY})}};exports.ring=ring;var arc={shape:{rx:0,ry:0,r:0,startAngle:0,endAngle:0,clockWise:true},validator:function validator(_ref29){var shape=_ref29.shape;var keys=["rx","ry","r","startAngle","endAngle"];if(keys.find(function(key){return typeof shape[key]!=="number"})){console.error("Arc shape configuration is abnormal!");return false}return true},draw:function draw(_ref30,_ref31){var ctx=_ref30.ctx;var shape=_ref31.shape;ctx.beginPath();var rx=shape.rx,ry=shape.ry,r=shape.r,startAngle=shape.startAngle,endAngle=shape.endAngle,clockWise=shape.clockWise;ctx.arc(rx,ry,r>0?r:.001,startAngle,endAngle,!clockWise);ctx.stroke();ctx.closePath()},hoverCheck:function hoverCheck(position,_ref32){var shape=_ref32.shape,style=_ref32.style;var rx=shape.rx,ry=shape.ry,r=shape.r,startAngle=shape.startAngle,endAngle=shape.endAngle,clockWise=shape.clockWise;var lineWidth=style.lineWidth;var halfLineWidth=lineWidth/2;var insideRadius=r-halfLineWidth;var outsideRadius=r+halfLineWidth;return!(0,_util.checkPointIsInSector)(position,rx,ry,insideRadius,startAngle,endAngle,clockWise)&&(0,_util.checkPointIsInSector)(position,rx,ry,outsideRadius,startAngle,endAngle,clockWise)},setGraphCenter:function setGraphCenter(e,_ref33){var shape=_ref33.shape,style=_ref33.style;var rx=shape.rx,ry=shape.ry;style.graphCenter=[rx,ry]},move:function move(_ref34,_ref35){var movementX=_ref34.movementX,movementY=_ref34.movementY;var shape=_ref35.shape;this.attr("shape",{rx:shape.rx+movementX,ry:shape.ry+movementY})}};exports.arc=arc;var sector={shape:{rx:0,ry:0,r:0,startAngle:0,endAngle:0,clockWise:true},validator:function validator(_ref36){var shape=_ref36.shape;var keys=["rx","ry","r","startAngle","endAngle"];if(keys.find(function(key){return typeof shape[key]!=="number"})){console.error("Sector shape configuration is abnormal!");return false}return true},draw:function draw(_ref37,_ref38){var ctx=_ref37.ctx;var shape=_ref38.shape;ctx.beginPath();var rx=shape.rx,ry=shape.ry,r=shape.r,startAngle=shape.startAngle,endAngle=shape.endAngle,clockWise=shape.clockWise;ctx.arc(rx,ry,r>0?r:.01,startAngle,endAngle,!clockWise);ctx.lineTo(rx,ry);ctx.closePath();ctx.stroke();ctx.fill()},hoverCheck:function hoverCheck(position,_ref39){var shape=_ref39.shape;var rx=shape.rx,ry=shape.ry,r=shape.r,startAngle=shape.startAngle,endAngle=shape.endAngle,clockWise=shape.clockWise;return(0,_util.checkPointIsInSector)(position,rx,ry,r,startAngle,endAngle,clockWise)},setGraphCenter:function setGraphCenter(e,_ref40){var shape=_ref40.shape,style=_ref40.style;var rx=shape.rx,ry=shape.ry;style.graphCenter=[rx,ry]},move:function move(_ref41,_ref42){var movementX=_ref41.movementX,movementY=_ref41.movementY;var shape=_ref42.shape;var rx=shape.rx,ry=shape.ry;this.attr("shape",{rx:rx+movementX,ry:ry+movementY})}};exports.sector=sector;var regPolygon={shape:{rx:0,ry:0,r:0,side:0},validator:function validator(_ref43){var shape=_ref43.shape;var side=shape.side;var keys=["rx","ry","r","side"];if(keys.find(function(key){return typeof shape[key]!=="number"})){console.error("RegPolygon shape configuration is abnormal!");return false}if(side<3){console.error("RegPolygon at least trigon!");return false}return true},draw:function draw(_ref44,_ref45){var ctx=_ref44.ctx;var shape=_ref45.shape,cache=_ref45.cache;ctx.beginPath();var rx=shape.rx,ry=shape.ry,r=shape.r,side=shape.side;if(!cache.points||cache.rx!==rx||cache.ry!==ry||cache.r!==r||cache.side!==side){var _points=(0,_util.getRegularPolygonPoints)(rx,ry,r,side);Object.assign(cache,{points:_points,rx:rx,ry:ry,r:r,side:side})}var points=cache.points;(0,_canvas.drawPolylinePath)(ctx,points);ctx.closePath();ctx.stroke();ctx.fill()},hoverCheck:function hoverCheck(position,_ref46){var cache=_ref46.cache;var points=cache.points;return(0,_util.checkPointIsInPolygon)(position,points)},setGraphCenter:function setGraphCenter(e,_ref47){var shape=_ref47.shape,style=_ref47.style;var rx=shape.rx,ry=shape.ry;style.graphCenter=[rx,ry]},move:function move(_ref48,_ref49){var movementX=_ref48.movementX,movementY=_ref48.movementY;var shape=_ref49.shape,cache=_ref49.cache;var rx=shape.rx,ry=shape.ry;cache.rx+=movementX;cache.ry+=movementY;this.attr("shape",{rx:rx+movementX,ry:ry+movementY});cache.points=cache.points.map(function(_ref50){var _ref51=(0,_slicedToArray2["default"])(_ref50,2),x=_ref51[0],y=_ref51[1];return[x+movementX,y+movementY]})}};exports.regPolygon=regPolygon;var polyline={shape:{points:[],close:false},validator:function validator(_ref52){var shape=_ref52.shape;var points=shape.points;if(!(points instanceof Array)){console.error("Polyline points should be an array!");return false}return true},draw:function draw(_ref53,_ref54){var ctx=_ref53.ctx;var shape=_ref54.shape,lineWidth=_ref54.style.lineWidth;ctx.beginPath();var points=shape.points,close=shape.close;if(lineWidth===1)points=(0,_util.eliminateBlur)(points);(0,_canvas.drawPolylinePath)(ctx,points);if(close){ctx.closePath();ctx.fill();ctx.stroke()}else{ctx.stroke()}},hoverCheck:function hoverCheck(position,_ref55){var shape=_ref55.shape,style=_ref55.style;var points=shape.points,close=shape.close;var lineWidth=style.lineWidth;if(close){return(0,_util.checkPointIsInPolygon)(position,points)}else{return(0,_util.checkPointIsNearPolyline)(position,points,lineWidth)}},setGraphCenter:function setGraphCenter(e,_ref56){var shape=_ref56.shape,style=_ref56.style;var points=shape.points;style.graphCenter=points[0]},move:function move(_ref57,_ref58){var movementX=_ref57.movementX,movementY=_ref57.movementY;var shape=_ref58.shape;var points=shape.points;var moveAfterPoints=points.map(function(_ref59){var _ref60=(0,_slicedToArray2["default"])(_ref59,2),x=_ref60[0],y=_ref60[1];return[x+movementX,y+movementY]});this.attr("shape",{points:moveAfterPoints})}};exports.polyline=polyline;var smoothline={shape:{points:[],close:false},validator:function validator(_ref61){var shape=_ref61.shape;var points=shape.points;if(!(points instanceof Array)){console.error("Smoothline points should be an array!");return false}return true},draw:function draw(_ref62,_ref63){var ctx=_ref62.ctx;var shape=_ref63.shape,cache=_ref63.cache;var points=shape.points,close=shape.close;if(!cache.points||cache.points.toString()!==points.toString()){var _bezierCurve=polylineToBezierCurve(points,close);var hoverPoints=bezierCurveToPolyline(_bezierCurve);Object.assign(cache,{points:(0,_util.deepClone)(points,true),bezierCurve:_bezierCurve,hoverPoints:hoverPoints})}var bezierCurve=cache.bezierCurve;ctx.beginPath();(0,_canvas.drawBezierCurvePath)(ctx,bezierCurve.slice(1),bezierCurve[0]);if(close){ctx.closePath();ctx.fill();ctx.stroke()}else{ctx.stroke()}},hoverCheck:function hoverCheck(position,_ref64){var cache=_ref64.cache,shape=_ref64.shape,style=_ref64.style;var hoverPoints=cache.hoverPoints;var close=shape.close;var lineWidth=style.lineWidth;if(close){return(0,_util.checkPointIsInPolygon)(position,hoverPoints)}else{return(0,_util.checkPointIsNearPolyline)(position,hoverPoints,lineWidth)}},setGraphCenter:function setGraphCenter(e,_ref65){var shape=_ref65.shape,style=_ref65.style;var points=shape.points;style.graphCenter=points[0]},move:function move(_ref66,_ref67){var movementX=_ref66.movementX,movementY=_ref66.movementY;var shape=_ref67.shape,cache=_ref67.cache;var points=shape.points;var moveAfterPoints=points.map(function(_ref68){var _ref69=(0,_slicedToArray2["default"])(_ref68,2),x=_ref69[0],y=_ref69[1];return[x+movementX,y+movementY]});cache.points=moveAfterPoints;var _cache$bezierCurve$=(0,_slicedToArray2["default"])(cache.bezierCurve[0],2),fx=_cache$bezierCurve$[0],fy=_cache$bezierCurve$[1];var curves=cache.bezierCurve.slice(1);cache.bezierCurve=[[fx+movementX,fy+movementY]].concat((0,_toConsumableArray2["default"])(curves.map(function(curve){return curve.map(function(_ref70){var _ref71=(0,_slicedToArray2["default"])(_ref70,2),x=_ref71[0],y=_ref71[1];return[x+movementX,y+movementY]})})));cache.hoverPoints=cache.hoverPoints.map(function(_ref72){var _ref73=(0,_slicedToArray2["default"])(_ref72,2),x=_ref73[0],y=_ref73[1];return[x+movementX,y+movementY]});this.attr("shape",{points:moveAfterPoints})}};exports.smoothline=smoothline;var bezierCurve={shape:{points:[],close:false},validator:function validator(_ref74){var shape=_ref74.shape;var points=shape.points;if(!(points instanceof Array)){console.error("BezierCurve points should be an array!");return false}return true},draw:function draw(_ref75,_ref76){var ctx=_ref75.ctx;var shape=_ref76.shape,cache=_ref76.cache;var points=shape.points,close=shape.close;if(!cache.points||cache.points.toString()!==points.toString()){var hoverPoints=bezierCurveToPolyline(points,20);Object.assign(cache,{points:(0,_util.deepClone)(points,true),hoverPoints:hoverPoints})}ctx.beginPath();(0,_canvas.drawBezierCurvePath)(ctx,points.slice(1),points[0]);if(close){ctx.closePath();ctx.fill();ctx.stroke()}else{ctx.stroke()}},hoverCheck:function hoverCheck(position,_ref77){var cache=_ref77.cache,shape=_ref77.shape,style=_ref77.style;var hoverPoints=cache.hoverPoints;var close=shape.close;var lineWidth=style.lineWidth;if(close){return(0,_util.checkPointIsInPolygon)(position,hoverPoints)}else{return(0,_util.checkPointIsNearPolyline)(position,hoverPoints,lineWidth)}},setGraphCenter:function setGraphCenter(e,_ref78){var shape=_ref78.shape,style=_ref78.style;var points=shape.points;style.graphCenter=points[0]},move:function move(_ref79,_ref80){var movementX=_ref79.movementX,movementY=_ref79.movementY;var shape=_ref80.shape,cache=_ref80.cache;var points=shape.points;var _points$=(0,_slicedToArray2["default"])(points[0],2),fx=_points$[0],fy=_points$[1];var curves=points.slice(1);var bezierCurve=[[fx+movementX,fy+movementY]].concat((0,_toConsumableArray2["default"])(curves.map(function(curve){return curve.map(function(_ref81){var _ref82=(0,_slicedToArray2["default"])(_ref81,2),x=_ref82[0],y=_ref82[1];return[x+movementX,y+movementY]})})));cache.points=bezierCurve;cache.hoverPoints=cache.hoverPoints.map(function(_ref83){var _ref84=(0,_slicedToArray2["default"])(_ref83,2),x=_ref84[0],y=_ref84[1];return[x+movementX,y+movementY]});this.attr("shape",{points:bezierCurve})}};exports.bezierCurve=bezierCurve;var text={shape:{content:"",position:[],maxWidth:undefined,rowGap:0},validator:function validator(_ref85){var shape=_ref85.shape;var content=shape.content,position=shape.position,rowGap=shape.rowGap;if(typeof content!=="string"){console.error("Text content should be a string!");return false}if(!(position instanceof Array)){console.error("Text position should be an array!");return false}if(typeof rowGap!=="number"){console.error("Text rowGap should be a number!");return false}return true},draw:function draw(_ref86,_ref87){var ctx=_ref86.ctx;var shape=_ref87.shape;var content=shape.content,position=shape.position,maxWidth=shape.maxWidth,rowGap=shape.rowGap;var textBaseline=ctx.textBaseline,font=ctx.font;var fontSize=parseInt(font.replace(/\D/g,""));var _position=position,_position2=(0,_slicedToArray2["default"])(_position,2),x=_position2[0],y=_position2[1];content=content.split("\n");var rowNum=content.length;var lineHeight=fontSize+rowGap;var allHeight=rowNum*lineHeight-rowGap;var offset=0;if(textBaseline==="middle"){offset=allHeight/2;y+=fontSize/2}if(textBaseline==="bottom"){offset=allHeight;y+=fontSize}position=new Array(rowNum).fill(0).map(function(foo,i){return[x,y+i*lineHeight-offset]});ctx.beginPath();content.forEach(function(text,i){ctx.fillText.apply(ctx,[text].concat((0,_toConsumableArray2["default"])(position[i]),[maxWidth]));ctx.strokeText.apply(ctx,[text].concat((0,_toConsumableArray2["default"])(position[i]),[maxWidth]))});ctx.closePath()},hoverCheck:function hoverCheck(position,_ref88){var shape=_ref88.shape,style=_ref88.style;return false},setGraphCenter:function setGraphCenter(e,_ref89){var shape=_ref89.shape,style=_ref89.style;var position=shape.position;style.graphCenter=(0,_toConsumableArray2["default"])(position)},move:function move(_ref90,_ref91){var movementX=_ref90.movementX,movementY=_ref90.movementY;var shape=_ref91.shape;var _shape$position=(0,_slicedToArray2["default"])(shape.position,2),x=_shape$position[0],y=_shape$position[1];this.attr("shape",{position:[x+movementX,y+movementY]})}};exports.text=text;var graphs=new Map([["circle",circle],["ellipse",ellipse],["rect",rect],["ring",ring],["arc",arc],["sector",sector],["regPolygon",regPolygon],["polyline",polyline],["smoothline",smoothline],["bezierCurve",bezierCurve],["text",text]]);var _default=graphs;exports["default"]=_default;function extendNewGraph(name,config){if(!name||!config){console.error("ExtendNewGraph Missing Parameters!");return}if(!config.shape){console.error("Required attribute of shape to extendNewGraph!");return}if(!config.validator){console.error("Required function of validator to extendNewGraph!");return}if(!config.draw){console.error("Required function of draw to extendNewGraph!");return}graphs.set(name,config)}},{"../plugin/canvas":53,"../plugin/util":54,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42,"@jiaminghi/bezier-curve":47}],52:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"CRender",{enumerable:true,get:function get(){return _crender["default"]}});Object.defineProperty(exports,"extendNewGraph",{enumerable:true,get:function get(){return _graphs.extendNewGraph}});exports["default"]=void 0;var _crender=_interopRequireDefault(require("./class/crender.class"));var _graphs=require("./config/graphs");var _default=_crender["default"];exports["default"]=_default},{"./class/crender.class":48,"./config/graphs":51,"@babel/runtime/helpers/interopRequireDefault":36}],53:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.drawPolylinePath=drawPolylinePath;exports.drawBezierCurvePath=drawBezierCurvePath;exports["default"]=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));function drawPolylinePath(ctx,points){var beginPath=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var closePath=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!ctx||points.length<2)return false;if(beginPath)ctx.beginPath();points.forEach(function(point,i){return point&&(i===0?ctx.moveTo.apply(ctx,(0,_toConsumableArray2["default"])(point)):ctx.lineTo.apply(ctx,(0,_toConsumableArray2["default"])(point)))});if(closePath)ctx.closePath()}function drawBezierCurvePath(ctx,points){var moveTo=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var beginPath=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var closePath=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;if(!ctx||!points)return false;if(beginPath)ctx.beginPath();if(moveTo)ctx.moveTo.apply(ctx,(0,_toConsumableArray2["default"])(moveTo));points.forEach(function(item){return item&&ctx.bezierCurveTo.apply(ctx,(0,_toConsumableArray2["default"])(item[0]).concat((0,_toConsumableArray2["default"])(item[1]),(0,_toConsumableArray2["default"])(item[2])))});if(closePath)ctx.closePath()}var _default={drawPolylinePath:drawPolylinePath,drawBezierCurvePath:drawBezierCurvePath};exports["default"]=_default},{"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/toConsumableArray":42}],54:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.deepClone=deepClone;exports.eliminateBlur=eliminateBlur;exports.checkPointIsInCircle=checkPointIsInCircle;exports.getTwoPointDistance=getTwoPointDistance;exports.checkPointIsInPolygon=checkPointIsInPolygon;exports.checkPointIsInSector=checkPointIsInSector;exports.checkPointIsNearPolyline=checkPointIsNearPolyline;exports.checkPointIsInRect=checkPointIsInRect;exports.getRotatePointPos=getRotatePointPos;exports.getScalePointPos=getScalePointPos;exports.getTranslatePointPos=getTranslatePointPos;exports.getDistanceBetweenPointAndLine=getDistanceBetweenPointAndLine;exports.getCircleRadianPoint=getCircleRadianPoint;exports.getRegularPolygonPoints=getRegularPolygonPoints;exports["default"]=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var abs=Math.abs,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,max=Math.max,min=Math.min,PI=Math.PI;function deepClone(object){var recursion=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!object)return object;var parse=JSON.parse,stringify=JSON.stringify;if(!recursion)return parse(stringify(object));var clonedObj=object instanceof Array?[]:{};if(object&&(0,_typeof2["default"])(object)==="object"){for(var key in object){if(object.hasOwnProperty(key)){if(object[key]&&(0,_typeof2["default"])(object[key])==="object"){clonedObj[key]=deepClone(object[key],true)}else{clonedObj[key]=object[key]}}}}return clonedObj}function eliminateBlur(points){return points.map(function(_ref){var _ref2=(0,_slicedToArray2["default"])(_ref,2),x=_ref2[0],y=_ref2[1];return[parseInt(x)+.5,parseInt(y)+.5]})}function checkPointIsInCircle(point,rx,ry,r){return getTwoPointDistance(point,[rx,ry])<=r}function getTwoPointDistance(_ref3,_ref4){var _ref5=(0,_slicedToArray2["default"])(_ref3,2),xa=_ref5[0],ya=_ref5[1];var _ref6=(0,_slicedToArray2["default"])(_ref4,2),xb=_ref6[0],yb=_ref6[1];var minusX=abs(xa-xb);var minusY=abs(ya-yb);return sqrt(minusX*minusX+minusY*minusY)}function checkPointIsInPolygon(point,polygon){var counter=0;var _point=(0,_slicedToArray2["default"])(point,2),x=_point[0],y=_point[1];var pointNum=polygon.length;for(var i=1,p1=polygon[0];i<=pointNum;i++){var p2=polygon[i%pointNum];if(x>min(p1[0],p2[0])&&x<=max(p1[0],p2[0])){if(y<=max(p1[1],p2[1])){if(p1[0]!==p2[0]){var xinters=(x-p1[0])*(p2[1]-p1[1])/(p2[0]-p1[0])+p1[1];if(p1[1]===p2[1]||y<=xinters){counter++}}}}p1=p2}return counter%2===1}function checkPointIsInSector(point,rx,ry,r,startAngle,endAngle,clockWise){if(!point)return false;if(getTwoPointDistance(point,[rx,ry])>r)return false;if(!clockWise){var _deepClone=deepClone([endAngle,startAngle]);var _deepClone2=(0,_slicedToArray2["default"])(_deepClone,2);startAngle=_deepClone2[0];endAngle=_deepClone2[1]}var reverseBE=startAngle>endAngle;if(reverseBE){var _ref7=[endAngle,startAngle];startAngle=_ref7[0];endAngle=_ref7[1]}var minus=endAngle-startAngle;if(minus>=PI*2)return true;var _point2=(0,_slicedToArray2["default"])(point,2),x=_point2[0],y=_point2[1];var _getCircleRadianPoint=getCircleRadianPoint(rx,ry,r,startAngle),_getCircleRadianPoint2=(0,_slicedToArray2["default"])(_getCircleRadianPoint,2),bx=_getCircleRadianPoint2[0],by=_getCircleRadianPoint2[1];var _getCircleRadianPoint3=getCircleRadianPoint(rx,ry,r,endAngle),_getCircleRadianPoint4=(0,_slicedToArray2["default"])(_getCircleRadianPoint3,2),ex=_getCircleRadianPoint4[0],ey=_getCircleRadianPoint4[1];var vPoint=[x-rx,y-ry];var vBArm=[bx-rx,by-ry];var vEArm=[ex-rx,ey-ry];var reverse=minus>PI;if(reverse){var _deepClone3=deepClone([vEArm,vBArm]);var _deepClone4=(0,_slicedToArray2["default"])(_deepClone3,2);vBArm=_deepClone4[0];vEArm=_deepClone4[1]}var inSector=isClockWise(vBArm,vPoint)&&!isClockWise(vEArm,vPoint);if(reverse)inSector=!inSector;if(reverseBE)inSector=!inSector;return inSector}function isClockWise(vArm,vPoint){var _vArm=(0,_slicedToArray2["default"])(vArm,2),ax=_vArm[0],ay=_vArm[1];var _vPoint=(0,_slicedToArray2["default"])(vPoint,2),px=_vPoint[0],py=_vPoint[1];return-ay*px+ax*py>0}function checkPointIsNearPolyline(point,polyline,lineWidth){var halfLineWidth=lineWidth/2;var moveUpPolyline=polyline.map(function(_ref8){var _ref9=(0,_slicedToArray2["default"])(_ref8,2),x=_ref9[0],y=_ref9[1];return[x,y-halfLineWidth]});var moveDownPolyline=polyline.map(function(_ref10){var _ref11=(0,_slicedToArray2["default"])(_ref10,2),x=_ref11[0],y=_ref11[1];return[x,y+halfLineWidth]});var polygon=[].concat((0,_toConsumableArray2["default"])(moveUpPolyline),(0,_toConsumableArray2["default"])(moveDownPolyline.reverse()));return checkPointIsInPolygon(point,polygon)}function checkPointIsInRect(_ref12,x,y,width,height){var _ref13=(0,_slicedToArray2["default"])(_ref12,2),px=_ref13[0],py=_ref13[1];if(pxx+width)return false;if(py>y+height)return false;return true}function getRotatePointPos(){var rotate=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var point=arguments.length>1?arguments[1]:undefined;var origin=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0];if(!point)return false;if(rotate%360===0)return point;var _point3=(0,_slicedToArray2["default"])(point,2),x=_point3[0],y=_point3[1];var _origin=(0,_slicedToArray2["default"])(origin,2),ox=_origin[0],oy=_origin[1];rotate*=PI/180;return[(x-ox)*cos(rotate)-(y-oy)*sin(rotate)+ox,(x-ox)*sin(rotate)+(y-oy)*cos(rotate)+oy]}function getScalePointPos(){var scale=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[1,1];var point=arguments.length>1?arguments[1]:undefined;var origin=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,0];if(!point)return false;if(scale===1)return point;var _point4=(0,_slicedToArray2["default"])(point,2),x=_point4[0],y=_point4[1];var _origin2=(0,_slicedToArray2["default"])(origin,2),ox=_origin2[0],oy=_origin2[1];var _scale=(0,_slicedToArray2["default"])(scale,2),xs=_scale[0],ys=_scale[1];var relativePosX=x-ox;var relativePosY=y-oy;return[relativePosX*xs+ox,relativePosY*ys+oy]}function getTranslatePointPos(translate,point){if(!translate||!point)return false;var _point5=(0,_slicedToArray2["default"])(point,2),x=_point5[0],y=_point5[1];var _translate=(0,_slicedToArray2["default"])(translate,2),tx=_translate[0],ty=_translate[1];return[x+tx,y+ty]}function getDistanceBetweenPointAndLine(point,lineBegin,lineEnd){if(!point||!lineBegin||!lineEnd)return false;var _point6=(0,_slicedToArray2["default"])(point,2),x=_point6[0],y=_point6[1];var _lineBegin=(0,_slicedToArray2["default"])(lineBegin,2),x1=_lineBegin[0],y1=_lineBegin[1];var _lineEnd=(0,_slicedToArray2["default"])(lineEnd,2),x2=_lineEnd[0],y2=_lineEnd[1];var a=y2-y1;var b=x1-x2;var c=y1*(x2-x1)-x1*(y2-y1);var molecule=abs(a*x+b*y+c);var denominator=sqrt(a*a+b*b);return molecule/denominator}function getCircleRadianPoint(x,y,radius,radian){return[x+cos(radian)*radius,y+sin(radian)*radius]}function getRegularPolygonPoints(rx,ry,r,side){var minus=arguments.length>4&&arguments[4]!==undefined?arguments[4]:PI*-.5;var radianGap=PI*2/side;var radians=new Array(side).fill("").map(function(t,i){return i*radianGap+minus});return radians.map(function(radian){return getCircleRadianPoint(rx,ry,r,radian)})}var _default={deepClone:deepClone,eliminateBlur:eliminateBlur,checkPointIsInCircle:checkPointIsInCircle,checkPointIsInPolygon:checkPointIsInPolygon,checkPointIsInSector:checkPointIsInSector,checkPointIsNearPolyline:checkPointIsNearPolyline,getTwoPointDistance:getTwoPointDistance,getRotatePointPos:getRotatePointPos,getScalePointPos:getScalePointPos,getTranslatePointPos:getTranslatePointPos,getCircleRadianPoint:getCircleRadianPoint,getRegularPolygonPoints:getRegularPolygonPoints,getDistanceBetweenPointAndLine:getDistanceBetweenPointAndLine};exports["default"]=_default},{"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/slicedToArray":41,"@babel/runtime/helpers/toConsumableArray":42,"@babel/runtime/helpers/typeof":43}],55:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _default=new Map([["transparent","rgba(0,0,0,0)"],["black","#000000"],["silver","#C0C0C0"],["gray","#808080"],["white","#FFFFFF"],["maroon","#800000"],["red","#FF0000"],["purple","#800080"],["fuchsia","#FF00FF"],["green","#008000"],["lime","#00FF00"],["olive","#808000"],["yellow","#FFFF00"],["navy","#000080"],["blue","#0000FF"],["teal","#008080"],["aqua","#00FFFF"],["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["blanchedalmond","#ffebcd"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["oldlace","#fdf5e6"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["whitesmoke","#f5f5f5"],["yellowgreen","#9acd32"]]);exports["default"]=_default},{}],56:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getRgbValue=getRgbValue;exports.getRgbaValue=getRgbaValue;exports.getOpacity=getOpacity;exports.toRgb=toRgb;exports.toHex=toHex;exports.getColorFromRgbValue=getColorFromRgbValue;exports.darken=darken;exports.lighten=lighten;exports.fade=fade;exports["default"]=void 0;var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _keywords=_interopRequireDefault(require("./config/keywords"));var hexReg=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;var rgbReg=/^(rgb|rgba|RGB|RGBA)/;var rgbaReg=/^(rgba|RGBA)/;function validator(color){var isHex=hexReg.test(color);var isRgb=rgbReg.test(color);if(isHex||isRgb)return color;color=getColorByKeyword(color);if(!color){console.error("Color: Invalid color!");return false}return color}function getColorByKeyword(keyword){if(!keyword){console.error("getColorByKeywords: Missing parameters!");return false}if(!_keywords["default"].has(keyword))return false;return _keywords["default"].get(keyword)}function getRgbValue(color){if(!color){console.error("getRgbValue: Missing parameters!");return false}color=validator(color);if(!color)return false;var isHex=hexReg.test(color);var isRgb=rgbReg.test(color);var lowerColor=color.toLowerCase();if(isHex)return getRgbValueFromHex(lowerColor);if(isRgb)return getRgbValueFromRgb(lowerColor)}function getRgbValueFromHex(color){color=color.replace("#","");if(color.length===3)color=Array.from(color).map(function(hexNum){return hexNum+hexNum}).join("");color=color.split("");return new Array(3).fill(0).map(function(t,i){return parseInt("0x".concat(color[i*2]).concat(color[i*2+1]))})}function getRgbValueFromRgb(color){return color.replace(/rgb\(|rgba\(|\)/g,"").split(",").slice(0,3).map(function(n){return parseInt(n)})}function getRgbaValue(color){if(!color){console.error("getRgbaValue: Missing parameters!");return false}var colorValue=getRgbValue(color);if(!colorValue)return false;colorValue.push(getOpacity(color));return colorValue}function getOpacity(color){if(!color){console.error("getOpacity: Missing parameters!");return false}color=validator(color);if(!color)return false;var isRgba=rgbaReg.test(color);if(!isRgba)return 1;color=color.toLowerCase();return Number(color.split(",").slice(-1)[0].replace(/[)|\s]/g,""))}function toRgb(color,opacity){if(!color){console.error("toRgb: Missing parameters!");return false}var rgbValue=getRgbValue(color);if(!rgbValue)return false;var addOpacity=typeof opacity==="number";if(addOpacity)return"rgba("+rgbValue.join(",")+",".concat(opacity,")");return"rgb("+rgbValue.join(",")+")"}function toHex(color){if(!color){console.error("toHex: Missing parameters!");return false}if(hexReg.test(color))return color;color=getRgbValue(color);if(!color)return false;return"#"+color.map(function(n){return Number(n).toString(16)}).map(function(n){return n==="0"?"00":n}).join("")}function getColorFromRgbValue(value){if(!value){console.error("getColorFromRgbValue: Missing parameters!");return false}var valueLength=value.length;if(valueLength!==3&&valueLength!==4){console.error("getColorFromRgbValue: Value is illegal!");return false}var color=valueLength===3?"rgb(":"rgba(";color+=value.join(",")+")";return color}function darken(color){var percent=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(!color){console.error("darken: Missing parameters!");return false}var rgbaValue=getRgbaValue(color);if(!rgbaValue)return false;rgbaValue=rgbaValue.map(function(v,i){return i===3?v:v-Math.ceil(2.55*percent)}).map(function(v){return v<0?0:v});return getColorFromRgbValue(rgbaValue)}function lighten(color){var percent=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(!color){console.error("lighten: Missing parameters!");return false}var rgbaValue=getRgbaValue(color);if(!rgbaValue)return false;rgbaValue=rgbaValue.map(function(v,i){return i===3?v:v+Math.ceil(2.55*percent)}).map(function(v){return v>255?255:v});return getColorFromRgbValue(rgbaValue)}function fade(color){var percent=arguments.length>1&&arguments[1]!==undefined?arguments[1]:100;if(!color){console.error("fade: Missing parameters!");return false}var rgbValue=getRgbValue(color);if(!rgbValue)return false;var rgbaValue=[].concat((0,_toConsumableArray2["default"])(rgbValue),[percent/100]);return getColorFromRgbValue(rgbaValue)}var _default={fade:fade,toHex:toHex,toRgb:toRgb,darken:darken,lighten:lighten,getOpacity:getOpacity,getRgbValue:getRgbValue,getRgbaValue:getRgbaValue,getColorFromRgbValue:getColorFromRgbValue};exports["default"]=_default},{"./config/keywords":55,"@babel/runtime/helpers/interopRequireDefault":36,"@babel/runtime/helpers/toConsumableArray":42}],57:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=exports.easeInOutBounce=exports.easeOutBounce=exports.easeInBounce=exports.easeInOutElastic=exports.easeOutElastic=exports.easeInElastic=exports.easeInOutBack=exports.easeOutBack=exports.easeInBack=exports.easeInOutQuint=exports.easeOutQuint=exports.easeInQuint=exports.easeInOutQuart=exports.easeOutQuart=exports.easeInQuart=exports.easeInOutCubic=exports.easeOutCubic=exports.easeInCubic=exports.easeInOutQuad=exports.easeOutQuad=exports.easeInQuad=exports.easeInOutSine=exports.easeOutSine=exports.easeInSine=exports.linear=void 0;var linear=[[[0,1],"",[.33,.67]],[[1,0],[.67,.33]]];exports.linear=linear;var easeInSine=[[[0,1]],[[.538,.564],[.169,.912],[.88,.196]],[[1,0]]];exports.easeInSine=easeInSine;var easeOutSine=[[[0,1]],[[.444,.448],[.169,.736],[.718,.16]],[[1,0]]];exports.easeOutSine=easeOutSine;var easeInOutSine=[[[0,1]],[[.5,.5],[.2,1],[.8,0]],[[1,0]]];exports.easeInOutSine=easeInOutSine;var easeInQuad=[[[0,1]],[[.55,.584],[.231,.904],[.868,.264]],[[1,0]]];exports.easeInQuad=easeInQuad;var easeOutQuad=[[[0,1]],[[.413,.428],[.065,.816],[.76,.04]],[[1,0]]];exports.easeOutQuad=easeOutQuad;var easeInOutQuad=[[[0,1]],[[.5,.5],[.3,.9],[.7,.1]],[[1,0]]];exports.easeInOutQuad=easeInOutQuad;var easeInCubic=[[[0,1]],[[.679,.688],[.366,.992],[.992,.384]],[[1,0]]];exports.easeInCubic=easeInCubic;var easeOutCubic=[[[0,1]],[[.321,.312],[.008,.616],[.634,.008]],[[1,0]]];exports.easeOutCubic=easeOutCubic;var easeInOutCubic=[[[0,1]],[[.5,.5],[.3,1],[.7,0]],[[1,0]]];exports.easeInOutCubic=easeInOutCubic;var easeInQuart=[[[0,1]],[[.812,.74],[.611,.988],[1.013,.492]],[[1,0]]];exports.easeInQuart=easeInQuart;var easeOutQuart=[[[0,1]],[[.152,.244],[.001,.448],[.285,-.02]],[[1,0]]];exports.easeOutQuart=easeOutQuart;var easeInOutQuart=[[[0,1]],[[.5,.5],[.4,1],[.6,0]],[[1,0]]];exports.easeInOutQuart=easeInOutQuart;var easeInQuint=[[[0,1]],[[.857,.856],[.714,1],[1,.712]],[[1,0]]];exports.easeInQuint=easeInQuint;var easeOutQuint=[[[0,1]],[[.108,.2],[.001,.4],[.214,-.012]],[[1,0]]];exports.easeOutQuint=easeOutQuint;var easeInOutQuint=[[[0,1]],[[.5,.5],[.5,1],[.5,0]],[[1,0]]];exports.easeInOutQuint=easeInOutQuint;var easeInBack=[[[0,1]],[[.667,.896],[.38,1.184],[.955,.616]],[[1,0]]];exports.easeInBack=easeInBack;var easeOutBack=[[[0,1]],[[.335,.028],[.061,.22],[.631,-.18]],[[1,0]]];exports.easeOutBack=easeOutBack;var easeInOutBack=[[[0,1]],[[.5,.5],[.4,1.4],[.6,-.4]],[[1,0]]];exports.easeInOutBack=easeInOutBack;var easeInElastic=[[[0,1]],[[.474,.964],[.382,.988],[.557,.952]],[[.619,1.076],[.565,1.088],[.669,1.08]],[[.77,.916],[.712,.924],[.847,.904]],[[.911,1.304],[.872,1.316],[.961,1.34]],[[1,0]]];exports.easeInElastic=easeInElastic;var easeOutElastic=[[[0,1]],[[.073,-.32],[.034,-.328],[.104,-.344]],[[.191,.092],[.11,.06],[.256,.08]],[[.31,-.076],[.26,-.068],[.357,-.076]],[[.432,.032],[.362,.028],[.683,-.004]],[[1,0]]];exports.easeOutElastic=easeOutElastic;var easeInOutElastic=[[[0,1]],[[.21,.94],[.167,.884],[.252,.98]],[[.299,1.104],[.256,1.092],[.347,1.108]],[[.5,.496],[.451,.672],[.548,.324]],[[.696,-.108],[.652,-.112],[.741,-.124]],[[.805,.064],[.756,.012],[.866,.096]],[[1,0]]];exports.easeInOutElastic=easeInOutElastic;var easeInBounce=[[[0,1]],[[.148,1],[.075,.868],[.193,.848]],[[.326,1],[.276,.836],[.405,.712]],[[.6,1],[.511,.708],[.671,.348]],[[1,0]]];exports.easeInBounce=easeInBounce;var easeOutBounce=[[[0,1]],[[.357,.004],[.27,.592],[.376,.252]],[[.604,-.004],[.548,.312],[.669,.184]],[[.82,0],[.749,.184],[.905,.132]],[[1,0]]];exports.easeOutBounce=easeOutBounce;var easeInOutBounce=[[[0,1]],[[.102,1],[.05,.864],[.117,.86]],[[.216,.996],[.208,.844],[.227,.808]],[[.347,.996],[.343,.8],[.48,.292]],[[.635,.004],[.511,.676],[.656,.208]],[[.787,0],[.76,.2],[.795,.144]],[[.905,-.004],[.899,.164],[.944,.144]],[[1,0]]];exports.easeInOutBounce=easeInOutBounce;var _default=new Map([["linear",linear],["easeInSine",easeInSine],["easeOutSine",easeOutSine],["easeInOutSine",easeInOutSine],["easeInQuad",easeInQuad],["easeOutQuad",easeOutQuad],["easeInOutQuad",easeInOutQuad],["easeInCubic",easeInCubic],["easeOutCubic",easeOutCubic],["easeInOutCubic",easeInOutCubic],["easeInQuart",easeInQuart],["easeOutQuart",easeOutQuart],["easeInOutQuart",easeInOutQuart],["easeInQuint",easeInQuint],["easeOutQuint",easeOutQuint],["easeInOutQuint",easeInOutQuint],["easeInBack",easeInBack],["easeOutBack",easeOutBack],["easeInOutBack",easeInOutBack],["easeInElastic",easeInElastic],["easeOutElastic",easeOutElastic],["easeInOutElastic",easeInOutElastic],["easeInBounce",easeInBounce],["easeOutBounce",easeOutBounce],["easeInOutBounce",easeInOutBounce]]);exports["default"]=_default},{}],58:[function(require,module,exports){"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.transition=transition;exports.injectNewCurve=injectNewCurve;exports["default"]=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _curves=_interopRequireDefault(require("./config/curves"));var defaultTransitionBC="linear";function transition(tBC){var startState=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var endState=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var frameNum=arguments.length>3&&arguments[3]!==undefined?arguments[3]:30;var deep=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;if(!checkParams.apply(void 0,arguments))return false;try{var bezierCurve=getBezierCurve(tBC);var frameStateProgress=getFrameStateProgress(bezierCurve,frameNum);if(!deep||typeof endState==="number")return getTransitionState(startState,endState,frameStateProgress);return recursionTransitionState(startState,endState,frameStateProgress)}catch(_unused){console.warn("Transition parameter may be abnormal!");return[endState]}}function checkParams(tBC){var startState=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var endState=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var frameNum=arguments.length>3&&arguments[3]!==undefined?arguments[3]:30;if(!tBC||startState===false||endState===false||!frameNum){console.error("transition: Missing Parameters!");return false}if((0,_typeof2["default"])(startState)!==(0,_typeof2["default"])(endState)){console.error("transition: Inconsistent Status Types!");return false}var stateType=(0,_typeof2["default"])(endState);if(stateType==="string"||stateType==="boolean"||!tBC.length){console.error("transition: Unsupported Data Type of State!");return false}if(!_curves["default"].has(tBC)&&!(tBC instanceof Array)){console.warn("transition: Transition curve not found, default curve will be used!")}return true}function getBezierCurve(tBC){var bezierCurve="";if(_curves["default"].has(tBC)){bezierCurve=_curves["default"].get(tBC)}else if(tBC instanceof Array){bezierCurve=tBC}else{bezierCurve=_curves["default"].get(defaultTransitionBC)}return bezierCurve}function getFrameStateProgress(bezierCurve,frameNum){var tMinus=1/(frameNum-1);var tState=new Array(frameNum).fill(0).map(function(t,i){return i*tMinus});var frameState=tState.map(function(t){return getFrameStateFromT(bezierCurve,t)});return frameState}function getFrameStateFromT(bezierCurve,t){var tBezierCurvePoint=getBezierCurvePointFromT(bezierCurve,t);var bezierCurvePointT=getBezierCurvePointTFromReT(tBezierCurvePoint,t);return getBezierCurveTState(tBezierCurvePoint,bezierCurvePointT)}function getBezierCurvePointFromT(bezierCurve,t){var lastIndex=bezierCurve.length-1;var begin="",end="";bezierCurve.findIndex(function(item,i){if(i===lastIndex)return;begin=item;end=bezierCurve[i+1];var currentMainPointX=begin[0][0];var nextMainPointX=end[0][0];return t>=currentMainPointX&&t=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev=0;--i){var entry=this.tryEntries[i];if(entry.finallyLoc===finallyLoc){this.complete(entry.completion,entry.afterLoc);resetTryEntry(entry);return ContinueSentinel}}},catch:function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if(record.type==="throw"){var thrown=record.arg;resetTryEntry(entry)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};if(this.method==="next"){this.arg=undefined}return ContinueSentinel}};return exports}(typeof module==="object"?module.exports:{});try{regeneratorRuntime=runtime}catch(accidentalStrictMode){Function("r","regeneratorRuntime = r")(runtime)}},{}]},{},[1]);