@fusioncharts/core
Version:
JavaScript Data Visualisation Library
1 lines • 26.8 kB
JavaScript
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=exports._mouseEvtHandler=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)}}}};var BaseChart=function(_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}(0,_inheritsLoose2.default)(BaseChart,_ComponentInterface);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.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=exports.default=BaseChart;
;