Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nivo/chord

Package Overview
Dependencies
Maintainers
2
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nivo/chord - npm Package Compare versions

Comparing version 0.81.0 to 0.82.0

./dist/nivo-chord.cjs.js

2

dist/nivo-chord.cjs.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@nivo/core"),o=require("@nivo/legends"),t=require("@nivo/tooltip"),n=require("react/jsx-runtime"),i=require("@nivo/colors"),a=require("@react-spring/web"),l=require("d3-shape"),c=require("d3-chord"),s=require("@nivo/arcs");function u(){return u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},u.apply(this,arguments)}function d(e,r){if(null==e)return{};var o,t,n={},i=Object.keys(e);for(t=0;t<i.length;t++)o=i[t],r.indexOf(o)>=0||(n[o]=e[o]);return n}var b=e.memo((function(e){var r=e.arc;return n.jsx(t.BasicTooltip,{id:r.label,value:r.formattedValue,color:r.color,enableChip:!0})})),v=e.memo((function(e){var r=e.ribbon;return n.jsx(t.TableTooltip,{rows:[[n.jsx(t.Chip,{color:r.source.color},"chip"),n.jsx("strong",{children:r.source.label},"id"),r.source.formattedValue],[n.jsx(t.Chip,{color:r.target.color},"chip"),n.jsx("strong",{children:r.target.label},"id"),r.target.formattedValue]]})})),f={layers:["ribbons","arcs","labels","legends"],padAngle:0,innerRadiusRatio:.9,innerRadiusOffset:0,colors:{scheme:"nivo"},arcOpacity:1,activeArcOpacity:1,inactiveArcOpacity:.15,arcBorderWidth:1,arcBorderColor:{from:"color",modifiers:[["darker",.4]]},arcTooltip:b,ribbonOpacity:.5,activeRibbonOpacity:.85,inactiveRibbonOpacity:.15,ribbonBorderWidth:1,ribbonBorderColor:{from:"color",modifiers:[["darker",.4]]},ribbonBlendMode:"normal",enableLabel:!0,label:"id",labelOffset:12,labelRotation:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,legends:[],animate:!0,motionConfig:"gentle",role:"img"},p=u({},f,{ribbonBlendMode:"normal",ribbonTooltip:v}),g=u({},f,{pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1}),h=function(e){var r=e.padAngle;return c.chord().padAngle(r)},m=function(e){var r=e.width,o=e.height,t=e.innerRadiusRatio,n=e.innerRadiusOffset,i=[r/2,o/2],a=Math.min(r,o)/2,s=a*t,u=a*(t-n);return{center:i,radius:a,innerRadius:s,arcGenerator:l.arc().outerRadius(a).innerRadius(s),ribbonGenerator:c.ribbon().radius(u)}},y=function(e){var r=e.chord,o=e.data,t=e.keys,n=e.getLabel,i=e.formatValue,a=e.getColor,l=r(o);return{arcs:l.groups.map((function(e){var r=u({},e,{id:t[e.index],formattedValue:i(e.value)});return u({},r,{label:n(r),color:a(r)})})),ribbons:l.map((function(e){var r=u({},e.source,{id:t[e.source.index],formattedValue:i(e.source.value)}),o=u({},e.target,{id:t[e.target.index],formattedValue:i(e.target.value)});return u({},e,{id:[r.id,o.id].sort().join("."),source:u({},r,{label:n(r),color:a(r)}),target:u({},o,{label:n(o),color:a(o)})})}))}},A=function(e){var r=e.startAngle,o=e.endAngle,t=e.arcGenerator;return a.to([r,o],(function(e,r){return t({startAngle:e,endAngle:r})}))},C=function(e){var r=e.sourceStartAngle,o=e.sourceEndAngle,t=e.targetStartAngle,n=e.targetEndAngle,i=e.ribbonGenerator;return a.to([r,o,t,n],(function(e,r,o,t){return i({source:{startAngle:Math.min(e,r),endAngle:Math.max(r,e)},target:{startAngle:Math.min(o,t),endAngle:Math.max(t,o)}})}))},R=function(r){var o=r.padAngle;return e.useMemo((function(){return h({padAngle:o})}),[o])},x=function(r){var o=r.width,t=r.height,n=r.innerRadiusRatio,i=r.innerRadiusOffset;return e.useMemo((function(){return m({width:o,height:t,innerRadiusRatio:n,innerRadiusOffset:i})}),[o,t,n,i])},M=function(r){var o=r.chord,t=r.getColor,n=r.keys,i=r.data,a=r.getLabel,l=r.formatValue;return e.useMemo((function(){return y({chord:o,data:i,keys:n,getLabel:a,formatValue:l,getColor:t})}),[o,t,n,i,a,l])},O=function(o){var t=o.data,n=o.keys,a=o.label,l=void 0===a?f.label:a,c=o.valueFormat,s=o.width,u=o.height,d=o.innerRadiusRatio,b=void 0===d?f.innerRadiusRatio:d,v=o.innerRadiusOffset,p=void 0===v?f.innerRadiusOffset:v,g=o.padAngle,h=void 0===g?f.padAngle:g,m=o.colors,y=void 0===m?f.colors:m,A=R({padAngle:h}),C=x({width:s,height:u,innerRadiusRatio:b,innerRadiusOffset:p}),O=C.center,E=C.radius,k=C.innerRadius,j=C.arcGenerator,I=C.ribbonGenerator,W=e.useMemo((function(){return r.getLabelGenerator(l)}),[l]),B=r.useValueFormatter(c),L=i.useOrdinalColorScale(y,"id"),T=M({chord:A,getColor:L,keys:n,data:t,getLabel:W,formatValue:B});return{center:O,chord:A,radius:E,innerRadius:k,arcGenerator:j,ribbonGenerator:I,getColor:L,arcs:T.arcs,ribbons:T.ribbons}},E=function(r){var o=r.arcOpacity,t=void 0===o?f.arcOpacity:o,n=r.activeArcOpacity,i=void 0===n?f.activeArcOpacity:n,a=r.inactiveArcOpacity,l=void 0===a?f.inactiveArcOpacity:a,c=r.ribbons,s=r.ribbonOpacity,d=void 0===s?f.ribbonOpacity:s,b=r.activeRibbonOpacity,v=void 0===b?f.activeRibbonOpacity:b,p=r.inactiveRibbonOpacity,g=void 0===p?f.inactiveRibbonOpacity:p,h=e.useState(null),m=h[0],y=h[1],A=e.useState(null),C=A[0],R=A[1],x=e.useMemo((function(){var e=[],r=[];return m&&(e.push(m.id),c.filter((function(e){return e.source.id===m.id||e.target.id===m.id})).forEach((function(e){r.push(e.id)}))),C&&(e.push(C.source.id),e.push(C.target.id),r.push(C.id)),{selectedArcIds:e,selectedRibbonIds:r}}),[m,C,c]),M=x.selectedArcIds.length>1||x.selectedRibbonIds.length>0,O=e.useMemo((function(){return function(e){return M?x.selectedArcIds.includes(e.id)?i:l:t}}),[M,x.selectedArcIds,t,i,l]),E=e.useMemo((function(){return function(e){return M?x.selectedRibbonIds.includes(e.id)?v:g:d}}),[M,x.selectedRibbonIds,d,v,g]);return u({currentArc:m,setCurrentArc:y,currentRibbon:C,setCurrentRibbon:R,hasSelection:M},x,{getArcOpacity:O,getRibbonOpacity:E})},k=function(r){var o=r.center,t=r.radius,n=r.arcs,i=r.arcGenerator,a=r.ribbons,l=r.ribbonGenerator;return e.useMemo((function(){return{center:o,radius:t,arcs:n,arcGenerator:i,ribbons:a,ribbonGenerator:l}}),[o,t,n,i,a,l])},j=e.memo((function(r){var o=r.ribbon,i=r.ribbonGenerator,l=r.animatedProps,c=r.borderWidth,s=r.blendMode,u=r.isInteractive,d=r.setCurrent,b=r.onMouseEnter,v=r.onMouseMove,f=r.onMouseLeave,p=r.onClick,g=r.tooltip,h=t.useTooltip(),m=h.showTooltipFromEvent,y=h.hideTooltip,A=e.useMemo((function(){if(u)return function(r){d(o),m(e.createElement(g,{ribbon:o}),r),null==b||b(o,r)}}),[u,m,g,o,b,d]),R=e.useMemo((function(){if(u)return function(r){m(e.createElement(g,{ribbon:o}),r),null==v||v(o,r)}}),[u,m,g,o,v]),x=e.useMemo((function(){if(u)return function(e){d(null),y(),null==f||f(o,e)}}),[u,y,o,f,d]),M=e.useMemo((function(){if(u&&p)return function(e){return null==p?void 0:p(o,e)}}),[u,o,p]);return n.jsx(a.animated.path,{"data-testid":"ribbon."+o.source.id+"."+o.target.id,d:C({sourceStartAngle:l.sourceStartAngle,sourceEndAngle:l.sourceEndAngle,targetStartAngle:l.targetStartAngle,targetEndAngle:l.targetEndAngle,ribbonGenerator:i}),fill:l.color,opacity:l.opacity,strokeWidth:c,stroke:l.borderColor,style:{mixBlendMode:s},onMouseEnter:A,onMouseMove:R,onMouseLeave:x,onClick:M})})),I=function(e,o){var t,n,i=e.source,a=e.target;if(i.startAngle<a.startAngle?(t=i,n=a):(t=a,n=i),o){var l=r.midAngle(t),c=r.midAngle(n);return{sourceStartAngle:l,sourceEndAngle:l,targetStartAngle:c,targetEndAngle:c}}return{sourceStartAngle:t.startAngle,sourceEndAngle:t.endAngle,targetStartAngle:n.startAngle,targetEndAngle:n.endAngle}},W=e.memo((function(e){var o=e.ribbons,t=e.ribbonGenerator,l=e.borderWidth,c=e.borderColor,s=e.getOpacity,d=e.blendMode,b=e.isInteractive,v=e.setCurrent,f=e.onMouseEnter,p=e.onMouseMove,g=e.onMouseLeave,h=e.onClick,m=e.tooltip,y=r.useMotionConfig(),A=y.animate,C=y.config,R=r.useTheme(),x=i.useInheritedColor(c,R),M=a.useTransition(o,{keys:function(e){return e.id},initial:function(e){return u({},I(e,!1),{color:e.source.color,opacity:s(e),borderColor:x(e.source)})},from:function(e){return u({},I(e,!1),{color:e.source.color,opacity:0,borderColor:x(e.source)})},update:function(e){return u({},I(e,!1),{color:e.source.color,opacity:s(e),borderColor:x(e.source)})},leave:function(e){return u({},I(e,!1),{color:e.source.color,opacity:0,borderColor:x(e.source)})},expires:!0,config:C,immediate:!A});return n.jsx(n.Fragment,{children:M((function(e,r){return n.jsx(j,{ribbon:r,ribbonGenerator:t,animatedProps:e,borderWidth:l,blendMode:d,setCurrent:v,isInteractive:b,tooltip:m,onMouseEnter:f,onMouseMove:p,onMouseLeave:g,onClick:h},r.id)}))})})),B=e.memo((function(r){var o=r.arc,i=r.animatedProps,l=r.borderWidth,c=r.arcGenerator,s=r.setCurrent,u=r.isInteractive,d=r.onMouseEnter,b=r.onMouseMove,v=r.onMouseLeave,f=r.onClick,p=r.tooltip,g=t.useTooltip(),h=g.showTooltipFromEvent,m=g.hideTooltip,y=e.useMemo((function(){if(u)return function(r){s(o),h(e.createElement(p,{arc:o}),r),null==d||d(o,r)}}),[u,h,p,o,d,s]),C=e.useMemo((function(){if(u)return function(r){h(e.createElement(p,{arc:o}),r),null==b||b(o,r)}}),[u,h,p,o,b]),R=e.useMemo((function(){if(u)return function(e){s(null),m(),null==v||v(o,e)}}),[u,m,o,v,s]),x=e.useMemo((function(){if(u&&f)return function(e){return null==f?void 0:f(o,e)}}),[u,o,f]);return n.jsx(a.animated.path,{"data-testid":"arc."+o.id,d:A({startAngle:i.startAngle,endAngle:i.endAngle,arcGenerator:c}),fill:i.color,opacity:i.opacity,strokeWidth:l,stroke:i.borderColor,onMouseEnter:y,onMouseMove:C,onMouseLeave:R,onClick:x})})),L=e.memo((function(e){var o=e.arcs,t=e.borderWidth,l=e.borderColor,c=e.getOpacity,s=e.arcGenerator,u=e.setCurrent,d=e.isInteractive,b=e.onMouseEnter,v=e.onMouseMove,f=e.onMouseLeave,p=e.onClick,g=e.tooltip,h=r.useMotionConfig(),m=h.animate,y=h.config,A=r.useTheme(),C=i.useInheritedColor(l,A),R=a.useTransition(o,{keys:function(e){return e.id},initial:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:c(e),borderColor:C(e)}},from:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:C(e)}},update:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:c(e),borderColor:C(e)}},leave:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:C(e)}},expires:!0,config:y,immediate:!m});return n.jsx(n.Fragment,{children:R((function(e,r){return n.jsx(B,{arc:r,arcGenerator:s,animatedProps:e,borderWidth:t,setCurrent:u,isInteractive:d,tooltip:g,onMouseEnter:b,onMouseMove:v,onMouseLeave:f,onClick:p},r.id)}))})})),T=e.memo((function(o){var t=o.arcs,l=o.radius,c=o.rotation,s=o.color,d=r.useMotionConfig(),b=d.animate,v=d.config,f=r.useTheme(),p=i.useInheritedColor(s,f),g=e.useMemo((function(){return t.map((function(e){var o=r.midAngle(e),t=r.getPolarLabelProps(l,o,c);return{id:e.id,label:e.label,x:t.x,y:t.y,rotation:t.rotate,color:p(e),textAnchor:t.align,dominantBaseline:t.baseline}}))}),[t,l,c,p]),h=a.useTransition(g,{keys:function(e){return e.id},initial:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},from:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},enter:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},update:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},expires:!0,config:v,immediate:!b});return n.jsx(n.Fragment,{children:h((function(e,r){return n.jsx(a.animated.text,{"data-testid":"label."+r.id,style:u({},f.labels.text,{pointerEvents:"none",fill:e.color}),transform:a.to([e.x,e.y,e.rotation],(function(e,r,o){return"translate("+e+", "+r+") rotate("+o+")"})),textAnchor:r.textAnchor,dominantBaseline:r.dominantBaseline,children:r.label},r.id)}))})})),G=["isInteractive","animate","motionConfig","theme","renderWrapper"],w=function(t){var i=t.data,a=t.keys,l=t.label,c=t.valueFormat,s=t.margin,d=t.width,b=t.height,v=t.innerRadiusRatio,f=void 0===v?p.innerRadiusRatio:v,g=t.innerRadiusOffset,h=void 0===g?p.innerRadiusOffset:g,m=t.padAngle,y=void 0===m?p.padAngle:m,A=t.layers,C=void 0===A?p.layers:A,R=t.colors,x=void 0===R?p.colors:R,M=t.arcBorderWidth,j=void 0===M?p.arcBorderWidth:M,I=t.arcBorderColor,B=void 0===I?p.arcBorderColor:I,G=t.arcOpacity,w=void 0===G?p.arcOpacity:G,S=t.activeArcOpacity,P=void 0===S?p.activeArcOpacity:S,F=t.inactiveArcOpacity,V=void 0===F?p.inactiveArcOpacity:F,q=t.arcTooltip,D=void 0===q?p.arcTooltip:q,H=t.ribbonBorderWidth,_=void 0===H?p.ribbonBorderWidth:H,z=t.ribbonBorderColor,U=void 0===z?p.ribbonBorderColor:z,J=t.ribbonBlendMode,K=void 0===J?p.ribbonBlendMode:J,N=t.ribbonOpacity,Q=void 0===N?p.ribbonOpacity:N,X=t.activeRibbonOpacity,Y=void 0===X?p.activeRibbonOpacity:X,Z=t.inactiveRibbonOpacity,$=void 0===Z?p.inactiveRibbonOpacity:Z,ee=t.ribbonTooltip,re=void 0===ee?p.ribbonTooltip:ee,oe=t.enableLabel,te=void 0===oe?p.enableLabel:oe,ne=t.labelOffset,ie=void 0===ne?p.labelOffset:ne,ae=t.labelRotation,le=void 0===ae?p.labelRotation:ae,ce=t.labelTextColor,se=void 0===ce?p.labelTextColor:ce,ue=t.isInteractive,de=void 0===ue?p.isInteractive:ue,be=t.onArcMouseEnter,ve=t.onArcMouseMove,fe=t.onArcMouseLeave,pe=t.onArcClick,ge=t.onRibbonMouseEnter,he=t.onRibbonMouseMove,me=t.onRibbonMouseLeave,ye=t.onRibbonClick,Ae=t.legends,Ce=void 0===Ae?p.legends:Ae,Re=t.role,xe=void 0===Re?p.role:Re,Me=t.ariaLabel,Oe=t.ariaLabelledBy,Ee=t.ariaDescribedBy,ke=r.useDimensions(d,b,s),je=ke.margin,Ie=ke.innerWidth,We=ke.innerHeight,Be=ke.outerWidth,Le=ke.outerHeight,Te=O({data:i,keys:a,label:l,valueFormat:c,width:Ie,height:We,innerRadiusRatio:f,innerRadiusOffset:h,padAngle:y,colors:x}),Ge=Te.center,we=Te.radius,Se=Te.arcGenerator,Pe=Te.ribbonGenerator,Fe=Te.arcs,Ve=Te.ribbons,qe=E({arcOpacity:w,activeArcOpacity:P,inactiveArcOpacity:V,ribbons:Ve,ribbonOpacity:Q,activeRibbonOpacity:Y,inactiveRibbonOpacity:$}),De=qe.setCurrentArc,He=qe.setCurrentRibbon,_e=qe.getArcOpacity,ze=qe.getRibbonOpacity,Ue=k({center:Ge,radius:we,arcs:Fe,arcGenerator:Se,ribbons:Ve,ribbonGenerator:Pe});if(we<=0)return null;var Je=Fe.map((function(e){return{id:e.id,label:e.label,color:e.color}})),Ke={ribbons:null,arcs:null,labels:null,legends:null};return C.includes("ribbons")&&(Ke.ribbons=n.jsx("g",{transform:"translate("+Ge[0]+", "+Ge[1]+")",children:n.jsx(W,{ribbons:Ve,ribbonGenerator:Pe,borderWidth:_,borderColor:U,getOpacity:ze,blendMode:K,setCurrent:He,isInteractive:de,onMouseEnter:ge,onMouseMove:he,onMouseLeave:me,onClick:ye,tooltip:re})},"ribbons")),C.includes("arcs")&&(Ke.arcs=n.jsx("g",{transform:"translate("+Ge[0]+", "+Ge[1]+")",children:n.jsx(L,{arcs:Fe,arcGenerator:Se,borderWidth:j,borderColor:B,getOpacity:_e,setCurrent:De,isInteractive:de,onMouseEnter:be,onMouseMove:ve,onMouseLeave:fe,onClick:pe,tooltip:D})},"arcs")),C.includes("labels")&&te&&(Ke.labels=n.jsx("g",{transform:"translate("+Ge[0]+", "+Ge[1]+")",children:n.jsx(T,{arcs:Fe,radius:we+ie,rotation:le,color:se})},"labels")),C.includes("legends")&&Ce.length>0&&(Ke.legends=n.jsx(e.Fragment,{children:Ce.map((function(e,r){return n.jsx(o.BoxLegendSvg,u({},e,{containerWidth:Ie,containerHeight:We,data:Je}),r)}))},"legends")),n.jsx(r.SvgWrapper,{width:Be,height:Le,margin:je,role:xe,ariaLabel:Me,ariaLabelledBy:Oe,ariaDescribedBy:Ee,children:C.map((function(r,o){var t;return"function"==typeof r?n.jsx(e.Fragment,{children:e.createElement(r,Ue)},o):null!=(t=null==Ke?void 0:Ke[r])?t:null}))})},S=function(e){var o=e.isInteractive,t=void 0===o?p.isInteractive:o,i=e.animate,a=void 0===i?p.animate:i,l=e.motionConfig,c=void 0===l?p.motionConfig:l,s=e.theme,b=e.renderWrapper,v=d(e,G);return n.jsx(r.Container,{animate:a,isInteractive:t,motionConfig:c,renderWrapper:b,theme:s,children:n.jsx(w,u({isInteractive:t},v))})},P=["theme","isInteractive","animate","motionConfig","renderWrapper"],F=function(e){var o=e.event,t=e.canvasEl,n=e.center,i=e.margin,a=e.radius,l=e.innerRadius,c=e.arcs,u=r.getRelativeCursor(t,o),d=u[0],b=u[1],v=i.left+n[0],f=i.top+n[1];return s.findArcUnderCursor(v,f,a,l,c,d,b)},V=function(a){var l=a.pixelRatio,c=void 0===l?g.pixelRatio:l,s=a.margin,d=a.data,b=a.keys,v=a.width,f=a.height,p=a.label,h=void 0===p?g.label:p,m=a.valueFormat,y=a.innerRadiusRatio,A=void 0===y?g.innerRadiusRatio:y,C=a.innerRadiusOffset,R=void 0===C?g.innerRadiusOffset:C,x=a.padAngle,M=void 0===x?g.padAngle:x,j=a.layers,I=void 0===j?g.layers:j,W=a.colors,B=void 0===W?g.colors:W,L=a.arcBorderWidth,T=void 0===L?g.arcBorderWidth:L,G=a.arcBorderColor,w=void 0===G?g.arcBorderColor:G,S=a.arcOpacity,P=void 0===S?g.arcOpacity:S,V=a.activeArcOpacity,q=void 0===V?g.activeArcOpacity:V,D=a.inactiveArcOpacity,H=void 0===D?g.inactiveArcOpacity:D,_=a.arcTooltip,z=void 0===_?g.arcTooltip:_,U=a.ribbonBorderWidth,J=void 0===U?g.ribbonBorderWidth:U,K=a.ribbonBorderColor,N=void 0===K?g.ribbonBorderColor:K,Q=a.ribbonOpacity,X=void 0===Q?g.ribbonOpacity:Q,Y=a.activeRibbonOpacity,Z=void 0===Y?g.activeRibbonOpacity:Y,$=a.inactiveRibbonOpacity,ee=void 0===$?g.inactiveRibbonOpacity:$,re=a.enableLabel,oe=void 0===re?g.enableLabel:re,te=a.labelOffset,ne=void 0===te?g.labelOffset:te,ie=a.labelRotation,ae=void 0===ie?g.labelRotation:ie,le=a.labelTextColor,ce=void 0===le?g.labelTextColor:le,se=a.isInteractive,ue=void 0===se?g.isInteractive:se,de=a.onArcMouseEnter,be=a.onArcMouseMove,ve=a.onArcMouseLeave,fe=a.onArcClick,pe=a.legends,ge=void 0===pe?g.legends:pe,he=e.useRef(null),me=r.useDimensions(v,f,s),ye=me.innerWidth,Ae=me.innerHeight,Ce=me.outerWidth,Re=me.outerHeight,xe=me.margin,Me=O({data:d,keys:b,label:h,valueFormat:m,width:ye,height:Ae,innerRadiusRatio:A,innerRadiusOffset:R,padAngle:M,colors:B}),Oe=Me.center,Ee=Me.radius,ke=Me.innerRadius,je=Me.arcGenerator,Ie=Me.ribbonGenerator,We=Me.arcs,Be=Me.ribbons,Le=E({arcOpacity:P,activeArcOpacity:q,inactiveArcOpacity:H,ribbons:Be,ribbonOpacity:X,activeRibbonOpacity:Z,inactiveRibbonOpacity:ee}),Te=Le.currentArc,Ge=Le.setCurrentArc,we=Le.getArcOpacity,Se=Le.getRibbonOpacity,Pe=r.useTheme(),Fe=i.useInheritedColor(ce,Pe),Ve=i.useInheritedColor(w,Pe),qe=i.useInheritedColor(N,Pe),De=k({center:Oe,radius:Ee,arcs:We,arcGenerator:je,ribbons:Be,ribbonGenerator:Ie});e.useEffect((function(){if(null!==he.current){he.current.width=Ce*c,he.current.height=Re*c;var e=he.current.getContext("2d");e.scale(c,c),e.fillStyle=Pe.background,e.fillRect(0,0,Ce,Re),Ee<=0||I.forEach((function(t){if("ribbons"===t&&(e.save(),e.translate(xe.left+Oe[0],xe.top+Oe[1]),Ie.context(e),Be.forEach((function(r){e.save(),e.globalAlpha=Se(r),e.fillStyle=r.source.color,e.beginPath(),Ie(r),e.fill(),J>0&&(e.strokeStyle=qe(r.source),e.lineWidth=J,e.stroke()),e.restore()})),e.restore()),"arcs"===t&&(e.save(),e.translate(xe.left+Oe[0],xe.top+Oe[1]),je.context(e),We.forEach((function(r){e.save(),e.globalAlpha=we(r),e.fillStyle=r.color,e.beginPath(),je(r),e.fill(),T>0&&(e.strokeStyle=Ve(r),e.lineWidth=T,e.stroke()),e.restore()})),e.restore()),"labels"===t&&!0===oe&&(e.save(),e.translate(xe.left+Oe[0],xe.top+Oe[1]),e.font=Pe.labels.text.fontSize+"px "+(Pe.labels.text.fontFamily||"sans-serif"),We.forEach((function(o){var t=r.midAngle(o),n=r.getPolarLabelProps(Ee+ne,t,ae);e.save(),e.translate(n.x,n.y),e.rotate(r.degreesToRadians(n.rotate)),e.textAlign=n.align,e.textBaseline=n.baseline,e.fillStyle=Fe(o),e.fillText(o.label,0,0),e.restore()})),e.restore()),"legends"===t){e.save(),e.translate(xe.left,xe.top);var n=We.map((function(e){return{id:e.id,label:e.label,color:e.color}}));ge.forEach((function(r){o.renderLegendToCanvas(e,u({},r,{data:n,containerWidth:ye,containerHeight:Ae,theme:Pe}))})),e.restore()}"function"==typeof t&&t(e,De)}))}}),[he,ye,Ae,Ce,Re,xe,c,Oe,Ee,Pe,I,We,je,we,T,Ve,Be,Ie,Se,J,qe,oe,ne,ae,Fe,ge,De]);var He=t.useTooltip(),_e=He.showTooltipFromEvent,ze=He.hideTooltip,Ue=e.useCallback((function(r){if(null!==he.current){var o=F({event:r,canvasEl:he.current,center:Oe,margin:xe,radius:Ee,innerRadius:ke,arcs:We});o?(Ge(o),_e(e.createElement(z,{arc:o}),r),!Te&&de&&de(o,r),be&&be(o,r),Te&&Te.id!==o.id&&ve&&ve(o,r)):(Ge(null),ze(),Te&&ve&&ve(Te,r))}}),[he,Oe,xe,Ee,ke,We,Ge,Te,_e,ze,z,de,be,ve]),Je=e.useCallback((function(){Ge(null),ze()}),[Ge,ze]),Ke=e.useCallback((function(e){if(null!==he.current&&fe){var r=F({event:e,canvasEl:he.current,center:Oe,margin:xe,radius:Ee,innerRadius:ke,arcs:We});r&&fe(r,e)}}),[he,Oe,xe,Ee,ke,We,fe]);return n.jsx("canvas",{ref:he,width:Ce*c,height:Re*c,style:{width:Ce,height:Re,cursor:ue?"auto":"normal"},onMouseEnter:ue?Ue:void 0,onMouseMove:ue?Ue:void 0,onMouseLeave:ue?Je:void 0,onClick:ue?Ke:void 0})},q=function(e){var o=e.theme,t=e.isInteractive,i=void 0===t?g.isInteractive:t,a=e.animate,l=void 0===a?g.animate:a,c=e.motionConfig,s=void 0===c?g.motionConfig:c,b=e.renderWrapper,v=d(e,P);return n.jsx(r.Container,{isInteractive:i,animate:l,motionConfig:s,theme:o,renderWrapper:b,children:n.jsx(V,u({isInteractive:i},v))})};exports.Chord=S,exports.ChordCanvas=q,exports.ResponsiveChord=function(e){return n.jsx(r.ResponsiveWrapper,{children:function(r){var o=r.width,t=r.height;return n.jsx(S,u({},e,{width:o,height:t}))}})},exports.ResponsiveChordCanvas=function(e){return n.jsx(r.ResponsiveWrapper,{children:function(r){var o=r.width,t=r.height;return n.jsx(q,u({},e,{width:o,height:t}))}})},exports.canvasDefaultProps=g,exports.commonDefaultProps=f,exports.computeArcPath=A,exports.computeChordArcsAndRibbons=y,exports.computeChordGenerators=m,exports.computeChordLayout=h,exports.computeRibbonPath=C,exports.svgDefaultProps=p,exports.useChord=O,exports.useChordArcsAndRibbons=M,exports.useChordGenerators=x,exports.useChordLayout=R,exports.useChordSelection=E,exports.useCustomLayerProps=k;
"use strict";var e=require("react"),r=require("@nivo/core"),o=require("@nivo/legends"),t=require("@nivo/tooltip"),n=require("react/jsx-runtime"),i=require("@nivo/colors"),a=require("@react-spring/web"),l=require("d3-shape"),c=require("d3-chord"),s=require("@nivo/arcs");function u(){return u=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},u.apply(this,arguments)}function d(e,r){if(null==e)return{};var o,t,n={},i=Object.keys(e);for(t=0;t<i.length;t++)o=i[t],r.indexOf(o)>=0||(n[o]=e[o]);return n}var b=e.memo((function(e){var r=e.arc;return n.jsx(t.BasicTooltip,{id:r.label,value:r.formattedValue,color:r.color,enableChip:!0})})),v=e.memo((function(e){var r=e.ribbon;return n.jsx(t.TableTooltip,{rows:[[n.jsx(t.Chip,{color:r.source.color},"chip"),n.jsx("strong",{children:r.source.label},"id"),r.source.formattedValue],[n.jsx(t.Chip,{color:r.target.color},"chip"),n.jsx("strong",{children:r.target.label},"id"),r.target.formattedValue]]})})),f={layers:["ribbons","arcs","labels","legends"],padAngle:0,innerRadiusRatio:.9,innerRadiusOffset:0,colors:{scheme:"nivo"},arcOpacity:1,activeArcOpacity:1,inactiveArcOpacity:.15,arcBorderWidth:1,arcBorderColor:{from:"color",modifiers:[["darker",.4]]},arcTooltip:b,ribbonOpacity:.5,activeRibbonOpacity:.85,inactiveRibbonOpacity:.15,ribbonBorderWidth:1,ribbonBorderColor:{from:"color",modifiers:[["darker",.4]]},ribbonBlendMode:"normal",enableLabel:!0,label:"id",labelOffset:12,labelRotation:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,legends:[],animate:!0,motionConfig:"gentle",role:"img"},p=u({},f,{ribbonBlendMode:"normal",ribbonTooltip:v}),g=u({},f,{pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1}),h=function(e){var r=e.padAngle;return c.chord().padAngle(r)},m=function(e){var r=e.width,o=e.height,t=e.innerRadiusRatio,n=e.innerRadiusOffset,i=[r/2,o/2],a=Math.min(r,o)/2,s=a*t,u=a*(t-n);return{center:i,radius:a,innerRadius:s,arcGenerator:l.arc().outerRadius(a).innerRadius(s),ribbonGenerator:c.ribbon().radius(u)}},y=function(e){var r=e.chord,o=e.data,t=e.keys,n=e.getLabel,i=e.formatValue,a=e.getColor,l=r(o);return{arcs:l.groups.map((function(e){var r=u({},e,{id:t[e.index],formattedValue:i(e.value)});return u({},r,{label:n(r),color:a(r)})})),ribbons:l.map((function(e){var r=u({},e.source,{id:t[e.source.index],formattedValue:i(e.source.value)}),o=u({},e.target,{id:t[e.target.index],formattedValue:i(e.target.value)});return u({},e,{id:[r.id,o.id].sort().join("."),source:u({},r,{label:n(r),color:a(r)}),target:u({},o,{label:n(o),color:a(o)})})}))}},A=function(e){var r=e.startAngle,o=e.endAngle,t=e.arcGenerator;return a.to([r,o],(function(e,r){return t({startAngle:e,endAngle:r})}))},C=function(e){var r=e.sourceStartAngle,o=e.sourceEndAngle,t=e.targetStartAngle,n=e.targetEndAngle,i=e.ribbonGenerator;return a.to([r,o,t,n],(function(e,r,o,t){return i({source:{startAngle:Math.min(e,r),endAngle:Math.max(r,e)},target:{startAngle:Math.min(o,t),endAngle:Math.max(t,o)}})}))},R=function(r){var o=r.padAngle;return e.useMemo((function(){return h({padAngle:o})}),[o])},x=function(r){var o=r.width,t=r.height,n=r.innerRadiusRatio,i=r.innerRadiusOffset;return e.useMemo((function(){return m({width:o,height:t,innerRadiusRatio:n,innerRadiusOffset:i})}),[o,t,n,i])},M=function(r){var o=r.chord,t=r.getColor,n=r.keys,i=r.data,a=r.getLabel,l=r.formatValue;return e.useMemo((function(){return y({chord:o,data:i,keys:n,getLabel:a,formatValue:l,getColor:t})}),[o,t,n,i,a,l])},O=function(o){var t=o.data,n=o.keys,a=o.label,l=void 0===a?f.label:a,c=o.valueFormat,s=o.width,u=o.height,d=o.innerRadiusRatio,b=void 0===d?f.innerRadiusRatio:d,v=o.innerRadiusOffset,p=void 0===v?f.innerRadiusOffset:v,g=o.padAngle,h=void 0===g?f.padAngle:g,m=o.colors,y=void 0===m?f.colors:m,A=R({padAngle:h}),C=x({width:s,height:u,innerRadiusRatio:b,innerRadiusOffset:p}),O=C.center,E=C.radius,k=C.innerRadius,j=C.arcGenerator,I=C.ribbonGenerator,W=e.useMemo((function(){return r.getLabelGenerator(l)}),[l]),B=r.useValueFormatter(c),L=i.useOrdinalColorScale(y,"id"),T=M({chord:A,getColor:L,keys:n,data:t,getLabel:W,formatValue:B});return{center:O,chord:A,radius:E,innerRadius:k,arcGenerator:j,ribbonGenerator:I,getColor:L,arcs:T.arcs,ribbons:T.ribbons}},E=function(r){var o=r.arcOpacity,t=void 0===o?f.arcOpacity:o,n=r.activeArcOpacity,i=void 0===n?f.activeArcOpacity:n,a=r.inactiveArcOpacity,l=void 0===a?f.inactiveArcOpacity:a,c=r.ribbons,s=r.ribbonOpacity,d=void 0===s?f.ribbonOpacity:s,b=r.activeRibbonOpacity,v=void 0===b?f.activeRibbonOpacity:b,p=r.inactiveRibbonOpacity,g=void 0===p?f.inactiveRibbonOpacity:p,h=e.useState(null),m=h[0],y=h[1],A=e.useState(null),C=A[0],R=A[1],x=e.useMemo((function(){var e=[],r=[];return m&&(e.push(m.id),c.filter((function(e){return e.source.id===m.id||e.target.id===m.id})).forEach((function(e){r.push(e.id)}))),C&&(e.push(C.source.id),e.push(C.target.id),r.push(C.id)),{selectedArcIds:e,selectedRibbonIds:r}}),[m,C,c]),M=x.selectedArcIds.length>1||x.selectedRibbonIds.length>0,O=e.useMemo((function(){return function(e){return M?x.selectedArcIds.includes(e.id)?i:l:t}}),[M,x.selectedArcIds,t,i,l]),E=e.useMemo((function(){return function(e){return M?x.selectedRibbonIds.includes(e.id)?v:g:d}}),[M,x.selectedRibbonIds,d,v,g]);return u({currentArc:m,setCurrentArc:y,currentRibbon:C,setCurrentRibbon:R,hasSelection:M},x,{getArcOpacity:O,getRibbonOpacity:E})},k=function(r){var o=r.center,t=r.radius,n=r.arcs,i=r.arcGenerator,a=r.ribbons,l=r.ribbonGenerator;return e.useMemo((function(){return{center:o,radius:t,arcs:n,arcGenerator:i,ribbons:a,ribbonGenerator:l}}),[o,t,n,i,a,l])},j=e.memo((function(r){var o=r.ribbon,i=r.ribbonGenerator,l=r.animatedProps,c=r.borderWidth,s=r.blendMode,u=r.isInteractive,d=r.setCurrent,b=r.onMouseEnter,v=r.onMouseMove,f=r.onMouseLeave,p=r.onClick,g=r.tooltip,h=t.useTooltip(),m=h.showTooltipFromEvent,y=h.hideTooltip,A=e.useMemo((function(){if(u)return function(r){d(o),m(e.createElement(g,{ribbon:o}),r),null==b||b(o,r)}}),[u,m,g,o,b,d]),R=e.useMemo((function(){if(u)return function(r){m(e.createElement(g,{ribbon:o}),r),null==v||v(o,r)}}),[u,m,g,o,v]),x=e.useMemo((function(){if(u)return function(e){d(null),y(),null==f||f(o,e)}}),[u,y,o,f,d]),M=e.useMemo((function(){if(u&&p)return function(e){return null==p?void 0:p(o,e)}}),[u,o,p]);return n.jsx(a.animated.path,{"data-testid":"ribbon."+o.source.id+"."+o.target.id,d:C({sourceStartAngle:l.sourceStartAngle,sourceEndAngle:l.sourceEndAngle,targetStartAngle:l.targetStartAngle,targetEndAngle:l.targetEndAngle,ribbonGenerator:i}),fill:l.color,opacity:l.opacity,strokeWidth:c,stroke:l.borderColor,style:{mixBlendMode:s},onMouseEnter:A,onMouseMove:R,onMouseLeave:x,onClick:M})})),I=function(e,o){var t,n,i=e.source,a=e.target;if(i.startAngle<a.startAngle?(t=i,n=a):(t=a,n=i),o){var l=r.midAngle(t),c=r.midAngle(n);return{sourceStartAngle:l,sourceEndAngle:l,targetStartAngle:c,targetEndAngle:c}}return{sourceStartAngle:t.startAngle,sourceEndAngle:t.endAngle,targetStartAngle:n.startAngle,targetEndAngle:n.endAngle}},W=e.memo((function(e){var o=e.ribbons,t=e.ribbonGenerator,l=e.borderWidth,c=e.borderColor,s=e.getOpacity,d=e.blendMode,b=e.isInteractive,v=e.setCurrent,f=e.onMouseEnter,p=e.onMouseMove,g=e.onMouseLeave,h=e.onClick,m=e.tooltip,y=r.useMotionConfig(),A=y.animate,C=y.config,R=r.useTheme(),x=i.useInheritedColor(c,R),M=a.useTransition(o,{keys:function(e){return e.id},initial:function(e){return u({},I(e,!1),{color:e.source.color,opacity:s(e),borderColor:x(e.source)})},from:function(e){return u({},I(e,!1),{color:e.source.color,opacity:0,borderColor:x(e.source)})},update:function(e){return u({},I(e,!1),{color:e.source.color,opacity:s(e),borderColor:x(e.source)})},leave:function(e){return u({},I(e,!1),{color:e.source.color,opacity:0,borderColor:x(e.source)})},expires:!0,config:C,immediate:!A});return n.jsx(n.Fragment,{children:M((function(e,r){return n.jsx(j,{ribbon:r,ribbonGenerator:t,animatedProps:e,borderWidth:l,blendMode:d,setCurrent:v,isInteractive:b,tooltip:m,onMouseEnter:f,onMouseMove:p,onMouseLeave:g,onClick:h},r.id)}))})})),B=e.memo((function(r){var o=r.arc,i=r.animatedProps,l=r.borderWidth,c=r.arcGenerator,s=r.setCurrent,u=r.isInteractive,d=r.onMouseEnter,b=r.onMouseMove,v=r.onMouseLeave,f=r.onClick,p=r.tooltip,g=t.useTooltip(),h=g.showTooltipFromEvent,m=g.hideTooltip,y=e.useMemo((function(){if(u)return function(r){s(o),h(e.createElement(p,{arc:o}),r),null==d||d(o,r)}}),[u,h,p,o,d,s]),C=e.useMemo((function(){if(u)return function(r){h(e.createElement(p,{arc:o}),r),null==b||b(o,r)}}),[u,h,p,o,b]),R=e.useMemo((function(){if(u)return function(e){s(null),m(),null==v||v(o,e)}}),[u,m,o,v,s]),x=e.useMemo((function(){if(u&&f)return function(e){return null==f?void 0:f(o,e)}}),[u,o,f]);return n.jsx(a.animated.path,{"data-testid":"arc."+o.id,d:A({startAngle:i.startAngle,endAngle:i.endAngle,arcGenerator:c}),fill:i.color,opacity:i.opacity,strokeWidth:l,stroke:i.borderColor,onMouseEnter:y,onMouseMove:C,onMouseLeave:R,onClick:x})})),L=e.memo((function(e){var o=e.arcs,t=e.borderWidth,l=e.borderColor,c=e.getOpacity,s=e.arcGenerator,u=e.setCurrent,d=e.isInteractive,b=e.onMouseEnter,v=e.onMouseMove,f=e.onMouseLeave,p=e.onClick,g=e.tooltip,h=r.useMotionConfig(),m=h.animate,y=h.config,A=r.useTheme(),C=i.useInheritedColor(l,A),R=a.useTransition(o,{keys:function(e){return e.id},initial:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:c(e),borderColor:C(e)}},from:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:C(e)}},update:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:c(e),borderColor:C(e)}},leave:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:C(e)}},expires:!0,config:y,immediate:!m});return n.jsx(n.Fragment,{children:R((function(e,r){return n.jsx(B,{arc:r,arcGenerator:s,animatedProps:e,borderWidth:t,setCurrent:u,isInteractive:d,tooltip:g,onMouseEnter:b,onMouseMove:v,onMouseLeave:f,onClick:p},r.id)}))})})),T=e.memo((function(o){var t=o.arcs,l=o.radius,c=o.rotation,s=o.color,d=r.useMotionConfig(),b=d.animate,v=d.config,f=r.useTheme(),p=i.useInheritedColor(s,f),g=e.useMemo((function(){return t.map((function(e){var o=r.midAngle(e),t=r.getPolarLabelProps(l,o,c);return{id:e.id,label:e.label,x:t.x,y:t.y,rotation:t.rotate,color:p(e),textAnchor:t.align,dominantBaseline:t.baseline}}))}),[t,l,c,p]),h=a.useTransition(g,{keys:function(e){return e.id},initial:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},from:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},enter:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},update:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},expires:!0,config:v,immediate:!b});return n.jsx(n.Fragment,{children:h((function(e,r){return n.jsx(a.animated.text,{"data-testid":"label."+r.id,style:u({},f.labels.text,{pointerEvents:"none",fill:e.color}),transform:a.to([e.x,e.y,e.rotation],(function(e,r,o){return"translate("+e+", "+r+") rotate("+o+")"})),textAnchor:r.textAnchor,dominantBaseline:r.dominantBaseline,children:r.label},r.id)}))})})),G=["isInteractive","animate","motionConfig","theme","renderWrapper"],w=function(t){var i=t.data,a=t.keys,l=t.label,c=t.valueFormat,s=t.margin,d=t.width,b=t.height,v=t.innerRadiusRatio,f=void 0===v?p.innerRadiusRatio:v,g=t.innerRadiusOffset,h=void 0===g?p.innerRadiusOffset:g,m=t.padAngle,y=void 0===m?p.padAngle:m,A=t.layers,C=void 0===A?p.layers:A,R=t.colors,x=void 0===R?p.colors:R,M=t.arcBorderWidth,j=void 0===M?p.arcBorderWidth:M,I=t.arcBorderColor,B=void 0===I?p.arcBorderColor:I,G=t.arcOpacity,w=void 0===G?p.arcOpacity:G,S=t.activeArcOpacity,P=void 0===S?p.activeArcOpacity:S,F=t.inactiveArcOpacity,V=void 0===F?p.inactiveArcOpacity:F,q=t.arcTooltip,D=void 0===q?p.arcTooltip:q,H=t.ribbonBorderWidth,z=void 0===H?p.ribbonBorderWidth:H,U=t.ribbonBorderColor,J=void 0===U?p.ribbonBorderColor:U,K=t.ribbonBlendMode,N=void 0===K?p.ribbonBlendMode:K,Q=t.ribbonOpacity,X=void 0===Q?p.ribbonOpacity:Q,Y=t.activeRibbonOpacity,Z=void 0===Y?p.activeRibbonOpacity:Y,$=t.inactiveRibbonOpacity,_=void 0===$?p.inactiveRibbonOpacity:$,ee=t.ribbonTooltip,re=void 0===ee?p.ribbonTooltip:ee,oe=t.enableLabel,te=void 0===oe?p.enableLabel:oe,ne=t.labelOffset,ie=void 0===ne?p.labelOffset:ne,ae=t.labelRotation,le=void 0===ae?p.labelRotation:ae,ce=t.labelTextColor,se=void 0===ce?p.labelTextColor:ce,ue=t.isInteractive,de=void 0===ue?p.isInteractive:ue,be=t.onArcMouseEnter,ve=t.onArcMouseMove,fe=t.onArcMouseLeave,pe=t.onArcClick,ge=t.onRibbonMouseEnter,he=t.onRibbonMouseMove,me=t.onRibbonMouseLeave,ye=t.onRibbonClick,Ae=t.legends,Ce=void 0===Ae?p.legends:Ae,Re=t.role,xe=void 0===Re?p.role:Re,Me=t.ariaLabel,Oe=t.ariaLabelledBy,Ee=t.ariaDescribedBy,ke=r.useDimensions(d,b,s),je=ke.margin,Ie=ke.innerWidth,We=ke.innerHeight,Be=ke.outerWidth,Le=ke.outerHeight,Te=O({data:i,keys:a,label:l,valueFormat:c,width:Ie,height:We,innerRadiusRatio:f,innerRadiusOffset:h,padAngle:y,colors:x}),Ge=Te.center,we=Te.radius,Se=Te.arcGenerator,Pe=Te.ribbonGenerator,Fe=Te.arcs,Ve=Te.ribbons,qe=E({arcOpacity:w,activeArcOpacity:P,inactiveArcOpacity:V,ribbons:Ve,ribbonOpacity:X,activeRibbonOpacity:Z,inactiveRibbonOpacity:_}),De=qe.setCurrentArc,He=qe.setCurrentRibbon,ze=qe.getArcOpacity,Ue=qe.getRibbonOpacity,Je=k({center:Ge,radius:we,arcs:Fe,arcGenerator:Se,ribbons:Ve,ribbonGenerator:Pe});if(we<=0)return null;var Ke=Fe.map((function(e){return{id:e.id,label:e.label,color:e.color}})),Ne={ribbons:null,arcs:null,labels:null,legends:null};return C.includes("ribbons")&&(Ne.ribbons=n.jsx("g",{transform:"translate("+Ge[0]+", "+Ge[1]+")",children:n.jsx(W,{ribbons:Ve,ribbonGenerator:Pe,borderWidth:z,borderColor:J,getOpacity:Ue,blendMode:N,setCurrent:He,isInteractive:de,onMouseEnter:ge,onMouseMove:he,onMouseLeave:me,onClick:ye,tooltip:re})},"ribbons")),C.includes("arcs")&&(Ne.arcs=n.jsx("g",{transform:"translate("+Ge[0]+", "+Ge[1]+")",children:n.jsx(L,{arcs:Fe,arcGenerator:Se,borderWidth:j,borderColor:B,getOpacity:ze,setCurrent:De,isInteractive:de,onMouseEnter:be,onMouseMove:ve,onMouseLeave:fe,onClick:pe,tooltip:D})},"arcs")),C.includes("labels")&&te&&(Ne.labels=n.jsx("g",{transform:"translate("+Ge[0]+", "+Ge[1]+")",children:n.jsx(T,{arcs:Fe,radius:we+ie,rotation:le,color:se})},"labels")),C.includes("legends")&&Ce.length>0&&(Ne.legends=n.jsx(e.Fragment,{children:Ce.map((function(e,r){return n.jsx(o.BoxLegendSvg,u({},e,{containerWidth:Ie,containerHeight:We,data:Ke}),r)}))},"legends")),n.jsx(r.SvgWrapper,{width:Be,height:Le,margin:je,role:xe,ariaLabel:Me,ariaLabelledBy:Oe,ariaDescribedBy:Ee,children:C.map((function(r,o){var t;return"function"==typeof r?n.jsx(e.Fragment,{children:e.createElement(r,Je)},o):null!=(t=null==Ne?void 0:Ne[r])?t:null}))})},S=function(e){var o=e.isInteractive,t=void 0===o?p.isInteractive:o,i=e.animate,a=void 0===i?p.animate:i,l=e.motionConfig,c=void 0===l?p.motionConfig:l,s=e.theme,b=e.renderWrapper,v=d(e,G);return n.jsx(r.Container,{animate:a,isInteractive:t,motionConfig:c,renderWrapper:b,theme:s,children:n.jsx(w,u({isInteractive:t},v))})},P=["theme","isInteractive","animate","motionConfig","renderWrapper"],F=function(e){var o=e.event,t=e.canvasEl,n=e.center,i=e.margin,a=e.radius,l=e.innerRadius,c=e.arcs,u=r.getRelativeCursor(t,o),d=u[0],b=u[1],v=i.left+n[0],f=i.top+n[1];return s.findArcUnderCursor(v,f,a,l,c,d,b)},V=function(a){var l=a.pixelRatio,c=void 0===l?g.pixelRatio:l,s=a.margin,d=a.data,b=a.keys,v=a.width,f=a.height,p=a.label,h=void 0===p?g.label:p,m=a.valueFormat,y=a.innerRadiusRatio,A=void 0===y?g.innerRadiusRatio:y,C=a.innerRadiusOffset,R=void 0===C?g.innerRadiusOffset:C,x=a.padAngle,M=void 0===x?g.padAngle:x,j=a.layers,I=void 0===j?g.layers:j,W=a.colors,B=void 0===W?g.colors:W,L=a.arcBorderWidth,T=void 0===L?g.arcBorderWidth:L,G=a.arcBorderColor,w=void 0===G?g.arcBorderColor:G,S=a.arcOpacity,P=void 0===S?g.arcOpacity:S,V=a.activeArcOpacity,q=void 0===V?g.activeArcOpacity:V,D=a.inactiveArcOpacity,H=void 0===D?g.inactiveArcOpacity:D,z=a.arcTooltip,U=void 0===z?g.arcTooltip:z,J=a.ribbonBorderWidth,K=void 0===J?g.ribbonBorderWidth:J,N=a.ribbonBorderColor,Q=void 0===N?g.ribbonBorderColor:N,X=a.ribbonOpacity,Y=void 0===X?g.ribbonOpacity:X,Z=a.activeRibbonOpacity,$=void 0===Z?g.activeRibbonOpacity:Z,_=a.inactiveRibbonOpacity,ee=void 0===_?g.inactiveRibbonOpacity:_,re=a.enableLabel,oe=void 0===re?g.enableLabel:re,te=a.labelOffset,ne=void 0===te?g.labelOffset:te,ie=a.labelRotation,ae=void 0===ie?g.labelRotation:ie,le=a.labelTextColor,ce=void 0===le?g.labelTextColor:le,se=a.isInteractive,ue=void 0===se?g.isInteractive:se,de=a.onArcMouseEnter,be=a.onArcMouseMove,ve=a.onArcMouseLeave,fe=a.onArcClick,pe=a.legends,ge=void 0===pe?g.legends:pe,he=e.useRef(null),me=r.useDimensions(v,f,s),ye=me.innerWidth,Ae=me.innerHeight,Ce=me.outerWidth,Re=me.outerHeight,xe=me.margin,Me=O({data:d,keys:b,label:h,valueFormat:m,width:ye,height:Ae,innerRadiusRatio:A,innerRadiusOffset:R,padAngle:M,colors:B}),Oe=Me.center,Ee=Me.radius,ke=Me.innerRadius,je=Me.arcGenerator,Ie=Me.ribbonGenerator,We=Me.arcs,Be=Me.ribbons,Le=E({arcOpacity:P,activeArcOpacity:q,inactiveArcOpacity:H,ribbons:Be,ribbonOpacity:Y,activeRibbonOpacity:$,inactiveRibbonOpacity:ee}),Te=Le.currentArc,Ge=Le.setCurrentArc,we=Le.getArcOpacity,Se=Le.getRibbonOpacity,Pe=r.useTheme(),Fe=i.useInheritedColor(ce,Pe),Ve=i.useInheritedColor(w,Pe),qe=i.useInheritedColor(Q,Pe),De=k({center:Oe,radius:Ee,arcs:We,arcGenerator:je,ribbons:Be,ribbonGenerator:Ie});e.useEffect((function(){if(null!==he.current){he.current.width=Ce*c,he.current.height=Re*c;var e=he.current.getContext("2d");e.scale(c,c),e.fillStyle=Pe.background,e.fillRect(0,0,Ce,Re),Ee<=0||I.forEach((function(t){if("ribbons"===t&&(e.save(),e.translate(xe.left+Oe[0],xe.top+Oe[1]),Ie.context(e),Be.forEach((function(r){e.save(),e.globalAlpha=Se(r),e.fillStyle=r.source.color,e.beginPath(),Ie(r),e.fill(),K>0&&(e.strokeStyle=qe(r.source),e.lineWidth=K,e.stroke()),e.restore()})),e.restore()),"arcs"===t&&(e.save(),e.translate(xe.left+Oe[0],xe.top+Oe[1]),je.context(e),We.forEach((function(r){e.save(),e.globalAlpha=we(r),e.fillStyle=r.color,e.beginPath(),je(r),e.fill(),T>0&&(e.strokeStyle=Ve(r),e.lineWidth=T,e.stroke()),e.restore()})),e.restore()),"labels"===t&&!0===oe&&(e.save(),e.translate(xe.left+Oe[0],xe.top+Oe[1]),e.font=Pe.labels.text.fontSize+"px "+(Pe.labels.text.fontFamily||"sans-serif"),We.forEach((function(o){var t=r.midAngle(o),n=r.getPolarLabelProps(Ee+ne,t,ae);e.save(),e.translate(n.x,n.y),e.rotate(r.degreesToRadians(n.rotate)),e.textAlign=n.align,e.textBaseline=n.baseline,e.fillStyle=Fe(o),e.fillText(o.label,0,0),e.restore()})),e.restore()),"legends"===t){e.save(),e.translate(xe.left,xe.top);var n=We.map((function(e){return{id:e.id,label:e.label,color:e.color}}));ge.forEach((function(r){o.renderLegendToCanvas(e,u({},r,{data:n,containerWidth:ye,containerHeight:Ae,theme:Pe}))})),e.restore()}"function"==typeof t&&t(e,De)}))}}),[he,ye,Ae,Ce,Re,xe,c,Oe,Ee,Pe,I,We,je,we,T,Ve,Be,Ie,Se,K,qe,oe,ne,ae,Fe,ge,De]);var He=t.useTooltip(),ze=He.showTooltipFromEvent,Ue=He.hideTooltip,Je=e.useCallback((function(r){if(null!==he.current){var o=F({event:r,canvasEl:he.current,center:Oe,margin:xe,radius:Ee,innerRadius:ke,arcs:We});o?(Ge(o),ze(e.createElement(U,{arc:o}),r),!Te&&de&&de(o,r),be&&be(o,r),Te&&Te.id!==o.id&&ve&&ve(o,r)):(Ge(null),Ue(),Te&&ve&&ve(Te,r))}}),[he,Oe,xe,Ee,ke,We,Ge,Te,ze,Ue,U,de,be,ve]),Ke=e.useCallback((function(){Ge(null),Ue()}),[Ge,Ue]),Ne=e.useCallback((function(e){if(null!==he.current&&fe){var r=F({event:e,canvasEl:he.current,center:Oe,margin:xe,radius:Ee,innerRadius:ke,arcs:We});r&&fe(r,e)}}),[he,Oe,xe,Ee,ke,We,fe]);return n.jsx("canvas",{ref:he,width:Ce*c,height:Re*c,style:{width:Ce,height:Re,cursor:ue?"auto":"normal"},onMouseEnter:ue?Je:void 0,onMouseMove:ue?Je:void 0,onMouseLeave:ue?Ke:void 0,onClick:ue?Ne:void 0})},q=function(e){var o=e.theme,t=e.isInteractive,i=void 0===t?g.isInteractive:t,a=e.animate,l=void 0===a?g.animate:a,c=e.motionConfig,s=void 0===c?g.motionConfig:c,b=e.renderWrapper,v=d(e,P);return n.jsx(r.Container,{isInteractive:i,animate:l,motionConfig:s,theme:o,renderWrapper:b,children:n.jsx(V,u({isInteractive:i},v))})};exports.Chord=S,exports.ChordCanvas=q,exports.ResponsiveChord=function(e){return n.jsx(r.ResponsiveWrapper,{children:function(r){var o=r.width,t=r.height;return n.jsx(S,u({},e,{width:o,height:t}))}})},exports.ResponsiveChordCanvas=function(e){return n.jsx(r.ResponsiveWrapper,{children:function(r){var o=r.width,t=r.height;return n.jsx(q,u({},e,{width:o,height:t}))}})},exports.canvasDefaultProps=g,exports.commonDefaultProps=f,exports.computeArcPath=A,exports.computeChordArcsAndRibbons=y,exports.computeChordGenerators=m,exports.computeChordLayout=h,exports.computeRibbonPath=C,exports.svgDefaultProps=p,exports.useChord=O,exports.useChordArcsAndRibbons=M,exports.useChordGenerators=x,exports.useChordLayout=R,exports.useChordSelection=E,exports.useCustomLayerProps=k;
//# sourceMappingURL=nivo-chord.cjs.js.map

