UNPKG

@fusioncharts/core

Version:

JavaScript Data Visualisation Library

1 lines 21.6 kB
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _extends=require("@babel/runtime/helpers/extends");exports.__esModule=true;exports.default=void 0;exports.extractAttribToEnd=extractAttribToEnd;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _gantt=_interopRequireWildcard(require("./gantt"));var _lib=require("../lib");var _dependencyManager=require("./../dependency-manager");var _ganttCommon=_interopRequireDefault(require("./gantt-common.animation"));function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap,n=new WeakMap;return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f=_extends({},null,{default:e});if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f)}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f})(e,t)}var UNDEF,lastHoverEle,hoverTimeout;var PXSTRING="px",NONE="none",UND_LINE="underline",VISIBLE_STR="visible",HIDDEN_STR="hidden",START_STR="start",END_STR="end",MIDDLE_STR="middle",HALF_SECOND=500,_hasElements=function _hasElements(elemArr,id){var i;for(i=0;i<elemArr.length;i++){if(elemArr[i].id===id){return elemArr[i]}}return false},_getAttribAsObj=function _getAttribAsObj(obj){var ind,ret={};for(ind in obj){if(obj.hasOwnProperty(ind)&&typeof obj[ind]==="string"&&!!obj[ind]){ret[ind]=obj[ind]}}return ret};function extractAttribToEnd(obj,attribObj){var ind;obj._attrib=(0,_lib.extend2)({},attribObj);obj._attrib=(0,_lib.extend2)(obj._attrib,_getAttribAsObj(obj));for(ind in obj){if(obj.hasOwnProperty(ind)&&!!obj[ind]&&typeof obj[ind]==="object"&&ind!=="_attrib"){extractAttribToEnd(obj[ind],obj._attrib)}}}(0,_dependencyManager.addDep)({name:"ganttCommonAnimation",type:"animationRule",extension:_ganttCommon.default});var GantCommonAxis=function(_GanttAxis){function GantCommonAxis(){var _this;_this=_GanttAxis.call(this)||this;_this.components={};return _this}(0,_inheritsLoose2.default)(GantCommonAxis,_GanttAxis);var _proto=GantCommonAxis.prototype;_proto.getName=function getName(){return"GanttCommon"};_proto._drawPlotLine=function _drawPlotLine(){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),canvas=chart.getChildren("canvas")[0],chartConfig=chart.config,axisPlotLineContainerBottom=axis.getContainer("ganttPlotLineContainer"),canvasBottom=canvas.canvasBottom||chartConfig.canvasBottom,canvasLeft=canvas.canvasLeft||chartConfig.canvasLeft,canvasRight=canvas.canvasRight||chartConfig.canvasRight,canvasTop=canvas.canvasTop||chartConfig.canvasTop,animationManager=axis.getFromEnv("animationManager"),gridArr=axisConfig.gridArr,plotLine=axis.getGraphicalElement("plotLine"),lineStyle,lineElement,i,ln,path=[];for(i=0,ln=gridArr.length;i<ln;i+=1){if(gridArr[i].x!==UNDEF){path.push("M",gridArr[i].x,canvasTop,"L",gridArr[i].x,canvasBottom)}else{path.push("M",canvasLeft,gridArr[i].y,"L",canvasRight,gridArr[i].y)}}lineStyle={"stroke-dasharray":axisConfig.plotLineDashStyle,"stroke-width":axisConfig.plotLineThickness,stroke:axisConfig.plotLineColor,path:path};lineElement=animationManager.setAnimation({el:plotLine&&plotLine[0]||"path",attr:lineStyle,container:axisPlotLineContainerBottom,label:"path",component:axis});if(!(plotLine&&plotLine[0])){axis.addGraphicalElement("plotLine",lineElement,true)}};_proto._drawTrendLine=function _drawTrendLine(){var axis=this,trendArr=axis.getComponentInfo("trend"),tooltipController=axis.getFromEnv("toolTipController"),i,markerObj,labelObj,axisConfig=axis.config,axisDrawingAttrObj,axisTextAttrObj,startValuePixel,isTrendZone,endValuePixel,startValue,endValue,fixedTrendLabelPos,fixedTrendLabelPosRight,isOpposit=axisConfig.isOpposit,crispPath,axisPadding=axisConfig.labelPadding,chart=axis.getFromEnv("chart"),animationManager=chart.getFromEnv("animationManager"),chartConfig=chart.config,canvas=chart.getChildren("canvas")[0],canvasBottom=canvas.config.canvasTop+canvas.config.canvasHeight,canvasLeft=canvas.config.canvasLeft||chartConfig.canvasLeft,canvasRight=canvas.config.canvasRight||chartConfig.canvasRight,canvasTop=canvas.config.canvasTop||chartConfig.canvasTop,drawTrendLabels=axisConfig.drawTrendLabels,trendlabels=axis.getGraphicalElement("trendlabels")||[],axisTrendContainerTop=axisConfig.axisTrendContainerTop,axisTrendContainerBottom=axisConfig.axisTrendContainerBottom,axisTrendContainer,axisDimention=axisConfig.axisDimention||{},checkForLimit=axis._isZoomed(),getLimit=axis.getVisibleConfig(),maxPx,minPx,showOnTop,xOffset=chartConfig.xOffset*-1,valueOnRight,trendElemsArr=axis.getGraphicalElement("trendElems"),trendTextElemsArr=axis.getGraphicalElement("trendlabels"),trendElems,trendTextElems,trendlines=axisConfig.trendLines,vtrendlines=axisConfig.vTrendLines;!trendElemsArr&&(trendElemsArr=[]);!trendTextElemsArr&&(trendTextElemsArr=[]);for(i=0;i<trendElemsArr.length;i++){trendElems=_hasElements(trendElemsArr,i);if(trendElems){trendElems.remove()}}if(vtrendlines){fixedTrendLabelPos=isOpposit?(axisDimention.opposite||canvasBottom)-(axisConfig.trendBottomPadding||0):(axisDimention.y||canvasBottom)+(axisConfig.trendBottomPadding||0)}else{fixedTrendLabelPos=isOpposit?(axisDimention.opposite||canvasLeft)+(axisPadding||0):(axisDimention.x||canvasLeft)-(axisPadding||0);fixedTrendLabelPosRight=isOpposit?(axisDimention.x||canvasRight)+(axisPadding||0):(axisDimention.opposite||canvasRight)+(axisPadding||0)}if(checkForLimit){maxPx=Math.max(axis.getPixel(getLimit.minValue,{wrtVisible:true}),axis.getPixel(getLimit.maxValue,{wrtVisible:true}));minPx=Math.min(axis.getPixel(getLimit.minValue,{wrtVisible:true}),axis.getPixel(getLimit.maxValue,{wrtVisible:true}))}if(trendlines||vtrendlines){for(i=0;i<trendArr.length;i++){markerObj=trendArr[i].marker;labelObj=trendArr[i].label;axisDrawingAttrObj={fill:markerObj.fill||"",stroke:markerObj.stroke||"","stroke-width":markerObj.strokeWidth,"stroke-dasharray":markerObj.strokeDashArray,"shape-rendering":markerObj.shapeRendering};axisTextAttrObj={fill:labelObj.fill||"",text:labelObj.text,"text-anchor":labelObj.textAnchor,"text-bound":labelObj.textBound};isTrendZone=markerObj.isZone;startValue=markerObj.startValue;endValue=markerObj.endValue;if(vtrendlines){startValuePixel=axis.getPixel(axisConfig.hasBreakPoints?axis._getRelativeBreakValue(startValue):startValue,{wrtVisible:true});endValuePixel=endValue?axis.getPixel(axisConfig.hasBreakPoints?axis._getRelativeBreakValue(endValue):endValue,{wrtVisible:true}):0;startValuePixel+=xOffset;endValuePixel+=xOffset;axisTextAttrObj.y=fixedTrendLabelPos;axisTextAttrObj["vertical-align"]="top";if(endValue!==UNDEF&&endValue!==""&&endValue!==startValue&&isTrendZone){axisDrawingAttrObj.path=["M",startValuePixel,canvasTop,"L",startValuePixel,canvasBottom,"L",endValuePixel,canvasBottom,"L",endValuePixel,canvasTop,"Z"];axisTextAttrObj.x=startValuePixel+(endValuePixel-startValuePixel)/2}else{crispPath=endValue?(0,_gantt.getCrispPath)(["M",startValuePixel,canvasTop,"L",endValuePixel,canvasBottom],markerObj.strokeWidth):(0,_gantt.getCrispPath)(["M",startValuePixel,canvasTop,"L",startValuePixel,canvasBottom],markerObj.strokeWidth);axisDrawingAttrObj.path=crispPath.path;axisTextAttrObj.x=endValue?endValuePixel:startValuePixel}if(checkForLimit&&(!drawTrendLabels||axisTextAttrObj.x>maxPx||axisTextAttrObj.x<minPx)){axisTextAttrObj.text=_lib.BLANKSTRING;axisTextAttrObj.visibility=HIDDEN_STR}else{axisTextAttrObj.visibility=VISIBLE_STR}}else if(trendlines){startValuePixel=axis.getPixel(startValue,{wrtVisible:true});endValuePixel=endValue?axis.getPixel(endValue,{wrtVisible:true}):0;valueOnRight=labelObj.valueOnRight;if(endValue!==UNDEF&&endValue!==""&&endValue!==startValue&&isTrendZone){axisDrawingAttrObj.path=["M",canvasLeft,startValuePixel,"L",canvasRight,startValuePixel,"L",canvasRight,endValuePixel,"L",canvasLeft,endValuePixel,"Z"];axisTextAttrObj.x=valueOnRight?fixedTrendLabelPosRight:fixedTrendLabelPos;axisTextAttrObj.y=startValuePixel+(endValuePixel-startValuePixel)/2}else{crispPath=endValue?(0,_gantt.getCrispPath)(["M",canvasLeft,startValuePixel,"L",canvasRight,endValuePixel,"Z"],markerObj.strokeWidth):(0,_gantt.getCrispPath)(["M",canvasLeft,startValuePixel,"L",canvasRight,startValuePixel,"Z"],markerObj.strokeWidth);axisDrawingAttrObj.path=crispPath.path;axisTextAttrObj.x=valueOnRight?fixedTrendLabelPosRight:fixedTrendLabelPos;axisTextAttrObj.y=endValue?valueOnRight?endValuePixel:startValuePixel:startValuePixel}if(checkForLimit&&(!drawTrendLabels||axisTextAttrObj.y>maxPx||axisTextAttrObj.y<minPx)){axisTextAttrObj.text=_lib.BLANKSTRING;axisTextAttrObj.visibility=HIDDEN_STR}else{axisTextAttrObj.visibility=VISIBLE_STR}}showOnTop=trendArr[i].showOnTop;if(!chart.config.is3D&&(showOnTop===1||axisConfig.showTrendlinesOnTop===1)){axisTrendContainer=axisTrendContainerTop}else{axisTrendContainer=axisTrendContainerBottom}trendElems=_hasElements(trendElemsArr,i);trendElems=animationManager.setAnimation({el:trendElems||"path",attr:axisDrawingAttrObj,container:axisTrendContainer,label:"path",component:axis}).show();trendTextElems=trendTextElemsArr[i];if(trendTextElems){animationManager.setAnimation({el:trendTextElems,attr:axisTextAttrObj,label:"text",component:axis})}!_hasElements(trendElemsArr,i)&&axis.addGraphicalElement("trendElems",trendElems,true);trendElems.id=i;if(labelObj.toolText!==""){tooltipController.enableToolTip(trendElems,labelObj.toolText)}else{tooltipController.disableToolTip(trendElems)}}}else{for(i=0;i<trendElemsArr.length;i++){trendElems=_hasElements(trendElemsArr,i);if(trendElems){trendElems.remove();trendlabels[i]&&trendlabels[i].remove()}}}};_proto._drawProcessAndDataTableStyleParser=function _drawProcessAndDataTableStyleParser(attrs){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),smartLabel=axis.getFromEnv("smartLabel"),colorM=axis.getFromEnv("color-manager"),labels=axisConfig.labels,style=labels.style,elem=attrs.elem||{},dimension=attrs.dimension,textStyle=elem._attrib||{},left=dimension.left,right=dimension.right,top=dimension.top,bottom=dimension.bottom,processPadding=2,fontFamily,fontSize,fontWeight,fontStyle,bgColor,xPos,yPos,text,retAttrib,smartText,vAlign,align,color,textDecoration,hoverC,hoverA,useHover,usePlotHover,rollOverColor,link,lHeight;switch(attrs.type){case"category":case"datatable":case"process":fontFamily=(0,_lib.pluck)(textStyle.font,style.fontFamily);fontSize=(0,_lib.pluck)(textStyle.fontsize,this.computeFontSize(style.fontSizeWithUnit).toString()).replace(/px/i,"")+PXSTRING;fontStyle=(0,_lib.pluck)(Number(textStyle.isitalic)?"italic":UNDEF,style.fontStyle);bgColor=(0,_lib.convertColor)((0,_lib.pluck)(textStyle.bgcolor?(0,_lib.getFirstColor)(textStyle.bgcolor):UNDEF,colorM.getColor("categoryBgColor")),(0,_lib.pluckNumber)(textStyle.bgalpha,100));color=(0,_lib.pluck)(textStyle.fontcolor?(0,_lib.getFirstColor)(textStyle.fontcolor):UNDEF,style.color);textDecoration=(0,_lib.pluckNumber)(textStyle.isunderline,0)&&UND_LINE||NONE;vAlign=(0,_lib.pluck)(textStyle.valign,"center").toLowerCase();align=(0,_lib.pluck)(textStyle.align,"middle").toLowerCase();text=elem.drawLabel||"";fontWeight=(0,_lib.pluck)(Number(textStyle.isbold)?"bold":UNDEF,style.fontWeight);link=elem.link;break;case"header":fontFamily=(0,_lib.pluck)(textStyle.headerfont,style.fontFamily);fontSize=(0,_lib.pluck)(textStyle.headerfontsize,this.computeFontSize(style.fontSizeWithUnit).toString()).replace(/px/i,"")+PXSTRING;fontWeight=(0,_lib.pluck)(Number(textStyle.headerisbold)===1?"bold":textStyle.headerisbold===UNDEF?"bold":UNDEF,style.fontWeight);color=(0,_lib.pluck)(textStyle.headerfontcolor?(0,_lib.getFirstColor)(textStyle.headerfontcolor):UNDEF,style.color);textDecoration=(0,_lib.pluckNumber)(textStyle.headerisunderline,0)&&UND_LINE||NONE;fontStyle=(0,_lib.pluck)(textStyle.headerisitalic?"italic":UNDEF,style.fontStyle);bgColor=(0,_lib.convertColor)((0,_lib.pluck)(textStyle.headerbgcolor?(0,_lib.getFirstColor)(textStyle.headerbgcolor):UNDEF,colorM.getColor("categoryBgColor")),(0,_lib.pluckNumber)(textStyle.headerbgalpha,100));vAlign=(0,_lib.pluck)(textStyle.headervalign,"center").toLowerCase();align=(0,_lib.pluck)(textStyle.headeralign,"middle").toLowerCase();text=elem.drawLabel||"";link=elem.headerlink;break}switch(attrs.type){case"category":axisConfig.gridLinePath+="M"+left+","+top+"L"+left+","+bottom+"L"+right+","+bottom;fontWeight=(0,_lib.pluck)(Number(textStyle.isbold)===1?"bold":textStyle.isbold===UNDEF?"bold":UNDEF,style.fontWeight);break;case"datatable":case"process":axisConfig.gridLinePath+="M"+left+","+bottom+"L"+right+","+bottom+"L"+right+","+top;break;case"header":axisConfig.gridLineHeaderPath+="M"+left+","+bottom+"L"+right+","+bottom+"L"+right+","+top;break}hoverC=(0,_lib.pluck)(elem._attrib.hoverbandcolor,axisConfig.hoverColor);hoverA=(0,_lib.pluckNumber)(elem._attrib.hoverbandalpha,axisConfig.hoverAlpha);if(align==="left"){xPos=left+processPadding;align=START_STR}else if(align==="right"){xPos=left+(right-left)-processPadding;align=END_STR}else{align=MIDDLE_STR;xPos=left+(right-left)/2}if(vAlign==="top"){yPos=top-processPadding}else if(vAlign==="bottom"){yPos=top+(bottom-top)-processPadding}else{vAlign=MIDDLE_STR;yPos=top+(bottom-top)/2}style={fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecoration:textDecoration};lHeight=(0,_lib.setLineHeight)(style);lHeight=Number(lHeight.replace(/px/i,""));lHeight=bottom-top>lHeight?bottom-top:lHeight;smartLabel.useEllipsesOnOverflow(chart.config.useEllipsesWhenOverflow);smartLabel.setStyle(style);smartText=smartLabel.getSmartText(text,right-left,lHeight);retAttrib={textAttr:{x:xPos,y:yPos,text:smartText.text,fill:color,"text-anchor":align,"vertical-align":vAlign,cursor:link?"pointer":chart.getFromEnv("paper").canvas.style.cursor},css:style,rectAttr:{x:left,y:top,width:left<right?right-left:0,height:top<bottom?bottom-top:0,fill:bgColor,"stroke-width":0,cursor:link?"pointer":chart.getFromEnv("paper").canvas.style.cursor},eventArgs:{isHeader:attrs.type==="header",label:text,vAlign:vAlign,align:align,link:link,id:elem.id},tooltext:smartText.oriText};if(attrs.type==="datatable"||attrs.type==="process"||attrs.type==="category"){rollOverColor=(0,_lib.convertColor)(hoverC,hoverA);useHover=(0,_lib.pluckNumber)(elem._attrib.showhoverband,axisConfig.useHover);usePlotHover=(0,_lib.pluckNumber)(elem._attrib.showganttpanehoverband,axisConfig.usePlotHover,useHover);retAttrib.dataArgs={rollOverColor:rollOverColor,useHover:useHover,usePlotHover:usePlotHover,dimension:dimension,hoverEle:elem,type:attrs.type,pos:attrs.pos,axis:axis,groupId:attrs.elemIndex}}else{retAttrib.dataArgs={rollOverColor:UNDEF,useHover:0,usePlotHover:0,dimension:dimension,hoverEle:elem,type:attrs.type,pos:attrs.pos,axis:axis,groupId:attrs.elemIndex}}return retAttrib};_proto._drawProcessAndDataTableElement=function _drawProcessAndDataTableElement(attrs){var axis=this,axisConfig=axis.config,chart=axis.getFromEnv("chart"),categoryElement=axis.components.categoryElement||[],hoverElemsArr=axisConfig.hoverElemsArr||(axisConfig.hoverElemsArr=[]),animationManager=axis.getFromEnv("animationManager"),elemIndex=attrs.elemIndex,labelHoverEventName=axisConfig.labelHoverEventName,toolTipController=axis.getFromEnv("toolTipController"),attribs,labelBackContainer,labelTextContainer,rectElement,textElement,showTooltip=chart.config.showtooltip,labelClickHandler=function labelClickHandler(e){var ele=this;chart.plotEventHandler(ele,e,labelHoverEventName.click)},labelRollOver=function labelRollOver(e){var ele=this;hoverTimeout=clearTimeout(hoverTimeout);if(!lastHoverEle||lastHoverEle.removed){lastHoverEle=null}lastHoverEle&&axis._gridOutHandler.call(lastHoverEle);axis._gridHoverHandler.call(ele);chart.plotEventHandler(ele,e,labelHoverEventName.rollOver)},labelRollOut=function labelRollOut(e){lastHoverEle=this;hoverTimeout=clearTimeout(hoverTimeout);hoverTimeout=setTimeout((function(){return axis._gridOutHandler.call(lastHoverEle)}),HALF_SECOND);chart.plotEventHandler(lastHoverEle,e,labelHoverEventName.rollOut)};if(attrs.type==="header"){labelBackContainer=axis.getContainer("headerBackContainer");labelTextContainer=axis.getContainer("headerTextContainer")}else{labelBackContainer=axis.getContainer("labelBackContainer");labelTextContainer=axis.getContainer("labelTextContainer")}attribs=axis._drawProcessAndDataTableStyleParser(attrs);rectElement=animationManager.setAnimation({el:categoryElement[elemIndex]&&categoryElement[elemIndex].graphics.rect||"rect",attr:attribs.rectAttr,container:labelBackContainer,label:"rect",component:axis});textElement=animationManager.setAnimation({el:categoryElement[elemIndex]&&categoryElement[elemIndex].graphics.label||"text",attr:attribs.textAttr,container:labelTextContainer,label:"text",component:axis});if(categoryElement[elemIndex]){textElement.removeCSS();labelBackContainer.appendChild(rectElement);labelTextContainer.appendChild(textElement)}else{axis.addGraphicalElement("rectElement",rectElement,true);axis.addGraphicalElement("textElement",textElement,true);categoryElement[elemIndex]={};categoryElement[elemIndex].graphics={};categoryElement[elemIndex].config={};categoryElement[elemIndex].graphics.label=textElement;categoryElement[elemIndex].graphics.rect=rectElement;rectElement.hover(labelRollOver,labelRollOut).on("fc-click",labelClickHandler);textElement.hover(labelRollOver,labelRollOut).on("fc-click",labelClickHandler)}textElement.css(attribs.css);if(attrs.type!=="header"){if(!hoverElemsArr[attrs.pos]){hoverElemsArr[attrs.pos]=[]}hoverElemsArr[attrs.pos].push({bgElem:rectElement,bgColor:attribs.rectAttr.fill})}rectElement.data("dataObj",attrs.elem).data("eventArgs",attribs.eventArgs).data("data",attribs.dataArgs);textElement.data("dataObj",attrs.elem).data("eventArgs",attribs.eventArgs).data("data",attribs.dataArgs);if(!showTooltip){toolTipController.disableToolTip(textElement)}else{toolTipController.enableToolTip(textElement,attribs.tooltext)}axis.components.categoryElement=categoryElement};_proto._drawGridLine=function _drawGridLine(){var axis=this,axisConfig=axis.config,animationManager=axis.getFromEnv("animationManager"),gridLine=axis.getGraphicalElement("gridLine")||[],lineStyle,lineElement,counter=0,i=0,ln=2,path,container;lineStyle={"stroke-dasharray":axisConfig.lineDashStyle,"stroke-width":axisConfig.lineThickness,stroke:axisConfig.lineColor};for(;i<ln;i+=1){if(i===0){path=axisConfig.gridLinePath;container=axis.getContainer("labelLineContainer")}else{path=axisConfig.gridLineHeaderPath;container=axis.getContainer("headerLineContainer");if(!path){continue}}lineStyle.path=path;lineElement=animationManager.setAnimation({el:gridLine&&gridLine[counter]||"path",attr:lineStyle,container:container,label:"path",component:axis});!(gridLine&&gridLine[counter])&&axis.addGraphicalElement("gridLine",lineElement,true);counter+=1}for(i=counter,ln=axis.getGraphicalElement("gridLine").length;i<ln;i+=1){axis.getGraphicalElement("gridLine")[i].attr({path:"M0,0"})}};_proto._gridHoverHandler=function _gridHoverHandler(){var data=this.data("data"),type=data.type,dimension=data.dimension,axis=data.axis,chart=axis.getFromEnv("chart"),chartConfig=chart.config,animationManager=axis.getFromEnv("animationManager"),hoverElems=axis.config.hoverElemsArr||[],ganttPlotHoverBandContainer=axis.getContainer("ganttPlotHoverBandContainer"),plotHoverElement=axis.getGraphicalElement("plotHoverElement"),isPlotHoverElement=plotHoverElement?1:0,plotHoverElementAttr,i,ln;if(type==="category"){plotHoverElementAttr={x:dimension.left,y:chartConfig.canvasTop,width:dimension.left<dimension.right?dimension.right-dimension.left:0,height:chartConfig.height,fill:data.rollOverColor,"stroke-width":0}}else{plotHoverElementAttr={y:dimension.top,x:chartConfig.canvasLeft,height:dimension.top<dimension.bottom?dimension.bottom-dimension.top:0,width:chartConfig.width,fill:data.rollOverColor,"stroke-width":0}}if(data.usePlotHover){plotHoverElement=animationManager.setAnimation({el:plotHoverElement||"rect",attr:plotHoverElementAttr,component:axis,label:"rect",container:ganttPlotHoverBandContainer});isPlotHoverElement?plotHoverElement.show():axis.addGraphicalElement("plotHoverElement",plotHoverElement)}if(data.useHover&&hoverElems[data.pos]){for(i=0,ln=hoverElems[data.pos].length;i<ln;i+=1){animationManager.setAnimation({el:hoverElems[data.pos][i].bgElem||"rect",attr:{fill:data.rollOverColor},label:"rect"})}}};_proto._gridOutHandler=function _gridOutHandler(){var data=this.data("data"),axis=data.axis,hoverElemsArr=axis.config.hoverElemsArr||[],animationManager=axis.getFromEnv("animationManager"),plotHoverElement=axis.getGraphicalElement("plotHoverElement"),i,ln,hoverOutElem;if(data.usePlotHover){if(plotHoverElement){plotHoverElement.hide()}}if(data.useHover&&hoverElemsArr[data.pos]){for(i=0,ln=hoverElemsArr[data.pos].length;i<ln;i+=1){hoverOutElem=hoverElemsArr[data.pos][i];animationManager.setAnimation({el:hoverOutElem.bgElem||"rect",attr:{fill:hoverOutElem.bgColor},label:"rect"})}}};_proto._disposeExtraProcessAndDataTableElement=function _disposeExtraProcessAndDataTableElement(index){var axis=this,categoryElement=axis.components.categoryElement||[],i,ln;for(i=index,ln=categoryElement.length;i<ln;i+=1){categoryElement[i].graphics.label.attr({text:""});categoryElement[i].graphics.rect.attr({x:0,y:0,width:0,heigth:0})}};return GantCommonAxis}(_gantt.default);var _default=exports.default=GantCommonAxis;