@fusioncharts/core
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -1,1 +0,1 @@ | ||
https://www.fusioncharts.com/buy/ | ||
All use of the FusionCharts, Inc. software product is subject to the license terms contained in the license agreement located at https://www.ideracorp.com/Legal/FusionCharts/MasterISVSoftwareSubscriptionAgreement and by proceeding to download, install or use the software in which this agreement is electronically embedded or by obtaining the license key for this software, you agree to be bound to the terms of such license agreement. IF YOU DO NOT AGREE WITH THESE TERMS AND CONDITIONS, THEN DO NOT INSTALL/DOWNLOAD OR USE THE SOFTWARE AND DELETE THE SOFTWARE FROM YOUR COMPUTER SYSTEM. |
{ | ||
"name": "@fusioncharts/core", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "JavaScript Data Visualisation Library", | ||
@@ -26,3 +26,3 @@ "author": "FusionCharts, Inc. <support@fusioncharts.com>", | ||
"@babel/runtime": "^7.9.2", | ||
"@fusioncharts/utils": "^1.0.5", | ||
"@fusioncharts/utils": "^1.1.0", | ||
"core-js": "^3.0.1", | ||
@@ -47,3 +47,3 @@ "ramda": "^0.25.0" | ||
], | ||
"gitHead": "7dbc71bf9d23bd9562077de819a1c8885f255546" | ||
"gitHead": "a3088463989ac99148fc6e198f93daab60aad35c" | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports._parseLabel=exports.extractStyleInfo=exports.getLabel=exports.setAxisPadding=exports._createContainer=exports.shiftLabels=exports.setTickValues=exports._drawLabel=exports.getPixel=exports.getTrendLineLimits=exports.setDataLimit=exports.setAxisDimention=void 0;var _difference=_interopRequireDefault(require("ramda/src/difference"));var _extent5=_interopRequireDefault(require("@fusioncharts/utils/src/array/extent"));var _lib=require("../lib");var queryOptions={wrtVisible:true},LABEL_ID="_label",NORMALSTRING="normal",MIDDLE_STR="middle",POINTER="pointer",NOSTRING="none",extractStyleInfo=function extractStyleInfo(cat,chart){var sAttrMap={labelfont:["fontFamily"],labelfontcolor:["fontColor"],labelfontsize:["fontSize",function(val){return val?(0,_lib.pluckNumber)(val)+"px":_lib.UNDEF}],labelfontbold:["fontWeight",function(val){return val?"bold":NORMALSTRING}],labelfontitalic:["fontStyle",function(val){return val?"italic":NORMALSTRING}],labelfontalpha:["fontAlpha"]},cats=chart.getFromEnv("dataSource").categories,catData=cats&&cats[0]||{},defFn=function defFn(val){return val},styleExists=false,attrKey,attrVal,secAttrVal,style={},attrRule,mappedAttr,mapFn,mappedVal;for(attrKey in catData){if(attrKey==="category"||attrKey in cat){continue}attrVal=catData[attrKey];cat[attrKey]=attrVal}for(attrKey in sAttrMap){attrRule=sAttrMap[attrKey];mappedAttr=attrRule[0];mapFn=attrRule[1]||defFn;attrVal=cat[attrKey];secAttrVal=cat[mappedAttr.toLowerCase()];if(attrVal!==_lib.UNDEF||secAttrVal!==_lib.UNDEF){if((mappedVal=mapFn(attrVal))!==_lib.UNDEF||(mappedVal=mapFn(secAttrVal))!==_lib.UNDEF){style[mappedAttr]=mappedVal;styleExists=true}}if(styleExists){cat.style=style}}},setAxisDimention=function setAxisDimention(data){var axis=this,scale=axis.getScale(),axisConfig=axis.config,chart=axis.getFromEnv("chart"),chartConfig=chart.config,axisDimention=axisConfig.axisDimention||(axisConfig.axisDimention={}),isReverse=axisConfig.isReverse;axisDimention.opposite=(0,_lib.pluckNumber)(data.opposite,axisDimention.opposite);axisDimention.x=(0,_lib.pluckNumber)(data.x,axisDimention.x,chartConfig.canvasLeft);axisDimention.y=(0,_lib.pluckNumber)(data.y,axisDimention.y,chartConfig.canvasTop);axisDimention.axisLength=(0,_lib.pluckNumber)(data.axisLength,axisDimention.axisLength);if(axisConfig.isVertical){isReverse?scale.setRange([axisDimention.y+axisDimention.axisLength,axisDimention.y]):scale.setRange([axisDimention.y,axisDimention.y+axisDimention.axisLength])}else{isReverse?scale.setRange([axisDimention.x+axisDimention.axisLength,axisDimention.x]):scale.setRange([axisDimention.x,axisDimention.x+axisDimention.axisLength])}axisConfig.translation=axis._computeTranslation()},setDataLimit=function setDataLimit(_max,_min){var axis=this,max=_max,min=_min,axisConfig=axis.config,categories=axis.getFromEnv("dataSource").categories,categoryArr=categories&&categories[0]&&categories[0].category,startPad=axisConfig.startPad||0,endPad=axisConfig.endPad||0,catMin,catMax,trendMin,trendMax,xAxisLabelMode=axisConfig.xAxisLabelMode,numberAccessor=function numberAccessor(a){return Number(a)};if(xAxisLabelMode==="categories"||xAxisLabelMode==="mixed"){var _extent=(0,_extent5.default)(categoryArr,(function(obj){return Number(obj.x)}));catMin=_extent[0];catMax=_extent[1]}var _axis$getTrendLineLim=axis.getTrendLineLimits();trendMin=_axis$getTrendLineLim[0];trendMax=_axis$getTrendLineLim[1];var _extent2=(0,_extent5.default)([trendMin,trendMax,catMin,catMax,min,max],numberAccessor);min=_extent2[0];max=_extent2[1];axisConfig.originalMax=max;axisConfig.originalMin=min;max=axisConfig.isPercent?100:max+endPad;min=axisConfig.isPercent?0:min-startPad;axis._setAxisRange({min:min,max:max});if(axisConfig.axisRange.tickInterval!==_lib.UNDEF){axis._adjustNumberFormatter(axisConfig.axisRange.tickInterval)}},getTrendLineLimits=function getTrendLineLimits(){var axisConfig=this.config,lines=axisConfig.trendLines||axisConfig.vTrendLines||axisConfig.trendPoints,lineArr=lines&&lines[0]&&lines[0].line||lines&&lines.point,startMin,startMax,endMin,endMax;if(axisConfig.trendLimits)return axisConfig.trendLimits;var _extent3=(0,_extent5.default)(lineArr,(function(obj){return obj.startvalue===""?_lib.UNDEF:Number(obj.startvalue)}));startMin=_extent3[0];startMax=_extent3[1];var _extent4=(0,_extent5.default)(lineArr,(function(obj){return obj.endvalue===""?_lib.UNDEF:Number(obj.endvalue)}));endMin=_extent4[0];endMax=_extent4[1];axisConfig.trendLimits=(0,_extent5.default)([startMin,startMax,endMin,endMax],(function(a){return Number(a)}));return axisConfig.trendLimits},getPixel=function getPixel(value){return this.getScale().getRangeValue(value)},_drawLabel=function _drawLabel(){var axis=this,axisConfig=axis.config,animationManager=axis.getFromEnv("animationManager"),toolTipController=this.getFromEnv("toolTipController"),axisRange=axisConfig.axisRange,labels=axisConfig.labels,style=labels.style,axisComponents=axis.components,i,j,ln,max=axisRange.max,min=axisRange.min,axisContainer=axisConfig.axisContainer,extremeLabels=axisConfig.extremeLabels,textElement,ticks=axisConfig.ticks,mapId,map=[],css={fontFamily:style.fontFamily,fontSize:style.fontSize,fontWeight:style.fontWeight,fontStyle:style.fontStyle,lineHeight:style.lineHeight},removingElement,axisAttrObj,value,diff,labelIndexArr,labelConfArr;if(axisConfig.labels.isDraw){labelConfArr=axisComponents.labels;labelIndexArr=axisComponents.labelIndexArr;axisContainer.css(css);for(j=0,ln=labelIndexArr&&labelIndexArr.length;j<ln;j+=1){i=labelIndexArr[j];value=ticks[i];mapId=""+value+LABEL_ID;textElement=axis.getGraphicalElement(mapId);axisAttrObj=labelConfArr[i].config.props.label.attr;textElement=axis.addGraphicalElement(mapId,animationManager.setAnimation({el:textElement||"text",attr:axisAttrObj,container:axisContainer,data:{value:value},component:axis,label:"text"}));if(axisAttrObj.tooltext){toolTipController.enableToolTip(textElement,axisAttrObj.tooltext)}else{toolTipController.disableToolTip(textElement)}if(value===max){extremeLabels.lastLabel.graphic=textElement}else if(value===min){extremeLabels.firstLabel.graphic=textElement}map.push(mapId)}}diff=(0,_difference.default)(axisConfig.prevIntervalArr,map);for(i=0,ln=diff.length;i<ln;i++){removingElement=axis.getGraphicalElement(diff[i]);removingElement&&axis.removeGraphicalElement(removingElement)}axisConfig.prevIntervalArr=map},_parseLabel=function _parseLabel(){var axis=this,axisConfig=axis.config,canvasDimensions=axis.getLinkedItem("canvas").getEffectiveDimensions(),axisDimension=axisConfig.axisDimention,chart=axis.getFromEnv("chart"),chartConfig=chart.config,axisRange=axisConfig.axisRange,isOpposit=axisConfig.isOpposit,labels=axisConfig.labels,axisComponents=axis.components,labelStore=axisComponents.labels,style=labels.style,smartLabel=chart.getFromEnv("smartLabel"),i,ln,isVertical=axisConfig.isVertical,max=axisRange.max,min=axisRange.min,numberFormatter=axis.getFromEnv("number-formatter"),canvasTop=canvasDimensions.top,canvasLeft=canvasDimensions.left,canvasBottom=canvasTop+canvasDimensions.height,canvasRight=canvasLeft+canvasDimensions.width,axisPadding=axisConfig.labelPadding,extremeLabels=axisConfig.extremeLabels,axisStartPosition=isVertical?axisDimension.x:axisDimension.y,axisEndPosition=axisDimension.opposite,labelRotation,labelLineHeight,avalW,avalH,axisValueMaxH=axisConfig.labelMaxH,axisValueMaxW=axisConfig.labelMaxW,tempStep,tickInterval=axisRange.tickInterval,intervalWidth=Math.abs(axis.getPixel(min,queryOptions)-axis.getPixel(min+tickInterval,queryOptions)),numberFormatterFn,axisAttrObjCommon,axisAttrObj,tickMap=[],ticks=axisConfig.ticks,counter=0,isReverse=axisConfig.isReverse,leftSpace,rightSpace,value,smartLabelConf,showZeroPlaneValue=(0,_lib.pluckNumber)(axis.getFromEnv("chart-attrib").showzeroplanevalue),checkLimit=true,zeroInPx,limit=axis.getLimit(),intervalArr;smartLabel.useEllipsesOnOverflow(chartConfig.useEllipsesWhenOverflow);smartLabel.setStyle({fontSize:style.fontSize,fontFamily:style.fontFamily,lineHeight:style.lineHeight,fontWeight:style.fontWeight});labelLineHeight=style.lineHeight;if(labelLineHeight){if(labelLineHeight.indexOf("px")!==-1){labelLineHeight=parseFloat(labelLineHeight.replace("px",""))}}if(showZeroPlaneValue===0){checkLimit=false}if(axisConfig.labels.isDraw){if(axisConfig.drawLabelsOpposit){isOpposit=!isOpposit;axisStartPosition=axisEndPosition}axisAttrObjCommon={fill:style.color,"line-height":labelLineHeight,"font-size":style.fontSize,opacity:1,cursor:style.labelLink?POINTER:""};labelRotation=axisConfig.labels.rotation;if(isVertical){if(axisConfig.labelMaxH>intervalWidth&&!axisConfig.tickValues){tempStep=Math.ceil(axisConfig.labelMaxH/intervalWidth)}axisAttrObjCommon["text-anchor"]=isOpposit?_lib.POSITION_START:_lib.POSITION_END}else{if(axisConfig.labelMaxW>intervalWidth&&!axisConfig.tickValues){tempStep=Math.ceil(axisConfig.labelMaxW/intervalWidth)}if(labelRotation){axisAttrObjCommon["text-anchor"]=isOpposit?_lib.POSITION_START:_lib.POSITION_END;axisAttrObjCommon["vertical-align"]=MIDDLE_STR}else{axisAttrObjCommon["vertical-align"]=isOpposit?_lib.POSITION_BOTTOM:_lib.POSITION_TOP}leftSpace=canvasLeft;rightSpace=chartConfig.width-canvasRight}if(tempStep>axisConfig.labels.step){axisConfig.labels.step=tempStep}if(axisConfig.numberFormatterFn){numberFormatterFn=numberFormatter[axisConfig.numberFormatterFn]}else if(axisConfig.isPercent){numberFormatterFn=numberFormatter.yAxisPercentValue}else if(isVertical){numberFormatterFn=numberFormatter.yAxis}else{numberFormatterFn=numberFormatter.xAxis}extremeLabels.firstLabel={};extremeLabels.lastLabel={};intervalArr=ticks.filter((function(tick,idx,arr){if(tick===0&&!axisConfig.showZeroPlaneValue){if(!checkLimit||checkLimit&&!(limit.max===tick||limit.min===tick)){return false}tickMap[counter++]=idx;return true}else if(!isVertical&&(axisConfig.isReverse?idx!==0:idx!==arr.length-1)&&axis.getPixel(tick,queryOptions)+axisConfig.labelMaxW>canvasRight){return false}else if(idx%axisConfig.labels.step===0){tickMap[counter++]=idx;return true}else if(axisConfig.labels.drawLimitVal&&(idx===0||idx===arr.length-1)){tickMap[counter++]=idx;return true}return false}));if(axisConfig.isZeroTickForced&&intervalArr.indexOf(0)!==-1){var valueInPx;counter=0;tickMap=[];zeroInPx=axis.getPixel(0);intervalArr=intervalArr.filter((function(tick,index,arr){valueInPx=axis.getPixel(tick);if(arr[index+1]===0||arr[index-1]===0){if(isVertical){if(valueInPx+axisValueMaxH>=zeroInPx&&zeroInPx>=valueInPx-axisValueMaxH)return false;tickMap[counter++]=index;return true}else if(valueInPx+axisValueMaxW>=zeroInPx&&zeroInPx>=valueInPx-axisValueMaxW){return false}tickMap[counter++]=index;return true}tickMap[counter++]=index;return true}))}avalW=(isVertical?axisValueMaxW:intervalWidth/2)*axisConfig.labels.step;avalH=isVertical?intervalWidth/2:axisValueMaxH;axisComponents.labelIndexArr=tickMap.slice();for(i=0,ln=intervalArr.length;i<ln;i+=1){value=intervalArr[i];labelStore[tickMap[i]]=labelStore[tickMap[i]]||{config:{props:{label:{}}}};axisAttrObj=Object.assign({},axisAttrObjCommon);smartLabelConf=_lib.UNDEF;if(!axisConfig.labels.drawNormalVal&&!(value===min||value===max)){axisAttrObj.text=_lib.BLANKSTRING}else if(!axisConfig.labels.drawLimitVal&&(value===min||value===max)){axisAttrObj.text=_lib.BLANKSTRING}else if(value===min&&axisConfig.lowerLimitDisplay&&axisConfig.labels.drawLimitVal){smartLabelConf=smartLabel.getSmartText(axisConfig.lowerLimitDisplay,avalW,avalH+labelLineHeight/2);axisAttrObj.text=smartLabelConf.text;axisAttrObj.tooltext=smartLabelConf.tooltext}else if(value===max&&axisConfig.upperLimitDisplay&&axisConfig.labels.drawLimitVal){smartLabelConf=smartLabel.getSmartText(axisConfig.upperLimitDisplay,avalW,avalH+labelLineHeight/2);axisAttrObj.text=smartLabelConf.text;axisAttrObj.tooltext=smartLabelConf.tooltext}else{axisAttrObj.text=_lib.BLANKSTRING+numberFormatterFn.call(numberFormatter,value,axisConfig.axisIndex);smartLabelConf=smartLabel.getOriSize(axisAttrObj.text)}if(axis.config.isPercent&&axisAttrObj.text.indexOf("%")===-1){axisAttrObj.text=axisAttrObj.text.replace(/\D/g,"");axisAttrObj.text=axisAttrObj.text+"%"}if(isVertical){axisAttrObj.x=isOpposit?(axisStartPosition||canvasRight)+axisPadding:(axisStartPosition||canvasLeft)-axisPadding;axisAttrObj.y=axis.getPixel(value,queryOptions);if((isReverse&&value===min&&axisConfig.lowerLimitDisplay||!isReverse&&value===max&&axisConfig.upperLimitDisplay)&&smartLabelConf&&smartLabelConf.height>labelLineHeight){axisAttrObj["vertical-align"]=_lib.POSITION_BOTTOM}if((isReverse&&value===max&&axisConfig.upperLimitDisplay||!isReverse&&value===min&&axisConfig.lowerLimitDisplay)&&smartLabelConf&&smartLabelConf.height>labelLineHeight){axisAttrObj["vertical-align"]=_lib.POSITION_TOP}if(axisConfig.placeValuesInside){axisAttrObj["text-anchor"]=isOpposit?_lib.POSITION_END:_lib.POSITION_START}}else{axisAttrObj.x=axis.getPixel(value,queryOptions);axisAttrObj.y=isOpposit?(axisStartPosition||canvasTop)-axisPadding:(axisStartPosition||canvasBottom)+axisPadding;if((!isReverse&&value===min||isReverse&&value===max)&&smartLabelConf&&smartLabelConf.width>leftSpace*2){axisAttrObj["text-anchor"]=_lib.POSITION_START}if((!isReverse&&value===max||isReverse&&value===min)&&smartLabelConf&&smartLabelConf.width>rightSpace*2){axisAttrObj["text-anchor"]=_lib.POSITION_END}if(axisConfig.placeValuesInside){axisAttrObj["vertical-align"]=isOpposit?_lib.POSITION_TOP:_lib.POSITION_BOTTOM}else{axisAttrObj["vertical-align"]=isOpposit?_lib.POSITION_BOTTOM:_lib.POSITION_TOP}}if(typeof value==="undefined"){axisAttrObj["text-bound"]=[]}else{axisAttrObj["text-bound"]=[(0,_lib.pluck)(style.backgroundColor,_lib.BLANKSTRING),(0,_lib.pluck)(style.borderColor,_lib.BLANKSTRING),(0,_lib.pluck)(style.borderThickness,_lib.BLANKSTRING),(0,_lib.pluck)(style.borderPadding,0),(0,_lib.pluck)(style.borderRadius,0),(0,_lib.pluck)(style.borderDash,NOSTRING)]}if(labels.shiftX){axisAttrObj.x+=labels.shiftX}if(labels.shiftY){axisAttrObj.y+=labels.shiftY}axisAttrObj.transform=(0,_lib.getSuggestiveRotation)(labelRotation,axisAttrObj.x,axisAttrObj.y);labelStore[tickMap[i]].config.props.label.attr=axisAttrObj}}},setTickValues=function setTickValues(categories){var len=categories&&categories.length,axisConfig=this.config,startPad=axisConfig.startPad||0,index,chart=this.getFromEnv("chart"),tickObj,countCat=0,tickValues=axisConfig.tickValues={},tickValue=tickValues.tickValue=[],vline=tickValues.vline=[],hasTickId,tickIdMap=tickValues.tickIdMap={},endPad=axisConfig.endPad||0;axisConfig.hasCategory=1;for(index=0;index<len;index+=1){tickObj=(0,_lib.extend2)({},categories[index]);hasTickId=tickObj.id||tickObj.id==="";if(!tickObj.vline){if(hasTickId){tickIdMap[tickObj.id.toLowerCase()]={tickObj:tickObj,index:countCat}}if(axisConfig.mapTickValuesById&&hasTickId||!axisConfig.mapTickValuesById){extractStyleInfo(tickObj,chart);tickValue.push(tickObj);tickValue[countCat].label=(0,_lib.parseUnsafeString)(tickValue[countCat].label);countCat+=1}}else{tickObj.startIndex=tickValue.length-1;vline.push(tickObj)}}axisConfig.oriCatLen=countCat;this._setAxisRange({max:Number((0,_lib.toPrecision)(countCat-1+endPad,10)),min:Number((0,_lib.toPrecision)(0-startPad,10)),tickInterval:Number((0,_lib.toPrecision)(1,10))})},shiftLabels=function shiftLabels(x,y){var axis=this,axisConfig=axis.config,labels=axisConfig.labels;labels.shiftX=x;labels.shiftY=y},_createContainer=function _createContainer(){var axis=this,axisConfig=axis.config,isVertical=axisConfig.isVertical,chart=axis.getLinkedParent(),childContainers=chart.getChildContainer(),axisBottom=childContainers.axisBottomGroup,axisTop=childContainers.axisTopGroup,translation=-axis.getTranslation(),translateString=isVertical?"T0,"+translation:"T"+translation+",0",axisLineGroup,axisNameGroup,axisTrendGroupTop,axisLabelGroup,axisLabelGroupTop;axisNameGroup=axis.createContainer("axisNameGroup",{name:"dataset-Name-group"},axisBottom);axisLineGroup=axis.createContainer("axisLineGroup",{name:"axis-Line-group"},axisTop);axisTrendGroupTop=axis.createContainer("axisTrendGroupTop",{name:"dataset-Trend-group-top"},axisTop);axisLabelGroup=axis.createContainer("axisLabelGroup",{name:"dataset-Label-group"},axisBottom);axisLabelGroupTop=axis.createContainer("axisLabelGroupTop",{name:"dataset-Label-group"},axisTop);axisConfig.axisContainer=axis.createGroup("axisContainer",{name:"dataset-axis",transform:translateString},axisLabelGroup);axisConfig.axisLabelContainerTop=axis.createGroup("axisLabelContainerTop",{name:"dataset-top-label",transform:translateString},axisLabelGroupTop);axisConfig.axisAxisLineContainer=axis.createGroup("axisAxisLineContainer",{name:"axis-line-tick"},axisLineGroup);axisConfig.axisTrendLabelContainer=axis.createGroup("axisTrendLabelContainer",{name:"dataset-axis-trend-label"},axisTrendGroupTop);axisConfig.axisNameContainer=axis.createGroup("axisNameContainer",{name:"dataset-axis-name"},axisNameGroup);axisConfig.axisAxisLineContainerBottom=axis.createGroup("axisAxisLineContainerBottom",{name:"axis-line-tick-bottom"},axisBottom)},setAxisPadding=function setAxisPadding(_startPad,_endPad){if(_startPad===void 0){_startPad=0}if(_endPad===void 0){_endPad=0}var axis=this,axisConfig=axis.config,startPad=_startPad,endPad=_endPad,scale=axis.getScale(),_scale$getDomain=scale.getDomain(),min=_scale$getDomain[0],max=_scale$getDomain[1],diff;if(axisConfig.oriCatLen===1){if(startPad===0){startPad=.5}if(endPad===0){endPad=.5}}diff=startPad-axisConfig.startPad;axisConfig.startPad=Math.max(axisConfig.startPad,startPad);axisConfig.endPad=Math.max(axisConfig.endPad,endPad);if(diff>0){axisConfig.setPadding=true;axis._setAxisRange({min:min-diff,max:max+diff})}if(!axisConfig.tickValues){if(axisConfig.originalMax&&axisConfig.originalMin){axis.setDataLimit(axisConfig.originalMax,axisConfig.originalMin)}}},getLabel=function getLabel(tickId){var axis=this,axisConfig=axis.config,tickObj=axisConfig.tickValues&&axisConfig.tickValues.tickValue[tickId],macroIndices=[3],parserConfig={};if(tickObj&&tickObj.tooltext){parserConfig.label=tickObj.label;tickObj.tooltext=(0,_lib.parseTooltext)(tickObj.tooltext,macroIndices,parserConfig)}return{label:tickObj&&(tickObj.oriLabel||tickObj.label),tooltext:tickObj&&tickObj.tooltext}};exports.getLabel=getLabel;exports.setAxisPadding=setAxisPadding;exports._createContainer=_createContainer;exports.shiftLabels=shiftLabels;exports.setTickValues=setTickValues;exports._parseLabel=_parseLabel;exports._drawLabel=_drawLabel;exports.getPixel=getPixel;exports.getTrendLineLimits=getTrendLineLimits;exports.setDataLimit=setDataLimit;exports.setAxisDimention=setAxisDimention;exports.extractStyleInfo=extractStyleInfo; | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports._parseLabel=exports.extractStyleInfo=exports.getLabel=exports.setAxisPadding=exports._createContainer=exports.shiftLabels=exports.setTickValues=exports._drawLabel=exports.getPixel=exports.getTrendLineLimits=exports.setDataLimit=exports.setAxisDimention=void 0;var _difference=_interopRequireDefault(require("ramda/src/difference"));var _extent5=_interopRequireDefault(require("@fusioncharts/utils/src/array/extent"));var _lib=require("../lib");var queryOptions={wrtVisible:true},LABEL_ID="_label",NORMALSTRING="normal",MIDDLE_STR="middle",POINTER="pointer",NOSTRING="none",extractStyleInfo=function extractStyleInfo(cat,chart){var sAttrMap={labelfont:["fontFamily"],labelfontcolor:["fontColor"],labelfontsize:["fontSize",function(val){return val?(0,_lib.pluckNumber)(val)+"px":_lib.UNDEF}],labelfontbold:["fontWeight",function(val){return val?"bold":NORMALSTRING}],labelfontitalic:["fontStyle",function(val){return val?"italic":NORMALSTRING}],labelfontalpha:["fontAlpha"]},cats=chart.getFromEnv("dataSource").categories,catData=cats&&cats[0]||{},defFn=function defFn(val){return val},styleExists=false,attrKey,attrVal,secAttrVal,style={},attrRule,mappedAttr,mapFn,mappedVal;for(attrKey in catData){if(attrKey==="category"||attrKey in cat){continue}attrVal=catData[attrKey];cat[attrKey]=attrVal}for(attrKey in sAttrMap){attrRule=sAttrMap[attrKey];mappedAttr=attrRule[0];mapFn=attrRule[1]||defFn;attrVal=cat[attrKey];secAttrVal=cat[mappedAttr.toLowerCase()];if(attrVal!==_lib.UNDEF||secAttrVal!==_lib.UNDEF){if((mappedVal=mapFn(attrVal))!==_lib.UNDEF||(mappedVal=mapFn(secAttrVal))!==_lib.UNDEF){style[mappedAttr]=mappedVal;styleExists=true}}if(styleExists){cat.style=style}}},setAxisDimention=function setAxisDimention(data){var axis=this,scale=axis.getScale(),axisConfig=axis.config,chart=axis.getFromEnv("chart"),chartConfig=chart.config,axisDimention=axisConfig.axisDimention||(axisConfig.axisDimention={}),isReverse=axisConfig.isReverse;axisDimention.opposite=(0,_lib.pluckNumber)(data.opposite,axisDimention.opposite);axisDimention.x=(0,_lib.pluckNumber)(data.x,axisDimention.x,chartConfig.canvasLeft);axisDimention.y=(0,_lib.pluckNumber)(data.y,axisDimention.y,chartConfig.canvasTop);axisDimention.axisLength=(0,_lib.pluckNumber)(data.axisLength,axisDimention.axisLength);if(axisConfig.isVertical){isReverse?scale.setRange([axisDimention.y+axisDimention.axisLength,axisDimention.y]):scale.setRange([axisDimention.y,axisDimention.y+axisDimention.axisLength])}else{isReverse?scale.setRange([axisDimention.x+axisDimention.axisLength,axisDimention.x]):scale.setRange([axisDimention.x,axisDimention.x+axisDimention.axisLength])}axisConfig.translation=axis._computeTranslation()},setDataLimit=function setDataLimit(_max,_min){var axis=this,max=_max,min=_min,axisConfig=axis.config,categories=axis.getFromEnv("dataSource").categories,categoryArr=categories&&categories[0]&&categories[0].category,startPad=axisConfig.startPad||0,endPad=axisConfig.endPad||0,catMin,catMax,trendMin,trendMax,xAxisLabelMode=axisConfig.xAxisLabelMode,numberAccessor=function numberAccessor(a){return Number(a)};if(xAxisLabelMode==="categories"||xAxisLabelMode==="mixed"){var _extent=(0,_extent5.default)(categoryArr,(function(obj){return Number(obj.x)}));catMin=_extent[0];catMax=_extent[1]}var _axis$getTrendLineLim=axis.getTrendLineLimits();trendMin=_axis$getTrendLineLim[0];trendMax=_axis$getTrendLineLim[1];var _extent2=(0,_extent5.default)([trendMin,trendMax,catMin,catMax,min,max],numberAccessor);min=_extent2[0];max=_extent2[1];axisConfig.originalMax=max;axisConfig.originalMin=min;max=axisConfig.isPercent?100:max+endPad;min=axisConfig.isPercent?0:min-startPad;axis._setAxisRange({min:min,max:max});if(axisConfig.axisRange.tickInterval!==_lib.UNDEF){axis._adjustNumberFormatter(axisConfig.axisRange.tickInterval)}},getTrendLineLimits=function getTrendLineLimits(){var axisConfig=this.config,lines=axisConfig.trendLines||axisConfig.vTrendLines||axisConfig.trendPoints,lineArr=lines&&lines[0]&&lines[0].line||lines&&lines.point,startMin,startMax,endMin,endMax;if(axisConfig.trendLimits)return axisConfig.trendLimits;var _extent3=(0,_extent5.default)(lineArr,(function(obj){return obj.startvalue===""?_lib.UNDEF:Number(obj.startvalue)}));startMin=_extent3[0];startMax=_extent3[1];var _extent4=(0,_extent5.default)(lineArr,(function(obj){return obj.endvalue===""?_lib.UNDEF:Number(obj.endvalue)}));endMin=_extent4[0];endMax=_extent4[1];axisConfig.trendLimits=(0,_extent5.default)([startMin,startMax,endMin,endMax],(function(a){return Number(a)}));return axisConfig.trendLimits},getPixel=function getPixel(value){return this.getScale().getRangeValue(value)},_drawLabel=function _drawLabel(){var axis=this,axisConfig=axis.config,animationManager=axis.getFromEnv("animationManager"),toolTipController=this.getFromEnv("toolTipController"),axisRange=axisConfig.axisRange,labels=axisConfig.labels,style=labels.style,axisComponents=axis.components,i,j,ln,max=axisRange.max,min=axisRange.min,axisContainer=axisConfig.axisContainer,extremeLabels=axisConfig.extremeLabels,textElement,ticks=axisConfig.ticks,mapId,map=[],css={fontFamily:style.fontFamily,fontSize:style.fontSize,fontWeight:style.fontWeight,fontStyle:style.fontStyle,lineHeight:style.lineHeight},removingElement,axisAttrObj,value,diff,labelIndexArr,labelConfArr;if(axisConfig.labels.isDraw){labelConfArr=axisComponents.labels;labelIndexArr=axisComponents.labelIndexArr;axisContainer.css(css);for(j=0,ln=labelIndexArr&&labelIndexArr.length;j<ln;j+=1){i=labelIndexArr[j];value=ticks[i];mapId=""+value+LABEL_ID;textElement=axis.getGraphicalElement(mapId);axisAttrObj=labelConfArr[i].config.props.label.attr;textElement=axis.addGraphicalElement(mapId,animationManager.setAnimation({el:textElement||"text",attr:axisAttrObj,container:axisContainer,data:{value:value},component:axis,label:"text"}));if(axisAttrObj.tooltext){toolTipController.enableToolTip(textElement,axisAttrObj.tooltext)}else{toolTipController.disableToolTip(textElement)}if(value===max){extremeLabels.lastLabel.graphic=textElement}else if(value===min){extremeLabels.firstLabel.graphic=textElement}map.push(mapId)}}diff=(0,_difference.default)(axisConfig.prevIntervalArr,map);for(i=0,ln=diff.length;i<ln;i++){removingElement=axis.getGraphicalElement(diff[i]);removingElement&&axis.removeGraphicalElement(removingElement)}axisConfig.prevIntervalArr=map},_parseLabel=function _parseLabel(){var axis=this,axisConfig=axis.config,canvasDimensions=axis.getLinkedItem("canvas").getEffectiveDimensions(),axisDimension=axisConfig.axisDimention,chart=axis.getFromEnv("chart"),chartConfig=chart.config,axisRange=axisConfig.axisRange,isOpposit=axisConfig.isOpposit,labels=axisConfig.labels,axisComponents=axis.components,labelStore=axisComponents.labels,style=labels.style,smartLabel=chart.getFromEnv("smartLabel"),i,ln,isVertical=axisConfig.isVertical,max=axisRange.max,min=axisRange.min,numberFormatter=axis.getFromEnv("number-formatter"),canvasTop=canvasDimensions.top,canvasLeft=canvasDimensions.left,canvasBottom=canvasTop+canvasDimensions.height,canvasRight=canvasLeft+canvasDimensions.width,axisPadding=axisConfig.labelPadding,extremeLabels=axisConfig.extremeLabels,axisStartPosition=isVertical?axisDimension.x:axisDimension.y,axisEndPosition=axisDimension.opposite,labelRotation,labelLineHeight,avalW,avalH,axisValueMaxH=axisConfig.labelMaxH,axisValueMaxW=axisConfig.labelMaxW,tempStep,tickInterval=axisRange.tickInterval,intervalWidth=Math.abs(axis.getPixel(min,queryOptions)-axis.getPixel(min+tickInterval,queryOptions)),numberFormatterFn,axisAttrObjCommon,axisAttrObj,tickMap=[],ticks=axisConfig.ticks,counter=0,isReverse=axisConfig.isReverse,leftSpace,rightSpace,value,smartLabelConf,showZeroPlaneValue=(0,_lib.pluckNumber)(axis.getFromEnv("chart-attrib").showzeroplanevalue),checkLimit=true,zeroInPx,limit=axis.getLimit(),intervalArr;smartLabel.useEllipsesOnOverflow(chartConfig.useEllipsesWhenOverflow);smartLabel.setStyle({fontSize:style.fontSize,fontFamily:style.fontFamily,lineHeight:style.lineHeight,fontWeight:style.fontWeight});labelLineHeight=style.lineHeight;if(labelLineHeight){if(labelLineHeight.indexOf("px")!==-1){labelLineHeight=parseFloat(labelLineHeight.replace("px",""))}}if(showZeroPlaneValue===0){checkLimit=false}if(axisConfig.labels.isDraw){if(axisConfig.drawLabelsOpposit){isOpposit=!isOpposit;axisStartPosition=axisEndPosition}axisAttrObjCommon={fill:style.color,"line-height":labelLineHeight,"font-size":style.fontSize,opacity:1,cursor:style.labelLink?POINTER:""};labelRotation=axisConfig.labels.rotation;if(isVertical){if(axisConfig.labelMaxH>intervalWidth&&!axisConfig.tickValues){tempStep=Math.ceil(axisConfig.labelMaxH/intervalWidth)}axisAttrObjCommon["text-anchor"]=isOpposit?_lib.POSITION_START:_lib.POSITION_END}else{if(axisConfig.labelMaxW>intervalWidth&&!axisConfig.tickValues){tempStep=Math.ceil(axisConfig.labelMaxW/intervalWidth)}if(labelRotation){axisAttrObjCommon["text-anchor"]=isOpposit?_lib.POSITION_START:_lib.POSITION_END;axisAttrObjCommon["vertical-align"]=MIDDLE_STR}else{axisAttrObjCommon["vertical-align"]=isOpposit?_lib.POSITION_BOTTOM:_lib.POSITION_TOP}leftSpace=canvasLeft;rightSpace=chartConfig.width-canvasRight}if(tempStep>axisConfig.labels.step){axisConfig.labels.step=tempStep}if(axisConfig.numberFormatterFn){numberFormatterFn=numberFormatter[axisConfig.numberFormatterFn]}else if(axisConfig.isPercent){numberFormatterFn=numberFormatter.yAxisPercentValue}else if(isVertical){numberFormatterFn=numberFormatter.yAxis}else{numberFormatterFn=numberFormatter.xAxis}extremeLabels.firstLabel={};extremeLabels.lastLabel={};intervalArr=ticks.filter((function(tick,idx,arr){if(tick===0&&!axisConfig.showZeroPlaneValue){if(!checkLimit||checkLimit&&!(limit.max===tick||limit.min===tick)){return false}tickMap[counter++]=idx;return true}else if(!isVertical&&(axisConfig.isReverse?idx!==0:idx!==arr.length-1)&&axis.getPixel(tick,queryOptions)+axisConfig.labelMaxW>canvasRight){return false}else if(idx%axisConfig.labels.step===0){tickMap[counter++]=idx;return true}else if(axisConfig.labels.drawLimitVal&&(idx===0||idx===arr.length-1)){tickMap[counter++]=idx;return true}return false}));if(axisConfig.isZeroTickForced&&intervalArr.indexOf(0)!==-1){var valueInPx;counter=0;tickMap=[];zeroInPx=axis.getPixel(0);intervalArr=intervalArr.filter((function(tick,index,arr){valueInPx=axis.getPixel(tick);if(arr[index+1]===0||arr[index-1]===0){if(isVertical){if(valueInPx+axisValueMaxH>=zeroInPx&&zeroInPx>=valueInPx-axisValueMaxH)return false;tickMap[counter++]=index;return true}else if(valueInPx+axisValueMaxW>=zeroInPx&&zeroInPx>=valueInPx-axisValueMaxW){return false}tickMap[counter++]=index;return true}tickMap[counter++]=index;return true}))}avalW=(isVertical?axisValueMaxW:intervalWidth/2)*axisConfig.labels.step;avalH=isVertical?intervalWidth/2:axisValueMaxH;axisComponents.labelIndexArr=tickMap.slice();for(i=0,ln=intervalArr.length;i<ln;i+=1){value=intervalArr[i];labelStore[tickMap[i]]=labelStore[tickMap[i]]||{config:{props:{label:{}}}};axisAttrObj=Object.assign({},axisAttrObjCommon);smartLabelConf=_lib.UNDEF;if(!axisConfig.labels.drawNormalVal&&!(value===min||value===max)){axisAttrObj.text=_lib.BLANKSTRING}else if(!axisConfig.labels.drawLimitVal&&(value===min||value===max)){axisAttrObj.text=_lib.BLANKSTRING}else if(value===min&&axisConfig.lowerLimitDisplay&&axisConfig.labels.drawLimitVal){smartLabelConf=smartLabel.getSmartText(axisConfig.lowerLimitDisplay,avalW,avalH+labelLineHeight/2);axisAttrObj.text=smartLabelConf.text;axisAttrObj.tooltext=smartLabelConf.tooltext}else if(value===max&&axisConfig.upperLimitDisplay&&axisConfig.labels.drawLimitVal){smartLabelConf=smartLabel.getSmartText(axisConfig.upperLimitDisplay,avalW,avalH+labelLineHeight/2);axisAttrObj.text=smartLabelConf.text;axisAttrObj.tooltext=smartLabelConf.tooltext}else{axisAttrObj.text=_lib.BLANKSTRING+numberFormatterFn.call(numberFormatter,value,axisConfig.axisIndex);smartLabelConf=smartLabel.getOriSize(axisAttrObj.text)}if(isVertical){axisAttrObj.x=isOpposit?(axisStartPosition||canvasRight)+axisPadding:(axisStartPosition||canvasLeft)-axisPadding;axisAttrObj.y=axis.getPixel(value,queryOptions);if((isReverse&&value===min&&axisConfig.lowerLimitDisplay||!isReverse&&value===max&&axisConfig.upperLimitDisplay)&&smartLabelConf&&smartLabelConf.height>labelLineHeight){axisAttrObj["vertical-align"]=_lib.POSITION_BOTTOM}if((isReverse&&value===max&&axisConfig.upperLimitDisplay||!isReverse&&value===min&&axisConfig.lowerLimitDisplay)&&smartLabelConf&&smartLabelConf.height>labelLineHeight){axisAttrObj["vertical-align"]=_lib.POSITION_TOP}if(axisConfig.placeValuesInside){axisAttrObj["text-anchor"]=isOpposit?_lib.POSITION_END:_lib.POSITION_START}}else{axisAttrObj.x=axis.getPixel(value,queryOptions);axisAttrObj.y=isOpposit?(axisStartPosition||canvasTop)-axisPadding:(axisStartPosition||canvasBottom)+axisPadding;if((!isReverse&&value===min||isReverse&&value===max)&&smartLabelConf&&smartLabelConf.width>leftSpace*2){axisAttrObj["text-anchor"]=_lib.POSITION_START}if((!isReverse&&value===max||isReverse&&value===min)&&smartLabelConf&&smartLabelConf.width>rightSpace*2){axisAttrObj["text-anchor"]=_lib.POSITION_END}if(axisConfig.placeValuesInside){axisAttrObj["vertical-align"]=isOpposit?_lib.POSITION_TOP:_lib.POSITION_BOTTOM}else{axisAttrObj["vertical-align"]=isOpposit?_lib.POSITION_BOTTOM:_lib.POSITION_TOP}}if(typeof value==="undefined"){axisAttrObj["text-bound"]=[]}else{axisAttrObj["text-bound"]=[(0,_lib.pluck)(style.backgroundColor,_lib.BLANKSTRING),(0,_lib.pluck)(style.borderColor,_lib.BLANKSTRING),(0,_lib.pluck)(style.borderThickness,_lib.BLANKSTRING),(0,_lib.pluck)(style.borderPadding,0),(0,_lib.pluck)(style.borderRadius,0),(0,_lib.pluck)(style.borderDash,NOSTRING)]}if(labels.shiftX){axisAttrObj.x+=labels.shiftX}if(labels.shiftY){axisAttrObj.y+=labels.shiftY}axisAttrObj.transform=(0,_lib.getSuggestiveRotation)(labelRotation,axisAttrObj.x,axisAttrObj.y);labelStore[tickMap[i]].config.props.label.attr=axisAttrObj}}},setTickValues=function setTickValues(categories){var len=categories&&categories.length,axisConfig=this.config,startPad=axisConfig.startPad||0,index,chart=this.getFromEnv("chart"),tickObj,countCat=0,tickValues=axisConfig.tickValues={},tickValue=tickValues.tickValue=[],vline=tickValues.vline=[],hasTickId,tickIdMap=tickValues.tickIdMap={},endPad=axisConfig.endPad||0;axisConfig.hasCategory=1;for(index=0;index<len;index+=1){tickObj=(0,_lib.extend2)({},categories[index]);hasTickId=tickObj.id||tickObj.id==="";if(!tickObj.vline){if(hasTickId){tickIdMap[tickObj.id.toLowerCase()]={tickObj:tickObj,index:countCat}}if(axisConfig.mapTickValuesById&&hasTickId||!axisConfig.mapTickValuesById){extractStyleInfo(tickObj,chart);tickValue.push(tickObj);tickValue[countCat].label=(0,_lib.parseUnsafeString)(tickValue[countCat].label);countCat+=1}}else{tickObj.startIndex=tickValue.length-1;vline.push(tickObj)}}axisConfig.oriCatLen=countCat;this._setAxisRange({max:Number((0,_lib.toPrecision)(countCat-1+endPad,10)),min:Number((0,_lib.toPrecision)(0-startPad,10)),tickInterval:Number((0,_lib.toPrecision)(1,10))})},shiftLabels=function shiftLabels(x,y){var axis=this,axisConfig=axis.config,labels=axisConfig.labels;labels.shiftX=x;labels.shiftY=y},_createContainer=function _createContainer(){var axis=this,axisConfig=axis.config,isVertical=axisConfig.isVertical,chart=axis.getLinkedParent(),childContainers=chart.getChildContainer(),axisBottom=childContainers.axisBottomGroup,axisTop=childContainers.axisTopGroup,translation=-axis.getTranslation(),translateString=isVertical?"T0,"+translation:"T"+translation+",0",axisLineGroup,axisNameGroup,axisTrendGroupTop,axisLabelGroup,axisLabelGroupTop;axisNameGroup=axis.createContainer("axisNameGroup",{name:"dataset-Name-group"},axisBottom);axisLineGroup=axis.createContainer("axisLineGroup",{name:"axis-Line-group"},axisTop);axisTrendGroupTop=axis.createContainer("axisTrendGroupTop",{name:"dataset-Trend-group-top"},axisTop);axisLabelGroup=axis.createContainer("axisLabelGroup",{name:"dataset-Label-group"},axisBottom);axisLabelGroupTop=axis.createContainer("axisLabelGroupTop",{name:"dataset-Label-group"},axisTop);axisConfig.axisContainer=axis.createGroup("axisContainer",{name:"dataset-axis",transform:translateString},axisLabelGroup);axisConfig.axisLabelContainerTop=axis.createGroup("axisLabelContainerTop",{name:"dataset-top-label",transform:translateString},axisLabelGroupTop);axisConfig.axisAxisLineContainer=axis.createGroup("axisAxisLineContainer",{name:"axis-line-tick"},axisLineGroup);axisConfig.axisTrendLabelContainer=axis.createGroup("axisTrendLabelContainer",{name:"dataset-axis-trend-label"},axisTrendGroupTop);axisConfig.axisNameContainer=axis.createGroup("axisNameContainer",{name:"dataset-axis-name"},axisNameGroup);axisConfig.axisAxisLineContainerBottom=axis.createGroup("axisAxisLineContainerBottom",{name:"axis-line-tick-bottom"},axisBottom)},setAxisPadding=function setAxisPadding(_startPad,_endPad){if(_startPad===void 0){_startPad=0}if(_endPad===void 0){_endPad=0}var axis=this,axisConfig=axis.config,startPad=_startPad,endPad=_endPad,scale=axis.getScale(),_scale$getDomain=scale.getDomain(),min=_scale$getDomain[0],max=_scale$getDomain[1],diff;if(axisConfig.oriCatLen===1){if(startPad===0){startPad=.5}if(endPad===0){endPad=.5}}diff=startPad-axisConfig.startPad;axisConfig.startPad=Math.max(axisConfig.startPad,startPad);axisConfig.endPad=Math.max(axisConfig.endPad,endPad);if(diff>0){axisConfig.setPadding=true;axis._setAxisRange({min:min-diff,max:max+diff})}if(!axisConfig.tickValues){if(axisConfig.originalMax&&axisConfig.originalMin){axis.setDataLimit(axisConfig.originalMax,axisConfig.originalMin)}}},getLabel=function getLabel(tickId){var axis=this,axisConfig=axis.config,tickObj=axisConfig.tickValues&&axisConfig.tickValues.tickValue[tickId],macroIndices=[3],parserConfig={};if(tickObj&&tickObj.tooltext){parserConfig.label=tickObj.label;tickObj.tooltext=(0,_lib.parseTooltext)(tickObj.tooltext,macroIndices,parserConfig)}return{label:tickObj&&(tickObj.oriLabel||tickObj.label),tooltext:tickObj&&tickObj.tooltext}};exports.getLabel=getLabel;exports.setAxisPadding=setAxisPadding;exports._createContainer=_createContainer;exports.shiftLabels=shiftLabels;exports.setTickValues=setTickValues;exports._parseLabel=_parseLabel;exports._drawLabel=_drawLabel;exports.getPixel=getPixel;exports.getTrendLineLimits=getTrendLineLimits;exports.setDataLimit=setDataLimit;exports.setAxisDimention=setAxisDimention;exports.extractStyleInfo=extractStyleInfo; |
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=exports._mouseEvtHandler=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _lib=require("../lib");var _eventApi=require("../event-api");var _chartMessage=_interopRequireDefault(require("../chart-message"));var _componentInterface=require("../component-interface");var _animationManager=_interopRequireDefault(require("../animation-manager"));var _dependencyManager=require("../dependency-manager");var _eiMethodList=_interopRequireDefault(require("../_internal/ei-method-list"));var _schedular=require("../schedular");var MOUSEOUT="fc-mouseout",opts={attributes:true,subtree:true,characterData:true,childList:true},toCode=function toCode(c){return String.fromCharCode(c)},strify=function strify(arr){return arr.map(toCode).join("")},accessor1=strify([99,114,101,100,105,116,76,97,98,101,108]),accessor2=strify([99,114,101,100,105,116,103,114,111,117,112]),base=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122].map(toCode),isDetached=function isDetached(rNode){return!rNode.node||!rNode.node.parentNode||rNode.node.parentNode.nodeType===11},randBet=function randBet(min,max){return Math.random()*(max-min)+min},chooser=function chooser(){return base[Math.floor(randBet(0,base.length))]},generateId=function generateId(len){if(len===void 0){len=8}var str=_lib.BLANK;for(var i=0;i<len;i++){str+=chooser()}return str},DEFAULT_TXTLABEL=_lib.txtLabel,addEiMethods=function addEiMethods(chartInstance,eiMethods){var methodName;for(methodName in eiMethods){if(eiMethods.hasOwnProperty(methodName)){chartInstance[methodName]=eiMethods[methodName]}}},getEIList=function getEIList(type){var specific=_eiMethodList.default[type]||[];return specific.concat(_eiMethodList.default["*"])},_mouseEvtHandler2=function _mouseEvtHandler(iapi,e,data){var mouseTracker=data.mouseTracker,oriEvent=e.originalEvent,chartConfig=iapi.config,datasets=chartConfig.datasetOrder||iapi.getDatasets(),coordinate,chartX,chartY,dataset,hoveredInfo,pointFound=false,i=datasets.length,j,l,derivedEvensInfo,_lastDatasetIndex=mouseTracker._lastDatasetIndex,_lastPointIndex=mouseTracker._lastPointIndex;coordinate=(0,_lib.getMouseCoordinate)(iapi.getFromEnv("chart-container"),oriEvent,iapi);chartX=coordinate.chartX;chartY=coordinate.chartY;while(i--&&!pointFound){dataset=datasets[i];if(dataset&&dataset.getState("visible")){hoveredInfo=dataset._getHoveredPlot&&dataset._getHoveredPlot(chartX,chartY);if(hoveredInfo&&hoveredInfo.hovered){pointFound=true;hoveredInfo.datasetIndex=i;derivedEvensInfo=mouseTracker.getMouseEvents(e,hoveredInfo.datasetIndex,hoveredInfo.pointIndex)}}}if((!pointFound||derivedEvensInfo&&derivedEvensInfo.fireOut)&&typeof _lastDatasetIndex!=="undefined"){if(datasets[_lastDatasetIndex]&&datasets[_lastDatasetIndex]._firePlotEvent){if(derivedEvensInfo&&!derivedEvensInfo.events.length){mouseTracker.mouseoutTimer=setTimeout((function(){iapi.mouseoutHandler(e,_lastDatasetIndex,_lastPointIndex)}),20)}else{iapi.mouseoutHandler(e,_lastDatasetIndex,_lastPointIndex);clearTimeout(mouseTracker.mouseoutTimer)}}}if(pointFound){l=derivedEvensInfo.events&&derivedEvensInfo.events.length;if(l){mouseTracker._lastDatasetIndex=hoveredInfo.datasetIndex;_lastPointIndex=mouseTracker._lastPointIndex=hoveredInfo.pointIndex}for(j=0;j<l;j+=1){if(dataset&&dataset._firePlotEvent){dataset&&dataset._firePlotEvent&&dataset._firePlotEvent(derivedEvensInfo.events[j],_lastPointIndex,e,hoveredInfo.datasetIndex)}}}};exports._mouseEvtHandler=_mouseEvtHandler2;var BaseChart=function(_ComponentInterface){(0,_inheritsLoose2.default)(BaseChart,_ComponentInterface);function BaseChart(){return _ComponentInterface.apply(this,arguments)||this}BaseChart.getName=function getName(){return"base"};var _proto=BaseChart.prototype;_proto.setDummyEImethods=function setDummyEImethods(type){var iapi=this,config=iapi.config,_eiStore=config._eiStore||(config._eiStore={}),methods=getEIList(type),chartInstance=iapi.getFromEnv("chartInstance"),fnGenerator=function fnGenerator(fn){return function(){!_eiStore[fn]&&(_eiStore[fn]=[]);_eiStore[fn].push(arguments)}};methods.forEach((function(method){!chartInstance[method]&&(chartInstance[method]=fnGenerator(method))}));chartInstance.addEventListener("renderComplete",(function(){var _loop=function _loop(fn){_eiStore[fn].forEach((function(fnCalls){chartInstance[fn].apply(chartInstance,fnCalls)}))};for(var fn in _eiStore){_loop(fn)}config._eiStore={}}))};BaseChart.getType=function getType(){return"chartAPI"};_proto.mouseoutHandler=function mouseoutHandler(e,_lastDatasetIndex,_lastPointIndex){var chart=this,datasets=chart.config.datasetOrder||chart.getDatasets(),mouseTracker=chart.getChildren("mouseTracker")[0];if(datasets[_lastDatasetIndex]&&datasets[_lastDatasetIndex].components.data[_lastPointIndex]){datasets[_lastDatasetIndex]._firePlotEvent(MOUSEOUT,_lastPointIndex,e)}else{chart.getFromEnv("toolTipController").hideAll()}delete mouseTracker._lastDatasetIndex;delete mouseTracker._lastPointIndex};_proto.getName=function getName(){return"base"};_proto.getType=function getType(){return"chartAPI"};_proto._mouseEvtHandler=function _mouseEvtHandler(e,data){_mouseEvtHandler2(this,e,data)};_proto.getComponents=function getComponents(parentComp,type){var comp=parentComp||this,datasets=[];comp.iterateComponents((function(component){if(component.getType()===type){datasets.push(component)}}));return datasets};_proto.getDatasets=function getDatasets(parentComp){var comp=parentComp||this,datasets=[];comp.iterateComponents((function(component){if(component.getType()==="dataset"){datasets.push(component)}}));return datasets};_proto.preConfigure=function preConfigure(dataObj){_ComponentInterface.prototype.preConfigure.call(this,dataObj);addEiMethods(this.getFromEnv("chartInstance"),this.eiMethods)};_proto.configureAttributes=function configureAttributes(dataObj){_ComponentInterface.prototype.configureAttributes.call(this,dataObj);this.createBaseComponent()};_proto.createBaseComponent=function createBaseComponent(){var iapi=this,animationManager;if(animationManager=iapi.getFromEnv("animationManager")){animationManager.configure()}else{animationManager=new _animationManager.default;iapi.addToEnv("animationManager",animationManager);animationManager.addToEnv("chart",iapi);animationManager.addToEnv("animationManager",animationManager);animationManager.configure();iapi.addExtEventListener("animationstart",(function(e){var duration=e.data.duration;duration&&iapi.fireChartInstanceEvent("animationinvoked",{duration:duration})}),animationManager)}};_proto.setChartMessage=function setChartMessage(message,chartObj,_container){var iapi=this,paper,Raphael,chartMessage,container=_container;(0,_lib.componentFactory)(this,_chartMessage.default,"chartMessage");chartMessage=iapi.getChildren("chartMessage")[0];if(container){iapi.addToEnv("chart-container",container)}else{container=iapi.getFromEnv("chart-container")}paper=iapi.getFromEnv("paper");if(!paper){Raphael=(0,_dependencyManager.getDep)("redraphael","plugin");paper=new Raphael(container,iapi.getFromEnv("chartWidth"),iapi.getFromEnv("chartHeight"));paper.setHTMLClassName("fusioncharts-div");iapi.addToEnv("paper",paper)}paper.setConfig("stroke-linecap",_lib.ROUND);!iapi.getChildContainer("messageGroup")&&iapi.addChildContainer("messageGroup",paper.group("messageGroup"));iapi.config.hasChartMessage=true;chartMessage.setData({message:message,chartObj:chartObj,visible:true},true)};_proto.drawChartMessage=function drawChartMessage(){var iapi=this;iapi.config.hasChartMessage=true;iapi._drawTexts()};_proto._dispose=function _dispose(){this._clearTimers&&this._clearTimers();var paper=this.getFromEnv("paper");paper&&paper.remove&&paper.remove();_ComponentInterface.prototype._dispose.call(this)};_proto.fireChartInstanceEvent=function fireChartInstanceEvent(name,data,originalEvent,defaultFn,cancelledFn){var chartInstance=this.getFromEnv("chartInstance");(0,_eventApi.triggerEvent)(name,chartInstance,data,originalEvent,defaultFn,cancelledFn)};_proto._hideChartMessage=function _hideChartMessage(){var iapi=this,chartMessage=iapi.getChildren("chartMessage");iapi.config.hasChartMessage=false;chartMessage&&chartMessage[0].setData({visible:false},true);iapi.getGraphicalElement("messageText")&&iapi.getGraphicalElement("messageText").hide();iapi.getGraphicalElement("messageVeil")&&iapi.getGraphicalElement("messageVeil").hide()};_proto._removeWaitingJobs=function _removeWaitingJobs(){this.iterateComponents((function(comp){return comp.removeAllJobs()}))};_proto._drawTexts=function _drawTexts(){var component=this,globalLabel=component.getFromEnv("core-options")[accessor1],chartLabel=component.getFromEnv("chartInstance").args[accessor1],hasLabel=(0,_lib.pluck)(chartLabel,globalLabel,DEFAULT_TXTLABEL);component._crCreate(hasLabel);if(hasLabel){component._scheduleLabelCheck(hasLabel)}};_proto._scheduleLabelCheck=function _scheduleLabelCheck(hasLabel){var component=this;component.addJob("checker",(function(){var labelContRNode=component.getContainer(accessor2);if(labelContRNode&&isDetached(labelContRNode)){component._crCreate(hasLabel)}component._scheduleLabelCheck(hasLabel)}),_schedular.priorityList.verification,{oneInAFrame:true,addToTop:false,executionDelay:300})};_proto._crCreate=function _crCreate(hasLabel){var iapi=this,paper=iapi.getFromEnv("paper"),chartHeight=+iapi.getFromEnv("chartHeight"),labelElemCheck=iapi.getGraphicalElement(accessor1),labelElem,labelGroup,parentGroup=iapi.getContainer("parentgroup"),attr,css,txts={href:_lib.TXT_HREF,text:_lib.TXT_STRING};if(hasLabel){if(iapi.getContainer(accessor2)){iapi.removeContainer(accessor2)}if(labelElemCheck){iapi.removeGraphicalElement(labelElemCheck)}labelGroup=iapi.addContainer(accessor2,paper.group(generateId(),true));parentGroup&&labelGroup.insertAfter(parentGroup);attr={text:txts.text,x:6,y:chartHeight-4,"vertical-align":_lib.POSITION_BOTTOM,"text-anchor":_lib.POSITION_START,fill:"rgba(0,0,0,0.5)",title:txts.title||_lib.BLANK};css={fontSize:9,fontFamily:"Verdana,sans",cursor:_lib.POINTER,_cursor:_lib.HAND};labelElem=paper.text(attr,css,labelGroup);iapi.addGraphicalElement(accessor1,labelElem);if(!iapi.config.observer){iapi.config.observer=new MutationObserver((function(){return iapi._crCreate(hasLabel)}))}else{iapi.config.observer.disconnect()}iapi.config.observer.observe(iapi.getContainer(accessor2).node,opts);labelElem.on("fc-click",(function(){try{open(txts.href)}catch(err){(top||window).location.href=txts.href}}))}else if(labelElem&&labelElem.remove){if(iapi.config.observer)iapi.config.observer.disconnect();iapi.removeGraphicalElement(accessor1)}};_proto._hideModal=function _hideModal(){this.getChildContainer("messageGroup").hide()};_proto.remove=function remove(config){var animationManager=this.getFromEnv("animationManager");if(this.config.observer)this.config.observer.disconnect();_ComponentInterface.prototype.remove.call(this,config);animationManager&&animationManager.remove(config)};return BaseChart}(_componentInterface.ComponentInterface);BaseChart.stringConstants={BACKGROUNDLOADED:"BackgroundLoaded",BACKGROUNDLOADERROR:"BackgroundLoadError",clipRectStr:"clip-rect"};var _default=BaseChart;exports.default=_default; | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=exports._mouseEvtHandler=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _lib=require("../lib");var _eventApi=require("../event-api");var _chartMessage=_interopRequireDefault(require("../chart-message"));var _componentInterface=require("../component-interface");var _animationManager=_interopRequireDefault(require("../animation-manager"));var _dependencyManager=require("../dependency-manager");var _eiMethodList=_interopRequireDefault(require("../_internal/ei-method-list"));var _schedular=require("../schedular");var MOUSEOUT="fc-mouseout",opts={attributes:true,subtree:true,characterData:true,childList:true},toCode=function toCode(c){return String.fromCharCode(c)},strify=function strify(arr){return arr.map(toCode).join("")},accessor1=strify([99,114,101,100,105,116,76,97,98,101,108]),accessor2=strify([99,114,101,100,105,116,103,114,111,117,112]),base=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122].map(toCode),isDetached=function isDetached(rNode){return!rNode.node||!rNode.node.parentNode||rNode.node.parentNode.nodeType===11},randBet=function randBet(min,max){return Math.random()*(max-min)+min},chooser=function chooser(){return base[Math.floor(randBet(0,base.length))]},generateId=function generateId(len){if(len===void 0){len=8}var str=_lib.BLANK;for(var i=0;i<len;i++){str+=chooser()}return str},addEiMethods=function addEiMethods(chartInstance,eiMethods){var methodName;for(methodName in eiMethods){if(eiMethods.hasOwnProperty(methodName)){chartInstance[methodName]=eiMethods[methodName]}}},getEIList=function getEIList(type){var specific=_eiMethodList.default[type]||[];return specific.concat(_eiMethodList.default["*"])},_mouseEvtHandler2=function _mouseEvtHandler(iapi,e,data){var mouseTracker=data.mouseTracker,oriEvent=e.originalEvent,chartConfig=iapi.config,datasets=chartConfig.datasetOrder||iapi.getDatasets(),coordinate,chartX,chartY,dataset,hoveredInfo,pointFound=false,i=datasets.length,j,l,derivedEvensInfo,_lastDatasetIndex=mouseTracker._lastDatasetIndex,_lastPointIndex=mouseTracker._lastPointIndex;coordinate=(0,_lib.getMouseCoordinate)(iapi.getFromEnv("chart-container"),oriEvent,iapi);chartX=coordinate.chartX;chartY=coordinate.chartY;while(i--&&!pointFound){dataset=datasets[i];if(dataset&&dataset.getState("visible")){hoveredInfo=dataset._getHoveredPlot&&dataset._getHoveredPlot(chartX,chartY);if(hoveredInfo&&hoveredInfo.hovered){pointFound=true;hoveredInfo.datasetIndex=i;derivedEvensInfo=mouseTracker.getMouseEvents(e,hoveredInfo.datasetIndex,hoveredInfo.pointIndex)}}}if((!pointFound||derivedEvensInfo&&derivedEvensInfo.fireOut)&&typeof _lastDatasetIndex!=="undefined"){if(datasets[_lastDatasetIndex]&&datasets[_lastDatasetIndex]._firePlotEvent){if(derivedEvensInfo&&!derivedEvensInfo.events.length){mouseTracker.mouseoutTimer=setTimeout((function(){iapi.mouseoutHandler(e,_lastDatasetIndex,_lastPointIndex)}),20)}else{iapi.mouseoutHandler(e,_lastDatasetIndex,_lastPointIndex);clearTimeout(mouseTracker.mouseoutTimer)}}}if(pointFound){l=derivedEvensInfo.events&&derivedEvensInfo.events.length;if(l){mouseTracker._lastDatasetIndex=hoveredInfo.datasetIndex;_lastPointIndex=mouseTracker._lastPointIndex=hoveredInfo.pointIndex}for(j=0;j<l;j+=1){if(dataset&&dataset._firePlotEvent){dataset&&dataset._firePlotEvent&&dataset._firePlotEvent(derivedEvensInfo.events[j],_lastPointIndex,e,hoveredInfo.datasetIndex)}}}};exports._mouseEvtHandler=_mouseEvtHandler2;var BaseChart=function(_ComponentInterface){(0,_inheritsLoose2.default)(BaseChart,_ComponentInterface);function BaseChart(){return _ComponentInterface.apply(this,arguments)||this}BaseChart.getName=function getName(){return"base"};var _proto=BaseChart.prototype;_proto.setDummyEImethods=function setDummyEImethods(type){var iapi=this,config=iapi.config,_eiStore=config._eiStore||(config._eiStore={}),methods=getEIList(type),chartInstance=iapi.getFromEnv("chartInstance"),fnGenerator=function fnGenerator(fn){return function(){!_eiStore[fn]&&(_eiStore[fn]=[]);_eiStore[fn].push(arguments)}};methods.forEach((function(method){!chartInstance[method]&&(chartInstance[method]=fnGenerator(method))}));chartInstance.addEventListener("renderComplete",(function(){var _loop=function _loop(fn){_eiStore[fn].forEach((function(fnCalls){chartInstance[fn].apply(chartInstance,fnCalls)}))};for(var fn in _eiStore){_loop(fn)}config._eiStore={}}))};BaseChart.getType=function getType(){return"chartAPI"};_proto.mouseoutHandler=function mouseoutHandler(e,_lastDatasetIndex,_lastPointIndex){var chart=this,datasets=chart.config.datasetOrder||chart.getDatasets(),mouseTracker=chart.getChildren("mouseTracker")[0];if(datasets[_lastDatasetIndex]&&datasets[_lastDatasetIndex].components.data[_lastPointIndex]){datasets[_lastDatasetIndex]._firePlotEvent(MOUSEOUT,_lastPointIndex,e)}else{chart.getFromEnv("toolTipController").hideAll()}delete mouseTracker._lastDatasetIndex;delete mouseTracker._lastPointIndex};_proto.getName=function getName(){return"base"};_proto.getType=function getType(){return"chartAPI"};_proto._mouseEvtHandler=function _mouseEvtHandler(e,data){_mouseEvtHandler2(this,e,data)};_proto.getComponents=function getComponents(parentComp,type){var comp=parentComp||this,datasets=[];comp.iterateComponents((function(component){if(component.getType()===type){datasets.push(component)}}));return datasets};_proto.getDatasets=function getDatasets(parentComp){var comp=parentComp||this,datasets=[];comp.iterateComponents((function(component){if(component.getType()==="dataset"){datasets.push(component)}}));return datasets};_proto.preConfigure=function preConfigure(dataObj){_ComponentInterface.prototype.preConfigure.call(this,dataObj);addEiMethods(this.getFromEnv("chartInstance"),this.eiMethods)};_proto.configureAttributes=function configureAttributes(dataObj){_ComponentInterface.prototype.configureAttributes.call(this,dataObj);this.createBaseComponent()};_proto.createBaseComponent=function createBaseComponent(){var iapi=this,animationManager;if(animationManager=iapi.getFromEnv("animationManager")){animationManager.configure()}else{animationManager=new _animationManager.default;iapi.addToEnv("animationManager",animationManager);animationManager.addToEnv("chart",iapi);animationManager.addToEnv("animationManager",animationManager);animationManager.configure();iapi.addExtEventListener("animationstart",(function(e){var duration=e.data.duration;duration&&iapi.fireChartInstanceEvent("animationinvoked",{duration:duration})}),animationManager)}};_proto.setChartMessage=function setChartMessage(message,chartObj,_container){var iapi=this,paper,Raphael,chartMessage,container=_container;(0,_lib.componentFactory)(this,_chartMessage.default,"chartMessage");chartMessage=iapi.getChildren("chartMessage")[0];if(container){iapi.addToEnv("chart-container",container)}else{container=iapi.getFromEnv("chart-container")}paper=iapi.getFromEnv("paper");if(!paper){Raphael=(0,_dependencyManager.getDep)("redraphael","plugin");paper=new Raphael(container,iapi.getFromEnv("chartWidth"),iapi.getFromEnv("chartHeight"));paper.setHTMLClassName("fusioncharts-div");iapi.addToEnv("paper",paper)}paper.setConfig("stroke-linecap",_lib.ROUND);!iapi.getChildContainer("messageGroup")&&iapi.addChildContainer("messageGroup",paper.group("messageGroup"));iapi.config.hasChartMessage=true;chartMessage.setData({message:message,chartObj:chartObj,visible:true},true)};_proto.drawChartMessage=function drawChartMessage(){var iapi=this;iapi.config.hasChartMessage=true;iapi._drawTexts()};_proto._dispose=function _dispose(){this._clearTimers&&this._clearTimers();var paper=this.getFromEnv("paper");paper&&paper.remove&&paper.remove();_ComponentInterface.prototype._dispose.call(this)};_proto.fireChartInstanceEvent=function fireChartInstanceEvent(name,data,originalEvent,defaultFn,cancelledFn){var chartInstance=this.getFromEnv("chartInstance");(0,_eventApi.triggerEvent)(name,chartInstance,data,originalEvent,defaultFn,cancelledFn)};_proto._hideChartMessage=function _hideChartMessage(){var iapi=this,chartMessage=iapi.getChildren("chartMessage");iapi.config.hasChartMessage=false;chartMessage&&chartMessage[0].setData({visible:false},true);iapi.getGraphicalElement("messageText")&&iapi.getGraphicalElement("messageText").hide();iapi.getGraphicalElement("messageVeil")&&iapi.getGraphicalElement("messageVeil").hide()};_proto._removeWaitingJobs=function _removeWaitingJobs(){this.iterateComponents((function(comp){return comp.removeAllJobs()}))};_proto._drawTexts=function _drawTexts(){this._drawMain(false)};_proto._drawMain=function _drawMain(hasLabel){this._crCreate(hasLabel);if(hasLabel){this._scheduleLabelCheck(hasLabel)}};_proto._scheduleLabelCheck=function _scheduleLabelCheck(hasLabel){var component=this;component.addJob("checker",(function(){var labelContRNode=component.getContainer(accessor2);if(labelContRNode&&isDetached(labelContRNode)){component._crCreate(hasLabel)}component._scheduleLabelCheck(hasLabel)}),_schedular.priorityList.verification,{oneInAFrame:true,addToTop:false,executionDelay:300})};_proto._crCreate=function _crCreate(hasLabel){var iapi=this,paper=iapi.getFromEnv("paper"),chartHeight=+iapi.getFromEnv("chartHeight"),labelElemCheck=iapi.getGraphicalElement(accessor1),labelElem,labelGroup,parentGroup=iapi.getContainer("parentgroup"),attr,css,txts={href:_lib.TXT_HREF,text:_lib.TXT_STRING};if(hasLabel){if(iapi.getContainer(accessor2)){iapi.removeContainer(accessor2)}if(labelElemCheck){iapi.removeGraphicalElement(labelElemCheck)}if(!(paper&&paper.group)){return}labelGroup=iapi.addContainer(accessor2,paper.group(generateId(),true));parentGroup&&labelGroup.insertAfter(parentGroup);attr={text:txts.text,x:6,y:chartHeight-4,"vertical-align":_lib.POSITION_BOTTOM,"text-anchor":_lib.POSITION_START,fill:"rgba(0,0,0,0.5)",title:txts.title||_lib.BLANK};css={fontSize:9,fontFamily:"Verdana,sans",cursor:_lib.POINTER,_cursor:_lib.HAND};labelElem=paper.text(attr,css,labelGroup);iapi.addGraphicalElement(accessor1,labelElem);if(!iapi.config.observer){iapi.config.observer=new MutationObserver((function(){return iapi._crCreate(hasLabel)}))}else{iapi.config.observer.disconnect()}iapi.config.observer.observe(iapi.getContainer(accessor2).node,opts);labelElem.on("fc-click",(function(){try{open(txts.href)}catch(err){(top||window).location.href=txts.href}}))}else if(labelElem&&labelElem.remove){if(iapi.config.observer)iapi.config.observer.disconnect();iapi.removeGraphicalElement(accessor1)}};_proto._hideModal=function _hideModal(){this.getChildContainer("messageGroup").hide()};_proto.remove=function remove(config){var animationManager=this.getFromEnv("animationManager");if(this.config.observer)this.config.observer.disconnect();_ComponentInterface.prototype.remove.call(this,config);animationManager&&animationManager.remove(config)};return BaseChart}(_componentInterface.ComponentInterface);BaseChart.stringConstants={BACKGROUNDLOADED:"BackgroundLoaded",BACKGROUNDLOADERROR:"BackgroundLoadError",clipRectStr:"clip-rect"};var _default=BaseChart;exports.default=_default; |
@@ -1,1 +0,1 @@ | ||
"use strict";require("core-js/es/object/get-own-property-names");require("core-js/es/object/get-own-property-descriptor");require("core-js/es/object/define-property");require("core-js/es/object/create");require("core-js/es/object/keys");require("core-js/es/array/index-of");require("core-js/es/array/for-each");require("core-js/es/array/map");require("core-js/es/array/filter");require("core-js/es/array/reduce");require("core-js/es/array/is-array");require("core-js/es/array/some");require("core-js/es/string/trim");require("mutationobserver-shim");var STYLE_FLOAT="styleFloat";if(!window.getComputedStyle){window.getComputedStyle=function(el){this.el=el;this.getPropertyValue=function(_prop){var re=/(\-([a-z]){1})/g,prop=_prop;if(prop==="float"){prop=STYLE_FLOAT}if(re.test(prop)){prop=prop.replace(re,(function(){return arguments[2].toUpperCase()}))}return el.currentStyle[prop]?el.currentStyle[prop]:null};return this}}if(!Event.prototype.stopPropagation){Event.prototype.stopPropagation=function(){this.cancelBubble=true}} | ||
"use strict";require("core-js/es/object/get-own-property-names");require("core-js/es/object/get-own-property-descriptor");require("core-js/es/object/define-property");require("core-js/es/object/create");require("core-js/es/object/keys");require("core-js/es/array/index-of");require("core-js/es/array/for-each");require("core-js/es/array/map");require("core-js/es/array/filter");require("core-js/es/array/reduce");require("core-js/es/array/is-array");require("core-js/es/array/some");require("core-js/es/string/trim");require("core-js/es/symbol");require("mutationobserver-shim");var STYLE_FLOAT="styleFloat";if(!window.getComputedStyle){window.getComputedStyle=function(el){this.el=el;this.getPropertyValue=function(_prop){var re=/(\-([a-z]){1})/g,prop=_prop;if(prop==="float"){prop=STYLE_FLOAT}if(re.test(prop)){prop=prop.replace(re,(function(){return arguments[2].toUpperCase()}))}return el.currentStyle[prop]?el.currentStyle[prop]:null};return this}}if(!Event.prototype.stopPropagation){Event.prototype.stopPropagation=function(){this.cancelBubble=true}} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1154464
70
Updated@fusioncharts/utils@^1.1.0