text: import{pluckNumber,pluck,toRaphaelColor,getFirstValue}from'../lib/lib';import LineDataset from'./line';import{addDep}from'../dependency-manager';import msStepLineAnimation from'../animation-rules/msStepLine-animation';let UNDEF,LINE='line',H='H',V='V',M='M';addDep({name:'stepLineAnimation',type:'animationRule',extension:msStepLineAnimation});class MSStepLineDataset extends LineDataset{getType(){return'dataset'}getName(){return'stepLine'}__setDefaultConfig(){super.__setDefaultConfig();let a=this.config;a.drawverticaljoins=UNDEF,a.useforwardsteps=UNDEF}_addLegend(){var a,b=this,c=b.config,d=b.getFromEnv('legend'),e=pluckNumber(c.drawanchors,1),f={enabled:c.includeinlegend,type:LINE,drawLine:pluck(c.drawLine,!0),anchorSide:e?c.anchorsides:0,label:getFirstValue(b.config.JSONData.seriesname)};c.includeinlegend?(a=d.getItem(b.config.legendItemId),!a&&(b.config.legendItemId=d.createItem(b),a=d.getItem(b.config.legendItemId),b.addExtEventListener('fc-click',function(){a.itemClickFn()},a)),a.configure(f),a.setStateCosmetics('default',{symbol:{fill:toRaphaelColor({color:c.anchorbgcolor,alpha:c.anchorbgalpha}),rawFillColor:c.anchorbgcolor,rawStrokeColor:c.anchorbordercolor,stroke:toRaphaelColor({color:c.anchorbordercolor,alpha:'100'}),"stroke-width":c.anchorborderthickness}}),b.getState('visible')?a.removeLegendState('hidden'):a.setLegendState('hidden')):b.config.legendItemId&&d.disposeItem(b.config.legendItemId)}getLinePath(a,b){var c,d,e,f,g,h,j,k=this,l=k.config,m=k.getFromEnv('chartConfig'),n=pluckNumber(m.connectnulldata),o={},p=k.getFromEnv('xAxis'),q=pluckNumber(l.drawverticaljoins),r=pluckNumber(l.useforwardsteps),s=pluckNumber(m.stepatmiddle)?.5*p.getPVR():0,t=o.lastValidValue||!1,u=o.temp||[],v=o.temp2||[],w=o.pathArr||[],x=o.path2Arr||[],y=a.length,z=o.pointsJoined||0,A=b&&b.begin||0,B=b&&b.end||y,C=m.viewPortConfig.step||1,D=[];for(D=D.concat(a),d=A;d<B;d+=C)if(h=D[d],!!h){if(e=h.config,j=e.setValue,j===UNDEF||e&&!0===e.isSkipped){e&&delete e.isSkipped;continue}f=e._Px,g=e._Py,null===j||j.isNull?!n&&(u=[],v=[],t=!1):t?(u.length&&(w=w.concat(u),u=[],z++),r?(w.push([H,f-s]),q?w.push([V,g]):w.push([M,f-s,g]),s&&w.push([H,f])):(q?w.push([V,g]):w.push([M,c,g]),w.push([H,f]),c=f)):(u.push([M,f,g]),c=f,z=0,t=!0)}return{pathArr:w,path2Arr:x,lastValidValue:t,pointsJoined:z,temp:u,temp2:v,getPathArr:function(){var a=this,b=a.pathArr,c=a.path2Arr;return b.length||c.length?b.concat(c):[]}}}}export default MSStepLineDataset;