@@ -1,2 +0,2 @@

import{memo as e,useMemo as r,useState as n,createElement as t,Fragment as o,useRef as i,useEffect as a,useCallback as c}from"react";import{getLabelGenerator as l,useValueFormatter as d,useMotionConfig as s,useTheme as u,midAngle as b,getPolarLabelProps as v,Container as f,useDimensions as g,SvgWrapper as p,degreesToRadians as h,getRelativeCursor as y,ResponsiveWrapper as m}from"@nivo/core";import{BoxLegendSvg as A,renderLegendToCanvas as R}from"@nivo/legends";import{BasicTooltip as O,TableTooltip as C,Chip as M,useTooltip as x}from"@nivo/tooltip";import{jsx as k,Fragment as E}from"react/jsx-runtime";import{useOrdinalColorScale as W,useInheritedColor as B}from"@nivo/colors";import{to as I,animated as G,useTransition as w}from"@react-spring/web";import{arc as L}from"d3-shape";import{chord as T,ribbon as S}from"d3-chord";import{findArcUnderCursor as F}from"@nivo/arcs";function V(){return V=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},V.apply(this,arguments)}function P(e,r){if(null==e)return{};var n,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n=i[t],r.indexOf(n)>=0||(o[n]=e[n]);return o}var H=e((function(e){var r=e.arc;return k(O,{id:r.label,value:r.formattedValue,color:r.color,enableChip:!0})})),j=e((function(e){var r=e.ribbon;return k(C,{rows:[[k(M,{color:r.source.color},"chip"),k("strong",{children:r.source.label},"id"),r.source.formattedValue],[k(M,{color:r.target.color},"chip"),k("strong",{children:r.target.label},"id"),r.target.formattedValue]]})})),D={layers:["ribbons","arcs","labels","legends"],padAngle:0,innerRadiusRatio:.9,innerRadiusOffset:0,colors:{scheme:"nivo"},arcOpacity:1,activeArcOpacity:1,inactiveArcOpacity:.15,arcBorderWidth:1,arcBorderColor:{from:"color",modifiers:[["darker",.4]]},arcTooltip:H,ribbonOpacity:.5,activeRibbonOpacity:.85,inactiveRibbonOpacity:.15,ribbonBorderWidth:1,ribbonBorderColor:{from:"color",modifiers:[["darker",.4]]},ribbonBlendMode:"normal",enableLabel:!0,label:"id",labelOffset:12,labelRotation:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,legends:[],animate:!0,motionConfig:"gentle",role:"img"},z=V({},D,{ribbonBlendMode:"normal",ribbonTooltip:j}),q=V({},D,{pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1}),J=function(e){var r=e.padAngle;return T().padAngle(r)},K=function(e){var r=e.width,n=e.height,t=e.innerRadiusRatio,o=e.innerRadiusOffset,i=[r/2,n/2],a=Math.min(r,n)/2,c=a*t,l=a*(t-o);return{center:i,radius:a,innerRadius:c,arcGenerator:L().outerRadius(a).innerRadius(c),ribbonGenerator:S().radius(l)}},N=function(e){var r=e.chord,n=e.data,t=e.keys,o=e.getLabel,i=e.formatValue,a=e.getColor,c=r(n),l=c.groups.map((function(e){var r=V({},e,{id:t[e.index],formattedValue:i(e.value)});return V({},r,{label:o(r),color:a(r)})}));return{arcs:l,ribbons:c.map((function(e){var r=V({},e.source,{id:t[e.source.index],formattedValue:i(e.source.value)}),n=V({},e.target,{id:t[e.target.index],formattedValue:i(e.target.value)});return V({},e,{id:[r.id,n.id].sort().join("."),source:V({},r,{label:o(r),color:a(r)}),target:V({},n,{label:o(n),color:a(n)})})}))}},Q=function(e){var r=e.startAngle,n=e.endAngle,t=e.arcGenerator;return I([r,n],(function(e,r){return t({startAngle:e,endAngle:r})}))},U=function(e){var r=e.sourceStartAngle,n=e.sourceEndAngle,t=e.targetStartAngle,o=e.targetEndAngle,i=e.ribbonGenerator;return I([r,n,t,o],(function(e,r,n,t){return i({source:{startAngle:Math.min(e,r),endAngle:Math.max(r,e)},target:{startAngle:Math.min(n,t),endAngle:Math.max(t,n)}})}))},X=function(e){var n=e.padAngle;return r((function(){return J({padAngle:n})}),[n])},Y=function(e){var n=e.width,t=e.height,o=e.innerRadiusRatio,i=e.innerRadiusOffset;return r((function(){return K({width:n,height:t,innerRadiusRatio:o,innerRadiusOffset:i})}),[n,t,o,i])},Z=function(e){var n=e.chord,t=e.getColor,o=e.keys,i=e.data,a=e.getLabel,c=e.formatValue;return r((function(){return N({chord:n,data:i,keys:o,getLabel:a,formatValue:c,getColor:t})}),[n,t,o,i,a,c])},$=function(e){var n=e.data,t=e.keys,o=e.label,i=void 0===o?D.label:o,a=e.valueFormat,c=e.width,s=e.height,u=e.innerRadiusRatio,b=void 0===u?D.innerRadiusRatio:u,v=e.innerRadiusOffset,f=void 0===v?D.innerRadiusOffset:v,g=e.padAngle,p=void 0===g?D.padAngle:g,h=e.colors,y=void 0===h?D.colors:h,m=X({padAngle:p}),A=Y({width:c,height:s,innerRadiusRatio:b,innerRadiusOffset:f}),R=A.center,O=A.radius,C=A.innerRadius,M=A.arcGenerator,x=A.ribbonGenerator,k=r((function(){return l(i)}),[i]),E=d(a),B=W(y,"id"),I=Z({chord:m,getColor:B,keys:t,data:n,getLabel:k,formatValue:E});return{center:R,chord:m,radius:O,innerRadius:C,arcGenerator:M,ribbonGenerator:x,getColor:B,arcs:I.arcs,ribbons:I.ribbons}},_=function(e){var t=e.arcOpacity,o=void 0===t?D.arcOpacity:t,i=e.activeArcOpacity,a=void 0===i?D.activeArcOpacity:i,c=e.inactiveArcOpacity,l=void 0===c?D.inactiveArcOpacity:c,d=e.ribbons,s=e.ribbonOpacity,u=void 0===s?D.ribbonOpacity:s,b=e.activeRibbonOpacity,v=void 0===b?D.activeRibbonOpacity:b,f=e.inactiveRibbonOpacity,g=void 0===f?D.inactiveRibbonOpacity:f,p=n(null),h=p[0],y=p[1],m=n(null),A=m[0],R=m[1],O=r((function(){var e=[],r=[];return h&&(e.push(h.id),d.filter((function(e){return e.source.id===h.id||e.target.id===h.id})).forEach((function(e){r.push(e.id)}))),A&&(e.push(A.source.id),e.push(A.target.id),r.push(A.id)),{selectedArcIds:e,selectedRibbonIds:r}}),[h,A,d]),C=O.selectedArcIds.length>1||O.selectedRibbonIds.length>0,M=r((function(){return function(e){return C?O.selectedArcIds.includes(e.id)?a:l:o}}),[C,O.selectedArcIds,o,a,l]),x=r((function(){return function(e){return C?O.selectedRibbonIds.includes(e.id)?v:g:u}}),[C,O.selectedRibbonIds,u,v,g]);return V({currentArc:h,setCurrentArc:y,currentRibbon:A,setCurrentRibbon:R,hasSelection:C},O,{getArcOpacity:M,getRibbonOpacity:x})},ee=function(e){var n=e.center,t=e.radius,o=e.arcs,i=e.arcGenerator,a=e.ribbons,c=e.ribbonGenerator;return r((function(){return{center:n,radius:t,arcs:o,arcGenerator:i,ribbons:a,ribbonGenerator:c}}),[n,t,o,i,a,c])},re=e((function(e){var n=e.ribbon,o=e.ribbonGenerator,i=e.animatedProps,a=e.borderWidth,c=e.blendMode,l=e.isInteractive,d=e.setCurrent,s=e.onMouseEnter,u=e.onMouseMove,b=e.onMouseLeave,v=e.onClick,f=e.tooltip,g=x(),p=g.showTooltipFromEvent,h=g.hideTooltip,y=r((function(){if(l)return function(e){d(n),p(t(f,{ribbon:n}),e),null==s||s(n,e)}}),[l,p,f,n,s,d]),m=r((function(){if(l)return function(e){p(t(f,{ribbon:n}),e),null==u||u(n,e)}}),[l,p,f,n,u]),A=r((function(){if(l)return function(e){d(null),h(),null==b||b(n,e)}}),[l,h,n,b,d]),R=r((function(){if(l&&v)return function(e){return null==v?void 0:v(n,e)}}),[l,n,v]);return k(G.path,{"data-testid":"ribbon."+n.source.id+"."+n.target.id,d:U({sourceStartAngle:i.sourceStartAngle,sourceEndAngle:i.sourceEndAngle,targetStartAngle:i.targetStartAngle,targetEndAngle:i.targetEndAngle,ribbonGenerator:o}),fill:i.color,opacity:i.opacity,strokeWidth:a,stroke:i.borderColor,style:{mixBlendMode:c},onMouseEnter:y,onMouseMove:m,onMouseLeave:A,onClick:R})})),ne=function(e,r){var n,t,o=e.source,i=e.target;if(o.startAngle<i.startAngle?(n=o,t=i):(n=i,t=o),r){var a=b(n),c=b(t);return{sourceStartAngle:a,sourceEndAngle:a,targetStartAngle:c,targetEndAngle:c}}return{sourceStartAngle:n.startAngle,sourceEndAngle:n.endAngle,targetStartAngle:t.startAngle,targetEndAngle:t.endAngle}},te=e((function(e){var r=e.ribbons,n=e.ribbonGenerator,t=e.borderWidth,o=e.borderColor,i=e.getOpacity,a=e.blendMode,c=e.isInteractive,l=e.setCurrent,d=e.onMouseEnter,b=e.onMouseMove,v=e.onMouseLeave,f=e.onClick,g=e.tooltip,p=s(),h=p.animate,y=p.config,m=u(),A=B(o,m),R=w(r,{keys:function(e){return e.id},initial:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:i(e),borderColor:A(e.source)})},from:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:0,borderColor:A(e.source)})},update:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:i(e),borderColor:A(e.source)})},leave:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:0,borderColor:A(e.source)})},expires:!0,config:y,immediate:!h});return k(E,{children:R((function(e,r){return k(re,{ribbon:r,ribbonGenerator:n,animatedProps:e,borderWidth:t,blendMode:a,setCurrent:l,isInteractive:c,tooltip:g,onMouseEnter:d,onMouseMove:b,onMouseLeave:v,onClick:f},r.id)}))})})),oe=e((function(e){var n=e.arc,o=e.animatedProps,i=e.borderWidth,a=e.arcGenerator,c=e.setCurrent,l=e.isInteractive,d=e.onMouseEnter,s=e.onMouseMove,u=e.onMouseLeave,b=e.onClick,v=e.tooltip,f=x(),g=f.showTooltipFromEvent,p=f.hideTooltip,h=r((function(){if(l)return function(e){c(n),g(t(v,{arc:n}),e),null==d||d(n,e)}}),[l,g,v,n,d,c]),y=r((function(){if(l)return function(e){g(t(v,{arc:n}),e),null==s||s(n,e)}}),[l,g,v,n,s]),m=r((function(){if(l)return function(e){c(null),p(),null==u||u(n,e)}}),[l,p,n,u,c]),A=r((function(){if(l&&b)return function(e){return null==b?void 0:b(n,e)}}),[l,n,b]);return k(G.path,{"data-testid":"arc."+n.id,d:Q({startAngle:o.startAngle,endAngle:o.endAngle,arcGenerator:a}),fill:o.color,opacity:o.opacity,strokeWidth:i,stroke:o.borderColor,onMouseEnter:h,onMouseMove:y,onMouseLeave:m,onClick:A})})),ie=e((function(e){var r=e.arcs,n=e.borderWidth,t=e.borderColor,o=e.getOpacity,i=e.arcGenerator,a=e.setCurrent,c=e.isInteractive,l=e.onMouseEnter,d=e.onMouseMove,b=e.onMouseLeave,v=e.onClick,f=e.tooltip,g=s(),p=g.animate,h=g.config,y=u(),m=B(t,y),A=w(r,{keys:function(e){return e.id},initial:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:o(e),borderColor:m(e)}},from:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:m(e)}},update:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:o(e),borderColor:m(e)}},leave:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:m(e)}},expires:!0,config:h,immediate:!p});return k(E,{children:A((function(e,r){return k(oe,{arc:r,arcGenerator:i,animatedProps:e,borderWidth:n,setCurrent:a,isInteractive:c,tooltip:f,onMouseEnter:l,onMouseMove:d,onMouseLeave:b,onClick:v},r.id)}))})})),ae=e((function(e){var n=e.arcs,t=e.radius,o=e.rotation,i=e.color,a=s(),c=a.animate,l=a.config,d=u(),f=B(i,d),g=r((function(){return n.map((function(e){var r=b(e),n=v(t,r,o);return{id:e.id,label:e.label,x:n.x,y:n.y,rotation:n.rotate,color:f(e),textAnchor:n.align,dominantBaseline:n.baseline}}))}),[n,t,o,f]),p=w(g,{keys:function(e){return e.id},initial:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},from:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},enter:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},update:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},expires:!0,config:l,immediate:!c});return k(E,{children:p((function(e,r){return k(G.text,{"data-testid":"label."+r.id,style:V({},d.labels.text,{pointerEvents:"none",fill:e.color}),transform:I([e.x,e.y,e.rotation],(function(e,r,n){return"translate("+e+", "+r+") rotate("+n+")"})),textAnchor:r.textAnchor,dominantBaseline:r.dominantBaseline,children:r.label},r.id)}))})})),ce=["isInteractive","animate","motionConfig","theme","renderWrapper"],le=function(e){var r=e.data,n=e.keys,i=e.label,a=e.valueFormat,c=e.margin,l=e.width,d=e.height,s=e.innerRadiusRatio,u=void 0===s?z.innerRadiusRatio:s,b=e.innerRadiusOffset,v=void 0===b?z.innerRadiusOffset:b,f=e.padAngle,h=void 0===f?z.padAngle:f,y=e.layers,m=void 0===y?z.layers:y,R=e.colors,O=void 0===R?z.colors:R,C=e.arcBorderWidth,M=void 0===C?z.arcBorderWidth:C,x=e.arcBorderColor,E=void 0===x?z.arcBorderColor:x,W=e.arcOpacity,B=void 0===W?z.arcOpacity:W,I=e.activeArcOpacity,G=void 0===I?z.activeArcOpacity:I,w=e.inactiveArcOpacity,L=void 0===w?z.inactiveArcOpacity:w,T=e.arcTooltip,S=void 0===T?z.arcTooltip:T,F=e.ribbonBorderWidth,P=void 0===F?z.ribbonBorderWidth:F,H=e.ribbonBorderColor,j=void 0===H?z.ribbonBorderColor:H,D=e.ribbonBlendMode,q=void 0===D?z.ribbonBlendMode:D,J=e.ribbonOpacity,K=void 0===J?z.ribbonOpacity:J,N=e.activeRibbonOpacity,Q=void 0===N?z.activeRibbonOpacity:N,U=e.inactiveRibbonOpacity,X=void 0===U?z.inactiveRibbonOpacity:U,Y=e.ribbonTooltip,Z=void 0===Y?z.ribbonTooltip:Y,re=e.enableLabel,ne=void 0===re?z.enableLabel:re,oe=e.labelOffset,ce=void 0===oe?z.labelOffset:oe,le=e.labelRotation,de=void 0===le?z.labelRotation:le,se=e.labelTextColor,ue=void 0===se?z.labelTextColor:se,be=e.isInteractive,ve=void 0===be?z.isInteractive:be,fe=e.onArcMouseEnter,ge=e.onArcMouseMove,pe=e.onArcMouseLeave,he=e.onArcClick,ye=e.onRibbonMouseEnter,me=e.onRibbonMouseMove,Ae=e.onRibbonMouseLeave,Re=e.onRibbonClick,Oe=e.legends,Ce=void 0===Oe?z.legends:Oe,Me=e.role,xe=void 0===Me?z.role:Me,ke=e.ariaLabel,Ee=e.ariaLabelledBy,We=e.ariaDescribedBy,Be=g(l,d,c),Ie=Be.margin,Ge=Be.innerWidth,we=Be.innerHeight,Le=Be.outerWidth,Te=Be.outerHeight,Se=$({data:r,keys:n,label:i,valueFormat:a,width:Ge,height:we,innerRadiusRatio:u,innerRadiusOffset:v,padAngle:h,colors:O}),Fe=Se.center,Ve=Se.radius,Pe=Se.arcGenerator,He=Se.ribbonGenerator,je=Se.arcs,De=Se.ribbons,ze=_({arcOpacity:B,activeArcOpacity:G,inactiveArcOpacity:L,ribbons:De,ribbonOpacity:K,activeRibbonOpacity:Q,inactiveRibbonOpacity:X}),qe=ze.setCurrentArc,Je=ze.setCurrentRibbon,Ke=ze.getArcOpacity,Ne=ze.getRibbonOpacity,Qe=ee({center:Fe,radius:Ve,arcs:je,arcGenerator:Pe,ribbons:De,ribbonGenerator:He});if(Ve<=0)return null;var Ue=je.map((function(e){return{id:e.id,label:e.label,color:e.color}})),Xe={ribbons:null,arcs:null,labels:null,legends:null};return m.includes("ribbons")&&(Xe.ribbons=k("g",{transform:"translate("+Fe[0]+", "+Fe[1]+")",children:k(te,{ribbons:De,ribbonGenerator:He,borderWidth:P,borderColor:j,getOpacity:Ne,blendMode:q,setCurrent:Je,isInteractive:ve,onMouseEnter:ye,onMouseMove:me,onMouseLeave:Ae,onClick:Re,tooltip:Z})},"ribbons")),m.includes("arcs")&&(Xe.arcs=k("g",{transform:"translate("+Fe[0]+", "+Fe[1]+")",children:k(ie,{arcs:je,arcGenerator:Pe,borderWidth:M,borderColor:E,getOpacity:Ke,setCurrent:qe,isInteractive:ve,onMouseEnter:fe,onMouseMove:ge,onMouseLeave:pe,onClick:he,tooltip:S})},"arcs")),m.includes("labels")&&ne&&(Xe.labels=k("g",{transform:"translate("+Fe[0]+", "+Fe[1]+")",children:k(ae,{arcs:je,radius:Ve+ce,rotation:de,color:ue})},"labels")),m.includes("legends")&&Ce.length>0&&(Xe.legends=k(o,{children:Ce.map((function(e,r){return k(A,V({},e,{containerWidth:Ge,containerHeight:we,data:Ue}),r)}))},"legends")),k(p,{width:Le,height:Te,margin:Ie,role:xe,ariaLabel:ke,ariaLabelledBy:Ee,ariaDescribedBy:We,children:m.map((function(e,r){var n;return"function"==typeof e?k(o,{children:t(e,Qe)},r):null!=(n=null==Xe?void 0:Xe[e])?n:null}))})},de=function(e){var r=e.isInteractive,n=void 0===r?z.isInteractive:r,t=e.animate,o=void 0===t?z.animate:t,i=e.motionConfig,a=void 0===i?z.motionConfig:i,c=e.theme,l=e.renderWrapper,d=P(e,ce);return k(f,{animate:o,isInteractive:n,motionConfig:a,renderWrapper:l,theme:c,children:k(le,V({isInteractive:n},d))})},se=["theme","isInteractive","animate","motionConfig","renderWrapper"],ue=function(e){var r=e.event,n=e.canvasEl,t=e.center,o=e.margin,i=e.radius,a=e.innerRadius,c=e.arcs,l=y(n,r),d=l[0],s=l[1],u=o.left+t[0],b=o.top+t[1];return F(u,b,i,a,c,d,s)},be=function(e){var r=e.pixelRatio,n=void 0===r?q.pixelRatio:r,o=e.margin,l=e.data,d=e.keys,s=e.width,f=e.height,p=e.label,y=void 0===p?q.label:p,m=e.valueFormat,A=e.innerRadiusRatio,O=void 0===A?q.innerRadiusRatio:A,C=e.innerRadiusOffset,M=void 0===C?q.innerRadiusOffset:C,E=e.padAngle,W=void 0===E?q.padAngle:E,I=e.layers,G=void 0===I?q.layers:I,w=e.colors,L=void 0===w?q.colors:w,T=e.arcBorderWidth,S=void 0===T?q.arcBorderWidth:T,F=e.arcBorderColor,P=void 0===F?q.arcBorderColor:F,H=e.arcOpacity,j=void 0===H?q.arcOpacity:H,D=e.activeArcOpacity,z=void 0===D?q.activeArcOpacity:D,J=e.inactiveArcOpacity,K=void 0===J?q.inactiveArcOpacity:J,N=e.arcTooltip,Q=void 0===N?q.arcTooltip:N,U=e.ribbonBorderWidth,X=void 0===U?q.ribbonBorderWidth:U,Y=e.ribbonBorderColor,Z=void 0===Y?q.ribbonBorderColor:Y,re=e.ribbonOpacity,ne=void 0===re?q.ribbonOpacity:re,te=e.activeRibbonOpacity,oe=void 0===te?q.activeRibbonOpacity:te,ie=e.inactiveRibbonOpacity,ae=void 0===ie?q.inactiveRibbonOpacity:ie,ce=e.enableLabel,le=void 0===ce?q.enableLabel:ce,de=e.labelOffset,se=void 0===de?q.labelOffset:de,be=e.labelRotation,ve=void 0===be?q.labelRotation:be,fe=e.labelTextColor,ge=void 0===fe?q.labelTextColor:fe,pe=e.isInteractive,he=void 0===pe?q.isInteractive:pe,ye=e.onArcMouseEnter,me=e.onArcMouseMove,Ae=e.onArcMouseLeave,Re=e.onArcClick,Oe=e.legends,Ce=void 0===Oe?q.legends:Oe,Me=i(null),xe=g(s,f,o),ke=xe.innerWidth,Ee=xe.innerHeight,We=xe.outerWidth,Be=xe.outerHeight,Ie=xe.margin,Ge=$({data:l,keys:d,label:y,valueFormat:m,width:ke,height:Ee,innerRadiusRatio:O,innerRadiusOffset:M,padAngle:W,colors:L}),we=Ge.center,Le=Ge.radius,Te=Ge.innerRadius,Se=Ge.arcGenerator,Fe=Ge.ribbonGenerator,Ve=Ge.arcs,Pe=Ge.ribbons,He=_({arcOpacity:j,activeArcOpacity:z,inactiveArcOpacity:K,ribbons:Pe,ribbonOpacity:ne,activeRibbonOpacity:oe,inactiveRibbonOpacity:ae}),je=He.currentArc,De=He.setCurrentArc,ze=He.getArcOpacity,qe=He.getRibbonOpacity,Je=u(),Ke=B(ge,Je),Ne=B(P,Je),Qe=B(Z,Je),Ue=ee({center:we,radius:Le,arcs:Ve,arcGenerator:Se,ribbons:Pe,ribbonGenerator:Fe});a((function(){if(null!==Me.current){Me.current.width=We*n,Me.current.height=Be*n;var e=Me.current.getContext("2d");e.scale(n,n),e.fillStyle=Je.background,e.fillRect(0,0,We,Be),Le<=0||G.forEach((function(r){if("ribbons"===r&&(e.save(),e.translate(Ie.left+we[0],Ie.top+we[1]),Fe.context(e),Pe.forEach((function(r){e.save(),e.globalAlpha=qe(r),e.fillStyle=r.source.color,e.beginPath(),Fe(r),e.fill(),X>0&&(e.strokeStyle=Qe(r.source),e.lineWidth=X,e.stroke()),e.restore()})),e.restore()),"arcs"===r&&(e.save(),e.translate(Ie.left+we[0],Ie.top+we[1]),Se.context(e),Ve.forEach((function(r){e.save(),e.globalAlpha=ze(r),e.fillStyle=r.color,e.beginPath(),Se(r),e.fill(),S>0&&(e.strokeStyle=Ne(r),e.lineWidth=S,e.stroke()),e.restore()})),e.restore()),"labels"===r&&!0===le&&(e.save(),e.translate(Ie.left+we[0],Ie.top+we[1]),e.font=Je.labels.text.fontSize+"px "+(Je.labels.text.fontFamily||"sans-serif"),Ve.forEach((function(r){var n=b(r),t=v(Le+se,n,ve);e.save(),e.translate(t.x,t.y),e.rotate(h(t.rotate)),e.textAlign=t.align,e.textBaseline=t.baseline,e.fillStyle=Ke(r),e.fillText(r.label,0,0),e.restore()})),e.restore()),"legends"===r){e.save(),e.translate(Ie.left,Ie.top);var n=Ve.map((function(e){return{id:e.id,label:e.label,color:e.color}}));Ce.forEach((function(r){R(e,V({},r,{data:n,containerWidth:ke,containerHeight:Ee,theme:Je}))})),e.restore()}"function"==typeof r&&r(e,Ue)}))}}),[Me,ke,Ee,We,Be,Ie,n,we,Le,Je,G,Ve,Se,ze,S,Ne,Pe,Fe,qe,X,Qe,le,se,ve,Ke,Ce,Ue]);var Xe=x(),Ye=Xe.showTooltipFromEvent,Ze=Xe.hideTooltip,$e=c((function(e){if(null!==Me.current){var r=ue({event:e,canvasEl:Me.current,center:we,margin:Ie,radius:Le,innerRadius:Te,arcs:Ve});r?(De(r),Ye(t(Q,{arc:r}),e),!je&&ye&&ye(r,e),me&&me(r,e),je&&je.id!==r.id&&Ae&&Ae(r,e)):(De(null),Ze(),je&&Ae&&Ae(je,e))}}),[Me,we,Ie,Le,Te,Ve,De,je,Ye,Ze,Q,ye,me,Ae]),_e=c((function(){De(null),Ze()}),[De,Ze]),er=c((function(e){if(null!==Me.current&&Re){var r=ue({event:e,canvasEl:Me.current,center:we,margin:Ie,radius:Le,innerRadius:Te,arcs:Ve});r&&Re(r,e)}}),[Me,we,Ie,Le,Te,Ve,Re]);return k("canvas",{ref:Me,width:We*n,height:Be*n,style:{width:We,height:Be,cursor:he?"auto":"normal"},onMouseEnter:he?$e:void 0,onMouseMove:he?$e:void 0,onMouseLeave:he?_e:void 0,onClick:he?er:void 0})},ve=function(e){var r=e.theme,n=e.isInteractive,t=void 0===n?q.isInteractive:n,o=e.animate,i=void 0===o?q.animate:o,a=e.motionConfig,c=void 0===a?q.motionConfig:a,l=e.renderWrapper,d=P(e,se);return k(f,{isInteractive:t,animate:i,motionConfig:c,theme:r,renderWrapper:l,children:k(be,V({isInteractive:t},d))})},fe=function(e){return k(m,{children:function(r){var n=r.width,t=r.height;return k(de,V({},e,{width:n,height:t}))}})},ge=function(e){return k(m,{children:function(r){var n=r.width,t=r.height;return k(ve,V({},e,{width:n,height:t}))}})};export{de as Chord,ve as ChordCanvas,fe as ResponsiveChord,ge as ResponsiveChordCanvas,q as canvasDefaultProps,D as commonDefaultProps,Q as computeArcPath,N as computeChordArcsAndRibbons,K as computeChordGenerators,J as computeChordLayout,U as computeRibbonPath,z as svgDefaultProps,$ as useChord,Z as useChordArcsAndRibbons,Y as useChordGenerators,X as useChordLayout,_ as useChordSelection,ee as useCustomLayerProps};
import{memo as e,useMemo as r,useState as n,createElement as t,Fragment as o,useRef as i,useEffect as a,useCallback as c}from"react";import{getLabelGenerator as l,useValueFormatter as d,useMotionConfig as s,useTheme as u,midAngle as b,getPolarLabelProps as v,Container as f,useDimensions as g,SvgWrapper as p,degreesToRadians as h,getRelativeCursor as y,ResponsiveWrapper as m}from"@nivo/core";import{BoxLegendSvg as A,renderLegendToCanvas as R}from"@nivo/legends";import{BasicTooltip as O,TableTooltip as C,Chip as M,useTooltip as x}from"@nivo/tooltip";import{jsx as k,Fragment as E}from"react/jsx-runtime";import{useOrdinalColorScale as W,useInheritedColor as B}from"@nivo/colors";import{to as I,animated as G,useTransition as w}from"@react-spring/web";import{arc as L}from"d3-shape";import{chord as T,ribbon as S}from"d3-chord";import{findArcUnderCursor as F}from"@nivo/arcs";function V(){return V=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},V.apply(this,arguments)}function P(e,r){if(null==e)return{};var n,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)n=i[t],r.indexOf(n)>=0||(o[n]=e[n]);return o}var j=e((function(e){var r=e.arc;return k(O,{id:r.label,value:r.formattedValue,color:r.color,enableChip:!0})})),H=e((function(e){var r=e.ribbon;return k(C,{rows:[[k(M,{color:r.source.color},"chip"),k("strong",{children:r.source.label},"id"),r.source.formattedValue],[k(M,{color:r.target.color},"chip"),k("strong",{children:r.target.label},"id"),r.target.formattedValue]]})})),D={layers:["ribbons","arcs","labels","legends"],padAngle:0,innerRadiusRatio:.9,innerRadiusOffset:0,colors:{scheme:"nivo"},arcOpacity:1,activeArcOpacity:1,inactiveArcOpacity:.15,arcBorderWidth:1,arcBorderColor:{from:"color",modifiers:[["darker",.4]]},arcTooltip:j,ribbonOpacity:.5,activeRibbonOpacity:.85,inactiveRibbonOpacity:.15,ribbonBorderWidth:1,ribbonBorderColor:{from:"color",modifiers:[["darker",.4]]},ribbonBlendMode:"normal",enableLabel:!0,label:"id",labelOffset:12,labelRotation:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,legends:[],animate:!0,motionConfig:"gentle",role:"img"},z=V({},D,{ribbonBlendMode:"normal",ribbonTooltip:H}),q=V({},D,{pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1}),J=function(e){var r=e.padAngle;return T().padAngle(r)},K=function(e){var r=e.width,n=e.height,t=e.innerRadiusRatio,o=e.innerRadiusOffset,i=[r/2,n/2],a=Math.min(r,n)/2,c=a*t,l=a*(t-o);return{center:i,radius:a,innerRadius:c,arcGenerator:L().outerRadius(a).innerRadius(c),ribbonGenerator:S().radius(l)}},N=function(e){var r=e.chord,n=e.data,t=e.keys,o=e.getLabel,i=e.formatValue,a=e.getColor,c=r(n),l=c.groups.map((function(e){var r=V({},e,{id:t[e.index],formattedValue:i(e.value)});return V({},r,{label:o(r),color:a(r)})}));return{arcs:l,ribbons:c.map((function(e){var r=V({},e.source,{id:t[e.source.index],formattedValue:i(e.source.value)}),n=V({},e.target,{id:t[e.target.index],formattedValue:i(e.target.value)});return V({},e,{id:[r.id,n.id].sort().join("."),source:V({},r,{label:o(r),color:a(r)}),target:V({},n,{label:o(n),color:a(n)})})}))}},Q=function(e){var r=e.startAngle,n=e.endAngle,t=e.arcGenerator;return I([r,n],(function(e,r){return t({startAngle:e,endAngle:r})}))},U=function(e){var r=e.sourceStartAngle,n=e.sourceEndAngle,t=e.targetStartAngle,o=e.targetEndAngle,i=e.ribbonGenerator;return I([r,n,t,o],(function(e,r,n,t){return i({source:{startAngle:Math.min(e,r),endAngle:Math.max(r,e)},target:{startAngle:Math.min(n,t),endAngle:Math.max(t,n)}})}))},X=function(e){var n=e.padAngle;return r((function(){return J({padAngle:n})}),[n])},Y=function(e){var n=e.width,t=e.height,o=e.innerRadiusRatio,i=e.innerRadiusOffset;return r((function(){return K({width:n,height:t,innerRadiusRatio:o,innerRadiusOffset:i})}),[n,t,o,i])},Z=function(e){var n=e.chord,t=e.getColor,o=e.keys,i=e.data,a=e.getLabel,c=e.formatValue;return r((function(){return N({chord:n,data:i,keys:o,getLabel:a,formatValue:c,getColor:t})}),[n,t,o,i,a,c])},$=function(e){var n=e.data,t=e.keys,o=e.label,i=void 0===o?D.label:o,a=e.valueFormat,c=e.width,s=e.height,u=e.innerRadiusRatio,b=void 0===u?D.innerRadiusRatio:u,v=e.innerRadiusOffset,f=void 0===v?D.innerRadiusOffset:v,g=e.padAngle,p=void 0===g?D.padAngle:g,h=e.colors,y=void 0===h?D.colors:h,m=X({padAngle:p}),A=Y({width:c,height:s,innerRadiusRatio:b,innerRadiusOffset:f}),R=A.center,O=A.radius,C=A.innerRadius,M=A.arcGenerator,x=A.ribbonGenerator,k=r((function(){return l(i)}),[i]),E=d(a),B=W(y,"id"),I=Z({chord:m,getColor:B,keys:t,data:n,getLabel:k,formatValue:E});return{center:R,chord:m,radius:O,innerRadius:C,arcGenerator:M,ribbonGenerator:x,getColor:B,arcs:I.arcs,ribbons:I.ribbons}},_=function(e){var t=e.arcOpacity,o=void 0===t?D.arcOpacity:t,i=e.activeArcOpacity,a=void 0===i?D.activeArcOpacity:i,c=e.inactiveArcOpacity,l=void 0===c?D.inactiveArcOpacity:c,d=e.ribbons,s=e.ribbonOpacity,u=void 0===s?D.ribbonOpacity:s,b=e.activeRibbonOpacity,v=void 0===b?D.activeRibbonOpacity:b,f=e.inactiveRibbonOpacity,g=void 0===f?D.inactiveRibbonOpacity:f,p=n(null),h=p[0],y=p[1],m=n(null),A=m[0],R=m[1],O=r((function(){var e=[],r=[];return h&&(e.push(h.id),d.filter((function(e){return e.source.id===h.id||e.target.id===h.id})).forEach((function(e){r.push(e.id)}))),A&&(e.push(A.source.id),e.push(A.target.id),r.push(A.id)),{selectedArcIds:e,selectedRibbonIds:r}}),[h,A,d]),C=O.selectedArcIds.length>1||O.selectedRibbonIds.length>0,M=r((function(){return function(e){return C?O.selectedArcIds.includes(e.id)?a:l:o}}),[C,O.selectedArcIds,o,a,l]),x=r((function(){return function(e){return C?O.selectedRibbonIds.includes(e.id)?v:g:u}}),[C,O.selectedRibbonIds,u,v,g]);return V({currentArc:h,setCurrentArc:y,currentRibbon:A,setCurrentRibbon:R,hasSelection:C},O,{getArcOpacity:M,getRibbonOpacity:x})},ee=function(e){var n=e.center,t=e.radius,o=e.arcs,i=e.arcGenerator,a=e.ribbons,c=e.ribbonGenerator;return r((function(){return{center:n,radius:t,arcs:o,arcGenerator:i,ribbons:a,ribbonGenerator:c}}),[n,t,o,i,a,c])},re=e((function(e){var n=e.ribbon,o=e.ribbonGenerator,i=e.animatedProps,a=e.borderWidth,c=e.blendMode,l=e.isInteractive,d=e.setCurrent,s=e.onMouseEnter,u=e.onMouseMove,b=e.onMouseLeave,v=e.onClick,f=e.tooltip,g=x(),p=g.showTooltipFromEvent,h=g.hideTooltip,y=r((function(){if(l)return function(e){d(n),p(t(f,{ribbon:n}),e),null==s||s(n,e)}}),[l,p,f,n,s,d]),m=r((function(){if(l)return function(e){p(t(f,{ribbon:n}),e),null==u||u(n,e)}}),[l,p,f,n,u]),A=r((function(){if(l)return function(e){d(null),h(),null==b||b(n,e)}}),[l,h,n,b,d]),R=r((function(){if(l&&v)return function(e){return null==v?void 0:v(n,e)}}),[l,n,v]);return k(G.path,{"data-testid":"ribbon."+n.source.id+"."+n.target.id,d:U({sourceStartAngle:i.sourceStartAngle,sourceEndAngle:i.sourceEndAngle,targetStartAngle:i.targetStartAngle,targetEndAngle:i.targetEndAngle,ribbonGenerator:o}),fill:i.color,opacity:i.opacity,strokeWidth:a,stroke:i.borderColor,style:{mixBlendMode:c},onMouseEnter:y,onMouseMove:m,onMouseLeave:A,onClick:R})})),ne=function(e,r){var n,t,o=e.source,i=e.target;if(o.startAngle<i.startAngle?(n=o,t=i):(n=i,t=o),r){var a=b(n),c=b(t);return{sourceStartAngle:a,sourceEndAngle:a,targetStartAngle:c,targetEndAngle:c}}return{sourceStartAngle:n.startAngle,sourceEndAngle:n.endAngle,targetStartAngle:t.startAngle,targetEndAngle:t.endAngle}},te=e((function(e){var r=e.ribbons,n=e.ribbonGenerator,t=e.borderWidth,o=e.borderColor,i=e.getOpacity,a=e.blendMode,c=e.isInteractive,l=e.setCurrent,d=e.onMouseEnter,b=e.onMouseMove,v=e.onMouseLeave,f=e.onClick,g=e.tooltip,p=s(),h=p.animate,y=p.config,m=u(),A=B(o,m),R=w(r,{keys:function(e){return e.id},initial:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:i(e),borderColor:A(e.source)})},from:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:0,borderColor:A(e.source)})},update:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:i(e),borderColor:A(e.source)})},leave:function(e){return V({},ne(e,!1),{color:e.source.color,opacity:0,borderColor:A(e.source)})},expires:!0,config:y,immediate:!h});return k(E,{children:R((function(e,r){return k(re,{ribbon:r,ribbonGenerator:n,animatedProps:e,borderWidth:t,blendMode:a,setCurrent:l,isInteractive:c,tooltip:g,onMouseEnter:d,onMouseMove:b,onMouseLeave:v,onClick:f},r.id)}))})})),oe=e((function(e){var n=e.arc,o=e.animatedProps,i=e.borderWidth,a=e.arcGenerator,c=e.setCurrent,l=e.isInteractive,d=e.onMouseEnter,s=e.onMouseMove,u=e.onMouseLeave,b=e.onClick,v=e.tooltip,f=x(),g=f.showTooltipFromEvent,p=f.hideTooltip,h=r((function(){if(l)return function(e){c(n),g(t(v,{arc:n}),e),null==d||d(n,e)}}),[l,g,v,n,d,c]),y=r((function(){if(l)return function(e){g(t(v,{arc:n}),e),null==s||s(n,e)}}),[l,g,v,n,s]),m=r((function(){if(l)return function(e){c(null),p(),null==u||u(n,e)}}),[l,p,n,u,c]),A=r((function(){if(l&&b)return function(e){return null==b?void 0:b(n,e)}}),[l,n,b]);return k(G.path,{"data-testid":"arc."+n.id,d:Q({startAngle:o.startAngle,endAngle:o.endAngle,arcGenerator:a}),fill:o.color,opacity:o.opacity,strokeWidth:i,stroke:o.borderColor,onMouseEnter:h,onMouseMove:y,onMouseLeave:m,onClick:A})})),ie=e((function(e){var r=e.arcs,n=e.borderWidth,t=e.borderColor,o=e.getOpacity,i=e.arcGenerator,a=e.setCurrent,c=e.isInteractive,l=e.onMouseEnter,d=e.onMouseMove,b=e.onMouseLeave,v=e.onClick,f=e.tooltip,g=s(),p=g.animate,h=g.config,y=u(),m=B(t,y),A=w(r,{keys:function(e){return e.id},initial:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:o(e),borderColor:m(e)}},from:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:m(e)}},update:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:o(e),borderColor:m(e)}},leave:function(e){return{startAngle:e.startAngle,endAngle:e.endAngle,color:e.color,opacity:0,borderColor:m(e)}},expires:!0,config:h,immediate:!p});return k(E,{children:A((function(e,r){return k(oe,{arc:r,arcGenerator:i,animatedProps:e,borderWidth:n,setCurrent:a,isInteractive:c,tooltip:f,onMouseEnter:l,onMouseMove:d,onMouseLeave:b,onClick:v},r.id)}))})})),ae=e((function(e){var n=e.arcs,t=e.radius,o=e.rotation,i=e.color,a=s(),c=a.animate,l=a.config,d=u(),f=B(i,d),g=r((function(){return n.map((function(e){var r=b(e),n=v(t,r,o);return{id:e.id,label:e.label,x:n.x,y:n.y,rotation:n.rotate,color:f(e),textAnchor:n.align,dominantBaseline:n.baseline}}))}),[n,t,o,f]),p=w(g,{keys:function(e){return e.id},initial:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},from:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},enter:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},update:function(e){return{x:e.x,y:e.y,rotation:e.rotation,color:e.color}},expires:!0,config:l,immediate:!c});return k(E,{children:p((function(e,r){return k(G.text,{"data-testid":"label."+r.id,style:V({},d.labels.text,{pointerEvents:"none",fill:e.color}),transform:I([e.x,e.y,e.rotation],(function(e,r,n){return"translate("+e+", "+r+") rotate("+n+")"})),textAnchor:r.textAnchor,dominantBaseline:r.dominantBaseline,children:r.label},r.id)}))})})),ce=["isInteractive","animate","motionConfig","theme","renderWrapper"],le=function(e){var r=e.data,n=e.keys,i=e.label,a=e.valueFormat,c=e.margin,l=e.width,d=e.height,s=e.innerRadiusRatio,u=void 0===s?z.innerRadiusRatio:s,b=e.innerRadiusOffset,v=void 0===b?z.innerRadiusOffset:b,f=e.padAngle,h=void 0===f?z.padAngle:f,y=e.layers,m=void 0===y?z.layers:y,R=e.colors,O=void 0===R?z.colors:R,C=e.arcBorderWidth,M=void 0===C?z.arcBorderWidth:C,x=e.arcBorderColor,E=void 0===x?z.arcBorderColor:x,W=e.arcOpacity,B=void 0===W?z.arcOpacity:W,I=e.activeArcOpacity,G=void 0===I?z.activeArcOpacity:I,w=e.inactiveArcOpacity,L=void 0===w?z.inactiveArcOpacity:w,T=e.arcTooltip,S=void 0===T?z.arcTooltip:T,F=e.ribbonBorderWidth,P=void 0===F?z.ribbonBorderWidth:F,j=e.ribbonBorderColor,H=void 0===j?z.ribbonBorderColor:j,D=e.ribbonBlendMode,q=void 0===D?z.ribbonBlendMode:D,J=e.ribbonOpacity,K=void 0===J?z.ribbonOpacity:J,N=e.activeRibbonOpacity,Q=void 0===N?z.activeRibbonOpacity:N,U=e.inactiveRibbonOpacity,X=void 0===U?z.inactiveRibbonOpacity:U,Y=e.ribbonTooltip,Z=void 0===Y?z.ribbonTooltip:Y,re=e.enableLabel,ne=void 0===re?z.enableLabel:re,oe=e.labelOffset,ce=void 0===oe?z.labelOffset:oe,le=e.labelRotation,de=void 0===le?z.labelRotation:le,se=e.labelTextColor,ue=void 0===se?z.labelTextColor:se,be=e.isInteractive,ve=void 0===be?z.isInteractive:be,fe=e.onArcMouseEnter,ge=e.onArcMouseMove,pe=e.onArcMouseLeave,he=e.onArcClick,ye=e.onRibbonMouseEnter,me=e.onRibbonMouseMove,Ae=e.onRibbonMouseLeave,Re=e.onRibbonClick,Oe=e.legends,Ce=void 0===Oe?z.legends:Oe,Me=e.role,xe=void 0===Me?z.role:Me,ke=e.ariaLabel,Ee=e.ariaLabelledBy,We=e.ariaDescribedBy,Be=g(l,d,c),Ie=Be.margin,Ge=Be.innerWidth,we=Be.innerHeight,Le=Be.outerWidth,Te=Be.outerHeight,Se=$({data:r,keys:n,label:i,valueFormat:a,width:Ge,height:we,innerRadiusRatio:u,innerRadiusOffset:v,padAngle:h,colors:O}),Fe=Se.center,Ve=Se.radius,Pe=Se.arcGenerator,je=Se.ribbonGenerator,He=Se.arcs,De=Se.ribbons,ze=_({arcOpacity:B,activeArcOpacity:G,inactiveArcOpacity:L,ribbons:De,ribbonOpacity:K,activeRibbonOpacity:Q,inactiveRibbonOpacity:X}),qe=ze.setCurrentArc,Je=ze.setCurrentRibbon,Ke=ze.getArcOpacity,Ne=ze.getRibbonOpacity,Qe=ee({center:Fe,radius:Ve,arcs:He,arcGenerator:Pe,ribbons:De,ribbonGenerator:je});if(Ve<=0)return null;var Ue=He.map((function(e){return{id:e.id,label:e.label,color:e.color}})),Xe={ribbons:null,arcs:null,labels:null,legends:null};return m.includes("ribbons")&&(Xe.ribbons=k("g",{transform:"translate("+Fe[0]+", "+Fe[1]+")",children:k(te,{ribbons:De,ribbonGenerator:je,borderWidth:P,borderColor:H,getOpacity:Ne,blendMode:q,setCurrent:Je,isInteractive:ve,onMouseEnter:ye,onMouseMove:me,onMouseLeave:Ae,onClick:Re,tooltip:Z})},"ribbons")),m.includes("arcs")&&(Xe.arcs=k("g",{transform:"translate("+Fe[0]+", "+Fe[1]+")",children:k(ie,{arcs:He,arcGenerator:Pe,borderWidth:M,borderColor:E,getOpacity:Ke,setCurrent:qe,isInteractive:ve,onMouseEnter:fe,onMouseMove:ge,onMouseLeave:pe,onClick:he,tooltip:S})},"arcs")),m.includes("labels")&&ne&&(Xe.labels=k("g",{transform:"translate("+Fe[0]+", "+Fe[1]+")",children:k(ae,{arcs:He,radius:Ve+ce,rotation:de,color:ue})},"labels")),m.includes("legends")&&Ce.length>0&&(Xe.legends=k(o,{children:Ce.map((function(e,r){return k(A,V({},e,{containerWidth:Ge,containerHeight:we,data:Ue}),r)}))},"legends")),k(p,{width:Le,height:Te,margin:Ie,role:xe,ariaLabel:ke,ariaLabelledBy:Ee,ariaDescribedBy:We,children:m.map((function(e,r){var n;return"function"==typeof e?k(o,{children:t(e,Qe)},r):null!=(n=null==Xe?void 0:Xe[e])?n:null}))})},de=function(e){var r=e.isInteractive,n=void 0===r?z.isInteractive:r,t=e.animate,o=void 0===t?z.animate:t,i=e.motionConfig,a=void 0===i?z.motionConfig:i,c=e.theme,l=e.renderWrapper,d=P(e,ce);return k(f,{animate:o,isInteractive:n,motionConfig:a,renderWrapper:l,theme:c,children:k(le,V({isInteractive:n},d))})},se=["theme","isInteractive","animate","motionConfig","renderWrapper"],ue=function(e){var r=e.event,n=e.canvasEl,t=e.center,o=e.margin,i=e.radius,a=e.innerRadius,c=e.arcs,l=y(n,r),d=l[0],s=l[1],u=o.left+t[0],b=o.top+t[1];return F(u,b,i,a,c,d,s)},be=function(e){var r=e.pixelRatio,n=void 0===r?q.pixelRatio:r,o=e.margin,l=e.data,d=e.keys,s=e.width,f=e.height,p=e.label,y=void 0===p?q.label:p,m=e.valueFormat,A=e.innerRadiusRatio,O=void 0===A?q.innerRadiusRatio:A,C=e.innerRadiusOffset,M=void 0===C?q.innerRadiusOffset:C,E=e.padAngle,W=void 0===E?q.padAngle:E,I=e.layers,G=void 0===I?q.layers:I,w=e.colors,L=void 0===w?q.colors:w,T=e.arcBorderWidth,S=void 0===T?q.arcBorderWidth:T,F=e.arcBorderColor,P=void 0===F?q.arcBorderColor:F,j=e.arcOpacity,H=void 0===j?q.arcOpacity:j,D=e.activeArcOpacity,z=void 0===D?q.activeArcOpacity:D,J=e.inactiveArcOpacity,K=void 0===J?q.inactiveArcOpacity:J,N=e.arcTooltip,Q=void 0===N?q.arcTooltip:N,U=e.ribbonBorderWidth,X=void 0===U?q.ribbonBorderWidth:U,Y=e.ribbonBorderColor,Z=void 0===Y?q.ribbonBorderColor:Y,re=e.ribbonOpacity,ne=void 0===re?q.ribbonOpacity:re,te=e.activeRibbonOpacity,oe=void 0===te?q.activeRibbonOpacity:te,ie=e.inactiveRibbonOpacity,ae=void 0===ie?q.inactiveRibbonOpacity:ie,ce=e.enableLabel,le=void 0===ce?q.enableLabel:ce,de=e.labelOffset,se=void 0===de?q.labelOffset:de,be=e.labelRotation,ve=void 0===be?q.labelRotation:be,fe=e.labelTextColor,ge=void 0===fe?q.labelTextColor:fe,pe=e.isInteractive,he=void 0===pe?q.isInteractive:pe,ye=e.onArcMouseEnter,me=e.onArcMouseMove,Ae=e.onArcMouseLeave,Re=e.onArcClick,Oe=e.legends,Ce=void 0===Oe?q.legends:Oe,Me=i(null),xe=g(s,f,o),ke=xe.innerWidth,Ee=xe.innerHeight,We=xe.outerWidth,Be=xe.outerHeight,Ie=xe.margin,Ge=$({data:l,keys:d,label:y,valueFormat:m,width:ke,height:Ee,innerRadiusRatio:O,innerRadiusOffset:M,padAngle:W,colors:L}),we=Ge.center,Le=Ge.radius,Te=Ge.innerRadius,Se=Ge.arcGenerator,Fe=Ge.ribbonGenerator,Ve=Ge.arcs,Pe=Ge.ribbons,je=_({arcOpacity:H,activeArcOpacity:z,inactiveArcOpacity:K,ribbons:Pe,ribbonOpacity:ne,activeRibbonOpacity:oe,inactiveRibbonOpacity:ae}),He=je.currentArc,De=je.setCurrentArc,ze=je.getArcOpacity,qe=je.getRibbonOpacity,Je=u(),Ke=B(ge,Je),Ne=B(P,Je),Qe=B(Z,Je),Ue=ee({center:we,radius:Le,arcs:Ve,arcGenerator:Se,ribbons:Pe,ribbonGenerator:Fe});a((function(){if(null!==Me.current){Me.current.width=We*n,Me.current.height=Be*n;var e=Me.current.getContext("2d");e.scale(n,n),e.fillStyle=Je.background,e.fillRect(0,0,We,Be),Le<=0||G.forEach((function(r){if("ribbons"===r&&(e.save(),e.translate(Ie.left+we[0],Ie.top+we[1]),Fe.context(e),Pe.forEach((function(r){e.save(),e.globalAlpha=qe(r),e.fillStyle=r.source.color,e.beginPath(),Fe(r),e.fill(),X>0&&(e.strokeStyle=Qe(r.source),e.lineWidth=X,e.stroke()),e.restore()})),e.restore()),"arcs"===r&&(e.save(),e.translate(Ie.left+we[0],Ie.top+we[1]),Se.context(e),Ve.forEach((function(r){e.save(),e.globalAlpha=ze(r),e.fillStyle=r.color,e.beginPath(),Se(r),e.fill(),S>0&&(e.strokeStyle=Ne(r),e.lineWidth=S,e.stroke()),e.restore()})),e.restore()),"labels"===r&&!0===le&&(e.save(),e.translate(Ie.left+we[0],Ie.top+we[1]),e.font=Je.labels.text.fontSize+"px "+(Je.labels.text.fontFamily||"sans-serif"),Ve.forEach((function(r){var n=b(r),t=v(Le+se,n,ve);e.save(),e.translate(t.x,t.y),e.rotate(h(t.rotate)),e.textAlign=t.align,e.textBaseline=t.baseline,e.fillStyle=Ke(r),e.fillText(r.label,0,0),e.restore()})),e.restore()),"legends"===r){e.save(),e.translate(Ie.left,Ie.top);var n=Ve.map((function(e){return{id:e.id,label:e.label,color:e.color}}));Ce.forEach((function(r){R(e,V({},r,{data:n,containerWidth:ke,containerHeight:Ee,theme:Je}))})),e.restore()}"function"==typeof r&&r(e,Ue)}))}}),[Me,ke,Ee,We,Be,Ie,n,we,Le,Je,G,Ve,Se,ze,S,Ne,Pe,Fe,qe,X,Qe,le,se,ve,Ke,Ce,Ue]);var Xe=x(),Ye=Xe.showTooltipFromEvent,Ze=Xe.hideTooltip,$e=c((function(e){if(null!==Me.current){var r=ue({event:e,canvasEl:Me.current,center:we,margin:Ie,radius:Le,innerRadius:Te,arcs:Ve});r?(De(r),Ye(t(Q,{arc:r}),e),!He&&ye&&ye(r,e),me&&me(r,e),He&&He.id!==r.id&&Ae&&Ae(r,e)):(De(null),Ze(),He&&Ae&&Ae(He,e))}}),[Me,we,Ie,Le,Te,Ve,De,He,Ye,Ze,Q,ye,me,Ae]),_e=c((function(){De(null),Ze()}),[De,Ze]),er=c((function(e){if(null!==Me.current&&Re){var r=ue({event:e,canvasEl:Me.current,center:we,margin:Ie,radius:Le,innerRadius:Te,arcs:Ve});r&&Re(r,e)}}),[Me,we,Ie,Le,Te,Ve,Re]);return k("canvas",{ref:Me,width:We*n,height:Be*n,style:{width:We,height:Be,cursor:he?"auto":"normal"},onMouseEnter:he?$e:void 0,onMouseMove:he?$e:void 0,onMouseLeave:he?_e:void 0,onClick:he?er:void 0})},ve=function(e){var r=e.theme,n=e.isInteractive,t=void 0===n?q.isInteractive:n,o=e.animate,i=void 0===o?q.animate:o,a=e.motionConfig,c=void 0===a?q.motionConfig:a,l=e.renderWrapper,d=P(e,se);return k(f,{isInteractive:t,animate:i,motionConfig:c,theme:r,renderWrapper:l,children:k(be,V({isInteractive:t},d))})},fe=function(e){return k(m,{children:function(r){var n=r.width,t=r.height;return k(de,V({},e,{width:n,height:t}))}})},ge=function(e){return k(m,{children:function(r){var n=r.width,t=r.height;return k(ve,V({},e,{width:n,height:t}))}})};export{de as Chord,ve as ChordCanvas,fe as ResponsiveChord,ge as ResponsiveChordCanvas,q as canvasDefaultProps,D as commonDefaultProps,Q as computeArcPath,N as computeChordArcsAndRibbons,K as computeChordGenerators,J as computeChordLayout,U as computeRibbonPath,z as svgDefaultProps,$ as useChord,Z as useChordArcsAndRibbons,Y as useChordGenerators,X as useChordLayout,_ as useChordSelection,ee as useCustomLayerProps};
//# sourceMappingURL=nivo-chord.es.js.map

