@carbon/charts-react 1.23.16 → 1.23.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.umd.cjs
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
${n.value===void 0||n.value===null?"":`<p class="value"/>${n.value}</p>`}
|
|
61
61
|
</div>
|
|
62
|
-
</li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=y(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=y(n,"tooltip","enabled");if(r){const i=I(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${de}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Gt.LEFT?i.left-=r:n==Gt.RIGHT?i.left+=r:n==Gt.TOP?i.top-=r:n==Gt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Gt.RIGHT,Gt.LEFT,Gt.TOP,Gt.BOTTOM];let d,{horizontalOffset:h}=pp;const{defaultOffset:p}=pp;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let x=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));x=this.addOffsetByPlacement(x,d,p),this.positionService.setElement(s,x);return}let f=y(t,"detail","mousePosition");if(!f)f=er(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=xe.height[m];o&&(f[1]+=v+xe.spacerHeight)}f[0]/r>.9?d=Gt.LEFT:f[0]/r<.1?d=Gt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Gt.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},s,d);this.positionService.setElement(s,g)}}const $g=class _o extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=it.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),s=N.appendOrSelect(i,`g.${this.type}`),a=N.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=N.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const p=N.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===nt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const g=b=>{const S=b[1]-b[0];let M="0,"+S.toString();const D=Math.floor(l/_o.DASH_LENGTH),A=D*_o.DASH_LENGTH;for(let R=0;R<D;R++)M+=","+_o.DASH_LENGTH;M+=","+(l-A),D%2===1&&(M+=",0"),M+=","+S.toString(),M+=","+l.toString(),p.attr("stroke-dasharray",M)},m=b=>{const S=b.selection;S===null||S[0]===S[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(S))},v=(b,S)=>{const M=cf().range([0,o]).domain(f);let D=[M.invert(b),M.invert(S)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==D[0].valueOf()||f[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let x;const _=b=>{const S=b.selection;S!==null&&(v(S[0],S[1]),s.call(x.move,null),p.style("display","none"))};l!=0&&o!=0&&(x=am().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",_),s.call(x));const E=this.services.zoom.getZoomRatio();i.on("click",function(b){if(b.shiftKey){const S=this.services.domUtils.getHolder(),M=er(s.node(),S)[0];let D=M-o*E/2;D<0&&(D=0);let A=M+o*E/2;A>o&&(A=o),v(D,A)}})}}};$g.DASH_LENGTH=4;let CL=$g;class AL extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=it.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=am(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=xe.height[s],{width:l}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=N.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(N.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",xe.spacerHeight).attr("opacity",1).attr("fill","none"),s===Pe.GRAPH_VIEW?N.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Pe.SLIDER_VIEW&&N.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,p=h.getMainXScale(),f=h.getMainYScale(),g=h.getMainXScaleType();if(p&&g===nt.TIME){let m=this.services.zoom.getZoomBarData();if(He(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const x=this.model.get("initialZoomDomain"),_=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");_&&_[0]&&_[1]&&(_[0]=new Date(_[0]),_[1]=new Date(_[1])),_&&!(x&&x[0].valueOf()===_[0].valueOf()&&x[1].valueOf()===_[1].valueOf())?this.model.set({initialZoomDomain:at([],_),zoomDomain:_?at([],_):v},{skipUpdate:!0}):_===null&&x!==null&&this.model.set({initialZoomDomain:null,zoomDomain:at([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ve(m,S=>S.value));const E=this.model.get("zoomDomain");if(s===Pe.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const S=a.highlightStartMapsTo,M=a.highlightEndMapsTo,D=a.color,A=a.labelMapsTo;a.data.forEach((R,$)=>{N.appendOrSelect(d,`rect.highlight-${$}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(R[S])).attr("width",this.xScale(R[M])-this.xScale(R[S])).style("fill",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(E,c,l);const b=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(E!==void 0)if(E[0].valueOf()===E[1].valueOf())b.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const S=E.map(M=>this.xScale(M));S[1]-S[0]<this.MIN_SELECTION_DIFF||(b.call(this.brush.move,S),this.updateBrushHandle(this.getComponentContainer(),S))}i&&(this.brush.filter(()=>!1),b.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=xe.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s],o=-i/2,l=xe.handleBarWidth,c=s===Pe.GRAPH_VIEW?xe.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(p){if(p.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(p.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(p){return"handle-bar handle-bar--"+p.type}),h.attr("x",function(p){if(p.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(p.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Pe.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=xe.height[n],i=this.getComponentContainer().select("svg.zoom-container");N.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,x,_)=>E=>s.getValueFromScale(v,x,_,E),d=u(this.xScale,l,a),h=u(this.yScale,c,o),p=y(this.getOptions(),"zoomBar",z.TOP,"type"),f=xe.height[p],g=tu().x(v=>d(v)).y0(f).y1(v=>f-h(v)),m=N.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=pn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s],o=vs()([[n,a],[r,a]]);N.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),N.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Pe.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class kL extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=it.SVG,this.positionService=new ao}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u?.correspondingDatasets,mapsTo:u?.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===z.LEFT||c===z.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===nt.LABELS,[g,m]=h.range(),[v,x]=p.range(),{cartesianScales:_}=l.services,E=_.getOrientation(),b=R=>_.getDomainValue(R),S=R=>_.getRangeValue(R),[M,D]=xn(b,S,E),A=I(this);c===z.TOP||c===z.BOTTOM?(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",v).attr("x1",({datum:R})=>M(R)+(f?u.step()/2:0)).attr("x2",({datum:R})=>M(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-M(R)).attr("width",Math.abs(v-x)).classed("rotate",!0)):(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",g).attr("x2",m).attr("y1",({datum:R})=>D(R)+(f?u.step()/2:0)).attr("y2",({datum:R})=>D(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:R})=>D(R)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===nt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),p=jl(d.ticks(),y(h,"timeInterval"));return Fl(n,0,d.ticks(),p,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${de}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=er(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Gt.RIGHT,Gt.LEFT,Gt.TOP,Gt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:n,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:n,hoveredElement:I(this),datum:I(this).datum()})})}}class LL extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=it.SVG,this.positionService=new ao,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,g]=d.range(),{cartesianScales:m}=l.services,v=m.getOrientation(),x=M=>m.getDomainValue(M),_=M=>m.getRangeValue(M),[E,b]=xn(x,_,v),S=I(this);c===z.TOP||c===z.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("y",Math.max(g+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:M,...D})=>E(D[M])).attr("width",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(E(A[D])-E(A[M]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null):S.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:M,...D})=>b(D[M])).attr("height",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(b(A[M])-b(A[D]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null)})}}class Mg extends uu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const f=h[p];d=[{label:l,value:u},...Array.isArray(f)&&f.length===2?[{label:"Start",value:f[0]},{label:"End",value:f[1]}]:[{label:c,value:h[p]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:vt(r,"locale.translations.group")||vt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const p=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(p)&&p.length===2?`${p[0]} - ${p[1]}`:p,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:vt(r,"locale.translations.total")||vt(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function Cg(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function DL(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function hu(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function RL(e){return e.depth}function IL(e,t){return t-1-e.height}function Ag(e,t){return e.sourceLinks.length?e.depth:t-1}function oo(e){return function(){return e}}function kg(e,t){return lo(e.source,t.source)||e.index-t.index}function Lg(e,t){return lo(e.target,t.target)||e.index-t.index}function lo(e,t){return e.y0-t.y0}function du(e){return e.value}function NL(e){return e.index}function PL(e){return e.nodes}function UL(e){return e.links}function Dg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Rg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function BL(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=NL,l=Ag,c,u,d=PL,h=UL,p=6;function f(){const O={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(O),m(O),v(O),x(O),b(O),Rg(O),O}f.update=function(O){return Rg(O),O},f.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:oo(O),f):o},f.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:oo(O),f):l},f.nodeSort=function(O){return arguments.length?(c=O,f):c},f.nodeWidth=function(O){return arguments.length?(i=+O,f):i},f.nodePadding=function(O){return arguments.length?(s=a=+O,f):s},f.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:oo(O),f):d},f.links=function(O){return arguments.length?(h=typeof O=="function"?O:oo(O),f):h},f.linkSort=function(O){return arguments.length?(u=O,f):u},f.size=function(O){return arguments.length?(e=t=0,n=+O[0],r=+O[1],f):[n-e,r-t]},f.extent=function(O){return arguments.length?(e=+O[0][0],n=+O[1][0],t=+O[0][1],r=+O[1][1],f):[[e,t],[n,r]]},f.iterations=function(O){return arguments.length?(p=+O,f):p};function g({nodes:O,links:w}){for(const[L,U]of O.entries())U.index=L,U.sourceLinks=[],U.targetLinks=[];const k=new Map(O.map((L,U)=>[o(L,U,O),L]));for(const[L,U]of w.entries()){U.index=L;let{source:K,target:W}=U;typeof K!="object"&&(K=U.source=Dg(k,K)),typeof W!="object"&&(W=U.target=Dg(k,W)),K.sourceLinks.push(U),W.targetLinks.push(U)}if(u!=null)for(const{sourceLinks:L,targetLinks:U}of O)L.sort(u),U.sort(u)}function m({nodes:O}){for(const w of O)w.value=w.fixedValue===void 0?Math.max(hu(w.sourceLinks,du),hu(w.targetLinks,du)):w.fixedValue}function v({nodes:O}){const w=O.length;let k=new Set(O),L=new Set,U=0;for(;k.size;){for(const K of k){K.depth=U;for(const{target:W}of K.sourceLinks)L.add(W)}if(++U>w)throw new Error("circular link");k=L,L=new Set}}function x({nodes:O}){const w=O.length;let k=new Set(O),L=new Set,U=0;for(;k.size;){for(const K of k){K.height=U;for(const{source:W}of K.targetLinks)L.add(W)}if(++U>w)throw new Error("circular link");k=L,L=new Set}}function _({nodes:O}){const w=Cg(O,U=>U.depth)+1,k=(n-e-i)/(w-1),L=new Array(w);for(const U of O){const K=Math.max(0,Math.min(w-1,Math.floor(l.call(null,U,w))));U.layer=K,U.x0=e+K*k,U.x1=U.x0+i,L[K]?L[K].push(U):L[K]=[U]}if(c)for(const U of L)U.sort(c);return L}function E(O){const w=DL(O,k=>(r-t-(k.length-1)*a)/hu(k,du));for(const k of O){let L=t;for(const U of k){U.y0=L,U.y1=L+U.value*w,L=U.y1+a;for(const K of U.sourceLinks)K.width=K.value*w}L=(r-L+a)/(k.length+1);for(let U=0;U<k.length;++U){const K=k[U];K.y0+=L*(U+1),K.y1+=L*(U+1)}H(k)}}function b(O){const w=_(O);a=Math.min(s,(r-t)/(Cg(w,k=>k.length)-1)),E(w);for(let k=0;k<p;++k){const L=Math.pow(.99,k),U=Math.max(1-L,(k+1)/p);M(w,L,U),S(w,L,U)}}function S(O,w,k){for(let L=1,U=O.length;L<U;++L){const K=O[L];for(const W of K){let j=0,X=0;for(const{source:J,value:Y}of W.targetLinks){let et=Y*(W.layer-J.layer);j+=P(J,W)*et,X+=et}if(!(X>0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(lo),D(K,k)}}function M(O,w,k){for(let L=O.length,U=L-2;U>=0;--U){const K=O[U];for(const W of K){let j=0,X=0;for(const{target:J,value:Y}of W.sourceLinks){let et=Y*(J.layer-W.layer);j+=B(W,J)*et,X+=et}if(!(X>0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(lo),D(K,k)}}function D(O,w){const k=O.length>>1,L=O[k];R(O,L.y0-a,k-1,w),A(O,L.y1+a,k+1,w),R(O,r,O.length-1,w),A(O,t,0,w)}function A(O,w,k,L){for(;k<O.length;++k){const U=O[k],K=(w-U.y0)*L;K>1e-6&&(U.y0+=K,U.y1+=K),w=U.y1+a}}function R(O,w,k,L){for(;k>=0;--k){const U=O[k],K=(U.y1-w)*L;K>1e-6&&(U.y0-=K,U.y1-=K),w=U.y0-a}}function $({sourceLinks:O,targetLinks:w}){if(u===void 0){for(const{source:{sourceLinks:k}}of w)k.sort(Lg);for(const{target:{targetLinks:k}}of O)k.sort(kg)}}function H(O){if(u===void 0)for(const{sourceLinks:w,targetLinks:k}of O)w.sort(Lg),k.sort(kg)}function P(O,w){let k=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:L,width:U}of O.sourceLinks){if(L===w)break;k+=U+a}for(const{source:L,width:U}of w.targetLinks){if(L===O)break;k-=U}return k}function B(O,w){let k=w.y0-(w.targetLinks.length-1)*a/2;for(const{source:L,width:U}of w.targetLinks){if(L===O)break;k+=U+a}for(const{target:L,width:U}of O.sourceLinks){if(L===w)break;k-=U}return k}return f}var pu=Math.PI,fu=2*pu,yr=1e-6,HL=fu-yr;function mu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ig(){return new mu}mu.prototype=Ig.prototype={constructor:mu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>yr)if(!(Math.abs(u*o-l*c)>yr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,f=o*o+l*l,g=h*h+p*p,m=Math.sqrt(f),v=Math.sqrt(d),x=i*Math.tan((pu-Math.acos((f+d-g)/(2*m*v)))/2),_=x/v,E=x/m;Math.abs(_-1)>yr&&(this._+="L"+(e+_*c)+","+(t+_*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+E*o)+","+(this._y1=t+E*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>yr||Math.abs(this._y1-c)>yr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%fu+fu),d>HL?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>yr&&(this._+="A"+n+","+n+",0,"+ +(d>=pu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function Ng(e){return function(){return e}}function VL(e){return e[0]}function GL(e){return e[1]}var zL=Array.prototype.slice;function FL(e){return e.source}function jL(e){return e.target}function WL(e){var t=FL,n=jL,r=VL,i=GL,s=null;function a(){var o,l=zL.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Ig()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:Ng(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Ng(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function qL(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function YL(){return WL(qL)}function XL(e){return[e.source.x1,e.y0]}function ZL(e){return[e.target.x0,e.y1]}function KL(){return YL().source(XL).target(ZL)}class QL extends mt{constructor(){super(...arguments),this.type="alluvial",this.renderType=it.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=je.minNodePadding;s.alluvial.nodePadding>je.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Ag;c===Ft.LEFT?u=RL:c===Ft.RIGHT&&(u=IL);const d=BL().nodeId(x=>x.name).nodeWidth(je.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(x=>Object.assign({},x)),links:a.map(x=>Object.assign({},x))}),this.graph.nodes=this.graph.nodes.filter(x=>x.value!==0);const h={};this.graph.nodes.forEach(x=>{const _=x.x0;x.category&&(h[_]=x?.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",x=>`translate(${x}, 0)`).append("text").attr("id",(x,_)=>this.services.domUtils.generateElementIDString(`alluvial-category-${_}`)).style("font-size","14px").text(x=>h[x]?h[x]:"").attr("y",20).attr("x",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-category-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});let S=0;return x+S>=b&&(S=-b+4),S});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const x=y(this.getOptions(),"color","scale");x&&p.enter().append("linearGradient").attr("id",_=>`${this.gradient_id}-link-${_.index}`).attr("gradientUnits","userSpaceOnUse").call(_=>_.append("stop").attr("offset","0%").attr("stop-color",E=>x[E.source.name])).call(_=>_.append("stop").attr("offset","100%").attr("stop-color",E=>x[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",KL()).attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-line-${x.index}`)).attr("class",x=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:x.source.index,originalClassName:"link"})).style("stroke",x=>o?`url(#${this.gradient_id}-link-${x.index})`:this.model.getFillColor(x.source.name,null,{...x,source:x.source.name,target:x.target.name})).attr("stroke-width",x=>Math.max(1,x.width)).style("stroke-opacity",je.opacity.default).attr("aria-label",x=>`${x.source.name} → ${x.target.name} (${x.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-${x.index}`)).classed("node-group",!0).attr("transform",x=>`translate(${x.x0}, ${x.y0})`);f.append("rect").classed("node",!0).attr("height",x=>x.y1-x.y0).attr("width",x=>x.x1-x.x0).attr("fill","black");const g=f.append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${x.index}`)),{code:m,number:v}=y(s,"locale");g.append("text").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${x.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(x=>`${x.name} (${v(x.value,m)})`).attr("aria-label",x=>`${x.name} (${x.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0}),S=(x.y1-x.y0)/2-9;let M=x.x1-x.x0;return x.x1>=b?M=M-(b+16):M+=4,`translate(${M}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=y(this.getOptions(),"locale"),s=va((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",je.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),je.opacity.selected):je.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=va((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",je.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(I(this).classed("link-hovered",!0).raise(),je.opacity.selected):je.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ji(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=ji(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEMOVE,{event:r,element:I(this),datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=ji(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",je.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ji(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
|
|
62
|
+
</li>`).join("")+"</ul>"}isDate(t){return t instanceof Date}valueFormatter(t,n){const r=this.getOptions(),i=y(r,"tooltip","valueFormatter"),{code:s,number:a,date:o}=y(r,"locale");if(i)return i(t,n);if(this.isDate(t))return o(t,s,{month:"short",day:"numeric",year:"numeric"});try{if(typeof t=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(t)){const l=new Date(t);return o(l,s,{month:"short",day:"numeric",year:"numeric"})}}catch{}return a(t,s)}render(t=!1){const n=this.getOptions(),r=y(n,"tooltip","enabled");if(r){const i=I(this.services.domUtils.getHolder()),s=y(n,"style","prefix");this.tooltip=N.appendOrSelect(i,`div.${de}--${s}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!r&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}addOffsetByPlacement(t,n,r){const i=Object.assign({},t);return n==Gt.LEFT?i.left-=r:n==Gt.RIGHT?i.left+=r:n==Gt.TOP?i.top-=r:n==Gt.BOTTOM&&(i.top+=r),i}positionTooltip(t){const n=this.services.domUtils.getHolder(),r=n.offsetWidth,i=n.offsetHeight,s=this.tooltip.node(),a=this.getOptions(),o=y(a,"zoomBar","top","enabled"),l=!!y(t,"detail","noWrap"),c=Array.isArray(y(t,"detail","placements")),u=c?y(t,"detail","placements"):[Gt.RIGHT,Gt.LEFT,Gt.TOP,Gt.BOTTOM];let d,{horizontalOffset:h}=pp;const{defaultOffset:p}=pp;if(this.tooltip.select("div.title-tooltip").classed("title-tooltip-nowrap",l),c){const m=y(t,"detail","event","target"),v=this.services.domUtils.getElementOffset(m,!0);d=this.positionService.findBestPlacementAt(v,s,u,()=>({top:0,left:0,width:r,height:i}));let x=this.positionService.findPosition(m,s,d,()=>this.services.domUtils.getElementOffset(m));x=this.addOffsetByPlacement(x,d,p),this.positionService.setElement(s,x);return}let f=y(t,"detail","mousePosition");if(!f)f=er(y(t,"detail","event"),n);else{const m=y(a,"zoomBar","top","type"),v=xe.height[m];o&&(f[1]+=v+xe.spacerHeight)}f[0]/r>.9?d=Gt.LEFT:f[0]/r<.1?d=Gt.RIGHT:d=this.positionService.findBestPlacementAt({left:f[0],top:f[1]},s,u,()=>({top:void 0,left:void 0,width:r,height:i})),d===Gt.LEFT&&(h*=-1);const g=this.positionService.findPositionAt({left:f[0]+h,top:f[1]},s,d);this.positionService.setElement(s,g)}}const $g=class _o extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=it.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=N.appendOrSelect(n,"svg.chart-grid-backdrop"),s=N.appendOrSelect(i,`g.${this.type}`),a=N.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=N.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const p=N.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===nt.TIME){let f=this.model.get("zoomDomain");f===void 0&&(f=this.services.zoom.getDefaultZoomBarDomain(),f&&this.model.set({zoomDomain:f},{animate:!1}));const g=b=>{const S=b[1]-b[0];let M="0,"+S.toString();const D=Math.floor(l/_o.DASH_LENGTH),A=D*_o.DASH_LENGTH;for(let R=0;R<D;R++)M+=","+_o.DASH_LENGTH;M+=","+(l-A),D%2===1&&(M+=",0"),M+=","+S.toString(),M+=","+l.toString(),p.attr("stroke-dasharray",M)},m=b=>{const S=b.selection;S===null||S[0]===S[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(S))},v=(b,S)=>{const M=cf().range([0,o]).domain(f);let D=[M.invert(b),M.invert(S)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(f[0].valueOf()!==D[0].valueOf()||f[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let x;const _=b=>{const S=b.selection;S!==null&&(v(S[0],S[1]),s.call(x.move,null),p.style("display","none"))};l!=0&&o!=0&&(x=am().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",_),s.call(x));const E=this.services.zoom.getZoomRatio();i.on("click",function(b){if(b.shiftKey){const S=this.services.domUtils.getHolder(),M=er(s.node(),S)[0];let D=M-o*E/2;D<0&&(D=0);let A=M+o*E/2;A>o&&(A=o),v(D,A)}})}}};$g.DASH_LENGTH=4;let CL=$g;class AL extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=it.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=am(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=xe.height[s],{width:l}=N.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=N.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1).attr("role","presentation");if(N.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",xe.spacerHeight).attr("opacity",1).attr("fill","none"),s===Pe.GRAPH_VIEW?N.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Pe.SLIDER_VIEW&&N.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,p=h.getMainXScale(),f=h.getMainYScale(),g=h.getMainXScaleType();if(p&&g===nt.TIME){let m=this.services.zoom.getZoomBarData();if(He(m)||m.length===1)return;this.xScale=p.copy(),this.yScale=f.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const x=this.model.get("initialZoomDomain"),_=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");_&&_[0]&&_[1]&&(_[0]=new Date(_[0]),_[1]=new Date(_[1])),_&&!(x&&x[0].valueOf()===_[0].valueOf()&&x[1].valueOf()===_[1].valueOf())?this.model.set({initialZoomDomain:at([],_),zoomDomain:_?at([],_):v},{skipUpdate:!0}):_===null&&x!==null&&this.model.set({initialZoomDomain:null,zoomDomain:at([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Ve(m,S=>S.value));const E=this.model.get("zoomDomain");if(s===Pe.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const S=a.highlightStartMapsTo,M=a.highlightEndMapsTo,D=a.color,A=a.labelMapsTo;a.data.forEach((R,$)=>{N.appendOrSelect(d,`rect.highlight-${$}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(R[S])).attr("width",this.xScale(R[M])-this.xScale(R[S])).style("fill",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[R[A]]?D.scale[R[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(E,c,l);const b=N.appendOrSelect(n,this.brushSelector).call(this.brush);if(E!==void 0)if(E[0].valueOf()===E[1].valueOf())b.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const S=E.map(M=>this.xScale(M));S[1]-S[0]<this.MIN_SELECTION_DIFF||(b.call(this.brush.move,S),this.updateBrushHandle(this.getComponentContainer(),S))}i&&(this.brush.filter(()=>!1),b.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=xe.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s],o=-i/2,l=xe.handleBarWidth,c=s===Pe.GRAPH_VIEW?xe.handleBarHeight:6,u=-l/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(p){if(p.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(p.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(p){return"handle-bar handle-bar--"+p.type}),h.attr("x",function(p){if(p.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(p.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Pe.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=xe.height[n],i=this.getComponentContainer().select("svg.zoom-container");N.appendOrSelect(i,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,x,_)=>E=>s.getValueFromScale(v,x,_,E),d=u(this.xScale,l,a),h=u(this.yScale,c,o),p=y(this.getOptions(),"zoomBar",z.TOP,"type"),f=xe.height[p],g=tu().x(v=>d(v)).y0(f).y1(v=>f-h(v)),m=N.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=N.appendOrSelect(t,"clipPath").attr("id",n);N.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=pn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=xe.height[s],o=vs()([[n,a],[r,a]]);N.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),N.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Pe.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class kL extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=it.SVG,this.positionService=new ao}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.thresholds&&u.thresholds.length>0&&r.push({axisPosition:c,thresholds:u.thresholds,correspondingDatasets:u?.correspondingDatasets,mapsTo:u?.mapsTo})}});const i=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-thresholds ${c.axisPosition}`);const a=s.selectAll("g.threshold-group").data(c=>c.thresholds.map(u=>(u.axisPosition=c.axisPosition,u.datum=this.constructDatumObj(c,u),u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(a).attr("class","threshold-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getScaleByPosition(c),d=l.services.cartesianScales.getScaleTypeByPosition(c);let h=null,p=null;c===z.LEFT||c===z.RIGHT?(p=u,h=l.services.cartesianScales.getMainXScale()):(h=u,p=l.services.cartesianScales.getMainYScale());const f=d===nt.LABELS,[g,m]=h.range(),[v,x]=p.range(),{cartesianScales:_}=l.services,E=_.getOrientation(),b=R=>_.getDomainValue(R),S=R=>_.getRangeValue(R),[M,D]=xn(b,S,E),A=I(this);c===z.TOP||c===z.BOTTOM?(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",v).attr("x1",({datum:R})=>M(R)+(f?u.step()/2:0)).attr("x2",({datum:R})=>M(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:R})=>-M(R)).attr("width",Math.abs(v-x)).classed("rotate",!0)):(A.selectAll("line.threshold-line").transition().call(R=>l.services.transitions.setupTransition({transition:R,name:"threshold-line-update",animate:t})).attr("x1",g).attr("x2",m).attr("y1",({datum:R})=>D(R)+(f?u.step()/2:0)).attr("y2",({datum:R})=>D(R)+(f?u.step()/2:0)).style("stroke",({fillColor:R})=>R),A.selectAll("rect.threshold-hoverable-area").attr("x",g).attr("y",({datum:R})=>D(R)).attr("width",Math.abs(m-g)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,c=>{this.setThresholdLabelPosition(c.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===nt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),p=jl(d.ticks(),y(h,"timeInterval"));return Fl(n,0,d.ticks(),p,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=N.appendOrSelect(t,`div.${de}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=er(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Gt.RIGHT,Gt.LEFT,Gt.TOP,Gt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:n,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(n){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:n,hoveredElement:I(this),datum:I(this).datum()})})}}class LL extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=it.SVG,this.positionService=new ao,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(c=>{if(Object.values(z).includes(c)){const u=n[c];u.highlights&&u.highlights.data.length>0&&r.push({axisPosition:c,highlightStartMapsTo:u.highlights.highlightStartMapsTo,highlightEndMapsTo:u.highlights.highlightEndMapsTo,labelMapsTo:u.highlights.labelMapsTo,highlight:u.highlights.data,color:u.highlights.color})}});const i=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,c=>c.axisPosition);i.exit().attr("opacity",0).remove();const s=i.enter().append("g").merge(i);s.attr("class",c=>`axis-highlight ${c.axisPosition}`);const a=s.selectAll("g.highlight-group").data(c=>c.highlight.map(u=>(u.axisPosition=c.axisPosition,u.highlightStartMapsTo=c.highlightStartMapsTo,u.labelMapsTo=c.labelMapsTo,u.color=c.color,u.highlightEndMapsTo=c.highlightEndMapsTo,u)));a.exit().attr("opacity",0).remove();const o=a.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(a).attr("class","highlight-group");const l=this;s.each(function({axisPosition:c}){const u=l.services.cartesianScales.getMainXScale(),d=l.services.cartesianScales.getMainYScale(),[h,p]=u.range(),[f,g]=d.range(),{cartesianScales:m}=l.services,v=m.getOrientation(),x=M=>m.getDomainValue(M),_=M=>m.getRangeValue(M),[E,b]=xn(x,_,v),S=I(this);c===z.TOP||c===z.BOTTOM?S.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("y",Math.max(g+l.highlightStrokeWidth,0)).attr("height",Math.max(f-2*l.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:M,...D})=>E(D[M])).attr("width",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(E(A[D])-E(A[M]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null):S.selectAll("rect.highlight-bar").transition().call(M=>l.services.transitions.setupTransition({transition:M,name:"highlight-bar-update",animate:t})).attr("x",h).attr("width",Math.max(p-h,0)).attr("y",({highlightEndMapsTo:M,...D})=>b(D[M])).attr("height",({highlightStartMapsTo:M,highlightEndMapsTo:D,...A})=>Math.max(b(A[M])-b(A[D]),0)).style("stroke",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",l.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:M,labelMapsTo:D,...A})=>M&&M.scale[A[D]]?M.scale[A[D]]:null)})}}class Mg extends uu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],p=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const f=h[p];d=[{label:l,value:u},...Array.isArray(f)&&f.length===2?[{label:"Start",value:f[0]},{label:"End",value:f[1]}]:[{label:c,value:h[p]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:vt(r,"locale.translations.group")||vt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const p=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(p)&&p.length===2?`${p[0]} - ${p[1]}`:p,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[st.TOOLTIP],dataGroupName:h[o]})}}).sort((h,p)=>p.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:vt(r,"locale.translations.total")||vt(r,"tooltip.totalLabel")||"Total",value:n.reduce((p,f)=>p+f[h],0),bold:!0})}return d}}function Cg(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function DL(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function hu(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function RL(e){return e.depth}function IL(e,t){return t-1-e.height}function Ag(e,t){return e.sourceLinks.length?e.depth:t-1}function oo(e){return function(){return e}}function kg(e,t){return lo(e.source,t.source)||e.index-t.index}function Lg(e,t){return lo(e.target,t.target)||e.index-t.index}function lo(e,t){return e.y0-t.y0}function du(e){return e.value}function NL(e){return e.index}function PL(e){return e.nodes}function UL(e){return e.links}function Dg(e,t){const n=e.get(t);if(!n)throw new Error("missing: "+t);return n}function Rg({nodes:e}){for(const t of e){let n=t.y0,r=n;for(const i of t.sourceLinks)i.y0=n+i.width/2,n+=i.width;for(const i of t.targetLinks)i.y1=r+i.width/2,r+=i.width}}function BL(){let e=0,t=0,n=1,r=1,i=24,s=8,a,o=NL,l=Ag,c,u,d=PL,h=UL,p=6;function f(){const O={nodes:d.apply(null,arguments),links:h.apply(null,arguments)};return g(O),m(O),v(O),x(O),b(O),Rg(O),O}f.update=function(O){return Rg(O),O},f.nodeId=function(O){return arguments.length?(o=typeof O=="function"?O:oo(O),f):o},f.nodeAlign=function(O){return arguments.length?(l=typeof O=="function"?O:oo(O),f):l},f.nodeSort=function(O){return arguments.length?(c=O,f):c},f.nodeWidth=function(O){return arguments.length?(i=+O,f):i},f.nodePadding=function(O){return arguments.length?(s=a=+O,f):s},f.nodes=function(O){return arguments.length?(d=typeof O=="function"?O:oo(O),f):d},f.links=function(O){return arguments.length?(h=typeof O=="function"?O:oo(O),f):h},f.linkSort=function(O){return arguments.length?(u=O,f):u},f.size=function(O){return arguments.length?(e=t=0,n=+O[0],r=+O[1],f):[n-e,r-t]},f.extent=function(O){return arguments.length?(e=+O[0][0],n=+O[1][0],t=+O[0][1],r=+O[1][1],f):[[e,t],[n,r]]},f.iterations=function(O){return arguments.length?(p=+O,f):p};function g({nodes:O,links:w}){for(const[L,U]of O.entries())U.index=L,U.sourceLinks=[],U.targetLinks=[];const k=new Map(O.map((L,U)=>[o(L,U,O),L]));for(const[L,U]of w.entries()){U.index=L;let{source:K,target:W}=U;typeof K!="object"&&(K=U.source=Dg(k,K)),typeof W!="object"&&(W=U.target=Dg(k,W)),K.sourceLinks.push(U),W.targetLinks.push(U)}if(u!=null)for(const{sourceLinks:L,targetLinks:U}of O)L.sort(u),U.sort(u)}function m({nodes:O}){for(const w of O)w.value=w.fixedValue===void 0?Math.max(hu(w.sourceLinks,du),hu(w.targetLinks,du)):w.fixedValue}function v({nodes:O}){const w=O.length;let k=new Set(O),L=new Set,U=0;for(;k.size;){for(const K of k){K.depth=U;for(const{target:W}of K.sourceLinks)L.add(W)}if(++U>w)throw new Error("circular link");k=L,L=new Set}}function x({nodes:O}){const w=O.length;let k=new Set(O),L=new Set,U=0;for(;k.size;){for(const K of k){K.height=U;for(const{source:W}of K.targetLinks)L.add(W)}if(++U>w)throw new Error("circular link");k=L,L=new Set}}function _({nodes:O}){const w=Cg(O,U=>U.depth)+1,k=(n-e-i)/(w-1),L=new Array(w);for(const U of O){const K=Math.max(0,Math.min(w-1,Math.floor(l.call(null,U,w))));U.layer=K,U.x0=e+K*k,U.x1=U.x0+i,L[K]?L[K].push(U):L[K]=[U]}if(c)for(const U of L)U.sort(c);return L}function E(O){const w=DL(O,k=>(r-t-(k.length-1)*a)/hu(k,du));for(const k of O){let L=t;for(const U of k){U.y0=L,U.y1=L+U.value*w,L=U.y1+a;for(const K of U.sourceLinks)K.width=K.value*w}L=(r-L+a)/(k.length+1);for(let U=0;U<k.length;++U){const K=k[U];K.y0+=L*(U+1),K.y1+=L*(U+1)}H(k)}}function b(O){const w=_(O);a=Math.min(s,(r-t)/(Cg(w,k=>k.length)-1)),E(w);for(let k=0;k<p;++k){const L=Math.pow(.99,k),U=Math.max(1-L,(k+1)/p);M(w,L,U),S(w,L,U)}}function S(O,w,k){for(let L=1,U=O.length;L<U;++L){const K=O[L];for(const W of K){let j=0,X=0;for(const{source:J,value:Y}of W.targetLinks){let et=Y*(W.layer-J.layer);j+=P(J,W)*et,X+=et}if(!(X>0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(lo),D(K,k)}}function M(O,w,k){for(let L=O.length,U=L-2;U>=0;--U){const K=O[U];for(const W of K){let j=0,X=0;for(const{target:J,value:Y}of W.sourceLinks){let et=Y*(J.layer-W.layer);j+=B(W,J)*et,X+=et}if(!(X>0))continue;let ct=(j/X-W.y0)*w;W.y0+=ct,W.y1+=ct,$(W)}c===void 0&&K.sort(lo),D(K,k)}}function D(O,w){const k=O.length>>1,L=O[k];R(O,L.y0-a,k-1,w),A(O,L.y1+a,k+1,w),R(O,r,O.length-1,w),A(O,t,0,w)}function A(O,w,k,L){for(;k<O.length;++k){const U=O[k],K=(w-U.y0)*L;K>1e-6&&(U.y0+=K,U.y1+=K),w=U.y1+a}}function R(O,w,k,L){for(;k>=0;--k){const U=O[k],K=(U.y1-w)*L;K>1e-6&&(U.y0-=K,U.y1-=K),w=U.y0-a}}function $({sourceLinks:O,targetLinks:w}){if(u===void 0){for(const{source:{sourceLinks:k}}of w)k.sort(Lg);for(const{target:{targetLinks:k}}of O)k.sort(kg)}}function H(O){if(u===void 0)for(const{sourceLinks:w,targetLinks:k}of O)w.sort(Lg),k.sort(kg)}function P(O,w){let k=O.y0-(O.sourceLinks.length-1)*a/2;for(const{target:L,width:U}of O.sourceLinks){if(L===w)break;k+=U+a}for(const{source:L,width:U}of w.targetLinks){if(L===O)break;k-=U}return k}function B(O,w){let k=w.y0-(w.targetLinks.length-1)*a/2;for(const{source:L,width:U}of w.targetLinks){if(L===O)break;k+=U+a}for(const{target:L,width:U}of O.sourceLinks){if(L===w)break;k-=U}return k}return f}var pu=Math.PI,fu=2*pu,yr=1e-6,HL=fu-yr;function mu(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ig(){return new mu}mu.prototype=Ig.prototype={constructor:mu,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+s)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var s=this._x1,a=this._y1,o=n-e,l=r-t,c=s-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>yr)if(!(Math.abs(u*o-l*c)>yr)||!i)this._+="L"+(this._x1=e)+","+(this._y1=t);else{var h=n-s,p=r-a,f=o*o+l*l,g=h*h+p*p,m=Math.sqrt(f),v=Math.sqrt(d),x=i*Math.tan((pu-Math.acos((f+d-g)/(2*m*v)))/2),_=x/v,E=x/m;Math.abs(_-1)>yr&&(this._+="L"+(e+_*c)+","+(t+_*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*p)+","+(this._x1=e+E*o)+","+(this._y1=t+E*l)}},arc:function(e,t,n,r,i,s){e=+e,t=+t,n=+n,s=!!s;var a=n*Math.cos(r),o=n*Math.sin(r),l=e+a,c=t+o,u=1^s,d=s?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);this._x1===null?this._+="M"+l+","+c:(Math.abs(this._x1-l)>yr||Math.abs(this._y1-c)>yr)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%fu+fu),d>HL?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-o)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>yr&&(this._+="A"+n+","+n+",0,"+ +(d>=pu)+","+u+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};function Ng(e){return function(){return e}}function VL(e){return e[0]}function GL(e){return e[1]}var zL=Array.prototype.slice;function FL(e){return e.source}function jL(e){return e.target}function WL(e){var t=FL,n=jL,r=VL,i=GL,s=null;function a(){var o,l=zL.call(arguments),c=t.apply(this,l),u=n.apply(this,l);if(s||(s=o=Ig()),e(s,+r.apply(this,(l[0]=c,l)),+i.apply(this,l),+r.apply(this,(l[0]=u,l)),+i.apply(this,l)),o)return s=null,o+""||null}return a.source=function(o){return arguments.length?(t=o,a):t},a.target=function(o){return arguments.length?(n=o,a):n},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:Ng(+o),a):r},a.y=function(o){return arguments.length?(i=typeof o=="function"?o:Ng(+o),a):i},a.context=function(o){return arguments.length?(s=o??null,a):s},a}function qL(e,t,n,r,i){e.moveTo(t,n),e.bezierCurveTo(t=(t+r)/2,n,t,i,r,i)}function YL(){return WL(qL)}function XL(e){return[e.source.x1,e.y0]}function ZL(e){return[e.target.x0,e.y1]}function KL(){return YL().source(XL).target(ZL)}class QL extends mt{constructor(){super(...arguments),this.type="alluvial",this.renderType=it.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"alluvial graphs",withinChartClip:!0});n.html("");const{width:r,height:i}=N.getSVGElementSize(n,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(this.getOptions(),"color","gradient","enabled");let l=je.minNodePadding;s.alluvial.nodePadding>je.minNodePadding&&(l=s.alluvial.nodePadding);const c=y(s,"alluvial","nodeAlignment");let u=Ag;c===Ft.LEFT?u=RL:c===Ft.RIGHT&&(u=IL);const d=BL().nodeId(x=>x.name).nodeWidth(je.nodeWidth).nodePadding(l).nodeAlign(u).extent([[2,30],[r-2,i]]);this.graph=d({nodes:s.alluvial.nodes.map(x=>Object.assign({},x)),links:a.map(x=>Object.assign({},x))}),this.graph.nodes=this.graph.nodes.filter(x=>x.value!==0);const h={};this.graph.nodes.forEach(x=>{const _=x.x0;x.category&&(h[_]=x?.category)}),n.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(h)).join("g").attr("transform",x=>`translate(${x}, 0)`).append("text").attr("id",(x,_)=>this.services.domUtils.generateElementIDString(`alluvial-category-${_}`)).style("font-size","14px").text(x=>h[x]?h[x]:"").attr("y",20).attr("x",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-category-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});let S=0;return x+S>=b&&(S=-b+4),S});const p=n.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(p.exit().remove(),o){const x=y(this.getOptions(),"color","scale");x&&p.enter().append("linearGradient").attr("id",_=>`${this.gradient_id}-link-${_.index}`).attr("gradientUnits","userSpaceOnUse").call(_=>_.append("stop").attr("offset","0%").attr("stop-color",E=>x[E.source.name])).call(_=>_.append("stop").attr("offset","100%").attr("stop-color",E=>x[E.target.name])),p.exit().remove()}p.enter().append("path").classed("link",!0).attr("d",KL()).attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-line-${x.index}`)).attr("class",x=>s.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[st.STROKE],dataGroupName:x.source.index,originalClassName:"link"})).style("stroke",x=>o?`url(#${this.gradient_id}-link-${x.index})`:this.model.getFillColor(x.source.name,null,{...x,source:x.source.name,target:x.target.name})).attr("stroke-width",x=>Math.max(1,x.width)).style("stroke-opacity",je.opacity.default).attr("aria-label",x=>`${x.source.name} → ${x.target.name} (${x.value}${s.alluvial.units?" "+s.alluvial.units:""})`);const f=n.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-${x.index}`)).classed("node-group",!0).attr("transform",x=>`translate(${x.x0}, ${x.y0})`);f.append("rect").classed("node",!0).attr("height",x=>x.y1-x.y0).attr("width",x=>x.x1-x.x0).attr("fill","black");const g=f.append("g").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${x.index}`)),{code:m,number:v}=y(s,"locale");g.append("text").attr("id",x=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${x.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(x=>`${x.name} (${v(x.value,m)})`).attr("aria-label",x=>`${x.name} (${x.value})`),g.append("rect").classed("node-text-bg",!0).attr("width",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0});return b+8}).attr("height",18).attr("stroke-width",2).lower(),g.attr("transform",(x,_)=>{const E=this.services.domUtils.generateElementIDString(`alluvial-node-text-${_}`),{width:b}=N.getSVGElementSize(I(`text#${E}`),{useBBox:!0}),S=(x.y1-x.y0)/2-9;let M=x.x1-x.x0;return x.x1>=b?M=M-(b+16):M+=4,`translate(${M}, ${S})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const t=this.getOptions(),n=this,{number:r,code:i}=y(this.getOptions(),"locale"),s=va((a,o="mouseover")=>{const l=n.parent.selectAll("path.link").transition().call(c=>n.services.transitions.setupTransition({transition:c,name:"alluvial-links-mouse-highlight"}));o==="mouseout"?(I(a).lower(),l.style("stroke-opacity",je.opacity.default)):l.style("stroke-opacity",function(){return a===this?(I(this).raise(),je.opacity.selected):je.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(a,o){const l=I(this);s(this,"mouseover"),l.classed("link-hovered",!0);const c=getComputedStyle(this).getPropertyValue("stroke");n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOVER,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:o.target.name,value:(r(o.value,i)?`${r(o.value,i)}`:"-")+(t.alluvial.units?` ${t.alluvial.units}`:""),color:c,labelIcon:n.getRightArrowIcon()}]})}).on("mousemove",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEMOVE,{event:a,element:I(this),datum:o}),n.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("click",function(a,o){n.services.events.dispatchEvent(T.Alluvial.LINE_CLICK,{event:a,element:I(this),datum:o})}).on("mouseout",function(a,o){const l=I(this);s(this,"mouseout"),l.classed("link-hovered",!1),n.services.events.dispatchEvent(T.Alluvial.LINE_MOUSEOUT,{event:a,element:l,datum:o}),n.services.events.dispatchEvent(T.Tooltip.HIDE,{event:a,hoveredElement:l})})}addNodeEventListener(){const t=this,n=va((r=[],i="mouseover")=>{if(i==="mouseout"||r.length===0){t.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,s=>s.index).order().style("stroke-opacity",je.opacity.default);return}t.parent.selectAll("path.link").transition().call(s=>this.services.transitions.setupTransition({transition:s,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(s){return r.some(a=>a===s.index)?(I(this).classed("link-hovered",!0).raise(),je.opacity.selected):je.opacity.unfocus})},66);t.parent.selectAll(".node-group").on("mouseover",function(r,i){const s=I(this),a=[];if(t.traverse({link:"sourceLinks",node:"target"},i,a),t.traverse({link:"targetLinks",node:"source"},i,a),a.length){const o=ji(s.attr("transform"));if(s.attr("transform",`translate(${o.x-2}, ${o.y})`),s.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),i.x0-2===0){const c=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),u=t.parent.select(`g#${c}`),d=ji(u.attr("transform"));u.attr("transform",`translate(${d.x+4},${d.y})`)}const l=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${l}`).style("font-weight","bold"),n(a,"mouseover"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOVER,{event:r,element:s,datum:i})}}).on("mousemove",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEMOVE,{event:r,element:I(this),datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Alluvial.NODE_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=ji(s.attr("transform"));if(s.classed("node-hovered",!1).attr("transform",`translate(${a.x+2}, ${a.y})`).select("rect.node").attr("width",je.nodeWidth),i.x0-2===0){const l=t.services.domUtils.generateElementIDString(`alluvial-node-title-${i.index}`),c=t.parent.select(`g#${l}`),u=ji(c.attr("transform"));c.attr("transform",`translate(${u.x-4},${u.y})`)}const o=t.services.domUtils.generateElementIDString(`alluvial-node-text-${i.index}`);t.parent.select(`text#${o}`).style("font-weight","normal"),n([],"mouseout"),t.services.events.dispatchEvent(T.Alluvial.NODE_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}traverse(t,n,r=[]){n[t.link].map(i=>(r.push(i.index),i[t.node])).forEach(i=>this.traverse(t,i,r))}getRightArrowIcon(){return`
|
|
63
63
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
64
64
|
<polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
|
|
65
65
|
<rect width="32" height="32"/>
|