@fusioncharts/core
Advanced tools
Comparing version 1.8.1 to 1.9.0-rc.1
{ | ||
"name": "@fusioncharts/core", | ||
"version": "1.8.1", | ||
"version": "1.9.0-rc.1", | ||
"description": "JavaScript Data Visualisation Library", | ||
@@ -26,3 +26,3 @@ "author": "FusionCharts, Inc. <support@fusioncharts.com>", | ||
"@babel/runtime": "^7.9.2", | ||
"@fusioncharts/utils": "^1.8.1", | ||
"@fusioncharts/utils": "^1.9.0-rc.1", | ||
"core-js": "^3.0.1", | ||
@@ -47,3 +47,3 @@ "ramda": "^0.29.0" | ||
], | ||
"gitHead": "6a584261d409148c14da0a112dfdfc4a84f91832" | ||
"gitHead": "aa80fce12db617a77d78a25584fe7503be8555ee" | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";exports.__esModule=true;exports.default=_default;exports.cacher=exports.showRecursively=exports.loadRefImage=exports.dashedAttr2CSSMap=exports.getArrayCopy=exports.merge=void 0;var UNDEF,BLANK="__blank",nullStr="␀",E="",arrayToStr="[object Array]",objectToStr="[object Object]",objectStr="object",isFirefox=/Firefox/i.test(window.navigator.userAgent),dashedAttr2CSSMap={"font-family":"fontFamily","font-size":"fontSize","text-anchor":"textAnchor","font-weight":"fontWeight","letter-spacing":"letterSpacing","font-style":"fontStyle"},loadRefImage=function loadRefImage(element,attrs){var src=attrs.src,RefImg=element._.RefImg;if(!RefImg){RefImg=element._.RefImg=new Image}if(attrs.src===undefined){return}RefImg.src=src;element._.RefImg=RefImg},showRecursively=function showRecursively(el){var origAttrTree={},currentEl=el,currentNode=origAttrTree,fn=function fn(){var localEl=el,localNode=origAttrTree;while(localEl){if(localNode._doHide){localEl.hide()}localEl=localEl.parent;localNode=localNode.parent}};while(currentEl){if(currentEl.node&¤tEl.node.style&¤tEl.node.style.display==="none"){currentEl.show();currentNode._doHide=true}currentEl=currentEl.parent;currentNode.parent={};currentNode=currentNode.parent}return fn},checkCyclicRef=function checkCyclicRef(obj,parentArr){var i=parentArr.length,bIndex=-1;while(i--){if(obj===parentArr[i]){bIndex=i;return bIndex}}return bIndex},getArrayCopy=function getArrayCopy(array){var i,len,arg;for(i=0,len=array.length,arg=new Array(len);i<len;i++){arg[i]=array[i]}return arg},merge=function merge(obj1,obj2,skipUndef,tgtArr,srcArr){var item,srcVal,tgtVal,str,cRef;if(!srcArr){tgtArr=[obj1];srcArr=[obj2]}else{tgtArr.push(obj1);srcArr.push(obj2)}if(obj2 instanceof Array){for(item=0;item<obj2.length;item+=1){try{srcVal=obj1[item];tgtVal=obj2[item]}catch(e){continue}if(typeof tgtVal!==objectStr){if(!(skipUndef&&tgtVal===UNDEF)){obj1[item]=tgtVal}}else{if(srcVal===null||typeof srcVal!==objectStr){srcVal=obj1[item]=tgtVal instanceof Array?[]:{}}cRef=checkCyclicRef(tgtVal,srcArr);if(cRef!==-1){srcVal=obj1[item]=tgtArr[cRef]}else{merge(srcVal,tgtVal,skipUndef,tgtArr,srcArr)}}}}else{for(item in obj2){try{srcVal=obj1[item];tgtVal=obj2[item]}catch(e){continue}if(tgtVal!==null&&typeof tgtVal===objectStr){str=Object.prototype.toString.call(tgtVal);if(str===objectToStr){if(srcVal===null||typeof srcVal!==objectStr){srcVal=obj1[item]={}}cRef=checkCyclicRef(tgtVal,srcArr);if(cRef!==-1){srcVal=obj1[item]=tgtArr[cRef]}else{merge(srcVal,tgtVal,skipUndef,tgtArr,srcArr)}}else if(str===arrayToStr){if(srcVal===null||!(srcVal instanceof Array)){srcVal=obj1[item]=[]}cRef=checkCyclicRef(tgtVal,srcArr);if(cRef!==-1){srcVal=obj1[item]=tgtArr[cRef]}else{merge(srcVal,tgtVal,skipUndef,tgtArr,srcArr)}}else{obj1[item]=tgtVal}}else{obj1[item]=tgtVal}}}return obj1};exports.merge=merge;exports.getArrayCopy=getArrayCopy;exports.showRecursively=showRecursively;exports.loadRefImage=loadRefImage;exports.dashedAttr2CSSMap=dashedAttr2CSSMap;function _default(obj1,obj2,skipUndef,shallow){var item;if(typeof obj1!==objectStr&&typeof obj2!==objectStr){return null}if(typeof obj2!==objectStr||obj2===null){return obj1}if(typeof obj1==="undefined"){obj1=obj2 instanceof Array?[]:{}}if(shallow){for(item in obj2){obj1[item]=obj2[item]}}else{merge(obj1,obj2,skipUndef)}return obj1}var cacher=function cacher(f,scope,postprocessor,key,maxCache,sharedCache,firstArgKey){var cache=sharedCache||{},count=0;if(cache.__start===undefined){cache.__start=null}if(cache.__end===undefined){cache.__end=null}maxCache=maxCache||1e3;key=key||"item";function cachedfunction(arg1){var hashKey=firstArgKey?arg1:getArrayCopy(arguments).join(nullStr),cur,oldEnd,oldStart;hashKey=hashKey===E?BLANK:hashKey;cur=cache[hashKey];if(!cur){cur=cache[hashKey]={};f&&(cache[hashKey][key]=postprocessor?postprocessor(f.apply(scope,arguments)):f.apply(scope,arguments));cache.__end===null&&(cache.__end=hashKey);count++;if(count>maxCache&&cache.__end){oldEnd=cache[cache.__end];cache[oldEnd.__prev].__next=null;delete cache[cache.__end];cache.__end=oldEnd.__prev;count--}}else{if(cur.__prev){cache[cur.__prev].__next=cur.__next;if(cur.__next){cur.__next.__prev=cur.__prev}else{cache.__end=cur.__prev}}}oldStart=cache.__start;if(oldStart!==cur){cur.__prev=null;cur.__next=oldStart;oldStart&&(oldStart.__prev=hashKey);cache.__start=cur}return cache[hashKey][key]}return cachedfunction};exports.cacher=cacher; | ||
"use strict";exports.__esModule=true;exports.default=_default;exports.isFirefox=exports.cacher=exports.showRecursively=exports.loadRefImage=exports.dashedAttr2CSSMap=exports.getArrayCopy=exports.merge=void 0;var UNDEF,BLANK="__blank",nullStr="␀",E="",arrayToStr="[object Array]",objectToStr="[object Object]",objectStr="object",isFirefox=/Firefox/i.test(window.navigator.userAgent),dashedAttr2CSSMap={"font-family":"fontFamily","font-size":"fontSize","text-anchor":"textAnchor","font-weight":"fontWeight","letter-spacing":"letterSpacing","font-style":"fontStyle"},loadRefImage=function loadRefImage(element,attrs){var src=attrs.src,RefImg=element._.RefImg;if(!RefImg){RefImg=element._.RefImg=new Image}if(attrs.src===undefined){return}RefImg.src=src;element._.RefImg=RefImg},showRecursively=function showRecursively(el){var origAttrTree={},currentEl=el,currentNode=origAttrTree,fn=function fn(){var localEl=el,localNode=origAttrTree;while(localEl){if(localNode._doHide){localEl.hide()}localEl=localEl.parent;localNode=localNode.parent}};while(currentEl){if(currentEl.node&¤tEl.node.style&¤tEl.node.style.display==="none"){currentEl.show();currentNode._doHide=true}currentEl=currentEl.parent;currentNode.parent={};currentNode=currentNode.parent}return fn},checkCyclicRef=function checkCyclicRef(obj,parentArr){var i=parentArr.length,bIndex=-1;while(i--){if(obj===parentArr[i]){bIndex=i;return bIndex}}return bIndex},getArrayCopy=function getArrayCopy(array){var i,len,arg;for(i=0,len=array.length,arg=new Array(len);i<len;i++){arg[i]=array[i]}return arg},merge=function merge(obj1,obj2,skipUndef,tgtArr,srcArr){var item,srcVal,tgtVal,str,cRef;if(!srcArr){tgtArr=[obj1];srcArr=[obj2]}else{tgtArr.push(obj1);srcArr.push(obj2)}if(obj2 instanceof Array){for(item=0;item<obj2.length;item+=1){try{srcVal=obj1[item];tgtVal=obj2[item]}catch(e){continue}if(typeof tgtVal!==objectStr){if(!(skipUndef&&tgtVal===UNDEF)){obj1[item]=tgtVal}}else{if(srcVal===null||typeof srcVal!==objectStr){srcVal=obj1[item]=tgtVal instanceof Array?[]:{}}cRef=checkCyclicRef(tgtVal,srcArr);if(cRef!==-1){srcVal=obj1[item]=tgtArr[cRef]}else{merge(srcVal,tgtVal,skipUndef,tgtArr,srcArr)}}}}else{for(item in obj2){try{srcVal=obj1[item];tgtVal=obj2[item]}catch(e){continue}if(tgtVal!==null&&typeof tgtVal===objectStr){str=Object.prototype.toString.call(tgtVal);if(str===objectToStr){if(srcVal===null||typeof srcVal!==objectStr){srcVal=obj1[item]={}}cRef=checkCyclicRef(tgtVal,srcArr);if(cRef!==-1){srcVal=obj1[item]=tgtArr[cRef]}else{merge(srcVal,tgtVal,skipUndef,tgtArr,srcArr)}}else if(str===arrayToStr){if(srcVal===null||!(srcVal instanceof Array)){srcVal=obj1[item]=[]}cRef=checkCyclicRef(tgtVal,srcArr);if(cRef!==-1){srcVal=obj1[item]=tgtArr[cRef]}else{merge(srcVal,tgtVal,skipUndef,tgtArr,srcArr)}}else{obj1[item]=tgtVal}}else{obj1[item]=tgtVal}}}return obj1};exports.merge=merge;exports.getArrayCopy=getArrayCopy;exports.showRecursively=showRecursively;exports.loadRefImage=loadRefImage;exports.dashedAttr2CSSMap=dashedAttr2CSSMap;exports.isFirefox=isFirefox;function _default(obj1,obj2,skipUndef,shallow){var item;if(typeof obj1!==objectStr&&typeof obj2!==objectStr){return null}if(typeof obj2!==objectStr||obj2===null){return obj1}if(typeof obj1==="undefined"){obj1=obj2 instanceof Array?[]:{}}if(shallow){for(item in obj2){obj1[item]=obj2[item]}}else{merge(obj1,obj2,skipUndef)}return obj1}var cacher=function cacher(f,scope,postprocessor,key,maxCache,sharedCache,firstArgKey){var cache=sharedCache||{},count=0;if(cache.__start===undefined){cache.__start=null}if(cache.__end===undefined){cache.__end=null}maxCache=maxCache||1e3;key=key||"item";function cachedfunction(arg1){var hashKey=firstArgKey?arg1:getArrayCopy(arguments).join(nullStr),cur,oldEnd,oldStart;hashKey=hashKey===E?BLANK:hashKey;cur=cache[hashKey];if(!cur){cur=cache[hashKey]={};f&&(cache[hashKey][key]=postprocessor?postprocessor(f.apply(scope,arguments)):f.apply(scope,arguments));cache.__end===null&&(cache.__end=hashKey);count++;if(count>maxCache&&cache.__end){oldEnd=cache[cache.__end];cache[oldEnd.__prev].__next=null;delete cache[cache.__end];cache.__end=oldEnd.__prev;count--}}else{if(cur.__prev){cache[cur.__prev].__next=cur.__next;if(cur.__next){cur.__next.__prev=cur.__prev}else{cache.__end=cur.__prev}}}oldStart=cache.__start;if(oldStart!==cur){cur.__prev=null;cur.__next=oldStart;oldStart&&(oldStart.__prev=hashKey);cache.__start=cur}return cache[hashKey][key]}return cachedfunction};exports.cacher=cacher; |
@@ -1,1 +0,1 @@ | ||
"use strict";exports.__esModule=true;exports.default=_default;var _raphael=require("./raphael.lib");function _default(R){if(R.svg){var has="hasOwnProperty",tSpanStr="tspan",vAlignStr="vertical-align",lineHeightStr="line-height",fontSizeStr="font-size",imageStr="image",noneStr="none",notToTuneStr="_do-not-tune",textStr="text",textPathStr="textpath",rtlStr="rtl",hasSup=false,hasSub=false,arrayStr="array",middleStr="middle",bottomStr="bottom",topStr="top",pxStr="px",initialStr="initial",fnStr="function",brStr="<br>",hiddenStr="hidden",visibleStr="visible",objectStr="object",fillStr="fill",transformStr="transform",visibilityStr="visibility",IESplTspanAttr={visibility:hiddenStr,"font-size":"0px"},Str=String,VERTICAL="vertical",HORIZONTAL="horizontal",PRESERVESTRING="pre",BLANKSTRING="",toFloat=parseFloat,toInt=parseInt,vAlignMultiplier={top:0,bottom:-1,middle:-.5},win=R._g.win,navigator=win.navigator,isIE=false||!!document.documentMode,math=Math,UNDEF,mmax=math.max,abs=math.abs,pow=math.pow,sqrt=math.sqrt,xlinkRegx=/^xlink:/,separator=/[, ]+/,textBreakRegx=/\n|<br\s*?\/?>/i,ltgtbrRegex=/<|>|"|'|"|<br/i,nbspRegex=/ | | /g,arrayShift=Array.prototype.shift,zeroStrokeFix=!!(/AppleWebKit/.test(navigator.userAgent)&&(!/Chrome/.test(navigator.userAgent)||navigator.appVersion.match(/Chrome\/(\d+)\./)[1]<29)),eve=R.eve,E="",S=" ",xlink="http://www.w3.org/1999/xlink",svgNSStr="http://www.w3.org/2000/svg",isIpad=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),typeStringSTR="string",markers={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},shapeRenderingAttrs={speed:"optimizeSpeed",crisp:"crispEdges",precision:"geometricPrecision"},nav=navigator.userAgent.toLowerCase(),isIE9=function(){var verIE=nav.indexOf("msie")!=-1?parseInt(nav.split("msie")[1]):false;if(verIE&&verIE===9){return true}else{return false}}(),supportsPointer=R.supportsPointer,supportsTouch=R.supportsTouch,markerCounter={},preLoad=function preLoad(elem,ig,isURL,paper){R._preload(isURL[1],(function(){var w=this.offsetWidth,h=this.offsetHeight;$(elem,{width:w,height:h});$(ig,{width:w,height:h});paper.safari()}))},quickExtend=function quickExtend(obj1,obj2){if(obj2){for(var key in obj2){obj1[key]=obj2[key]}}},lastHoveredInfo={elementInfo:[]},doc=R._g.doc,win=R._g.win,safeMouseEventMapping={mouseover:"touchstart",mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove",mouseout:"touchend"},createValidTextNode=function createValidTextNode(text,abbrArr){var underlineRegex=/<under>/g,underlineEndRegex=/<\/under>/g,boldRegex=/<bold>/g,boldEndRegex=/<\/bold>/g,emphasisRegex=/<em>/g,emphasisEndRegex=/<\/em>/g,strikeRegex=/<strike>/g,strikeEndRegex=/<\/strike>/g,subscriptRegex=/<sub>/g,subscriptEndRegex=/<\/sub>/g,superscriptRegex=/<sup>/g,superscriptEndRegex=/<\/sup>/g,abbrRegex=/<abbr[\s]+([^>]+)>/g,abbrEndRegex=/<\/abbr>/g,spanRegex=/<span[\s]+([^>]+)>/g,spanEndRegex=/<\/span>/g,anchorRegex=/<a[\s]+([^>]+)>/g,anchorEndRegex=/<\/a>/g,lastAttrList=[],index,subtext,tspanArray=[],startIndex=0,sortedIndices,underlinetagIndices=getTagIndices(underlineRegex,underlineEndRegex,text,"<under>","</under>"),boldtagIndices=getTagIndices(boldRegex,boldEndRegex,text,"<bold>","</bold>"),emtagIndices=getTagIndices(emphasisRegex,emphasisEndRegex,text,"<em>","</em>"),strikeTagIndices=getTagIndices(strikeRegex,strikeEndRegex,text,"<strike>","</strike>"),subscriptTagIndices=getTagIndices(subscriptRegex,subscriptEndRegex,text,"<sub>","</sub>"),superscriptTagIndices=getTagIndices(superscriptRegex,superscriptEndRegex,text,"<sup>","</sup>"),abbrTagIndices=getAbbrTagIndices(abbrRegex,abbrEndRegex,text,"<abbr>","</abbr>"),anchorTagIndices=getAnchorTagIndices(anchorRegex,anchorEndRegex,text,"<a>","</a>"),spanTagIndices=getSpanTagIndices(spanRegex,spanEndRegex,text,"<span>","</span>"),sortedIndices=sortTags(underlinetagIndices,boldtagIndices,emtagIndices,strikeTagIndices,subscriptTagIndices,superscriptTagIndices,abbrTagIndices,anchorTagIndices,spanTagIndices);if(sortedIndices.length){if(sortedIndices[0].index>startIndex){subtext=text.substring(startIndex,sortedIndices[0].index);tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,abbrArr,sortedIndices);startIndex=sortedIndices[0].index+sortedIndices[0].tagName.length}for(index=0;index<sortedIndices.length;index++){if(sortedIndices[index+1]!==UNDEF){lastAttrList=createAttrList(lastAttrList,sortedIndices[index]);if(startIndex===0&&sortedIndices[index].index===0){subtext=text.substring(startIndex+sortedIndices[index].tagName.length,sortedIndices[index+1].index)}else{subtext=text.substring(startIndex,sortedIndices[index+1].index)}tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,sortedIndices[index],abbrArr,sortedIndices);startIndex=sortedIndices[index+1].index+sortedIndices[index+1].tagName.length}}if(startIndex<text.length){subtext=text.substring(startIndex,text.length);tspanArray=createtspanArray(tspanArray,subtext,[],abbrArr,sortedIndices)}}return tspanArray},tagHash={"<bold>":{action:"add",tagAttr:"font-weight",tagAttrVal:"bold"},"</bold>":{action:"remove",actionTag:"<bold>"},"<under>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</under>":{action:"remove",actionTag:"<under>"},"<em>":{action:"add",tagAttr:"font-style",tagAttrVal:"italic"},"</em>":{action:"remove",actionTag:"<em>"},"<strike>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"line-through"},"</strike>":{action:"remove",actionTag:"<strike>"},"<sub>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"sub"},"</sub>":{action:"remove",actionTag:"<sub>"},"<sup>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"super"},"</sup>":{action:"remove",actionTag:"<sup>"},"<abbr>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</abbr>":{action:"remove",actionTag:"<abbr>"},"<a>":{action:"add"},"</a>":{action:"remove",actionTag:"<a>"},"<span>":{action:"add"},"</span>":{action:"remove",actionTag:"<span>"}},createAttrList=function createAttrList(attrArr,sortedIndex){var i,abbrReg=/<abbr[\s]+([^>]+)>/g,anchorReg=/<a[\s]+([^>]+)>/g,spanReg=/<span[\s]+([^>]+)>/g,obj;if(sortedIndex.tagName.match(abbrReg)){obj=MergeRecursive({tag:"<abbr>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(anchorReg)){obj=MergeRecursive({tag:"<a>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(spanReg)){obj=MergeRecursive({tag:"<span>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="add"){obj=MergeRecursive({tag:sortedIndex.tagName,sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="remove"){for(i=attrArr.length-1;i>=0;i--){if(attrArr[i].tag===tagHash[sortedIndex.tagName].actionTag){attrArr.splice(i,1);break}}}return attrArr},createtspanArray=function createtspanArray(tspanArray,str,lastAttr,indicesObj,abbrArr,sortedIndices){var textNode=R._g.doc.createTextNode(str),obj={},hasAnchor=false,hasAbbr=false,hasSpan=false,title="",style,anchor,tspan,i,j;if(isIE||_raphael.isFirefox){if(hasSub){obj["dy"]=-6;hasSub=false}if(hasSup){obj["dy"]=6;hasSup=false}}if(!lastAttr.length){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}else{for(i=0;i<lastAttr.length;i++){if(lastAttr[i].tag==="<abbr>"){hasAbbr=true;title=lastAttr[i].sortedIndex.title}else if(lastAttr[i].tag==="<a>"){hasAnchor=true;if(lastAttr[i].href!==""){obj["href"]=lastAttr[i].sortedIndex.href}if(indicesObj.target!==""){obj["target"]=lastAttr[i].sortedIndex.target}if(indicesObj.hreflang!==""){obj["hreflang"]=lastAttr[i].sortedIndex.hreflang}if(indicesObj.referrerpolicy!==""){obj["referrerpolicy"]=lastAttr[i].sortedIndex.referrerpolicy}if(indicesObj.rel!==""){obj["rel"]=lastAttr[i].sortedIndex.rel}anchor=$("a",obj)}else if(lastAttr[i].tag==="<span>"){hasSpan=true;style=lastAttr[i].sortedIndex.style}if(tagHash[lastAttr[i].tag].tagAttr&&tagHash[lastAttr[i].tag].tagAttrVal){if(isIE||_raphael.isFirefox){if(lastAttr[i].tag==="<sup>"){obj["dy"]=-6;hasSup=true}else if(lastAttr[i].tag==="<sub>"){obj["dy"]=6;hasSub=true}}obj[tagHash[lastAttr[i].tag].tagAttr]=tagHash[lastAttr[i].tag].tagAttrVal}}if(hasAnchor){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);anchor.appendChild(tspan);tspanArray.push(anchor);hasAnchor=false}}else if(hasAbbr){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);abbrArr.push({tspan:tspan,title:title});tspanArray.push(tspan)}}else if(hasSpan){if(str!==""){obj=MergeRecursive(obj,style);tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}else{if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}}return tspanArray},MergeRecursive=function MergeRecursive(obj1,obj2){for(var p in obj2){try{if(obj2[p].constructor==Object){obj1[p]=MergeRecursive(obj1[p],obj2[p])}else{obj1[p]=obj2[p]}}catch(e){obj1[p]=obj2[p]}}return obj1},sortTags=function sortTags(u,b,em,strike,sub,sup,abbr,a,sp){var i,j,tagArr=[u,b,em,strike,sub,sup,abbr,a,sp],res=[];for(j=0;j<tagArr.length;j++){for(var key in tagArr[j]){if(tagArr[j][key].length){for(i=0;i<tagArr[j][key].length;i++){res.push(tagArr[j][key][i])}}}}res=res.sort((function(a,b){return a.index-b.index}));return res},getAbbrTagIndices=function getAbbrTagIndices(abbrRegex,abbrEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,title,endtagindices=[];while(result=abbrRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</abbr>";dummyNode.innerHTML=testAbbr;title=dummyNode.childNodes[0]?dummyNode.childNodes[0].title:"";tagindices.push({tagName:result[0],index:result.index,title:title?title:""})}while(result=abbrEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getStyles=function getStyles(el){var output={};if(!el||!el.style||!el.style.cssText){return output}var camelize=function camelize(str){return str.replace(/(?:^|[-])(\w)/g,(function(a,c){c=a.substr(0,1)==="-"?c.toUpperCase():c;return c?c:""}))};var style=el.style.cssText.split(";");for(var i=0;i<style.length;++i){var rule=style[i].trim();if(rule){var ruleParts=rule.split(":");var key=camelize(ruleParts[0].trim());output[key]=ruleParts[1].trim()}}return output},getSpanTagIndices=function getSpanTagIndices(spanRegex,spanEndRegex,text,tagText,endtagText){var tagindices=[],result,dummySpan,testSpan,styleObj,endtagindices=[];while(result=spanRegex.exec(text)){dummySpan=document.createElement("p");testSpan=result[0]+"Dummy</span>";dummySpan.innerHTML=testSpan;styleObj=getStyles(dummySpan.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:""})}while(result=spanEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},isUrlValid=function isUrlValid(userInput){var res=userInput.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&=]*)/g);if(!res)return false;else return true},getAnchorTagIndices=function getAnchorTagIndices(anchorRegex,anchorEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyAnchor,testAnchor,isValidHref,endtagindices=[];while(result=anchorRegex.exec(text)){dummyAnchor=document.createElement("p");testAnchor=result[0]+"</a>";dummyAnchor.innerHTML=testAnchor;isValidHref=isUrlValid(encodeURIComponent(dummyAnchor.childNodes[0].href));tagindices.push({tagName:result[0],index:result.index,href:isValidHref?dummyAnchor.childNodes[0].href:"",target:dummyAnchor.childNodes[0].target?dummyAnchor.childNodes[0].target:"",hreflang:dummyAnchor.childNodes[0].hreflang?dummyAnchor.childNodes[0].hreflang:"",referrerpolicy:dummyAnchor.childNodes[0].referrerpolicy?dummyAnchor.childNodes[0].referrerpolicy:"",rel:dummyAnchor.childNodes[0].rel?dummyAnchor.childNodes[0].rel:""})}while(result=anchorEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getTagIndices=function getTagIndices(tagRegex,endTagRegex,text,tagText,endtagText){var tagindices=[],result,endtagindices=[];while(result=tagRegex.exec(text)){tagindices.push({tagName:tagText,index:result.index})}while(result=endTagRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},allPossibleAttrs={"accent-height":true,accumulate:true,additive:true,"alignment-baseline":true,alphabetic:true,amplitude:true,"arabic-form":true,ascent:true,azimuth:true,"baseline-shift":true,bbox:true,begin:true,bias:true,by:true,"cap-height":true,class:true,clip:true,"clip-path":true,"clip-rule":true,color:true,"color-interpolation":true,"color-interpolation-filters":true,"color-profile":true,"color-rendering":true,cursor:true,cx:true,cy:true,d:true,decelerate:true,descent:true,direction:true,display:true,divisor:true,"dominant-baseline":true,dur:true,dx:true,dy:true,elevation:true,"enable-background":true,end:true,exponent:true,fill:true,"fill-opacity":true,"fill-rule":true,filter:true,"flood-color":true,"flood-opacity":true,"font-family":true,"font-size":true,"font-size-adjust":true,"font-stretch":true,"font-style":true,"font-variant":true,"font-weight":true,format:true,fr:true,from:true,fx:true,fy:true,g1:true,g2:true,"glyph-name":true,"glyph-orientation-horizontal":true,"glyph-orientation-vertical":true,hanging:true,height:true,"horiz-adv-x":true,"horiz-origin-x":true,href:true,hreflang:true,id:true,ideographic:true,"image-rendering":true,in2:true,in:true,intercept:true,k1:true,k2:true,k3:true,k4:true,k:true,kerning:true,lang:true,"letter-spacing":true,"lighting-color":true,local:true,"marker-end":true,"marker-mid":true,"marker-start":true,mask:true,mathematical:true,max:true,media:true,method:true,min:true,mode:true,name:true,offset:true,opacity:true,operator:true,order:true,orient:true,orientation:true,origin:true,overflow:true,"overline-position":true,"overline-thickness":true,"paint-order":true,"panose-1":true,path:true,ping:true,"pointer-events":true,points:true,r:true,radius:true,rel:true,"rendering-intent":true,restart:true,result:true,rotate:true,rx:true,ry:true,scale:true,seed:true,"shape-rendering":true,slope:true,spacing:true,speed:true,stemh:true,stemv:true,"stop-color":true,"stop-opacity":true,"strikethrough-position":true,"strikethrough-thickness":true,string:true,stroke:true,"stroke-dasharray":true,"stroke-dashoffset":true,"stroke-linecap":true,"stroke-linejoin":true,"stroke-miterlimit":true,"stroke-opacity":true,"stroke-width":true,style:true,tabindex:true,target:true,"text-anchor":true,"text-decoration":true,"text-rendering":true,to:true,transform:true,type:true,u1:true,u2:true,"underline-position":true,"underline-thickness":true,unicode:true,"unicode-bidi":true,"unicode-range":true,"units-per-em":true,"v-alphabetic":true,"v-hanging":true,"v-ideographic":true,"v-mathematical":true,values:true,"vector-effect":true,version:true,"vert-adv-y":true,"vert-origin-x":true,"vert-origin-y":true,visibility:true,width:true,widths:true,"word-spacing":true,"writing-mode":true,x1:true,x2:true,x:true,"x-height":true,"xlink:actuate":true,"xlink:arcrole":true,"xlink:href":true,"xlink:role":true,"xlink:show":true,"xlink:title":true,"xlink:type":true,"xml:base":true,"xml:lang":true,"xml:space":true,y1:true,y2:true,y:true,z:true};if(supportsTouch){doc.addEventListener(supportsPointer?"pointerover":"touchstart",(function(e){if(lastHoveredInfo.srcElement&&lastHoveredInfo.srcElement!==(e.srcElement||e.target)){var elementInfo=lastHoveredInfo.elementInfo,ii=elementInfo.length,elementInfo,elems,i;for(i=0;i<ii;i++){elems=elementInfo[i];elems.callback.call(elems.el,e)}}lastHoveredInfo={elementInfo:[]}}),true)}R.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};R._url=E;var updateGradientReference=function updateGradientReference(element,newGradient,attr){if(attr===void 0){attr="fill"}var gradient=attr==="fill"?element.gradient:element["stroke-gradient"];if(gradient){if(gradient===newGradient){return}gradient.refCount--;if(!gradient.refCount){gradient.parentNode.removeChild(gradient)}attr==="fill"?delete element.gradient:delete element["stroke-gradient"]}if(newGradient){attr==="fill"?element.gradient=newGradient:element["stroke-gradient"]=newGradient;newGradient.refCount++}};var $=R._createNode=function(el,attr){if(typeof el===typeStringSTR){el=R._g.doc.createElementNS(svgNSStr,el)}if(attr){var key,value;for(key in attr){value=isIE9?Str(attr[key]):attr[key];if(xlinkRegx.test(key)){el.setAttributeNS(xlink,key.replace(xlinkRegx,E),value)}else{el.setAttribute(key,value)}}}return el},gradientUnitNames={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},gradientSpreadNames={pad:"pad",redlect:"reflect",repeat:"repeat"},addGradient=function addGradient(element,gradient,attr){var _$;if(attr===void 0){attr="fill"}if(!element.paper||!element.paper.defs){return 0}var type="linear",SVG=element.paper,id=R.getElementID((SVG.id+"-"+gradient).replace(/[()\s%:,\xb0#]/g,"_")),fx=.5,fy=.5,r,cx,cy,units,spread,o=element.node,s=o.style,el=R._g.doc.getElementById(id),vector;if(!el){gradient=Str(gradient).replace(R._radial_gradient,(function(all,opts){type="radial";opts=opts?opts.split(","):[];units=opts[5];spread=opts[6];var _fx=opts[0],_fy=opts[1],_r=opts[2],_cx=opts[3],_cy=opts[4],shifted=_fx&&_fy,dir,sqx;if(_r){r=/%/.test(_r)?_r:toFloat(_r)}if(units===gradientUnitNames.userSpaceOnUse){if(shifted){fx=_fx;fy=_fy}if(_cx&&_cy){cx=_cx;cy=_cy;if(!shifted){fx=cx;fy=cy}}return E}if(shifted){fx=toFloat(_fx);fy=toFloat(_fy);dir=(fy>.5)*2-1;(sqx=pow(fx-.5,2))+pow(fy-.5,2)>.25&&sqx<.25&&(fy=sqrt(.25-sqx)*dir+.5)&&fy!==.5&&(fy=fy.toFixed(5)-1e-5*dir)}if(_cx&&_cy){cx=toFloat(_cx);cy=toFloat(_cy);dir=(cy>.5)*2-1;(sqx=pow(cx-.5,2))+pow(cy-.5,2)>.25&&sqx<.25&&(cy=sqrt(.25-sqx)*dir+.5)&&cy!==.5&&(cy=cy.toFixed(5)-1e-5*dir);if(!shifted){fx=cx;fy=cy}}return E}));gradient=gradient.split(/\s*-\s*/);if(type==="linear"){var angle=gradient.shift(),specs=angle.match(/\((.*)\)/),max;specs=specs&&specs[1]&&specs[1].split(/\s*,\s*/);angle=-toFloat(angle);if(isNaN(angle)){return null}if(specs&&specs.length){if(specs[0]in gradientUnitNames){units=specs.shift();specs[0]in gradientSpreadNames&&(spread=specs.shift())}else{specs[4]&&(units=specs[4]);specs[5]&&(spread=specs[5])}vector=[specs[0]||"0%",specs[1]||"0%",specs[2]||"100%",specs[3]||"0%"]}else{vector=[0,0,math.cos(R.rad(angle)),math.sin(R.rad(angle))];max=1/(mmax(abs(vector[2]),abs(vector[3]))||1);vector[2]*=max;vector[3]*=max;if(vector[2]<0){vector[0]=-vector[2];vector[2]=0}if(vector[3]<0){vector[1]=-vector[3];vector[3]=0}}}var dots=R._parseDots(gradient);if(!dots){return null}el=$(type+"Gradient",{id:id});el.refCount=0;units in gradientUnitNames&&el.setAttribute("gradientUnits",Str(units));spread in gradientSpreadNames&&el.setAttribute("spreadMethod",Str(spread));if(type==="radial"){r!==undefined&&el.setAttribute("r",Str(r));if(cx!==undefined&&cy!==undefined){el.setAttribute("cx",Str(cx));el.setAttribute("cy",Str(cy))}el.setAttribute("fx",Str(fx));el.setAttribute("fy",Str(fy))}else{$(el,{x1:vector[0],y1:vector[1],x2:vector[2],y2:vector[3]})}for(var i=0,ii=dots.length;i<ii;i++){el.appendChild($("stop",{offset:dots[i].offset?dots[i].offset:i?"100%":"0%","stop-color":dots[i].color||"#fff","stop-opacity":dots[i].opacity===undefined?1:dots[i].opacity}))}SVG.defs.appendChild(el)}updateGradientReference(element,el,attr);$(o,(_$={},_$[attr]="url('"+R._url+"#"+id+"')",_$[attr+"-opacity"]=1,_$));s.fill=E;return 1},updatePosition=function updatePosition(o){var bbox=o.getBBox(1);$(o.pattern,{patternTransform:o.matrix.invert()+" translate("+bbox.x+","+bbox.y+")"})},addArrow=function addArrow(o,value,isEnd){if(o.type=="path"){var values=Str(value).toLowerCase().split("-"),p=o.paper,se=isEnd?"end":"start",node=o.node,attrs=o.attrs,stroke=attrs["stroke-width"],i=values.length,type="classic",from,to,dx,refX,attr,w=3,h=3,t=5;while(i--){switch(values[i]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":type=values[i];break;case"wide":h=5;break;case"narrow":h=2;break;case"long":w=5;break;case"short":w=2;break}}if(type=="open"){w+=2;h+=2;t+=2;dx=1;refX=isEnd?4:1;attr={fill:"none",stroke:attrs.stroke}}else{refX=dx=w/2;attr={fill:attrs.stroke,stroke:"none"}}if(o._.arrows){if(isEnd){o._.arrows.endPath&&markerCounter[o._.arrows.endPath]--;o._.arrows.endMarker&&markerCounter[o._.arrows.endMarker]--}else{o._.arrows.startPath&&markerCounter[o._.arrows.startPath]--;o._.arrows.startMarker&&markerCounter[o._.arrows.startMarker]--}}else{o._.arrows={}}if(type!="none"){var pathId="raphael-marker-"+type,markerId="raphael-marker-"+se+type+w+h+"-obj"+o.id;if(!R._g.doc.getElementById(pathId)){p.defs.appendChild($($("path"),{"stroke-linecap":"round",d:markers[type],id:pathId}));markerCounter[pathId]=1}else{markerCounter[pathId]++}var marker=R._g.doc.getElementById(markerId),use;if(!marker){marker=$($("marker"),{id:markerId,markerHeight:h,markerWidth:w,orient:"auto",refX:refX,refY:h/2});use=$($("use"),{"xlink:href":"#"+pathId,transform:(isEnd?"rotate(180 "+w/2+" "+h/2+") ":E)+"scale("+w/t+","+h/t+")","stroke-width":(1/((w/t+h/t)/2)).toFixed(4)});marker.appendChild(use);p.defs.appendChild(marker);markerCounter[markerId]=1}else{markerCounter[markerId]++;use=marker.getElementsByTagName("use")[0]}$(use,attr);var delta=dx*(type!="diamond"&&type!="oval");if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-delta*stroke}else{from=delta*stroke;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}attr={};attr["marker-"+se]="url('"+R._url+"#"+markerId+"')";if(to||from){attr.d=R.getSubpath(attrs.path,from,to)}$(node,attr);o._.arrows[se+"Path"]=pathId;o._.arrows[se+"Marker"]=markerId;o._.arrows[se+"dx"]=delta;o._.arrows[se+"Type"]=type;o._.arrows[se+"String"]=value}else{if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-from}else{from=0;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}o._.arrows[se+"Path"]&&$(node,{d:R.getSubpath(attrs.path,from,to)});delete o._.arrows[se+"Path"];delete o._.arrows[se+"Marker"];delete o._.arrows[se+"dx"];delete o._.arrows[se+"Type"];delete o._.arrows[se+"String"]}for(attr in markerCounter){if(markerCounter[has](attr)&&!markerCounter[attr]){var item=R._g.doc.getElementById(attr);item&&item.parentNode.removeChild(item)}}}},dasharray={"":[noneStr],none:[noneStr],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},addDashes=function addDashes(o,value,params){if(value!==undefined){var predefValue=dasharray[value.toLowerCase&&value.toLowerCase()],calculatedValues,width,butt,i,widthFactor;value=predefValue||[].concat(value);if(R.is(value,arrayStr)){width=params["stroke-width"]||o.attrs["stroke-width"]||1;butt={round:width,square:width,butt:0}[params["stroke-linecap"]||o.attrs["stroke-linecap"]]||0;i=value.length;widthFactor=predefValue?width:1;if(value[0]===noneStr){calculatedValues=value}else{calculatedValues=[];while(i--){calculatedValues[i]=value[i]*widthFactor+(i%2?1:-1)*butt;calculatedValues[i]<=0&&(calculatedValues[i]=.01+(width<=1?butt:0));if(isNaN(calculatedValues[i])){calculatedValues[i]=0}}}return{"stroke-dasharray":calculatedValues.join(",")}}}},setFillAndStroke=R._setFillAndStroke=function(o,params){if(!o.paper.canvas){return}var node=o.node,attrs=o.attrs,paper=o.paper,el,att,finalAttr={},finalS={},ignoreAttrs={"clip-rect":true},value,pathClip,urlArr,rect;if(o.type===imageStr){(0,_raphael.loadRefImage)(o,params)}for(att in params){if(att in R._availableAttrs){value=params[att];if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}else if(value===null&&!ignoreAttrs[att]){if(att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}}else{attrs[att]=value;switch(att){case"blur":o.blur(value);break;case"href":case"title":case"target":var pn=node.parentNode;if(pn.tagName.toLowerCase()!=="a"){if(value===E){break}var hl=$("a");hl.raphael=true;hl.raphaelid=node.raphaelid;pn.insertBefore(hl,node);hl.appendChild(node);pn=hl}if(att==="target"){pn.setAttributeNS(xlink,"show",value==="blank"?"new":value)}else{pn.setAttributeNS(xlink,att,value)}node.titleNode=pn;break;case"cursor":finalS.cursor=value;break;case"transform":o.transform(value);break;case"rotation":if(R.is(value,arrayStr)){o.rotate.apply(o,value)}else{o.rotate(value)}break;case"arrow-start":addArrow(o,value);break;case"arrow-end":addArrow(o,value,1);break;case"clip-path":pathClip=true;case"clip-rect":rect=!pathClip&&Str(value).split(separator);o._.clipispath=!!pathClip;if(pathClip||rect.length===4){o.clip&&o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);var rc=$(pathClip?"path":"rect");el=$("clipPath");el.id=R.getElementID(R.createUUID());$(rc,pathClip?{d:value?attrs["clip-path"]=R._pathToAbsolute(value):R._availableAttrs.path,fill:noneStr}:{x:rect[0],y:rect[1],width:rect[2],height:rect[3],transform:o.matrix.invert()});el.appendChild(rc);paper.defs.appendChild(el);finalAttr["clip-path"]="url('"+R._url+"#"+el.id+"')";o.clip=rc}if(!value){var path=node.getAttribute("clip-path");if(path){var clip=R._g.doc.getElementById(path.replace(/(^url\(#|\)$)/g,E));clip&&clip.parentNode.removeChild(clip);finalAttr["clip-path"]=E;document.documentMode===11&&node.removeAttribute("clip-path");delete o.clip}}break;case"path":if(o.type==="path"){finalAttr.d=value?attrs.path=R._stopabsolutePath?R.sanitizePath(value):R._pathToAbsolute(value):R._availableAttrs.path;o._.dirty=1;if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"width":finalAttr[att]=value;o._.dirty=1;if(attrs.fx){att="x";value=attrs.x}else{break}case"x":if(attrs.fx){value=-attrs.x-(attrs.width||0)}case"rx":if(att==="rx"&&o.type==="rect"){break}case"cx":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"height":finalAttr[att]=value;o._.dirty=1;if(attrs.fy){att="y";value=attrs.y}else{break}case"y":if(o.type===textStr){break}if(attrs.fy){value=-attrs.y-(attrs.height||0)}case"ry":if(att==="ry"&&o.type==="rect"){break}case"cy":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"r":if(o.type==="rect"){finalAttr.rx=finalAttr.ry=value}else{finalAttr[att]=value}o._.dirty=1;break;case"src":if(o.type===imageStr){node.setAttributeNS(xlink,"href",value)}break;case"stroke-width":if(o._.sx!==1||o._.sy!==1){value/=mmax(abs(o._.sx),abs(o._.sy))||1}if(paper._vbSize){value*=paper._vbSize}if(zeroStrokeFix&&value===0){value=1e-6}finalAttr[att]=value;if(!params["stroke-dasharray"]&&attrs["stroke-dasharray"]&¶ms["stroke-dasharray"]!==""){quickExtend(finalAttr,addDashes(o,attrs["stroke-dasharray"],params))}if(o._.arrows){"startString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.endString,1)}break;case"stroke-dasharray":quickExtend(finalAttr,addDashes(o,value,params));break;case"fill":var isURL=R._ISURL.test(value);if(isURL){urlArr=value.split(R._ISURL);el=$("pattern");var ig=$(imageStr);el.id=R.getElementID(R.createUUID());$(el,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});$(ig,{x:0,y:0,"xlink:href":urlArr[1]});el.appendChild(ig);preLoad(el,ig,urlArr,paper);paper.defs.appendChild(el);finalAttr.fill="url('"+R._url+urlArr[1]+"')";o.pattern=el;o.pattern&&updatePosition(o);break}var clr=R.getRGB(value);if(!clr.error){delete params.gradient;delete attrs.gradient;!R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")&&(finalAttr["fill-opacity"]=attrs["fill-opacity"]);o.gradient&&updateGradientReference(o)}else if((o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value)){attrs.gradient=value;break}if(clr[has]("opacity")){finalAttr["fill-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.fillOpacityDirty=true}else if(o._.fillOpacityDirty&&R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")){node.removeAttribute("fill-opacity");delete o._.fillOpacityDirty}case"stroke":clr=R.getRGB(value);if(clr.error){if(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r"){addGradient(o,value,"stroke")}}else{finalAttr[att]=clr.hex;updateGradientReference(o,UNDEF,att)}if(att==="stroke"){if(clr[has]("opacity")){finalAttr["stroke-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.strokeOpacityDirty=true}else if(o._.strokeOpacityDirty&&R.is(attrs["stroke-opacity"],"undefined")&&R.is(params["stroke-opacity"],"undefined")){node.removeAttribute("stroke-opacity");delete o._.strokeOpacityDirty}if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"gradient":(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value);break;case"visibility":value===hiddenStr?o.hide():o.show();break;case"opacity":value=value>1?value/100:value;finalAttr.opacity=value;break;case"fill-opacity":value=value>1?value/100:value;finalAttr["fill-opacity"]=value;break;case"shape-rendering":o.attrs[att]=value=shapeRenderingAttrs[value]||value||"auto";finalAttr[att]=value;node.style.shapeRendering=value;break;case"line-height":case"vertical-align":break;default:att===fontSizeStr&&(value=toInt(value,10)+"px");o._.dirty=1;finalAttr[att]=value;if(_raphael.dashedAttr2CSSMap[att]){finalS[_raphael.dashedAttr2CSSMap[att]]=value}break}}}else if(att in allPossibleAttrs){if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att)}else{attrs[att]=value;finalS[att]=value}}}for(att in finalS){node.style[att]=finalS[att]}for(att in finalAttr){node.setAttribute(att,finalAttr[att])}o.type===textStr&&!params[notToTuneStr]&&tuneText(o,params)},updateFollowers=R._updateFollowers=function(){var i,ii,followerElem,args=(0,_raphael.getArrayCopy)(arguments),o=arrayShift.call(args),fnName=arrayShift.call(args);for(i=0,ii=o.followers.length;i<ii;i++){followerElem=o.followers[i].el;followerElem[fnName].apply(followerElem,args)}},leading=1.2,tuneText=function tuneText(el,params){if(el.type!==textStr||!(params[has](textStr)||params[has]("font")||params[has](fontSizeStr)||params[has]("x")||params[has]("y")||params[has](lineHeightStr)||params[has](vAlignStr)||params[has](textPathStr))){return}var a=el.attrs,defs=el.paper.defs,group=el.parent,node=el.node,fontSize,oldAttr=el._oldAttr=el._oldAttr||{baseLineDiff:8,valign:-.5},lineHeight=toFloat(params[lineHeightStr]||a[lineHeightStr]),direction=params.direction||a.direction||group&&group.attrs&&group.attrs.direction||oldAttr.direction||initialStr,valign,updateNode=false,tspanAttr,updateTspan=false,i,spanArr=[],abbrindx,dummyEl,tspanArr=[],abbrArr=[],hasTags=false,l,ii,j=!isIE&&direction===rtlStr?2:1,texts,tempIESpan,tspan,updateAlignment=false,tspans,text,textChanged=false,removeAllChild,hasnbsp=function hasnbsp(text){return text& Regex.test(text)},spacify=function spacify(text){return text.replace(/\s+/g," ").trim().replace(nbspRegex," ")};if(params[has](textPathStr)){var rUUID=R.getElementID(R.createUUID()),textPathParams=params[textPathStr];var textPath,tSpan,txtNode,dy=0,textPathProps={};for(var key in textPathParams){if(textPathParams.hasOwnProperty(key)){if(key==="path"&&!("href"in textPathParams)){if(oldAttr.textPathStr!==textPathParams[key]){if(el.textPathDef){el.textPathDef.setAttribute("d",textPathParams[key]||E);textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}else{el.textPathDef=defs.appendChild($("path",{id:rUUID,d:textPathParams[key]||E}));textPathProps.href="#"+rUUID;textPathProps["xlink:href"]="#"+rUUID}oldAttr.textPathStr=textPathParams[key]}else{textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}}else{textPathProps[key]=textPathParams[key]}}}if(params[has](textStr)){txtNode=R._g.doc.createTextNode(params[textStr]||E);oldAttr.pathText=a.text=params[textStr]||E}else{txtNode=R._g.doc.createTextNode(oldAttr.pathText||oldAttr.text||E);oldAttr.pathText=oldAttr.pathText||oldAttr.text||E;delete oldAttr.text}if(params[has](vAlignStr)){if(params[vAlignStr]===middleStr){dy=.3;oldAttr.valign=-.5}else if(params[vAlignStr]===bottomStr){dy=.7;oldAttr.valign=-1}else if(params[vAlignStr]===topStr){oldAttr.valign=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}else{if(oldAttr.tSpan&&(oldAttr.tSpan.textContent===params[textStr]||typeof params[textStr]!==typeStringSTR)){tSpan=oldAttr.tSpan}else{if(oldAttr.valign===-.5){dy=.3}else if(oldAttr.valign===-1){dy=.7}else{dy=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}}if(params[textStr]!==UNDEF){delete oldAttr.x;delete oldAttr.y;node.removeAttribute("x");node.removeAttribute("y");textPath=$("textPath",textPathProps);textPath.appendChild(tSpan||txtNode);while(node.firstChild){node.removeChild(node.firstChild)}node.appendChild(textPath)}}else{oldAttr.direction=direction;if(el.textPathDef&&defs){el.textPathDef.parentNode.removeChild(el.textPathDef);delete el.textPathDef}delete oldAttr.txtNode;delete oldAttr.tSpan;delete oldAttr.textPathStr;if(!lineHeight){fontSize=params.fontSize||params[fontSizeStr]||a[fontSizeStr]||group&&group.attrs&&group.attrs.fontSize;fontSize=fontSize?fontSize.toString().replace(pxStr,E):10;lineHeight=fontSize*leading}if(params[has](textStr)||oldAttr.pathText){if(R.is(params.text,arrayStr)){text=params.text.join(brStr)}else if(params.text==null){text=oldAttr.pathText}else{text=params.text}delete oldAttr.pathText;text=text.toString();if(text!==oldAttr.text){textChanged=true;if(text&<gtbrRegex.test(text)){text=text.replace(/</g,"<").replace(/>/g,">").replace(/"|"/g,'"').replace(/'/g,"'").replace(/&<br\/>lt;|&l<br\/>t;|<<br\/>;/g,"<<br/>").replace(/&<br\/>gt;|&g<br\/>t;|><br\/>;/g,"><br/>")}text=text.replace(/<u>/g,"<under>").replace(/<\/u>/g,"</under>").replace(/<b>/g,"<bold>").replace(/<\/b>/g,"</bold>").replace(/<strong>/g,"<bold>").replace(/<\/strong>/g,"</bold>").replace(/<em>/g,"<em>").replace(/<\/em>/g,"</em>").replace(/<i>/g,"<em>").replace(/<\/i>/g,"</em>").replace(/<strike>/g,"<strike>").replace(/<\/strike>/g,"</strike>").replace(/<s>/g,"<strike>").replace(/<\/s>/g,"</strike>").replace(/<del>/g,"<strike>").replace(/<\/del>/g,"</strike>").replace(/<sub>/g,"<sub>").replace(/<\/sub>/g,"</sub>").replace(/<sup>/g,"<sup>").replace(/<\/sup>/g,"</sup>");oldAttr.text=a.text=text;if(textBreakRegx.test(text)){if(oldAttr.noTSpan){oldAttr.noTSpan=!(removeAllChild=true)}texts=Str(text).split(textBreakRegx);l=texts.length}else{removeAllChild=true;oldAttr.noTSpan=true;l=1}if(oldAttr.lineCount!==l){oldAttr.lineCount=l;updateAlignment=true}}}if(lineHeight!==oldAttr.lineHeight){oldAttr.lineHeight=lineHeight;oldAttr.baseLineDiff=lineHeight*.75;updateAlignment=true}if(removeAllChild){while(node.firstChild){node.removeChild(node.firstChild)}}if(oldAttr.lineCount>1){if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanAttr={};if(!oldAttr.tspanAttr){oldAttr.tspanAttr={};oldAttr.tspan0Attr={}}if(oldAttr.tspanAttr.dy!==oldAttr.lineHeight){oldAttr.tspanAttr.dy=tspanAttr.dy=oldAttr.lineHeight;updateTspan=true}if(params[has]("x")&&oldAttr.tspanAttr.x!==params.x){oldAttr.tspan0Attr.x=oldAttr.tspanAttr.x=tspanAttr.x=a.x;updateTspan=true}if(textChanged){tspans=node.childNodes;for(i=0;i<l;i++){tspan=tspans[i*j];spanArr=createValidTextNode(texts[i],abbrArr);if(tspan){tspan.innerHTML=E;if(isIE){while(tspan.firstChild){tspan.removeChild(tspan.firstChild)}}if(updateTspan){$(tspan,i?tspanAttr:oldAttr.tspan0Attr)}}else{tspan=$(tSpanStr,i?oldAttr.tspanAttr:oldAttr.tspan0Attr);node.appendChild(tspan);if(!isIE&&direction===rtlStr){tempIESpan=$(tSpanStr,IESplTspanAttr);tempIESpan.appendChild(R._g.doc.createTextNode("i"));node.appendChild(tempIESpan)}}if(!texts[i]){tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");texts[i]=S}if(hasnbsp(texts[i])){texts[i]=spacify(texts[i]);tspan.style.whiteSpace=PRESERVESTRING}else if(tspan.style.whiteSpace===PRESERVESTRING){tspan.style.whiteSpace=BLANKSTRING}if(spanArr.length){for(var indx=0;indx<spanArr.length;indx++){tspan.appendChild(spanArr[indx])}}else{tspan.appendChild(R._g.doc.createTextNode(texts[i]))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}}else if(updateTspan){tspans=node.childNodes;ii=tspans.length;for(i=0;i<ii;i+=j){$(tspans[i],i?tspanAttr:oldAttr.tspan0Attr)}}ii=l*j;if(node.childNodes.length>ii){for(i=node.childNodes.length-1;i>=ii;i-=1){node.removeChild(node.childNodes[i])}}}else if(textChanged){if(hasnbsp(text)){text=spacify(text);node.style.whiteSpace=PRESERVESTRING}else if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanArr=createValidTextNode(text,abbrArr);if(tspanArr.length){for(var index=0;index<tspanArr.length;index++){node.appendChild(tspanArr[index])}}else{node.appendChild(R._g.doc.createTextNode(text))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}if(params[vAlignStr]){valign=vAlignMultiplier[a[vAlignStr]]||0;if(valign!==oldAttr.valign){oldAttr.valign=valign;updateAlignment=true}}if(updateAlignment){oldAttr.shift=oldAttr.baseLineDiff+oldAttr.lineCount*oldAttr.lineHeight*oldAttr.valign;updateNode=true}if((params.y||params.y===0)&&oldAttr.y!==params.y){oldAttr.y=a.y;updateNode=true}if(updateNode&&(oldAttr.y||oldAttr.y===0)&&(oldAttr.shift||oldAttr.shift===0)){$(node,{y:Math.round(oldAttr.y+oldAttr.shift)})}}},Element=function Element(node,svg,group){var o=this,parent=group||svg;parent.canvas&&parent.canvas.appendChild(node);o.node=o[0]=node;node.raphael=true;node.raphaelid=o.id=R._oid++;o.matrix=R.matrix();o.realPath=null;o.attrs=o.attrs||{};o.followers=o.followers||[];o.paper=svg;o.ca=o.customAttributes=o.customAttributes||new svg._CustomAttributes;o._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1};o.parent=parent;!parent.bottom&&(parent.bottom=o);o.prev=parent.top;parent.top&&(parent.top.next=o);parent.top=o;o.next=null},getTouchDistance=function getTouchDistance(touch1,touch2,isY){var select=isY?"pageY":"pageX";return Math.abs(touch2[select]-touch1[select])},storeHandlers=R.storeHandlers=function(elem,handler,fn){elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);elem._actualListners.push(handler);elem._derivedListeners.push(fn)},removeHandlers=function removeHandlers(elem,handler){var index=elem._actualListners.indexOf(handler),derivedHandler;if(index!==-1){derivedHandler=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}return derivedHandler},elproto=R.el;Element.prototype=elproto;elproto.constructor=Element;R._engine.getNode=function(el){var node=el.node||el[0].node;return node.titleNode||node};R._engine.getLastNode=function(el){var node=el.node||el[el.length-1].node;return node.titleNode||node};elproto.rotate=function(deg,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"rotate",deg,cx,cy);deg=Str(deg).split(separator);if(deg.length-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1);cx=bbox.x+bbox.width/2;cy=bbox.y+bbox.height/2}o.transform(o._.transform.concat([["r",deg,cx,cy]]));return o};elproto.scale=function(sx,sy,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"scale",sx,sy,cx,cy);sx=Str(sx).split(separator);if(sx.length-1){sy=toFloat(sx[1]);cx=toFloat(sx[2]);cy=toFloat(sx[3])}sx=toFloat(sx[0]);sy==null&&(sy=sx);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1)}cx=cx==null?bbox.x+bbox.width/2:cx;cy=cy==null?bbox.y+bbox.height/2:cy;o.transform(o._.transform.concat([["s",sx,sy,cx,cy]]));return o};elproto.translate=function(dx,dy){var o=this;if(o.removed){return o}updateFollowers(o,"translate",dx,dy);dx=Str(dx).split(separator);if(dx.length-1){dy=toFloat(dx[1])}dx=toFloat(dx[0])||0;dy=+dy||0;o.transform(o._.transform.concat([["t",dx,dy]]));return o};elproto.transform=function(tstr){var o=this,_=o._,sw;if(tstr==null){return _.transform}R._extractTransform(o,tstr);o.clip&&!_.clipispath&&$(o.clip,{transform:o.matrix.invert()});o.pattern&&updatePosition(o);o.node&&$(o.node,{transform:o.matrix});if(_.sx!==1||_.sy!==1){sw=o.attrs["stroke-width"];sw&&o.attr({"stroke-width":sw})}return o};elproto.hide=function(){var o=this;updateFollowers(o,"hide");!o.removed&&o.paper.safari(o.node.style.display=noneStr);return o};elproto.show=function(){var o=this;updateFollowers(o,"show");!o.removed&&o.paper.safari(o.node.style.display=E);return o};elproto.remove=function(){if(this.removed||!this.parent.canvas){return}var o=this,node=R._engine.getNode(o),paper=o.paper,defs=paper.defs,i;paper.__set__&&paper.__set__.exclude(o);eve.unbind("raphael.*.*."+o.id);if(o.gradient&&defs){updateGradientReference(o)}if(o["stroke-gradient"]&&defs){updateGradientReference(o,UNDEF,"stroke")}if(o.textPathDef&&defs){o.textPathDef.parentNode.removeChild(o.textPathDef);delete o.textPathDef}while(i=o.followers.pop()){i.el.remove()}while(i=o.bottom){i.remove()}if(o._drag){o.undrag()}if(o.events){while(i=o.events.pop()){i.unbind()}}o.parent.canvas.contains(node)&&o.parent.canvas.removeChild(node);o.removeData();delete paper._elementsById[o.id];R._tear(o,o.parent);for(i in o){o[i]=typeof o[i]===fnStr?R._removedFactory(i):null}o.removed=true};elproto._getBBox=function(){var fn,o=this,node=o.node,bbox={},a=o.attrs,align,hide,isText=o.type===textStr;if(isIE&&isText){fn=(0,_raphael.showRecursively)(o)}else{if(node.style.display===noneStr){o.show();hide=true}}try{bbox=node.getBBox();if(isText){if(bbox.x===undefined){bbox.isCalculated=true;align=a["text-anchor"];bbox.x=(a.x||0)-bbox.width*(align==="start"?0:align===middleStr?.5:1)}if(bbox.y===undefined){bbox.isCalculated=true;align=a[vAlignStr];bbox.y=(a.y||0)-bbox.height*(align===bottomStr?1:align===middleStr?.5:0)}}}catch(e){}finally{bbox=bbox||{}}isIE&&isText?fn&&fn():hide&&o.hide();return bbox};elproto.attr=function(name,value){if(this.removed){return this}var elem=this,attrs=this.attrs,key,finalParam={},i,ii,params,subkey,par,follower,invokedCa=elem._invokedCa||(elem._invokedCa={}),ca,caObj=this.ca;if(name==null){var res={};for(key in attrs){if(attrs[has](key)){res[key]=attrs[key]}}res.gradient&&res.fill===noneStr&&(res.fill=res.gradient)&&delete res.gradient;res.transform=this._.transform;res.visibility=this.node.style.display===noneStr?hiddenStr:visibleStr;return res}else{if(value==null){if(R.is(name,objectStr)){params=name}else if(R.is(name,typeStringSTR)){if(name===fillStr&&attrs.fill===noneStr&&attrs.gradient){return attrs.gradient}if(name===transformStr){return this._.transform}if(name===visibilityStr){return this.node.style.display===noneStr?hiddenStr:visibleStr}if(name in attrs){return attrs[name]}else if(R.is(caObj[name],fnStr)){return caObj[name].def}return R._availableAttrs[name]}}else{params={};params[name]=value}if(!R.stopPartialEventPropagation){for(key in params){eve("raphael.attr."+key+"."+this.id,this,params[key],key)}}for(key in params){ca=caObj[key];if(ca&&!invokedCa[key]&&R.is(ca,fnStr)){invokedCa[key]=true;par=ca.apply(this,[].concat(params[key]));invokedCa[key]=false;for(subkey in par){finalParam[subkey]=par[subkey]}attrs[key]=params[key]}else{finalParam[key]=params[key]}}setFillAndStroke(this,finalParam);for(i=0,ii=this.followers.length;i<ii;i++){follower=this.followers[i];follower.cb&&!follower.cb.call(follower.el,finalParam,this)||follower.el.attr(finalParam)}return this}};elproto.pinchstart=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];elem._blockDrag=true;e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}else{elem._blockDrag=false}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchstart",fn)};elproto.unpinchstart=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem.__blockDrag=false;elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchstart",derivedHandler)};elproto.pinchmove=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];e&&e.preventDefault();elem._pinchDragStarted=true;R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchmove",fn)};elproto.unpinchmove=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("touchmove",derivedHandler)};elproto.pinchend=function(handler,context){var elem=this,fn=function fn(e){if(elem._pinchDragStarted){elem._pinchDragStarted=false;handler.call(context||elem,e)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchend",fn)};elproto.unpinchend=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchend",derivedHandler)};elproto.pinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.pinchstart.call(this,pinchstarthandler);elproto.pinchin.call(this,pinchinhandler);elproto.pinchend.call(this,pinchendhandler)};elproto.unpinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.unpinchstart.call(this,pinchstarthandler);elproto.unpinchin.call(this,pinchinhandler);elproto.unpinchend.call(this,pinchendhandler)};elproto.fcwheel=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);handler.call(context||elem,dummyEve)};storeHandlers(elem,handler,fn);elem.node.addEventListener("wheel",fn)};elproto.fcunwheel=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("wheel",derivedHandler)};elproto.on=function(eventType,handler,context){if(!handler||!eventType){return}var elem=this,node,actualEventType,isSafe=eventType.match(/fc-/),fn=handler;if(this.removed){return this}elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);switch(eventType){case"fc-dragstart":elem.drag(null,handler);return elem;case"fc-dragmove":elem.drag(handler);return elem;case"fc-dragend":elem.drag(null,null,handler);return elem;case"fc-dbclick":elem.dbclick(handler,context);return elem;case"fc-pinchstart":elem.pinchstart(handler,context);return elem;case"fc-pinchmove":elem.pinchmove(handler,context);return elem;case"fc-pinchend":elem.pinchend(handler,context);return elem;case"fc-click":elem.fcclick(handler,context);return elem;case"fc-wheel":elem.fcwheel(handler,context);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){fn=function fn(e){if(!(supportsPointer&&supportsTouch&&!e.isPrimary)){lastHoveredInfo.elementInfo.push({el:context||elem,callback:handler});lastHoveredInfo.srcElement=e.srcElement||e.target}};eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg&&(eventType==="load"||eventType==="error")){node=this._.RefImg;fn=function fn(e){!elem.removed&&handler.call(elem,e)}}else{node=this.node}if(fn===handler){fn=function fn(e){!(supportsPointer&&supportsTouch&&!e.isPrimary)&&handler.call(context||elem,e)}}elem._actualListners.push(handler);elem._derivedListeners.push(fn);if(node.addEventListener){node.addEventListener(eventType,fn)}else{node["on"+eventType]=fn}return this};elproto.off=function(eventType,handler){var elem=this,fn=handler,actualEventType,index,isSafe=eventType.match(/fc-/),node;if(this.removed||!elem._actualListners||!eventType||!handler){return this}switch(eventType){case"fc-dragstart":elem.undragstart(handler);return elem;case"fc-dragmove":elem.undragmove(handler);return elem;case"fc-dragend":elem.undragend(handler);return elem;case"fc-dbclick":elem.undbclick(handler);return elem;case"fc-pinchstart":elem.unpinchstart(handler);return elem;case"fc-pinchmove":elem.unpinchmove(handler);return elem;case"fc-pinchend":elem.unpinchend(handler);return elem;case"fc-click":elem.fcunclick(handler);return elem;case"fc-wheel":elem.fcunwheel(handler);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));fn=handler;if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg){node=this._.RefImg}else{node=this.node}index=elem._actualListners.indexOf(fn);if(index!==-1){fn=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}if(node.removeEventListener){node.removeEventListener(eventType,fn)}else{node["on"+eventType]=null}return this};R._engine.path=function(svg,attrs,group){var el=$("path"),res=new Element(el,svg,group);res.type="path";attrs&&res.attr(attrs);return res};R._engine.group=function(svg,id,group,overrideId){var el=$("g"),res=new Element(el,svg,group);res.type="group";res.canvas=res.node;res.top=res.bottom=null;res._id=id||E;if(id){if(overrideId){el.setAttribute("class","raphael-group-"+id)}else{el.setAttribute("class","raphael-group-"+res.id+"-"+id)}}return res};R._engine.circle=function(svg,attrs,group){var el=$("circle"),res=new Element(el,svg,group);res.type="circle";attrs&&res.attr(attrs);return res};R._engine.rect=function(svg,attrs,group){var el=$("rect"),res=new Element(el,svg,group);res.type="rect";attrs.rx=attrs.ry=attrs.r;attrs&&res.attr(attrs);return res};R._engine.ellipse=function(svg,attrs,group){var el=$("ellipse"),res=new Element(el,svg,group);res.type="ellipse";attrs&&res.attr(attrs);return res};R._engine.image=function(svg,attrs,group){var el=$(imageStr),res=new Element(el,svg,group,true);res._.group=group||svg;res.type=imageStr;el.setAttribute("preserveAspectRatio",noneStr);attrs&&res.attr(attrs);return res};R._engine.text=function(svg,attrs,group,css){var el=$(textStr),res=new Element(el,svg,group);res.type=textStr;css&&res.css&&res.css(css,undefined,true);attrs&&res.attr(attrs);return res};R._engine.setSize=function(width,height){this.width=width||this.width;this.height=height||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);if(this._viewBox){this.setViewBox.apply(this,this._viewBox)}return this};R._engine.create=function(){var con=R._getContainer.apply(0,arguments),container=con&&con.container,x=con.x,y=con.y,width=con.width,height=con.height,paper;if(!container){throw new Error("SVG container not found.")}var cnvs=$("svg"),css="overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);"+"-webkit-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;"+"-ms-user-select:none;user-select:none;-o-user-select:none;cursor:default;"+"vertical-align:middle;",isFloating;if(supportsTouch){if(R.isIE10){css+="-ms-touch-action:pan-x,pan-y;"}else{css+="touch-action:pan-x,pan-y;"}}x=x||0;y=y||0;width=width||512;height=height||342;$(cnvs,{height:height,version:1.1,width:width,xmlns:svgNSStr});if(container===1){cnvs.style.cssText=css+"position:absolute;left:"+x+"px;top:"+y+pxStr;container=R._g.doc.body;container.appendChild(cnvs);isFloating=1}else{cnvs.style.cssText=css+"position:relative";if(container.firstChild){container.insertBefore(cnvs,container.firstChild)}else{container.appendChild(cnvs)}}paper=new R._Paper;paper.width=width;paper.height=height;paper.canvas=cnvs;paper.container=container;$(cnvs,{id:"raphael-paper-"+paper.id});paper.clear();paper._left=paper._top=0;isFloating&&(paper.renderfix=function(){});paper.renderfix();return paper};R._engine.setViewBox=function(x,y,w,h,fit){eve("raphael.setViewBox",this,this._viewBox,[x,y,w,h,fit]);var size=mmax(w/this.width,h/this.height),top=this.top,aspectRatio=fit?"meet":"xMinYMin",vb,sw;if(x==null){if(this._vbSize){size=1}delete this._vbSize;vb="0 0 "+this.width+S+this.height}else{this._vbSize=size;vb=x+S+y+S+w+S+h}$(this.canvas,{viewBox:vb,preserveAspectRatio:aspectRatio});if(size){while(top){sw="stroke-width"in top.attrs?top.attrs["stroke-width"]:1;top.attr({"stroke-width":sw});top._.dirty=1;top._.dirtyT=1;top=top.prev}}this._viewBox=[x,y,w,h,!!fit];return this};R.prototype.detachPaper=function(){if(this._detached!==false){this.container.removeChild(this.canvas);this._detached=true}};R.prototype.attachPaper=function(){if(this._detached){this.container.appendChild(this.canvas);this._detached=false}};R.prototype.renderfix=function(){var cnvs=this.canvas,s=cnvs.style,pos;try{pos=cnvs.getScreenCTM()||cnvs.createSVGMatrix()}catch(e){pos=cnvs.createSVGMatrix()}var left=-pos.e%1,top=-pos.f%1;if(left||top){if(left){this._left=(this._left+left)%1;s.left=this._left+pxStr}if(top){this._top=(this._top+top)%1;s.top=this._top+pxStr}}};R.prototype._desc=function(txt){var desc=this.desc;if(!desc){this.desc=desc=$("desc");this.canvas.appendChild(desc)}else{while(desc.firstChild){desc.removeChild(desc.firstChild)}}desc.appendChild(R._g.doc.createTextNode(R.is(txt,typeStringSTR)?txt:"Created with Red Raphaël "+R.version))};R.prototype.clear=function(){var c;eve("raphael.clear",this);while(c=this.bottom){c.remove()}c=this.canvas;while(c.firstChild){c.removeChild(c.firstChild)}this.bottom=this.top=null;c.appendChild(this.desc=$("desc"));c.appendChild(this.defs=$("defs"))};R.prototype.remove=function(){var i;eve("raphael.remove",this);while(i=this.bottom){i.remove()}this.defs&&this.defs.parentNode.removeChild(this.defs);this.desc&&this.desc.parentNode.removeChild(this.desc);this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(i in this){this[i]=typeof this[i]===fnStr?R._removedFactory(i):null}this.removed=true};R.prototype.setHTMLClassName=function(){}}} | ||
"use strict";exports.__esModule=true;exports.default=_default;var _raphael=require("./raphael.lib");function _default(R){if(R.svg){var has="hasOwnProperty",tSpanStr="tspan",vAlignStr="vertical-align",lineHeightStr="line-height",fontSizeStr="font-size",imageStr="image",noneStr="none",notToTuneStr="_do-not-tune",textStr="text",textPathStr="textpath",rtlStr="rtl",hasSup=false,hasSub=false,arrayStr="array",middleStr="middle",bottomStr="bottom",topStr="top",pxStr="px",initialStr="initial",fnStr="function",brStr="<br>",hiddenStr="hidden",visibleStr="visible",objectStr="object",fillStr="fill",transformStr="transform",visibilityStr="visibility",IESplTspanAttr={visibility:hiddenStr,"font-size":"0px"},Str=String,VERTICAL="vertical",HORIZONTAL="horizontal",PRESERVESTRING="pre",BLANKSTRING="",toFloat=parseFloat,toInt=parseInt,vAlignMultiplier={top:0,bottom:-1,middle:-.5},win=R._g.win,navigator=win.navigator,isIE=false||!!document.documentMode,math=Math,UNDEF,mmax=math.max,abs=math.abs,pow=math.pow,sqrt=math.sqrt,xlinkRegx=/^xlink:/,separator=/[, ]+/,textBreakRegx=/\n|<br\s*?\/?>/i,ltgtbrRegex=/<|>|"|'|"|<br/i,nbspRegex=/ | | /g,arrayShift=Array.prototype.shift,zeroStrokeFix=!!(/AppleWebKit/.test(navigator.userAgent)&&(!/Chrome/.test(navigator.userAgent)||navigator.appVersion.match(/Chrome\/(\d+)\./)[1]<29)),eve=R.eve,E="",S=" ",xlink="http://www.w3.org/1999/xlink",svgNSStr="http://www.w3.org/2000/svg",isIpad=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),typeStringSTR="string",markers={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},shapeRenderingAttrs={speed:"optimizeSpeed",crisp:"crispEdges",precision:"geometricPrecision"},nav=navigator.userAgent.toLowerCase(),isIE9=function(){var verIE=nav.indexOf("msie")!=-1?parseInt(nav.split("msie")[1]):false;if(verIE&&verIE===9){return true}else{return false}}(),supportsPointer=R.supportsPointer,supportsTouch=R.supportsTouch,markerCounter={},preLoad=function preLoad(elem,ig,isURL,paper){R._preload(isURL[1],(function(){var w=this.offsetWidth,h=this.offsetHeight;$(elem,{width:w,height:h});$(ig,{width:w,height:h});paper.safari()}))},quickExtend=function quickExtend(obj1,obj2){if(obj2){for(var key in obj2){obj1[key]=obj2[key]}}},lastHoveredInfo={elementInfo:[]},doc=R._g.doc,win=R._g.win,safeMouseEventMapping={mouseover:"touchstart",mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove",mouseout:"touchend"},createValidTextNode=function createValidTextNode(text,abbrArr){var underlineRegex=/<under>/g,underlineEndRegex=/<\/under>/g,boldRegex=/<bold>/g,boldEndRegex=/<\/bold>/g,emphasisRegex=/<em>/g,emphasisEndRegex=/<\/em>/g,strikeRegex=/<strike>/g,strikeEndRegex=/<\/strike>/g,subscriptRegex=/<sub[\s]+([^>]+)>|<sub>/g,subscriptEndRegex=/<\/sub>/g,superscriptRegex=/<sup[\s]+([^>]+)>|<sup>/g,superscriptEndRegex=/<\/sup>/g,abbrRegex=/<abbr[\s]+([^>]+)>/g,abbrEndRegex=/<\/abbr>/g,spanRegex=/<span[\s]+([^>]+)>|<span>/g,spanEndRegex=/<\/span>/g,anchorRegex=/<a[\s]+([^>]+)>/g,anchorEndRegex=/<\/a>/g,lastAttrList=[],index,subtext,tspanArray=[],startIndex=0,sortedIndices,underlinetagIndices=getTagIndices(underlineRegex,underlineEndRegex,text,"<under>","</under>"),boldtagIndices=getTagIndices(boldRegex,boldEndRegex,text,"<bold>","</bold>"),emtagIndices=getTagIndices(emphasisRegex,emphasisEndRegex,text,"<em>","</em>"),strikeTagIndices=getTagIndices(strikeRegex,strikeEndRegex,text,"<strike>","</strike>"),subscriptTagIndices=getSubSupTagIndices(subscriptRegex,subscriptEndRegex,text,"<sub>","</sub>"),superscriptTagIndices=getSubSupTagIndices(superscriptRegex,superscriptEndRegex,text,"<sup>","</sup>"),abbrTagIndices=getAbbrTagIndices(abbrRegex,abbrEndRegex,text,"<abbr>","</abbr>"),anchorTagIndices=getAnchorTagIndices(anchorRegex,anchorEndRegex,text,"<a>","</a>"),spanTagIndices=getSpanTagIndices(spanRegex,spanEndRegex,text,"<span>","</span>"),sortedIndices=sortTags(underlinetagIndices,boldtagIndices,emtagIndices,strikeTagIndices,subscriptTagIndices,superscriptTagIndices,abbrTagIndices,anchorTagIndices,spanTagIndices);if(sortedIndices.length){if(sortedIndices[0].index>startIndex){subtext=text.substring(startIndex,sortedIndices[0].index);tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,abbrArr,sortedIndices);startIndex=sortedIndices[0].index+sortedIndices[0].tagName.length}for(index=0;index<sortedIndices.length;index++){if(sortedIndices[index+1]!==UNDEF){lastAttrList=createAttrList(lastAttrList,sortedIndices[index]);if(startIndex===0&&sortedIndices[index].index===0){subtext=text.substring(startIndex+sortedIndices[index].tagName.length,sortedIndices[index+1].index)}else{subtext=text.substring(startIndex,sortedIndices[index+1].index)}tspanArray=createtspanArray(tspanArray,subtext,lastAttrList,sortedIndices[index],abbrArr,sortedIndices);startIndex=sortedIndices[index+1].index+sortedIndices[index+1].tagName.length}}if(startIndex<text.length){subtext=text.substring(startIndex,text.length);tspanArray=createtspanArray(tspanArray,subtext,[],abbrArr,sortedIndices)}}return tspanArray},tagHash={"<bold>":{action:"add",tagAttr:"font-weight",tagAttrVal:"bold"},"</bold>":{action:"remove",actionTag:"<bold>"},"<under>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</under>":{action:"remove",actionTag:"<under>"},"<em>":{action:"add",tagAttr:"font-style",tagAttrVal:"italic"},"</em>":{action:"remove",actionTag:"<em>"},"<strike>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"line-through"},"</strike>":{action:"remove",actionTag:"<strike>"},"<sub>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"sub"},"</sub>":{action:"remove",actionTag:"<sub>"},"<sup>":{action:"add",tagAttr:"baseline-shift",tagAttrVal:"super"},"</sup>":{action:"remove",actionTag:"<sup>"},"<abbr>":{action:"add",tagAttr:"text-decoration",tagAttrVal:"underline"},"</abbr>":{action:"remove",actionTag:"<abbr>"},"<a>":{action:"add"},"</a>":{action:"remove",actionTag:"<a>"},"<span>":{action:"add"},"</span>":{action:"remove",actionTag:"<span>"}},createAttrList=function createAttrList(attrArr,sortedIndex){var i,abbrReg=/<abbr[\s]+([^>]+)>/g,anchorReg=/<a[\s]+([^>]+)>/g,spanReg=/<span[\s]+([^>]+)>/g,subReg=/<sub[\s]+([^>]+)>/g,supReg=/<sup[\s]+([^>]+)>/g,obj;if(sortedIndex.tagName.match(abbrReg)){obj=MergeRecursive({tag:"<abbr>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(anchorReg)){obj=MergeRecursive({tag:"<a>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(spanReg)){obj=MergeRecursive({tag:"<span>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(subReg)){obj=MergeRecursive({tag:"<sub>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(sortedIndex.tagName.match(supReg)){obj=MergeRecursive({tag:"<sup>",sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="add"){obj=MergeRecursive({tag:sortedIndex.tagName,sortedIndex:sortedIndex});attrArr.push(obj)}else if(tagHash[sortedIndex.tagName].action==="remove"){for(i=attrArr.length-1;i>=0;i--){if(attrArr[i].tag===tagHash[sortedIndex.tagName].actionTag){attrArr.splice(i,1);break}}}return attrArr},createtspanArray=function createtspanArray(tspanArray,str,lastAttr,indicesObj,abbrArr,sortedIndices){var textNode=R._g.doc.createTextNode(str),obj={},hasAnchor=false,hasAbbr=false,hasSpan=false,title="",style,anchor,tspan,i,j;if(isIE||_raphael.isFirefox){if(hasSub){obj["dy"]=-6;hasSub=false}if(hasSup){obj["dy"]=6;hasSup=false}}if(!lastAttr.length){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}else{for(i=0;i<lastAttr.length;i++){if(lastAttr[i].tag==="<abbr>"){hasAbbr=true;title=lastAttr[i].sortedIndex.title}else if(lastAttr[i].tag==="<a>"){hasAnchor=true;if(lastAttr[i].href!==""){obj["href"]=lastAttr[i].sortedIndex.href}if(indicesObj.target!==""){obj["target"]=lastAttr[i].sortedIndex.target}if(indicesObj.hreflang!==""){obj["hreflang"]=lastAttr[i].sortedIndex.hreflang}if(indicesObj.referrerpolicy!==""){obj["referrerpolicy"]=lastAttr[i].sortedIndex.referrerpolicy}if(indicesObj.rel!==""){obj["rel"]=lastAttr[i].sortedIndex.rel}anchor=$("a",obj)}else if(lastAttr[i].tag==="<span>"){hasSpan=true;style=lastAttr[i].sortedIndex.style}else if(lastAttr[i].tag==="<sub>"){hasSub=true;style=lastAttr[i].sortedIndex.style}else if(lastAttr[i].tag==="<sup>"){hasSup=true;style=lastAttr[i].sortedIndex.style}if(tagHash[lastAttr[i].tag].tagAttr&&tagHash[lastAttr[i].tag].tagAttrVal){if(isIE||_raphael.isFirefox){if(lastAttr[i].tag==="<sup>"){obj["dy"]=-6;hasSup=true}else if(lastAttr[i].tag==="<sub>"){obj["dy"]=6;hasSub=true}}obj[tagHash[lastAttr[i].tag].tagAttr]=tagHash[lastAttr[i].tag].tagAttrVal}}if(hasAnchor){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);anchor.appendChild(tspan);tspanArray.push(anchor);hasAnchor=false}}else if(hasAbbr){if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);abbrArr.push({tspan:tspan,title:title});tspanArray.push(tspan)}}else if(hasSpan){if(str!==""){obj=MergeRecursive(obj,style);tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}else if(hasSub||hasSup){if(str!==""){obj=MergeRecursive(obj,style);tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}else{if(str!==""){tspan=$("tspan",obj);tspan.appendChild(textNode);tspanArray.push(tspan)}}}return tspanArray},MergeRecursive=function MergeRecursive(obj1,obj2){for(var p in obj2){try{if(obj2[p].constructor==Object){obj1[p]=MergeRecursive(obj1[p],obj2[p])}else{obj1[p]=obj2[p]}}catch(e){obj1[p]=obj2[p]}}return obj1},sortTags=function sortTags(u,b,em,strike,sub,sup,abbr,a,sp){var i,j,tagArr=[u,b,em,strike,sub,sup,abbr,a,sp],res=[];for(j=0;j<tagArr.length;j++){for(var key in tagArr[j]){if(tagArr[j][key].length){for(i=0;i<tagArr[j][key].length;i++){res.push(tagArr[j][key][i])}}}}res=res.sort((function(a,b){return a.index-b.index}));return res},getAbbrTagIndices=function getAbbrTagIndices(abbrRegex,abbrEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyNode,testAbbr,title,endtagindices=[];while(result=abbrRegex.exec(text)){dummyNode=document.createElement("p");testAbbr=result[0]+"Dummy</abbr>";dummyNode.innerHTML=testAbbr;title=dummyNode.childNodes[0]?dummyNode.childNodes[0].title:"";tagindices.push({tagName:result[0],index:result.index,title:title?title:""})}while(result=abbrEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getStyles=function getStyles(el){var output={};if(!el||!el.style||!el.style.cssText){return output}var camelize=function camelize(str){return str.replace(/(?:^|[-])(\w)/g,(function(a,c){c=a.substr(0,1)==="-"?c.toUpperCase():c;return c?c:""}))};var style=el.style.cssText.split(";");for(var i=0;i<style.length;++i){var rule=style[i].trim();if(rule){var ruleParts=rule.split(":");var key=ruleParts[0].trim();output[key]=ruleParts[1].trim()}}return output},getSpanTagIndices=function getSpanTagIndices(spanRegex,spanEndRegex,text,tagText,endtagText){var tagindices=[],result,dummySpan,testSpan,styleObj,endtagindices=[];while(result=spanRegex.exec(text)){dummySpan=document.createElement("p");testSpan=result[0]+"Dummy</span>";dummySpan.innerHTML=testSpan;styleObj=getStyles(dummySpan.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:""})}while(result=spanEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getSubSupTagIndices=function getSubSupTagIndices(subSupRegex,subSupEndRegex,text,tagText,endtagText){var tagindices=[],result,dummySpan,testSpan,styleObj,endtagindices=[];while(result=subSupRegex.exec(text)){dummySpan=document.createElement("p");testSpan=result[0]+"Dummy"+endtagText;dummySpan.innerHTML=testSpan;styleObj=getStyles(dummySpan.childNodes[0]);tagindices.push({tagName:result[0],index:result.index,style:styleObj?styleObj:""})}while(result=subSupEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},isUrlValid=function isUrlValid(userInput){var res=userInput.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&=]*)/g);if(!res)return false;else return true},getAnchorTagIndices=function getAnchorTagIndices(anchorRegex,anchorEndRegex,text,tagText,endtagText){var tagindices=[],result,dummyAnchor,testAnchor,isValidHref,endtagindices=[];while(result=anchorRegex.exec(text)){dummyAnchor=document.createElement("p");testAnchor=result[0]+"</a>";dummyAnchor.innerHTML=testAnchor;isValidHref=isUrlValid(encodeURIComponent(dummyAnchor.childNodes[0].href));tagindices.push({tagName:result[0],index:result.index,href:isValidHref?dummyAnchor.childNodes[0].href:"",target:dummyAnchor.childNodes[0].target?dummyAnchor.childNodes[0].target:"",hreflang:dummyAnchor.childNodes[0].hreflang?dummyAnchor.childNodes[0].hreflang:"",referrerpolicy:dummyAnchor.childNodes[0].referrerpolicy?dummyAnchor.childNodes[0].referrerpolicy:"",rel:dummyAnchor.childNodes[0].rel?dummyAnchor.childNodes[0].rel:""})}while(result=anchorEndRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},getTagIndices=function getTagIndices(tagRegex,endTagRegex,text,tagText,endtagText){var tagindices=[],result,endtagindices=[];while(result=tagRegex.exec(text)){tagindices.push({tagName:tagText,index:result.index})}while(result=endTagRegex.exec(text)){endtagindices.push({tagName:endtagText,index:result.index})}return{tag:tagindices,endtag:endtagindices}},allPossibleAttrs={"accent-height":true,accumulate:true,additive:true,"alignment-baseline":true,alphabetic:true,amplitude:true,"arabic-form":true,ascent:true,azimuth:true,"baseline-shift":true,bbox:true,begin:true,bias:true,by:true,"cap-height":true,class:true,clip:true,"clip-path":true,"clip-rule":true,color:true,"color-interpolation":true,"color-interpolation-filters":true,"color-profile":true,"color-rendering":true,cursor:true,cx:true,cy:true,d:true,decelerate:true,descent:true,direction:true,display:true,divisor:true,"dominant-baseline":true,dur:true,dx:true,dy:true,elevation:true,"enable-background":true,end:true,exponent:true,fill:true,"fill-opacity":true,"fill-rule":true,filter:true,"flood-color":true,"flood-opacity":true,"font-family":true,"font-size":true,"font-size-adjust":true,"font-stretch":true,"font-style":true,"font-variant":true,"font-weight":true,format:true,fr:true,from:true,fx:true,fy:true,g1:true,g2:true,"glyph-name":true,"glyph-orientation-horizontal":true,"glyph-orientation-vertical":true,hanging:true,height:true,"horiz-adv-x":true,"horiz-origin-x":true,href:true,hreflang:true,id:true,ideographic:true,"image-rendering":true,in2:true,in:true,intercept:true,k1:true,k2:true,k3:true,k4:true,k:true,kerning:true,lang:true,"letter-spacing":true,"lighting-color":true,local:true,"marker-end":true,"marker-mid":true,"marker-start":true,mask:true,mathematical:true,max:true,media:true,method:true,min:true,mode:true,name:true,offset:true,opacity:true,operator:true,order:true,orient:true,orientation:true,origin:true,overflow:true,"overline-position":true,"overline-thickness":true,"paint-order":true,"panose-1":true,path:true,ping:true,"pointer-events":true,points:true,r:true,radius:true,rel:true,"rendering-intent":true,restart:true,result:true,rotate:true,rx:true,ry:true,scale:true,seed:true,"shape-rendering":true,slope:true,spacing:true,speed:true,stemh:true,stemv:true,"stop-color":true,"stop-opacity":true,"strikethrough-position":true,"strikethrough-thickness":true,string:true,stroke:true,"stroke-dasharray":true,"stroke-dashoffset":true,"stroke-linecap":true,"stroke-linejoin":true,"stroke-miterlimit":true,"stroke-opacity":true,"stroke-width":true,style:true,tabindex:true,target:true,"text-anchor":true,"text-decoration":true,"text-rendering":true,to:true,transform:true,type:true,u1:true,u2:true,"underline-position":true,"underline-thickness":true,unicode:true,"unicode-bidi":true,"unicode-range":true,"units-per-em":true,"v-alphabetic":true,"v-hanging":true,"v-ideographic":true,"v-mathematical":true,values:true,"vector-effect":true,version:true,"vert-adv-y":true,"vert-origin-x":true,"vert-origin-y":true,visibility:true,width:true,widths:true,"word-spacing":true,"writing-mode":true,x1:true,x2:true,x:true,"x-height":true,"xlink:actuate":true,"xlink:arcrole":true,"xlink:href":true,"xlink:role":true,"xlink:show":true,"xlink:title":true,"xlink:type":true,"xml:base":true,"xml:lang":true,"xml:space":true,y1:true,y2:true,y:true,z:true};if(supportsTouch){doc.addEventListener(supportsPointer?"pointerover":"touchstart",(function(e){if(lastHoveredInfo.srcElement&&lastHoveredInfo.srcElement!==(e.srcElement||e.target)){var elementInfo=lastHoveredInfo.elementInfo,ii=elementInfo.length,elementInfo,elems,i;for(i=0;i<ii;i++){elems=elementInfo[i];elems.callback.call(elems.el,e)}}lastHoveredInfo={elementInfo:[]}}),true)}R.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};R._url=E;var updateGradientReference=function updateGradientReference(element,newGradient,attr){if(attr===void 0){attr="fill"}var gradient=attr==="fill"?element.gradient:element["stroke-gradient"];if(gradient){if(gradient===newGradient){return}gradient.refCount--;if(!gradient.refCount){gradient.parentNode.removeChild(gradient)}attr==="fill"?delete element.gradient:delete element["stroke-gradient"]}if(newGradient){attr==="fill"?element.gradient=newGradient:element["stroke-gradient"]=newGradient;newGradient.refCount++}};var $=R._createNode=function(el,attr){if(typeof el===typeStringSTR){el=R._g.doc.createElementNS(svgNSStr,el)}if(attr){var key,value;for(key in attr){value=isIE9?Str(attr[key]):attr[key];if(xlinkRegx.test(key)){el.setAttributeNS(xlink,key.replace(xlinkRegx,E),value)}else{el.setAttribute(key,value)}}}return el},gradientUnitNames={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},gradientSpreadNames={pad:"pad",redlect:"reflect",repeat:"repeat"},addGradient=function addGradient(element,gradient,attr){var _$;if(attr===void 0){attr="fill"}if(!element.paper||!element.paper.defs){return 0}var type="linear",SVG=element.paper,id=R.getElementID((SVG.id+"-"+gradient).replace(/[()\s%:,\xb0#]/g,"_")),fx=.5,fy=.5,r,cx,cy,units,spread,o=element.node,s=o.style,el=R._g.doc.getElementById(id),vector;if(!el){gradient=Str(gradient).replace(R._radial_gradient,(function(all,opts){type="radial";opts=opts?opts.split(","):[];units=opts[5];spread=opts[6];var _fx=opts[0],_fy=opts[1],_r=opts[2],_cx=opts[3],_cy=opts[4],shifted=_fx&&_fy,dir,sqx;if(_r){r=/%/.test(_r)?_r:toFloat(_r)}if(units===gradientUnitNames.userSpaceOnUse){if(shifted){fx=_fx;fy=_fy}if(_cx&&_cy){cx=_cx;cy=_cy;if(!shifted){fx=cx;fy=cy}}return E}if(shifted){fx=toFloat(_fx);fy=toFloat(_fy);dir=(fy>.5)*2-1;(sqx=pow(fx-.5,2))+pow(fy-.5,2)>.25&&sqx<.25&&(fy=sqrt(.25-sqx)*dir+.5)&&fy!==.5&&(fy=fy.toFixed(5)-1e-5*dir)}if(_cx&&_cy){cx=toFloat(_cx);cy=toFloat(_cy);dir=(cy>.5)*2-1;(sqx=pow(cx-.5,2))+pow(cy-.5,2)>.25&&sqx<.25&&(cy=sqrt(.25-sqx)*dir+.5)&&cy!==.5&&(cy=cy.toFixed(5)-1e-5*dir);if(!shifted){fx=cx;fy=cy}}return E}));gradient=gradient.split(/\s*-\s*/);if(type==="linear"){var angle=gradient.shift(),specs=angle.match(/\((.*)\)/),max;specs=specs&&specs[1]&&specs[1].split(/\s*,\s*/);angle=-toFloat(angle);if(isNaN(angle)){return null}if(specs&&specs.length){if(specs[0]in gradientUnitNames){units=specs.shift();specs[0]in gradientSpreadNames&&(spread=specs.shift())}else{specs[4]&&(units=specs[4]);specs[5]&&(spread=specs[5])}vector=[specs[0]||"0%",specs[1]||"0%",specs[2]||"100%",specs[3]||"0%"]}else{vector=[0,0,math.cos(R.rad(angle)),math.sin(R.rad(angle))];max=1/(mmax(abs(vector[2]),abs(vector[3]))||1);vector[2]*=max;vector[3]*=max;if(vector[2]<0){vector[0]=-vector[2];vector[2]=0}if(vector[3]<0){vector[1]=-vector[3];vector[3]=0}}}var dots=R._parseDots(gradient);if(!dots){return null}el=$(type+"Gradient",{id:id});el.refCount=0;units in gradientUnitNames&&el.setAttribute("gradientUnits",Str(units));spread in gradientSpreadNames&&el.setAttribute("spreadMethod",Str(spread));if(type==="radial"){r!==undefined&&el.setAttribute("r",Str(r));if(cx!==undefined&&cy!==undefined){el.setAttribute("cx",Str(cx));el.setAttribute("cy",Str(cy))}el.setAttribute("fx",Str(fx));el.setAttribute("fy",Str(fy))}else{$(el,{x1:vector[0],y1:vector[1],x2:vector[2],y2:vector[3]})}for(var i=0,ii=dots.length;i<ii;i++){el.appendChild($("stop",{offset:dots[i].offset?dots[i].offset:i?"100%":"0%","stop-color":dots[i].color||"#fff","stop-opacity":dots[i].opacity===undefined?1:dots[i].opacity}))}SVG.defs.appendChild(el)}updateGradientReference(element,el,attr);$(o,(_$={},_$[attr]="url('"+R._url+"#"+id+"')",_$[attr+"-opacity"]=1,_$));s.fill=E;return 1},updatePosition=function updatePosition(o){var bbox=o.getBBox(1);$(o.pattern,{patternTransform:o.matrix.invert()+" translate("+bbox.x+","+bbox.y+")"})},addArrow=function addArrow(o,value,isEnd){if(o.type=="path"){var values=Str(value).toLowerCase().split("-"),p=o.paper,se=isEnd?"end":"start",node=o.node,attrs=o.attrs,stroke=attrs["stroke-width"],i=values.length,type="classic",from,to,dx,refX,attr,w=3,h=3,t=5;while(i--){switch(values[i]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":type=values[i];break;case"wide":h=5;break;case"narrow":h=2;break;case"long":w=5;break;case"short":w=2;break}}if(type=="open"){w+=2;h+=2;t+=2;dx=1;refX=isEnd?4:1;attr={fill:"none",stroke:attrs.stroke}}else{refX=dx=w/2;attr={fill:attrs.stroke,stroke:"none"}}if(o._.arrows){if(isEnd){o._.arrows.endPath&&markerCounter[o._.arrows.endPath]--;o._.arrows.endMarker&&markerCounter[o._.arrows.endMarker]--}else{o._.arrows.startPath&&markerCounter[o._.arrows.startPath]--;o._.arrows.startMarker&&markerCounter[o._.arrows.startMarker]--}}else{o._.arrows={}}if(type!="none"){var pathId="raphael-marker-"+type,markerId="raphael-marker-"+se+type+w+h+"-obj"+o.id;if(!R._g.doc.getElementById(pathId)){p.defs.appendChild($($("path"),{"stroke-linecap":"round",d:markers[type],id:pathId}));markerCounter[pathId]=1}else{markerCounter[pathId]++}var marker=R._g.doc.getElementById(markerId),use;if(!marker){marker=$($("marker"),{id:markerId,markerHeight:h,markerWidth:w,orient:"auto",refX:refX,refY:h/2});use=$($("use"),{"xlink:href":"#"+pathId,transform:(isEnd?"rotate(180 "+w/2+" "+h/2+") ":E)+"scale("+w/t+","+h/t+")","stroke-width":(1/((w/t+h/t)/2)).toFixed(4)});marker.appendChild(use);p.defs.appendChild(marker);markerCounter[markerId]=1}else{markerCounter[markerId]++;use=marker.getElementsByTagName("use")[0]}$(use,attr);var delta=dx*(type!="diamond"&&type!="oval");if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-delta*stroke}else{from=delta*stroke;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}attr={};attr["marker-"+se]="url('"+R._url+"#"+markerId+"')";if(to||from){attr.d=R.getSubpath(attrs.path,from,to)}$(node,attr);o._.arrows[se+"Path"]=pathId;o._.arrows[se+"Marker"]=markerId;o._.arrows[se+"dx"]=delta;o._.arrows[se+"Type"]=type;o._.arrows[se+"String"]=value}else{if(isEnd){from=o._.arrows.startdx*stroke||0;to=R.getTotalLength(attrs.path)-from}else{from=0;to=R.getTotalLength(attrs.path)-(o._.arrows.enddx*stroke||0)}o._.arrows[se+"Path"]&&$(node,{d:R.getSubpath(attrs.path,from,to)});delete o._.arrows[se+"Path"];delete o._.arrows[se+"Marker"];delete o._.arrows[se+"dx"];delete o._.arrows[se+"Type"];delete o._.arrows[se+"String"]}for(attr in markerCounter){if(markerCounter[has](attr)&&!markerCounter[attr]){var item=R._g.doc.getElementById(attr);item&&item.parentNode.removeChild(item)}}}},dasharray={"":[noneStr],none:[noneStr],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},addDashes=function addDashes(o,value,params){if(value!==undefined){var predefValue=dasharray[value.toLowerCase&&value.toLowerCase()],calculatedValues,width,butt,i,widthFactor;value=predefValue||[].concat(value);if(R.is(value,arrayStr)){width=params["stroke-width"]||o.attrs["stroke-width"]||1;butt={round:width,square:width,butt:0}[params["stroke-linecap"]||o.attrs["stroke-linecap"]]||0;i=value.length;widthFactor=predefValue?width:1;if(value[0]===noneStr){calculatedValues=value}else{calculatedValues=[];while(i--){calculatedValues[i]=value[i]*widthFactor+(i%2?1:-1)*butt;calculatedValues[i]<=0&&(calculatedValues[i]=.01+(width<=1?butt:0));if(isNaN(calculatedValues[i])){calculatedValues[i]=0}}}return{"stroke-dasharray":calculatedValues.join(",")}}}},setFillAndStroke=R._setFillAndStroke=function(o,params){if(!o.paper.canvas){return}var node=o.node,attrs=o.attrs,paper=o.paper,el,att,finalAttr={},finalS={},ignoreAttrs={"clip-rect":true},value,pathClip,urlArr,rect;if(o.type===imageStr){(0,_raphael.loadRefImage)(o,params)}for(att in params){if(att in R._availableAttrs){value=params[att];if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}else if(value===null&&!ignoreAttrs[att]){if(att in attrs){delete attrs[att];node.removeAttribute(att==="src"?"href":att)}}else{attrs[att]=value;switch(att){case"blur":o.blur(value);break;case"href":case"title":case"target":var pn=node.parentNode;if(pn.tagName.toLowerCase()!=="a"){if(value===E){break}var hl=$("a");hl.raphael=true;hl.raphaelid=node.raphaelid;pn.insertBefore(hl,node);hl.appendChild(node);pn=hl}if(att==="target"){pn.setAttributeNS(xlink,"show",value==="blank"?"new":value)}else{pn.setAttributeNS(xlink,att,value)}node.titleNode=pn;break;case"cursor":finalS.cursor=value;break;case"transform":o.transform(value);break;case"rotation":if(R.is(value,arrayStr)){o.rotate.apply(o,value)}else{o.rotate(value)}break;case"arrow-start":addArrow(o,value);break;case"arrow-end":addArrow(o,value,1);break;case"clip-path":pathClip=true;case"clip-rect":rect=!pathClip&&Str(value).split(separator);o._.clipispath=!!pathClip;if(pathClip||rect.length===4){o.clip&&o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);var rc=$(pathClip?"path":"rect");el=$("clipPath");el.id=R.getElementID(R.createUUID());$(rc,pathClip?{d:value?attrs["clip-path"]=R._pathToAbsolute(value):R._availableAttrs.path,fill:noneStr}:{x:rect[0],y:rect[1],width:rect[2],height:rect[3],transform:o.matrix.invert()});el.appendChild(rc);paper.defs.appendChild(el);finalAttr["clip-path"]="url('"+R._url+"#"+el.id+"')";o.clip=rc}if(!value){var path=node.getAttribute("clip-path");if(path){var clip=R._g.doc.getElementById(path.replace(/(^url\(#|\)$)/g,E));clip&&clip.parentNode.removeChild(clip);finalAttr["clip-path"]=E;document.documentMode===11&&node.removeAttribute("clip-path");delete o.clip}}break;case"path":if(o.type==="path"){finalAttr.d=value?attrs.path=R._stopabsolutePath?R.sanitizePath(value):R._pathToAbsolute(value):R._availableAttrs.path;o._.dirty=1;if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"width":finalAttr[att]=value;o._.dirty=1;if(attrs.fx){att="x";value=attrs.x}else{break}case"x":if(attrs.fx){value=-attrs.x-(attrs.width||0)}case"rx":if(att==="rx"&&o.type==="rect"){break}case"cx":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"height":finalAttr[att]=value;o._.dirty=1;if(attrs.fy){att="y";value=attrs.y}else{break}case"y":if(o.type===textStr){break}if(attrs.fy){value=-attrs.y-(attrs.height||0)}case"ry":if(att==="ry"&&o.type==="rect"){break}case"cy":finalAttr[att]=value;o.pattern&&updatePosition(o);o._.dirty=1;break;case"r":if(o.type==="rect"){finalAttr.rx=finalAttr.ry=value}else{finalAttr[att]=value}o._.dirty=1;break;case"src":if(o.type===imageStr){node.setAttributeNS(xlink,"href",value)}break;case"stroke-width":if(o._.sx!==1||o._.sy!==1){value/=mmax(abs(o._.sx),abs(o._.sy))||1}if(paper._vbSize){value*=paper._vbSize}if(zeroStrokeFix&&value===0){value=1e-6}finalAttr[att]=value;if(!params["stroke-dasharray"]&&attrs["stroke-dasharray"]&¶ms["stroke-dasharray"]!==""){quickExtend(finalAttr,addDashes(o,attrs["stroke-dasharray"],params))}if(o._.arrows){"startString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&R.addArrow&&R.addArrow(o,o._.arrows.endString,1)}break;case"stroke-dasharray":quickExtend(finalAttr,addDashes(o,value,params));break;case"fill":var isURL=R._ISURL.test(value);if(isURL){urlArr=value.split(R._ISURL);el=$("pattern");var ig=$(imageStr);el.id=R.getElementID(R.createUUID());$(el,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});$(ig,{x:0,y:0,"xlink:href":urlArr[1]});el.appendChild(ig);preLoad(el,ig,urlArr,paper);paper.defs.appendChild(el);finalAttr.fill="url('"+R._url+urlArr[1]+"')";o.pattern=el;o.pattern&&updatePosition(o);break}var clr=R.getRGB(value);if(!clr.error){delete params.gradient;delete attrs.gradient;!R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")&&(finalAttr["fill-opacity"]=attrs["fill-opacity"]);o.gradient&&updateGradientReference(o)}else if((o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value)){attrs.gradient=value;break}if(clr[has]("opacity")){finalAttr["fill-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.fillOpacityDirty=true}else if(o._.fillOpacityDirty&&R.is(attrs["fill-opacity"],"undefined")&&R.is(params["fill-opacity"],"undefined")){node.removeAttribute("fill-opacity");delete o._.fillOpacityDirty}case"stroke":clr=R.getRGB(value);if(clr.error){if(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r"){addGradient(o,value,"stroke")}}else{finalAttr[att]=clr.hex;updateGradientReference(o,UNDEF,att)}if(att==="stroke"){if(clr[has]("opacity")){finalAttr["stroke-opacity"]=clr.opacity>1?clr.opacity/100:clr.opacity;o._.strokeOpacityDirty=true}else if(o._.strokeOpacityDirty&&R.is(attrs["stroke-opacity"],"undefined")&&R.is(params["stroke-opacity"],"undefined")){node.removeAttribute("stroke-opacity");delete o._.strokeOpacityDirty}if(o._.arrows){"startString"in o._.arrows&&addArrow(o,o._.arrows.startString);"endString"in o._.arrows&&addArrow(o,o._.arrows.endString,1)}}break;case"gradient":(o.type==="circle"||o.type==="ellipse"||Str(value).charAt()!=="r")&&addGradient(o,value);break;case"visibility":value===hiddenStr?o.hide():o.show();break;case"opacity":value=value>1?value/100:value;finalAttr.opacity=value;break;case"fill-opacity":value=value>1?value/100:value;finalAttr["fill-opacity"]=value;break;case"shape-rendering":o.attrs[att]=value=shapeRenderingAttrs[value]||value||"auto";finalAttr[att]=value;node.style.shapeRendering=value;break;case"line-height":case"vertical-align":break;default:att===fontSizeStr&&(value=toInt(value,10)+"px");o._.dirty=1;finalAttr[att]=value;if(_raphael.dashedAttr2CSSMap[att]){finalS[_raphael.dashedAttr2CSSMap[att]]=value}break}}}else if(att in allPossibleAttrs){if(value===E&&att in attrs){delete attrs[att];node.removeAttribute(att)}else{attrs[att]=value;finalS[att]=value}}}for(att in finalS){node.style[att]=finalS[att]}for(att in finalAttr){node.setAttribute(att,finalAttr[att])}o.type===textStr&&!params[notToTuneStr]&&tuneText(o,params)},updateFollowers=R._updateFollowers=function(){var i,ii,followerElem,args=(0,_raphael.getArrayCopy)(arguments),o=arrayShift.call(args),fnName=arrayShift.call(args);for(i=0,ii=o.followers.length;i<ii;i++){followerElem=o.followers[i].el;followerElem[fnName].apply(followerElem,args)}},leading=1.2,tuneText=function tuneText(el,params){if(el.type!==textStr||!(params[has](textStr)||params[has]("font")||params[has](fontSizeStr)||params[has]("x")||params[has]("y")||params[has](lineHeightStr)||params[has](vAlignStr)||params[has](textPathStr))){return}var a=el.attrs,defs=el.paper.defs,group=el.parent,node=el.node,fontSize,oldAttr=el._oldAttr=el._oldAttr||{baseLineDiff:8,valign:-.5},lineHeight=toFloat(params[lineHeightStr]||a[lineHeightStr]),direction=params.direction||a.direction||group&&group.attrs&&group.attrs.direction||oldAttr.direction||initialStr,valign,updateNode=false,tspanAttr,updateTspan=false,i,spanArr=[],abbrindx,dummyEl,tspanArr=[],abbrArr=[],hasTags=false,l,ii,j=!isIE&&direction===rtlStr?2:1,texts,tempIESpan,tspan,updateAlignment=false,tspans,text,textChanged=false,removeAllChild,hasnbsp=function hasnbsp(text){return text& Regex.test(text)},spacify=function spacify(text){return text.replace(/\s+/g," ").trim().replace(nbspRegex," ")};if(params[has](textPathStr)){var rUUID=R.getElementID(R.createUUID()),textPathParams=params[textPathStr];var textPath,tSpan,txtNode,dy=0,textPathProps={};for(var key in textPathParams){if(textPathParams.hasOwnProperty(key)){if(key==="path"&&!("href"in textPathParams)){if(oldAttr.textPathStr!==textPathParams[key]){if(el.textPathDef){el.textPathDef.setAttribute("d",textPathParams[key]||E);textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}else{el.textPathDef=defs.appendChild($("path",{id:rUUID,d:textPathParams[key]||E}));textPathProps.href="#"+rUUID;textPathProps["xlink:href"]="#"+rUUID}oldAttr.textPathStr=textPathParams[key]}else{textPathProps.href="#"+el.textPathDef.getAttribute("id");textPathProps["xlink:href"]="#"+el.textPathDef.getAttribute("id")}}else{textPathProps[key]=textPathParams[key]}}}if(params[has](textStr)){txtNode=R._g.doc.createTextNode(params[textStr]||E);oldAttr.pathText=a.text=params[textStr]||E}else{txtNode=R._g.doc.createTextNode(oldAttr.pathText||oldAttr.text||E);oldAttr.pathText=oldAttr.pathText||oldAttr.text||E;delete oldAttr.text}if(params[has](vAlignStr)){if(params[vAlignStr]===middleStr){dy=.3;oldAttr.valign=-.5}else if(params[vAlignStr]===bottomStr){dy=.7;oldAttr.valign=-1}else if(params[vAlignStr]===topStr){oldAttr.valign=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}else{if(oldAttr.tSpan&&(oldAttr.tSpan.textContent===params[textStr]||typeof params[textStr]!==typeStringSTR)){tSpan=oldAttr.tSpan}else{if(oldAttr.valign===-.5){dy=.3}else if(oldAttr.valign===-1){dy=.7}else{dy=0}tSpan=$("tspan",{dy:dy+"em"});tSpan.appendChild(txtNode);oldAttr.tSpan=tSpan}}if(params[textStr]!==UNDEF){delete oldAttr.x;delete oldAttr.y;node.removeAttribute("x");node.removeAttribute("y");textPath=$("textPath",textPathProps);textPath.appendChild(tSpan||txtNode);while(node.firstChild){node.removeChild(node.firstChild)}node.appendChild(textPath)}}else{oldAttr.direction=direction;if(el.textPathDef&&defs){el.textPathDef.parentNode.removeChild(el.textPathDef);delete el.textPathDef}delete oldAttr.txtNode;delete oldAttr.tSpan;delete oldAttr.textPathStr;if(!lineHeight){fontSize=params.fontSize||params[fontSizeStr]||a[fontSizeStr]||group&&group.attrs&&group.attrs.fontSize;fontSize=fontSize?fontSize.toString().replace(pxStr,E):10;lineHeight=fontSize*leading}if(params[has](textStr)||oldAttr.pathText){if(R.is(params.text,arrayStr)){text=params.text.join(brStr)}else if(params.text==null){text=oldAttr.pathText}else{text=params.text}delete oldAttr.pathText;text=text.toString();if(text!==oldAttr.text){textChanged=true;if(text&<gtbrRegex.test(text)){text=text.replace(/</g,"<").replace(/>/g,">").replace(/"|"/g,'"').replace(/'/g,"'").replace(/&<br\/>lt;|&l<br\/>t;|<<br\/>;/g,"<<br/>").replace(/&<br\/>gt;|&g<br\/>t;|><br\/>;/g,"><br/>")}text=text.replace(/<u>/g,"<under>").replace(/<\/u>/g,"</under>").replace(/<b>/g,"<bold>").replace(/<\/b>/g,"</bold>").replace(/<strong>/g,"<bold>").replace(/<\/strong>/g,"</bold>").replace(/<em>/g,"<em>").replace(/<\/em>/g,"</em>").replace(/<i>/g,"<em>").replace(/<\/i>/g,"</em>").replace(/<strike>/g,"<strike>").replace(/<\/strike>/g,"</strike>").replace(/<s>/g,"<strike>").replace(/<\/s>/g,"</strike>").replace(/<del>/g,"<strike>").replace(/<\/del>/g,"</strike>").replace(/<sub>/g,"<sub>").replace(/<\/sub>/g,"</sub>").replace(/<sup>/g,"<sup>").replace(/<\/sup>/g,"</sup>");oldAttr.text=a.text=text;if(textBreakRegx.test(text)){if(oldAttr.noTSpan){oldAttr.noTSpan=!(removeAllChild=true)}texts=Str(text).split(textBreakRegx);l=texts.length}else{removeAllChild=true;oldAttr.noTSpan=true;l=1}if(oldAttr.lineCount!==l){oldAttr.lineCount=l;updateAlignment=true}}}if(lineHeight!==oldAttr.lineHeight){oldAttr.lineHeight=lineHeight;oldAttr.baseLineDiff=lineHeight*.75;updateAlignment=true}if(removeAllChild){while(node.firstChild){node.removeChild(node.firstChild)}}if(oldAttr.lineCount>1){if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanAttr={};if(!oldAttr.tspanAttr){oldAttr.tspanAttr={};oldAttr.tspan0Attr={}}if(oldAttr.tspanAttr.dy!==oldAttr.lineHeight){oldAttr.tspanAttr.dy=tspanAttr.dy=oldAttr.lineHeight;updateTspan=true}if(params[has]("x")&&oldAttr.tspanAttr.x!==params.x){oldAttr.tspan0Attr.x=oldAttr.tspanAttr.x=tspanAttr.x=a.x;updateTspan=true}if(textChanged){tspans=node.childNodes;for(i=0;i<l;i++){tspan=tspans[i*j];spanArr=createValidTextNode(texts[i],abbrArr);if(tspan){tspan.innerHTML=E;if(isIE){while(tspan.firstChild){tspan.removeChild(tspan.firstChild)}}if(updateTspan){$(tspan,i?tspanAttr:oldAttr.tspan0Attr)}}else{tspan=$(tSpanStr,i?oldAttr.tspanAttr:oldAttr.tspan0Attr);node.appendChild(tspan);if(!isIE&&direction===rtlStr){tempIESpan=$(tSpanStr,IESplTspanAttr);tempIESpan.appendChild(R._g.doc.createTextNode("i"));node.appendChild(tempIESpan)}}if(!texts[i]){tspan.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");texts[i]=S}if(hasnbsp(texts[i])){texts[i]=spacify(texts[i]);tspan.style.whiteSpace=PRESERVESTRING}else if(tspan.style.whiteSpace===PRESERVESTRING){tspan.style.whiteSpace=BLANKSTRING}if(spanArr.length){for(var indx=0;indx<spanArr.length;indx++){tspan.appendChild(spanArr[indx])}}else{tspan.appendChild(R._g.doc.createTextNode(texts[i]))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}}else if(updateTspan){tspans=node.childNodes;ii=tspans.length;for(i=0;i<ii;i+=j){$(tspans[i],i?tspanAttr:oldAttr.tspan0Attr)}}ii=l*j;if(node.childNodes.length>ii){for(i=node.childNodes.length-1;i>=ii;i-=1){node.removeChild(node.childNodes[i])}}}else if(textChanged){if(hasnbsp(text)){text=spacify(text);node.style.whiteSpace=PRESERVESTRING}else if(node.style.whiteSpace===PRESERVESTRING){node.style.whiteSpace=BLANKSTRING}tspanArr=createValidTextNode(text,abbrArr);if(tspanArr.length){for(var index=0;index<tspanArr.length;index++){node.appendChild(tspanArr[index])}}else{node.appendChild(R._g.doc.createTextNode(text))}if(abbrArr.length){for(abbrindx=0;abbrindx<abbrArr.length;abbrindx++){dummyEl=el.paper["text"]({display:"none"});dummyEl.node=abbrArr[abbrindx].tspan;if(!el.abbrArr){el.abbrArr=[]}el.abbrArr.push({el:dummyEl,title:abbrArr[abbrindx].title})}}}if(params[vAlignStr]){valign=vAlignMultiplier[a[vAlignStr]]||0;if(valign!==oldAttr.valign){oldAttr.valign=valign;updateAlignment=true}}if(updateAlignment){oldAttr.shift=oldAttr.baseLineDiff+oldAttr.lineCount*oldAttr.lineHeight*oldAttr.valign;updateNode=true}if((params.y||params.y===0)&&oldAttr.y!==params.y){oldAttr.y=a.y;updateNode=true}if(updateNode&&(oldAttr.y||oldAttr.y===0)&&(oldAttr.shift||oldAttr.shift===0)){$(node,{y:Math.round(oldAttr.y+oldAttr.shift)})}}},Element=function Element(node,svg,group){var o=this,parent=group||svg;parent.canvas&&parent.canvas.appendChild(node);o.node=o[0]=node;node.raphael=true;node.raphaelid=o.id=R._oid++;o.matrix=R.matrix();o.realPath=null;o.attrs=o.attrs||{};o.followers=o.followers||[];o.paper=svg;o.ca=o.customAttributes=o.customAttributes||new svg._CustomAttributes;o._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1};o.parent=parent;!parent.bottom&&(parent.bottom=o);o.prev=parent.top;parent.top&&(parent.top.next=o);parent.top=o;o.next=null},getTouchDistance=function getTouchDistance(touch1,touch2,isY){var select=isY?"pageY":"pageX";return Math.abs(touch2[select]-touch1[select])},storeHandlers=R.storeHandlers=function(elem,handler,fn){elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);elem._actualListners.push(handler);elem._derivedListeners.push(fn)},removeHandlers=function removeHandlers(elem,handler){var index=elem._actualListners.indexOf(handler),derivedHandler;if(index!==-1){derivedHandler=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}return derivedHandler},elproto=R.el;Element.prototype=elproto;elproto.constructor=Element;R._engine.getNode=function(el){var node=el.node||el[0].node;return node.titleNode||node};R._engine.getLastNode=function(el){var node=el.node||el[el.length-1].node;return node.titleNode||node};elproto.rotate=function(deg,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"rotate",deg,cx,cy);deg=Str(deg).split(separator);if(deg.length-1){cx=toFloat(deg[1]);cy=toFloat(deg[2])}deg=toFloat(deg[0]);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1);cx=bbox.x+bbox.width/2;cy=bbox.y+bbox.height/2}o.transform(o._.transform.concat([["r",deg,cx,cy]]));return o};elproto.scale=function(sx,sy,cx,cy){var o=this,bbox;if(o.removed){return o}updateFollowers(o,"scale",sx,sy,cx,cy);sx=Str(sx).split(separator);if(sx.length-1){sy=toFloat(sx[1]);cx=toFloat(sx[2]);cy=toFloat(sx[3])}sx=toFloat(sx[0]);sy==null&&(sy=sx);cy==null&&(cx=cy);if(cx==null||cy==null){bbox=o.getBBox(1)}cx=cx==null?bbox.x+bbox.width/2:cx;cy=cy==null?bbox.y+bbox.height/2:cy;o.transform(o._.transform.concat([["s",sx,sy,cx,cy]]));return o};elproto.translate=function(dx,dy){var o=this;if(o.removed){return o}updateFollowers(o,"translate",dx,dy);dx=Str(dx).split(separator);if(dx.length-1){dy=toFloat(dx[1])}dx=toFloat(dx[0])||0;dy=+dy||0;o.transform(o._.transform.concat([["t",dx,dy]]));return o};elproto.transform=function(tstr){var o=this,_=o._,sw;if(tstr==null){return _.transform}R._extractTransform(o,tstr);o.clip&&!_.clipispath&&$(o.clip,{transform:o.matrix.invert()});o.pattern&&updatePosition(o);o.node&&$(o.node,{transform:o.matrix});if(_.sx!==1||_.sy!==1){sw=o.attrs["stroke-width"];sw&&o.attr({"stroke-width":sw})}return o};elproto.hide=function(){var o=this;updateFollowers(o,"hide");!o.removed&&o.paper.safari(o.node.style.display=noneStr);return o};elproto.show=function(){var o=this;updateFollowers(o,"show");!o.removed&&o.paper.safari(o.node.style.display=E);return o};elproto.remove=function(){if(this.removed||!this.parent.canvas){return}var o=this,node=R._engine.getNode(o),paper=o.paper,defs=paper.defs,i;paper.__set__&&paper.__set__.exclude(o);eve.unbind("raphael.*.*."+o.id);if(o.gradient&&defs){updateGradientReference(o)}if(o["stroke-gradient"]&&defs){updateGradientReference(o,UNDEF,"stroke")}if(o.textPathDef&&defs){o.textPathDef.parentNode.removeChild(o.textPathDef);delete o.textPathDef}while(i=o.followers.pop()){i.el.remove()}while(i=o.bottom){i.remove()}if(o._drag){o.undrag()}if(o.events){while(i=o.events.pop()){i.unbind()}}o.parent.canvas.contains(node)&&o.parent.canvas.removeChild(node);o.removeData();delete paper._elementsById[o.id];R._tear(o,o.parent);for(i in o){o[i]=typeof o[i]===fnStr?R._removedFactory(i):null}o.removed=true};elproto._getBBox=function(){var fn,o=this,node=o.node,bbox={},a=o.attrs,align,hide,isText=o.type===textStr;if(isIE&&isText){fn=(0,_raphael.showRecursively)(o)}else{if(node.style.display===noneStr){o.show();hide=true}}try{bbox=node.getBBox();if(isText){if(bbox.x===undefined){bbox.isCalculated=true;align=a["text-anchor"];bbox.x=(a.x||0)-bbox.width*(align==="start"?0:align===middleStr?.5:1)}if(bbox.y===undefined){bbox.isCalculated=true;align=a[vAlignStr];bbox.y=(a.y||0)-bbox.height*(align===bottomStr?1:align===middleStr?.5:0)}}}catch(e){}finally{bbox=bbox||{}}isIE&&isText?fn&&fn():hide&&o.hide();return bbox};elproto.attr=function(name,value){if(this.removed){return this}var elem=this,attrs=this.attrs,key,finalParam={},i,ii,params,subkey,par,follower,invokedCa=elem._invokedCa||(elem._invokedCa={}),ca,caObj=this.ca;if(name==null){var res={};for(key in attrs){if(attrs[has](key)){res[key]=attrs[key]}}res.gradient&&res.fill===noneStr&&(res.fill=res.gradient)&&delete res.gradient;res.transform=this._.transform;res.visibility=this.node.style.display===noneStr?hiddenStr:visibleStr;return res}else{if(value==null){if(R.is(name,objectStr)){params=name}else if(R.is(name,typeStringSTR)){if(name===fillStr&&attrs.fill===noneStr&&attrs.gradient){return attrs.gradient}if(name===transformStr){return this._.transform}if(name===visibilityStr){return this.node.style.display===noneStr?hiddenStr:visibleStr}if(name in attrs){return attrs[name]}else if(R.is(caObj[name],fnStr)){return caObj[name].def}return R._availableAttrs[name]}}else{params={};params[name]=value}if(!R.stopPartialEventPropagation){for(key in params){eve("raphael.attr."+key+"."+this.id,this,params[key],key)}}for(key in params){ca=caObj[key];if(ca&&!invokedCa[key]&&R.is(ca,fnStr)){invokedCa[key]=true;par=ca.apply(this,[].concat(params[key]));invokedCa[key]=false;for(subkey in par){finalParam[subkey]=par[subkey]}attrs[key]=params[key]}else{finalParam[key]=params[key]}}setFillAndStroke(this,finalParam);for(i=0,ii=this.followers.length;i<ii;i++){follower=this.followers[i];follower.cb&&!follower.cb.call(follower.el,finalParam,this)||follower.el.attr(finalParam)}return this}};elproto.pinchstart=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];elem._blockDrag=true;e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}else{elem._blockDrag=false}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchstart",fn)};elproto.unpinchstart=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem.__blockDrag=false;elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchstart",derivedHandler)};elproto.pinchmove=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){if(e.touches&&e.touches.length===2){var touch1=e.touches[0],touch2=e.touches[1];e&&e.preventDefault();elem._pinchDragStarted=true;R.makeSelectiveCopy(dummyEve,e);dummyEve.data={finger0:touch1,finger1:touch2,distanceX:getTouchDistance(touch1,touch2),distanceY:getTouchDistance(touch1,touch2,true)};handler.call(context||elem,dummyEve)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchmove",fn)};elproto.unpinchmove=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("touchmove",derivedHandler)};elproto.pinchend=function(handler,context){var elem=this,fn=function fn(e){if(elem._pinchDragStarted){elem._pinchDragStarted=false;handler.call(context||elem,e)}};storeHandlers(elem,handler,fn);elem.node.addEventListener("touchend",fn)};elproto.unpinchend=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);elem._pinchDragStarted=false;derivedHandler&&elem.node.removeEventListener("touchend",derivedHandler)};elproto.pinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.pinchstart.call(this,pinchstarthandler);elproto.pinchin.call(this,pinchinhandler);elproto.pinchend.call(this,pinchendhandler)};elproto.unpinch=function(pinchstarthandler,pinchinhandler,pinchendhandler){elproto.unpinchstart.call(this,pinchstarthandler);elproto.unpinchin.call(this,pinchinhandler);elproto.unpinchend.call(this,pinchendhandler)};elproto.fcwheel=function(handler,context){var elem=this,dummyEve={},fn=function fn(e){e&&e.preventDefault();R.makeSelectiveCopy(dummyEve,e);handler.call(context||elem,dummyEve)};storeHandlers(elem,handler,fn);elem.node.addEventListener("wheel",fn)};elproto.fcunwheel=function(handler){var elem=this,derivedHandler=removeHandlers(elem,handler);derivedHandler&&elem.node.removeEventListener("wheel",derivedHandler)};elproto.on=function(eventType,handler,context){if(!handler||!eventType){return}var elem=this,node,actualEventType,isSafe=eventType.match(/fc-/),fn=handler;if(this.removed){return this}elem._actualListners||(elem._actualListners=[]);elem._derivedListeners||(elem._derivedListeners=[]);switch(eventType){case"fc-dragstart":elem.drag(null,handler);return elem;case"fc-dragmove":elem.drag(handler);return elem;case"fc-dragend":elem.drag(null,null,handler);return elem;case"fc-dbclick":elem.dbclick(handler,context);return elem;case"fc-pinchstart":elem.pinchstart(handler,context);return elem;case"fc-pinchmove":elem.pinchmove(handler,context);return elem;case"fc-pinchend":elem.pinchend(handler,context);return elem;case"fc-click":elem.fcclick(handler,context);return elem;case"fc-wheel":elem.fcwheel(handler,context);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){fn=function fn(e){if(!(supportsPointer&&supportsTouch&&!e.isPrimary)){lastHoveredInfo.elementInfo.push({el:context||elem,callback:handler});lastHoveredInfo.srcElement=e.srcElement||e.target}};eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg&&(eventType==="load"||eventType==="error")){node=this._.RefImg;fn=function fn(e){!elem.removed&&handler.call(elem,e)}}else{node=this.node}if(fn===handler){fn=function fn(e){!(supportsPointer&&supportsTouch&&!e.isPrimary)&&handler.call(context||elem,e)}}elem._actualListners.push(handler);elem._derivedListeners.push(fn);if(node.addEventListener){node.addEventListener(eventType,fn)}else{node["on"+eventType]=fn}return this};elproto.off=function(eventType,handler){var elem=this,fn=handler,actualEventType,index,isSafe=eventType.match(/fc-/),node;if(this.removed||!elem._actualListners||!eventType||!handler){return this}switch(eventType){case"fc-dragstart":elem.undragstart(handler);return elem;case"fc-dragmove":elem.undragmove(handler);return elem;case"fc-dragend":elem.undragend(handler);return elem;case"fc-dbclick":elem.undbclick(handler);return elem;case"fc-pinchstart":elem.unpinchstart(handler);return elem;case"fc-pinchmove":elem.unpinchmove(handler);return elem;case"fc-pinchend":elem.unpinchend(handler);return elem;case"fc-click":elem.fcunclick(handler);return elem;case"fc-wheel":elem.fcunwheel(handler);return elem}isSafe&&(eventType=eventType.replace(/fc-/,""));fn=handler;if(isSafe){if(supportsTouch){actualEventType=eventType;eventType=(supportsPointer?R.safePointerEventMapping[eventType]:safeMouseEventMapping[eventType])||eventType;if(actualEventType==="mouseout"){eventType=supportsPointer?"pointerover":"touchstart"}}}if(this._&&this._.RefImg){node=this._.RefImg}else{node=this.node}index=elem._actualListners.indexOf(fn);if(index!==-1){fn=elem._derivedListeners[index];elem._actualListners.splice(index,1);elem._derivedListeners.splice(index,1)}if(node.removeEventListener){node.removeEventListener(eventType,fn)}else{node["on"+eventType]=null}return this};R._engine.path=function(svg,attrs,group){var el=$("path"),res=new Element(el,svg,group);res.type="path";attrs&&res.attr(attrs);return res};R._engine.group=function(svg,id,group,overrideId){var el=$("g"),res=new Element(el,svg,group);res.type="group";res.canvas=res.node;res.top=res.bottom=null;res._id=id||E;if(id){if(overrideId){el.setAttribute("class","raphael-group-"+id)}else{el.setAttribute("class","raphael-group-"+res.id+"-"+id)}}return res};R._engine.circle=function(svg,attrs,group){var el=$("circle"),res=new Element(el,svg,group);res.type="circle";attrs&&res.attr(attrs);return res};R._engine.rect=function(svg,attrs,group){var el=$("rect"),res=new Element(el,svg,group);res.type="rect";attrs.rx=attrs.ry=attrs.r;attrs&&res.attr(attrs);return res};R._engine.ellipse=function(svg,attrs,group){var el=$("ellipse"),res=new Element(el,svg,group);res.type="ellipse";attrs&&res.attr(attrs);return res};R._engine.image=function(svg,attrs,group){var el=$(imageStr),res=new Element(el,svg,group,true);res._.group=group||svg;res.type=imageStr;el.setAttribute("preserveAspectRatio",noneStr);attrs&&res.attr(attrs);return res};R._engine.text=function(svg,attrs,group,css){var el=$(textStr),res=new Element(el,svg,group);res.type=textStr;css&&res.css&&res.css(css,undefined,true);attrs&&res.attr(attrs);return res};R._engine.setSize=function(width,height){this.width=width||this.width;this.height=height||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);if(this._viewBox){this.setViewBox.apply(this,this._viewBox)}return this};R._engine.create=function(){var con=R._getContainer.apply(0,arguments),container=con&&con.container,x=con.x,y=con.y,width=con.width,height=con.height,paper;if(!container){throw new Error("SVG container not found.")}var cnvs=$("svg"),css="overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);"+"-webkit-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;"+"-ms-user-select:none;user-select:none;-o-user-select:none;cursor:default;"+"vertical-align:middle;",isFloating;if(supportsTouch){if(R.isIE10){css+="-ms-touch-action:pan-y;"}else{css+="touch-action:pan-y;"}}x=x||0;y=y||0;width=width||512;height=height||342;$(cnvs,{height:height,version:1.1,width:width,xmlns:svgNSStr});if(container===1){cnvs.style.cssText=css+"position:absolute;left:"+x+"px;top:"+y+pxStr;container=R._g.doc.body;container.appendChild(cnvs);isFloating=1}else{cnvs.style.cssText=css+"position:relative";if(container.firstChild){container.insertBefore(cnvs,container.firstChild)}else{container.appendChild(cnvs)}}paper=new R._Paper;paper.width=width;paper.height=height;paper.canvas=cnvs;paper.container=container;$(cnvs,{id:"raphael-paper-"+paper.id});paper.clear();paper._left=paper._top=0;isFloating&&(paper.renderfix=function(){});paper.renderfix();return paper};R._engine.setViewBox=function(x,y,w,h,fit){eve("raphael.setViewBox",this,this._viewBox,[x,y,w,h,fit]);var size=mmax(w/this.width,h/this.height),top=this.top,aspectRatio=fit?"meet":"xMinYMin",vb,sw;if(x==null){if(this._vbSize){size=1}delete this._vbSize;vb="0 0 "+this.width+S+this.height}else{this._vbSize=size;vb=x+S+y+S+w+S+h}$(this.canvas,{viewBox:vb,preserveAspectRatio:aspectRatio});if(size){while(top){sw="stroke-width"in top.attrs?top.attrs["stroke-width"]:1;top.attr({"stroke-width":sw});top._.dirty=1;top._.dirtyT=1;top=top.prev}}this._viewBox=[x,y,w,h,!!fit];return this};R.prototype.detachPaper=function(){if(this._detached!==false){this.container.removeChild(this.canvas);this._detached=true}};R.prototype.attachPaper=function(){if(this._detached){this.container.appendChild(this.canvas);this._detached=false}};R.prototype.renderfix=function(){var cnvs=this.canvas,s=cnvs.style,pos;try{pos=cnvs.getScreenCTM()||cnvs.createSVGMatrix()}catch(e){pos=cnvs.createSVGMatrix()}var left=-pos.e%1,top=-pos.f%1;if(left||top){if(left){this._left=(this._left+left)%1;s.left=this._left+pxStr}if(top){this._top=(this._top+top)%1;s.top=this._top+pxStr}}};R.prototype._desc=function(txt){var desc=this.desc;if(!desc){this.desc=desc=$("desc");this.canvas.appendChild(desc)}else{while(desc.firstChild){desc.removeChild(desc.firstChild)}}desc.appendChild(R._g.doc.createTextNode(R.is(txt,typeStringSTR)?txt:"Created with Red Raphaël "+R.version))};R.prototype.clear=function(){var c;eve("raphael.clear",this);while(c=this.bottom){c.remove()}c=this.canvas;while(c.firstChild){c.removeChild(c.firstChild)}this.bottom=this.top=null;c.appendChild(this.desc=$("desc"));c.appendChild(this.defs=$("defs"))};R.prototype.remove=function(){var i;eve("raphael.remove",this);while(i=this.bottom){i.remove()}this.defs&&this.defs.parentNode.removeChild(this.defs);this.desc&&this.desc.parentNode.removeChild(this.desc);this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(i in this){this[i]=typeof this[i]===fnStr?R._removedFactory(i):null}this.removed=true};R.prototype.setHTMLClassName=function(){}}} |
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports._drawScrollBar=_drawScrollBar;exports.getCrispPath=exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _safeMin=_interopRequireDefault(require("@fusioncharts/utils/src/array/safe-min"));var _safeMax=_interopRequireDefault(require("@fusioncharts/utils/src/array/safe-max"));var _componentInterface=require("../component-interface");var _lib=require("../lib");var _dependencyManager=require("../dependency-manager");var UNDEF,R=(0,_dependencyManager.getDep)("redraphael","plugin"),PXSTRING="px",DASH_DEF="none",NORMALSTRING="normal",TREND="trend",CAT_VLINE="catVLine",LABEL="label",LINE="line",BAND="band",CAT_BAND="catBand",TREND_LINE_COLOR="333333",pInt=function pInt(s,mag){return parseInt(s,mag||10)},createGroup=function createGroup(groupName,parentContainer,axis){return axis.getFromEnv("animationManager").setAnimation({el:"group",attr:{name:groupName},container:parentContainer,state:"appearing",component:axis,label:"group"})},roundToMultiple=function roundToMultiple(num,multiple){if(multiple===void 0){multiple=0}var remainder;if(multiple===0)return num;remainder=Math.abs(num)%multiple;if(remainder===0)return num;if(num<0)return-(Math.abs(num)-remainder);return num+multiple-remainder},getCrispPath=function getCrispPath(path,width){var isCrisped=false,oddWidth=width%2,value,roundValue;if(path[1]===path[4]){value=path[1];roundValue=Math.round(value);path[1]=path[4]=oddWidth?roundValue>value?roundValue-.5:roundValue+.5:roundValue;isCrisped=true}if(path[2]===path[5]){value=path[2];roundValue=Math.round(value);path[2]=path[5]=oddWidth?roundValue>value?roundValue-.5:roundValue+.5:roundValue;isCrisped=true}return{path:path,isCrisped:isCrisped}},_forceValidLowerLimit=function _forceValidLowerLimit(value,limit){return value<limit?limit:value},_drawLimitUpdater=function _drawLimitUpdater(limitUpdater){limitUpdater.draw()};exports.getCrispPath=getCrispPath;function sanitiseComponentName(name){var sanitisedName=_lib.BLANKSTRING;if(name===TREND||name===TREND+"s"){sanitisedName=TREND}if(name===CAT_VLINE||name===CAT_VLINE+"s"){sanitisedName=CAT_VLINE}if(name===LABEL||name===LABEL+"s"){sanitisedName=LABEL+"s"}if(name===LINE||name===LINE+"s"){sanitisedName=LINE+"s"}if(name===BAND||name===BAND+"s"){sanitisedName=BAND}if(name===CAT_BAND||name===CAT_BAND+"s"){sanitisedName=CAT_BAND}return sanitisedName}function _drawScrollBar(){var axis=this,chart=axis.getFromEnv("chart"),chartConfig=chart.config,graphics=chart.graphics,axisConfig=axis.config,axisRange=axisConfig.axisRange,scrollOptions=chartConfig.scrollOptions||(chartConfig.scrollOptions={}),max=axisRange.max,min=axisRange.min,scrollBar=axis.getLinkedItem("scrollBar"),scrollNode=scrollBar&&scrollBar.config.node,canvasLeft,canvasTop,canvasHeight,canvasConfig=chart.getChildren("canvas")[0].config,canvasBorderWidth,axisLineWidth,axisLineStartExtension,axisLineEndExtension,scrollRatio,windowedCanvasWidth,fullCanvasWidth,scrollBarParentGroup,visibleConfig,visibleRange,totalRange,scrollPosition;if(!scrollBar){return}canvasLeft=canvasConfig.canvasLeft;canvasTop=canvasConfig.canvasTop;canvasHeight=canvasConfig.canvasHeight;canvasBorderWidth=canvasConfig.canvasBorderWidth;axisLineWidth=axisConfig.showAxisLine?axisConfig.axisLineThickness||0:0;axisLineStartExtension=(0,_lib.pluckNumber)(canvasBorderWidth,axisConfig.lineStartExtension);axisLineEndExtension=(0,_lib.pluckNumber)(canvasBorderWidth,axisConfig.lineEndExtension);scrollOptions.viewPortMin=min;scrollOptions.viewPortMax=max;visibleConfig=axis.getVisibleConfig();visibleRange=visibleConfig.maxValue-visibleConfig.minValue;totalRange=axisRange.max-axisRange.min;scrollRatio=visibleRange/totalRange;scrollPosition=(visibleConfig.minValue-axisRange.min)/(totalRange-visibleRange);windowedCanvasWidth=scrollOptions.windowedCanvasWidth=axis.getPixel(scrollOptions.vxLength);fullCanvasWidth=scrollOptions.fullCanvasWidth=axis.getPixel(max-min)-windowedCanvasWidth;scrollBarParentGroup=graphics.scrollBarParentGroup;if(!scrollBarParentGroup){scrollBarParentGroup=graphics.scrollBarParentGroup=createGroup("scrollBarParentGroup",graphics.parentGroup).insertBefore(chart.getChildContainer().datalabelsGroup)}if(axisConfig.scrollEnabled!==false){if(axisConfig.isVertical){scrollBar.draw(canvasLeft,canvasTop,{height:canvasHeight,scrollRatio:scrollRatio,roundEdges:canvasConfig.isRoundEdges,fullCanvasWidth:fullCanvasWidth,windowedCanvasWidth:windowedCanvasWidth,scrollPosition:scrollPosition,parentLayer:scrollBarParentGroup})}else{scrollBar.draw(canvasLeft-axisLineStartExtension,canvasTop+canvasHeight+canvasBorderWidth+axisLineWidth-2,{width:canvasConfig.canvasWidth+axisLineStartExtension+axisLineEndExtension,scrollRatio:scrollRatio,roundEdges:canvasConfig.isRoundEdges,fullCanvasWidth:fullCanvasWidth,windowedCanvasWidth:windowedCanvasWidth,scrollPosition:scrollPosition,parentLayer:scrollBarParentGroup})}!scrollNode&&function(){var prevPos;R.eve.on("raphael.scroll.start."+scrollBar.config.node.id,(function(pos){axis.setState("scrolling",true);prevPos=pos;chart.fireChartInstanceEvent("scrollstart",{scrollPosition:pos})}));R.eve.on("raphael.scroll.end."+scrollBar.config.node.id,(function(pos){axis.setState("scrolling",false);chart.fireChartInstanceEvent("scrollend",{prevScrollPosition:prevPos,scrollPosition:pos})}))}()}else{scrollBar&&scrollBar.node&&scrollBar.node.hide()}axisConfig.scrollBarDrawn=true}var CartesianAxis=function(_ComponentInterface){(0,_inheritsLoose2.default)(CartesianAxis,_ComponentInterface);function CartesianAxis(){var _this;_this=_ComponentInterface.call(this)||this;_this._drawScrollBar=_drawScrollBar;return _this}var _proto=CartesianAxis.prototype;_proto.getType=function getType(){return"axis"};_proto.getName=function getName(){return"cartesian"};_proto.__setDefaultConfig=function __setDefaultConfig(){_ComponentInterface.prototype.__setDefaultConfig.call(this);var config=this.config;config.setAdaptiveMin=0;config.adjustDiv=1;config.axisNameWidth=UNDEF;config.rotateAxisName=0;config.useEllipsesWhenOverflow=1;config.divLineColor=UNDEF;config.divLineAlpha=UNDEF;config.divLineThickness=UNDEF;config.divLineIsDashed=UNDEF;config.divLineDashLen=UNDEF;config.divLineDashGap=UNDEF;config.showAlternateGridColor=UNDEF;config.alternateGridColor=UNDEF;config.alternateGridAlpha=UNDEF;config.showZeroPlane=1;config.zeroPlaneAlpha=80;config.showZeroPlaneValue=1;config.showZeroPlaneOnTop=1;config.showAxisLine=UNDEF;config.axisLineThickness=UNDEF;config.axisLineAlpha=UNDEF;config.tickLength=UNDEF;config.trendlineToolText=UNDEF;config.trendlineColor=TREND_LINE_COLOR;config.trendlineThickness=1;config.trendlineAlpha=UNDEF;config.showTrendlinesOnTop=0;config.trendlinesAreDashed=0;config.trendlinesDashLen=5;config.trendlinesDashGap=2;config.isTrendZone=UNDEF;config.showTrendlines=1;config.showTrendlineLabels=1;config.showLabels=1;config.maxLabelHeight=UNDEF;config.rotateLabels=UNDEF;config.slantLabel=0;config.showAxisValues=1;config.showTooltip=1;config.isActive=true;config.drawLabels=true;config.drawOnlyCategoryLine=false;config.drawLabelsOpposit=false;config.drawPlotlines=true;config.drawAxisLine=true;config.drawPlotBands=true;config.drawAxisName=true;config.drawAxisNameOpposit=false;config.axisNameAlignCanvas=false;config.drawAxisNameFromBottom=false;config.drawTrendLines=true;config.drawTrendLabels=true;config.drawTick=true;config.drawTickMinor=true;config.animateAxis=true;config.drawAxisLineWRTCanvas=true;config.isRelativeAxisInverse=false;config.axisIndex=0;config.uniqueClassName=0;config.viewPortRatio={};config.canvas={};config.axisRange={};config.isConfigured=true;config.axisDimention={};config.extremeLabels={firstLabel:{},lastLabel:{}};config._setRangeAgain=false;config._defaultForceDecimal=UNDEF;config._defaultDecimalPrecision=UNDEF;config.rangeChanged=false;config.dimensionChanged=false;config.apparentScrollPos=0;this.addToEnv("componentInfo",{catVLine:[],trend:[],labels:[],lines:[],bands:[],catBand:[]})};_proto.configure=function configure(rawAttr){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),is3D=axis.getFromEnv("chart").config.is3D,FCChartObj=chart.getFromEnv("dataSource").chart,numberFormatter=axis.getFromEnv("number-formatter"),tempAxis=axis.getFromEnv("tempAxis"),axisAttr,fontBdrColor,trendFontBdrColor,labelFontBdrColor,i,j,axisAttrTrend,rawAttrTrend;axisAttr=axisConfig.rawAttr=rawAttr;if(rawAttr.vtrendlines){for(i=0;i<rawAttr.vtrendlines.length;++i){for(j=0;j<rawAttr.vtrendlines[i].line.length;++j){axisAttrTrend=axisAttr.vtrendlines[i].line[j];rawAttrTrend=rawAttr.vtrendlines[i].line[j];axisAttrTrend.startvalue=(0,_lib.pluckNumber)(rawAttrTrend.startvalue,UNDEF);axisAttrTrend.endvalue=(0,_lib.pluckNumber)(rawAttrTrend.endvalue,rawAttrTrend.startvalue);axisAttrTrend.color=(0,_lib.pluck)(rawAttrTrend.color,"FFFFFF");axisAttrTrend.istrendzone=(0,_lib.pluckNumber)(rawAttrTrend.istrendzone,1);axisAttrTrend.thickness=(0,_lib.pluckNumber)(rawAttrTrend.thickness,1);axisAttrTrend.trendTextAlpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,axisConfig.trendlineAlpha,99);axisAttrTrend.alpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,40);axisAttrTrend.tooltext=(0,_lib.pluck)(rawAttrTrend.tooltext,"")}}}if(rawAttr.trendlines){for(i=0;i<rawAttr.trendlines.length;++i){for(j=0;j<rawAttr.trendlines[i].line.length;++j){axisAttrTrend=axisAttr.trendlines[i].line[j];rawAttrTrend=rawAttr.trendlines[i].line[j];axisAttrTrend.startvalue=(0,_lib.pluckNumber)(rawAttrTrend.startvalue,UNDEF);axisAttrTrend.endvalue=(0,_lib.pluckNumber)(rawAttrTrend.endvalue,rawAttrTrend.startvalue);axisAttrTrend.color=(0,_lib.pluck)(rawAttrTrend.color,"FFFFFF");axisAttrTrend.istrendzone=(0,_lib.pluckNumber)(rawAttrTrend.istrendzone,1);axisAttrTrend.thickness=(0,_lib.pluckNumber)(rawAttrTrend.thickness,1);axisAttrTrend.trendTextAlpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,axisConfig.trendlineAlpha,99);axisAttrTrend.alpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,40);axisAttrTrend.showOnTop=(0,_lib.pluckNumber)(rawAttrTrend.showOnTop,1);axisAttrTrend.valueOnRight=(0,_lib.pluckNumber)(rawAttrTrend.valueOnRight,0)}}}axisConfig.trendLines=axisAttr.trendlines;axisConfig.vTrendLines=axisAttr.vtrendlines;(0,_lib.parseConfiguration)(axisAttr,axisConfig);axisConfig.axisName=(0,_lib.parseUnsafeString)(axisAttr.axisName);axisConfig.axisValuePadding=axisConfig.axisNamePadding||(0,_lib.pluckNumber)(axisAttr.axisValuePadding,4);axisConfig.axisNamePadding=axisConfig.axisNamePadding||(0,_lib.pluckNumber)(axisAttr.axisNamePadding,5);axisConfig.maxLabelWidthPercent=(0,_lib.pluckNumber)(axisAttr.maxLabelWidthPercent);axisConfig.maxLabelWidthPercent=Math.abs(axisConfig.maxLabelWidthPercent);axisConfig.minLabelWidthPercent=Math.abs((0,_lib.pluckNumber)(axisAttr.minLabelWidthPercent));axisConfig.numDivLines=(0,_lib.pluckNumber)(axisAttr.numDivLines,4);axisConfig.numDivLines=_forceValidLowerLimit(axisConfig.numDivLines,0);axisConfig.categoryNumDivLines=(0,_lib.pluckNumber)(axisAttr.numDivLines,0);axisConfig.axisValuePadding=_forceValidLowerLimit(axisConfig.axisValuePadding,0);axisConfig.isReverse=Number(axisAttr.isReverse,0);axisConfig.isOpposit=Number(axisAttr.isOpposit,0);axisConfig.isVertical=Number(axisAttr.isVertical,0);axisConfig.categoryDivLinesFromZero=1;axisConfig.axisMinValue=numberFormatter.getCleanValue(axisAttr.axisMinValue);axisConfig.axisMaxValue=numberFormatter.getCleanValue(axisAttr.axisMaxValue);axisConfig.zeroPlaneColor=(0,_lib.pluck)(axisAttr.zeroPlaneColor,axisAttr.divLineColor);axisConfig.zeroPlaneThickness=(0,_lib.pluck)(axisAttr.zeroPlaneThickness,axisAttr.divLineThickness);axisConfig.axisLineColor=(0,_lib.convertColor)(axisAttr.axisLineColor,axisAttr.axisLineAlpha);axisConfig.tickAlpha=(0,_lib.pluckNumber)(axisAttr.tickAlpha,axisConfig.axisLineAlpha);axisConfig.tickColor=(0,_lib.convertColor)((0,_lib.pluck)(axisAttr.tickColor,axisAttr.axisLineColor),axisConfig.tickAlpha);axisConfig.tickWidth=(0,_lib.pluckNumber)(axisAttr.tickWidth,axisConfig.axisLineThickness);axisConfig.maxZoomLimit=(0,_lib.pluckNumber)(FCChartObj.maxzoomlimit,chart.maxzoomlimit,1e3);axisConfig.showVLines=(0,_lib.pluckNumber)(FCChartObj.showvlines,1);axisConfig.showVLinesOnTop=(0,_lib.pluckNumber)(FCChartObj.showvlinesontop,0);axisConfig.showVLineLabels=(0,_lib.pluckNumber)(FCChartObj.showvlinelabels,this.showVLineLabels,1);axisConfig.showVLineLabelBorder=(0,_lib.pluckNumber)(FCChartObj.showvlinelabelborder,1);axisConfig.rotateVLineLabels=(0,_lib.pluckNumber)(FCChartObj.rotatevlinelabels,0);axisConfig.vLineColor=(0,_lib.pluck)(FCChartObj.vlinecolor,"333333");axisConfig.vLineLabelColor=(0,_lib.pluck)(FCChartObj.vlinelabelcolor);axisConfig.vLineThickness=(0,_lib.pluck)(FCChartObj.vlinethickness,1);axisConfig.vLineAlpha=(0,_lib.pluckNumber)(FCChartObj.vlinealpha,80);axisConfig.vLineLabelBgColor=(0,_lib.pluck)(FCChartObj.vlinelabelbgcolor,"ffffff");axisConfig.vLineLabelBgAlpha=(0,_lib.pluckNumber)(FCChartObj.vlinelabelbgalpha,is3D?50:100);axisConfig.staggerLines=Math.max((0,_lib.pluckNumber)(FCChartObj.staggerlines,2),2);axisConfig.staggerLines=_forceValidLowerLimit(axisConfig.staggerLines,1);axisConfig.trendlineValuesOnOpp=(0,_lib.pluck)(axisAttr.trendlineValuesOnOpp,axisAttr.trendlineValuesOnOpp,0);axisConfig.labelDisplay=(0,_lib.pluck)(axisAttr.labelDisplay,"auto").toLowerCase();axisConfig.labelStep=(0,_lib.pluckNumber)(axisAttr.labelStep,0);axisConfig.labelStep=Math.round(axisConfig.labelStep);axisConfig.labelStep=_forceValidLowerLimit(axisConfig.labelStep,0);axisConfig.startPad=0;axisConfig.endPad=0;axisConfig._oriLabelStep=axisConfig.labelStep;axisConfig.showLimits=(0,_lib.pluckNumber)(axisAttr.showLimits,axisConfig.showAxisValues);axisConfig.showUpperLimit=axisAttr.showLimits;axisConfig.showDivLineValues=(0,_lib.pluckNumber)(axisAttr.showDivLineValues,axisConfig.showAxisValues);axisConfig.showCanvasBorder=chart.getChildren("canvas")[0].config.showCanvasBorder?1:0;axisConfig.axisBreak=axisAttr.axisBreaks;axisConfig.isBreak=!!axisConfig.axisBreak;if(axisConfig.isBreak){axis._processAxisBreak()}fontBdrColor=(0,_lib.getFirstValue)(axisAttr.axisNameBorderColor,_lib.BLANKSTRING);fontBdrColor=fontBdrColor?(0,_lib.convertColor)(fontBdrColor,(0,_lib.pluckNumber)(axisAttr.axisNameBorderAlpha,axisAttr.axisNameAlpha,100)):_lib.BLANKSTRING;axisConfig.name=axisConfig.name||{};axisConfig.name.style={fontFamily:(0,_lib.pluck)(axisAttr.axisNameFont,axisAttr.outCanfontFamily),fontSize:(0,_lib.pluck)(axisAttr.axisNameFontSize,pInt(axisAttr.outCanfontSize))+PXSTRING,fontSizeWithUnit:(0,_lib.pluckFontSizeMaintainUnit)(axisAttr.axisNameFontSizeWithUnit,axisAttr.outCanfontSizeWithUnit),color:(0,_lib.convertColor)((0,_lib.pluck)(axisAttr.axisNameFontColor,axisAttr.outCancolor),(0,_lib.pluckNumber)(axisAttr.axisNameFontAlpha,axisAttr.axisNameAlpha,100)),fontWeight:(0,_lib.pluckNumber)(axisAttr.axisNameFontBold,1)?"bold":NORMALSTRING,fontStyle:(0,_lib.pluckNumber)(axisAttr.axisNameFontItalic)?"italic":NORMALSTRING,border:fontBdrColor||axisAttr.axisNameBgColor?(0,_lib.pluckNumber)(axisAttr.axisNameBorderThickness,1)+"px solid":UNDEF,borderColor:fontBdrColor,borderThickness:(0,_lib.pluckNumber)(axisAttr.axisNameBorderThickness,1),borderPadding:(0,_lib.pluckNumber)(axisAttr.axisNameBorderPadding,2),borderRadius:(0,_lib.pluckNumber)(axisAttr.axisNameBorderRadius,0),backgroundColor:axisAttr.axisNameBgColor?(0,_lib.convertColor)(axisAttr.axisNameBgColor,(0,_lib.pluckNumber)(axisAttr.axisNameBgAlpha,axisAttr.axisNameAlpha,100)):_lib.BLANKSTRING,borderDash:(0,_lib.pluckNumber)(axisAttr.axisNameBorderDashed,0)?(0,_lib.getDashStyle)((0,_lib.pluckNumber)(axisAttr.axisNameBorderDashLen,4),(0,_lib.pluckNumber)(axisAttr.axisNameBorderDashGap,2)):DASH_DEF};axisConfig.name.style.lineHeight=(0,_lib.setLineHeight)(axisConfig.name.style);trendFontBdrColor=(0,_lib.getFirstValue)(FCChartObj.trendvaluebordercolor,_lib.BLANKSTRING);trendFontBdrColor=trendFontBdrColor?(0,_lib.convertColor)(trendFontBdrColor,(0,_lib.pluckNumber)(FCChartObj.trendvalueborderalpha,FCChartObj.trendvaluealpha,100)):_lib.BLANKSTRING;axisConfig.trend=axisConfig.trend||{};axisConfig.trend.trendStyle={fontFamily:(0,_lib.pluck)(FCChartObj.trendvaluefont,axisAttr.outCanfontFamily),color:(0,_lib.pluck)(FCChartObj.trendvaluefontcolor,axisAttr.trendlineColor,axisAttr.outCancolor,"333333"),fontSize:(0,_lib.pluckFontSize)(this.computeFontSize(FCChartObj.trendvaluefontsize),pInt(axisAttr.outCanfontSize))+PXSTRING,fontSizeWithUnit:(0,_lib.pluckFontSizeMaintainUnit)(FCChartObj.trendvaluefontsize,axisAttr.outCanfontSizeWithUnit),fontWeight:(0,_lib.pluckNumber)(FCChartObj.trendvaluefontbold)?"bold":NORMALSTRING,fontStyle:(0,_lib.pluckNumber)(FCChartObj.trendvaluefontitalic)?"italic":NORMALSTRING,border:trendFontBdrColor||FCChartObj.trendvaluebgcolor?(0,_lib.pluckNumber)(FCChartObj.trendvalueborderthickness,1)+"px solid":"",borderColor:trendFontBdrColor,borderThickness:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderthickness,1),borderPadding:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderpadding,2),borderRadius:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderradius,0),backgroundColor:FCChartObj.trendvaluebgcolor?(0,_lib.convertColor)(FCChartObj.trendvaluebgcolor,(0,_lib.pluckNumber)(FCChartObj.trendvaluebgalpha,FCChartObj.trendvaluealpha,100)):_lib.BLANKSTRING,borderDash:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderdashed,0)?(0,_lib.getDashStyle)((0,_lib.pluckNumber)(FCChartObj.trendvalueborderdashlen,4),(0,_lib.pluckNumber)(FCChartObj.trendvalueborderdashgap,2)):DASH_DEF};axisConfig.trend.trendStyle.lineHeight=(0,_lib.setLineHeight)(axisConfig.trend.trendStyle);axisConfig.labels=axisConfig.labels||{};axisConfig.lines=axisConfig.lines||{};axisConfig.band=axisConfig.band||{};labelFontBdrColor=(0,_lib.getFirstValue)(FCChartObj.labelbordercolor,_lib.BLANKSTRING);labelFontBdrColor=labelFontBdrColor?(0,_lib.convertColor)(labelFontBdrColor,(0,_lib.pluckNumber)(FCChartObj.labelborderalpha,FCChartObj.labelalpha,100)):_lib.BLANKSTRING;axisConfig.labels.style={fontFamily:(0,_lib.pluck)(axisAttr.labelFont,axisAttr.outCanfontFamily),fontSize:(0,_lib.pluckNumber)(axisAttr.labelFontSize,pInt(axisAttr.outCanfontSize))+PXSTRING,fontSizeWithUnit:(0,_lib.pluckFontSizeMaintainUnit)(axisAttr.labelFontSizeWithUnit,axisAttr.outCanfontSizeWithUnit),fontWeight:(0,_lib.pluckNumber)(axisAttr.labelFontBold)?"bold":NORMALSTRING,fontStyle:(0,_lib.pluckNumber)(axisAttr.labelFontItalic)?"italic":NORMALSTRING,color:(0,_lib.convertColor)((0,_lib.pluck)(axisAttr.labelFontColor,axisAttr.outCancolor),(0,_lib.pluckNumber)(axisAttr.labelFontAlpha,100)),labelLink:FCChartObj.labellink,border:labelFontBdrColor||FCChartObj.labelbgcolor?(0,_lib.pluckNumber)(FCChartObj.labelborderthickness,1)+"px solid":"",borderColor:labelFontBdrColor,borderThickness:(0,_lib.pluckNumber)(FCChartObj.labelborderthickness,1),borderPadding:(0,_lib.pluckNumber)(FCChartObj.labelborderpadding,2),borderRadius:(0,_lib.pluckNumber)(FCChartObj.labelborderradius,0),backgroundColor:FCChartObj.labelbgcolor?(0,_lib.convertColor)(FCChartObj.labelbgcolor,(0,_lib.pluckNumber)(FCChartObj.labelbgalpha,FCChartObj.labelalpha,100)):_lib.BLANKSTRING,borderDash:(0,_lib.pluckNumber)(FCChartObj.labelborderdashed,0)?(0,_lib.getDashStyle)((0,_lib.pluckNumber)(FCChartObj.labelborderdashlen,4),(0,_lib.pluckNumber)(FCChartObj.labelborderdashgap,2)):DASH_DEF};axisConfig.labels.style.lineHeight=(0,_lib.setLineHeight)(axisConfig.labels.style);axisConfig.numberFormatterFn=(0,_lib.pluck)(axisAttr.numberFormatterFn);axisConfig.apparentScrollPos=axisAttr.apparentScrollPos||axisConfig.apparentScrollPos;axisConfig.axisEndLabelDisplaySpace={left:0,right:0,top:0,bottom:0};axisConfig.isConfigured=true;axisConfig._defaultForceDecimal=UNDEF;axisConfig._defaultDecimalPrecision=UNDEF;axis.setScrollType("smart");axis.addToEnv("savedAxis",tempAxis&&(0,_lib.extend2)({},tempAxis))};_proto.setScrollType=function setScrollType(type){var visibleConfig=this.getVisibleConfig();if(type==="none"||type==="smart"||type==="always"){this.config.scrollType=type}this.setVisibleConfig(visibleConfig.minValue,visibleConfig.maxValue)};_proto.getScrollType=function getScrollType(){return this.config.scrollType};_proto._processAxisBreak=function _processAxisBreak(){var axis=this,axisConfig=axis.config,breakPoints,count,i,len;axisConfig.breakPoints=[];breakPoints=axisConfig.axisBreak.split("|");for(i=0,len=breakPoints.length,count=0;i<len;i+=1){breakPoints[i]=breakPoints[i].split(",");if(!isNaN(breakPoints[i][0])&&!isNaN(breakPoints[i][1])){axisConfig.breakPoints[count]={start:(0,_lib.pluckNumber)(breakPoints[i][0]),end:(0,_lib.pluckNumber)(breakPoints[i][1]),length:(0,_lib.pluckNumber)(breakPoints[i][2],0)};count+=1}}axisConfig.breakPoints.sort((function compareAxisBreakPoints(a,b){return a.start-b.start}));axisConfig.hasBreakPoints=true;axis._validateBreakPoints()};_proto._validateBreakPoints=function _validateBreakPoints(){var axisConfig=this.config,breakPoints=axisConfig.breakPoints,totalBreakAmount=0,i,len=breakPoints.length;for(i=0;i<len;i+=1){totalBreakAmount+=breakPoints[i].end-breakPoints[i].start}axisConfig.totalBreakAmount=totalBreakAmount};_proto._getRelativeBreakValue=function _getRelativeBreakValue(value){var breakPoints=this.config.breakPoints,i,len=breakPoints.length,valueDeletion=0;for(i=0;i<len;i+=1){if(value>=breakPoints[i].start&&value<=breakPoints[i].end){return breakPoints[i].start-valueDeletion}else if(value<breakPoints[i].start){break}valueDeletion+=breakPoints[i].end-breakPoints[i].start}return value-valueDeletion};_proto._getRealBreakValue=function _getRealBreakValue(_value){var value=_value,breakPoints=this.config.breakPoints,i,len=breakPoints.length;for(i=0;i<len;i+=1){if(value>=breakPoints[i].start){value+=breakPoints[i].end-breakPoints[i].start}else if(value<breakPoints[i].start){return value}}return value};_proto._adjustNumberFormatter=function _adjustNumberFormatter(interval){var axis=this,axisConfig=axis.config,numberFormatter=axis.getFromEnv("chart").getFromEnv("number-formatter"),defaultDecimalPrecision=axisConfig._defaultDecimalPrecision,defaultForceDecimal=axisConfig._defaultForceDecimal,dec,beforeZero=0,numberFormatterSetting;if(axisConfig.isVertical||axisConfig.numberFormatterFn==="yAxis"){numberFormatterSetting=(numberFormatter.Y[axisConfig.axisIndex]||numberFormatter.Y[0]).yAxisLabelConf}else{numberFormatterSetting=numberFormatter.paramX}defaultDecimalPrecision!==UNDEF?numberFormatterSetting.decimalprecision=defaultDecimalPrecision:axisConfig._defaultDecimalPrecision=numberFormatterSetting.decimalprecision;defaultForceDecimal!==UNDEF?numberFormatterSetting.forcedecimals=defaultForceDecimal:axisConfig._defaultForceDecimal=numberFormatterSetting.forcedecimals;if(parseInt(interval,10)>0){return}dec=interval.toString().split(".")[1];if(dec){beforeZero=dec.match(/^[0]*/)[0].length;if(beforeZero+1>numberFormatterSetting.decimalprecision){numberFormatterSetting.forcedecimals=1}numberFormatterSetting.decimalprecision=Math.max(beforeZero+1,numberFormatterSetting.decimalprecision)}};_proto._isZoomed=function _isZoomed(){var viewPortConfig=this.getFromEnv("chart").config.viewPortConfig;if(this.config.isVertical){return viewPortConfig.scaleY!==1}return viewPortConfig.scaleX!==1};_proto._getIntervalArr=function _getIntervalArr(args){var axis=this,axisConfig=axis.config,axisLabelConfig=axisConfig.labels,increment=axisConfig.axisRange.tickInterval*(args&&args.step||1),returnArr=[],getLimit,visibleMin,visibleMax,min,max,i,value;getLimit=this.getVisibleConfig();if(axis.getFromEnv("chart").config.axisType==="polar"){visibleMin=getLimit.minValue;visibleMax=getLimit.maxValue}else{visibleMin=getLimit.minValue-(args&&args.minPad||0);visibleMax=getLimit.maxValue+(args&&args.maxPad||0)}min=roundToMultiple(visibleMin,increment);max=roundToMultiple(visibleMax-visibleMax%increment,increment);if(min===max){return[min]}if(axisLabelConfig.drawNormalVal){for(i=(0,_lib.toPrecision)(min+increment,10);i<max;i=(0,_lib.toPrecision)(i+increment,10)){if(axisConfig.hasBreakPoints){value=(0,_lib.toPrecision)(axis._getRealBreakValue(i),10)}else{value=(0,_lib.toPrecision)(i,10)}returnArr.push(value)}}if(axisLabelConfig.drawLimitVal){returnArr.push(max,min)}returnArr.indexOf(0)!==-1&&returnArr.splice(returnArr.indexOf(0),1);if(axisConfig.showZeroPlane&&min<=0&&max>=0){returnArr.push(0)}return returnArr.sort((function(a,b){return a-b}))};_proto._disposeScrollBar=function _disposeScrollBar(){var axis=this,axisConfig=axis.config;if(axisConfig.scrollBarDrawn){axis.getLinkedItem("scrollBar").hide();axisConfig.scrollBarDrawn=false}};_proto.addComponentInfo=function addComponentInfo(name,obj){this.getFromEnv("componentInfo")[sanitiseComponentName(name)].push(obj)};_proto.getComponentInfo=function getComponentInfo(name){return this.getFromEnv("componentInfo")[sanitiseComponentName(name)]};_proto.clearComponentInfo=function clearComponentInfo(){var componentInfo=this.getFromEnv("componentInfo"),key;for(key in componentInfo){if(componentInfo.hasOwnProperty(key)){componentInfo[key]=[]}}};_proto.draw=function draw(){var axis=this,axisConfig=axis.config,canvas=axisConfig.canvas,chart=axis.getFromEnv("chart"),chartConfig=chart.config,isVertical=axisConfig.isVertical,viewPortConfig=chartConfig.viewPortConfig,limitUpdaters=axis.getChildren().limitUpdater,viewPortRatio=axisConfig.viewPortRatio||{},canvasLeft=canvas.canvasLeft||chartConfig.canvasLeft,canvasTop=canvas.canvasTop||chartConfig.canvasTop,canvasWidth=canvas.canvasWidth||chartConfig.canvasWidth,canvasHeight=canvas.canvasHeight||chartConfig.canvasHeight,axisContainer=axisConfig.axisContainer,axisLabelContainerTop=axisConfig.axisLabelContainerTop,axisPlotLineContainer=axisConfig.axisPlotLineContainer,axisPlotLineContainerTop=axisConfig.axisPlotLineContainerTop,vlineLabelContainer=axisConfig.vlineLabelContainer,axisBandContainer=axisConfig.axisBandContainer,axisNameContainer=axisConfig.axisNameContainer,axisTrendContainerTop=axisConfig.axisTrendContainerTop,axisTrendContainerBottom=axisConfig.axisTrendContainerBottom,axisTrendLabelContainer=axisConfig.axisTrendLabelContainer,axisAxisLineContainer=axisConfig.axisAxisLineContainer,axisAxisLineContainerBottom=axisConfig.axisAxisLineContainerBottom,plotLineWidth=axisConfig.divLineThickness||0,childContainers=chart.getChildContainer(),axisBottom=childContainers.axisBottomGroup,axisTop=childContainers.axisTopGroup,animElems=[],axisBandGroup,axisPlotLineGroup,axisPlotLineGroupTop,axisLineGroup,axisNameGroup,axisLabelGroup,axisLabelGroupTop,axisTrendGroupTop,axisTrendGroupBottom,dx,dy,originY,originX,plotLineClipRect;axis.clearComponentInfo();originY=viewPortConfig.y*viewPortConfig.scaleY;originX=viewPortConfig.x*viewPortConfig.scaleX;if(isVertical){plotLineClipRect=canvasLeft+","+(canvasTop-plotLineWidth)+","+canvasWidth+","+(canvasHeight+plotLineWidth*2)}else{plotLineClipRect=canvasLeft-plotLineWidth+","+canvasTop+","+(canvasWidth+plotLineWidth*2)+","+canvasHeight}axisBandGroup=axis.getContainer("axisBandGroup")||axis.addContainer("axisBandGroup",createGroup("dataset-Band-group",axisBottom,axis));axisPlotLineGroup=axis.getContainer("axisPlotLineGroup")||axis.addContainer("axisPlotLineGroup",createGroup("dataset-Line-group",axisBottom,axis));axisPlotLineGroupTop=axis.getContainer("axisPlotLineGroupTop")||axis.addContainer("axisPlotLineGroupTop",createGroup("dataset-Line-group-top",axisTop,axis));axisNameGroup=axis.getContainer("axisNameGroup")||axis.addContainer("axisNameGroup",createGroup("dataset-Name-group",axisBottom,axis));axisLineGroup=axis.getContainer("axisLineGroup")||axis.addContainer("axisLineGroup",createGroup("axis-Line-group",axisTop,axis));axisTrendGroupTop=axis.getContainer("axisTrendGroupTop")||axis.addContainer("axisTrendGroupTop",createGroup("dataset-Trend-group-top",axisTop,axis));axisLabelGroup=axis.getContainer("axisLabelGroup")||axis.addContainer("axisLabelGroup",createGroup("dataset-Label-group",axisBottom,axis));axisLabelGroupTop=axis.getContainer("axisLabelGroupTop")||axis.addContainer("axisLabelGroupTop",createGroup("dataset-Label-group",axisTop,axis));axisTrendGroupBottom=axis.getContainer("axisTrendGroupBottom")||axis.addContainer("axisTrendGroupBottom",createGroup("dataset-Trend-group-bottom",axisBottom,axis));if(!axisTrendContainerBottom){axisConfig.axisTrendContainerBottom=axisTrendContainerBottom=createGroup("dataset-axis-trend-bottom",axisTrendGroupBottom,axis);axisTrendContainerBottom.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}else{axisTrendContainerBottom.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}if(!axisContainer){axisConfig.axisContainer=axisContainer=createGroup("dataset-axis",axisLabelGroup,axis)}if(!axisLabelContainerTop){axisConfig.axisLabelContainerTop=axisLabelContainerTop=createGroup("dataset-top-label",axisLabelGroupTop,axis)}if(!axisAxisLineContainer){axisConfig.axisAxisLineContainer=axisAxisLineContainer=createGroup("axis-line-tick",axisLineGroup,axis)}if(!vlineLabelContainer){axisConfig.vlineLabelContainer=vlineLabelContainer=createGroup("axis-vline-label",axisLineGroup,axis)}if(!axisBandContainer){axisConfig.axisBandContainer=axisBandContainer=createGroup("dataset-axis-bands",axisBandGroup,axis);axisBandContainer.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}else{animElems.push({el:axisBandContainer,attrs:{"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisPlotLineContainer){axisConfig.axisPlotLineContainer=axisPlotLineContainer=createGroup("dataset-axis-lines",axisPlotLineGroup,axis);axisPlotLineContainer.attr({"clip-rect":plotLineClipRect})}else{animElems.push({el:axisPlotLineContainer,attrs:{"clip-rect":plotLineClipRect},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisPlotLineContainerTop){axisConfig.axisPlotLineContainerTop=axisPlotLineContainerTop=createGroup("dataset-axis-lines-top",axisPlotLineGroupTop,axis);axisPlotLineContainerTop.attr({"clip-rect":plotLineClipRect})}else{animElems.push({el:axisPlotLineContainerTop,attrs:{"clip-rect":plotLineClipRect},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisTrendContainerTop){axisConfig.axisTrendContainerTop=axisTrendContainerTop=createGroup("dataset-axis-trend-top",axisTrendGroupTop,axis);axisTrendContainerTop.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}else{animElems.push({el:axisTrendContainerTop,attrs:{"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisTrendLabelContainer){axisConfig.axisTrendLabelContainer=axisTrendLabelContainer=createGroup("dataset-axis-trend-label",axisTrendGroupTop,axis)}if(!axisNameContainer){axisConfig.axisNameContainer=axisNameContainer=createGroup("dataset-axis-name",axisNameGroup,axis)}if(!axisAxisLineContainerBottom){axisConfig.axisAxisLineContainerBottom=axisAxisLineContainerBottom=createGroup("axis-line-tick-bottom",axisBottom,axis)}if(viewPortRatio.scaleX&&viewPortRatio.scaleY&&(viewPortRatio.scaleX!==viewPortConfig.scaleX||viewPortRatio.scaleY!==viewPortConfig.scaleY)){viewPortRatio.scaleX=viewPortConfig.scaleX;viewPortRatio.scaleY=viewPortConfig.scaleY;axis._drawComponents()}else{if(isVertical){dy=originY-viewPortConfig.y*viewPortConfig.scaleY;vlineLabelContainer.transform("t0,"+dy);axisContainer.transform("t0,"+dy);axisLabelContainerTop.transform("t0,"+dy);axisPlotLineContainer.transform("t0,"+dy);axisPlotLineContainerTop.transform("t0,"+dy);axisBandContainer.transform("t0,"+dy);axisTrendContainerTop.transform("t0,"+dy);axisTrendContainerBottom.transform("t0,"+dy)}else{dx=originX-viewPortConfig.x*viewPortConfig.scaleX;vlineLabelContainer.transform("t"+dx+",0");axisContainer.transform("t"+dx+",0");axisLabelContainerTop.transform("t"+dx+",0");axisPlotLineContainer.transform("t"+dx+",0");axisPlotLineContainerTop.transform("t"+dx+",0");axisBandContainer.transform("t"+dx+",0");axisTrendContainerTop.transform("t"+dx+",0");axisTrendContainerBottom.transform("t"+dx+",0")}axis._drawComponents()}axis.addExtEventListener("animationcomplete",(function(){limitUpdaters&&limitUpdaters.forEach(_drawLimitUpdater)}),axis.getFromEnv("animationmanager"));axis.addToEnv("tempAxis",{canvasHeight:axis.config.canvas.canvasHeight,canvasWidth:axis.config.canvas.canvasWidth,canvasLeft:axis.config.canvas.canvasLeft,canvasRight:axis.config.canvas.canvasRight,canvasBottom:axis.config.canvas.canvasBottom,canvasTop:axis.config.canvas.canvasTop,visibleRange:axis.getVisibleConfig(),visibleLength:axis.getVisibleLength(),axisLength:axis.config.axisDimention.axisLength,axisOpposite:axis.config.axisDimention.opposite,axisY:axis.config.axisDimention.y,axisX:axis.config.axisDimention.x,axisRangeMin:axis.config.axisRange.min,axisRangeMax:axis.config.axisRange.max,axisTickInterval:axis.config.axisRange.tickInterval,axisIsReverse:axis.config.isReverse,axisIsVertical:axis.config.isVertical,axisHasBreakPoints:axis.config.hasBreakPoints,viewPortScaleY:axis.getFromEnv("chart").config.viewPortConfig.scaleY,viewPortY:axis.getFromEnv("chart").config.viewPortConfig.y,viewPortScaleX:axis.getFromEnv("chart").config.viewPortConfig.scaleX,viewPortX:axis.getFromEnv("chart").config.viewPortConfig.x,chartHeight:axis.getFromEnv("chart").config.canvasHeight,chartWidth:axis.getFromEnv("chart").config.canvasWidth,chartLeft:axis.getFromEnv("chart").config.canvasLeft,chartRight:axis.getFromEnv("chart").config.canvasRight,chartBottom:axis.getFromEnv("chart").config.canvasBottom,chartTop:axis.getFromEnv("chart").config.canvasTop,pvr:axis.config.pvr,refVal:axis.config.refVal,refVisibleVal:axis.config.refVisibleVal})};_proto.getBreakPoints=function getBreakPoints(){var axisConfig=this.config;if(axisConfig.hasBreakPoints){return axisConfig.breakPoints}return false};_proto.getValue=function getValue(pixel,options){var axis=this,axisConfig=axis.config,wrtVisible=options&&options.wrtVisible,refVal=wrtVisible?axisConfig.refVisibleVal:axisConfig.refVal;return refVal+(pixel-axisConfig.refPx)/axis.config.pvr};_proto.getVisibleLength=function getVisibleLength(){var limit=this.getVisibleConfig();return Math.abs(limit.maxValue-limit.minValue)};_proto.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;startPad=axisConfig.startPad=Math.max(axisConfig.startPad,startPad);endPad=axisConfig.endPad=Math.max(axisConfig.endPad,endPad);if(axisConfig.oriCatLen===0){if(startPad===0){startPad=.5}if(endPad===0){endPad=.5}}if(axisConfig.hasCategory){if(axisConfig.oriCatLen>=0){axis.setAxisRange({max:axisConfig.oriCatLen+endPad,min:-startPad})}}else{if(axisConfig.originalMax&&axisConfig.originalMin){axis.setDataLimit(axisConfig.originalMax,axisConfig.originalMin)}}};_proto.setAxisConfig=function setAxisConfig(data){var axisConfig=this.config,prop;for(prop in data){if(data.hasOwnProperty(prop)){axisConfig[prop]=data[prop]}}};_proto.getAxisConfig=function getAxisConfig(name){var axisConfig=this.config;if(name){return axisConfig[name]}return axisConfig};_proto.setAxisRange=function setAxisRange(data){var axis=this,axisConfig=axis.config,axisRange=axisConfig.axisRange,tempAxis,tempAxisRange,prop;for(prop in data){if(data.hasOwnProperty(prop)){axisRange[prop]=data[prop]}}if(axisConfig.isReverse){axisConfig.refVal=axisRange.max}else{axisConfig.refVal=axisRange.min}axis.setVisibleConfig(axisRange.min,axisRange.max);if(axis.getFromEnv("tempAxis")){tempAxis=axis.getFromEnv("tempAxis");tempAxisRange={max:tempAxis.axisRangeMax,min:tempAxis.axisRangeMin,tickInterval:tempAxis.axisTickInterval};if(tempAxisRange.max!==axisRange.max||tempAxisRange.min!==axisRange.min||tempAxisRange.tickInterval!==axisRange.tickInterval){axisConfig.rangeChanged=true}else{axisConfig.rangeChanged=false}}};_proto.setAxisDimention=function setAxisDimention(data){var axis=this,axisConfig=axis.config,chartConfig=axis.getFromEnv("chart").config,axisDimention=axisConfig.axisDimention||(axisConfig.axisDimention={}),tempAxis;axisDimention.opposite=(0,_lib.pluckNumber)(data.opposite,axisDimention.opposite);axisDimention.x=(0,_lib.pluckNumber)(data.x,chartConfig.canvasLeft,axisDimention.x);axisDimention.y=(0,_lib.pluckNumber)(data.y,chartConfig.canvasTop,axisDimention.y);axisDimention.axisLength=(0,_lib.pluckNumber)(data.axisLength,axisDimention.axisLength);if(axisConfig.isVertical){axisConfig.refPx=axisDimention.y}else{axisConfig.refPx=axisDimention.x}axis.getPVR();if(axis.getFromEnv("tempAxis")){tempAxis=axis.getFromEnv("tempAxis");if(tempAxis.axisLength!==axisDimention.axisLength||tempAxis.axisOpposite!==axisDimention.opposite||tempAxis.axisY!==axisDimention.y||tempAxis.axisX!==axisDimention.x){axisConfig.dimensionChanged=true}else{axisConfig.dimensionChanged=false}}};_proto.setDataLimit=function setDataLimit(_max,_min){var axis=this,axisConfig=axis.config,max=_max,min=_min,axisRange=axisConfig.axisRange,AxisMaxValue=axisConfig.isPercent?100:axisConfig.axisMaxValue,AxisMinValue=axisConfig.isPercent?0:axisConfig.axisMinValue,numDivLines=axisConfig.numDivLines,setAdaptiveMin=axisConfig.setAdaptiveMin,adjustDiv=axisConfig.adjustDiv,startPad=axisConfig.startPad||0,endPad=axisConfig.endPad||0,setMinAsZero,stopMaxAtZero,axisLimits,lines=axisConfig.trendLines||axisConfig.vTrendLines,lineArr=lines&&lines[0]&&lines[0].line,lineMin,lineMax;lineMin=(0,_safeMin.default)(lineArr,(function _getMin(obj){return obj.startvalue}));lineMax=(0,_safeMax.default)(lineArr,(function _getMax(obj){return obj.endvalue}));min=(0,_safeMin.default)([lineMin,min]);max=(0,_safeMax.default)([lineMax,max]);axisConfig.originalMax=max;axisConfig.originalMin=min;max=axisConfig.isPercent?100:max+endPad;min=axisConfig.isPercent?0:min-startPad;setMinAsZero=stopMaxAtZero=!setAdaptiveMin;if(axisConfig.hasBreakPoints){max-=axisConfig.totalBreakAmount}axisLimits=(0,_lib.getAxisLimits)((0,_lib.pluckNumber)(max,AxisMaxValue),(0,_lib.pluckNumber)(min,AxisMinValue),AxisMaxValue,AxisMinValue,stopMaxAtZero,setMinAsZero,numDivLines,adjustDiv);axis.setAxisRange({max:Number((0,_lib.toPrecision)(axisLimits.Max,10)),min:Number((0,_lib.toPrecision)(axisLimits.Min,10)),tickInterval:Number((0,_lib.toPrecision)(axisLimits.divGap,10))});axis._adjustNumberFormatter(axisRange.tickInterval);if(axisRange.tickInterval===0){axisRange.tickInterval=1}};_proto.setVisibleConfig=function setVisibleConfig(minValue,maxValue){var axis=this,axisConfig=axis.config,range=axisConfig.axisRange,scrollType=axis.getScrollType(),axisScroll,translationStr,zoom,maxZoomLimit=axisConfig.maxZoomLimit;if(minValue>maxValue){return false}zoom=(range.max-range.min)/(maxValue-minValue);if(maxZoomLimit&&zoom>maxZoomLimit){return false}axisConfig.minVisibleValue=minValue;axisConfig.maxVisibleValue=maxValue;if(axisConfig.isReverse){axisConfig.refVisibleVal=maxValue}else{axisConfig.refVisibleVal=minValue}if(scrollType==="always"){axis.setScrollEnabled(true)}else if(scrollType==="smart"){if(axis._isZoomed()){axis.setScrollEnabled(true)}else{axis.setScrollEnabled(false)}}else if(scrollType==="none"&&axis.isScrollEnabled()){axis.setScrollEnabled(false)}axis.getPVR();axis.fireEvent("visiblerangeset",{minValue:axisConfig.minVisibleValue,maxValue:axisConfig.maxVisibleValue});if(axis.getFromEnv("tempAxis")){axis.asyncDraw();axisScroll=-axis.getTranslation();if(axisConfig.isVertical){translationStr=["T",0,",",axisScroll].join("")}else{translationStr=["T",axisScroll,",",0].join("")}axisConfig.axisContainer.attr({transform:translationStr});axisConfig.axisBandContainer.attr({transform:translationStr});axisConfig.axisPlotLineContainer.attr({transform:translationStr});axisConfig.axisTrendContainerTop.attr({transform:translationStr})}return true};_proto.getVisibleConfig=function getVisibleConfig(){var axisConfig=this.config;return{minValue:axisConfig.minVisibleValue,maxValue:axisConfig.maxVisibleValue}};_proto.getPVR=function getPVR(){var axis=this,axisConfig=axis.config,visibleConfig=axis.getVisibleConfig(),visibleSpan=visibleConfig.maxValue-visibleConfig.minValue,axisLength=(axisConfig.axisDimention||{}).axisLength,pvr=axisLength/visibleSpan;if(pvr){if(axisConfig.isReverse){axisConfig.pvr=-pvr}else{axisConfig.pvr=pvr}}return axisConfig.pvr};_proto.getPixel=function getPixel(_value,options){var axis=this,axisConfig=axis.config,value=_value,wrtVisible=options&&options.wrtVisible,refVal=wrtVisible?axisConfig.refVisibleVal:axisConfig.refVal,tempAxis=axis.getFromEnv("tempAxis"),pvr=axisConfig.pvr*axis.getFromEnv("chartConfig").viewPortConfig.scaleX;if(options&&options.preValue&&tempAxis){refVal=wrtVisible?tempAxis.refVisibleVal:tempAxis.refVal;pvr=axis.getOldPVR()}if(!pvr){return 0}if(axisConfig.hasBreakPoints){value=axis._getRelativeBreakValue(value)}return(0,_lib.toPrecision)(axisConfig.refPx+(value-refVal)*pvr,2)};_proto.getLimit=function getLimit(){var axisRange=this.config.axisRange;return{min:axisRange.min,max:axisRange.max,tickInterval:axisRange.tickInterval}};_proto.getOldPVR=function getOldPVR(){var tempAxis=this.getFromEnv("tempAxis");return tempAxis?tempAxis.pvr:this.config.pvr};_proto.hide=function hide(){var axisConfig=this.config;if(!axisConfig.axisContainer){return}axisConfig.axisLabelContainerTop.hide();axisConfig.axisContainer.hide();axisConfig.axisPlotLineContainer.hide();axisConfig.axisPlotLineContainerTop.hide();axisConfig.axisBandContainer.hide();axisConfig.axisNameContainer.hide();axisConfig.axisTrendContainerTop.hide();axisConfig.axisTrendContainerBottom.hide();axisConfig.axisTrendLabelContainer.hide();axisConfig.axisAxisLineContainer.hide();axisConfig.axisAxisLineContainerBottom.hide()};_proto.show=function show(){var axisConfig=this.config;if(!axisConfig.axisContainer){return}axisConfig.axisLabelContainerTop.show();axisConfig.axisContainer.show();axisConfig.axisPlotLineContainer.show();axisConfig.axisPlotLineContainerTop.show();axisConfig.axisBandContainer.show();axisConfig.axisNameContainer.show();axisConfig.axisTrendContainerTop.show();axisConfig.axisTrendContainerBottom.show();axisConfig.axisTrendLabelContainer.show();axisConfig.axisAxisLineContainer.show();axisConfig.axisAxisLineContainerBottom.show()};_proto.getTranslation=function getTranslation(){var axis=this,axisConfig=axis.config;return axis.getPixel(axisConfig.refVisibleVal)-axisConfig.refPx};_proto.setScrollEnabled=function setScrollEnabled(bool){var axis=this;axis.config.scrollEnabled=bool;if(bool){axis.getFromEnv("chart")._createToolBoxGantt();axis.getFromEnv("tempAxis")&&axis.asyncDraw()}else{axis._disposeScrollBar()}};_proto.isScrollEnabled=function isScrollEnabled(){return this.config.scrollEnabled};_proto.manageProcessScroll=function manageProcessScroll(scroll){var axis=this,axisConfig=axis.config,spaceTaken=axisConfig.totalWidth||0,totalVisiblelWidth=axisConfig.totalVisiblelWidth,translateX;if(spaceTaken>totalVisiblelWidth){translateX=(spaceTaken-totalVisiblelWidth)*(1-scroll);axis.translateAxis(translateX,UNDEF)}};_proto.translateAxis=function translateAxis(x,y){var axis=this,axisConfig=axis.config,ganttPlotLineContainer=axis.getContainer("ganttPlotLineContainer"),ganttPlotHoverBandContainer=axis.getContainer("ganttPlotHoverBandContainer"),lastTranslate=axisConfig.lastTranslate||(axisConfig.lastTranslate={x:0,y:0}),ganttLabelContainer=axis.getContainer("labelContainer"),ganttHeaderContainer=axis.getContainer("headerContainer"),hotContainer=axis.getContainer("hotContainer"),dx,dy;dx=x!==UNDEF?x-lastTranslate.x:0;dy=y!==UNDEF?y-lastTranslate.y:0;lastTranslate.x=x!==UNDEF?x:lastTranslate.x;lastTranslate.y=y!==UNDEF?y:lastTranslate.y;ganttLabelContainer&&ganttLabelContainer.translate(dx,dy);ganttHeaderContainer&&ganttHeaderContainer.translate(dx,dy);axisConfig.labelContainer&&axisConfig.labelContainer.translate(dx,dy);hotContainer&&hotContainer.translate(dx,dy);axisConfig.headerContainer&&axisConfig.headerContainer.translate(dx,0);if(axisConfig.isVertical){ganttPlotLineContainer&&ganttPlotLineContainer.translate(0,dy);ganttPlotHoverBandContainer&&ganttPlotHoverBandContainer.translate(0,dy)}else{ganttPlotLineContainer&&ganttPlotLineContainer.translate(dx,0);ganttPlotHoverBandContainer&&ganttPlotHoverBandContainer.translate(dx,0);axis.setAxisConfig({animateAxis:false});axisConfig.drawTrendLines&&axis._drawTrendLine();axis.setAxisConfig({animateAxis:true})}};_proto.resetTransletAxis=function resetTransletAxis(){var axis=this,axisConfig=axis.config,ganttLabelContainer=axis.getContainer("labelContainer"),ganttHeaderContainer=axis.getContainer("headerContainer"),hotContainer=axis.getContainer("hotContainer"),transformAttr;transformAttr={transform:"t0,0"};axisConfig.lastTranslate={x:0,y:0};ganttLabelContainer&&ganttLabelContainer.attr(transformAttr);ganttHeaderContainer&&ganttHeaderContainer.attr(transformAttr);axisConfig.labelContainer&&axisConfig.labelContainer.attr(transformAttr);axisConfig.headerContainer&&axisConfig.headerContainer.attr(transformAttr);axisConfig.ganttPlotLineContainer&&axisConfig.ganttPlotLineContainer.attr(transformAttr);axisConfig.ganttPlotHoverBandContainer&&axisConfig.ganttPlotHoverBandContainer.attr(transformAttr);hotContainer&&hotContainer.attr(transformAttr)};return CartesianAxis}(_componentInterface.ComponentInterface);var _default=CartesianAxis;exports.default=_default; | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports._drawScrollBar=_drawScrollBar;exports.getCrispPath=exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _safeMin=_interopRequireDefault(require("@fusioncharts/utils/src/array/safe-min"));var _safeMax=_interopRequireDefault(require("@fusioncharts/utils/src/array/safe-max"));var _componentInterface=require("../component-interface");var _lib=require("../lib");var _dependencyManager=require("../dependency-manager");var UNDEF,R=(0,_dependencyManager.getDep)("redraphael","plugin"),PXSTRING="px",DASH_DEF="none",NORMALSTRING="normal",TREND="trend",CAT_VLINE="catVLine",LABEL="label",LINE="line",BAND="band",CAT_BAND="catBand",TREND_LINE_COLOR="333333",pInt=function pInt(s,mag){return parseInt(s,mag||10)},createGroup=function createGroup(groupName,parentContainer,axis){return axis.getFromEnv("animationManager").setAnimation({el:"group",attr:{name:groupName},container:parentContainer,state:"appearing",component:axis,label:"group"})},roundToMultiple=function roundToMultiple(num,multiple){if(multiple===void 0){multiple=0}var remainder;if(multiple===0)return num;remainder=Math.abs(num)%multiple;if(remainder===0)return num;if(num<0)return-(Math.abs(num)-remainder);return num+multiple-remainder},getCrispPath=function getCrispPath(path,width){var isCrisped=false,oddWidth=width%2,value,roundValue;if(path[1]===path[4]){value=path[1];roundValue=Math.round(value);path[1]=path[4]=oddWidth?roundValue>value?roundValue-.5:roundValue+.5:roundValue;isCrisped=true}if(path[2]===path[5]){value=path[2];roundValue=Math.round(value);path[2]=path[5]=oddWidth?roundValue>value?roundValue-.5:roundValue+.5:roundValue;isCrisped=true}return{path:path,isCrisped:isCrisped}},_forceValidLowerLimit=function _forceValidLowerLimit(value,limit){return value<limit?limit:value},_drawLimitUpdater=function _drawLimitUpdater(limitUpdater){limitUpdater.draw()};exports.getCrispPath=getCrispPath;function sanitiseComponentName(name){var sanitisedName=_lib.BLANKSTRING;if(name===TREND||name===TREND+"s"){sanitisedName=TREND}if(name===CAT_VLINE||name===CAT_VLINE+"s"){sanitisedName=CAT_VLINE}if(name===LABEL||name===LABEL+"s"){sanitisedName=LABEL+"s"}if(name===LINE||name===LINE+"s"){sanitisedName=LINE+"s"}if(name===BAND||name===BAND+"s"){sanitisedName=BAND}if(name===CAT_BAND||name===CAT_BAND+"s"){sanitisedName=CAT_BAND}return sanitisedName}function _drawScrollBar(){var axis=this,chart=axis.getFromEnv("chart"),chartConfig=chart.config,graphics=chart.graphics,axisConfig=axis.config,axisRange=axisConfig.axisRange,scrollOptions=chartConfig.scrollOptions||(chartConfig.scrollOptions={}),max=axisRange.max,min=axisRange.min,scrollBar=axis.getLinkedItem("scrollBar"),scrollNode=scrollBar&&scrollBar.config.node,canvasLeft,canvasTop,canvasHeight,canvasConfig=chart.getChildren("canvas")[0].config,canvasBorderWidth,axisLineWidth,axisLineStartExtension,axisLineEndExtension,scrollRatio,windowedCanvasWidth,fullCanvasWidth,scrollBarParentGroup,visibleConfig,visibleRange,totalRange,scrollPosition;if(!scrollBar){return}canvasLeft=canvasConfig.canvasLeft;canvasTop=canvasConfig.canvasTop;canvasHeight=canvasConfig.canvasHeight;canvasBorderWidth=canvasConfig.canvasBorderWidth;axisLineWidth=axisConfig.showAxisLine?axisConfig.axisLineThickness||0:0;axisLineStartExtension=(0,_lib.pluckNumber)(canvasBorderWidth,axisConfig.lineStartExtension);axisLineEndExtension=(0,_lib.pluckNumber)(canvasBorderWidth,axisConfig.lineEndExtension);scrollOptions.viewPortMin=min;scrollOptions.viewPortMax=max;visibleConfig=axis.getVisibleConfig();visibleRange=visibleConfig.maxValue-visibleConfig.minValue;totalRange=axisRange.max-axisRange.min;scrollRatio=visibleRange/totalRange;scrollPosition=(visibleConfig.minValue-axisRange.min)/(totalRange-visibleRange);windowedCanvasWidth=scrollOptions.windowedCanvasWidth=axis.getPixel(scrollOptions.vxLength);fullCanvasWidth=scrollOptions.fullCanvasWidth=axis.getPixel(max-min)-windowedCanvasWidth;scrollBarParentGroup=graphics.scrollBarParentGroup;if(!scrollBarParentGroup){scrollBarParentGroup=graphics.scrollBarParentGroup=createGroup("scrollBarParentGroup",graphics.parentGroup).insertBefore(chart.getChildContainer().datalabelsGroup)}if(axisConfig.scrollEnabled!==false){if(axisConfig.isVertical){scrollBar.draw(canvasLeft,canvasTop,{height:canvasHeight,scrollRatio:scrollRatio,roundEdges:canvasConfig.isRoundEdges,fullCanvasWidth:fullCanvasWidth,windowedCanvasWidth:windowedCanvasWidth,scrollPosition:scrollPosition,parentLayer:scrollBarParentGroup})}else{scrollBar.draw(canvasLeft-axisLineStartExtension,canvasTop+canvasHeight+canvasBorderWidth+axisLineWidth-2,{width:canvasConfig.canvasWidth+axisLineStartExtension+axisLineEndExtension,scrollRatio:scrollRatio,roundEdges:canvasConfig.isRoundEdges,fullCanvasWidth:fullCanvasWidth,windowedCanvasWidth:windowedCanvasWidth,scrollPosition:scrollPosition,parentLayer:scrollBarParentGroup})}!scrollNode&&function(){var prevPos;R.eve.on("raphael.scroll.start."+scrollBar.config.node.id,(function(pos){axis.setState("scrolling",true);prevPos=pos;chart.fireChartInstanceEvent("scrollstart",{scrollPosition:pos})}));R.eve.on("raphael.scroll.end."+scrollBar.config.node.id,(function(pos){axis.setState("scrolling",false);chart.fireChartInstanceEvent("scrollend",{prevScrollPosition:prevPos,scrollPosition:pos})}))}()}else{scrollBar&&scrollBar.node&&scrollBar.node.hide()}axisConfig.scrollBarDrawn=true}var CartesianAxis=function(_ComponentInterface){(0,_inheritsLoose2.default)(CartesianAxis,_ComponentInterface);function CartesianAxis(){var _this;_this=_ComponentInterface.call(this)||this;_this._drawScrollBar=_drawScrollBar;return _this}var _proto=CartesianAxis.prototype;_proto.getType=function getType(){return"axis"};_proto.getName=function getName(){return"cartesian"};_proto.__setDefaultConfig=function __setDefaultConfig(){_ComponentInterface.prototype.__setDefaultConfig.call(this);var config=this.config;config.setAdaptiveMin=0;config.adjustDiv=1;config.axisNameWidth=UNDEF;config.rotateAxisName=0;config.useEllipsesWhenOverflow=1;config.divLineColor=UNDEF;config.divLineAlpha=UNDEF;config.divLineThickness=UNDEF;config.divLineIsDashed=UNDEF;config.divLineDashLen=UNDEF;config.divLineDashGap=UNDEF;config.showAlternateGridColor=UNDEF;config.alternateGridColor=UNDEF;config.alternateGridAlpha=UNDEF;config.showZeroPlane=1;config.zeroPlaneAlpha=80;config.showZeroPlaneValue=1;config.showZeroPlaneOnTop=1;config.showAxisLine=UNDEF;config.axisLineThickness=UNDEF;config.axisLineAlpha=UNDEF;config.tickLength=UNDEF;config.trendlineToolText=UNDEF;config.trendlineColor=TREND_LINE_COLOR;config.trendlineThickness=1;config.trendlineAlpha=UNDEF;config.showTrendlinesOnTop=0;config.trendlinesAreDashed=0;config.trendlinesDashLen=5;config.trendlinesDashGap=2;config.isTrendZone=UNDEF;config.showTrendlines=1;config.showTrendlineLabels=1;config.showLabels=1;config.maxLabelHeight=UNDEF;config.rotateLabels=UNDEF;config.slantLabel=0;config.showAxisValues=1;config.showTooltip=1;config.isActive=true;config.drawLabels=true;config.drawOnlyCategoryLine=false;config.drawLabelsOpposit=false;config.drawPlotlines=true;config.drawAxisLine=true;config.drawPlotBands=true;config.drawAxisName=true;config.drawAxisNameOpposit=false;config.axisNameAlignCanvas=false;config.drawAxisNameFromBottom=false;config.drawTrendLines=true;config.drawTrendLabels=true;config.drawTick=true;config.drawTickMinor=true;config.animateAxis=true;config.drawAxisLineWRTCanvas=true;config.isRelativeAxisInverse=false;config.axisIndex=0;config.uniqueClassName=0;config.viewPortRatio={};config.canvas={};config.axisRange={};config.isConfigured=true;config.axisDimention={};config.extremeLabels={firstLabel:{},lastLabel:{}};config._setRangeAgain=false;config._defaultForceDecimal=UNDEF;config._defaultDecimalPrecision=UNDEF;config.rangeChanged=false;config.dimensionChanged=false;config.apparentScrollPos=0;this.addToEnv("componentInfo",{catVLine:[],trend:[],labels:[],lines:[],bands:[],catBand:[]})};_proto.configure=function configure(rawAttr){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),is3D=axis.getFromEnv("chart").config.is3D,FCChartObj=chart.getFromEnv("dataSource").chart,numberFormatter=axis.getFromEnv("number-formatter"),tempAxis=axis.getFromEnv("tempAxis"),axisAttr,fontBdrColor,trendFontBdrColor,labelFontBdrColor,i,j,axisAttrTrend,rawAttrTrend;axisAttr=axisConfig.rawAttr=rawAttr;if(rawAttr.vtrendlines){for(i=0;i<rawAttr.vtrendlines.length;++i){for(j=0;j<rawAttr.vtrendlines[i].line.length;++j){axisAttrTrend=axisAttr.vtrendlines[i].line[j];rawAttrTrend=rawAttr.vtrendlines[i].line[j];axisAttrTrend.startvalue=(0,_lib.pluckNumber)(rawAttrTrend.startvalue,UNDEF);axisAttrTrend.endvalue=(0,_lib.pluckNumber)(rawAttrTrend.endvalue,rawAttrTrend.startvalue);axisAttrTrend.color=(0,_lib.pluck)(rawAttrTrend.color,"FFFFFF");axisAttrTrend.istrendzone=(0,_lib.pluckNumber)(rawAttrTrend.istrendzone,1);axisAttrTrend.thickness=(0,_lib.pluckNumber)(rawAttrTrend.thickness,1);axisAttrTrend.trendTextAlpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,axisConfig.trendlineAlpha,99);axisAttrTrend.alpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,40);axisAttrTrend.tooltext=(0,_lib.pluck)(rawAttrTrend.tooltext,"")}}}if(rawAttr.trendlines){for(i=0;i<rawAttr.trendlines.length;++i){for(j=0;j<rawAttr.trendlines[i].line.length;++j){axisAttrTrend=axisAttr.trendlines[i].line[j];rawAttrTrend=rawAttr.trendlines[i].line[j];axisAttrTrend.startvalue=(0,_lib.pluckNumber)(rawAttrTrend.startvalue,UNDEF);axisAttrTrend.endvalue=(0,_lib.pluckNumber)(rawAttrTrend.endvalue,rawAttrTrend.startvalue);axisAttrTrend.color=(0,_lib.pluck)(rawAttrTrend.color,"FFFFFF");axisAttrTrend.istrendzone=(0,_lib.pluckNumber)(rawAttrTrend.istrendzone,1);axisAttrTrend.thickness=(0,_lib.pluckNumber)(rawAttrTrend.thickness,1);axisAttrTrend.trendTextAlpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,axisConfig.trendlineAlpha,99);axisAttrTrend.alpha=(0,_lib.pluckNumber)(rawAttrTrend.alpha,40);axisAttrTrend.showOnTop=(0,_lib.pluckNumber)(rawAttrTrend.showOnTop,1);axisAttrTrend.valueOnRight=(0,_lib.pluckNumber)(rawAttrTrend.valueOnRight,0)}}}axisConfig.trendLines=axisAttr.trendlines;axisConfig.vTrendLines=axisAttr.vtrendlines;(0,_lib.parseConfiguration)(axisAttr,axisConfig);axisConfig.axisName=(0,_lib.parseUnsafeString)(axisAttr.axisName);axisConfig.axisValuePadding=axisConfig.axisNamePadding||(0,_lib.pluckNumber)(axisAttr.axisValuePadding,4);axisConfig.axisNamePadding=axisConfig.axisNamePadding||(0,_lib.pluckNumber)(axisAttr.axisNamePadding,5);axisConfig.maxLabelWidthPercent=(0,_lib.pluckNumber)(axisAttr.maxLabelWidthPercent);axisConfig.maxLabelWidthPercent=Math.abs(axisConfig.maxLabelWidthPercent);axisConfig.minLabelWidthPercent=Math.abs((0,_lib.pluckNumber)(axisAttr.minLabelWidthPercent));axisConfig.numDivLines=(0,_lib.pluckNumber)(axisAttr.numDivLines,4);axisConfig.numDivLines=_forceValidLowerLimit(axisConfig.numDivLines,0);axisConfig.categoryNumDivLines=(0,_lib.pluckNumber)(axisAttr.numDivLines,0);axisConfig.axisValuePadding=_forceValidLowerLimit(axisConfig.axisValuePadding,0);axisConfig.isReverse=Number(axisAttr.isReverse,0);axisConfig.isOpposit=Number(axisAttr.isOpposit,0);axisConfig.isVertical=Number(axisAttr.isVertical,0);axisConfig.categoryDivLinesFromZero=1;axisConfig.axisMinValue=numberFormatter.getCleanValue(axisAttr.axisMinValue);axisConfig.axisMaxValue=numberFormatter.getCleanValue(axisAttr.axisMaxValue);axisConfig.zeroPlaneColor=(0,_lib.pluck)(axisAttr.zeroPlaneColor,axisAttr.divLineColor);axisConfig.zeroPlaneThickness=(0,_lib.pluck)(axisAttr.zeroPlaneThickness,axisAttr.divLineThickness);axisConfig.axisLineColor=(0,_lib.convertColor)(axisAttr.axisLineColor,axisAttr.axisLineAlpha);axisConfig.tickAlpha=(0,_lib.pluckNumber)(axisAttr.tickAlpha,axisConfig.axisLineAlpha);axisConfig.tickColor=(0,_lib.convertColor)((0,_lib.pluck)(axisAttr.tickColor,axisAttr.axisLineColor),axisConfig.tickAlpha);axisConfig.tickWidth=(0,_lib.pluckNumber)(axisAttr.tickWidth,axisConfig.axisLineThickness);axisConfig.maxZoomLimit=(0,_lib.pluckNumber)(FCChartObj.maxzoomlimit,chart.maxzoomlimit,1e3);axisConfig.showVLines=(0,_lib.pluckNumber)(FCChartObj.showvlines,1);axisConfig.showVLinesOnTop=(0,_lib.pluckNumber)(FCChartObj.showvlinesontop,0);axisConfig.showVLineLabels=(0,_lib.pluckNumber)(FCChartObj.showvlinelabels,this.showVLineLabels,1);axisConfig.showVLineLabelBorder=(0,_lib.pluckNumber)(FCChartObj.showvlinelabelborder,1);axisConfig.rotateVLineLabels=(0,_lib.pluckNumber)(FCChartObj.rotatevlinelabels,0);axisConfig.vLineColor=(0,_lib.pluck)(FCChartObj.vlinecolor,"333333");axisConfig.vLineLabelColor=(0,_lib.pluck)(FCChartObj.vlinelabelcolor);axisConfig.vLineThickness=(0,_lib.pluck)(FCChartObj.vlinethickness,1);axisConfig.vLineAlpha=(0,_lib.pluckNumber)(FCChartObj.vlinealpha,80);axisConfig.vLineLabelBgColor=(0,_lib.pluck)(FCChartObj.vlinelabelbgcolor,"ffffff");axisConfig.vLineLabelBgAlpha=(0,_lib.pluckNumber)(FCChartObj.vlinelabelbgalpha,is3D?50:100);axisConfig.staggerLines=Math.max((0,_lib.pluckNumber)(FCChartObj.staggerlines,2),2);axisConfig.staggerLines=_forceValidLowerLimit(axisConfig.staggerLines,1);axisConfig.trendlineValuesOnOpp=(0,_lib.pluck)(axisAttr.trendlineValuesOnOpp,axisAttr.trendlineValuesOnOpp,0);axisConfig.labelDisplay=(0,_lib.pluck)(axisAttr.labelDisplay,"auto").toLowerCase();axisConfig.labelStep=(0,_lib.pluckNumber)(axisAttr.labelStep,0);axisConfig.labelStep=Math.round(axisConfig.labelStep);axisConfig.labelStep=_forceValidLowerLimit(axisConfig.labelStep,0);axisConfig.startPad=0;axisConfig.endPad=0;axisConfig._oriLabelStep=axisConfig.labelStep;axisConfig.showLimits=(0,_lib.pluckNumber)(axisAttr.showLimits,axisConfig.showAxisValues);axisConfig.showUpperLimit=axisAttr.showLimits;axisConfig.showDivLineValues=(0,_lib.pluckNumber)(axisAttr.showDivLineValues,axisConfig.showAxisValues);axisConfig.showCanvasBorder=chart.getChildren("canvas")[0].config.showCanvasBorder?1:0;axisConfig.axisBreak=axisAttr.axisBreaks;axisConfig.isBreak=!!axisConfig.axisBreak;if(axisConfig.isBreak){axis._processAxisBreak()}fontBdrColor=(0,_lib.getFirstValue)(axisAttr.axisNameBorderColor,_lib.BLANKSTRING);fontBdrColor=fontBdrColor?(0,_lib.convertColor)(fontBdrColor,(0,_lib.pluckNumber)(axisAttr.axisNameBorderAlpha,axisAttr.axisNameAlpha,100)):_lib.BLANKSTRING;axisConfig.name=axisConfig.name||{};axisConfig.name.style={fontFamily:(0,_lib.pluck)(axisAttr.axisNameFont,axisAttr.outCanfontFamily),fontSize:(0,_lib.pluck)(axisAttr.axisNameFontSize,pInt(axisAttr.outCanfontSize))+PXSTRING,fontSizeWithUnit:(0,_lib.pluckFontSizeMaintainUnit)(axisAttr.axisNameFontSizeWithUnit,axisAttr.outCanfontSizeWithUnit),color:(0,_lib.convertColor)((0,_lib.pluck)(axisAttr.axisNameFontColor,axisAttr.outCancolor),(0,_lib.pluckNumber)(axisAttr.axisNameFontAlpha,axisAttr.axisNameAlpha,100)),fontWeight:(0,_lib.pluckNumber)(axisAttr.axisNameFontBold,1)?"bold":NORMALSTRING,fontStyle:(0,_lib.pluckNumber)(axisAttr.axisNameFontItalic)?"italic":NORMALSTRING,border:fontBdrColor||axisAttr.axisNameBgColor?(0,_lib.pluckNumber)(axisAttr.axisNameBorderThickness,1)+"px solid":UNDEF,borderColor:fontBdrColor,borderThickness:(0,_lib.pluckNumber)(axisAttr.axisNameBorderThickness,1),borderPadding:(0,_lib.pluckNumber)(axisAttr.axisNameBorderPadding,2),borderRadius:(0,_lib.pluckNumber)(axisAttr.axisNameBorderRadius,0),backgroundColor:axisAttr.axisNameBgColor?(0,_lib.convertColor)(axisAttr.axisNameBgColor,(0,_lib.pluckNumber)(axisAttr.axisNameBgAlpha,axisAttr.axisNameAlpha,100)):_lib.BLANKSTRING,borderDash:(0,_lib.pluckNumber)(axisAttr.axisNameBorderDashed,0)?(0,_lib.getDashStyle)((0,_lib.pluckNumber)(axisAttr.axisNameBorderDashLen,4),(0,_lib.pluckNumber)(axisAttr.axisNameBorderDashGap,2)):DASH_DEF};axisConfig.name.style.lineHeight=(0,_lib.setLineHeight)(axisConfig.name.style);trendFontBdrColor=(0,_lib.getFirstValue)(FCChartObj.trendvaluebordercolor,_lib.BLANKSTRING);trendFontBdrColor=trendFontBdrColor?(0,_lib.convertColor)(trendFontBdrColor,(0,_lib.pluckNumber)(FCChartObj.trendvalueborderalpha,FCChartObj.trendvaluealpha,100)):_lib.BLANKSTRING;axisConfig.trend=axisConfig.trend||{};axisConfig.trend.trendStyle={fontFamily:(0,_lib.pluck)(FCChartObj.trendvaluefont,axisAttr.outCanfontFamily),color:(0,_lib.pluck)(FCChartObj.trendvaluefontcolor,axisAttr.trendlineColor,axisAttr.outCancolor,"333333"),fontSize:(0,_lib.pluckFontSize)(this.computeFontSize(FCChartObj.trendvaluefontsize),pInt(axisAttr.outCanfontSize))+PXSTRING,fontSizeWithUnit:(0,_lib.pluckFontSizeMaintainUnit)(FCChartObj.trendvaluefontsize,axisAttr.outCanfontSizeWithUnit),fontWeight:(0,_lib.pluckNumber)(FCChartObj.trendvaluefontbold)?"bold":NORMALSTRING,fontStyle:(0,_lib.pluckNumber)(FCChartObj.trendvaluefontitalic)?"italic":NORMALSTRING,border:trendFontBdrColor||FCChartObj.trendvaluebgcolor?(0,_lib.pluckNumber)(FCChartObj.trendvalueborderthickness,1)+"px solid":"",borderColor:trendFontBdrColor,borderThickness:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderthickness,1),borderPadding:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderpadding,2),borderRadius:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderradius,0),backgroundColor:FCChartObj.trendvaluebgcolor?(0,_lib.convertColor)(FCChartObj.trendvaluebgcolor,(0,_lib.pluckNumber)(FCChartObj.trendvaluebgalpha,FCChartObj.trendvaluealpha,100)):_lib.BLANKSTRING,borderDash:(0,_lib.pluckNumber)(FCChartObj.trendvalueborderdashed,0)?(0,_lib.getDashStyle)((0,_lib.pluckNumber)(FCChartObj.trendvalueborderdashlen,4),(0,_lib.pluckNumber)(FCChartObj.trendvalueborderdashgap,2)):DASH_DEF};axisConfig.trend.trendStyle.lineHeight=(0,_lib.setLineHeight)(axisConfig.trend.trendStyle);axisConfig.labels=axisConfig.labels||{};axisConfig.lines=axisConfig.lines||{};axisConfig.band=axisConfig.band||{};labelFontBdrColor=(0,_lib.getFirstValue)(FCChartObj.labelbordercolor,_lib.BLANKSTRING);labelFontBdrColor=labelFontBdrColor?(0,_lib.convertColor)(labelFontBdrColor,(0,_lib.pluckNumber)(FCChartObj.labelborderalpha,FCChartObj.labelalpha,100)):_lib.BLANKSTRING;axisConfig.labels.style={fontFamily:(0,_lib.pluck)(axisAttr.labelFont,axisAttr.outCanfontFamily),fontSize:(0,_lib.pluckNumber)(axisAttr.labelFontSize,pInt(axisAttr.outCanfontSize))+PXSTRING,fontSizeWithUnit:(0,_lib.pluckFontSizeMaintainUnit)(axisAttr.labelFontSizeWithUnit,axisAttr.outCanfontSizeWithUnit),fontWeight:(0,_lib.pluckNumber)(axisAttr.labelFontBold)?"bold":NORMALSTRING,fontStyle:(0,_lib.pluckNumber)(axisAttr.labelFontItalic)?"italic":NORMALSTRING,color:(0,_lib.convertColor)((0,_lib.pluck)(axisAttr.labelFontColor,axisAttr.outCancolor),(0,_lib.pluckNumber)(axisAttr.labelFontAlpha,100)),labelLink:FCChartObj.labellink,border:labelFontBdrColor||FCChartObj.labelbgcolor?(0,_lib.pluckNumber)(FCChartObj.labelborderthickness,1)+"px solid":"",borderColor:labelFontBdrColor,borderThickness:(0,_lib.pluckNumber)(FCChartObj.labelborderthickness,1),borderPadding:(0,_lib.pluckNumber)(FCChartObj.labelborderpadding,2),borderRadius:(0,_lib.pluckNumber)(FCChartObj.labelborderradius,0),backgroundColor:FCChartObj.labelbgcolor?(0,_lib.convertColor)(FCChartObj.labelbgcolor,(0,_lib.pluckNumber)(FCChartObj.labelbgalpha,FCChartObj.labelalpha,100)):_lib.BLANKSTRING,borderDash:(0,_lib.pluckNumber)(FCChartObj.labelborderdashed,0)?(0,_lib.getDashStyle)((0,_lib.pluckNumber)(FCChartObj.labelborderdashlen,4),(0,_lib.pluckNumber)(FCChartObj.labelborderdashgap,2)):DASH_DEF};axisConfig.labels.style.lineHeight=(0,_lib.setLineHeight)(axisConfig.labels.style);axisConfig.numberFormatterFn=(0,_lib.pluck)(axisAttr.numberFormatterFn);axisConfig.apparentScrollPos=axisAttr.apparentScrollPos||axisConfig.apparentScrollPos;axisConfig.axisEndLabelDisplaySpace={left:0,right:0,top:0,bottom:0};axisConfig.isConfigured=true;axisConfig._defaultForceDecimal=UNDEF;axisConfig._defaultDecimalPrecision=UNDEF;axis.setScrollType("smart");axis.addToEnv("savedAxis",tempAxis&&(0,_lib.extend2)({},tempAxis))};_proto.setScrollType=function setScrollType(type){var visibleConfig=this.getVisibleConfig();if(type==="none"||type==="smart"||type==="always"){this.config.scrollType=type}this.setVisibleConfig(visibleConfig.minValue,visibleConfig.maxValue)};_proto.getScrollType=function getScrollType(){return this.config.scrollType};_proto._processAxisBreak=function _processAxisBreak(){var axis=this,axisConfig=axis.config,breakPoints,count,i,len;axisConfig.breakPoints=[];breakPoints=axisConfig.axisBreak.split("|");for(i=0,len=breakPoints.length,count=0;i<len;i+=1){breakPoints[i]=breakPoints[i].split(",");if(!isNaN(breakPoints[i][0])&&!isNaN(breakPoints[i][1])){axisConfig.breakPoints[count]={start:(0,_lib.pluckNumber)(breakPoints[i][0]),end:(0,_lib.pluckNumber)(breakPoints[i][1]),length:(0,_lib.pluckNumber)(breakPoints[i][2],0)};count+=1}}axisConfig.breakPoints.sort((function compareAxisBreakPoints(a,b){return a.start-b.start}));axisConfig.hasBreakPoints=true;axis._validateBreakPoints()};_proto._validateBreakPoints=function _validateBreakPoints(){var axisConfig=this.config,breakPoints=axisConfig.breakPoints,totalBreakAmount=0,i,len=breakPoints.length;for(i=0;i<len;i+=1){totalBreakAmount+=breakPoints[i].end-breakPoints[i].start}axisConfig.totalBreakAmount=totalBreakAmount};_proto._getRelativeBreakValue=function _getRelativeBreakValue(value){var breakPoints=this.config.breakPoints,i,len=breakPoints.length,valueDeletion=0;for(i=0;i<len;i+=1){if(value>=breakPoints[i].start&&value<=breakPoints[i].end){return breakPoints[i].start-valueDeletion}else if(value<breakPoints[i].start){break}valueDeletion+=breakPoints[i].end-breakPoints[i].start}return value-valueDeletion};_proto._getRealBreakValue=function _getRealBreakValue(_value){var value=_value,breakPoints=this.config.breakPoints,i,len=breakPoints.length;for(i=0;i<len;i+=1){if(value>=breakPoints[i].start){value+=breakPoints[i].end-breakPoints[i].start}else if(value<breakPoints[i].start){return value}}return value};_proto._adjustNumberFormatter=function _adjustNumberFormatter(interval){var axis=this,axisConfig=axis.config,numberFormatter=axis.getFromEnv("chart").getFromEnv("number-formatter"),defaultDecimalPrecision=axisConfig._defaultDecimalPrecision,defaultForceDecimal=axisConfig._defaultForceDecimal,dec,beforeZero=0,numberFormatterSetting;if(axisConfig.isVertical||axisConfig.numberFormatterFn==="yAxis"){numberFormatterSetting=(numberFormatter.Y[axisConfig.axisIndex]||numberFormatter.Y[0]).yAxisLabelConf}else{numberFormatterSetting=numberFormatter.paramX}defaultDecimalPrecision!==UNDEF?numberFormatterSetting.decimalprecision=defaultDecimalPrecision:axisConfig._defaultDecimalPrecision=numberFormatterSetting.decimalprecision;defaultForceDecimal!==UNDEF?numberFormatterSetting.forcedecimals=defaultForceDecimal:axisConfig._defaultForceDecimal=numberFormatterSetting.forcedecimals;if(parseInt(interval,10)>0){return}dec=interval.toString().split(".")[1];if(dec){beforeZero=dec.match(/^[0]*/)[0].length;if(beforeZero+1>numberFormatterSetting.decimalprecision){numberFormatterSetting.forcedecimals=1}numberFormatterSetting.decimalprecision=Math.max(beforeZero+1,numberFormatterSetting.decimalprecision)}};_proto._isZoomed=function _isZoomed(){var viewPortConfig=this.getFromEnv("chart").config.viewPortConfig;if(this.config.isVertical){return viewPortConfig.scaleY!==1}return viewPortConfig.scaleX!==1};_proto._getIntervalArr=function _getIntervalArr(args){var axis=this,axisConfig=axis.config,axisLabelConfig=axisConfig.labels,increment=axisConfig.axisRange.tickInterval*(args&&args.step||1),returnArr=[],getLimit,visibleMin,visibleMax,min,max,i,value;getLimit=this.getVisibleConfig();if(axis.getFromEnv("chart").config.axisType==="polar"){visibleMin=getLimit.minValue;visibleMax=getLimit.maxValue}else{visibleMin=getLimit.minValue-(args&&args.minPad||0);visibleMax=getLimit.maxValue+(args&&args.maxPad||0)}min=roundToMultiple(visibleMin,increment);max=roundToMultiple(visibleMax-visibleMax%increment,increment);if(min===max){return[min]}if(axisLabelConfig.drawNormalVal){for(i=(0,_lib.toPrecision)(min+increment,10);i<max;i=(0,_lib.toPrecision)(i+increment,10)){if(axisConfig.hasBreakPoints){value=(0,_lib.toPrecision)(axis._getRealBreakValue(i),10)}else{value=(0,_lib.toPrecision)(i,10)}returnArr.push(value)}}if(axisLabelConfig.drawLimitVal){returnArr.push(max,min)}returnArr.indexOf(0)!==-1&&returnArr.splice(returnArr.indexOf(0),1);if(axisConfig.showZeroPlane&&min<=0&&max>=0){returnArr.push(0)}return returnArr.sort((function(a,b){return a-b}))};_proto._disposeScrollBar=function _disposeScrollBar(){var axis=this,axisConfig=axis.config;if(axisConfig.scrollBarDrawn){axis.getLinkedItem("scrollBar").hide();axisConfig.scrollBarDrawn=false}};_proto.addComponentInfo=function addComponentInfo(name,obj){this.getFromEnv("componentInfo")[sanitiseComponentName(name)].push(obj)};_proto.getComponentInfo=function getComponentInfo(name){return this.getFromEnv("componentInfo")[sanitiseComponentName(name)]};_proto.clearComponentInfo=function clearComponentInfo(){var componentInfo=this.getFromEnv("componentInfo"),key;for(key in componentInfo){if(componentInfo.hasOwnProperty(key)){componentInfo[key]=[]}}};_proto.draw=function draw(){var axis=this,axisConfig=axis.config,canvas=axisConfig.canvas,chart=axis.getFromEnv("chart"),chartConfig=chart.config,isVertical=axisConfig.isVertical,viewPortConfig=chartConfig.viewPortConfig,limitUpdaters=axis.getChildren().limitUpdater,viewPortRatio=axisConfig.viewPortRatio||{},canvasLeft=canvas.canvasLeft||chartConfig.canvasLeft,canvasTop=canvas.canvasTop||chartConfig.canvasTop,canvasWidth=canvas.canvasWidth||chartConfig.canvasWidth,canvasHeight=canvas.canvasHeight||chartConfig.canvasHeight,axisContainer=axisConfig.axisContainer,axisLabelContainerTop=axisConfig.axisLabelContainerTop,axisPlotLineContainer=axisConfig.axisPlotLineContainer,axisPlotLineContainerTop=axisConfig.axisPlotLineContainerTop,vlineLabelContainer=axisConfig.vlineLabelContainer,axisBandContainer=axisConfig.axisBandContainer,axisNameContainer=axisConfig.axisNameContainer,axisTrendContainerTop=axisConfig.axisTrendContainerTop,axisTrendContainerBottom=axisConfig.axisTrendContainerBottom,axisTrendLabelContainer=axisConfig.axisTrendLabelContainer,axisAxisLineContainer=axisConfig.axisAxisLineContainer,axisAxisLineContainerBottom=axisConfig.axisAxisLineContainerBottom,plotLineWidth=axisConfig.divLineThickness||0,childContainers=chart.getChildContainer(),axisBottom=childContainers.axisBottomGroup,axisTop=childContainers.axisTopGroup,animElems=[],axisBandGroup,axisPlotLineGroup,axisPlotLineGroupTop,axisLineGroup,axisNameGroup,axisLabelGroup,axisLabelGroupTop,axisTrendGroupTop,axisTrendGroupBottom,dx,dy,originY,originX,plotLineClipRect;axis.clearComponentInfo();originY=viewPortConfig.y*viewPortConfig.scaleY;originX=viewPortConfig.x*viewPortConfig.scaleX;if(isVertical){plotLineClipRect=canvasLeft+","+(canvasTop-plotLineWidth)+","+canvasWidth+","+(canvasHeight+plotLineWidth*2)}else{plotLineClipRect=canvasLeft-plotLineWidth+","+canvasTop+","+(canvasWidth+plotLineWidth*2)+","+canvasHeight}axisBandGroup=axis.getContainer("axisBandGroup")||axis.addContainer("axisBandGroup",createGroup("dataset-Band-group",axisBottom,axis));axisPlotLineGroup=axis.getContainer("axisPlotLineGroup")||axis.addContainer("axisPlotLineGroup",createGroup("dataset-Line-group",axisBottom,axis));axisPlotLineGroupTop=axis.getContainer("axisPlotLineGroupTop")||axis.addContainer("axisPlotLineGroupTop",createGroup("dataset-Line-group-top",axisTop,axis));axisNameGroup=axis.getContainer("axisNameGroup")||axis.addContainer("axisNameGroup",createGroup("dataset-Name-group",axisBottom,axis));axisLineGroup=axis.getContainer("axisLineGroup")||axis.addContainer("axisLineGroup",createGroup("axis-Line-group",axisTop,axis));axisTrendGroupTop=axis.getContainer("axisTrendGroupTop")||axis.addContainer("axisTrendGroupTop",createGroup("dataset-Trend-group-top",axisTop,axis));axisLabelGroup=axis.getContainer("axisLabelGroup")||axis.addContainer("axisLabelGroup",createGroup("dataset-Label-group",axisBottom,axis));axisLabelGroupTop=axis.getContainer("axisLabelGroupTop")||axis.addContainer("axisLabelGroupTop",createGroup("dataset-Label-group",axisTop,axis));axisTrendGroupBottom=axis.getContainer("axisTrendGroupBottom")||axis.addContainer("axisTrendGroupBottom",createGroup("dataset-Trend-group-bottom",axisBottom,axis));if(!axisTrendContainerBottom){axisConfig.axisTrendContainerBottom=axisTrendContainerBottom=createGroup("dataset-axis-trend-bottom",axisTrendGroupBottom,axis);axisTrendContainerBottom.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}else{axisTrendContainerBottom.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}if(!axisContainer){axisConfig.axisContainer=axisContainer=createGroup("dataset-axis",axisLabelGroup,axis)}if(!axisLabelContainerTop){axisConfig.axisLabelContainerTop=axisLabelContainerTop=createGroup("dataset-top-label",axisLabelGroupTop,axis)}if(!axisAxisLineContainer){axisConfig.axisAxisLineContainer=axisAxisLineContainer=createGroup("axis-line-tick",axisLineGroup,axis)}if(!vlineLabelContainer){axisConfig.vlineLabelContainer=vlineLabelContainer=createGroup("axis-vline-label",axisLineGroup,axis)}if(!axisBandContainer){axisConfig.axisBandContainer=axisBandContainer=createGroup("dataset-axis-bands",axisBandGroup,axis);axisBandContainer.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}else{animElems.push({el:axisBandContainer,attrs:{"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisPlotLineContainer){axisConfig.axisPlotLineContainer=axisPlotLineContainer=createGroup("dataset-axis-lines",axisPlotLineGroup,axis);axisPlotLineContainer.attr({"clip-rect":plotLineClipRect})}else{animElems.push({el:axisPlotLineContainer,attrs:{"clip-rect":plotLineClipRect},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisPlotLineContainerTop){axisConfig.axisPlotLineContainerTop=axisPlotLineContainerTop=createGroup("dataset-axis-lines-top",axisPlotLineGroupTop,axis);axisPlotLineContainerTop.attr({"clip-rect":plotLineClipRect})}else{animElems.push({el:axisPlotLineContainerTop,attrs:{"clip-rect":plotLineClipRect},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisTrendContainerTop){axisConfig.axisTrendContainerTop=axisTrendContainerTop=createGroup("dataset-axis-trend-top",axisTrendGroupTop,axis);axisTrendContainerTop.attr({"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight})}else{animElems.push({el:axisTrendContainerTop,attrs:{"clip-rect":canvasLeft+","+canvasTop+","+canvasWidth+","+canvasHeight},animType:"linear",animConfig:[{syncWith:"initial",start:0,initial:1}]})}if(!axisTrendLabelContainer){axisConfig.axisTrendLabelContainer=axisTrendLabelContainer=createGroup("dataset-axis-trend-label",axisTrendGroupTop,axis)}if(!axisNameContainer){axisConfig.axisNameContainer=axisNameContainer=createGroup("dataset-axis-name",axisNameGroup,axis)}if(!axisAxisLineContainerBottom){axisConfig.axisAxisLineContainerBottom=axisAxisLineContainerBottom=createGroup("axis-line-tick-bottom",axisBottom,axis)}if(viewPortRatio.scaleX&&viewPortRatio.scaleY&&(viewPortRatio.scaleX!==viewPortConfig.scaleX||viewPortRatio.scaleY!==viewPortConfig.scaleY)){viewPortRatio.scaleX=viewPortConfig.scaleX;viewPortRatio.scaleY=viewPortConfig.scaleY;axis._drawComponents()}else{if(isVertical){dy=originY-viewPortConfig.y*viewPortConfig.scaleY;vlineLabelContainer.transform("t0,"+dy);axisContainer.transform("t0,"+dy);axisLabelContainerTop.transform("t0,"+dy);axisPlotLineContainer.transform("t0,"+dy);axisPlotLineContainerTop.transform("t0,"+dy);axisBandContainer.transform("t0,"+dy);axisTrendContainerTop.transform("t0,"+dy);axisTrendContainerBottom.transform("t0,"+dy)}else{dx=originX-viewPortConfig.x*viewPortConfig.scaleX;vlineLabelContainer.transform("t"+dx+",0");axisContainer.transform("t"+dx+",0");axisLabelContainerTop.transform("t"+dx+",0");axisPlotLineContainer.transform("t"+dx+",0");axisPlotLineContainerTop.transform("t"+dx+",0");axisBandContainer.transform("t"+dx+",0");axisTrendContainerTop.transform("t"+dx+",0");axisTrendContainerBottom.transform("t"+dx+",0")}axis._drawComponents()}axis.addExtEventListener("animationcomplete",(function(){limitUpdaters&&limitUpdaters.forEach(_drawLimitUpdater)}),axis.getFromEnv("animationmanager"));axis.addToEnv("tempAxis",{canvasHeight:axis.config.canvas.canvasHeight,canvasWidth:axis.config.canvas.canvasWidth,canvasLeft:axis.config.canvas.canvasLeft,canvasRight:axis.config.canvas.canvasRight,canvasBottom:axis.config.canvas.canvasBottom,canvasTop:axis.config.canvas.canvasTop,visibleRange:axis.getVisibleConfig(),visibleLength:axis.getVisibleLength(),axisLength:axis.config.axisDimention.axisLength,axisOpposite:axis.config.axisDimention.opposite,axisY:axis.config.axisDimention.y,axisX:axis.config.axisDimention.x,axisRangeMin:axis.config.axisRange.min,axisRangeMax:axis.config.axisRange.max,axisTickInterval:axis.config.axisRange.tickInterval,axisIsReverse:axis.config.isReverse,axisIsVertical:axis.config.isVertical,axisHasBreakPoints:axis.config.hasBreakPoints,viewPortScaleY:axis.getFromEnv("chart").config.viewPortConfig.scaleY,viewPortY:axis.getFromEnv("chart").config.viewPortConfig.y,viewPortScaleX:axis.getFromEnv("chart").config.viewPortConfig.scaleX,viewPortX:axis.getFromEnv("chart").config.viewPortConfig.x,chartHeight:axis.getFromEnv("chart").config.canvasHeight,chartWidth:axis.getFromEnv("chart").config.canvasWidth,chartLeft:axis.getFromEnv("chart").config.canvasLeft,chartRight:axis.getFromEnv("chart").config.canvasRight,chartBottom:axis.getFromEnv("chart").config.canvasBottom,chartTop:axis.getFromEnv("chart").config.canvasTop,pvr:axis.config.pvr,refVal:axis.config.refVal,refVisibleVal:axis.config.refVisibleVal})};_proto.getBreakPoints=function getBreakPoints(){var axisConfig=this.config;if(axisConfig.hasBreakPoints){return axisConfig.breakPoints}return false};_proto.getValue=function getValue(pixel,options){var axis=this,axisConfig=axis.config,wrtVisible=options&&options.wrtVisible,refVal=wrtVisible?axisConfig.refVisibleVal:axisConfig.refVal;return refVal+(pixel-axisConfig.refPx)/axis.config.pvr};_proto.getDraggedValue=function getDraggedValue(pixel){var axis=this,parent=this._linkedParent,config=parent==null?void 0:parent.config,viewPortConfig=config==null?void 0:config.viewPortConfig,axisConfig=axis.config,adjustedPixel=pixel,refVal=axisConfig.refVal;if(config!=null&&config.scrolltodate)adjustedPixel-=(viewPortConfig==null?void 0:viewPortConfig.scaleX)*viewPortConfig.x;return Math.round(refVal+(adjustedPixel-axisConfig.refPx)/axisConfig.pvr/(viewPortConfig==null?void 0:viewPortConfig.scaleX))};_proto.getVisibleLength=function getVisibleLength(){var limit=this.getVisibleConfig();return Math.abs(limit.maxValue-limit.minValue)};_proto.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;startPad=axisConfig.startPad=Math.max(axisConfig.startPad,startPad);endPad=axisConfig.endPad=Math.max(axisConfig.endPad,endPad);if(axisConfig.oriCatLen===0){if(startPad===0){startPad=.5}if(endPad===0){endPad=.5}}if(axisConfig.hasCategory){if(axisConfig.oriCatLen>=0){axis.setAxisRange({max:axisConfig.oriCatLen+endPad,min:-startPad})}}else{if(axisConfig.originalMax&&axisConfig.originalMin){axis.setDataLimit(axisConfig.originalMax,axisConfig.originalMin)}}};_proto.setAxisConfig=function setAxisConfig(data){var axisConfig=this.config,prop;for(prop in data){if(data.hasOwnProperty(prop)){axisConfig[prop]=data[prop]}}};_proto.getAxisConfig=function getAxisConfig(name){var axisConfig=this.config;if(name){return axisConfig[name]}return axisConfig};_proto.setAxisRange=function setAxisRange(data){var axis=this,axisConfig=axis.config,axisRange=axisConfig.axisRange,tempAxis,tempAxisRange,prop;for(prop in data){if(data.hasOwnProperty(prop)){axisRange[prop]=data[prop]}}if(axisConfig.isReverse){axisConfig.refVal=axisRange.max}else{axisConfig.refVal=axisRange.min}axis.setVisibleConfig(axisRange.min,axisRange.max);if(axis.getFromEnv("tempAxis")){tempAxis=axis.getFromEnv("tempAxis");tempAxisRange={max:tempAxis.axisRangeMax,min:tempAxis.axisRangeMin,tickInterval:tempAxis.axisTickInterval};if(tempAxisRange.max!==axisRange.max||tempAxisRange.min!==axisRange.min||tempAxisRange.tickInterval!==axisRange.tickInterval){axisConfig.rangeChanged=true}else{axisConfig.rangeChanged=false}}};_proto.setAxisDimention=function setAxisDimention(data){var axis=this,axisConfig=axis.config,chartConfig=axis.getFromEnv("chart").config,axisDimention=axisConfig.axisDimention||(axisConfig.axisDimention={}),tempAxis;axisDimention.opposite=(0,_lib.pluckNumber)(data.opposite,axisDimention.opposite);axisDimention.x=(0,_lib.pluckNumber)(data.x,chartConfig.canvasLeft,axisDimention.x);axisDimention.y=(0,_lib.pluckNumber)(data.y,chartConfig.canvasTop,axisDimention.y);axisDimention.axisLength=(0,_lib.pluckNumber)(data.axisLength,axisDimention.axisLength);if(axisConfig.isVertical){axisConfig.refPx=axisDimention.y}else{axisConfig.refPx=axisDimention.x}axis.getPVR();if(axis.getFromEnv("tempAxis")){tempAxis=axis.getFromEnv("tempAxis");if(tempAxis.axisLength!==axisDimention.axisLength||tempAxis.axisOpposite!==axisDimention.opposite||tempAxis.axisY!==axisDimention.y||tempAxis.axisX!==axisDimention.x){axisConfig.dimensionChanged=true}else{axisConfig.dimensionChanged=false}}};_proto.setDataLimit=function setDataLimit(_max,_min){var axis=this,axisConfig=axis.config,max=_max,min=_min,axisRange=axisConfig.axisRange,AxisMaxValue=axisConfig.isPercent?100:axisConfig.axisMaxValue,AxisMinValue=axisConfig.isPercent?0:axisConfig.axisMinValue,numDivLines=axisConfig.numDivLines,setAdaptiveMin=axisConfig.setAdaptiveMin,adjustDiv=axisConfig.adjustDiv,startPad=axisConfig.startPad||0,endPad=axisConfig.endPad||0,setMinAsZero,stopMaxAtZero,axisLimits,lines=axisConfig.trendLines||axisConfig.vTrendLines,lineArr=lines&&lines[0]&&lines[0].line,lineMin,lineMax;lineMin=(0,_safeMin.default)(lineArr,(function _getMin(obj){return obj.startvalue}));lineMax=(0,_safeMax.default)(lineArr,(function _getMax(obj){return obj.endvalue}));min=(0,_safeMin.default)([lineMin,min]);max=(0,_safeMax.default)([lineMax,max]);axisConfig.originalMax=max;axisConfig.originalMin=min;max=axisConfig.isPercent?100:max+endPad;min=axisConfig.isPercent?0:min-startPad;setMinAsZero=stopMaxAtZero=!setAdaptiveMin;if(axisConfig.hasBreakPoints){max-=axisConfig.totalBreakAmount}axisLimits=(0,_lib.getAxisLimits)((0,_lib.pluckNumber)(max,AxisMaxValue),(0,_lib.pluckNumber)(min,AxisMinValue),AxisMaxValue,AxisMinValue,stopMaxAtZero,setMinAsZero,numDivLines,adjustDiv);axis.setAxisRange({max:Number((0,_lib.toPrecision)(axisLimits.Max,10)),min:Number((0,_lib.toPrecision)(axisLimits.Min,10)),tickInterval:Number((0,_lib.toPrecision)(axisLimits.divGap,10))});axis._adjustNumberFormatter(axisRange.tickInterval);if(axisRange.tickInterval===0){axisRange.tickInterval=1}};_proto.setVisibleConfig=function setVisibleConfig(minValue,maxValue){var axis=this,axisConfig=axis.config,range=axisConfig.axisRange,scrollType=axis.getScrollType(),axisScroll,translationStr,zoom,maxZoomLimit=axisConfig.maxZoomLimit;if(minValue>maxValue){return false}zoom=(range.max-range.min)/(maxValue-minValue);if(maxZoomLimit&&zoom>maxZoomLimit){return false}axisConfig.minVisibleValue=minValue;axisConfig.maxVisibleValue=maxValue;if(axisConfig.isReverse){axisConfig.refVisibleVal=maxValue}else{axisConfig.refVisibleVal=minValue}if(scrollType==="always"){axis.setScrollEnabled(true)}else if(scrollType==="smart"){if(axis._isZoomed()){axis.setScrollEnabled(true)}else{axis.setScrollEnabled(false)}}else if(scrollType==="none"&&axis.isScrollEnabled()){axis.setScrollEnabled(false)}axis.getPVR();axis.fireEvent("visiblerangeset",{minValue:axisConfig.minVisibleValue,maxValue:axisConfig.maxVisibleValue});if(axis.getFromEnv("tempAxis")){axis.asyncDraw();axisScroll=-axis.getTranslation();if(axisConfig.isVertical){translationStr=["T",0,",",axisScroll].join("")}else{translationStr=["T",axisScroll,",",0].join("")}axisConfig.axisContainer.attr({transform:translationStr});axisConfig.axisBandContainer.attr({transform:translationStr});axisConfig.axisPlotLineContainer.attr({transform:translationStr});axisConfig.axisTrendContainerTop.attr({transform:translationStr})}return true};_proto.getVisibleConfig=function getVisibleConfig(){var axisConfig=this.config;return{minValue:axisConfig.minVisibleValue,maxValue:axisConfig.maxVisibleValue}};_proto.getPVR=function getPVR(){var axis=this,axisConfig=axis.config,visibleConfig=axis.getVisibleConfig(),visibleSpan=visibleConfig.maxValue-visibleConfig.minValue,axisLength=(axisConfig.axisDimention||{}).axisLength,pvr=axisLength/visibleSpan;if(pvr){if(axisConfig.isReverse){axisConfig.pvr=-pvr}else{axisConfig.pvr=pvr}}return axisConfig.pvr};_proto.getPixel=function getPixel(_value,options){var axis=this,axisConfig=axis.config,value=_value,wrtVisible=options&&options.wrtVisible,refVal=wrtVisible?axisConfig.refVisibleVal:axisConfig.refVal,tempAxis=axis.getFromEnv("tempAxis"),pvr=axisConfig.pvr*axis.getFromEnv("chartConfig").viewPortConfig.scaleX;if(options&&options.preValue&&tempAxis){refVal=wrtVisible?tempAxis.refVisibleVal:tempAxis.refVal;pvr=axis.getOldPVR()}if(!pvr){return 0}if(axisConfig.hasBreakPoints){value=axis._getRelativeBreakValue(value)}return(0,_lib.toPrecision)(axisConfig.refPx+(value-refVal)*pvr,2)};_proto.getLimit=function getLimit(){var axisRange=this.config.axisRange;return{min:axisRange.min,max:axisRange.max,tickInterval:axisRange.tickInterval}};_proto.getOldPVR=function getOldPVR(){var tempAxis=this.getFromEnv("tempAxis");return tempAxis?tempAxis.pvr:this.config.pvr};_proto.hide=function hide(){var axisConfig=this.config;if(!axisConfig.axisContainer){return}axisConfig.axisLabelContainerTop.hide();axisConfig.axisContainer.hide();axisConfig.axisPlotLineContainer.hide();axisConfig.axisPlotLineContainerTop.hide();axisConfig.axisBandContainer.hide();axisConfig.axisNameContainer.hide();axisConfig.axisTrendContainerTop.hide();axisConfig.axisTrendContainerBottom.hide();axisConfig.axisTrendLabelContainer.hide();axisConfig.axisAxisLineContainer.hide();axisConfig.axisAxisLineContainerBottom.hide()};_proto.show=function show(){var axisConfig=this.config;if(!axisConfig.axisContainer){return}axisConfig.axisLabelContainerTop.show();axisConfig.axisContainer.show();axisConfig.axisPlotLineContainer.show();axisConfig.axisPlotLineContainerTop.show();axisConfig.axisBandContainer.show();axisConfig.axisNameContainer.show();axisConfig.axisTrendContainerTop.show();axisConfig.axisTrendContainerBottom.show();axisConfig.axisTrendLabelContainer.show();axisConfig.axisAxisLineContainer.show();axisConfig.axisAxisLineContainerBottom.show()};_proto.getTranslation=function getTranslation(){var axis=this,axisConfig=axis.config;return axis.getPixel(axisConfig.refVisibleVal)-axisConfig.refPx};_proto.setScrollEnabled=function setScrollEnabled(bool){var axis=this;axis.config.scrollEnabled=bool;if(bool){axis.getFromEnv("chart")._createToolBoxGantt();axis.getFromEnv("tempAxis")&&axis.asyncDraw()}else{axis._disposeScrollBar()}};_proto.isScrollEnabled=function isScrollEnabled(){return this.config.scrollEnabled};_proto.manageProcessScroll=function manageProcessScroll(scroll){var axis=this,axisConfig=axis.config,spaceTaken=axisConfig.totalWidth||0,totalVisiblelWidth=axisConfig.totalVisiblelWidth,translateX;if(spaceTaken>totalVisiblelWidth){translateX=(spaceTaken-totalVisiblelWidth)*(1-scroll);axis.translateAxis(translateX,UNDEF)}};_proto.translateAxis=function translateAxis(x,y){var axis=this,axisConfig=axis.config,ganttPlotLineContainer=axis.getContainer("ganttPlotLineContainer"),ganttPlotHoverBandContainer=axis.getContainer("ganttPlotHoverBandContainer"),lastTranslate=axisConfig.lastTranslate||(axisConfig.lastTranslate={x:0,y:0}),ganttLabelContainer=axis.getContainer("labelContainer"),ganttHeaderContainer=axis.getContainer("headerContainer"),hotContainer=axis.getContainer("hotContainer"),dx,dy;dx=x!==UNDEF?x-lastTranslate.x:0;dy=y!==UNDEF?y-lastTranslate.y:0;lastTranslate.x=x!==UNDEF?x:lastTranslate.x;lastTranslate.y=y!==UNDEF?y:lastTranslate.y;ganttLabelContainer&&ganttLabelContainer.translate(dx,dy);ganttHeaderContainer&&ganttHeaderContainer.translate(dx,dy);axisConfig.labelContainer&&axisConfig.labelContainer.translate(dx,dy);hotContainer&&hotContainer.translate(dx,dy);axisConfig.headerContainer&&axisConfig.headerContainer.translate(dx,0);if(axisConfig.isVertical){ganttPlotLineContainer&&ganttPlotLineContainer.translate(0,dy);ganttPlotHoverBandContainer&&ganttPlotHoverBandContainer.translate(0,dy)}else{ganttPlotLineContainer&&ganttPlotLineContainer.translate(dx,0);ganttPlotHoverBandContainer&&ganttPlotHoverBandContainer.translate(dx,0);axis.setAxisConfig({animateAxis:false});axisConfig.drawTrendLines&&axis._drawTrendLine();axis.setAxisConfig({animateAxis:true})}};_proto.resetTransletAxis=function resetTransletAxis(){var axis=this,axisConfig=axis.config,ganttLabelContainer=axis.getContainer("labelContainer"),ganttHeaderContainer=axis.getContainer("headerContainer"),hotContainer=axis.getContainer("hotContainer"),transformAttr;transformAttr={transform:"t0,0"};axisConfig.lastTranslate={x:0,y:0};ganttLabelContainer&&ganttLabelContainer.attr(transformAttr);ganttHeaderContainer&&ganttHeaderContainer.attr(transformAttr);axisConfig.labelContainer&&axisConfig.labelContainer.attr(transformAttr);axisConfig.headerContainer&&axisConfig.headerContainer.attr(transformAttr);axisConfig.ganttPlotLineContainer&&axisConfig.ganttPlotLineContainer.attr(transformAttr);axisConfig.ganttPlotHoverBandContainer&&axisConfig.ganttPlotHoverBandContainer.attr(transformAttr);hotContainer&&hotContainer.attr(transformAttr)};return CartesianAxis}(_componentInterface.ComponentInterface);var _default=CartesianAxis;exports.default=_default; |
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _gaugePolarNumeric=_interopRequireDefault(require("./gauge-polar-numeric"));var _lib=require("../lib");var _polarUtil=require("@fusioncharts/utils/src/scale-utils/polar-util");var _diff=_interopRequireDefault(require("@fusioncharts/utils/src/scale-utils/array/diff"));var _dependencyManager=require("../dependency-manager");var _polarNumeric=_interopRequireDefault(require("./polar-numeric.animation"));var _linear=_interopRequireDefault(require("@fusioncharts/utils/src/scales/linear"));var UNDEF,POSITION_MIDDLE=_lib.preDefStr.POSITION_MIDDLE,POSITION_START=_lib.preDefStr.POSITION_START,POSITION_TOP=_lib.preDefStr.POSITION_TOP,POSITION_BOTTOM=_lib.preDefStr.POSITION_BOTTOM,POSITION_END=_lib.preDefStr.POSITION_END,BLANKSTRING="",GUTTER_PADDING=5,M="M",L="L",math=Math,pi=math.PI,pi2=2*pi,TICK="_tick",LABEL_ID="_label",TRENDLINE_ID="_trendLine",TRENDLABEL_ID="_trendLabel",TRENDMARKER_ID="_marker";(0,_dependencyManager.addDep)({name:"polarNumericAnimation",type:"animationRule",extension:_polarNumeric.default});var PolarGaugeAxis=function(_GaugePolarNumeric){(0,_inheritsLoose2.default)(PolarGaugeAxis,_GaugePolarNumeric);function PolarGaugeAxis(){var _this;_this=_GaugePolarNumeric.call(this)||this;_this.config.scale=new _linear.default;_this.config.prevTickMarks=[];_this.config.prevIntervalArrLabel=[];_this.config.prevIntervalArrTrendLine=[];return _this}var _proto=PolarGaugeAxis.prototype;_proto.getName=function getName(){return"polarNumeric"};_proto.setAxisDimention=function setAxisDimention(){var axis=this,scale=axis.getScale(),axisConfig=axis.config,startAngle=axisConfig.startAngle||pi2/2,totalAngle=axisConfig.totalAngle||pi2/2,endAngle=startAngle+totalAngle,rangeArr,axisDimention=axisConfig.axisDimention||(axisConfig.axisDimention={});axisDimention.centerX=axisConfig.centerX;axisDimention.centerY=axisConfig.centerY;axisDimention.axisLength=pi2;rangeArr=[startAngle,endAngle];scale.setRange(rangeArr)};_proto.__setDefaultConfig=function __setDefaultConfig(){_GaugePolarNumeric.prototype.__setDefaultConfig.call(this);var config=this.config;config.trendPoints=UNDEF;config.ticksBelowGauge=UNDEF;config.ticksBelowGraph=UNDEF;config.trendValueDistance=UNDEF};_proto.configureAttributes=function configureAttributes(rawAttr){var axis=this,axisConfig=axis.config,axisAttr;_GaugePolarNumeric.prototype.configureAttributes.call(this,rawAttr);axisAttr=axisConfig.rawAttr;axisConfig.upperLimitDisplay=axisAttr.upperLimitDisplay||"";axisConfig.lowerLimitDisplay=axisAttr.lowerLimitDisplay||"";axisConfig.polarPadding=4};_proto._drawComponents=function _drawComponents(){var axis=this,axisConfig=axis.config;axisConfig.drawTick&&axis._drawTick();axisConfig.drawLabels&&axis._drawLabel();axisConfig.drawTrendLines&&axis._drawTrendLine()};_proto.getAngle=function getAngle(value){var axis=this,angle,axisScale=axis.getScale();angle=axisScale.getRangeValue(value);return angle};_proto.placeAxis=function placeAxis(maxLimit){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),smartLabel=chart.getFromEnv("smartLabel"),axisRange=axisConfig.axisRange,labelStyle=axisConfig.labels.style,increment=axisRange.tickInterval||1,upperLimitDisplay=axisConfig.upperLimitDisplay,lowerLimitDisplay=axisConfig.lowerLimitDisplay,max=axisRange.max,min=axisRange.min,maxTextSize=0,maxText,i,counter,text,numberFormatterFn,textWidthBuffer,numberFormatter=chart.getFromEnv("number-formatter"),numDimention,ret,leftLimit;ret={left:0,right:0,top:0,bottom:0};smartLabel.useEllipsesOnOverflow(chart.config.useEllipsesWhenOverflow);smartLabel.setStyle({fontSize:labelStyle.fontSize,fontFamily:labelStyle.fontFamily,lineHeight:labelStyle.lineHeight,fontWeight:labelStyle.fontWeight});if(!axis.components){axis.components={};axis.components.labels=[]}axisConfig.labels.isDraw=1;axisConfig.labels.drawNormalVal=1;axisConfig.labels.drawLimitVal=1;axisConfig.lines.isDraw=1;axisConfig.labels.step=axisConfig.tickValueStep;axisConfig.labelPadding=0;leftLimit=maxLimit;if(axisConfig.drawLabels&&axisConfig.showTickValues&&leftLimit>0){axisConfig.labelPadding+=axisConfig.tickValueDistance;leftLimit-=axisConfig.tickValueDistance;numberFormatterFn=numberFormatter.scale;for(i=min,counter=0;i<=max;i+=increment){text=""+numberFormatterFn.call(numberFormatter,(0,_lib.toPrecision)(i,10));numDimention=smartLabel.getOriSize(text,true);axis.components.labels[counter]={config:{width:numDimention.width,height:numDimention.height,props:{label:{attr:{}}}}};counter++;if(text.length>maxTextSize){maxText=text;maxTextSize=text.length}}numDimention=smartLabel.getOriSize(maxText,true);if(numDimention.width>maxLimit/2){axisConfig.labels.isDraw=false;return ret}if(axisConfig.showLimits){if(upperLimitDisplay||lowerLimitDisplay){textWidthBuffer=smartLabel.getOriSize(upperLimitDisplay,true);if(textWidthBuffer.width>numDimention.width){maxText=upperLimitDisplay;maxTextSize=textWidthBuffer.width;numDimention=textWidthBuffer}textWidthBuffer=smartLabel.getOriSize(lowerLimitDisplay,true);if(textWidthBuffer.width>numDimention.width){maxText=lowerLimitDisplay;maxTextSize=textWidthBuffer.width;numDimention=textWidthBuffer}}}else{axisConfig.labels.drawLimitVal=false}numDimention=smartLabel.getOriSize(maxText);axisConfig.labelMaxW=numDimention.width;if(axisConfig.labelMaxW>maxLimit/2){axisConfig.labelMaxW=maxLimit/2}axisConfig.labelMaxH=numDimention.height;if(!axisConfig.placeValuesInside){ret.right+=axisConfig.labelMaxW+axisConfig.tickValueDistance;ret.left+=axisConfig.labelMaxW+axisConfig.tickValueDistance;ret.top+=axisConfig.labelMaxH+axisConfig.tickValueDistance;ret.bottom+=axisConfig.labelMaxH+axisConfig.tickValueDistance}else{axisConfig.labelPadding=-axisConfig.labelPadding}}else{axisConfig.labels.isDraw=false}return ret};_proto._parseLabel=function _parseLabel(){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),axisRange=axisConfig.axisRange,axisScale=axis.getScale(),smartLabel=chart.getFromEnv("smartLabel"),labelStore,labelConf,labels=axisConfig.labels,style=labels.style,axisPadding=axisConfig.labelPadding||0,radius=axisConfig.radius,gaugeOuterRadius=(0,_lib.pluckNumber)(axisConfig.gaugeOuterRadius,radius),gaugeInnerRadius=(0,_lib.pluckNumber)(axisConfig.gaugeInnerRadius,radius),centerX=axisConfig.centerX,centerY=axisConfig.centerY,placeValuesInside=axisConfig.placeValuesInside,axisValueMaxH=axisConfig.labelMaxH,axisValueMaxW=axisConfig.labelMaxW,i,tick,max=axisRange.max,min=axisRange.min,tempText,theta,text,increment,parsing,ticks=axisConfig.ticks,ticksLen=ticks.length,labelLineHeight,numberFormatterFn,numberFormatter=chart.getFromEnv("number-formatter"),axisAttrObj,getPos;if(style.lineHeight){labelLineHeight=style.lineHeight;if(labelLineHeight.indexOf("px")!==-1){labelLineHeight=labelLineHeight.replace("px","");labelLineHeight=parseFloat(labelLineHeight)}}smartLabel.useEllipsesOnOverflow(chart.config.useEllipsesWhenOverflow);smartLabel.setStyle({fontSize:style.fontSize,fontFamily:style.fontFamily,lineHeight:style.lineHeight,fontWeight:style.fontWeight});if(axisConfig.labels.isDraw){labelStore=axis.components.labels;increment=axisConfig.labels.step;parsing=function parsing(index){tick=ticks[index];theta=axisScale.getRangeValue(tick);if(!axisConfig.labels.drawNormalVal&&!(axisConfig.labels.drawLimitVal&&(tick===min||tick===max))){return}if(!axisConfig.labels.drawNormalVal&&!(tick===min||tick===max)){return}if(!axisConfig.labels.drawLimitVal&&(tick===min||tick===max)){return}if(axisConfig.showZeroPlaneValue===0&&axisConfig.showZeroPlane===0&&tick===0){return}numberFormatterFn=numberFormatter.scale;if(tick===min&&axisConfig.lowerLimitDisplay){tempText=smartLabel.getSmartText(axisConfig.lowerLimitDisplay,axisValueMaxW,axisValueMaxH);text=tempText.text}else if(tick===max&&axisConfig.upperLimitDisplay){tempText=smartLabel.getSmartText(axisConfig.upperLimitDisplay,axisValueMaxW,axisValueMaxH);text=tempText.text}else{text=numberFormatterFn.call(numberFormatter,(0,_lib.toPrecision)(tick,10))}if(placeValuesInside){getPos=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius+axisPadding-axisConfig.polarPadding,theta)}else{getPos=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius+axisPadding+axisConfig.polarPadding,theta)}getPos.x+=centerX;getPos.y+=centerY;axisAttrObj={fill:style.color,"line-height":labelLineHeight,text:text,x:getPos.x,y:getPos.y};if(getPos.x>centerX-10&&getPos.x<centerX+10&&getPos.y<centerY){axisAttrObj["text-anchor"]=POSITION_MIDDLE;axisAttrObj["text-valign"]=placeValuesInside?POSITION_TOP:POSITION_BOTTOM}else if(getPos.x>centerX-10&&getPos.x<centerX+10&&getPos.y<centerY){axisAttrObj["text-anchor"]=POSITION_MIDDLE;axisAttrObj["text-valign"]=placeValuesInside?POSITION_BOTTOM:POSITION_TOP}else if(getPos.x<centerX){axisAttrObj["text-anchor"]=placeValuesInside?POSITION_START:POSITION_END;axisAttrObj["text-valign"]="center"}else{axisAttrObj["text-anchor"]=placeValuesInside?POSITION_END:POSITION_START;axisAttrObj["text-valign"]="center"}labelConf=labelStore[index]=labelStore[index]||{config:{props:{label:{attr:{}}}}};labelConf.config.props.label.attr=Object.assign(labelConf.config.props.label.attr,axisAttrObj)};for(i=0;i<ticksLen;i+=increment){parsing(i)}if((ticksLen-1)%increment!==0){parsing(ticksLen-1)}}};_proto._drawLabel=function _drawLabel(){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),axisRange=axisConfig.axisRange,labels=axisConfig.labels,style=labels.style,i,tick,max=axisRange.max,min=axisRange.min,axisContainer=axisConfig.axisLabelContainerTop,textElement,animationManager=chart.getFromEnv("animationManager"),css={fontFamily:style.fontFamily,fontSize:style.fontSize,fontWeight:style.fontWeight,fontStyle:style.fontStyle,lineHeight:style.lineHeight},axisAttrObj,ticks=axisConfig.ticks,ticksLen=ticks.length,tickMap=[],ln,diff,increment,drawing,removingElement,textElementCheck;axisContainer.show();axisContainer.css(css);if(axisConfig.labels.isDraw){increment=axisConfig.labels.step;drawing=function drawing(index){tick=ticks[index];if(!axisConfig.labels.drawNormalVal&&!(axisConfig.labels.drawLimitVal&&(tick===min||tick===max))){return}if(!axisConfig.labels.drawNormalVal&&!(tick===min||tick===max)){return}if(!axisConfig.labels.drawLimitVal&&(tick===min||tick===max)){return}if(axisConfig.showZeroPlaneValue===0&&axisConfig.showZeroPlane===0&&tick===0){return}tickMap.push(tick);textElementCheck=axis.getGraphicalElement(""+tick+LABEL_ID);axisAttrObj=axis.components.labels[index].config.props.label.attr;textElement=animationManager.setAnimation({el:textElementCheck||"text",attr:axisAttrObj,container:axisContainer,component:axis,label:"text"});if(!textElementCheck){axis.addGraphicalElement(""+tick+LABEL_ID,textElement)}};for(i=0;i<ticksLen;i+=increment){drawing(i)}if((ticksLen-1)%increment!==0){drawing(ticksLen-1)}}diff=(0,_diff.default)(axisConfig.prevIntervalArrLabel,tickMap);for(tick=0,ln=diff.length;tick<ln;tick++){removingElement=axis.getGraphicalElement(""+diff[tick]+LABEL_ID);removingElement&&axis.removeGraphicalElement(removingElement)}axisConfig.prevIntervalArrLabel=tickMap};_proto._drawTick=function _drawTick(){var axis=this,axisConfig=axis.config,drawTick=axisConfig.drawTick,axisScale=axis.getScale(),thetaMajor,thetaMinor,drawTickMinor=axisConfig.drawTickMinor,chart=axis.getFromEnv("chart"),animationManager=chart.getFromEnv("animationManager"),radius=axisConfig.radius,centerX=axisConfig.centerX,centerY=axisConfig.centerY,gaugeOuterRadius=(0,_lib.pluckNumber)(axisConfig.gaugeOuterRadius,radius),gaugeInnerRadius=(0,_lib.pluckNumber)(axisConfig.gaugeInnerRadius,radius),lineElement,minorTickObj,majorTickObj,statPix,endPixMajor,endPixMinor,i,minorV,tickGroup,diff,tempObj,tickValue,ticks=axisConfig.ticks,minorTickValues=axisConfig.minorTicks,majorTickCheck,prevTickMap,minorTickCheck,removingElement,ln;tickGroup=axisConfig.axisAxisLineContainer;majorTickObj={stroke:axisConfig.majorTMColor,"stroke-width":axisConfig.majorTMThickness,"stroke-linecap":"round"};minorTickObj={stroke:axisConfig.minorTMColor,"stroke-width":axisConfig.minorTMThickness,"stroke-linecap":"round"};tickGroup.show();prevTickMap=axisConfig.prevTickMarks;axisConfig.prevTickMarks=[];if(axisConfig.lines.isDraw&&drawTick&&axisConfig.showTickMarks){axisConfig.prevTickMarks=ticks.slice();for(i=0;i<ticks.length;i++){tickValue=ticks[i];thetaMajor=axisScale.getRangeValue(tickValue);if(!axisConfig.placeTicksInside){statPix=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius,thetaMajor);endPixMajor=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius-axisConfig.majorTMHeight,thetaMajor)}else{statPix=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius,thetaMajor);endPixMajor=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius+axisConfig.majorTMHeight,thetaMajor)}statPix.x+=centerX;statPix.y+=centerY;endPixMajor.x+=centerX;endPixMajor.y+=centerY;majorTickObj.path="M"+statPix.x+" "+statPix.y+"L"+endPixMajor.x+" "+endPixMajor.y;tempObj=Object.assign({},majorTickObj);majorTickCheck=axis.getGraphicalElement(""+ticks[i]+TICK);lineElement=animationManager.setAnimation({el:majorTickCheck||"path",attr:tempObj,container:tickGroup,component:axis,label:"path"});if(!majorTickCheck){axis.addGraphicalElement(""+ticks[i]+TICK,lineElement)}}if(drawTickMinor){axisConfig.prevTickMarks=axisConfig.prevTickMarks.concat(minorTickValues);for(i=0;i<minorTickValues.length;i+=1){minorV=minorTickValues[i];thetaMinor=axisScale.getRangeValue(minorV);if(!axisConfig.placeTicksInside){statPix=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius,thetaMinor);endPixMinor=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius-axisConfig.minorTMHeight,thetaMinor)}else{statPix=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius,thetaMinor);endPixMinor=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius+axisConfig.minorTMHeight,thetaMinor)}statPix.x+=centerX;statPix.y+=centerY;endPixMinor.x+=centerX;endPixMinor.y+=centerY;minorTickObj.path="M"+statPix.x+" "+statPix.y+"L"+endPixMinor.x+" "+endPixMinor.y;tempObj=Object.assign({},minorTickObj);minorTickCheck=axis.getGraphicalElement(""+minorTickValues[i]+TICK);lineElement=animationManager.setAnimation({el:minorTickCheck||"path",attr:tempObj,container:tickGroup,component:axis,label:"path"});if(!minorTickCheck){axis.addGraphicalElement(""+minorTickValues[i]+TICK,lineElement)}}}}diff=(0,_diff.default)(prevTickMap,axisConfig.prevTickMarks);for(i=0,ln=diff.length;i<ln;i++){removingElement=axis.getGraphicalElement(""+diff[i]+TICK);removingElement&&axis.removeGraphicalElement(removingElement)}};_proto._drawTrendLine=function _drawTrendLine(){var axis=this,axisConfig=axis.config,axisRange=axisConfig.axisRange,toolTipController=axis.getFromEnv("toolTipController"),max=axisRange.max,axisScale=axis.getScale(),theta,min=axisRange.min,canvas=axisConfig.canvas,chart=axis.getFromEnv("chart"),chartConfig=chart.config,smartLabel=chart.getFromEnv("smartLabel"),colorM=chart.getFromEnv("color-manager"),animationManager=chart.getFromEnv("animationManager"),scaleFactor=axisConfig.scaleFactor,centerX=axisConfig.centerX||0,centerY=axisConfig.centerY||0,canvasWidth=canvas.canvasWidth||chartConfig.canvasWidth,style=axisConfig.trend.trendStyle,axisTrendContainerTop=axisConfig.axisTrendContainerTop,axisTrendContainerBottom=axisConfig.axisTrendContainerBottom,axisTrendLabelContainer=axisConfig.axisTrendLabelContainer,css={fontFamily:style.fontFamily,fontSize:style.fontSize,lineHeight:style.lineHeight,fontWeight:style.fontWeight,fontStyle:style.fontStyle},numberFormatter=chart.getFromEnv("number-formatter"),trendPoints=axisConfig.trendPoints,point=trendPoints&&trendPoints.point,deg2rad=math.PI/180,trendText={},i,iLim=point&&point.length,trendElement,trendElemenCheck,trendLabelElementCheck,trendLabelElement,isTrendZone,axisDrawingAttrObj={},axisMarkerAttrObj={},axisTextAttrObj={},trendPointObj,startValue,endValue,AttrList,sides,limitingValue,limitingNegValue,trendOuterRadius,trendInnerRadius,startPoints,startPoints1,startX,startY,startX1,startY1,trendEndAngle,trendStartAngle,textValue,cosTh,sinTh,trendTextWidth,textRadius,align,trendTextHeight,stHeight,trendMarkerElement,trendMarkerCheck,trendValues=[],idStart,diff,removingElement,removingElementLabel,removingElementMarker,ln;smartLabel.useEllipsesOnOverflow(chartConfig.useEllipsesWhenOverflow);smartLabel.setStyle(css);for(i=0;i<iLim;i+=1){trendPointObj=trendPoints.point[i];trendValues.push(trendPointObj.startvalue+"_"+trendPointObj.endvalue+"_"+i)}diff=(0,_diff.default)(axisConfig.prevIntervalArrTrendLine,trendValues);for(i=0,ln=diff.length;i<ln;i++){removingElement=axis.getGraphicalElement(""+diff[i]+TRENDLINE_ID);removingElementLabel=axis.getGraphicalElement(""+diff[i]+TRENDLABEL_ID);removingElementMarker=axis.getGraphicalElement(""+diff[i]+TRENDMARKER_ID);removingElement&&axis.removeGraphicalElement(removingElement);removingElementLabel&&axis.removeGraphicalElement(removingElementLabel);removingElementMarker&&axis.removeGraphicalElement(removingElementMarker)}axisConfig.prevIntervalArrTrendLine=trendValues.slice();for(i=0;i<iLim;i+=1){trendPointObj=trendPoints.point[i];idStart=trendPointObj.startvalue+"_"+trendPointObj.endvalue+"_"+i;startValue=(0,_lib.pluckNumber)(trendPointObj.startvalue,trendPointObj.value);endValue=(0,_lib.pluckNumber)(trendPointObj.endvalue,startValue);theta=axisScale.getRangeValue(startValue);isTrendZone=startValue!==endValue;if(startValue<=max&&startValue>=min&&endValue<=max&&endValue>=min){AttrList={startValue:startValue,endValue:endValue,tooltext:(0,_lib.getValidValue)((0,_lib.parseUnsafeString)(trendPointObj.markertooltext,false)),displayValue:(0,_lib.getValidValue)((0,_lib.parseUnsafeString)(trendPointObj.displayvalue),isTrendZone?BLANKSTRING:numberFormatter.scale(startValue)),showOnTop:(0,_lib.pluckNumber)(trendPointObj.showontop,axisConfig.ticksBelowGauge,axisConfig.ticksBelowGraph,1),color:(0,_lib.pluck)(trendPointObj.color,colorM.getColor("trendLightColor")),alpha:(0,_lib.pluckNumber)(trendPointObj.alpha,99),thickness:(0,_lib.pluckNumber)(trendPointObj.thickness,1),dashStyle:trendPointObj.dashed?(0,_lib.getDashStyle)(trendPointObj.dashlen||2,trendPointObj.dashgap||2):"",useMarker:(0,_lib.pluckNumber)(trendPointObj.usemarker,0),markerColor:(0,_lib.convertColor)((0,_lib.pluck)(trendPointObj.markercolor,trendPointObj.color,colorM.getColor("trendLightColor")),100),markerBorderColor:(0,_lib.convertColor)((0,_lib.pluck)(trendPointObj.markerbordercolor,trendPointObj.bordercolor,colorM.getColor("trendDarkColor")),100),markerRadius:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.markerradius)*scaleFactor,5),markerToolText:(0,_lib.getFirstValue)(trendPointObj.markertooltext),trendValueDistance:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.trendvaluedistance,axisConfig.trendValueDistance)*scaleFactor,axisConfig.tickValueDistance),isTrendZone:isTrendZone,valueInside:(0,_lib.pluckNumber)(trendPointObj.valueinside,axisConfig.placeValuesInside,0),showBorder:(0,_lib.pluckNumber)(trendPointObj.showborder,1),borderColor:(0,_lib.convertColor)((0,_lib.pluck)(trendPointObj.bordercolor,trendPointObj.color,colorM.getColor("trendDarkColor")),(0,_lib.pluckNumber)(trendPointObj.borderalpha,trendPointObj.alpha,100)),radius:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.radius)*scaleFactor),innerRadius:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.innerradius)*scaleFactor)};sides=3;limitingValue=Math.cos(89.99*deg2rad);limitingNegValue=-limitingValue;trendOuterRadius=(0,_lib.pluckNumber)(AttrList.radius,axisConfig.gaugeOuterRadius);trendInnerRadius=(0,_lib.pluckNumber)(AttrList.innerRadius,isTrendZone?Math.max(axisConfig.gaugeInnerRadius-15,0):axisConfig.gaugeInnerRadius);startPoints=(0,_polarUtil.polarToCartesian)(trendOuterRadius,theta);startPoints1=(0,_polarUtil.polarToCartesian)(trendInnerRadius,theta);startPoints.x+=centerX;startPoints.y+=centerY;startPoints1.x+=centerX;startPoints1.y+=centerY;startX=startPoints.x;startY=startPoints.y;startX1=startPoints1.x;startY1=startPoints1.y;trendEndAngle=axis.getAngle(endValue);trendStartAngle=axis.getAngle(startValue);if(isTrendZone){if(trendStartAngle>trendEndAngle){trendStartAngle+=trendEndAngle;trendEndAngle=trendStartAngle-trendEndAngle;trendStartAngle=trendStartAngle-trendEndAngle}axisDrawingAttrObj={fill:(0,_lib.convertColor)(AttrList.color,AttrList.alpha),"stroke-width":AttrList.showBorder?AttrList.thickness:0,stroke:AttrList.borderColor,"stroke-dasharray":AttrList.dashStyle,ringpath:[centerX,centerY,trendOuterRadius,trendInnerRadius,trendStartAngle,trendEndAngle]}}else{axisDrawingAttrObj={"stroke-width":AttrList.showBorder?AttrList.thickness:0,stroke:AttrList.borderColor,"stroke-linecap":"round","stroke-dasharray":AttrList.dashStyle,path:[M,startX,startY,L,startX1,startY1]}}if(AttrList.useMarker){axisMarkerAttrObj={fill:AttrList.markerColor,"stroke-width":1,stroke:AttrList.markerBorderColor,polypath:[sides,startX,startY,AttrList.markerRadius,(-trendStartAngle+Math.PI)/deg2rad,0]}}else{axisMarkerAttrObj={}}if(AttrList.displayValue!==BLANKSTRING){textValue=(AttrList.endValue+AttrList.startValue)/2;trendEndAngle=axis.getAngle(textValue);cosTh=Math.cos(trendEndAngle);sinTh=Math.sin(trendEndAngle);trendTextWidth=smartLabel.getOriSize(AttrList.displayValue).width;if(AttrList.valueInside){textRadius=trendInnerRadius-2-AttrList.trendValueDistance;align=cosTh>limitingValue?POSITION_END:cosTh<limitingNegValue?POSITION_START:POSITION_MIDDLE}else{textRadius=trendOuterRadius+2+AttrList.trendValueDistance;align=cosTh>limitingValue?POSITION_START:cosTh<limitingNegValue?POSITION_END:POSITION_MIDDLE}startX=centerX+textRadius*cosTh;startY=centerY+textRadius*sinTh;trendTextHeight=smartLabel.getOriSize(AttrList.displayValue).height;trendText=smartLabel.getSmartText(AttrList.displayValue,canvasWidth,trendTextHeight);startX=canvasWidth<startX+trendTextWidth?canvasWidth-trendTextWidth-GUTTER_PADDING:startX<trendTextWidth?trendTextWidth+GUTTER_PADDING:startX;if(trendTextWidth>canvasWidth){startX=canvasWidth/2}axisTextAttrObj={fill:(0,_lib.convertColor)(trendPointObj.color,AttrList.alpha)||style.color,text:trendText.text,"text-anchor":align,"vertical-align":POSITION_TOP,"text-bound":[style.backgroundColor,style.borderColor,style.borderThickness,style.borderPadding,style.borderRadius,style.borderDash],x:startX,y:startY};stHeight=trendText.height;if(cosTh>limitingValue||cosTh<limitingNegValue){startY+=-(stHeight/2)+stHeight*.4*sinTh*(AttrList.valueInside?-1:1)}else{if(AttrList.valueInside){startY+=-(sinTh<0?0:stHeight)}else{startY+=-(sinTh>0?0:stHeight)}}axisTextAttrObj.y=startY}else{axisTextAttrObj={text:BLANKSTRING}}trendElemenCheck=axis.getGraphicalElement(idStart+TRENDLINE_ID);trendLabelElementCheck=axis.getGraphicalElement(idStart+TRENDLABEL_ID);trendMarkerCheck=axis.getGraphicalElement(idStart+TRENDMARKER_ID);trendElement=isTrendZone?animationManager.setAnimation({el:trendElemenCheck||"ringpath",attr:axisDrawingAttrObj,container:axisTrendContainerBottom,component:axis,label:"ringpath"}):animationManager.setAnimation({el:trendElemenCheck||"path",attr:axisDrawingAttrObj,container:axisTrendContainerTop,component:axis,label:"path"});trendElement.show();trendElement.data("label",isTrendZone?"ringPath":"path");trendLabelElement=animationManager.setAnimation({el:trendLabelElementCheck||"text",attr:axisTextAttrObj,container:axisTrendLabelContainer,component:axis,label:"text"});trendLabelElement.css(css);trendLabelElement.show();trendMarkerElement=animationManager.setAnimation({el:trendMarkerCheck||"polypath",attr:axisMarkerAttrObj,container:axisTrendContainerTop,component:axis,label:"polypath"});trendMarkerElement.show();if(axisConfig.showTooltip){if(trendText.oriText){toolTipController.enableToolTip(trendLabelElement,trendText.oriText)}else{toolTipController.disableToolTip(trendLabelElement)}if(AttrList.markerToolText){toolTipController.enableToolTip(trendMarkerElement,AttrList.markerToolText)}else{toolTipController.disableToolTip(trendMarkerElement)}}if(!trendElemenCheck){axis.addGraphicalElement(idStart+TRENDLINE_ID,trendElement)}if(!trendElemenCheck){axis.addGraphicalElement(idStart+TRENDLABEL_ID,trendLabelElement)}if(!trendMarkerCheck){axis.addGraphicalElement(idStart+TRENDMARKER_ID,trendMarkerElement)}}}};return PolarGaugeAxis}(_gaugePolarNumeric.default);var _default=PolarGaugeAxis;exports.default=_default; | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _gaugePolarNumeric=_interopRequireDefault(require("./gauge-polar-numeric"));var _lib=require("../lib");var _polarUtil=require("@fusioncharts/utils/src/scale-utils/polar-util");var _diff=_interopRequireDefault(require("@fusioncharts/utils/src/scale-utils/array/diff"));var _dependencyManager=require("../dependency-manager");var _polarNumeric=_interopRequireDefault(require("./polar-numeric.animation"));var _linear=_interopRequireDefault(require("@fusioncharts/utils/src/scales/linear"));var UNDEF,POSITION_MIDDLE=_lib.preDefStr.POSITION_MIDDLE,POSITION_START=_lib.preDefStr.POSITION_START,POSITION_TOP=_lib.preDefStr.POSITION_TOP,POSITION_BOTTOM=_lib.preDefStr.POSITION_BOTTOM,POSITION_END=_lib.preDefStr.POSITION_END,BLANKSTRING="",GUTTER_PADDING=5,M="M",L="L",math=Math,pi=math.PI,pi2=2*pi,TICK="_tick",LABEL_ID="_label",TRENDLINE_ID="_trendLine",TRENDLABEL_ID="_trendLabel",TRENDMARKER_ID="_marker",trendTextPositions=[],overLappingPoints={};(0,_dependencyManager.addDep)({name:"polarNumericAnimation",type:"animationRule",extension:_polarNumeric.default});var PolarGaugeAxis=function(_GaugePolarNumeric){(0,_inheritsLoose2.default)(PolarGaugeAxis,_GaugePolarNumeric);function PolarGaugeAxis(){var _this;_this=_GaugePolarNumeric.call(this)||this;_this.config.scale=new _linear.default;_this.config.prevTickMarks=[];_this.config.prevIntervalArrLabel=[];_this.config.prevIntervalArrTrendLine=[];return _this}var _proto=PolarGaugeAxis.prototype;_proto.getName=function getName(){return"polarNumeric"};_proto.setAxisDimention=function setAxisDimention(){var axis=this,scale=axis.getScale(),axisConfig=axis.config,startAngle=axisConfig.startAngle||pi2/2,totalAngle=axisConfig.totalAngle||pi2/2,endAngle=startAngle+totalAngle,rangeArr,axisDimention=axisConfig.axisDimention||(axisConfig.axisDimention={});axisDimention.centerX=axisConfig.centerX;axisDimention.centerY=axisConfig.centerY;axisDimention.axisLength=pi2;rangeArr=[startAngle,endAngle];scale.setRange(rangeArr)};_proto.__setDefaultConfig=function __setDefaultConfig(){_GaugePolarNumeric.prototype.__setDefaultConfig.call(this);var config=this.config;config.trendPoints=UNDEF;config.ticksBelowGauge=UNDEF;config.ticksBelowGraph=UNDEF;config.trendValueDistance=UNDEF};_proto.configureAttributes=function configureAttributes(rawAttr){var axis=this,axisConfig=axis.config,axisAttr;_GaugePolarNumeric.prototype.configureAttributes.call(this,rawAttr);axisAttr=axisConfig.rawAttr;axisConfig.upperLimitDisplay=axisAttr.upperLimitDisplay||"";axisConfig.lowerLimitDisplay=axisAttr.lowerLimitDisplay||"";axisConfig.polarPadding=4};_proto._drawComponents=function _drawComponents(){var axis=this,axisConfig=axis.config;axisConfig.drawTick&&axis._drawTick();axisConfig.drawLabels&&axis._drawLabel();axisConfig.drawTrendLines&&axis._drawTrendLine()};_proto.getAngle=function getAngle(value){var axis=this,angle,axisScale=axis.getScale();angle=axisScale.getRangeValue(value);return angle};_proto.placeAxis=function placeAxis(maxLimit){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),smartLabel=chart.getFromEnv("smartLabel"),axisRange=axisConfig.axisRange,labelStyle=axisConfig.labels.style,increment=axisRange.tickInterval||1,upperLimitDisplay=axisConfig.upperLimitDisplay,lowerLimitDisplay=axisConfig.lowerLimitDisplay,max=axisRange.max,min=axisRange.min,maxTextSize=0,maxText,i,counter,text,numberFormatterFn,textWidthBuffer,numberFormatter=chart.getFromEnv("number-formatter"),numDimention,ret,leftLimit;ret={left:0,right:0,top:0,bottom:0};smartLabel.useEllipsesOnOverflow(chart.config.useEllipsesWhenOverflow);smartLabel.setStyle({fontSize:labelStyle.fontSize,fontFamily:labelStyle.fontFamily,lineHeight:labelStyle.lineHeight,fontWeight:labelStyle.fontWeight});if(!axis.components){axis.components={};axis.components.labels=[]}axisConfig.labels.isDraw=1;axisConfig.labels.drawNormalVal=1;axisConfig.labels.drawLimitVal=1;axisConfig.lines.isDraw=1;axisConfig.labels.step=axisConfig.tickValueStep;axisConfig.labelPadding=0;leftLimit=maxLimit;if(axisConfig.drawLabels&&axisConfig.showTickValues&&leftLimit>0){axisConfig.labelPadding+=axisConfig.tickValueDistance;leftLimit-=axisConfig.tickValueDistance;numberFormatterFn=numberFormatter.scale;for(i=min,counter=0;i<=max;i+=increment){text=""+numberFormatterFn.call(numberFormatter,(0,_lib.toPrecision)(i,10));numDimention=smartLabel.getOriSize(text,true);axis.components.labels[counter]={config:{width:numDimention.width,height:numDimention.height,props:{label:{attr:{}}}}};counter++;if(text.length>maxTextSize){maxText=text;maxTextSize=text.length}}numDimention=smartLabel.getOriSize(maxText,true);if(numDimention.width>maxLimit/2){axisConfig.labels.isDraw=false;return ret}if(axisConfig.showLimits){if(upperLimitDisplay||lowerLimitDisplay){textWidthBuffer=smartLabel.getOriSize(upperLimitDisplay,true);if(textWidthBuffer.width>numDimention.width){maxText=upperLimitDisplay;maxTextSize=textWidthBuffer.width;numDimention=textWidthBuffer}textWidthBuffer=smartLabel.getOriSize(lowerLimitDisplay,true);if(textWidthBuffer.width>numDimention.width){maxText=lowerLimitDisplay;maxTextSize=textWidthBuffer.width;numDimention=textWidthBuffer}}}else{axisConfig.labels.drawLimitVal=false}numDimention=smartLabel.getOriSize(maxText);axisConfig.labelMaxW=numDimention.width;if(axisConfig.labelMaxW>maxLimit/2){axisConfig.labelMaxW=maxLimit/2}axisConfig.labelMaxH=numDimention.height;if(!axisConfig.placeValuesInside){ret.right+=axisConfig.labelMaxW+axisConfig.tickValueDistance;ret.left+=axisConfig.labelMaxW+axisConfig.tickValueDistance;ret.top+=axisConfig.labelMaxH+axisConfig.tickValueDistance;ret.bottom+=axisConfig.labelMaxH+axisConfig.tickValueDistance}else{axisConfig.labelPadding=-axisConfig.labelPadding}}else{axisConfig.labels.isDraw=false}return ret};_proto._parseLabel=function _parseLabel(){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),axisRange=axisConfig.axisRange,axisScale=axis.getScale(),smartLabel=chart.getFromEnv("smartLabel"),labelStore,labelConf,labels=axisConfig.labels,style=labels.style,axisPadding=axisConfig.labelPadding||0,radius=axisConfig.radius,gaugeOuterRadius=(0,_lib.pluckNumber)(axisConfig.gaugeOuterRadius,radius),gaugeInnerRadius=(0,_lib.pluckNumber)(axisConfig.gaugeInnerRadius,radius),centerX=axisConfig.centerX,centerY=axisConfig.centerY,placeValuesInside=axisConfig.placeValuesInside,axisValueMaxH=axisConfig.labelMaxH,axisValueMaxW=axisConfig.labelMaxW,i,tick,max=axisRange.max,min=axisRange.min,tempText,theta,text,increment,parsing,ticks=axisConfig.ticks,ticksLen=ticks.length,labelLineHeight,numberFormatterFn,numberFormatter=chart.getFromEnv("number-formatter"),axisAttrObj,getPos;if(style.lineHeight){labelLineHeight=style.lineHeight;if(labelLineHeight.indexOf("px")!==-1){labelLineHeight=labelLineHeight.replace("px","");labelLineHeight=parseFloat(labelLineHeight)}}smartLabel.useEllipsesOnOverflow(chart.config.useEllipsesWhenOverflow);smartLabel.setStyle({fontSize:style.fontSize,fontFamily:style.fontFamily,lineHeight:style.lineHeight,fontWeight:style.fontWeight});if(axisConfig.labels.isDraw){labelStore=axis.components.labels;increment=axisConfig.labels.step;parsing=function parsing(index){tick=ticks[index];theta=axisScale.getRangeValue(tick);if(!axisConfig.labels.drawNormalVal&&!(axisConfig.labels.drawLimitVal&&(tick===min||tick===max))){return}if(!axisConfig.labels.drawNormalVal&&!(tick===min||tick===max)){return}if(!axisConfig.labels.drawLimitVal&&(tick===min||tick===max)){return}if(axisConfig.showZeroPlaneValue===0&&axisConfig.showZeroPlane===0&&tick===0){return}numberFormatterFn=numberFormatter.scale;if(tick===min&&axisConfig.lowerLimitDisplay){tempText=smartLabel.getSmartText(axisConfig.lowerLimitDisplay,axisValueMaxW,axisValueMaxH);text=tempText.text}else if(tick===max&&axisConfig.upperLimitDisplay){tempText=smartLabel.getSmartText(axisConfig.upperLimitDisplay,axisValueMaxW,axisValueMaxH);text=tempText.text}else{text=numberFormatterFn.call(numberFormatter,(0,_lib.toPrecision)(tick,10))}if(placeValuesInside){getPos=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius+axisPadding-axisConfig.polarPadding,theta)}else{getPos=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius+axisPadding+axisConfig.polarPadding,theta)}getPos.x+=centerX;getPos.y+=centerY;axisAttrObj={fill:style.color,"line-height":labelLineHeight,text:text,x:getPos.x,y:getPos.y};if(getPos.x>centerX-10&&getPos.x<centerX+10&&getPos.y<centerY){axisAttrObj["text-anchor"]=POSITION_MIDDLE;axisAttrObj["text-valign"]=placeValuesInside?POSITION_TOP:POSITION_BOTTOM}else if(getPos.x>centerX-10&&getPos.x<centerX+10&&getPos.y<centerY){axisAttrObj["text-anchor"]=POSITION_MIDDLE;axisAttrObj["text-valign"]=placeValuesInside?POSITION_BOTTOM:POSITION_TOP}else if(getPos.x<centerX){axisAttrObj["text-anchor"]=placeValuesInside?POSITION_START:POSITION_END;axisAttrObj["text-valign"]="center"}else{axisAttrObj["text-anchor"]=placeValuesInside?POSITION_END:POSITION_START;axisAttrObj["text-valign"]="center"}labelConf=labelStore[index]=labelStore[index]||{config:{props:{label:{attr:{}}}}};labelConf.config.props.label.attr=Object.assign(labelConf.config.props.label.attr,axisAttrObj)};for(i=0;i<ticksLen;i+=increment){parsing(i)}if((ticksLen-1)%increment!==0){parsing(ticksLen-1)}}};_proto._drawLabel=function _drawLabel(){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),axisRange=axisConfig.axisRange,labels=axisConfig.labels,style=labels.style,i,tick,max=axisRange.max,min=axisRange.min,axisContainer=axisConfig.axisLabelContainerTop,textElement,animationManager=chart.getFromEnv("animationManager"),css={fontFamily:style.fontFamily,fontSize:style.fontSize,fontWeight:style.fontWeight,fontStyle:style.fontStyle,lineHeight:style.lineHeight},axisAttrObj,ticks=axisConfig.ticks,ticksLen=ticks.length,tickMap=[],ln,diff,increment,drawing,removingElement,textElementCheck;axisContainer.show();axisContainer.css(css);if(axisConfig.labels.isDraw){increment=axisConfig.labels.step;drawing=function drawing(index){tick=ticks[index];if(!axisConfig.labels.drawNormalVal&&!(axisConfig.labels.drawLimitVal&&(tick===min||tick===max))){return}if(!axisConfig.labels.drawNormalVal&&!(tick===min||tick===max)){return}if(!axisConfig.labels.drawLimitVal&&(tick===min||tick===max)){return}if(axisConfig.showZeroPlaneValue===0&&axisConfig.showZeroPlane===0&&tick===0){return}tickMap.push(tick);textElementCheck=axis.getGraphicalElement(""+tick+LABEL_ID);axisAttrObj=axis.components.labels[index].config.props.label.attr;textElement=animationManager.setAnimation({el:textElementCheck||"text",attr:axisAttrObj,container:axisContainer,component:axis,label:"text"});if(!textElementCheck){axis.addGraphicalElement(""+tick+LABEL_ID,textElement)}};for(i=0;i<ticksLen;i+=increment){drawing(i)}if((ticksLen-1)%increment!==0){drawing(ticksLen-1)}}diff=(0,_diff.default)(axisConfig.prevIntervalArrLabel,tickMap);for(tick=0,ln=diff.length;tick<ln;tick++){removingElement=axis.getGraphicalElement(""+diff[tick]+LABEL_ID);removingElement&&axis.removeGraphicalElement(removingElement)}axisConfig.prevIntervalArrLabel=tickMap};_proto._drawTick=function _drawTick(){var axis=this,axisConfig=axis.config,drawTick=axisConfig.drawTick,axisScale=axis.getScale(),thetaMajor,thetaMinor,drawTickMinor=axisConfig.drawTickMinor,chart=axis.getFromEnv("chart"),animationManager=chart.getFromEnv("animationManager"),radius=axisConfig.radius,centerX=axisConfig.centerX,centerY=axisConfig.centerY,gaugeOuterRadius=(0,_lib.pluckNumber)(axisConfig.gaugeOuterRadius,radius),gaugeInnerRadius=(0,_lib.pluckNumber)(axisConfig.gaugeInnerRadius,radius),lineElement,minorTickObj,majorTickObj,statPix,endPixMajor,endPixMinor,i,minorV,tickGroup,diff,tempObj,tickValue,ticks=axisConfig.ticks,minorTickValues=axisConfig.minorTicks,majorTickCheck,prevTickMap,minorTickCheck,removingElement,ln;tickGroup=axisConfig.axisAxisLineContainer;majorTickObj={stroke:axisConfig.majorTMColor,"stroke-width":axisConfig.majorTMThickness,"stroke-linecap":"round"};minorTickObj={stroke:axisConfig.minorTMColor,"stroke-width":axisConfig.minorTMThickness,"stroke-linecap":"round"};tickGroup.show();prevTickMap=axisConfig.prevTickMarks;axisConfig.prevTickMarks=[];if(axisConfig.lines.isDraw&&drawTick&&axisConfig.showTickMarks){axisConfig.prevTickMarks=ticks.slice();for(i=0;i<ticks.length;i++){tickValue=ticks[i];thetaMajor=axisScale.getRangeValue(tickValue);if(!axisConfig.placeTicksInside){statPix=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius,thetaMajor);endPixMajor=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius-axisConfig.majorTMHeight,thetaMajor)}else{statPix=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius,thetaMajor);endPixMajor=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius+axisConfig.majorTMHeight,thetaMajor)}statPix.x+=centerX;statPix.y+=centerY;endPixMajor.x+=centerX;endPixMajor.y+=centerY;majorTickObj.path="M"+statPix.x+" "+statPix.y+"L"+endPixMajor.x+" "+endPixMajor.y;tempObj=Object.assign({},majorTickObj);majorTickCheck=axis.getGraphicalElement(""+ticks[i]+TICK);lineElement=animationManager.setAnimation({el:majorTickCheck||"path",attr:tempObj,container:tickGroup,component:axis,label:"path"});if(!majorTickCheck){axis.addGraphicalElement(""+ticks[i]+TICK,lineElement)}}if(drawTickMinor){axisConfig.prevTickMarks=axisConfig.prevTickMarks.concat(minorTickValues);for(i=0;i<minorTickValues.length;i+=1){minorV=minorTickValues[i];thetaMinor=axisScale.getRangeValue(minorV);if(!axisConfig.placeTicksInside){statPix=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius,thetaMinor);endPixMinor=(0,_polarUtil.polarToCartesian)(gaugeOuterRadius-axisConfig.minorTMHeight,thetaMinor)}else{statPix=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius,thetaMinor);endPixMinor=(0,_polarUtil.polarToCartesian)(gaugeInnerRadius+axisConfig.minorTMHeight,thetaMinor)}statPix.x+=centerX;statPix.y+=centerY;endPixMinor.x+=centerX;endPixMinor.y+=centerY;minorTickObj.path="M"+statPix.x+" "+statPix.y+"L"+endPixMinor.x+" "+endPixMinor.y;tempObj=Object.assign({},minorTickObj);minorTickCheck=axis.getGraphicalElement(""+minorTickValues[i]+TICK);lineElement=animationManager.setAnimation({el:minorTickCheck||"path",attr:tempObj,container:tickGroup,component:axis,label:"path"});if(!minorTickCheck){axis.addGraphicalElement(""+minorTickValues[i]+TICK,lineElement)}}}}diff=(0,_diff.default)(prevTickMap,axisConfig.prevTickMarks);for(i=0,ln=diff.length;i<ln;i++){removingElement=axis.getGraphicalElement(""+diff[i]+TICK);removingElement&&axis.removeGraphicalElement(removingElement)}};_proto._drawTrendLine=function _drawTrendLine(){var _ref;var axis=this,axisConfig=axis.config,axisRange=axisConfig.axisRange,toolTipController=axis.getFromEnv("toolTipController"),max=axisRange.max,markerLabelOffset,axisScale=axis.getScale(),theta,min=axisRange.min,canvas=axisConfig.canvas,chart=axis.getFromEnv("chart"),chartConfig=chart.config,smartLabel=chart.getFromEnv("smartLabel"),colorM=chart.getFromEnv("color-manager"),animationManager=chart.getFromEnv("animationManager"),scaleFactor=axisConfig.scaleFactor,centerX=axisConfig.centerX||0,centerY=axisConfig.centerY||0,canvasWidth=canvas.canvasWidth||chartConfig.canvasWidth,style=axisConfig.trend.trendStyle,axisTrendContainerTop=axisConfig.axisTrendContainerTop,axisTrendContainerBottom=axisConfig.axisTrendContainerBottom,axisTrendLabelContainer=axisConfig.axisTrendLabelContainer,css={fontFamily:style.fontFamily,fontSize:style.fontSize,lineHeight:style.lineHeight,fontWeight:style.fontWeight,fontStyle:style.fontStyle},numberFormatter=chart.getFromEnv("number-formatter"),trendPoints=axisConfig.trendPoints,point=trendPoints&&trendPoints.point,deg2rad=math.PI/180,trendText={},i,totalPoints=(_ref=point&&point.length)!=null?_ref:0,trendElement,trendElemenCheck,trendLabelElementCheck,trendLabelElement,isTrendZone,axisDrawingAttrObj={},axisMarkerAttrObj={},axisTextAttrObj={},trendPointObj,startValue,endValue,overlappingArray,AttrList,sides,limitingValue,limitingNegValue,trendOuterRadius,trendInnerRadius,startPoints,startPoints1,startX,startY,startX1,startY1,trendEndAngle,trendStartAngle,textValue,cosTh,sinTh,trendTextWidth,textRadius,align,trendTextHeight,stHeight,trendMarkerElement,trendMarkerCheck,trendValues=[],idStart,diff,removingElement,removingElementLabel,removingElementMarker,ln;smartLabel.useEllipsesOnOverflow(chartConfig.useEllipsesWhenOverflow);smartLabel.setStyle(css);for(i=0;i<totalPoints;i+=1){trendPointObj=trendPoints.point[i];trendValues.push(trendPointObj.startvalue+"_"+trendPointObj.endvalue+"_"+i)}diff=(0,_diff.default)(axisConfig.prevIntervalArrTrendLine,trendValues);for(i=0,ln=diff.length;i<ln;i++){removingElement=axis.getGraphicalElement(""+diff[i]+TRENDLINE_ID);removingElementLabel=axis.getGraphicalElement(""+diff[i]+TRENDLABEL_ID);removingElementMarker=axis.getGraphicalElement(""+diff[i]+TRENDMARKER_ID);removingElement&&axis.removeGraphicalElement(removingElement);removingElementLabel&&axis.removeGraphicalElement(removingElementLabel);removingElementMarker&&axis.removeGraphicalElement(removingElementMarker)}axisConfig.prevIntervalArrTrendLine=trendValues.slice();for(var k=0;k<totalPoints;k++){var currentTrendPoint=trendPoints.point[k];for(var j=k+1;j<totalPoints;j++){var nextTrendPoint=trendPoints.point[j],currStartValue=(0,_lib.pluckNumber)(currentTrendPoint.startvalue,currentTrendPoint.value),currEndValue=(0,_lib.pluckNumber)(currentTrendPoint.endvalue,currStartValue),nextStartValue=(0,_lib.pluckNumber)(nextTrendPoint.startvalue,nextTrendPoint.value),nextEndValue=(0,_lib.pluckNumber)(nextTrendPoint.endvalue,nextStartValue),key=currStartValue+"_"+currEndValue;overlappingArray=overLappingPoints[key];if(currStartValue===nextStartValue&&currEndValue===nextEndValue){if(!overlappingArray){overLappingPoints[key]=[];overlappingArray=overLappingPoints[key]}this.addToOverlappingPoints(currentTrendPoint.displayvalue,key);this.addToOverlappingPoints(nextTrendPoint.displayvalue,key)}}}for(i=0;i<totalPoints;i+=1){var _trendPointObj;trendPointObj=trendPoints.point[i];markerLabelOffset=(0,_lib.pluckNumber)((_trendPointObj=trendPointObj)==null?void 0:_trendPointObj.markerlabeloffset,0);idStart=trendPointObj.startvalue+"_"+trendPointObj.endvalue+"_"+i;startValue=(0,_lib.pluckNumber)(trendPointObj.startvalue,trendPointObj.value);endValue=(0,_lib.pluckNumber)(trendPointObj.endvalue,startValue);theta=axisScale.getRangeValue(startValue);isTrendZone=startValue!==endValue;overlappingArray=overLappingPoints[startValue+"_"+endValue];if(startValue<=max&&startValue>=min&&endValue<=max&&endValue>=min){AttrList={startValue:startValue,endValue:endValue,tooltext:(0,_lib.getValidValue)((0,_lib.parseUnsafeString)(trendPointObj.markertooltext,false)),displayValue:(0,_lib.getValidValue)((0,_lib.parseUnsafeString)(trendPointObj.displayvalue),isTrendZone?BLANKSTRING:numberFormatter.scale(startValue)),showOnTop:(0,_lib.pluckNumber)(trendPointObj.showontop,axisConfig.ticksBelowGauge,axisConfig.ticksBelowGraph,1),color:(0,_lib.pluck)(trendPointObj.color,colorM.getColor("trendLightColor")),alpha:(0,_lib.pluckNumber)(trendPointObj.alpha,99),thickness:(0,_lib.pluckNumber)(trendPointObj.thickness,1),dashStyle:trendPointObj.dashed?(0,_lib.getDashStyle)(trendPointObj.dashlen||2,trendPointObj.dashgap||2):"",useMarker:(0,_lib.pluckNumber)(trendPointObj.usemarker,0),markerColor:(0,_lib.convertColor)((0,_lib.pluck)(trendPointObj.markercolor,trendPointObj.color,colorM.getColor("trendLightColor")),100),markerBorderColor:(0,_lib.convertColor)((0,_lib.pluck)(trendPointObj.markerbordercolor,trendPointObj.bordercolor,colorM.getColor("trendDarkColor")),100),markerRadius:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.markerradius)*scaleFactor,5),markerToolText:(0,_lib.getFirstValue)(trendPointObj.markertooltext),trendValueDistance:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.trendvaluedistance,axisConfig.trendValueDistance)*scaleFactor,axisConfig.tickValueDistance),isTrendZone:isTrendZone,valueInside:(0,_lib.pluckNumber)(trendPointObj.valueinside,axisConfig.placeValuesInside,0),showBorder:(0,_lib.pluckNumber)(trendPointObj.showborder,1),borderColor:(0,_lib.convertColor)((0,_lib.pluck)(trendPointObj.bordercolor,trendPointObj.color,colorM.getColor("trendDarkColor")),(0,_lib.pluckNumber)(trendPointObj.borderalpha,trendPointObj.alpha,100)),radius:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.radius)*scaleFactor),innerRadius:(0,_lib.pluckNumber)((0,_lib.pluckNumber)(trendPointObj.innerradius)*scaleFactor)};sides=3;limitingValue=Math.cos(89.99*deg2rad);limitingNegValue=-limitingValue;trendOuterRadius=(0,_lib.pluckNumber)(AttrList.radius,axisConfig.gaugeOuterRadius);trendInnerRadius=(0,_lib.pluckNumber)(AttrList.innerRadius,isTrendZone?Math.max(axisConfig.gaugeInnerRadius-15,0):axisConfig.gaugeInnerRadius);startPoints=(0,_polarUtil.polarToCartesian)(trendOuterRadius,theta);startPoints1=(0,_polarUtil.polarToCartesian)(trendInnerRadius,theta);startPoints.x+=centerX;startPoints.y+=centerY;startPoints1.x+=centerX;startPoints1.y+=centerY;startX=startPoints.x;startY=startPoints.y;startX1=startPoints1.x;startY1=startPoints1.y;trendEndAngle=axis.getAngle(endValue);trendStartAngle=axis.getAngle(startValue);if(isTrendZone){if(trendStartAngle>trendEndAngle){trendStartAngle+=trendEndAngle;trendEndAngle=trendStartAngle-trendEndAngle;trendStartAngle=trendStartAngle-trendEndAngle}axisDrawingAttrObj={fill:(0,_lib.convertColor)(AttrList.color,AttrList.alpha),"stroke-width":AttrList.showBorder?AttrList.thickness:0,stroke:AttrList.borderColor,"stroke-dasharray":AttrList.dashStyle,ringpath:[centerX,centerY,trendOuterRadius,trendInnerRadius,trendStartAngle,trendEndAngle]}}else{axisDrawingAttrObj={"stroke-width":AttrList.showBorder?AttrList.thickness:0,stroke:AttrList.borderColor,"stroke-linecap":"round","stroke-dasharray":AttrList.dashStyle,path:[M,startX,startY,L,startX1,startY1]}}if(AttrList.useMarker){axisMarkerAttrObj={fill:AttrList.markerColor,"stroke-width":1,stroke:AttrList.markerBorderColor,polypath:[sides,startX,startY,AttrList.markerRadius,(-trendStartAngle+Math.PI)/deg2rad,0]}}else{axisMarkerAttrObj={}}if(AttrList.displayValue!==BLANKSTRING){textValue=(AttrList.endValue+AttrList.startValue)/2;trendEndAngle=axis.getAngle(textValue);cosTh=Math.cos(trendEndAngle);sinTh=Math.sin(trendEndAngle);trendTextWidth=smartLabel.getOriSize(AttrList.displayValue).width;if(AttrList.valueInside){textRadius=trendInnerRadius-2-AttrList.trendValueDistance;align=cosTh>limitingValue?POSITION_END:cosTh<limitingNegValue?POSITION_START:POSITION_MIDDLE}else{textRadius=trendOuterRadius+2+AttrList.trendValueDistance;align=cosTh>limitingValue?POSITION_START:cosTh<limitingNegValue?POSITION_END:POSITION_MIDDLE}startX=centerX+textRadius*cosTh;startY=centerY+textRadius*sinTh;trendTextHeight=smartLabel.getOriSize(AttrList.displayValue).height;trendText=smartLabel.getSmartText(AttrList.displayValue,canvasWidth,trendTextHeight);startX=canvasWidth<startX+trendTextWidth?canvasWidth-trendTextWidth-GUTTER_PADDING:startX<trendTextWidth?trendTextWidth+GUTTER_PADDING:startX;if(trendTextWidth>canvasWidth){startX=canvasWidth/2}axisTextAttrObj={fill:(0,_lib.convertColor)(trendPointObj.color,AttrList.alpha)||style.color,text:trendText.text,"text-anchor":align,"vertical-align":POSITION_TOP,"text-bound":[style.backgroundColor,style.borderColor,style.borderThickness,style.borderPadding,style.borderRadius,style.borderDash],x:startX,y:startY};stHeight=trendText.height;if(cosTh>limitingValue||cosTh<limitingNegValue){startY+=-(stHeight/2)+stHeight*.4*sinTh*(AttrList.valueInside?-1:1)}else{if(AttrList.valueInside){startY+=-(sinTh<0?0:stHeight)}else{startY+=-(sinTh>0?0:stHeight)}}var _this$adjustTextPosit=this.adjustTextPositionToAvoidOverlap(AttrList,startY,Math.round((max+min)/2),startX,markerLabelOffset),adjustedStartY=_this$adjustTextPosit.adjustedStartY,adjustedStartX=_this$adjustTextPosit.adjustedStartX;axisTextAttrObj.y=adjustedStartY;axisTextAttrObj.x=adjustedStartX}else{axisTextAttrObj={text:BLANKSTRING}}trendElemenCheck=axis.getGraphicalElement(idStart+TRENDLINE_ID);trendLabelElementCheck=axis.getGraphicalElement(idStart+TRENDLABEL_ID);trendMarkerCheck=axis.getGraphicalElement(idStart+TRENDMARKER_ID);trendElement=isTrendZone?animationManager.setAnimation({el:trendElemenCheck||"ringpath",attr:axisDrawingAttrObj,container:axisTrendContainerBottom,component:axis,label:"ringpath"}):animationManager.setAnimation({el:trendElemenCheck||"path",attr:axisDrawingAttrObj,container:axisTrendContainerTop,component:axis,label:"path"});trendElement.show();trendElement.data("label",isTrendZone?"ringPath":"path");trendLabelElement=animationManager.setAnimation({el:trendLabelElementCheck||"text",attr:axisTextAttrObj,container:axisTrendLabelContainer,component:axis,label:"text"});trendLabelElement.css(css);trendLabelElement.show();trendMarkerElement=animationManager.setAnimation({el:trendMarkerCheck||"polypath",attr:axisMarkerAttrObj,container:axisTrendContainerTop,component:axis,label:"polypath"});trendMarkerElement.show();if(axisConfig.showTooltip){if(trendText.oriText&&!overLappingPoints[startValue+"_"+endValue]){toolTipController.enableToolTip(trendLabelElement,trendText.oriText+": "+startValue+" "+(endValue===startValue?"":"- "+endValue))}else{toolTipController.disableToolTip(trendLabelElement)}if(AttrList.markerToolText){toolTipController.enableToolTip(trendMarkerElement,AttrList.markerToolText)}else{toolTipController.disableToolTip(trendMarkerElement)}if(Array.isArray(overlappingArray)&&overlappingArray.length>1&&overlappingArray.includes(trendPointObj.displayvalue)){var combinedToolTipText=this.getCombinedTooltip(overlappingArray,startValue,endValue);toolTipController.enableToolTip(trendLabelElement,combinedToolTipText)}}if(!trendElemenCheck){axis.addGraphicalElement(idStart+TRENDLINE_ID,trendElement)}if(!trendElemenCheck){axis.addGraphicalElement(idStart+TRENDLABEL_ID,trendLabelElement)}if(!trendMarkerCheck){axis.addGraphicalElement(idStart+TRENDMARKER_ID,trendMarkerElement)}}}};_proto.adjustTextPositionToAvoidOverlap=function adjustTextPositionToAvoidOverlap(currentAttrList,currentStartY,mid,currentStartX,markerLabelOffset){var minimumSpaceBetween=11,startValue=currentAttrList.startValue,endValue=currentAttrList.endValue,isLessThanMid=startValue<mid||endValue<mid?-1:1,labelOffset=Number(markerLabelOffset),xOffSet=(0,_lib.pluckNumber)(labelOffset,0),adjustedStartX=currentStartX+xOffSet*isLessThanMid,shouldSpaceBetween=14;this.overLapped=false;this.startY=currentStartY;for(var j=0;j<trendTextPositions.length;j+=1){var adjacentStartY=trendTextPositions[j],isOverlapping=Math.abs(this.startY-adjacentStartY)<minimumSpaceBetween;if(isOverlapping){this.startY+=shouldSpaceBetween*isLessThanMid;this.overLapped=true}}trendTextPositions.push(this.startY);return{isOverlapping:this.overLapped,adjustedStartY:this.startY,adjustedStartX:adjustedStartX}};_proto.getCombinedTooltip=function getCombinedTooltip(displayValues,startValue,endValue){var _displayValues$length;this.tipString="";var i=(_displayValues$length=displayValues.length)!=null?_displayValues$length:0;while(i-- >0){var stringToAdd=displayValues[i]+": "+startValue+" "+(endValue===startValue?"":"- "+endValue)+" ::";this.tipString=stringToAdd+this.tipString}return this.tipString.split("::").filter((function(t){return t!==""})).join(",<br/>")};_proto.addToOverlappingPoints=function addToOverlappingPoints(value,key){this.overlappingArray=overLappingPoints[key];if(this.overlappingArray&&!this.overlappingArray.includes(value)){this.overlappingArray.push(value)}};return PolarGaugeAxis}(_gaugePolarNumeric.default);var _default=PolarGaugeAxis;exports.default=_default; |
@@ -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",SVG_NAMESPACE="http://www.w3.org/2000/svg",WATERMARK_DEFAULT_COLOR="#b1b2b7",TRANSITION_TIME="0.5s",CURSOR="pointer",WATERMARK_HOVER_COLOR="#373c8b",WATERMARK_SVG={FC_TXT_PATH:"M23,11.46V1.87h5.8V3.31h-4.1V6h3.48V7.46H24.71v4Zm7-2.68V4.26h1.69v4.3c0,1.19.34,1.63,1.12,1.63.63,0,1-.3,1.59-1V4.26h1.69v7.2H34.67l-.13-1.05h0a3,3,0,0,1-2.32,1.23C30.64,11.64,30,10.6,30,8.78Zm7.51,1.86.8-1.08a3.23,3.23,0,0,0,2,.8c.78,0,1.14-.36,1.14-.86s-.77-.87-1.54-1.16c-1-.35-2-.9-2-2.1s1-2.15,2.63-2.15A3.94,3.94,0,0,1,42.86,5l-.78,1a2.66,2.66,0,0,0-1.58-.62c-.72,0-1.06.34-1.06.79s.72.8,1.5,1.07c1,.37,2.06.84,2.06,2.19s-1,2.23-2.8,2.23A4.6,4.6,0,0,1,37.47,10.64ZM45.36,3a1,1,0,1,1,1-1A1,1,0,0,1,45.36,3Zm-.85,8.46V4.26H46.2v7.2Zm3.38-3.59a3.44,3.44,0,1,1,6.85,0,3.44,3.44,0,1,1-6.85,0Zm1.73,0c0,1.44.63,2.39,1.69,2.39S53,9.31,53,7.87s-.65-2.41-1.7-2.41S49.62,6.42,49.62,7.87Zm6.79,3.59V4.26H57.8l.12,1H58a3.34,3.34,0,0,1,2.36-1.14c1.54,0,2.21,1,2.21,2.86v4.51H60.87V7.17c0-1.19-.34-1.63-1.13-1.63a2.29,2.29,0,0,0-1.64.89v5ZM64.24,6.7c0-3.14,2-5,4.43-5A3.79,3.79,0,0,1,71.4,2.91L70.46,4a2.42,2.42,0,0,0-1.77-.79C67.12,3.18,66,4.5,66,6.65s1,3.51,2.64,3.51a2.57,2.57,0,0,0,2-1l.94,1.05a3.84,3.84,0,0,1-3,1.39C66.16,11.64,64.24,9.88,64.24,6.7ZM73,11.46V1.11h1.68V3.78l0,1.39A3.3,3.3,0,0,1,77,4.09c1.54,0,2.21,1,2.21,2.86v4.51H77.49V7.17c0-1.19-.34-1.63-1.13-1.63a2.33,2.33,0,0,0-1.65.89v5ZM80.9,9.53c0-1.54,1.29-2.35,4.24-2.67,0-.77-.33-1.41-1.3-1.41a4,4,0,0,0-2,.7L81.2,5a5.64,5.64,0,0,1,3-.93c1.8,0,2.68,1.1,2.68,3.1v4.27H85.45l-.13-.79h0a3.49,3.49,0,0,1-2.22,1A2,2,0,0,1,80.9,9.53Zm1.65-.14c0,.65.42.93,1,.93a2.25,2.25,0,0,0,1.57-.79V7.91C83.19,8.16,82.55,8.68,82.55,9.39Zm6.33,2.07V4.26h1.4l.11,1.28h.06a2.45,2.45,0,0,1,2-1.45,1.86,1.86,0,0,1,.82.14L93,5.7a2.46,2.46,0,0,0-.75-.12c-.57,0-1.26.4-1.7,1.48v4.4ZM94.6,9V5.6h-1V4.33l1.11-.07.21-2h1.4v2h1.84V5.6H96.3V9c0,.85.33,1.26,1,1.26a2,2,0,0,0,.74-.16l.3,1.24a4.43,4.43,0,0,1-1.47.27C95.22,11.64,94.6,10.58,94.6,9Zm4.33,1.61.79-1.08a3.26,3.26,0,0,0,2,.8c.77,0,1.14-.36,1.14-.86s-.78-.87-1.54-1.16c-.95-.35-2-.9-2-2.1s1-2.15,2.62-2.15a3.89,3.89,0,0,1,2.39.86l-.77,1A2.69,2.69,0,0,0,102,5.36c-.72,0-1,.34-1,.79s.71.8,1.49,1.07c1,.37,2.07.84,2.07,2.19s-1,2.23-2.8,2.23A4.58,4.58,0,0,1,98.93,10.64Z",TRIAL_TXT_PATH:["M111.54,4.59h-2.39V3.32h6.28V4.59H113v7h-1.5Z","M116.11,5.38h1.24l.11,1.11h0a2.15,2.15,0,0,1,1.77-1.27,1.7,1.7,0,0,1,.71.13l-.3,1.28a2.1,2.1,0,0,0-.6-.07c-.49,0-1.09.33-1.46,1.28v3.78h-1.51Z","M120.75,3.46a.9.9,0,0,1,1.8,0,.9.9,0,0,1-1.8,0Zm.13,1.92h1.51v6.24h-1.51Z","M123.89,9.94c0-1.37,1.09-2,3.65-2.33,0-.64-.27-1.17-1.11-1.17a3.6,3.6,0,0,0-1.75.58l-.53-1a4.78,4.78,0,0,1,2.56-.82c1.55,0,2.33,1,2.33,2.71v3.69h-1.22l-.12-.69h0a2.93,2.93,0,0,1-1.91.84A1.75,1.75,0,0,1,123.89,9.94Zm3.65,0V8.62c-1.69.21-2.2.59-2.2,1.22s.35.74.86.74A1.85,1.85,0,0,0,127.54,9.94Z","M130.77,10V2.66h1.51v7.4c0,.36.16.49.31.49a1,1,0,0,0,.23,0l.18,1.1a1.77,1.77,0,0,1-.79.14C131.16,11.77,130.77,11.08,130.77,10Z"],LOGO_PATH:["M9.76,0L12.93,0L12.93,11.39,L9.76,11.39L9.76,0","M9.76,12.86L12.93,12.86L12.93,16.19L9.76,16.19L9.76,12.86"],LOGO_RECT1:{x:0,y:1.63,width:3.33,height:9.76},LOGO_RECT2:{x:4.8,y:6.43,width:3.41,height:4.96}},opts={attributes:false,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];var lastDataSet=datasets[_lastDatasetIndex];if(lastDataSet&&lastDataSet.components&&lastDataSet.components.data&&lastDataSet.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,logoElement,parentGroup=iapi.getContainer("parentgroup"),txts={href:_lib.TXT_HREF};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);iapi.addGraphicalElement(accessor1,labelElem);logoElement=this._creatingTheLogo(chartHeight-27.32);labelGroup.node.appendChild(logoElement);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);labelGroup.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.hoverCallback=function hoverCallback(event){if(event.type==="mouseover"){this.style.fill=WATERMARK_HOVER_COLOR}else if(event.type==="mouseout"){this.style.fill=WATERMARK_DEFAULT_COLOR}};_proto._creatingTheLogo=function _creatingTheLogo(yPos){var fusionLogoContainer,path1,rect1,rect2,polygon1,polygon2,path2,path3,path4,path5,path6;fusionLogoContainer=document.createElementNS(SVG_NAMESPACE,"g");fusionLogoContainer.setAttributeNS(null,"transform","translate(18,"+yPos+")");fusionLogoContainer.setAttributeNS(null,"fill",WATERMARK_DEFAULT_COLOR);fusionLogoContainer.setAttributeNS(null,"cursor",CURSOR);fusionLogoContainer.setAttributeNS(null,"pointer-events","bounding-box");fusionLogoContainer.setAttributeNS(null,"style","transition:"+TRANSITION_TIME+";");path1=document.createElementNS(SVG_NAMESPACE,"path");path1.setAttribute("d",WATERMARK_SVG.FC_TXT_PATH);path1.setAttributeNS(null,"fill","");path1.setAttributeNS(null,"stroke","");path1.setAttributeNS(null,"stroke-linecap","");rect1=document.createElementNS(SVG_NAMESPACE,"rect");rect1.setAttributeNS(null,"x",WATERMARK_SVG.LOGO_RECT1.x);rect1.setAttributeNS(null,"y",WATERMARK_SVG.LOGO_RECT1.y);rect1.setAttributeNS(null,"width",WATERMARK_SVG.LOGO_RECT1.width);rect1.setAttributeNS(null,"height",WATERMARK_SVG.LOGO_RECT1.height);rect1.setAttributeNS(null,"fill","");rect1.setAttributeNS(null,"stroke","");rect1.setAttributeNS(null,"stroke-linecap","");rect2=document.createElementNS(SVG_NAMESPACE,"rect");rect2.setAttributeNS(null,"x",WATERMARK_SVG.LOGO_RECT2.x);rect2.setAttributeNS(null,"y",WATERMARK_SVG.LOGO_RECT2.y);rect2.setAttributeNS(null,"width",WATERMARK_SVG.LOGO_RECT2.width);rect2.setAttributeNS(null,"height",WATERMARK_SVG.LOGO_RECT2.height);rect2.setAttributeNS(null,"fill","");rect2.setAttributeNS(null,"stroke","");rect2.setAttributeNS(null,"stroke-linecap","");polygon1=document.createElementNS(SVG_NAMESPACE,"path");polygon1.setAttributeNS(null,"d",WATERMARK_SVG.LOGO_PATH[0]);polygon1.setAttributeNS(null,"fill","");polygon1.setAttributeNS(null,"stroke","");polygon1.setAttributeNS(null,"stroke-linecap","");polygon2=document.createElementNS(SVG_NAMESPACE,"path");polygon2.setAttributeNS(null,"d",WATERMARK_SVG.LOGO_PATH[1]);polygon2.setAttributeNS(null,"fill","");polygon2.setAttributeNS(null,"stroke","");polygon2.setAttributeNS(null,"stroke-linecap","");path2=document.createElementNS(SVG_NAMESPACE,"path");path2.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[0]);path2.setAttributeNS(null,"fill","");path2.setAttributeNS(null,"stroke","");path2.setAttributeNS(null,"stroke-linecap","");path3=document.createElementNS(SVG_NAMESPACE,"path");path3.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[1]);path3.setAttributeNS(null,"fill","");path3.setAttributeNS(null,"stroke","");path3.setAttributeNS(null,"stroke-linecap","");path4=document.createElementNS(SVG_NAMESPACE,"path");path4.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[2]);path4.setAttributeNS(null,"fill","");path4.setAttributeNS(null,"stroke","");path4.setAttributeNS(null,"stroke-linecap","");path5=document.createElementNS(SVG_NAMESPACE,"path");path5.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[3]);path5.setAttributeNS(null,"fill","");path5.setAttributeNS(null,"stroke","");path5.setAttributeNS(null,"stroke-linecap","");path6=document.createElementNS(SVG_NAMESPACE,"path");path6.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[4]);path6.setAttributeNS(null,"fill","");path6.setAttributeNS(null,"stroke","");path6.setAttributeNS(null,"stroke-linecap","");fusionLogoContainer.appendChild(path1);fusionLogoContainer.appendChild(rect1);fusionLogoContainer.appendChild(rect2);fusionLogoContainer.appendChild(polygon1);fusionLogoContainer.appendChild(polygon2);fusionLogoContainer.appendChild(path2);fusionLogoContainer.appendChild(path3);fusionLogoContainer.appendChild(path4);fusionLogoContainer.appendChild(path5);fusionLogoContainer.appendChild(path6);fusionLogoContainer.addEventListener("mouseover",this.hoverCallback);fusionLogoContainer.addEventListener("mouseout",this.hoverCallback);return fusionLogoContainer};_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 _unlicensedText=require("./unlicensedText");var MOUSEOUT="fc-mouseout",SVG_NAMESPACE="http://www.w3.org/2000/svg",WATERMARK_DEFAULT_COLOR="#b1b2b7",LICENSE_EXPIRED_TEXT="#666",LICENSE_EXPIRED_LIGHT_TEXT="#ffffff",WATERMARK_EXPIRED_DEFAULT_COLOR="#fd002dcc",TRANSITION_TIME="0.5s",CURSOR="pointer",WATERMARK_HOVER_COLOR="#373c8b",BUY_LICENSE_COLOR="#6957da",BUY_LICENSE_LIGHT_COLOR="#74a8d2",WATERMARK_SVG={FC_TXT_PATH:"M23,11.46V1.87h5.8V3.31h-4.1V6h3.48V7.46H24.71v4Zm7-2.68V4.26h1.69v4.3c0,1.19.34,1.63,1.12,1.63.63,0,1-.3,1.59-1V4.26h1.69v7.2H34.67l-.13-1.05h0a3,3,0,0,1-2.32,1.23C30.64,11.64,30,10.6,30,8.78Zm7.51,1.86.8-1.08a3.23,3.23,0,0,0,2,.8c.78,0,1.14-.36,1.14-.86s-.77-.87-1.54-1.16c-1-.35-2-.9-2-2.1s1-2.15,2.63-2.15A3.94,3.94,0,0,1,42.86,5l-.78,1a2.66,2.66,0,0,0-1.58-.62c-.72,0-1.06.34-1.06.79s.72.8,1.5,1.07c1,.37,2.06.84,2.06,2.19s-1,2.23-2.8,2.23A4.6,4.6,0,0,1,37.47,10.64ZM45.36,3a1,1,0,1,1,1-1A1,1,0,0,1,45.36,3Zm-.85,8.46V4.26H46.2v7.2Zm3.38-3.59a3.44,3.44,0,1,1,6.85,0,3.44,3.44,0,1,1-6.85,0Zm1.73,0c0,1.44.63,2.39,1.69,2.39S53,9.31,53,7.87s-.65-2.41-1.7-2.41S49.62,6.42,49.62,7.87Zm6.79,3.59V4.26H57.8l.12,1H58a3.34,3.34,0,0,1,2.36-1.14c1.54,0,2.21,1,2.21,2.86v4.51H60.87V7.17c0-1.19-.34-1.63-1.13-1.63a2.29,2.29,0,0,0-1.64.89v5ZM64.24,6.7c0-3.14,2-5,4.43-5A3.79,3.79,0,0,1,71.4,2.91L70.46,4a2.42,2.42,0,0,0-1.77-.79C67.12,3.18,66,4.5,66,6.65s1,3.51,2.64,3.51a2.57,2.57,0,0,0,2-1l.94,1.05a3.84,3.84,0,0,1-3,1.39C66.16,11.64,64.24,9.88,64.24,6.7ZM73,11.46V1.11h1.68V3.78l0,1.39A3.3,3.3,0,0,1,77,4.09c1.54,0,2.21,1,2.21,2.86v4.51H77.49V7.17c0-1.19-.34-1.63-1.13-1.63a2.33,2.33,0,0,0-1.65.89v5ZM80.9,9.53c0-1.54,1.29-2.35,4.24-2.67,0-.77-.33-1.41-1.3-1.41a4,4,0,0,0-2,.7L81.2,5a5.64,5.64,0,0,1,3-.93c1.8,0,2.68,1.1,2.68,3.1v4.27H85.45l-.13-.79h0a3.49,3.49,0,0,1-2.22,1A2,2,0,0,1,80.9,9.53Zm1.65-.14c0,.65.42.93,1,.93a2.25,2.25,0,0,0,1.57-.79V7.91C83.19,8.16,82.55,8.68,82.55,9.39Zm6.33,2.07V4.26h1.4l.11,1.28h.06a2.45,2.45,0,0,1,2-1.45,1.86,1.86,0,0,1,.82.14L93,5.7a2.46,2.46,0,0,0-.75-.12c-.57,0-1.26.4-1.7,1.48v4.4ZM94.6,9V5.6h-1V4.33l1.11-.07.21-2h1.4v2h1.84V5.6H96.3V9c0,.85.33,1.26,1,1.26a2,2,0,0,0,.74-.16l.3,1.24a4.43,4.43,0,0,1-1.47.27C95.22,11.64,94.6,10.58,94.6,9Zm4.33,1.61.79-1.08a3.26,3.26,0,0,0,2,.8c.77,0,1.14-.36,1.14-.86s-.78-.87-1.54-1.16c-.95-.35-2-.9-2-2.1s1-2.15,2.62-2.15a3.89,3.89,0,0,1,2.39.86l-.77,1A2.69,2.69,0,0,0,102,5.36c-.72,0-1,.34-1,.79s.71.8,1.49,1.07c1,.37,2.07.84,2.07,2.19s-1,2.23-2.8,2.23A4.58,4.58,0,0,1,98.93,10.64Z",TRIAL_TXT_PATH:["M111.54,4.59h-2.39V3.32h6.28V4.59H113v7h-1.5Z","M116.11,5.38h1.24l.11,1.11h0a2.15,2.15,0,0,1,1.77-1.27,1.7,1.7,0,0,1,.71.13l-.3,1.28a2.1,2.1,0,0,0-.6-.07c-.49,0-1.09.33-1.46,1.28v3.78h-1.51Z","M120.75,3.46a.9.9,0,0,1,1.8,0,.9.9,0,0,1-1.8,0Zm.13,1.92h1.51v6.24h-1.51Z","M123.89,9.94c0-1.37,1.09-2,3.65-2.33,0-.64-.27-1.17-1.11-1.17a3.6,3.6,0,0,0-1.75.58l-.53-1a4.78,4.78,0,0,1,2.56-.82c1.55,0,2.33,1,2.33,2.71v3.69h-1.22l-.12-.69h0a2.93,2.93,0,0,1-1.91.84A1.75,1.75,0,0,1,123.89,9.94Zm3.65,0V8.62c-1.69.21-2.2.59-2.2,1.22s.35.74.86.74A1.85,1.85,0,0,0,127.54,9.94Z","M130.77,10V2.66h1.51v7.4c0,.36.16.49.31.49a1,1,0,0,0,.23,0l.18,1.1a1.77,1.77,0,0,1-.79.14C131.16,11.77,130.77,11.08,130.77,10Z"],LOGO_PATH:["M9.76,0L12.93,0L12.93,11.39,L9.76,11.39L9.76,0","M9.76,12.86L12.93,12.86L12.93,16.19L9.76,16.19L9.76,12.86"],EXP_LOGO_PATH:["M140,42.7h36.1v129.8H140V42.7","M140,189.2h36.1v38H140V189.2"],UNLICENSED_TXT_PATH:["M130.77,10V2.66h1.51v7.4c0,.36.16.49.31.49a1,1,0,0,0,.23,0l.18,1.1a1.77,1.77,0,0,1-.79.14C131.16,11.77,130.77,11.08,130.77,10Z","M116.11,5.38h1.24l.11,1.11h0a2.15,2.15,0,0,1,1.77-1.27,1.7,1.7,0,0,1,.71.13l-.3,1.28a2.1,2.1,0,0,0-.6-.07c-.49,0-1.09.33-1.46,1.28v3.78h-1.51Z","M120.75,3.46a.9.9,0,0,1,1.8,0,.9.9,0,0,1-1.8,0Zm.13,1.92h1.51v6.24h-1.51Z","M123.89,9.94c0-1.37,1.09-2,3.65-2.33,0-.64-.27-1.17-1.11-1.17a3.6,3.6,0,0,0-1.75.58l-.53-1a4.78,4.78,0,0,1,2.56-.82c1.55,0,2.33,1,2.33,2.71v3.69h-1.22l-.12-.69h0a2.93,2.93,0,0,1-1.91.84A1.75,1.75,0,0,1,123.89,9.94Zm3.65,0V8.62c-1.69.21-2.2.59-2.2,1.22s.35.74.86.74A1.85,1.85,0,0,0,127.54,9.94Z","M130.77,10V2.66h1.51v7.4c0,.36.16.49.31.49a1,1,0,0,0,.23,0l.18,1.1a1.77,1.77,0,0,1-.79.14C131.16,11.77,130.77,11.08,130.77,10Z"],LOGO_RECT1:{x:0,y:1.63,width:3.33,height:9.76},LOGO_RECT2:{x:4.8,y:6.43,width:3.41,height:4.96},EXP_LOGO_RECT1:{x:28.8,y:61.2,width:38,height:111.2},EXP_LOGO_RECT2:{x:83.5,y:111.9,width:38.9,height:56.5},EXP_LOGO_RECT3:{x:3200,y:40,width:20,height:180}},opts={attributes:false,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(){var _this;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}_this=_ComponentInterface.call.apply(_ComponentInterface,[this].concat(args))||this;_this._creatingTheBlurredContainer=function(divWidth,divHeight,chartTheme){var chartBlurContainer,blurredRect,path2;chartBlurContainer=document.createElementNS(SVG_NAMESPACE,"g");path2=document.createElementNS(SVG_NAMESPACE,"g");chartBlurContainer.setAttributeNS(null,"fill",WATERMARK_DEFAULT_COLOR);chartBlurContainer.setAttributeNS(null,"cursor",CURSOR);chartBlurContainer.setAttributeNS(null,"pointer-events","bounding-box");chartBlurContainer.setAttributeNS(null,"style","transition:"+TRANSITION_TIME+";");blurredRect=document.createElementNS(SVG_NAMESPACE,"rect");blurredRect.setAttributeNS(null,"width",divWidth);blurredRect.setAttributeNS(null,"height",divHeight);blurredRect.setAttributeNS(null,"fill","#ffffff33");for(var index=0;index<Math.trunc(divWidth/250);index++){var chartBlurTextContainer2=void 0,dimension2=index,leftMargin=dimension2*250,renderingAreaWidth=(divWidth-Math.trunc(divWidth/250)*250)/Math.trunc(divWidth/250),path1=document.createElementNS(SVG_NAMESPACE,"g");for(var index2=0;index2*120<divHeight-120;index2++){var chartBlurTextContainer=void 0,dimension=index2*120;chartBlurTextContainer=_this._createBlurText(dimension,chartTheme);path1.appendChild(chartBlurTextContainer)}chartBlurTextContainer2=path1;chartBlurTextContainer2.setAttributeNS(null,"transform","translate("+(leftMargin+renderingAreaWidth)+", 0)");path2.appendChild(chartBlurTextContainer2)}chartBlurContainer.appendChild(blurredRect);chartBlurContainer.appendChild(path2);return chartBlurContainer};_this._createBlurText=function(dimension,chartTheme){var chartBlurTextContainer,path1,path2,path3,path4,isCandy=false;if(chartTheme&&chartTheme==="candy")isCandy=true;chartBlurTextContainer=document.createElementNS(SVG_NAMESPACE,"g");chartBlurTextContainer.setAttributeNS(null,"transform","scale(0.1), translate(0, "+(dimension*10+500)+")");chartBlurTextContainer.setAttributeNS(null,"fill",isCandy?LICENSE_EXPIRED_LIGHT_TEXT:LICENSE_EXPIRED_TEXT);chartBlurTextContainer.setAttributeNS(null,"cursor",CURSOR);chartBlurTextContainer.setAttributeNS(null,"pointer-events","bounding-box");chartBlurTextContainer.setAttributeNS(null,"style","transition:"+TRANSITION_TIME+";");path1=document.createElementNS(SVG_NAMESPACE,"path");path1.setAttribute("d",_unlicensedText.text.fusionchartsLicenseHasExpiredText[0]);path1.setAttributeNS(null,"fill","");path1.setAttributeNS(null,"stroke","");path1.setAttributeNS(null,"stroke-linecap","");path2=document.createElementNS(SVG_NAMESPACE,"path");path2.setAttribute("d",_unlicensedText.text.fusionchartsLicenseHasExpiredText[1]);path2.setAttributeNS(null,"fill","");path2.setAttributeNS(null,"stroke","");path2.setAttributeNS(null,"stroke-linecap","");path3=document.createElementNS(SVG_NAMESPACE,"path");path3.setAttribute("d",_unlicensedText.text.fusionchartsLicenseHasExpiredText[2]);path3.setAttributeNS(null,"fill","");path3.setAttributeNS(null,"stroke","");path3.setAttributeNS(null,"stroke-linecap","");path4=document.createElementNS(SVG_NAMESPACE,"path");path4.setAttribute("d",_unlicensedText.text.fusionchartsLicenseHasExpiredText[3]);path4.setAttributeNS(null,"fill","");path4.setAttributeNS(null,"stroke","");path4.setAttributeNS(null,"stroke-linecap","");chartBlurTextContainer.appendChild(path1);chartBlurTextContainer.appendChild(path2);chartBlurTextContainer.appendChild(path3);chartBlurTextContainer.appendChild(path4);return chartBlurTextContainer};return _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];var lastDataSet=datasets[_lastDatasetIndex];if(lastDataSet&&lastDataSet.components&&lastDataSet.components.data&&lastDataSet.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,usingExpiredKey){if(usingExpiredKey===void 0){usingExpiredKey=false}this._crCreate(hasLabel,usingExpiredKey);if(hasLabel){this._scheduleLabelCheck(hasLabel,usingExpiredKey)}};_proto._scheduleLabelCheck=function _scheduleLabelCheck(hasLabel,usingExpiredKey){var component=this;component.addJob("checker",(function(){var labelContRNode=component.getContainer(accessor2);if(labelContRNode&&isDetached(labelContRNode)){component._crCreate(hasLabel,usingExpiredKey)}component._scheduleLabelCheck(hasLabel,usingExpiredKey)}),_schedular.priorityList.verification,{oneInAFrame:true,addToTop:false,executionDelay:300})};_proto._crCreate=function _crCreate(hasLabel,usingExpiredKey){var _iapi$getFromEnv;var iapi=this,paper=iapi.getFromEnv("paper"),chartHeight=+iapi.getFromEnv("chartHeight"),chartWidth=+iapi.getFromEnv("chartWidth"),chartName=iapi.constructor.name,chartTheme=(_iapi$getFromEnv=iapi.getFromEnv("chart-attrib"))==null?void 0:_iapi$getFromEnv.theme,labelElemCheck=iapi.getGraphicalElement(accessor1),labelElem,labelGroup,logoElement,blurElement,parentGroup=iapi.getContainer("parentgroup"),txts={href:_lib.TXT_HREF};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);iapi.addGraphicalElement(accessor1,labelElem);logoElement=this._creatingTheLogo(chartHeight-27.32,usingExpiredKey,chartName,chartHeight,chartTheme);if(usingExpiredKey){var svgFilter,feGaussianBlur,currentNode,currentChildNode;blurElement=this._creatingTheBlurredContainer(chartWidth,chartHeight,chartTheme);labelGroup.node.appendChild(blurElement);svgFilter=document.createElementNS(SVG_NAMESPACE,"filter");svgFilter.setAttribute("id","blurFilter");feGaussianBlur=document.createElementNS(SVG_NAMESPACE,"feGaussianBlur");feGaussianBlur.setAttribute("in","SourceGraphic");feGaussianBlur.setAttribute("stdDeviation","2");svgFilter.appendChild(feGaussianBlur);parentGroup.node.appendChild(svgFilter);parentGroup.node.setAttributeNS(null,"filter","url(#blurFilter)");currentNode=labelGroup;while((_currentNode=currentNode)!=null&&_currentNode.next){var _currentNode,_currentNode2,_currentNode3;currentNode=(_currentNode2=currentNode)==null?void 0:_currentNode2.next;currentChildNode=(_currentNode3=currentNode)==null?void 0:_currentNode3.node;currentChildNode.setAttributeNS(null,"filter","url(#blurFilter)")}}labelGroup.node.appendChild(logoElement);if(!iapi.config.observer){iapi.config.observer=new MutationObserver((function(){return iapi._crCreate(hasLabel,usingExpiredKey)}))}else{iapi.config.observer.disconnect()}iapi.config.observer.observe(iapi.getContainer(accessor2).node,opts);if(!usingExpiredKey){labelGroup.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.hoverCallback=function hoverCallback(event){if(event.type==="mouseover"){this.style.fill=WATERMARK_HOVER_COLOR}else if(event.type==="mouseout"){this.style.fill=WATERMARK_DEFAULT_COLOR}};_proto._creatingTheLogo=function _creatingTheLogo(yPos,usingExpiredKey,chartName,chartHeight,chartTheme){var fusionLogoContainer,path1,rect1,rect2,polygon1,polygon2,path2,path3,path4,path5,path6,path7,path8,chartNameContainer,buyLicenseLink;fusionLogoContainer=document.createElementNS(SVG_NAMESPACE,"g");usingExpiredKey?fusionLogoContainer.setAttributeNS(null,"transform","scale(0.1), translate(18,"+yPos*10+")"):fusionLogoContainer.setAttributeNS(null,"transform","translate(18,"+yPos+")");fusionLogoContainer.setAttributeNS(null,"fill",usingExpiredKey?WATERMARK_EXPIRED_DEFAULT_COLOR:WATERMARK_DEFAULT_COLOR);fusionLogoContainer.setAttributeNS(null,"cursor",CURSOR);fusionLogoContainer.setAttributeNS(null,"pointer-events","bounding-box");fusionLogoContainer.setAttributeNS(null,"style","transition:"+TRANSITION_TIME+";");path1=document.createElementNS(SVG_NAMESPACE,"path");path1.setAttribute("d",WATERMARK_SVG.FC_TXT_PATH);path1.setAttributeNS(null,"fill","");path1.setAttributeNS(null,"stroke","");path1.setAttributeNS(null,"stroke-linecap","");rect1=document.createElementNS(SVG_NAMESPACE,"rect");rect1.setAttributeNS(null,"x",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT1.x:WATERMARK_SVG.LOGO_RECT1.x);rect1.setAttributeNS(null,"y",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT1.y:WATERMARK_SVG.LOGO_RECT1.y);rect1.setAttributeNS(null,"width",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT1.width:WATERMARK_SVG.LOGO_RECT1.width);rect1.setAttributeNS(null,"height",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT1.height:WATERMARK_SVG.LOGO_RECT1.height);rect1.setAttributeNS(null,"fill","");rect1.setAttributeNS(null,"stroke","");rect1.setAttributeNS(null,"stroke-linecap","");rect2=document.createElementNS(SVG_NAMESPACE,"rect");rect2.setAttributeNS(null,"x",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT2.x:WATERMARK_SVG.LOGO_RECT2.x);rect2.setAttributeNS(null,"y",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT2.y:WATERMARK_SVG.LOGO_RECT2.y);rect2.setAttributeNS(null,"width",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT2.width:WATERMARK_SVG.LOGO_RECT2.width);rect2.setAttributeNS(null,"height",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_RECT2.height:WATERMARK_SVG.LOGO_RECT2.height);rect2.setAttributeNS(null,"fill","");rect2.setAttributeNS(null,"stroke","");rect2.setAttributeNS(null,"stroke-linecap","");polygon1=document.createElementNS(SVG_NAMESPACE,"path");polygon1.setAttributeNS(null,"d",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_PATH[0]:WATERMARK_SVG.LOGO_PATH[0]);polygon1.setAttributeNS(null,"fill","");polygon1.setAttributeNS(null,"stroke","");polygon1.setAttributeNS(null,"stroke-linecap","");polygon2=document.createElementNS(SVG_NAMESPACE,"path");polygon2.setAttributeNS(null,"d",usingExpiredKey?WATERMARK_SVG.EXP_LOGO_PATH[1]:WATERMARK_SVG.LOGO_PATH[1]);polygon2.setAttributeNS(null,"fill","");polygon2.setAttributeNS(null,"stroke","");polygon2.setAttributeNS(null,"stroke-linecap","");path2=document.createElementNS(SVG_NAMESPACE,"path");path2.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[0]);path2.setAttributeNS(null,"fill","");path2.setAttributeNS(null,"stroke","");path2.setAttributeNS(null,"stroke-linecap","");path3=document.createElementNS(SVG_NAMESPACE,"path");path3.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[1]);path3.setAttributeNS(null,"fill","");path3.setAttributeNS(null,"stroke","");path3.setAttributeNS(null,"stroke-linecap","");path4=document.createElementNS(SVG_NAMESPACE,"path");path4.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[2]);path4.setAttributeNS(null,"fill","");path4.setAttributeNS(null,"stroke","");path4.setAttributeNS(null,"stroke-linecap","");path5=document.createElementNS(SVG_NAMESPACE,"path");path5.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[3]);path5.setAttributeNS(null,"fill","");path5.setAttributeNS(null,"stroke","");path5.setAttributeNS(null,"stroke-linecap","");path6=document.createElementNS(SVG_NAMESPACE,"path");path6.setAttributeNS(null,"d",WATERMARK_SVG.TRIAL_TXT_PATH[4]);path6.setAttributeNS(null,"fill","");path6.setAttributeNS(null,"stroke","");path6.setAttributeNS(null,"stroke-linecap","");path7=document.createElementNS(SVG_NAMESPACE,"path");path7.setAttributeNS(null,"d",_unlicensedText.text.fusionchartsUnlicensedText[0]);path7.setAttributeNS(null,"transform","scale(0.9), translate(0, 35)");path7.setAttributeNS(null,"fill","");path7.setAttributeNS(null,"stroke","");path7.setAttributeNS(null,"stroke-linecap","");path8=document.createElementNS(SVG_NAMESPACE,"path");path8.setAttributeNS(null,"d",_unlicensedText.text.fusionchartsUnlicensedText[1]);path8.setAttributeNS(null,"transform","scale(0.9), translate(2050, 85)");path8.setAttributeNS(null,"fill",chartTheme==="candy"?BUY_LICENSE_LIGHT_COLOR:BUY_LICENSE_COLOR);path8.setAttributeNS(null,"stroke","");path8.setAttributeNS(null,"stroke-linecap","");buyLicenseLink=document.createElementNS(SVG_NAMESPACE,"a");buyLicenseLink.setAttributeNS(null,"href",_lib.BUY_LICENSE_HREF);buyLicenseLink.setAttribute("target","_blank");buyLicenseLink.appendChild(path8);chartNameContainer=document.createElementNS(SVG_NAMESPACE,"text");chartNameContainer.setAttributeNS(null,"transform","scale(10), translate(0, -"+(chartHeight-40)+")");chartNameContainer.setAttribute("x",0);chartNameContainer.setAttribute("y",0);chartNameContainer.setAttribute("width",1e3);chartNameContainer.setAttribute("height",1e3);chartNameContainer.setAttribute("fill",WATERMARK_DEFAULT_COLOR);fusionLogoContainer.appendChild(rect1);fusionLogoContainer.appendChild(rect2);fusionLogoContainer.appendChild(polygon1);fusionLogoContainer.appendChild(polygon2);if(usingExpiredKey){fusionLogoContainer.appendChild(path7);fusionLogoContainer.appendChild(buyLicenseLink);fusionLogoContainer.appendChild(chartNameContainer)}else{fusionLogoContainer.appendChild(path1);fusionLogoContainer.appendChild(path2);fusionLogoContainer.appendChild(path3);fusionLogoContainer.appendChild(path4);fusionLogoContainer.appendChild(path5);fusionLogoContainer.appendChild(path6)}if(!usingExpiredKey){fusionLogoContainer.addEventListener("mouseover",this.hoverCallback);fusionLogoContainer.addEventListener("mouseout",this.hoverCallback)}return fusionLogoContainer};_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";exports.__esModule=true;exports.default=void 0;function json2json(input){var out={data:{}};if(!input){return out}if(typeof input==="string"){try{out.data=JSON.parse(input)}catch(err){out.error=err}}else{out.data=input}return out}function getJSONData(obj){if(!obj||!obj.isRaw){return this.getChartData({format:"json",isRaw:0})}else if(obj.isRaw&&parseInt(obj.isRaw,10)){var isRaw=parseInt(obj.isRaw,10);return this.getChartData({format:"json",isRaw:isRaw})}return this.getChartData("json")}function setJSONData(data){this.setChartData(data,"json");this.render()}function wrapper(FusionCharts){FusionCharts&&(FusionCharts.prototype.setJSONData=setJSONData);FusionCharts&&(FusionCharts.prototype.getJSONData=getJSONData);return{format:"json",toJSON:json2json,fromJSON:json2json}}var _default={extension:wrapper,name:"JSON",type:"transcoder",requiresFusionCharts:true};exports.default=_default; | ||
"use strict";exports.__esModule=true;exports.default=void 0;function json2json(input){var out={data:{}};if(!input){return out}if(typeof input==="string"){try{out.data=JSON.parse(input)}catch(err){out.error=err}}else{out.data=input}return out}function getJSONData(obj){if(!obj||!obj.isRaw){return this.getChartData({format:"json",isRaw:0})}else if(obj.isRaw&&parseInt(obj.isRaw,10)){var isRaw=parseInt(obj.isRaw,10);return this.getChartData({format:"json",isRaw:isRaw})}return this.getChartData("json")}function setJSONData(data){this.setChartData(data,"json");if(this!=null&&this.options&&(this==null?void 0:this.options.chartType)==="scatter"){this.render()}}function wrapper(FusionCharts){FusionCharts&&(FusionCharts.prototype.setJSONData=setJSONData);FusionCharts&&(FusionCharts.prototype.getJSONData=getJSONData);return{format:"json",toJSON:json2json,fromJSON:json2json}}var _default={extension:wrapper,name:"JSON",type:"transcoder",requiresFusionCharts:true};exports.default=_default; |
@@ -1,1 +0,1 @@ | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _lib=require("../../../lib");var _dependencyManager=require("../../../dependency-manager");var R=(0,_dependencyManager.getDep)("redraphael","plugin"),M="M",m="m",v="v",COLOR_5F5F5F="#5F5F5F";var ScrollAnchor=function(_Tool){(0,_inheritsLoose2.default)(ScrollAnchor,_Tool);function ScrollAnchor(){var _this;_this=_Tool.call(this)||this;_this._evtHandlers={};return _this}var _proto=ScrollAnchor.prototype;_proto.configureAttributes=function configureAttributes(obj){if(obj===void 0){obj={}}var selfConfig=this.config;selfConfig.drawStripes=(0,_lib.pluckNumber)(obj.drawStripes,0);selfConfig._nodeDimensions={};selfConfig.style={scroller:Object.assign({},{fill:obj.displayFlat&&R.tintshade(obj.color,-.6).rgba||[270*obj.isHorizontal,R.tintshade(obj.color,.3).rgba+":40",R.tintshade(obj.color,-.7).rgba].join("-"),stroke:R.tintshade(obj.color,-.6).rgba},obj.style.scroller),grip:Object.assign({},{stroke:COLOR_5F5F5F,"stroke-linecap":"round","stroke-width":2},obj.style.grip)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollAnchor=this,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,_dragstart,_dragaxis,newScrollPos,isHorizontal=scrollbarConfig.isHorizontal;scrollAnchor.addEventListener("fc-dragmove",scrollAnchor._evtHandlers.dragmove||(scrollAnchor._evtHandlers.dragmove=function(event){newScrollPos=_dragstart+event.originalEvent.data[_dragaxis]/this.config.trackLength;if(newScrollPos>=1){newScrollPos=1}else if(newScrollPos<=0||isNaN(newScrollPos)){newScrollPos=0}scrollbarConfig.scrollPosition=newScrollPos;scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragstart",scrollAnchor._evtHandlers.dragstart||(scrollAnchor._evtHandlers.dragstart=function(){_dragaxis=isHorizontal?0:1;_dragstart=scrollbarConfig.scrollPosition;typeof scrollbarConfig.evt.scrollStart==="function"&&scrollbarConfig.evt.scrollStart(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragend",scrollAnchor._evtHandlers.dragend||(scrollAnchor._evtHandlers.dragend=function(){typeof scrollbarConfig.evt.scrollEnd==="function"&&scrollbarConfig.evt.scrollEnd(scrollbarConfig.scrollPosition)}))};_proto.draw=function draw(){var scrollAnchor=this,selfConfig=scrollAnchor.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,x=scrollbarConfig.x+.5,y=scrollbarConfig.y+scrollbarConfig.padding+.5,width=scrollbarConfig.width-1,height=scrollbarConfig.height-1<1?1:scrollbarConfig.height-1,ratio=scrollbarConfig.restrictScrollAnchor?Math.max(scrollbarConfig.scrollRatio,.01):scrollbarConfig.scrollRatio,isHorizontal=scrollbarConfig.isHorizontal,position=(0,_lib.pluckNumber)(scrollbarConfig.scrollPosition,scrollbarConfig.startPercent,0),trackLength,trackOffset,button=0,track=isHorizontal?width*ratio:height*ratio;if(position>=1){position=1}else if(position<=0||isNaN(position)){position=0}if(scrollbarConfig.showButtons){button=isHorizontal?Math.min(height,width*.5):Math.min(width,height*.5);track-=button*2*ratio}selfConfig.trackLength=trackLength=isHorizontal?width-2*button-track:height-2*button-track;selfConfig.trackOffset=trackOffset=isHorizontal?x+button+.5:y+button+.5;selfConfig._nodeDimensions={x:isHorizontal?trackOffset+trackLength*position:x,y:isHorizontal?y:trackOffset+trackLength*position,width:isHorizontal?track-1<1?1:track-1:width<1?1:width,height:isHorizontal?height<1?1:height:track-1<1?1:track-1};scrollAnchor.addGraphicalElement({el:"rect",attr:{x:selfConfig._nodeDimensions.x,y:selfConfig._nodeDimensions.y,width:selfConfig._nodeDimensions.width,height:selfConfig._nodeDimensions.height,r:scrollbarConfig.roundEdges&&2||0,opacity:selfConfig.style.scroller.opacity},css:selfConfig.style.scroller,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchor",id:"scrollbarAnchor"});if(selfConfig.drawStripes&&selfConfig._nodeDimensions.width>=8){scrollAnchor.addGraphicalElement({el:"path",attr:{path:[M,selfConfig._nodeDimensions.x+selfConfig._nodeDimensions.width/2-3,selfConfig._nodeDimensions.y+.2*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height],opacity:selfConfig.style.grip.opacity},css:selfConfig.style.grip,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchorStripe",id:"scrollbarAnchorStripe"})}};return ScrollAnchor}(_tool.default);var _default=ScrollAnchor;exports.default=_default; | ||
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _tool=_interopRequireDefault(require("../tool"));var _lib=require("../../../lib");var _dependencyManager=require("../../../dependency-manager");var R=(0,_dependencyManager.getDep)("redraphael","plugin"),M="M",m="m",v="v",COLOR_5F5F5F="#5F5F5F";var ScrollAnchor=function(_Tool){(0,_inheritsLoose2.default)(ScrollAnchor,_Tool);function ScrollAnchor(){var _this;_this=_Tool.call(this)||this;_this._evtHandlers={};return _this}var _proto=ScrollAnchor.prototype;_proto.configureAttributes=function configureAttributes(obj){if(obj===void 0){obj={}}var selfConfig=this.config;selfConfig.drawStripes=(0,_lib.pluckNumber)(obj.drawStripes,0);selfConfig._nodeDimensions={};selfConfig.style={scroller:Object.assign({},{fill:obj.displayFlat&&R.tintshade(obj.color,-.6).rgba||[270*obj.isHorizontal,R.tintshade(obj.color,.3).rgba+":40",R.tintshade(obj.color,-.7).rgba].join("-"),stroke:R.tintshade(obj.color,-.6).rgba},obj.style.scroller),grip:Object.assign({},{stroke:COLOR_5F5F5F,"stroke-linecap":"round","stroke-width":2},obj.style.grip)}};_proto.attachEventHandlers=function attachEventHandlers(){var scrollAnchor=this,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,_dragstart,_dragaxis,newScrollPos,isHorizontal=scrollbarConfig.isHorizontal;scrollAnchor.addEventListener("fc-dragmove",scrollAnchor._evtHandlers.dragmove||(scrollAnchor._evtHandlers.dragmove=function(event){newScrollPos=_dragstart+event.originalEvent.data[_dragaxis]/this.config.trackLength;if(newScrollPos>=1){newScrollPos=1}else if(newScrollPos<=0||isNaN(newScrollPos)){newScrollPos=0}scrollbarConfig.scrollPosition=newScrollPos;scrollAnchor.asyncDraw();typeof scrollbarConfig.evt.scroll==="function"&&scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragstart",scrollAnchor._evtHandlers.dragstart||(scrollAnchor._evtHandlers.dragstart=function(){_dragaxis=isHorizontal?0:1;_dragstart=scrollbarConfig.scrollPosition;typeof scrollbarConfig.evt.scrollStart==="function"&&scrollbarConfig.evt.scrollStart(scrollbarConfig.scrollPosition)}));scrollAnchor.addEventListener("fc-dragend",scrollAnchor._evtHandlers.dragend||(scrollAnchor._evtHandlers.dragend=function(){typeof scrollbarConfig.evt.scrollEnd==="function"&&scrollbarConfig.evt.scrollEnd(scrollbarConfig.scrollPosition)}))};_proto.draw=function draw(){var scrollAnchor=this,selfConfig=scrollAnchor.config,scrollbar=this.getLinkedParent(),scrollbarConfig=scrollbar.config,x=scrollbarConfig.x+.5,y=scrollbarConfig.y+scrollbarConfig.padding+.5,width=scrollbarConfig.width-1,height=scrollbarConfig.height-1<1?1:scrollbarConfig.height-1,ratio=scrollbarConfig.restrictScrollAnchor?Math.max(scrollbarConfig.scrollRatio,.01):scrollbarConfig.scrollRatio,isHorizontal=scrollbarConfig.isHorizontal,position=(0,_lib.pluckNumber)(scrollbarConfig.scrollPosition,scrollbarConfig.startPercent,0),trackLength,trackOffset,button=0,track=isHorizontal?width*ratio:height*ratio;if(position>=1){position=1}else if(position<=0||isNaN(position)){position=0}if(scrollbarConfig.showButtons){button=isHorizontal?Math.min(height,width*.5):Math.min(width,height*.5);track-=button*2*ratio}selfConfig.trackLength=trackLength=isHorizontal?width-2*button-track:height-2*button-track;selfConfig.trackOffset=trackOffset=isHorizontal?x+button+.5:y+button+.5;selfConfig._nodeDimensions={x:isHorizontal?trackOffset+trackLength*position:x,y:isHorizontal?y:trackOffset+trackLength*position,width:isHorizontal?track-1<1?1:track-1:width<1?1:width,height:isHorizontal?height<1?1:height:track-1<1?1:track-1};scrollAnchor.addGraphicalElement({el:"rect",attr:{x:selfConfig._nodeDimensions.x,y:selfConfig._nodeDimensions.y,width:selfConfig._nodeDimensions.width,height:selfConfig._nodeDimensions.height,r:scrollbarConfig.roundEdges&&2||0,opacity:selfConfig.style.scroller.opacity},css:selfConfig.style.scroller,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchor",id:"scrollbarAnchor"});if(selfConfig.drawStripes&&selfConfig._nodeDimensions.width>=8){scrollAnchor.addGraphicalElement({el:"path",attr:{path:[M,selfConfig._nodeDimensions.x+selfConfig._nodeDimensions.width/2-3,selfConfig._nodeDimensions.y+.2*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height,m,3,-.6*selfConfig._nodeDimensions.height,v,.6*selfConfig._nodeDimensions.height],opacity:selfConfig.style.grip.opacity},css:selfConfig.style.grip,container:{id:"scrollbarGroup",label:"scrollbarGroup",isParent:true},component:scrollAnchor,label:"scrollbarAnchorStripe",id:"scrollbarAnchorStripe"})}};_proto.scrollTo=function scrollTo(position){var scrollbarConfig=this.getLinkedParent().config;if(position>=0&&position<=1){scrollbarConfig.scrollPosition=position;this.asyncDraw();if(typeof scrollbarConfig.evt.scroll==="function"){scrollbarConfig.evt.scroll(scrollbarConfig.scrollPosition)}}};return ScrollAnchor}(_tool.default);var _default=ScrollAnchor;exports.default=_default; |
Sorry, the diff of this file is too big to display
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
1254970
142
111
2