@@ -7,3 +7,3 @@ /// <reference types="react" />

export declare const svgDefaultProps: {
ribbonBlendMode: import("@nivo/core").CssMixBlendMode;
ribbonBlendMode: NonNullable<import("@nivo/core").CssMixBlendMode | undefined>;
ribbonTooltip: import("react").MemoExoticComponent<({ ribbon }: import("./types").RibbonTooltipComponentProps) => JSX.Element>;

@@ -10,0 +10,0 @@ legends: import("@nivo/legends").LegendProps[];

@@ -7,3 +7,3 @@ import { AriaAttributes, MouseEvent, FunctionComponent } from 'react';

import { LegendProps } from '@nivo/legends';
export declare type LayerId = 'ribbons' | 'arcs' | 'labels' | 'legends';
export type LayerId = 'ribbons' | 'arcs' | 'labels' | 'legends';
export interface CustomLayerProps {

@@ -17,4 +17,4 @@ center: [number, number];

}
export declare type CustomLayer = FunctionComponent<CustomLayerProps>;
export declare type CustomCanvasLayer = (ctx: CanvasRenderingContext2D, props: CustomLayerProps) => void;
export type CustomLayer = FunctionComponent<CustomLayerProps>;
export type CustomCanvasLayer = (ctx: CanvasRenderingContext2D, props: CustomLayerProps) => void;
export interface ChordDataProps {

@@ -55,3 +55,3 @@ data: number[][];

}
export declare type RibbonGenerator = D3RibbonGenerator<any, RibbonDatum | {
export type RibbonGenerator = D3RibbonGenerator<any, RibbonDatum | {
source: {

@@ -66,3 +66,3 @@ startAngle: number;

}, RibbonDatum>;
export declare type ArcGenerator = D3Arc<any, ArcDatum | {
export type ArcGenerator = D3Arc<any, ArcDatum | {
startAngle: number;

@@ -74,10 +74,10 @@ endAngle: number;

}
export declare type ArcTooltipComponent = FunctionComponent<ArcTooltipComponentProps>;
export type ArcTooltipComponent = FunctionComponent<ArcTooltipComponentProps>;
export interface RibbonTooltipComponentProps {
ribbon: RibbonDatum;
}
export declare type RibbonTooltipComponent = FunctionComponent<RibbonTooltipComponentProps>;
export declare type ChordArcMouseHandler = (arc: any, event: MouseEvent) => void;
export declare type ChordRibbonMouseHandler = (ribbon: any, event: MouseEvent) => void;
export declare type ChordCommonProps = {
export type RibbonTooltipComponent = FunctionComponent<RibbonTooltipComponentProps>;
export type ChordArcMouseHandler = (arc: any, event: MouseEvent) => void;
export type ChordRibbonMouseHandler = (ribbon: any, event: MouseEvent) => void;
export type ChordCommonProps = {
margin: Box;

@@ -119,3 +119,3 @@ label: PropertyAccessor<Omit<ArcDatum, 'label' | 'color'>, string>;

} & Required<ModernMotionProps>;
export declare type ChordSvgProps = Partial<ChordCommonProps> & ChordDataProps & Dimensions & {
export type ChordSvgProps = Partial<ChordCommonProps> & ChordDataProps & Dimensions & {
onRibbonMouseEnter?: ChordRibbonMouseHandler;

@@ -128,3 +128,3 @@ onRibbonMouseMove?: ChordRibbonMouseHandler;

};
export declare type ChordCanvasProps = Partial<ChordCommonProps> & ChordDataProps & Dimensions & {
export type ChordCanvasProps = Partial<ChordCommonProps> & ChordDataProps & Dimensions & {
layers?: (LayerId | CustomCanvasLayer)[];

@@ -131,0 +131,0 @@ pixelRatio?: number;

{
"name": "@nivo/chord",
"version": "0.81.0",
"license": "MIT",
"author": {
"name": "Raphaël Benitte",
"url": "https://github.com/plouc"
},
"repository": {
"type": "git",
"url": "https://github.com/plouc/nivo.git",
"directory": "packages/chord"
},
"keywords": [
"nivo",
"dataviz",
"react",
"d3",
"charts",
"chord-diagram"
],
"main": "./dist/nivo-chord.cjs.js",
"module": "./dist/nivo-chord.es.js",
"typings": "./dist/types/index.d.ts",
"files": [
"README.md",
"LICENSE.md",
"dist/",
"!dist/tsconfig.tsbuildinfo"
],
"dependencies": {
"@nivo/arcs": "0.81.0",
"@nivo/colors": "0.81.0",
"@nivo/legends": "0.81.0",
"@nivo/tooltip": "0.81.0",
"@react-spring/web": "9.4.5 || ^9.7.2",
"d3-chord": "^1.0.6",
"d3-shape": "^1.3.5"
},
"devDependencies": {
"@nivo/core": "0.81.0",
"@types/d3-chord": "^3.0.1"
},
"peerDependencies": {
"@nivo/core": "0.81.0",
"react": ">= 16.14.0 < 19.0.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "56db9cb7738f406a21085c11ab28716044fceb5b"
"name": "@nivo/chord",
"version": "0.82.0",
"license": "MIT",
"author": {
"name": "Raphaël Benitte",
"url": "https://github.com/plouc"
},
"repository": {
"type": "git",
"url": "https://github.com/plouc/nivo.git",
"directory": "packages/chord"
},
"keywords": [
"nivo",
"dataviz",
"react",
"d3",
"charts",
"chord-diagram"
],
"main": "./dist/nivo-chord.cjs.js",
"module": "./dist/nivo-chord.es.js",
"types": "./dist/types/index.d.ts",
"files": [
"README.md",
"LICENSE.md",
"dist/",
"!dist/tsconfig.tsbuildinfo"
],
"dependencies": {
"@nivo/arcs": "0.82.0",
"@nivo/colors": "0.82.0",
"@nivo/legends": "0.82.0",
"@nivo/tooltip": "0.82.0",
"@react-spring/web": "9.4.5 || ^9.7.2",
"@types/d3-chord": "^3.0.1",
"@types/d3-shape": "^2.0.0",
"d3-chord": "^1.0.6",
"d3-shape": "^1.3.5"
},
"peerDependencies": {
"@nivo/core": "workspace:*",
"react": ">= 16.14.0 < 19.0.0"
},
"devDependencies": {
"@nivo/core": "0.82.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "579fc012df24e154a387243559165e344b6523da"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc