@fusioncharts/fusiontime
Version:
FusionCharts JavaScript time-series charting framework
1 lines • 23.1 kB
JavaScript
;var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=true;exports.default=void 0;var _inheritsLoose2=_interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));var _smartRenderer=_interopRequireDefault(require("@fusioncharts/core/src/component-interface/smart-renderer"));var _timeConverter=_interopRequireDefault(require("@fusioncharts/utils/src/time-converter"));var _lib=require("@fusioncharts/core/src/lib");var _libGraphics=require("@fusioncharts/core/src/lib/lib-graphics");var _timeBucket=require("@fusioncharts/utils/src/time-bucket");var _dependencyManager=require("@fusioncharts/core/src/dependency-manager");var _dataMarker=_interopRequireDefault(require("./data-marker.animation"));var _isArray=_interopRequireDefault(require("@fusioncharts/utils/src/type/is-array"));var _isObject=_interopRequireDefault(require("@fusioncharts/utils/src/type/is-object"));var _flagMarkerDrawable=_interopRequireDefault(require("./flag-marker-drawable"));var _pinMarkerDrawable=_interopRequireDefault(require("./pin-marker-drawable"));var _equals=_interopRequireDefault(require("ramda/es/equals"));var _isNumber=_interopRequireDefault(require("@fusioncharts/utils/src/type/is-number"));var markerDimensions={flagHeight:16,flagWidth:16,stickLength:10,pinHeight:23,pinWidth:23,totalFlagHeight:26},DASH_STR="—",VISIBLE="visible",DEFAULT_FONT_COLOR="#ffffff",DEFAULT_STROKE_COLOR="#8c8c8c",DEFAULT_TOOLTIP_BACKGROUND="#f2eded",ROLLOVER="DataMarkerRollOver",ROLLOUT="DataMarkerRollOut",CLICK="dataMarkerClick",TYPE_PIN="pin",getSameProperty=function getSameProperty(arr){if(arr===void 0){arr=[]}if(!(0,_isArray.default)(arr))return{};var output={},key,j,obj1=(0,_isObject.default)(arr[0])?arr[0]:{},len=arr.length,filterFn=function filterFn(obj){return(0,_isObject.default)(obj)&&obj.hasOwnProperty(key)&&obj[key]==obj1[key]};for(key in obj1){if(obj1.hasOwnProperty(key)){var addProp=true;for(j=1;j<len;++j){if(!filterFn(arr[j])){addProp=false;break}}if(addProp){output[key]=obj1[key]}}}return output},checkForValidCoordinated=function checkForValidCoordinated(coordiante){var valid=true,key;for(key in coordiante){if(coordiante.hasOwnProperty(key)){valid=valid&&!isNaN(coordiante[key])}}return valid},_isMarkerInBounds=function _isMarkerInBounds(width,height,chartX,chartY,centerX,y){return chartX>=centerX-width/2&&chartX<=centerX+width/2&&chartY<=y&&chartY>=y-height};(0,_dependencyManager.addDep)({name:"dataMarkerAnimation",type:"animationRule",extension:_dataMarker.default});var DataMarker=function(_SmartRenderer){function DataMarker(){var _this;_this=_SmartRenderer.call(this)||this;_this.getClassName=function(baseName){if(baseName===void 0){baseName=""}var randomString=Math.random().toString(36).substring(2);return baseName+"-"+randomString};_this.getCSPNonce=function(){var metaTag=document.querySelector('meta[http-equiv="Content-Security-Policy"]');if(metaTag){var content=metaTag.getAttribute("content");if(content){var match=content.match(/'nonce-([^']+)'/);if(match){return match[1]}}}return null};_this.config.styleInfo={};return _this}(0,_inheritsLoose2.default)(DataMarker,_SmartRenderer);var _proto=DataMarker.prototype;_proto.configure=function configure(dataObj){_SmartRenderer.prototype.configure.call(this,dataObj);var config=this.config,styleInfo=config.styleInfo,currStyle,styleObj;if((0,_isArray.default)(dataObj.data)){var oldData=config.unsortedData;config.unsortedData=dataObj.data.slice();if(!(0,_equals.default)(oldData,config.unsortedData)){config.data=dataObj.data.slice();config.data.sort((function(a,b){return _timeConverter.default.parser(a.timeformat).parse(a.time)-_timeConverter.default.parser(b.timeformat).parse(b.time)}))}}config.isStock=(0,_lib.pluck)(dataObj.isStock,config.isStock);config.isRange=(0,_lib.pluck)(dataObj.isRange,config.isRange);if(styleObj=dataObj.style){currStyle=styleInfo[dataObj.index]||(styleInfo[dataObj.index]={});for(var styles in styleObj){if(styleObj.hasOwnProperty(styles)){currStyle[styles]=styleObj[styles]}}}config.skipGrouping=dataObj.skipGrouping;(0,_lib.defined)(dataObj.visibility)&&(config.visibility=dataObj.visibility)};_proto.setHoverInEffect=function setHoverInEffect(index){var marker=this,markerConfig=marker.config,hoveredMarkers=markerConfig.markerInfo[index].markers,style=hoveredMarkers[0].style||{},markerHoverStyle={},markerHoverStyles={},textHoverStyle={},textHoverStyles={},styleDef=marker.getFromEnv("getStyleDef");if(hoveredMarkers.multipleMarkers){markerHoverStyles=hoveredMarkers.markers.map((function(markerInfo){return markerInfo.style&&styleDef(markerInfo.style["marker:hover"])||{}}));textHoverStyles=hoveredMarkers.markers.map((function(markerInfo){return markerInfo.style&&styleDef(markerInfo.style["text:hover"])||{}}));Object.assign(markerHoverStyle,markerConfig.defaultHoverStyle,getSameProperty(markerHoverStyles));Object.assign(textHoverStyle,markerConfig.defaultHoverStyle,getSameProperty(textHoverStyles))}else{Object.assign(markerHoverStyle,markerConfig.defaultHoverStyle,styleDef(style["marker:hover"]));Object.assign(textHoverStyle,markerConfig.defaultHoverStyle,styleDef(style["text:hover"]))}marker.getFromEnv("animationManager").setAnimationState("mouseOver");marker.setData({style:{marker:markerHoverStyle,text:textHoverStyle},index:index,skipGrouping:true},true)};_proto.setHoverOutEffect=function setHoverOutEffect(index){var marker=this;marker.getFromEnv("animationManager").setAnimationState("mouseOut");marker.setData({style:{marker:{},text:{}},index:index,skipGrouping:true},true)};_proto._firePlotEvent=function _firePlotEvent(eventType,index,e,hoveredInfo){var marker=this,markerConfig=marker.config,markerInfo=markerConfig.markerInfo,eventArgs=markerInfo[index]&&markerInfo[index].eventArgs||{},chart=marker.getFromEnv("chart"),coordiante=(0,_lib.getMouseCoordinate)(chart.getFromEnv("chart-container"),e,chart),validCoordinates=checkForValidCoordinated(coordiante),args=(0,_lib.extend2)(coordiante,eventArgs);if(validCoordinates&&index!==_lib.UNDEF){switch(eventType){case"fc-mouseover":chart.fireChartInstanceEvent(ROLLOVER,args);break;case"fc-mouseout":chart.fireChartInstanceEvent(ROLLOUT,args);break;case"fc-click":chart.fireChartInstanceEvent(CLICK,args);break;default:break}}};_proto.__setDefaultConfig=function __setDefaultConfig(){var config=this.config;config.isStock=false;config.isRange=false;config["default-stroke-width"]=1;config["default-fill-opacity"]=.5;config["default-stroke-opacity"]=.5;config["default-font-color"]=DEFAULT_FONT_COLOR;config["default-stroke-color-multiple"]=DEFAULT_STROKE_COLOR;config["default-tooltip-background"]=DEFAULT_TOOLTIP_BACKGROUND;config.defaultMarkerStyle={"stroke-width":1,"fill-opacity":.5,"stroke-opacity":.5};config.defaultTextStyle={fill:"#ffffff","font-size":"12px","line-height":"14.4px","fill-opacity":1,"stroke-opacity":1,"text-anchor":"middle","font-weight":"normal","font-style":"normal"};config.defaultHoverStyle={opacity:1,"fill-opacity":1,"stroke-opacity":1}};_proto.draw=function draw(){if(this.config.visibility===VISIBLE){this._createGroup();this._drawMarkers()}};_proto.getType=function getType(){return"dataMarker"};_proto.getName=function getName(){return"dataMarker"};_proto._checkPointOverMarker=function _checkPointOverMarker(pX,chartX,chartY,catWidth){var dataMarker=this,config=dataMarker.config,dataInfo=config.dataInfo,currData,currentMarker,x,y,dim=markerDimensions,halfWidth,centerX,returnObj,markerInfo=config.markerInfo,ceilPx=Math.ceil(pX),floorPx=Math.floor(pX),sum=catWidth,testWidth,testHeight,indexRange=[ceilPx,floorPx];while(sum<dim.flagWidth||sum<dim.pinWidth){indexRange.unshift(++ceilPx);indexRange.push(--floorPx);sum+=catWidth}indexRange.forEach((function(index){currentMarker=markerInfo[index];if(!returnObj&¤tMarker){currData=dataInfo[index];x=currData.x;y=currData.y;halfWidth=(currData.width||0)/2;centerX=x+halfWidth;if(currentMarker&¤tMarker.markers&¤tMarker.markers[0].type===TYPE_PIN){testWidth=dim.pinWidth;testHeight=dim.pinHeight}else{testWidth=dim.flagWidth;testHeight=dim.totalFlagHeight}if(_isMarkerInBounds(testWidth,testHeight,chartX,chartY,centerX,y)){returnObj={pointIndex:index,hovered:true,pointObj:currData,markerObj:currentMarker,component:dataMarker}}}}));return returnObj};_proto._getTooltext=function _getTooltext(index){var _this2=this;var marker=this,config=marker.config,markerInfo=config.markerInfo,markerObj=markerInfo[index],markers=markerObj.markers,len=markers.length,formatter=marker.getFromEnv("yScale").tickFormat(4,".2s"),multipleMarkers=markerObj.multipleMarkers,timeMap={},header,body;var tooltipHeaderClass=this.getClassName("tooltip-header-class"),chartNonce=this.getCSPNonce();if(!markerObj.formatedTime){markerObj.formatedTime=marker.getFromEnv("xScale").getFormattedTime({type:"tooltip",dateRange:markerObj})}header='\n <style nonce="'+chartNonce+'">\n .'+tooltipHeaderClass+' {\n margin-bottom: 6px;\n }\n </style>\n <div class="'+tooltipHeaderClass+'">'+markerObj.formatedTime+"</div>";if(config.isStock){var tooltipIsStockBody1=this.getClassName("tooltip-isStock-body1"),tooltipIsStockBody2=this.getClassName("tooltip-isStock-body2"),tooltipIsStockOpen1=this.getClassName("tooltip-isStock-open1"),tooltipIsStockOpen2=this.getClassName("tooltip-isStock-open2"),tooltipIsStockHigh1=this.getClassName("tooltip-isStock-high1"),tooltipIsStockHigh2=this.getClassName("tooltip-isStock-high2"),tooltipIsStockLow1=this.getClassName("tooltip-isStock-low1"),tooltipIsStockLow2=this.getClassName("tooltip-isStock-low2"),tooltipIsStockClose=this.getClassName("tooltip-isStock-close");body='\n <style nonce="'+chartNonce+'">\n .'+tooltipIsStockBody1+" {\n display: grid; display: -ms-grid; grid-template-columns: auto auto auto auto 1fr; -ms-grid-columns: auto auto auto auto 1fr; grid-template-rows: auto auto; -ms-grid-rows: auto auto; margin-bottom:6px;\n }\n\n ."+tooltipIsStockBody2+' {\n grid-column-start: 1; -ms-grid-column: 1; grid-row-start: 1; -ms-grid-row: 1;\n }\n </style>\n <div class="'+tooltipIsStockBody1+'">\n <div class="'+tooltipIsStockBody2+'">\n Open:\n </div>\n <style nonce="'+chartNonce+'">\n .'+tooltipIsStockOpen1+" {\n grid-column-start: 2; -ms-grid-column: 2; grid-row-start: 1; -ms-grid-row: 1; text-align: center; margin-left: 6px;\n }\n\n ."+tooltipIsStockOpen2+' {\n grid-column-start: 3; -ms-grid-column: 3; grid-row-start: 1; -ms-grid-row: 1; margin-left: 12px;\n }\n </style>\n <div class="'+tooltipIsStockOpen1+'">\n '+((0,_isNumber.default)(markerObj.openValue)?(0,_lib.parseUnsafeString)(formatter(markerObj.openValue)):DASH_STR)+'\n </div>\n <div class="'+tooltipIsStockOpen2+'">\n High:\n </div>\n <style nonce="'+chartNonce+'">\n .'+tooltipIsStockHigh1+" {\n grid-column-start: 4; -ms-grid-column: 4; grid-row-start: 1; -ms-grid-row: 1; text-align: center; margin-left: 6px;\n }\n\n ."+tooltipIsStockHigh2+' {\n grid-column-start: 1; -ms-grid-column: 1; grid-row-start: 2; -ms-grid-row: 2;\n }\n </style>\n <div class="'+tooltipIsStockHigh1+'">\n '+((0,_isNumber.default)(markerObj.highValue)?(0,_lib.parseUnsafeString)(formatter(markerObj.highValue)):DASH_STR)+'\n </div>\n <div class="'+tooltipIsStockHigh2+'">\n Low:\n </div>\n <style nonce="'+chartNonce+'">\n .'+tooltipIsStockLow1+" {\n grid-column-start: 2; -ms-grid-column: 2; grid-row-start: 2; -ms-grid-row: 2; text-align: center; margin-left: 6px;\n }\n\n ."+tooltipIsStockLow2+' {\n grid-column-start: 3; -ms-grid-column: 3; grid-row-start: 2; -ms-grid-row: 2; margin-left: 12px;\n }\n </style>\n <div class="'+tooltipIsStockLow1+'">\n '+((0,_isNumber.default)(markerObj.lowValue)?(0,_lib.parseUnsafeString)(formatter(markerObj.lowValue)):DASH_STR)+'\n </div>\n <div class="'+tooltipIsStockLow2+'">\n Close:\n </div>\n <style nonce="'+chartNonce+'">\n .'+tooltipIsStockClose+' {\n grid-column-start: 4; -ms-grid-column: 4; grid-row-start: 2; -ms-grid-row: 2; text-align: center; margin-left: 6px;\n }\n </style>\n <div class="'+tooltipIsStockClose+'">\n '+((0,_isNumber.default)(markerObj.closeValue)?(0,_lib.parseUnsafeString)(formatter(markerObj.closeValue)):DASH_STR)+"\n </div>\n </div>"}else if(config.isRange){var tooltipIsRangeBody1=this.getClassName("tooltip-isRange-body1"),tooltipIsRangeBody2=this.getClassName("tooltip-isRange-body2"),tooltipIsRangeHigh1=this.getClassName("tooltip-isRange-high1"),tooltipIsRangeHigh2=this.getClassName("tooltip-isRange-high2"),tooltipIsRangeLow=this.getClassName("tooltip-isRange-low1");body='\n <style nonce="'+chartNonce+'">\n .'+tooltipIsRangeBody1+" {\n display: grid; display: -ms-grid; grid-template-columns: auto auto auto auto 1fr; -ms-grid-columns: auto auto auto auto 1fr; grid-template-rows: auto auto; -ms-grid-rows: auto auto; margin-bottom:6px;\n }\n\n ."+tooltipIsRangeBody2+' {\n grid-column-start: 1; -ms-grid-column: 1; grid-row-start: 1; -ms-grid-row: 1;\n }\n </style>\n <div class="'+tooltipIsRangeBody1+'">\n <div class="'+tooltipIsRangeBody2+'">\n High:\n </div>\n <style nonce="'+chartNonce+'">\n .'+tooltipIsRangeHigh1+" {\n grid-column-start: 2; -ms-grid-column: 2; grid-row-start: 1; -ms-grid-row: 1; text-align: center; margin-left: 6px;\n }\n\n ."+tooltipIsRangeHigh2+' {\n grid-column-start: 1; -ms-grid-column: 1; grid-row-start: 2; -ms-grid-row: 2;\n }\n </style>\n <div class="'+tooltipIsRangeHigh1+'">\n '+((0,_isNumber.default)(markerObj.highValue)?formatter(markerObj.highValue):DASH_STR)+'\n </div>\n <div class="'+tooltipIsRangeHigh2+'">\n Low:\n </div>\n <style nonce="'+chartNonce+'">\n .'+tooltipIsRangeLow+' {\n grid-column-start: 2; -ms-grid-column: 2; grid-row-start: 2; -ms-grid-row: 2; text-align: center; margin-left: 6px;\n }\n </style>\n <div class="'+tooltipIsRangeLow+'">\n '+((0,_isNumber.default)(markerObj.lowValue)?formatter(markerObj.lowValue):DASH_STR)+"\n </div>\n </div>"}else{if(!markerObj.tooltipValue){markerObj.tooltipValue=formatter(markerObj.value)}if(markerObj.value<1&&markerObj.value>-1){var tooltipIsMarkerObjBody1=this.getClassName("tooltip-markerObj-body1"),tooltipIsMarkerObjBody2=this.getClassName("tooltip-markerObj-body2"),tooltipIsMarkerObjBody3=this.getClassName("tooltip-markerObj-body3");body='\n <style nonce="'+chartNonce+'">\n .'+tooltipIsMarkerObjBody1+" {\n margin-bottom:6px; height: 14px;\n }\n\n ."+tooltipIsMarkerObjBody2+" {\n float: left;\n }\n\n ."+tooltipIsMarkerObjBody3+' {\n padding-left: 8px;\n }\n </style>\n <div class="'+tooltipIsMarkerObjBody1+'">\n <div class="'+tooltipIsMarkerObjBody2+'">'+(0,_lib.parseUnsafeString)(markerObj.seriesname)+':<span class="'+tooltipIsMarkerObjBody3+'">\n '+markerObj.value+"</span></div>\n </div>"}else{var _tooltipIsMarkerObjBody=this.getClassName("tooltip-markerObj-body1"),_tooltipIsMarkerObjBody2=this.getClassName("tooltip-markerObj-body2"),_tooltipIsMarkerObjBody3=this.getClassName("tooltip-markerObj-body3");body='\n <style nonce="'+chartNonce+'">\n .'+_tooltipIsMarkerObjBody+" {\n margin-bottom:6px; height: 14px;\n }\n\n ."+_tooltipIsMarkerObjBody2+" {\n float: left;\n }\n\n ."+_tooltipIsMarkerObjBody3+' {\n padding-left: 8px;\n }\n </style>\n <div class="'+_tooltipIsMarkerObjBody+'">\n <div class="'+_tooltipIsMarkerObjBody2+'">'+(0,_lib.parseUnsafeString)(markerObj.seriesname)+':<span class="'+_tooltipIsMarkerObjBody3+'">\n '+(0,_lib.parseUnsafeString)(markerObj.tooltipValue)+"</span></div>\n </div>"}}markers.forEach((function(currMarker,i){var margBottom=6;if(multipleMarkers&&!timeMap[currMarker.time]){var tooltipIsmultipleMarkersBody=_this2.getClassName("tooltip-multipleMarkers-body");timeMap[currMarker.time]=true;body+='\n <style nonce="'+chartNonce+'">\n .'+tooltipIsmultipleMarkersBody+' {\n clear: both; margin-bottom:2px; font-weight: 600;\n }\n </style>\n <div clas="'+tooltipIsmultipleMarkersBody+'">'+currMarker.time+"</div>";if(i+1<len&&timeMap[markers[i+1].time]){margBottom=2}}var tooltipIscurrMarkersBody=_this2.getClassName("tooltip-currMarker-body");body+=currMarker.tooltext?'\n <style nonce="'+chartNonce+'">\n .'+tooltipIscurrMarkersBody+" {\n clear: both; "+(i<len-1?"margin-bottom: "+margBottom+"px":"")+';\n }\n </style>\n <div class="'+tooltipIscurrMarkersBody+'">'+(0,_lib.parseUnsafeString)(currMarker.tooltext,false)+"</div>":""}));return{header:header,body:body}};_proto.allocatePosition=function allocatePosition(){!this.config.skipGrouping&&this._groupMarkers()};_proto._groupMarkers=function _groupMarkers(){var marker=this,parent=marker.getLinkedParent(),info=parent._getRelevantInfo(),dataInfo=info.dataInfo,config=marker.config,markerInfo=config.markerInfo={},currMarkerObj,index,markerTime,timeGroupLevelDiff,binDecider=marker.getFromEnv("binDecider"),thresHold=binDecider.getRangeThreshold(),currentGrouping=thresHold[0].name(),firstTimeStamp=info.firstTimeStamp,xScale=marker.getFromEnv("xScale"),xScaleDomain=xScale.getDomain(),plotInfo,seriesInfo,seriesName,keys,data=config.data;config.dataInfo=dataInfo;data.forEach((function(currMarker,i){markerTime=_timeConverter.default.parser(currMarker.timeformat).parse(currMarker.time);timeGroupLevelDiff=(0,_timeBucket.getPlaceHolderIndex)(currentGrouping)-(0,_timeBucket.getPlaceHolderIndex)((0,_timeBucket.getMinPlaceHolder)(currMarker.timeformat));if(markerTime&&timeGroupLevelDiff>=0&&timeGroupLevelDiff<=2){markerTime=markerTime.getTime();if(markerTime>=firstTimeStamp&&markerTime>=xScaleDomain[0]&&markerTime<=xScaleDomain[1]){index=xScale.getBinIndex(markerTime,false);if(plotInfo=dataInfo[index]){seriesInfo=currMarker.series||{};seriesName=Object.keys(seriesInfo)[0];keys=(config.isRange||config.isStock)&&((0,_isObject.default)(currMarker.measures[0])?Object.keys(currMarker.measures[0]).toString():currMarker.measures[0]);if(!markerInfo[index]){markerInfo[index]={markers:[],id:(config.isStock||config.isRange?keys:currMarker.seriesname)+currMarker.time,startDate:plotInfo.startDate,seriesname:currMarker.seriesname,endDate:dataInfo[index].endDate,eventArgs:{timestamp:markerTime,timeText:currMarker.time,tooltipText:[currMarker.tooltext],timeFormatter:currMarker.timeformat,binStart:plotInfo.startDate,binEnd:plotInfo.endDate,binValue:plotInfo.eventArgs.binValue,binValueFormatted:plotInfo.eventArgs.binValueFormatted,measure:currMarker.value,series:seriesName,seriesName:seriesName&&seriesInfo[seriesName],identifier:currMarker.identifier}}}currMarkerObj=markerInfo[index];if(config.isStock){currMarkerObj.openValue=plotInfo.openValue;currMarkerObj.highValue=plotInfo.highValue;currMarkerObj.lowValue=plotInfo.lowValue;currMarkerObj.closeValue=plotInfo.closeValue}else if(config.isRange){currMarkerObj.highValue=plotInfo.highValue;currMarkerObj.lowValue=plotInfo.lowValue}else{currMarkerObj.value=plotInfo.value}currMarkerObj.markers.push(currMarker);if(currMarkerObj.markers.length>1){currMarkerObj.multipleMarkers=true;currMarkerObj.eventArgs.tooltipText.push(currMarker.tooltext);currMarkerObj.eventArgs.identifier=currMarkerObj.markers.length}}}}}))};_proto._createGroup=function _createGroup(){var marker=this;marker.addGraphicalElement({el:"group",container:{label:"group",id:"thermo",isParent:true},component:marker,label:"group",attr:{name:"markerGroup-thermo"}});marker.addGraphicalElement({el:"group",container:{label:"group",id:"thermo",isParent:true},component:marker,label:"group-pin",attr:{name:"markerGroup-thermo-pin"}})};_proto._drawMarkers=function _drawMarkers(){var marker=this,currMarkerObj,index,forceDrawFlag,allPin=true,markerInfo=marker.config.markerInfo,checkIfAllPins=function checkIfAllPins(m){if(m.type!==TYPE_PIN){allPin=false}};for(index in markerInfo){currMarkerObj=markerInfo[index];forceDrawFlag=false;allPin=true;if(currMarkerObj.multipleMarkers){currMarkerObj.markers.forEach(checkIfAllPins);forceDrawFlag=!allPin}if(currMarkerObj.markers[0].type===TYPE_PIN&&!forceDrawFlag){(0,_pinMarkerDrawable.default)(marker,index,markerDimensions)}else{(0,_flagMarkerDrawable.default)(marker,index,markerDimensions)}}marker.styleInfo={}};_proto.getStyleInformation=function getStyleInformation(index){var marker=this,config=marker.config,styleInfo=config.styleInfo,currMarkerObj=config.markerInfo[index],getStyleDef=marker.getFromEnv("getStyleDef"),markerStyle,markerHoverStyle,textStyle,style,currMarker,defaultMarkerStyle=config.defaultMarkerStyle,defaultTextStyle=config.defaultTextStyle,info=marker.getLinkedParent()._getRelevantInfo(index),appliedMarkerStyle,appliedTextStyle,hoveredStyleInfo,baseTextStyle=marker.getFromEnv("baseTextStyle"),textStyles,markerStyles;appliedMarkerStyle={};appliedTextStyle={};hoveredStyleInfo=styleInfo[index]||{};markerHoverStyle=hoveredStyleInfo.marker||{};currMarker=currMarkerObj.markers[0];style=currMarker.style||{};markerStyle=getStyleDef(style.marker);textStyle=getStyleDef(style.text);if(currMarkerObj.multipleMarkers){markerStyles=currMarkerObj.markers.map((function(markerInfo){return markerInfo.style&&getStyleDef(markerInfo.style.marker)||{}}));textStyles=currMarkerObj.markers.map((function(markerInfo){return markerInfo.style&&getStyleDef(markerInfo.style.text)||{}}));markerStyle=getSameProperty(markerStyles);textStyle=getSameProperty(textStyles);if(!markerStyle.fill){markerStyle.fill=currMarkerObj.fill=config["default-stroke-color-multiple"]}if(!markerStyle.stroke){markerStyle.stroke=config["default-stroke-color-multiple"]}}else{if(!markerStyle.fill&&!textStyle.fill&&config.isStock&&info.text){textStyle=Object.assign({},textStyle,info.text)}markerStyle.fill=currMarkerObj.fill=(0,_libGraphics.convertColor)((0,_lib.pluck)(markerStyle.fill,info.fill),(0,_lib.pluck)(markerHoverStyle["fill-opacity"],markerStyle["fill-opacity"],defaultMarkerStyle["fill-opacity"])*100);markerStyle.stroke=currMarkerObj.stroke=(0,_libGraphics.convertColor)((0,_lib.pluck)(markerStyle.stroke,info.stroke,info.fill),(0,_lib.pluck)(markerHoverStyle["stroke-opacity"],markerStyle["stroke-opacity"],defaultMarkerStyle["fill-opacity"])*100)}Object.assign(appliedMarkerStyle,defaultMarkerStyle,markerStyle,hoveredStyleInfo.marker);Object.assign(appliedTextStyle,defaultTextStyle,baseTextStyle,textStyle,hoveredStyleInfo.text);return{marker:appliedMarkerStyle,text:appliedTextStyle}};return DataMarker}(_smartRenderer.default);var _default=exports.default=DataMarker;