@nivo/sankey
Advanced tools
Comparing version 0.79.1 to 0.80.0
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/uniq"),o=require("react"),n=require("@nivo/core"),t=require("@nivo/legends"),i=require("d3-sankey"),r=require("@nivo/tooltip"),a=require("react/jsx-runtime"),l=require("lodash/cloneDeep"),d=require("@nivo/colors"),s=require("@react-spring/web"),c=require("d3-shape");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=u(e),p=u(l);function v(){return v=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},v.apply(this,arguments)}var g={container:{display:"flex",alignItems:"center"},sourceChip:{marginRight:7},targetChip:{marginLeft:7,marginRight:7}},y={center:i.sankeyCenter,justify:i.sankeyJustify,start:i.sankeyLeft,end:i.sankeyRight},f=Object.keys(y),k=function(e){return y[e]},x={layout:"horizontal",align:"center",sort:"auto",colors:{scheme:"nivo"},nodeOpacity:.75,nodeHoverOpacity:1,nodeHoverOthersOpacity:.15,nodeThickness:12,nodeSpacing:12,nodeInnerPadding:0,nodeBorderWidth:1,nodeBorderColor:{from:"color",modifiers:[["darker",.5]]},nodeBorderRadius:0,linkOpacity:.25,linkHoverOpacity:.6,linkHoverOthersOpacity:.15,linkContract:0,linkBlendMode:"multiply",enableLinkGradient:!1,enableLabels:!0,label:"id",labelPosition:"inside",labelPadding:9,labelOrientation:"horizontal",labelTextColor:{from:"color",modifiers:[["darker",.8]]},isInteractive:!0,nodeTooltip:function(e){var o=e.node;return a.jsx(r.BasicTooltip,{id:o.label,enableChip:!0,color:o.color})},linkTooltip:function(e){var o=e.link;return a.jsx(r.BasicTooltip,{id:a.jsxs("span",{style:g.container,children:[a.jsx(r.Chip,{color:o.source.color,style:g.sourceChip}),a.jsx("strong",{children:o.source.label})," > ",a.jsx("strong",{children:o.target.label}),a.jsx(r.Chip,{color:o.target.color,style:g.targetChip}),a.jsx("strong",{children:o.formattedValue})]})})},legends:[],layers:["links","nodes","labels","legends"],role:"img",animate:!0,motionConfig:"gentle"},m=function(e){return e.id},b=function(e){var t=e.data,r=e.valueFormat,a=e.layout,l=e.width,s=e.height,c=e.sort,u=e.align,h=e.colors,v=e.nodeThickness,g=e.nodeSpacing,y=e.nodeInnerPadding,f=e.nodeBorderColor,x=e.label,b=e.labelTextColor,C=o.useState(null),O=C[0],j=C[1],M=o.useState(null),L=M[0],T=M[1],B=o.useMemo((function(){if("auto"!==c)return"input"===c?null:"ascending"===c?function(e,o){return e.value-o.value}:"descending"===c?function(e,o){return o.value-e.value}:c}),[c]),I="input"===c?null:void 0,w=o.useMemo((function(){return"function"==typeof u?u:k(u)}),[u]),P=n.useTheme(),H=d.useOrdinalColorScale(h,"id"),S=d.useInheritedColor(f,P),W=n.usePropertyAccessor(x),F=d.useInheritedColor(b,P),N=n.useValueFormatter(r),E=o.useMemo((function(){return function(e){var o=e.data,n=e.formatValue,t=e.layout,r=e.alignFunction,a=e.sortFunction,l=e.linkSortMode,d=e.nodeThickness,s=e.nodeSpacing,c=e.nodeInnerPadding,u=e.width,h=e.height,v=e.getColor,g=e.getLabel,y=i.sankey().nodeAlign(r).nodeSort(a).linkSort(l).nodeWidth(d).nodePadding(s).size("horizontal"===t?[u,h]:[h,u]).nodeId(m),f=p.default(o);return y(f),f.nodes.forEach((function(e){if(e.color=v(e),e.label=g(e),e.formattedValue=n(e.value),"horizontal"===t)e.x=e.x0+c,e.y=e.y0,e.width=Math.max(e.x1-e.x0-2*c,0),e.height=Math.max(e.y1-e.y0,0);else{e.x=e.y0,e.y=e.x0+c,e.width=Math.max(e.y1-e.y0,0),e.height=Math.max(e.x1-e.x0-2*c,0);var o=e.x0,i=e.x1;e.x0=e.y0,e.x1=e.y1,e.y0=o,e.y1=i}})),f.links.forEach((function(e){e.formattedValue=n(e.value),e.color=e.source.color,e.pos0=e.y0,e.pos1=e.y1,e.thickness=e.width,delete e.y0,delete e.y1,delete e.width})),f}({data:t,formatValue:N,layout:a,alignFunction:w,sortFunction:B,linkSortMode:I,nodeThickness:v,nodeSpacing:g,nodeInnerPadding:y,width:l,height:s,getColor:H,getLabel:W})}),[t,N,a,w,B,I,v,g,y,l,s,H,W]),R=E.nodes,q=E.links,A=o.useMemo((function(){return R.map((function(e){return{id:e.id,label:e.label,color:e.color}}))}),[R]);return{nodes:R,links:q,legendData:A,getNodeBorderColor:S,currentNode:O,setCurrentNode:j,currentLink:L,setCurrentLink:T,getLabelTextColor:F}},C=function(e){var t=e.node,i=e.x,l=e.y,d=e.width,c=e.height,u=e.color,h=e.opacity,p=e.borderWidth,v=e.borderColor,g=e.borderRadius,y=e.setCurrent,f=e.isInteractive,k=e.onClick,x=e.tooltip,m=n.useMotionConfig(),b=m.animate,C=m.config,O=s.useSpring({x:i,y:l,width:d,height:c,opacity:h,color:u,config:C,immediate:!b}),j=r.useTooltip(),M=j.showTooltipFromEvent,L=j.hideTooltip,T=o.useCallback((function(e){y(t),M(o.createElement(x,{node:t}),e,"left")}),[y,t,M,x]),B=o.useCallback((function(e){M(o.createElement(x,{node:t}),e,"left")}),[M,t,x]),I=o.useCallback((function(){y(null),L()}),[y,L]),w=o.useCallback((function(e){null==k||k(t,e)}),[k,t]);return a.jsx(s.animated.rect,{x:O.x,y:O.y,rx:g,ry:g,width:O.width.to((function(e){return Math.max(e,0)})),height:O.height.to((function(e){return Math.max(e,0)})),fill:O.color,fillOpacity:O.opacity,strokeWidth:p,stroke:v,strokeOpacity:h,onMouseEnter:f?T:void 0,onMouseMove:f?B:void 0,onMouseLeave:f?I:void 0,onClick:f?w:void 0})},O=function(e){var o=e.nodes,n=e.nodeOpacity,t=e.nodeHoverOpacity,i=e.nodeHoverOthersOpacity,r=e.borderWidth,l=e.getBorderColor,d=e.borderRadius,s=e.setCurrentNode,c=e.currentNode,u=e.currentLink,h=e.isCurrentNode,p=e.isInteractive,v=e.onClick,g=e.tooltip,y=function(e){return c||u?h(e)?t:i:n};return a.jsx(a.Fragment,{children:o.map((function(e){return a.jsx(C,{node:e,x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,opacity:y(e),borderWidth:r,borderColor:l(e),borderRadius:d,setCurrent:s,isInteractive:p,onClick:v,tooltip:g},e.id)}))})},j=function(e){var o,n=e.id,t=e.layout,i=e.startColor,r=e.endColor;return o="horizontal"===t?{x1:"0%",x2:"100%",y1:"0%",y2:"0%"}:{x1:"0%",x2:"0%",y1:"0%",y2:"100%"},a.jsxs("linearGradient",v({id:n,spreadMethod:"pad"},o,{children:[a.jsx("stop",{offset:"0%",stopColor:i}),a.jsx("stop",{offset:"100%",stopColor:r})]}))},M=function(e){var t=e.link,i=e.layout,l=e.path,d=e.color,c=e.opacity,u=e.blendMode,h=e.enableGradient,p=e.setCurrent,v=e.tooltip,g=e.isInteractive,y=e.onClick,f=t.source.id+"."+t.target.id,k=n.useMotionConfig(),x=k.animate,m=k.config,b=n.useAnimatedPath(l),C=s.useSpring({color:d,opacity:c,config:m,immediate:!x}),O=r.useTooltip(),M=O.showTooltipFromEvent,L=O.hideTooltip,T=o.useCallback((function(e){p(t),M(o.createElement(v,{link:t}),e,"left")}),[p,t,M,v]),B=o.useCallback((function(e){M(o.createElement(v,{link:t}),e,"left")}),[M,t,v]),I=o.useCallback((function(){p(null),L()}),[p,L]),w=o.useCallback((function(e){null==y||y(t,e)}),[y,t]);return a.jsxs(a.Fragment,{children:[h&&a.jsx(j,{id:f,layout:i,startColor:t.startColor||t.source.color,endColor:t.endColor||t.target.color}),a.jsx(s.animated.path,{fill:h?'url("#'+encodeURI(f)+'")':C.color,d:b,fillOpacity:C.opacity,onMouseEnter:g?T:void 0,onMouseMove:g?B:void 0,onMouseLeave:g?I:void 0,onClick:g?w:void 0,style:{mixBlendMode:u}})]})},L=function(e){var n=e.links,t=e.layout,i=e.linkOpacity,r=e.linkHoverOpacity,l=e.linkHoverOthersOpacity,d=e.linkContract,s=e.linkBlendMode,u=e.enableLinkGradient,h=e.setCurrentLink,p=e.currentLink,v=e.currentNode,g=e.isCurrentLink,y=e.isInteractive,f=e.onClick,k=e.tooltip,x=function(e){return v||p?g(e)?r:l:i},m=o.useMemo((function(){return"horizontal"===t?(e=c.line().curve(c.curveMonotoneX),function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.x0-o.source.x1),r=[[o.source.x1,o.pos0-t],[o.source.x1+i,o.pos0-t],[o.target.x0-i,o.pos1-t],[o.target.x0,o.pos1-t],[o.target.x0,o.pos1+t],[o.target.x0-i,o.pos1+t],[o.source.x1+i,o.pos0+t],[o.source.x1,o.pos0+t],[o.source.x1,o.pos0-t]];return e(r)+"Z"}):function(){var e=c.line().curve(c.curveMonotoneY);return function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.y0-o.source.y1),r=[[o.pos0+t,o.source.y1],[o.pos0+t,o.source.y1+i],[o.pos1+t,o.target.y0-i],[o.pos1+t,o.target.y0],[o.pos1-t,o.target.y0],[o.pos1-t,o.target.y0-i],[o.pos0-t,o.source.y1+i],[o.pos0-t,o.source.y1],[o.pos0+t,o.source.y1]];return e(r)+"Z"}}();var e}),[t]);return a.jsx(a.Fragment,{children:n.map((function(e){return a.jsx(M,{link:e,layout:t,path:m(e,d),color:e.color,opacity:x(e),blendMode:s,enableGradient:u,setCurrent:h,isInteractive:y,onClick:f,tooltip:k},e.source.id+"."+e.target.id)}))})},T=function(e){var o=e.nodes,t=e.layout,i=e.width,r=e.height,l=e.labelPosition,d=e.labelPadding,c=e.labelOrientation,u=e.getLabelTextColor,h=n.useTheme(),p="vertical"===c?-90:0,g=o.map((function(e){var o,n,a;return"horizontal"===t?(n=e.y+e.height/2,e.x<i/2?"inside"===l?(o=e.x1+d,a="vertical"===c?"middle":"start"):(o=e.x-d,a="vertical"===c?"middle":"end"):"inside"===l?(o=e.x-d,a="vertical"===c?"middle":"end"):(o=e.x1+d,a="vertical"===c?"middle":"start")):"vertical"===t&&(o=e.x+e.width/2,e.y<r/2?"inside"===l?(n=e.y1+d,a="vertical"===c?"end":"middle"):(n=e.y-d,a="vertical"===c?"start":"middle"):"inside"===l?(n=e.y-d,a="vertical"===c?"start":"middle"):(n=e.y1+d,a="vertical"===c?"end":"middle")),{id:e.id,label:e.label,x:o,y:n,textAnchor:a,color:u(e)}})),y=n.useMotionConfig(),f=y.animate,k=y.config,x=s.useSprings(g.length,g.map((function(e){return{transform:"translate("+e.x+", "+e.y+") rotate("+p+")",color:e.color,config:k,immediate:!f}})));return a.jsx(a.Fragment,{children:x.map((function(e,o){var n=g[o];return a.jsx(s.animated.text,{dominantBaseline:"central",textAnchor:n.textAnchor,transform:e.transform,style:v({},h.labels.text,{fill:e.color,pointerEvents:"none"}),children:n.label},n.id)}))})},B=["isInteractive","animate","motionConfig","theme","renderWrapper"],I=function(e){var i=e.data,r=e.valueFormat,l=e.layout,d=void 0===l?x.layout:l,s=e.sort,c=void 0===s?x.sort:s,u=e.align,p=void 0===u?x.align:u,g=e.width,y=e.height,f=e.margin,k=e.colors,m=void 0===k?x.colors:k,C=e.nodeThickness,j=void 0===C?x.nodeThickness:C,M=e.nodeSpacing,B=void 0===M?x.nodeThickness:M,I=e.nodeInnerPadding,w=void 0===I?x.nodeInnerPadding:I,P=e.nodeBorderColor,H=void 0===P?x.nodeBorderColor:P,S=e.nodeOpacity,W=void 0===S?x.nodeOpacity:S,F=e.nodeHoverOpacity,N=void 0===F?x.nodeHoverOpacity:F,E=e.nodeHoverOthersOpacity,R=void 0===E?x.nodeHoverOthersOpacity:E,q=e.nodeBorderWidth,A=void 0===q?x.nodeBorderWidth:q,z=e.nodeBorderRadius,G=void 0===z?x.nodeBorderRadius:z,D=e.linkOpacity,V=void 0===D?x.linkOpacity:D,Z=e.linkHoverOpacity,_=void 0===Z?x.linkHoverOpacity:Z,J=e.linkHoverOthersOpacity,K=void 0===J?x.linkHoverOthersOpacity:J,U=e.linkContract,X=void 0===U?x.linkContract:U,Y=e.linkBlendMode,Q=void 0===Y?x.linkBlendMode:Y,$=e.enableLinkGradient,ee=void 0===$?x.enableLinkGradient:$,oe=e.enableLabels,ne=void 0===oe?x.enableLabels:oe,te=e.labelPosition,ie=void 0===te?x.labelPosition:te,re=e.labelPadding,ae=void 0===re?x.labelPadding:re,le=e.labelOrientation,de=void 0===le?x.labelOrientation:le,se=e.label,ce=void 0===se?x.label:se,ue=e.labelTextColor,he=void 0===ue?x.labelTextColor:ue,pe=e.nodeTooltip,ve=void 0===pe?x.nodeTooltip:pe,ge=e.linkTooltip,ye=void 0===ge?x.linkTooltip:ge,fe=e.isInteractive,ke=void 0===fe?x.isInteractive:fe,xe=e.onClick,me=e.legends,be=void 0===me?x.legends:me,Ce=e.layers,Oe=void 0===Ce?x.layers:Ce,je=e.role,Me=void 0===je?x.role:je,Le=e.ariaLabel,Te=e.ariaLabelledBy,Be=e.ariaDescribedBy,Ie=n.useDimensions(g,y,f),we=Ie.margin,Pe=Ie.innerWidth,He=Ie.innerHeight,Se=Ie.outerWidth,We=Ie.outerHeight,Fe=b({data:i,valueFormat:r,layout:d,width:Pe,height:He,sort:c,align:p,colors:m,nodeThickness:j,nodeSpacing:B,nodeInnerPadding:w,nodeBorderColor:H,label:ce,labelTextColor:he}),Ne=Fe.nodes,Ee=Fe.links,Re=Fe.legendData,qe=Fe.getNodeBorderColor,Ae=Fe.currentNode,ze=Fe.setCurrentNode,Ge=Fe.currentLink,De=Fe.setCurrentLink,Ve=Fe.getLabelTextColor,Ze=function(){return!1},_e=function(){return!1};if(Ge&&(Ze=function(e){var o=e.id;return o===Ge.source.id||o===Ge.target.id},_e=function(e){var o=e.source,n=e.target;return o.id===Ge.source.id&&n.id===Ge.target.id}),Ae){var Je=[Ae.id];Ee.filter((function(e){var o=e.source,n=e.target;return o.id===Ae.id||n.id===Ae.id})).forEach((function(e){var o=e.source,n=e.target;Je.push(o.id),Je.push(n.id)})),Je=h.default(Je),Ze=function(e){var o=e.id;return Je.includes(o)},_e=function(e){var o=e.source,n=e.target;return o.id===Ae.id||n.id===Ae.id}}var Ke={links:Ee,nodes:Ne,margin:we,width:g,height:y,outerWidth:Se,outerHeight:We},Ue={links:null,nodes:null,labels:null,legends:null};return Oe.includes("links")&&(Ue.links=a.jsx(L,{links:Ee,layout:d,linkContract:X,linkOpacity:V,linkHoverOpacity:_,linkHoverOthersOpacity:K,linkBlendMode:Q,enableLinkGradient:ee,setCurrentLink:De,currentNode:Ae,currentLink:Ge,isCurrentLink:_e,isInteractive:ke,onClick:xe,tooltip:ye},"links")),Oe.includes("nodes")&&(Ue.nodes=a.jsx(O,{nodes:Ne,nodeOpacity:W,nodeHoverOpacity:N,nodeHoverOthersOpacity:R,borderWidth:A,borderRadius:G,getBorderColor:qe,setCurrentNode:ze,currentNode:Ae,currentLink:Ge,isCurrentNode:Ze,isInteractive:ke,onClick:xe,tooltip:ve},"nodes")),Oe.includes("labels")&&ne&&(Ue.labels=a.jsx(T,{nodes:Ne,layout:d,width:Pe,height:He,labelPosition:ie,labelPadding:ae,labelOrientation:de,getLabelTextColor:Ve},"labels")),Oe.includes("legends")&&(Ue.legends=a.jsx(o.Fragment,{children:be.map((function(e,o){return a.jsx(t.BoxLegendSvg,v({},e,{containerWidth:Pe,containerHeight:He,data:Re}),"legend"+o)}))},"legends")),a.jsx(n.SvgWrapper,{width:Se,height:We,margin:we,role:Me,ariaLabel:Le,ariaLabelledBy:Te,ariaDescribedBy:Be,children:Oe.map((function(e,n){var t;return"function"==typeof e?a.jsx(o.Fragment,{children:o.createElement(e,Ke)},n):null!=(t=null==Ue?void 0:Ue[e])?t:null}))})},w=function(e){var o=e.isInteractive,t=void 0===o?x.isInteractive:o,i=e.animate,r=void 0===i?x.animate:i,l=e.motionConfig,d=void 0===l?x.motionConfig:l,s=e.theme,c=e.renderWrapper,u=function(e,o){if(null==e)return{};var n,t,i={},r=Object.keys(e);for(t=0;t<r.length;t++)n=r[t],o.indexOf(n)>=0||(i[n]=e[n]);return i}(e,B);return a.jsx(n.Container,{animate:r,isInteractive:t,motionConfig:d,renderWrapper:c,theme:s,children:a.jsx(I,v({isInteractive:t},u))})};exports.ResponsiveSankey=function(e){return a.jsx(n.ResponsiveWrapper,{children:function(o){var n=o.width,t=o.height;return a.jsx(w,v({width:n,height:t},e))}})},exports.Sankey=w,exports.sankeyAlignmentFromProp=k,exports.sankeyAlignmentPropKeys=f,exports.sankeyAlignmentPropMapping=y,exports.svgDefaultProps=x; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("lodash/uniq"),o=require("react"),n=require("@nivo/core"),t=require("@nivo/legends"),i=require("d3-sankey"),r=require("@nivo/tooltip"),a=require("react/jsx-runtime"),l=require("lodash/cloneDeep"),d=require("@nivo/colors"),s=require("@react-spring/web"),c=require("d3-shape");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=u(e),p=u(l);function v(){return v=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},v.apply(this,arguments)}var g={container:{display:"flex",alignItems:"center"},sourceChip:{marginRight:7},targetChip:{marginLeft:7,marginRight:7}},y={center:i.sankeyCenter,justify:i.sankeyJustify,start:i.sankeyLeft,end:i.sankeyRight},f=Object.keys(y),k=function(e){return y[e]},x={layout:"horizontal",align:"center",sort:"auto",colors:{scheme:"nivo"},nodeOpacity:.75,nodeHoverOpacity:1,nodeHoverOthersOpacity:.15,nodeThickness:12,nodeSpacing:12,nodeInnerPadding:0,nodeBorderWidth:1,nodeBorderColor:{from:"color",modifiers:[["darker",.5]]},nodeBorderRadius:0,linkOpacity:.25,linkHoverOpacity:.6,linkHoverOthersOpacity:.15,linkContract:0,linkBlendMode:"multiply",enableLinkGradient:!1,enableLabels:!0,label:"id",labelPosition:"inside",labelPadding:9,labelOrientation:"horizontal",labelTextColor:{from:"color",modifiers:[["darker",.8]]},isInteractive:!0,nodeTooltip:function(e){var o=e.node;return a.jsx(r.BasicTooltip,{id:o.label,enableChip:!0,color:o.color})},linkTooltip:function(e){var o=e.link;return a.jsx(r.BasicTooltip,{id:a.jsxs("span",{style:g.container,children:[a.jsx(r.Chip,{color:o.source.color,style:g.sourceChip}),a.jsx("strong",{children:o.source.label})," > ",a.jsx("strong",{children:o.target.label}),a.jsx(r.Chip,{color:o.target.color,style:g.targetChip}),a.jsx("strong",{children:o.formattedValue})]})})},legends:[],layers:["links","nodes","labels","legends"],role:"img",animate:!0,motionConfig:"gentle"},m=function(e){return e.id},b=function(e){var t=e.data,r=e.valueFormat,a=e.layout,l=e.width,s=e.height,c=e.sort,u=e.align,h=e.colors,v=e.nodeThickness,g=e.nodeSpacing,y=e.nodeInnerPadding,f=e.nodeBorderColor,x=e.label,b=e.labelTextColor,C=o.useState(null),O=C[0],j=C[1],M=o.useState(null),L=M[0],T=M[1],B=o.useMemo((function(){if("auto"!==c)return"input"===c?null:"ascending"===c?function(e,o){return e.value-o.value}:"descending"===c?function(e,o){return o.value-e.value}:c}),[c]),I="input"===c?null:void 0,w=o.useMemo((function(){return"function"==typeof u?u:k(u)}),[u]),P=n.useTheme(),H=d.useOrdinalColorScale(h,"id"),S=d.useInheritedColor(f,P),W=n.usePropertyAccessor(x),F=d.useInheritedColor(b,P),N=n.useValueFormatter(r),E=o.useMemo((function(){return function(e){var o=e.data,n=e.formatValue,t=e.layout,r=e.alignFunction,a=e.sortFunction,l=e.linkSortMode,d=e.nodeThickness,s=e.nodeSpacing,c=e.nodeInnerPadding,u=e.width,h=e.height,v=e.getColor,g=e.getLabel,y=i.sankey().nodeAlign(r).nodeSort(a).linkSort(l).nodeWidth(d).nodePadding(s).size("horizontal"===t?[u,h]:[h,u]).nodeId(m),f=p.default(o);return y(f),f.nodes.forEach((function(e){if(e.color=v(e),e.label=g(e),e.formattedValue=n(e.value),"horizontal"===t)e.x=e.x0+c,e.y=e.y0,e.width=Math.max(e.x1-e.x0-2*c,0),e.height=Math.max(e.y1-e.y0,0);else{e.x=e.y0,e.y=e.x0+c,e.width=Math.max(e.y1-e.y0,0),e.height=Math.max(e.x1-e.x0-2*c,0);var o=e.x0,i=e.x1;e.x0=e.y0,e.x1=e.y1,e.y0=o,e.y1=i}})),f.links.forEach((function(e){e.formattedValue=n(e.value),e.color=e.source.color,e.pos0=e.y0,e.pos1=e.y1,e.thickness=e.width,delete e.y0,delete e.y1,delete e.width})),f}({data:t,formatValue:N,layout:a,alignFunction:w,sortFunction:B,linkSortMode:I,nodeThickness:v,nodeSpacing:g,nodeInnerPadding:y,width:l,height:s,getColor:H,getLabel:W})}),[t,N,a,w,B,I,v,g,y,l,s,H,W]),R=E.nodes,q=E.links,A=o.useMemo((function(){return R.map((function(e){return{id:e.id,label:e.label,color:e.color}}))}),[R]);return{nodes:R,links:q,legendData:A,getNodeBorderColor:S,currentNode:O,setCurrentNode:j,currentLink:L,setCurrentLink:T,getLabelTextColor:F}},C=function(e){var t=e.node,i=e.x,l=e.y,d=e.width,c=e.height,u=e.color,h=e.opacity,p=e.borderWidth,v=e.borderColor,g=e.borderRadius,y=e.setCurrent,f=e.isInteractive,k=e.onClick,x=e.tooltip,m=n.useMotionConfig(),b=m.animate,C=m.config,O=s.useSpring({x:i,y:l,width:d,height:c,opacity:h,color:u,config:C,immediate:!b}),j=r.useTooltip(),M=j.showTooltipFromEvent,L=j.hideTooltip,T=o.useCallback((function(e){y(t),M(o.createElement(x,{node:t}),e,"left")}),[y,t,M,x]),B=o.useCallback((function(e){M(o.createElement(x,{node:t}),e,"left")}),[M,t,x]),I=o.useCallback((function(){y(null),L()}),[y,L]),w=o.useCallback((function(e){null==k||k(t,e)}),[k,t]);return a.jsx(s.animated.rect,{x:O.x,y:O.y,rx:g,ry:g,width:O.width.to((function(e){return Math.max(e,0)})),height:O.height.to((function(e){return Math.max(e,0)})),fill:O.color,fillOpacity:O.opacity,strokeWidth:p,stroke:v,strokeOpacity:h,onMouseEnter:f?T:void 0,onMouseMove:f?B:void 0,onMouseLeave:f?I:void 0,onClick:f?w:void 0})},O=function(e){var o=e.nodes,n=e.nodeOpacity,t=e.nodeHoverOpacity,i=e.nodeHoverOthersOpacity,r=e.borderWidth,l=e.getBorderColor,d=e.borderRadius,s=e.setCurrentNode,c=e.currentNode,u=e.currentLink,h=e.isCurrentNode,p=e.isInteractive,v=e.onClick,g=e.tooltip,y=function(e){return c||u?h(e)?t:i:n};return a.jsx(a.Fragment,{children:o.map((function(e){return a.jsx(C,{node:e,x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,opacity:y(e),borderWidth:r,borderColor:l(e),borderRadius:d,setCurrent:s,isInteractive:p,onClick:v,tooltip:g},e.id)}))})},j=function(e){var o,n=e.id,t=e.layout,i=e.startColor,r=e.endColor;return o="horizontal"===t?{x1:"0%",x2:"100%",y1:"0%",y2:"0%"}:{x1:"0%",x2:"0%",y1:"0%",y2:"100%"},a.jsxs("linearGradient",v({id:n,spreadMethod:"pad"},o,{children:[a.jsx("stop",{offset:"0%",stopColor:i}),a.jsx("stop",{offset:"100%",stopColor:r})]}))},M=function(e){var t=e.link,i=e.layout,l=e.path,d=e.color,c=e.opacity,u=e.blendMode,h=e.enableGradient,p=e.setCurrent,v=e.tooltip,g=e.isInteractive,y=e.onClick,f=t.source.id+"."+t.target.id+"."+t.index,k=n.useMotionConfig(),x=k.animate,m=k.config,b=n.useAnimatedPath(l),C=s.useSpring({color:d,opacity:c,config:m,immediate:!x}),O=r.useTooltip(),M=O.showTooltipFromEvent,L=O.hideTooltip,T=o.useCallback((function(e){p(t),M(o.createElement(v,{link:t}),e,"left")}),[p,t,M,v]),B=o.useCallback((function(e){M(o.createElement(v,{link:t}),e,"left")}),[M,t,v]),I=o.useCallback((function(){p(null),L()}),[p,L]),w=o.useCallback((function(e){null==y||y(t,e)}),[y,t]);return a.jsxs(a.Fragment,{children:[h&&a.jsx(j,{id:f,layout:i,startColor:t.startColor||t.source.color,endColor:t.endColor||t.target.color}),a.jsx(s.animated.path,{fill:h?'url("#'+encodeURI(f)+'")':C.color,d:b,fillOpacity:C.opacity,onMouseEnter:g?T:void 0,onMouseMove:g?B:void 0,onMouseLeave:g?I:void 0,onClick:g?w:void 0,style:{mixBlendMode:u}})]})},L=function(e){var n=e.links,t=e.layout,i=e.linkOpacity,r=e.linkHoverOpacity,l=e.linkHoverOthersOpacity,d=e.linkContract,s=e.linkBlendMode,u=e.enableLinkGradient,h=e.setCurrentLink,p=e.currentLink,v=e.currentNode,g=e.isCurrentLink,y=e.isInteractive,f=e.onClick,k=e.tooltip,x=function(e){return v||p?g(e)?r:l:i},m=o.useMemo((function(){return"horizontal"===t?(e=c.line().curve(c.curveMonotoneX),function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.x0-o.source.x1),r=[[o.source.x1,o.pos0-t],[o.source.x1+i,o.pos0-t],[o.target.x0-i,o.pos1-t],[o.target.x0,o.pos1-t],[o.target.x0,o.pos1+t],[o.target.x0-i,o.pos1+t],[o.source.x1+i,o.pos0+t],[o.source.x1,o.pos0+t],[o.source.x1,o.pos0-t]];return e(r)+"Z"}):function(){var e=c.line().curve(c.curveMonotoneY);return function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.y0-o.source.y1),r=[[o.pos0+t,o.source.y1],[o.pos0+t,o.source.y1+i],[o.pos1+t,o.target.y0-i],[o.pos1+t,o.target.y0],[o.pos1-t,o.target.y0],[o.pos1-t,o.target.y0-i],[o.pos0-t,o.source.y1+i],[o.pos0-t,o.source.y1],[o.pos0+t,o.source.y1]];return e(r)+"Z"}}();var e}),[t]);return a.jsx(a.Fragment,{children:n.map((function(e){return a.jsx(M,{link:e,layout:t,path:m(e,d),color:e.color,opacity:x(e),blendMode:s,enableGradient:u,setCurrent:h,isInteractive:y,onClick:f,tooltip:k},e.source.id+"."+e.target.id+"."+e.index)}))})},T=function(e){var o=e.nodes,t=e.layout,i=e.width,r=e.height,l=e.labelPosition,d=e.labelPadding,c=e.labelOrientation,u=e.getLabelTextColor,h=n.useTheme(),p="vertical"===c?-90:0,g=o.map((function(e){var o,n,a;return"horizontal"===t?(n=e.y+e.height/2,e.x<i/2?"inside"===l?(o=e.x1+d,a="vertical"===c?"middle":"start"):(o=e.x-d,a="vertical"===c?"middle":"end"):"inside"===l?(o=e.x-d,a="vertical"===c?"middle":"end"):(o=e.x1+d,a="vertical"===c?"middle":"start")):"vertical"===t&&(o=e.x+e.width/2,e.y<r/2?"inside"===l?(n=e.y1+d,a="vertical"===c?"end":"middle"):(n=e.y-d,a="vertical"===c?"start":"middle"):"inside"===l?(n=e.y-d,a="vertical"===c?"start":"middle"):(n=e.y1+d,a="vertical"===c?"end":"middle")),{id:e.id,label:e.label,x:o,y:n,textAnchor:a,color:u(e)}})),y=n.useMotionConfig(),f=y.animate,k=y.config,x=s.useSprings(g.length,g.map((function(e){return{transform:"translate("+e.x+", "+e.y+") rotate("+p+")",color:e.color,config:k,immediate:!f}})));return a.jsx(a.Fragment,{children:x.map((function(e,o){var n=g[o];return a.jsx(s.animated.text,{dominantBaseline:"central",textAnchor:n.textAnchor,transform:e.transform,style:v({},h.labels.text,{fill:e.color,pointerEvents:"none"}),children:n.label},n.id)}))})},B=["isInteractive","animate","motionConfig","theme","renderWrapper"],I=function(e){var i=e.data,r=e.valueFormat,l=e.layout,d=void 0===l?x.layout:l,s=e.sort,c=void 0===s?x.sort:s,u=e.align,p=void 0===u?x.align:u,g=e.width,y=e.height,f=e.margin,k=e.colors,m=void 0===k?x.colors:k,C=e.nodeThickness,j=void 0===C?x.nodeThickness:C,M=e.nodeSpacing,B=void 0===M?x.nodeThickness:M,I=e.nodeInnerPadding,w=void 0===I?x.nodeInnerPadding:I,P=e.nodeBorderColor,H=void 0===P?x.nodeBorderColor:P,S=e.nodeOpacity,W=void 0===S?x.nodeOpacity:S,F=e.nodeHoverOpacity,N=void 0===F?x.nodeHoverOpacity:F,E=e.nodeHoverOthersOpacity,R=void 0===E?x.nodeHoverOthersOpacity:E,q=e.nodeBorderWidth,A=void 0===q?x.nodeBorderWidth:q,z=e.nodeBorderRadius,G=void 0===z?x.nodeBorderRadius:z,D=e.linkOpacity,V=void 0===D?x.linkOpacity:D,Z=e.linkHoverOpacity,_=void 0===Z?x.linkHoverOpacity:Z,J=e.linkHoverOthersOpacity,K=void 0===J?x.linkHoverOthersOpacity:J,U=e.linkContract,X=void 0===U?x.linkContract:U,Y=e.linkBlendMode,Q=void 0===Y?x.linkBlendMode:Y,$=e.enableLinkGradient,ee=void 0===$?x.enableLinkGradient:$,oe=e.enableLabels,ne=void 0===oe?x.enableLabels:oe,te=e.labelPosition,ie=void 0===te?x.labelPosition:te,re=e.labelPadding,ae=void 0===re?x.labelPadding:re,le=e.labelOrientation,de=void 0===le?x.labelOrientation:le,se=e.label,ce=void 0===se?x.label:se,ue=e.labelTextColor,he=void 0===ue?x.labelTextColor:ue,pe=e.nodeTooltip,ve=void 0===pe?x.nodeTooltip:pe,ge=e.linkTooltip,ye=void 0===ge?x.linkTooltip:ge,fe=e.isInteractive,ke=void 0===fe?x.isInteractive:fe,xe=e.onClick,me=e.legends,be=void 0===me?x.legends:me,Ce=e.layers,Oe=void 0===Ce?x.layers:Ce,je=e.role,Me=void 0===je?x.role:je,Le=e.ariaLabel,Te=e.ariaLabelledBy,Be=e.ariaDescribedBy,Ie=n.useDimensions(g,y,f),we=Ie.margin,Pe=Ie.innerWidth,He=Ie.innerHeight,Se=Ie.outerWidth,We=Ie.outerHeight,Fe=b({data:i,valueFormat:r,layout:d,width:Pe,height:He,sort:c,align:p,colors:m,nodeThickness:j,nodeSpacing:B,nodeInnerPadding:w,nodeBorderColor:H,label:ce,labelTextColor:he}),Ne=Fe.nodes,Ee=Fe.links,Re=Fe.legendData,qe=Fe.getNodeBorderColor,Ae=Fe.currentNode,ze=Fe.setCurrentNode,Ge=Fe.currentLink,De=Fe.setCurrentLink,Ve=Fe.getLabelTextColor,Ze=function(){return!1},_e=function(){return!1};if(Ge&&(Ze=function(e){var o=e.id;return o===Ge.source.id||o===Ge.target.id},_e=function(e){var o=e.source,n=e.target;return o.id===Ge.source.id&&n.id===Ge.target.id}),Ae){var Je=[Ae.id];Ee.filter((function(e){var o=e.source,n=e.target;return o.id===Ae.id||n.id===Ae.id})).forEach((function(e){var o=e.source,n=e.target;Je.push(o.id),Je.push(n.id)})),Je=h.default(Je),Ze=function(e){var o=e.id;return Je.includes(o)},_e=function(e){var o=e.source,n=e.target;return o.id===Ae.id||n.id===Ae.id}}var Ke={links:Ee,nodes:Ne,margin:we,width:g,height:y,outerWidth:Se,outerHeight:We},Ue={links:null,nodes:null,labels:null,legends:null};return Oe.includes("links")&&(Ue.links=a.jsx(L,{links:Ee,layout:d,linkContract:X,linkOpacity:V,linkHoverOpacity:_,linkHoverOthersOpacity:K,linkBlendMode:Q,enableLinkGradient:ee,setCurrentLink:De,currentNode:Ae,currentLink:Ge,isCurrentLink:_e,isInteractive:ke,onClick:xe,tooltip:ye},"links")),Oe.includes("nodes")&&(Ue.nodes=a.jsx(O,{nodes:Ne,nodeOpacity:W,nodeHoverOpacity:N,nodeHoverOthersOpacity:R,borderWidth:A,borderRadius:G,getBorderColor:qe,setCurrentNode:ze,currentNode:Ae,currentLink:Ge,isCurrentNode:Ze,isInteractive:ke,onClick:xe,tooltip:ve},"nodes")),Oe.includes("labels")&&ne&&(Ue.labels=a.jsx(T,{nodes:Ne,layout:d,width:Pe,height:He,labelPosition:ie,labelPadding:ae,labelOrientation:de,getLabelTextColor:Ve},"labels")),Oe.includes("legends")&&(Ue.legends=a.jsx(o.Fragment,{children:be.map((function(e,o){return a.jsx(t.BoxLegendSvg,v({},e,{containerWidth:Pe,containerHeight:He,data:Re}),"legend"+o)}))},"legends")),a.jsx(n.SvgWrapper,{width:Se,height:We,margin:we,role:Me,ariaLabel:Le,ariaLabelledBy:Te,ariaDescribedBy:Be,children:Oe.map((function(e,n){var t;return"function"==typeof e?a.jsx(o.Fragment,{children:o.createElement(e,Ke)},n):null!=(t=null==Ue?void 0:Ue[e])?t:null}))})},w=function(e){var o=e.isInteractive,t=void 0===o?x.isInteractive:o,i=e.animate,r=void 0===i?x.animate:i,l=e.motionConfig,d=void 0===l?x.motionConfig:l,s=e.theme,c=e.renderWrapper,u=function(e,o){if(null==e)return{};var n,t,i={},r=Object.keys(e);for(t=0;t<r.length;t++)n=r[t],o.indexOf(n)>=0||(i[n]=e[n]);return i}(e,B);return a.jsx(n.Container,{animate:r,isInteractive:t,motionConfig:d,renderWrapper:c,theme:s,children:a.jsx(I,v({isInteractive:t},u))})};exports.ResponsiveSankey=function(e){return a.jsx(n.ResponsiveWrapper,{children:function(o){var n=o.width,t=o.height;return a.jsx(w,v({width:n,height:t},e))}})},exports.Sankey=w,exports.sankeyAlignmentFromProp=k,exports.sankeyAlignmentPropKeys=f,exports.sankeyAlignmentPropMapping=y,exports.svgDefaultProps=x; | ||
//# sourceMappingURL=nivo-sankey.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"lodash/uniq";import{useState as o,useMemo as n,useCallback as t,createElement as i,Fragment as r}from"react";import{useTheme as l,usePropertyAccessor as a,useValueFormatter as d,useMotionConfig as c,useAnimatedPath as s,Container as u,useDimensions as h,SvgWrapper as v,ResponsiveWrapper as p}from"@nivo/core";import{BoxLegendSvg as g}from"@nivo/legends";import{sankeyCenter as f,sankeyJustify as y,sankeyLeft as m,sankeyRight as k,sankey as b}from"d3-sankey";import{BasicTooltip as C,Chip as x,useTooltip as O}from"@nivo/tooltip";import{jsx as L,jsxs as M,Fragment as T}from"react/jsx-runtime";import w from"lodash/cloneDeep";import{useOrdinalColorScale as B,useInheritedColor as I}from"@nivo/colors";import{useSpring as H,animated as P,useSprings as W}from"@react-spring/web";import{line as N,curveMonotoneX as F,curveMonotoneY as R}from"d3-shape";function S(){return S=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},S.apply(this,arguments)}var z={container:{display:"flex",alignItems:"center"},sourceChip:{marginRight:7},targetChip:{marginLeft:7,marginRight:7}},E={center:f,justify:y,start:m,end:k},G=Object.keys(E),j=function(e){return E[e]},D={layout:"horizontal",align:"center",sort:"auto",colors:{scheme:"nivo"},nodeOpacity:.75,nodeHoverOpacity:1,nodeHoverOthersOpacity:.15,nodeThickness:12,nodeSpacing:12,nodeInnerPadding:0,nodeBorderWidth:1,nodeBorderColor:{from:"color",modifiers:[["darker",.5]]},nodeBorderRadius:0,linkOpacity:.25,linkHoverOpacity:.6,linkHoverOthersOpacity:.15,linkContract:0,linkBlendMode:"multiply",enableLinkGradient:!1,enableLabels:!0,label:"id",labelPosition:"inside",labelPadding:9,labelOrientation:"horizontal",labelTextColor:{from:"color",modifiers:[["darker",.8]]},isInteractive:!0,nodeTooltip:function(e){var o=e.node;return L(C,{id:o.label,enableChip:!0,color:o.color})},linkTooltip:function(e){var o=e.link;return L(C,{id:M("span",{style:z.container,children:[L(x,{color:o.source.color,style:z.sourceChip}),L("strong",{children:o.source.label})," > ",L("strong",{children:o.target.label}),L(x,{color:o.target.color,style:z.targetChip}),L("strong",{children:o.formattedValue})]})})},legends:[],layers:["links","nodes","labels","legends"],role:"img",animate:!0,motionConfig:"gentle"},V=function(e){return e.id},A=function(e){var t=e.data,i=e.valueFormat,r=e.layout,c=e.width,s=e.height,u=e.sort,h=e.align,v=e.colors,p=e.nodeThickness,g=e.nodeSpacing,f=e.nodeInnerPadding,y=e.nodeBorderColor,m=e.label,k=e.labelTextColor,C=o(null),x=C[0],O=C[1],L=o(null),M=L[0],T=L[1],H=n((function(){if("auto"!==u)return"input"===u?null:"ascending"===u?function(e,o){return e.value-o.value}:"descending"===u?function(e,o){return o.value-e.value}:u}),[u]),P="input"===u?null:void 0,W=n((function(){return"function"==typeof h?h:j(h)}),[h]),N=l(),F=B(v,"id"),R=I(y,N),S=a(m),z=I(k,N),E=d(i),G=n((function(){return function(e){var o=e.data,n=e.formatValue,t=e.layout,i=e.alignFunction,r=e.sortFunction,l=e.linkSortMode,a=e.nodeThickness,d=e.nodeSpacing,c=e.nodeInnerPadding,s=e.width,u=e.height,h=e.getColor,v=e.getLabel,p=b().nodeAlign(i).nodeSort(r).linkSort(l).nodeWidth(a).nodePadding(d).size("horizontal"===t?[s,u]:[u,s]).nodeId(V),g=w(o);return p(g),g.nodes.forEach((function(e){if(e.color=h(e),e.label=v(e),e.formattedValue=n(e.value),"horizontal"===t)e.x=e.x0+c,e.y=e.y0,e.width=Math.max(e.x1-e.x0-2*c,0),e.height=Math.max(e.y1-e.y0,0);else{e.x=e.y0,e.y=e.x0+c,e.width=Math.max(e.y1-e.y0,0),e.height=Math.max(e.x1-e.x0-2*c,0);var o=e.x0,i=e.x1;e.x0=e.y0,e.x1=e.y1,e.y0=o,e.y1=i}})),g.links.forEach((function(e){e.formattedValue=n(e.value),e.color=e.source.color,e.pos0=e.y0,e.pos1=e.y1,e.thickness=e.width,delete e.y0,delete e.y1,delete e.width})),g}({data:t,formatValue:E,layout:r,alignFunction:W,sortFunction:H,linkSortMode:P,nodeThickness:p,nodeSpacing:g,nodeInnerPadding:f,width:c,height:s,getColor:F,getLabel:S})}),[t,E,r,W,H,P,p,g,f,c,s,F,S]),D=G.nodes,A=G.links,Z=n((function(){return D.map((function(e){return{id:e.id,label:e.label,color:e.color}}))}),[D]);return{nodes:D,links:A,legendData:Z,getNodeBorderColor:R,currentNode:x,setCurrentNode:O,currentLink:M,setCurrentLink:T,getLabelTextColor:z}},Z=function(e){var o=e.node,n=e.x,r=e.y,l=e.width,a=e.height,d=e.color,s=e.opacity,u=e.borderWidth,h=e.borderColor,v=e.borderRadius,p=e.setCurrent,g=e.isInteractive,f=e.onClick,y=e.tooltip,m=c(),k=m.animate,b=m.config,C=H({x:n,y:r,width:l,height:a,opacity:s,color:d,config:b,immediate:!k}),x=O(),M=x.showTooltipFromEvent,T=x.hideTooltip,w=t((function(e){p(o),M(i(y,{node:o}),e,"left")}),[p,o,M,y]),B=t((function(e){M(i(y,{node:o}),e,"left")}),[M,o,y]),I=t((function(){p(null),T()}),[p,T]),W=t((function(e){null==f||f(o,e)}),[f,o]);return L(P.rect,{x:C.x,y:C.y,rx:v,ry:v,width:C.width.to((function(e){return Math.max(e,0)})),height:C.height.to((function(e){return Math.max(e,0)})),fill:C.color,fillOpacity:C.opacity,strokeWidth:u,stroke:h,strokeOpacity:s,onMouseEnter:g?w:void 0,onMouseMove:g?B:void 0,onMouseLeave:g?I:void 0,onClick:g?W:void 0})},q=function(e){var o=e.nodes,n=e.nodeOpacity,t=e.nodeHoverOpacity,i=e.nodeHoverOthersOpacity,r=e.borderWidth,l=e.getBorderColor,a=e.borderRadius,d=e.setCurrentNode,c=e.currentNode,s=e.currentLink,u=e.isCurrentNode,h=e.isInteractive,v=e.onClick,p=e.tooltip,g=function(e){return c||s?u(e)?t:i:n};return L(T,{children:o.map((function(e){return L(Z,{node:e,x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,opacity:g(e),borderWidth:r,borderColor:l(e),borderRadius:a,setCurrent:d,isInteractive:h,onClick:v,tooltip:p},e.id)}))})},U=function(e){var o=e.id,n=e.layout,t=e.startColor,i=e.endColor;return M("linearGradient",S({id:o,spreadMethod:"pad"},"horizontal"===n?{x1:"0%",x2:"100%",y1:"0%",y2:"0%"}:{x1:"0%",x2:"0%",y1:"0%",y2:"100%"},{children:[L("stop",{offset:"0%",stopColor:t}),L("stop",{offset:"100%",stopColor:i})]}))},J=function(e){var o=e.link,n=e.layout,r=e.path,l=e.color,a=e.opacity,d=e.blendMode,u=e.enableGradient,h=e.setCurrent,v=e.tooltip,p=e.isInteractive,g=e.onClick,f=o.source.id+"."+o.target.id,y=c(),m=y.animate,k=y.config,b=s(r),C=H({color:l,opacity:a,config:k,immediate:!m}),x=O(),w=x.showTooltipFromEvent,B=x.hideTooltip,I=t((function(e){h(o),w(i(v,{link:o}),e,"left")}),[h,o,w,v]),W=t((function(e){w(i(v,{link:o}),e,"left")}),[w,o,v]),N=t((function(){h(null),B()}),[h,B]),F=t((function(e){null==g||g(o,e)}),[g,o]);return M(T,{children:[u&&L(U,{id:f,layout:n,startColor:o.startColor||o.source.color,endColor:o.endColor||o.target.color}),L(P.path,{fill:u?'url("#'+encodeURI(f)+'")':C.color,d:b,fillOpacity:C.opacity,onMouseEnter:p?I:void 0,onMouseMove:p?W:void 0,onMouseLeave:p?N:void 0,onClick:p?F:void 0,style:{mixBlendMode:d}})]})},K=function(e){var o=e.links,t=e.layout,i=e.linkOpacity,r=e.linkHoverOpacity,l=e.linkHoverOthersOpacity,a=e.linkContract,d=e.linkBlendMode,c=e.enableLinkGradient,s=e.setCurrentLink,u=e.currentLink,h=e.currentNode,v=e.isCurrentLink,p=e.isInteractive,g=e.onClick,f=e.tooltip,y=function(e){return h||u?v(e)?r:l:i},m=n((function(){return"horizontal"===t?(e=N().curve(F),function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.x0-o.source.x1),r=[[o.source.x1,o.pos0-t],[o.source.x1+i,o.pos0-t],[o.target.x0-i,o.pos1-t],[o.target.x0,o.pos1-t],[o.target.x0,o.pos1+t],[o.target.x0-i,o.pos1+t],[o.source.x1+i,o.pos0+t],[o.source.x1,o.pos0+t],[o.source.x1,o.pos0-t]];return e(r)+"Z"}):function(){var e=N().curve(R);return function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.y0-o.source.y1),r=[[o.pos0+t,o.source.y1],[o.pos0+t,o.source.y1+i],[o.pos1+t,o.target.y0-i],[o.pos1+t,o.target.y0],[o.pos1-t,o.target.y0],[o.pos1-t,o.target.y0-i],[o.pos0-t,o.source.y1+i],[o.pos0-t,o.source.y1],[o.pos0+t,o.source.y1]];return e(r)+"Z"}}();var e}),[t]);return L(T,{children:o.map((function(e){return L(J,{link:e,layout:t,path:m(e,a),color:e.color,opacity:y(e),blendMode:d,enableGradient:c,setCurrent:s,isInteractive:p,onClick:g,tooltip:f},e.source.id+"."+e.target.id)}))})},Q=function(e){var o=e.nodes,n=e.layout,t=e.width,i=e.height,r=e.labelPosition,a=e.labelPadding,d=e.labelOrientation,s=e.getLabelTextColor,u=l(),h="vertical"===d?-90:0,v=o.map((function(e){var o,l,c;return"horizontal"===n?(l=e.y+e.height/2,e.x<t/2?"inside"===r?(o=e.x1+a,c="vertical"===d?"middle":"start"):(o=e.x-a,c="vertical"===d?"middle":"end"):"inside"===r?(o=e.x-a,c="vertical"===d?"middle":"end"):(o=e.x1+a,c="vertical"===d?"middle":"start")):"vertical"===n&&(o=e.x+e.width/2,e.y<i/2?"inside"===r?(l=e.y1+a,c="vertical"===d?"end":"middle"):(l=e.y-a,c="vertical"===d?"start":"middle"):"inside"===r?(l=e.y-a,c="vertical"===d?"start":"middle"):(l=e.y1+a,c="vertical"===d?"end":"middle")),{id:e.id,label:e.label,x:o,y:l,textAnchor:c,color:s(e)}})),p=c(),g=p.animate,f=p.config,y=W(v.length,v.map((function(e){return{transform:"translate("+e.x+", "+e.y+") rotate("+h+")",color:e.color,config:f,immediate:!g}})));return L(T,{children:y.map((function(e,o){var n=v[o];return L(P.text,{dominantBaseline:"central",textAnchor:n.textAnchor,transform:e.transform,style:S({},u.labels.text,{fill:e.color,pointerEvents:"none"}),children:n.label},n.id)}))})},X=["isInteractive","animate","motionConfig","theme","renderWrapper"],Y=function(o){var n=o.data,t=o.valueFormat,l=o.layout,a=void 0===l?D.layout:l,d=o.sort,c=void 0===d?D.sort:d,s=o.align,u=void 0===s?D.align:s,p=o.width,f=o.height,y=o.margin,m=o.colors,k=void 0===m?D.colors:m,b=o.nodeThickness,C=void 0===b?D.nodeThickness:b,x=o.nodeSpacing,O=void 0===x?D.nodeThickness:x,M=o.nodeInnerPadding,T=void 0===M?D.nodeInnerPadding:M,w=o.nodeBorderColor,B=void 0===w?D.nodeBorderColor:w,I=o.nodeOpacity,H=void 0===I?D.nodeOpacity:I,P=o.nodeHoverOpacity,W=void 0===P?D.nodeHoverOpacity:P,N=o.nodeHoverOthersOpacity,F=void 0===N?D.nodeHoverOthersOpacity:N,R=o.nodeBorderWidth,z=void 0===R?D.nodeBorderWidth:R,E=o.nodeBorderRadius,G=void 0===E?D.nodeBorderRadius:E,j=o.linkOpacity,V=void 0===j?D.linkOpacity:j,Z=o.linkHoverOpacity,U=void 0===Z?D.linkHoverOpacity:Z,J=o.linkHoverOthersOpacity,X=void 0===J?D.linkHoverOthersOpacity:J,Y=o.linkContract,$=void 0===Y?D.linkContract:Y,_=o.linkBlendMode,ee=void 0===_?D.linkBlendMode:_,oe=o.enableLinkGradient,ne=void 0===oe?D.enableLinkGradient:oe,te=o.enableLabels,ie=void 0===te?D.enableLabels:te,re=o.labelPosition,le=void 0===re?D.labelPosition:re,ae=o.labelPadding,de=void 0===ae?D.labelPadding:ae,ce=o.labelOrientation,se=void 0===ce?D.labelOrientation:ce,ue=o.label,he=void 0===ue?D.label:ue,ve=o.labelTextColor,pe=void 0===ve?D.labelTextColor:ve,ge=o.nodeTooltip,fe=void 0===ge?D.nodeTooltip:ge,ye=o.linkTooltip,me=void 0===ye?D.linkTooltip:ye,ke=o.isInteractive,be=void 0===ke?D.isInteractive:ke,Ce=o.onClick,xe=o.legends,Oe=void 0===xe?D.legends:xe,Le=o.layers,Me=void 0===Le?D.layers:Le,Te=o.role,we=void 0===Te?D.role:Te,Be=o.ariaLabel,Ie=o.ariaLabelledBy,He=o.ariaDescribedBy,Pe=h(p,f,y),We=Pe.margin,Ne=Pe.innerWidth,Fe=Pe.innerHeight,Re=Pe.outerWidth,Se=Pe.outerHeight,ze=A({data:n,valueFormat:t,layout:a,width:Ne,height:Fe,sort:c,align:u,colors:k,nodeThickness:C,nodeSpacing:O,nodeInnerPadding:T,nodeBorderColor:B,label:he,labelTextColor:pe}),Ee=ze.nodes,Ge=ze.links,je=ze.legendData,De=ze.getNodeBorderColor,Ve=ze.currentNode,Ae=ze.setCurrentNode,Ze=ze.currentLink,qe=ze.setCurrentLink,Ue=ze.getLabelTextColor,Je=function(){return!1},Ke=function(){return!1};if(Ze&&(Je=function(e){var o=e.id;return o===Ze.source.id||o===Ze.target.id},Ke=function(e){var o=e.source,n=e.target;return o.id===Ze.source.id&&n.id===Ze.target.id}),Ve){var Qe=[Ve.id];Ge.filter((function(e){var o=e.source,n=e.target;return o.id===Ve.id||n.id===Ve.id})).forEach((function(e){var o=e.source,n=e.target;Qe.push(o.id),Qe.push(n.id)})),Qe=e(Qe),Je=function(e){var o=e.id;return Qe.includes(o)},Ke=function(e){var o=e.source,n=e.target;return o.id===Ve.id||n.id===Ve.id}}var Xe={links:Ge,nodes:Ee,margin:We,width:p,height:f,outerWidth:Re,outerHeight:Se},Ye={links:null,nodes:null,labels:null,legends:null};return Me.includes("links")&&(Ye.links=L(K,{links:Ge,layout:a,linkContract:$,linkOpacity:V,linkHoverOpacity:U,linkHoverOthersOpacity:X,linkBlendMode:ee,enableLinkGradient:ne,setCurrentLink:qe,currentNode:Ve,currentLink:Ze,isCurrentLink:Ke,isInteractive:be,onClick:Ce,tooltip:me},"links")),Me.includes("nodes")&&(Ye.nodes=L(q,{nodes:Ee,nodeOpacity:H,nodeHoverOpacity:W,nodeHoverOthersOpacity:F,borderWidth:z,borderRadius:G,getBorderColor:De,setCurrentNode:Ae,currentNode:Ve,currentLink:Ze,isCurrentNode:Je,isInteractive:be,onClick:Ce,tooltip:fe},"nodes")),Me.includes("labels")&&ie&&(Ye.labels=L(Q,{nodes:Ee,layout:a,width:Ne,height:Fe,labelPosition:le,labelPadding:de,labelOrientation:se,getLabelTextColor:Ue},"labels")),Me.includes("legends")&&(Ye.legends=L(r,{children:Oe.map((function(e,o){return L(g,S({},e,{containerWidth:Ne,containerHeight:Fe,data:je}),"legend"+o)}))},"legends")),L(v,{width:Re,height:Se,margin:We,role:we,ariaLabel:Be,ariaLabelledBy:Ie,ariaDescribedBy:He,children:Me.map((function(e,o){var n;return"function"==typeof e?L(r,{children:i(e,Xe)},o):null!=(n=null==Ye?void 0:Ye[e])?n:null}))})},$=function(e){var o=e.isInteractive,n=void 0===o?D.isInteractive:o,t=e.animate,i=void 0===t?D.animate:t,r=e.motionConfig,l=void 0===r?D.motionConfig:r,a=e.theme,d=e.renderWrapper,c=function(e,o){if(null==e)return{};var n,t,i={},r=Object.keys(e);for(t=0;t<r.length;t++)n=r[t],o.indexOf(n)>=0||(i[n]=e[n]);return i}(e,X);return L(u,{animate:i,isInteractive:n,motionConfig:l,renderWrapper:d,theme:a,children:L(Y,S({isInteractive:n},c))})},_=function(e){return L(p,{children:function(o){var n=o.width,t=o.height;return L($,S({width:n,height:t},e))}})};export{_ as ResponsiveSankey,$ as Sankey,j as sankeyAlignmentFromProp,G as sankeyAlignmentPropKeys,E as sankeyAlignmentPropMapping,D as svgDefaultProps}; | ||
import e from"lodash/uniq";import{useState as o,useMemo as n,useCallback as t,createElement as i,Fragment as r}from"react";import{useTheme as l,usePropertyAccessor as a,useValueFormatter as d,useMotionConfig as c,useAnimatedPath as s,Container as u,useDimensions as h,SvgWrapper as v,ResponsiveWrapper as p}from"@nivo/core";import{BoxLegendSvg as g}from"@nivo/legends";import{sankeyCenter as f,sankeyJustify as y,sankeyLeft as m,sankeyRight as k,sankey as b}from"d3-sankey";import{BasicTooltip as C,Chip as x,useTooltip as O}from"@nivo/tooltip";import{jsx as L,jsxs as M,Fragment as T}from"react/jsx-runtime";import w from"lodash/cloneDeep";import{useOrdinalColorScale as B,useInheritedColor as I}from"@nivo/colors";import{useSpring as H,animated as P,useSprings as W}from"@react-spring/web";import{line as N,curveMonotoneX as F,curveMonotoneY as R}from"d3-shape";function S(){return S=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},S.apply(this,arguments)}var z={container:{display:"flex",alignItems:"center"},sourceChip:{marginRight:7},targetChip:{marginLeft:7,marginRight:7}},E={center:f,justify:y,start:m,end:k},G=Object.keys(E),j=function(e){return E[e]},D={layout:"horizontal",align:"center",sort:"auto",colors:{scheme:"nivo"},nodeOpacity:.75,nodeHoverOpacity:1,nodeHoverOthersOpacity:.15,nodeThickness:12,nodeSpacing:12,nodeInnerPadding:0,nodeBorderWidth:1,nodeBorderColor:{from:"color",modifiers:[["darker",.5]]},nodeBorderRadius:0,linkOpacity:.25,linkHoverOpacity:.6,linkHoverOthersOpacity:.15,linkContract:0,linkBlendMode:"multiply",enableLinkGradient:!1,enableLabels:!0,label:"id",labelPosition:"inside",labelPadding:9,labelOrientation:"horizontal",labelTextColor:{from:"color",modifiers:[["darker",.8]]},isInteractive:!0,nodeTooltip:function(e){var o=e.node;return L(C,{id:o.label,enableChip:!0,color:o.color})},linkTooltip:function(e){var o=e.link;return L(C,{id:M("span",{style:z.container,children:[L(x,{color:o.source.color,style:z.sourceChip}),L("strong",{children:o.source.label})," > ",L("strong",{children:o.target.label}),L(x,{color:o.target.color,style:z.targetChip}),L("strong",{children:o.formattedValue})]})})},legends:[],layers:["links","nodes","labels","legends"],role:"img",animate:!0,motionConfig:"gentle"},V=function(e){return e.id},A=function(e){var t=e.data,i=e.valueFormat,r=e.layout,c=e.width,s=e.height,u=e.sort,h=e.align,v=e.colors,p=e.nodeThickness,g=e.nodeSpacing,f=e.nodeInnerPadding,y=e.nodeBorderColor,m=e.label,k=e.labelTextColor,C=o(null),x=C[0],O=C[1],L=o(null),M=L[0],T=L[1],H=n((function(){if("auto"!==u)return"input"===u?null:"ascending"===u?function(e,o){return e.value-o.value}:"descending"===u?function(e,o){return o.value-e.value}:u}),[u]),P="input"===u?null:void 0,W=n((function(){return"function"==typeof h?h:j(h)}),[h]),N=l(),F=B(v,"id"),R=I(y,N),S=a(m),z=I(k,N),E=d(i),G=n((function(){return function(e){var o=e.data,n=e.formatValue,t=e.layout,i=e.alignFunction,r=e.sortFunction,l=e.linkSortMode,a=e.nodeThickness,d=e.nodeSpacing,c=e.nodeInnerPadding,s=e.width,u=e.height,h=e.getColor,v=e.getLabel,p=b().nodeAlign(i).nodeSort(r).linkSort(l).nodeWidth(a).nodePadding(d).size("horizontal"===t?[s,u]:[u,s]).nodeId(V),g=w(o);return p(g),g.nodes.forEach((function(e){if(e.color=h(e),e.label=v(e),e.formattedValue=n(e.value),"horizontal"===t)e.x=e.x0+c,e.y=e.y0,e.width=Math.max(e.x1-e.x0-2*c,0),e.height=Math.max(e.y1-e.y0,0);else{e.x=e.y0,e.y=e.x0+c,e.width=Math.max(e.y1-e.y0,0),e.height=Math.max(e.x1-e.x0-2*c,0);var o=e.x0,i=e.x1;e.x0=e.y0,e.x1=e.y1,e.y0=o,e.y1=i}})),g.links.forEach((function(e){e.formattedValue=n(e.value),e.color=e.source.color,e.pos0=e.y0,e.pos1=e.y1,e.thickness=e.width,delete e.y0,delete e.y1,delete e.width})),g}({data:t,formatValue:E,layout:r,alignFunction:W,sortFunction:H,linkSortMode:P,nodeThickness:p,nodeSpacing:g,nodeInnerPadding:f,width:c,height:s,getColor:F,getLabel:S})}),[t,E,r,W,H,P,p,g,f,c,s,F,S]),D=G.nodes,A=G.links,Z=n((function(){return D.map((function(e){return{id:e.id,label:e.label,color:e.color}}))}),[D]);return{nodes:D,links:A,legendData:Z,getNodeBorderColor:R,currentNode:x,setCurrentNode:O,currentLink:M,setCurrentLink:T,getLabelTextColor:z}},Z=function(e){var o=e.node,n=e.x,r=e.y,l=e.width,a=e.height,d=e.color,s=e.opacity,u=e.borderWidth,h=e.borderColor,v=e.borderRadius,p=e.setCurrent,g=e.isInteractive,f=e.onClick,y=e.tooltip,m=c(),k=m.animate,b=m.config,C=H({x:n,y:r,width:l,height:a,opacity:s,color:d,config:b,immediate:!k}),x=O(),M=x.showTooltipFromEvent,T=x.hideTooltip,w=t((function(e){p(o),M(i(y,{node:o}),e,"left")}),[p,o,M,y]),B=t((function(e){M(i(y,{node:o}),e,"left")}),[M,o,y]),I=t((function(){p(null),T()}),[p,T]),W=t((function(e){null==f||f(o,e)}),[f,o]);return L(P.rect,{x:C.x,y:C.y,rx:v,ry:v,width:C.width.to((function(e){return Math.max(e,0)})),height:C.height.to((function(e){return Math.max(e,0)})),fill:C.color,fillOpacity:C.opacity,strokeWidth:u,stroke:h,strokeOpacity:s,onMouseEnter:g?w:void 0,onMouseMove:g?B:void 0,onMouseLeave:g?I:void 0,onClick:g?W:void 0})},q=function(e){var o=e.nodes,n=e.nodeOpacity,t=e.nodeHoverOpacity,i=e.nodeHoverOthersOpacity,r=e.borderWidth,l=e.getBorderColor,a=e.borderRadius,d=e.setCurrentNode,c=e.currentNode,s=e.currentLink,u=e.isCurrentNode,h=e.isInteractive,v=e.onClick,p=e.tooltip,g=function(e){return c||s?u(e)?t:i:n};return L(T,{children:o.map((function(e){return L(Z,{node:e,x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,opacity:g(e),borderWidth:r,borderColor:l(e),borderRadius:a,setCurrent:d,isInteractive:h,onClick:v,tooltip:p},e.id)}))})},U=function(e){var o=e.id,n=e.layout,t=e.startColor,i=e.endColor;return M("linearGradient",S({id:o,spreadMethod:"pad"},"horizontal"===n?{x1:"0%",x2:"100%",y1:"0%",y2:"0%"}:{x1:"0%",x2:"0%",y1:"0%",y2:"100%"},{children:[L("stop",{offset:"0%",stopColor:t}),L("stop",{offset:"100%",stopColor:i})]}))},J=function(e){var o=e.link,n=e.layout,r=e.path,l=e.color,a=e.opacity,d=e.blendMode,u=e.enableGradient,h=e.setCurrent,v=e.tooltip,p=e.isInteractive,g=e.onClick,f=o.source.id+"."+o.target.id+"."+o.index,y=c(),m=y.animate,k=y.config,b=s(r),C=H({color:l,opacity:a,config:k,immediate:!m}),x=O(),w=x.showTooltipFromEvent,B=x.hideTooltip,I=t((function(e){h(o),w(i(v,{link:o}),e,"left")}),[h,o,w,v]),W=t((function(e){w(i(v,{link:o}),e,"left")}),[w,o,v]),N=t((function(){h(null),B()}),[h,B]),F=t((function(e){null==g||g(o,e)}),[g,o]);return M(T,{children:[u&&L(U,{id:f,layout:n,startColor:o.startColor||o.source.color,endColor:o.endColor||o.target.color}),L(P.path,{fill:u?'url("#'+encodeURI(f)+'")':C.color,d:b,fillOpacity:C.opacity,onMouseEnter:p?I:void 0,onMouseMove:p?W:void 0,onMouseLeave:p?N:void 0,onClick:p?F:void 0,style:{mixBlendMode:d}})]})},K=function(e){var o=e.links,t=e.layout,i=e.linkOpacity,r=e.linkHoverOpacity,l=e.linkHoverOthersOpacity,a=e.linkContract,d=e.linkBlendMode,c=e.enableLinkGradient,s=e.setCurrentLink,u=e.currentLink,h=e.currentNode,v=e.isCurrentLink,p=e.isInteractive,g=e.onClick,f=e.tooltip,y=function(e){return h||u?v(e)?r:l:i},m=n((function(){return"horizontal"===t?(e=N().curve(F),function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.x0-o.source.x1),r=[[o.source.x1,o.pos0-t],[o.source.x1+i,o.pos0-t],[o.target.x0-i,o.pos1-t],[o.target.x0,o.pos1-t],[o.target.x0,o.pos1+t],[o.target.x0-i,o.pos1+t],[o.source.x1+i,o.pos0+t],[o.source.x1,o.pos0+t],[o.source.x1,o.pos0-t]];return e(r)+"Z"}):function(){var e=N().curve(R);return function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.y0-o.source.y1),r=[[o.pos0+t,o.source.y1],[o.pos0+t,o.source.y1+i],[o.pos1+t,o.target.y0-i],[o.pos1+t,o.target.y0],[o.pos1-t,o.target.y0],[o.pos1-t,o.target.y0-i],[o.pos0-t,o.source.y1+i],[o.pos0-t,o.source.y1],[o.pos0+t,o.source.y1]];return e(r)+"Z"}}();var e}),[t]);return L(T,{children:o.map((function(e){return L(J,{link:e,layout:t,path:m(e,a),color:e.color,opacity:y(e),blendMode:d,enableGradient:c,setCurrent:s,isInteractive:p,onClick:g,tooltip:f},e.source.id+"."+e.target.id+"."+e.index)}))})},Q=function(e){var o=e.nodes,n=e.layout,t=e.width,i=e.height,r=e.labelPosition,a=e.labelPadding,d=e.labelOrientation,s=e.getLabelTextColor,u=l(),h="vertical"===d?-90:0,v=o.map((function(e){var o,l,c;return"horizontal"===n?(l=e.y+e.height/2,e.x<t/2?"inside"===r?(o=e.x1+a,c="vertical"===d?"middle":"start"):(o=e.x-a,c="vertical"===d?"middle":"end"):"inside"===r?(o=e.x-a,c="vertical"===d?"middle":"end"):(o=e.x1+a,c="vertical"===d?"middle":"start")):"vertical"===n&&(o=e.x+e.width/2,e.y<i/2?"inside"===r?(l=e.y1+a,c="vertical"===d?"end":"middle"):(l=e.y-a,c="vertical"===d?"start":"middle"):"inside"===r?(l=e.y-a,c="vertical"===d?"start":"middle"):(l=e.y1+a,c="vertical"===d?"end":"middle")),{id:e.id,label:e.label,x:o,y:l,textAnchor:c,color:s(e)}})),p=c(),g=p.animate,f=p.config,y=W(v.length,v.map((function(e){return{transform:"translate("+e.x+", "+e.y+") rotate("+h+")",color:e.color,config:f,immediate:!g}})));return L(T,{children:y.map((function(e,o){var n=v[o];return L(P.text,{dominantBaseline:"central",textAnchor:n.textAnchor,transform:e.transform,style:S({},u.labels.text,{fill:e.color,pointerEvents:"none"}),children:n.label},n.id)}))})},X=["isInteractive","animate","motionConfig","theme","renderWrapper"],Y=function(o){var n=o.data,t=o.valueFormat,l=o.layout,a=void 0===l?D.layout:l,d=o.sort,c=void 0===d?D.sort:d,s=o.align,u=void 0===s?D.align:s,p=o.width,f=o.height,y=o.margin,m=o.colors,k=void 0===m?D.colors:m,b=o.nodeThickness,C=void 0===b?D.nodeThickness:b,x=o.nodeSpacing,O=void 0===x?D.nodeThickness:x,M=o.nodeInnerPadding,T=void 0===M?D.nodeInnerPadding:M,w=o.nodeBorderColor,B=void 0===w?D.nodeBorderColor:w,I=o.nodeOpacity,H=void 0===I?D.nodeOpacity:I,P=o.nodeHoverOpacity,W=void 0===P?D.nodeHoverOpacity:P,N=o.nodeHoverOthersOpacity,F=void 0===N?D.nodeHoverOthersOpacity:N,R=o.nodeBorderWidth,z=void 0===R?D.nodeBorderWidth:R,E=o.nodeBorderRadius,G=void 0===E?D.nodeBorderRadius:E,j=o.linkOpacity,V=void 0===j?D.linkOpacity:j,Z=o.linkHoverOpacity,U=void 0===Z?D.linkHoverOpacity:Z,J=o.linkHoverOthersOpacity,X=void 0===J?D.linkHoverOthersOpacity:J,Y=o.linkContract,$=void 0===Y?D.linkContract:Y,_=o.linkBlendMode,ee=void 0===_?D.linkBlendMode:_,oe=o.enableLinkGradient,ne=void 0===oe?D.enableLinkGradient:oe,te=o.enableLabels,ie=void 0===te?D.enableLabels:te,re=o.labelPosition,le=void 0===re?D.labelPosition:re,ae=o.labelPadding,de=void 0===ae?D.labelPadding:ae,ce=o.labelOrientation,se=void 0===ce?D.labelOrientation:ce,ue=o.label,he=void 0===ue?D.label:ue,ve=o.labelTextColor,pe=void 0===ve?D.labelTextColor:ve,ge=o.nodeTooltip,fe=void 0===ge?D.nodeTooltip:ge,ye=o.linkTooltip,me=void 0===ye?D.linkTooltip:ye,ke=o.isInteractive,be=void 0===ke?D.isInteractive:ke,Ce=o.onClick,xe=o.legends,Oe=void 0===xe?D.legends:xe,Le=o.layers,Me=void 0===Le?D.layers:Le,Te=o.role,we=void 0===Te?D.role:Te,Be=o.ariaLabel,Ie=o.ariaLabelledBy,He=o.ariaDescribedBy,Pe=h(p,f,y),We=Pe.margin,Ne=Pe.innerWidth,Fe=Pe.innerHeight,Re=Pe.outerWidth,Se=Pe.outerHeight,ze=A({data:n,valueFormat:t,layout:a,width:Ne,height:Fe,sort:c,align:u,colors:k,nodeThickness:C,nodeSpacing:O,nodeInnerPadding:T,nodeBorderColor:B,label:he,labelTextColor:pe}),Ee=ze.nodes,Ge=ze.links,je=ze.legendData,De=ze.getNodeBorderColor,Ve=ze.currentNode,Ae=ze.setCurrentNode,Ze=ze.currentLink,qe=ze.setCurrentLink,Ue=ze.getLabelTextColor,Je=function(){return!1},Ke=function(){return!1};if(Ze&&(Je=function(e){var o=e.id;return o===Ze.source.id||o===Ze.target.id},Ke=function(e){var o=e.source,n=e.target;return o.id===Ze.source.id&&n.id===Ze.target.id}),Ve){var Qe=[Ve.id];Ge.filter((function(e){var o=e.source,n=e.target;return o.id===Ve.id||n.id===Ve.id})).forEach((function(e){var o=e.source,n=e.target;Qe.push(o.id),Qe.push(n.id)})),Qe=e(Qe),Je=function(e){var o=e.id;return Qe.includes(o)},Ke=function(e){var o=e.source,n=e.target;return o.id===Ve.id||n.id===Ve.id}}var Xe={links:Ge,nodes:Ee,margin:We,width:p,height:f,outerWidth:Re,outerHeight:Se},Ye={links:null,nodes:null,labels:null,legends:null};return Me.includes("links")&&(Ye.links=L(K,{links:Ge,layout:a,linkContract:$,linkOpacity:V,linkHoverOpacity:U,linkHoverOthersOpacity:X,linkBlendMode:ee,enableLinkGradient:ne,setCurrentLink:qe,currentNode:Ve,currentLink:Ze,isCurrentLink:Ke,isInteractive:be,onClick:Ce,tooltip:me},"links")),Me.includes("nodes")&&(Ye.nodes=L(q,{nodes:Ee,nodeOpacity:H,nodeHoverOpacity:W,nodeHoverOthersOpacity:F,borderWidth:z,borderRadius:G,getBorderColor:De,setCurrentNode:Ae,currentNode:Ve,currentLink:Ze,isCurrentNode:Je,isInteractive:be,onClick:Ce,tooltip:fe},"nodes")),Me.includes("labels")&&ie&&(Ye.labels=L(Q,{nodes:Ee,layout:a,width:Ne,height:Fe,labelPosition:le,labelPadding:de,labelOrientation:se,getLabelTextColor:Ue},"labels")),Me.includes("legends")&&(Ye.legends=L(r,{children:Oe.map((function(e,o){return L(g,S({},e,{containerWidth:Ne,containerHeight:Fe,data:je}),"legend"+o)}))},"legends")),L(v,{width:Re,height:Se,margin:We,role:we,ariaLabel:Be,ariaLabelledBy:Ie,ariaDescribedBy:He,children:Me.map((function(e,o){var n;return"function"==typeof e?L(r,{children:i(e,Xe)},o):null!=(n=null==Ye?void 0:Ye[e])?n:null}))})},$=function(e){var o=e.isInteractive,n=void 0===o?D.isInteractive:o,t=e.animate,i=void 0===t?D.animate:t,r=e.motionConfig,l=void 0===r?D.motionConfig:r,a=e.theme,d=e.renderWrapper,c=function(e,o){if(null==e)return{};var n,t,i={},r=Object.keys(e);for(t=0;t<r.length;t++)n=r[t],o.indexOf(n)>=0||(i[n]=e[n]);return i}(e,X);return L(u,{animate:i,isInteractive:n,motionConfig:l,renderWrapper:d,theme:a,children:L(Y,S({isInteractive:n},c))})},_=function(e){return L(p,{children:function(o){var n=o.width,t=o.height;return L($,S({width:n,height:t},e))}})};export{_ as ResponsiveSankey,$ as Sankey,j as sankeyAlignmentFromProp,G as sankeyAlignmentPropKeys,E as sankeyAlignmentPropMapping,D as svgDefaultProps}; | ||
//# sourceMappingURL=nivo-sankey.es.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("lodash/uniq"),require("react"),require("@nivo/core"),require("@nivo/legends"),require("d3-sankey"),require("@nivo/tooltip"),require("react/jsx-runtime"),require("lodash/cloneDeep"),require("@nivo/colors"),require("@react-spring/web"),require("d3-shape")):"function"==typeof define&&define.amd?define(["exports","lodash/uniq","react","@nivo/core","@nivo/legends","d3-sankey","@nivo/tooltip","react/jsx-runtime","lodash/cloneDeep","@nivo/colors","@react-spring/web","d3-shape"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).nivo=e.nivo||{},e["lodash/uniq"],e.React,e.nivo,e.nivo,e.d3,e.nivo,e["react/jsx-runtime"],e["lodash/cloneDeep"],e.nivo,e["@react-spring/web"],e.d3)}(this,(function(e,o,n,t,i,r,a,l,d,s,c,u){"use strict";function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=h(o),v=h(d);function g(){return g=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},g.apply(this,arguments)}var y={container:{display:"flex",alignItems:"center"},sourceChip:{marginRight:7},targetChip:{marginLeft:7,marginRight:7}},f={center:r.sankeyCenter,justify:r.sankeyJustify,start:r.sankeyLeft,end:r.sankeyRight},k=Object.keys(f),m=function(e){return f[e]},x={layout:"horizontal",align:"center",sort:"auto",colors:{scheme:"nivo"},nodeOpacity:.75,nodeHoverOpacity:1,nodeHoverOthersOpacity:.15,nodeThickness:12,nodeSpacing:12,nodeInnerPadding:0,nodeBorderWidth:1,nodeBorderColor:{from:"color",modifiers:[["darker",.5]]},nodeBorderRadius:0,linkOpacity:.25,linkHoverOpacity:.6,linkHoverOthersOpacity:.15,linkContract:0,linkBlendMode:"multiply",enableLinkGradient:!1,enableLabels:!0,label:"id",labelPosition:"inside",labelPadding:9,labelOrientation:"horizontal",labelTextColor:{from:"color",modifiers:[["darker",.8]]},isInteractive:!0,nodeTooltip:function(e){var o=e.node;return l.jsx(a.BasicTooltip,{id:o.label,enableChip:!0,color:o.color})},linkTooltip:function(e){var o=e.link;return l.jsx(a.BasicTooltip,{id:l.jsxs("span",{style:y.container,children:[l.jsx(a.Chip,{color:o.source.color,style:y.sourceChip}),l.jsx("strong",{children:o.source.label})," > ",l.jsx("strong",{children:o.target.label}),l.jsx(a.Chip,{color:o.target.color,style:y.targetChip}),l.jsx("strong",{children:o.formattedValue})]})})},legends:[],layers:["links","nodes","labels","legends"],role:"img",animate:!0,motionConfig:"gentle"},b=function(e){return e.id},C=function(e){var o=e.data,i=e.valueFormat,a=e.layout,l=e.width,d=e.height,c=e.sort,u=e.align,h=e.colors,p=e.nodeThickness,g=e.nodeSpacing,y=e.nodeInnerPadding,f=e.nodeBorderColor,k=e.label,x=e.labelTextColor,C=n.useState(null),O=C[0],j=C[1],M=n.useState(null),L=M[0],T=M[1],B=n.useMemo((function(){if("auto"!==c)return"input"===c?null:"ascending"===c?function(e,o){return e.value-o.value}:"descending"===c?function(e,o){return o.value-e.value}:c}),[c]),w="input"===c?null:void 0,I=n.useMemo((function(){return"function"==typeof u?u:m(u)}),[u]),P=t.useTheme(),H=s.useOrdinalColorScale(h,"id"),S=s.useInheritedColor(f,P),W=t.usePropertyAccessor(k),F=s.useInheritedColor(x,P),q=t.useValueFormatter(i),N=n.useMemo((function(){return function(e){var o=e.data,n=e.formatValue,t=e.layout,i=e.alignFunction,a=e.sortFunction,l=e.linkSortMode,d=e.nodeThickness,s=e.nodeSpacing,c=e.nodeInnerPadding,u=e.width,h=e.height,p=e.getColor,g=e.getLabel,y=r.sankey().nodeAlign(i).nodeSort(a).linkSort(l).nodeWidth(d).nodePadding(s).size("horizontal"===t?[u,h]:[h,u]).nodeId(b),f=v.default(o);return y(f),f.nodes.forEach((function(e){if(e.color=p(e),e.label=g(e),e.formattedValue=n(e.value),"horizontal"===t)e.x=e.x0+c,e.y=e.y0,e.width=Math.max(e.x1-e.x0-2*c,0),e.height=Math.max(e.y1-e.y0,0);else{e.x=e.y0,e.y=e.x0+c,e.width=Math.max(e.y1-e.y0,0),e.height=Math.max(e.x1-e.x0-2*c,0);var o=e.x0,i=e.x1;e.x0=e.y0,e.x1=e.y1,e.y0=o,e.y1=i}})),f.links.forEach((function(e){e.formattedValue=n(e.value),e.color=e.source.color,e.pos0=e.y0,e.pos1=e.y1,e.thickness=e.width,delete e.y0,delete e.y1,delete e.width})),f}({data:o,formatValue:q,layout:a,alignFunction:I,sortFunction:B,linkSortMode:w,nodeThickness:p,nodeSpacing:g,nodeInnerPadding:y,width:l,height:d,getColor:H,getLabel:W})}),[o,q,a,I,B,w,p,g,y,l,d,H,W]),R=N.nodes,E=N.links,A=n.useMemo((function(){return R.map((function(e){return{id:e.id,label:e.label,color:e.color}}))}),[R]);return{nodes:R,links:E,legendData:A,getNodeBorderColor:S,currentNode:O,setCurrentNode:j,currentLink:L,setCurrentLink:T,getLabelTextColor:F}},O=function(e){var o=e.node,i=e.x,r=e.y,d=e.width,s=e.height,u=e.color,h=e.opacity,p=e.borderWidth,v=e.borderColor,g=e.borderRadius,y=e.setCurrent,f=e.isInteractive,k=e.onClick,m=e.tooltip,x=t.useMotionConfig(),b=x.animate,C=x.config,O=c.useSpring({x:i,y:r,width:d,height:s,opacity:h,color:u,config:C,immediate:!b}),j=a.useTooltip(),M=j.showTooltipFromEvent,L=j.hideTooltip,T=n.useCallback((function(e){y(o),M(n.createElement(m,{node:o}),e,"left")}),[y,o,M,m]),B=n.useCallback((function(e){M(n.createElement(m,{node:o}),e,"left")}),[M,o,m]),w=n.useCallback((function(){y(null),L()}),[y,L]),I=n.useCallback((function(e){null==k||k(o,e)}),[k,o]);return l.jsx(c.animated.rect,{x:O.x,y:O.y,rx:g,ry:g,width:O.width.to((function(e){return Math.max(e,0)})),height:O.height.to((function(e){return Math.max(e,0)})),fill:O.color,fillOpacity:O.opacity,strokeWidth:p,stroke:v,strokeOpacity:h,onMouseEnter:f?T:void 0,onMouseMove:f?B:void 0,onMouseLeave:f?w:void 0,onClick:f?I:void 0})},j=function(e){var o=e.nodes,n=e.nodeOpacity,t=e.nodeHoverOpacity,i=e.nodeHoverOthersOpacity,r=e.borderWidth,a=e.getBorderColor,d=e.borderRadius,s=e.setCurrentNode,c=e.currentNode,u=e.currentLink,h=e.isCurrentNode,p=e.isInteractive,v=e.onClick,g=e.tooltip,y=function(e){return c||u?h(e)?t:i:n};return l.jsx(l.Fragment,{children:o.map((function(e){return l.jsx(O,{node:e,x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,opacity:y(e),borderWidth:r,borderColor:a(e),borderRadius:d,setCurrent:s,isInteractive:p,onClick:v,tooltip:g},e.id)}))})},M=function(e){var o,n=e.id,t=e.layout,i=e.startColor,r=e.endColor;return o="horizontal"===t?{x1:"0%",x2:"100%",y1:"0%",y2:"0%"}:{x1:"0%",x2:"0%",y1:"0%",y2:"100%"},l.jsxs("linearGradient",g({id:n,spreadMethod:"pad"},o,{children:[l.jsx("stop",{offset:"0%",stopColor:i}),l.jsx("stop",{offset:"100%",stopColor:r})]}))},L=function(e){var o=e.link,i=e.layout,r=e.path,d=e.color,s=e.opacity,u=e.blendMode,h=e.enableGradient,p=e.setCurrent,v=e.tooltip,g=e.isInteractive,y=e.onClick,f=o.source.id+"."+o.target.id,k=t.useMotionConfig(),m=k.animate,x=k.config,b=t.useAnimatedPath(r),C=c.useSpring({color:d,opacity:s,config:x,immediate:!m}),O=a.useTooltip(),j=O.showTooltipFromEvent,L=O.hideTooltip,T=n.useCallback((function(e){p(o),j(n.createElement(v,{link:o}),e,"left")}),[p,o,j,v]),B=n.useCallback((function(e){j(n.createElement(v,{link:o}),e,"left")}),[j,o,v]),w=n.useCallback((function(){p(null),L()}),[p,L]),I=n.useCallback((function(e){null==y||y(o,e)}),[y,o]);return l.jsxs(l.Fragment,{children:[h&&l.jsx(M,{id:f,layout:i,startColor:o.startColor||o.source.color,endColor:o.endColor||o.target.color}),l.jsx(c.animated.path,{fill:h?'url("#'+encodeURI(f)+'")':C.color,d:b,fillOpacity:C.opacity,onMouseEnter:g?T:void 0,onMouseMove:g?B:void 0,onMouseLeave:g?w:void 0,onClick:g?I:void 0,style:{mixBlendMode:u}})]})},T=function(e){var o=e.links,t=e.layout,i=e.linkOpacity,r=e.linkHoverOpacity,a=e.linkHoverOthersOpacity,d=e.linkContract,s=e.linkBlendMode,c=e.enableLinkGradient,h=e.setCurrentLink,p=e.currentLink,v=e.currentNode,g=e.isCurrentLink,y=e.isInteractive,f=e.onClick,k=e.tooltip,m=function(e){return v||p?g(e)?r:a:i},x=n.useMemo((function(){return"horizontal"===t?(e=u.line().curve(u.curveMonotoneX),function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.x0-o.source.x1),r=[[o.source.x1,o.pos0-t],[o.source.x1+i,o.pos0-t],[o.target.x0-i,o.pos1-t],[o.target.x0,o.pos1-t],[o.target.x0,o.pos1+t],[o.target.x0-i,o.pos1+t],[o.source.x1+i,o.pos0+t],[o.source.x1,o.pos0+t],[o.source.x1,o.pos0-t]];return e(r)+"Z"}):function(){var e=u.line().curve(u.curveMonotoneY);return function(o,n){var t=Math.max(1,o.thickness-2*n)/2,i=.12*(o.target.y0-o.source.y1),r=[[o.pos0+t,o.source.y1],[o.pos0+t,o.source.y1+i],[o.pos1+t,o.target.y0-i],[o.pos1+t,o.target.y0],[o.pos1-t,o.target.y0],[o.pos1-t,o.target.y0-i],[o.pos0-t,o.source.y1+i],[o.pos0-t,o.source.y1],[o.pos0+t,o.source.y1]];return e(r)+"Z"}}();var e}),[t]);return l.jsx(l.Fragment,{children:o.map((function(e){return l.jsx(L,{link:e,layout:t,path:x(e,d),color:e.color,opacity:m(e),blendMode:s,enableGradient:c,setCurrent:h,isInteractive:y,onClick:f,tooltip:k},e.source.id+"."+e.target.id)}))})},B=function(e){var o=e.nodes,n=e.layout,i=e.width,r=e.height,a=e.labelPosition,d=e.labelPadding,s=e.labelOrientation,u=e.getLabelTextColor,h=t.useTheme(),p="vertical"===s?-90:0,v=o.map((function(e){var o,t,l;return"horizontal"===n?(t=e.y+e.height/2,e.x<i/2?"inside"===a?(o=e.x1+d,l="vertical"===s?"middle":"start"):(o=e.x-d,l="vertical"===s?"middle":"end"):"inside"===a?(o=e.x-d,l="vertical"===s?"middle":"end"):(o=e.x1+d,l="vertical"===s?"middle":"start")):"vertical"===n&&(o=e.x+e.width/2,e.y<r/2?"inside"===a?(t=e.y1+d,l="vertical"===s?"end":"middle"):(t=e.y-d,l="vertical"===s?"start":"middle"):"inside"===a?(t=e.y-d,l="vertical"===s?"start":"middle"):(t=e.y1+d,l="vertical"===s?"end":"middle")),{id:e.id,label:e.label,x:o,y:t,textAnchor:l,color:u(e)}})),y=t.useMotionConfig(),f=y.animate,k=y.config,m=c.useSprings(v.length,v.map((function(e){return{transform:"translate("+e.x+", "+e.y+") rotate("+p+")",color:e.color,config:k,immediate:!f}})));return l.jsx(l.Fragment,{children:m.map((function(e,o){var n=v[o];return l.jsx(c.animated.text,{dominantBaseline:"central",textAnchor:n.textAnchor,transform:e.transform,style:g({},h.labels.text,{fill:e.color,pointerEvents:"none"}),children:n.label},n.id)}))})},w=["isInteractive","animate","motionConfig","theme","renderWrapper"],I=function(e){var o=e.data,r=e.valueFormat,a=e.layout,d=void 0===a?x.layout:a,s=e.sort,c=void 0===s?x.sort:s,u=e.align,h=void 0===u?x.align:u,v=e.width,y=e.height,f=e.margin,k=e.colors,m=void 0===k?x.colors:k,b=e.nodeThickness,O=void 0===b?x.nodeThickness:b,M=e.nodeSpacing,L=void 0===M?x.nodeThickness:M,w=e.nodeInnerPadding,I=void 0===w?x.nodeInnerPadding:w,P=e.nodeBorderColor,H=void 0===P?x.nodeBorderColor:P,S=e.nodeOpacity,W=void 0===S?x.nodeOpacity:S,F=e.nodeHoverOpacity,q=void 0===F?x.nodeHoverOpacity:F,N=e.nodeHoverOthersOpacity,R=void 0===N?x.nodeHoverOthersOpacity:N,E=e.nodeBorderWidth,A=void 0===E?x.nodeBorderWidth:E,D=e.nodeBorderRadius,z=void 0===D?x.nodeBorderRadius:D,G=e.linkOpacity,V=void 0===G?x.linkOpacity:G,Z=e.linkHoverOpacity,_=void 0===Z?x.linkHoverOpacity:Z,J=e.linkHoverOthersOpacity,K=void 0===J?x.linkHoverOthersOpacity:J,U=e.linkContract,X=void 0===U?x.linkContract:U,Y=e.linkBlendMode,Q=void 0===Y?x.linkBlendMode:Y,$=e.enableLinkGradient,ee=void 0===$?x.enableLinkGradient:$,oe=e.enableLabels,ne=void 0===oe?x.enableLabels:oe,te=e.labelPosition,ie=void 0===te?x.labelPosition:te,re=e.labelPadding,ae=void 0===re?x.labelPadding:re,le=e.labelOrientation,de=void 0===le?x.labelOrientation:le,se=e.label,ce=void 0===se?x.label:se,ue=e.labelTextColor,he=void 0===ue?x.labelTextColor:ue,pe=e.nodeTooltip,ve=void 0===pe?x.nodeTooltip:pe,ge=e.linkTooltip,ye=void 0===ge?x.linkTooltip:ge,fe=e.isInteractive,ke=void 0===fe?x.isInteractive:fe,me=e.onClick,xe=e.legends,be=void 0===xe?x.legends:xe,Ce=e.layers,Oe=void 0===Ce?x.layers:Ce,je=e.role,Me=void 0===je?x.role:je,Le=e.ariaLabel,Te=e.ariaLabelledBy,Be=e.ariaDescribedBy,we=t.useDimensions(v,y,f),Ie=we.margin,Pe=we.innerWidth,He=we.innerHeight,Se=we.outerWidth,We=we.outerHeight,Fe=C({data:o,valueFormat:r,layout:d,width:Pe,height:He,sort:c,align:h,colors:m,nodeThickness:O,nodeSpacing:L,nodeInnerPadding:I,nodeBorderColor:H,label:ce,labelTextColor:he}),qe=Fe.nodes,Ne=Fe.links,Re=Fe.legendData,Ee=Fe.getNodeBorderColor,Ae=Fe.currentNode,De=Fe.setCurrentNode,ze=Fe.currentLink,Ge=Fe.setCurrentLink,Ve=Fe.getLabelTextColor,Ze=function(){return!1},_e=function(){return!1};if(ze&&(Ze=function(e){var o=e.id;return o===ze.source.id||o===ze.target.id},_e=function(e){var o=e.source,n=e.target;return o.id===ze.source.id&&n.id===ze.target.id}),Ae){var Je=[Ae.id];Ne.filter((function(e){var o=e.source,n=e.target;return o.id===Ae.id||n.id===Ae.id})).forEach((function(e){var o=e.source,n=e.target;Je.push(o.id),Je.push(n.id)})),Je=p.default(Je),Ze=function(e){var o=e.id;return Je.includes(o)},_e=function(e){var o=e.source,n=e.target;return o.id===Ae.id||n.id===Ae.id}}var Ke={links:Ne,nodes:qe,margin:Ie,width:v,height:y,outerWidth:Se,outerHeight:We},Ue={links:null,nodes:null,labels:null,legends:null};return Oe.includes("links")&&(Ue.links=l.jsx(T,{links:Ne,layout:d,linkContract:X,linkOpacity:V,linkHoverOpacity:_,linkHoverOthersOpacity:K,linkBlendMode:Q,enableLinkGradient:ee,setCurrentLink:Ge,currentNode:Ae,currentLink:ze,isCurrentLink:_e,isInteractive:ke,onClick:me,tooltip:ye},"links")),Oe.includes("nodes")&&(Ue.nodes=l.jsx(j,{nodes:qe,nodeOpacity:W,nodeHoverOpacity:q,nodeHoverOthersOpacity:R,borderWidth:A,borderRadius:z,getBorderColor:Ee,setCurrentNode:De,currentNode:Ae,currentLink:ze,isCurrentNode:Ze,isInteractive:ke,onClick:me,tooltip:ve},"nodes")),Oe.includes("labels")&&ne&&(Ue.labels=l.jsx(B,{nodes:qe,layout:d,width:Pe,height:He,labelPosition:ie,labelPadding:ae,labelOrientation:de,getLabelTextColor:Ve},"labels")),Oe.includes("legends")&&(Ue.legends=l.jsx(n.Fragment,{children:be.map((function(e,o){return l.jsx(i.BoxLegendSvg,g({},e,{containerWidth:Pe,containerHeight:He,data:Re}),"legend"+o)}))},"legends")),l.jsx(t.SvgWrapper,{width:Se,height:We,margin:Ie,role:Me,ariaLabel:Le,ariaLabelledBy:Te,ariaDescribedBy:Be,children:Oe.map((function(e,o){var t;return"function"==typeof e?l.jsx(n.Fragment,{children:n.createElement(e,Ke)},o):null!=(t=null==Ue?void 0:Ue[e])?t:null}))})},P=function(e){var o=e.isInteractive,n=void 0===o?x.isInteractive:o,i=e.animate,r=void 0===i?x.animate:i,a=e.motionConfig,d=void 0===a?x.motionConfig:a,s=e.theme,c=e.renderWrapper,u=function(e,o){if(null==e)return{};var n,t,i={},r=Object.keys(e);for(t=0;t<r.length;t++)n=r[t],o.indexOf(n)>=0||(i[n]=e[n]);return i}(e,w);return l.jsx(t.Container,{animate:r,isInteractive:n,motionConfig:d,renderWrapper:c,theme:s,children:l.jsx(I,g({isInteractive:n},u))})};e.ResponsiveSankey=function(e){return l.jsx(t.ResponsiveWrapper,{children:function(o){var n=o.width,t=o.height;return l.jsx(P,g({width:n,height:t},e))}})},e.Sankey=P,e.sankeyAlignmentFromProp=m,e.sankeyAlignmentPropKeys=k,e.sankeyAlignmentPropMapping=f,e.svgDefaultProps=x,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("lodash/uniq"),require("react"),require("@nivo/core"),require("@nivo/legends"),require("d3-sankey"),require("@nivo/tooltip"),require("react/jsx-runtime"),require("lodash/cloneDeep"),require("@nivo/colors"),require("@react-spring/web"),require("d3-shape")):"function"==typeof define&&define.amd?define(["exports","lodash/uniq","react","@nivo/core","@nivo/legends","d3-sankey","@nivo/tooltip","react/jsx-runtime","lodash/cloneDeep","@nivo/colors","@react-spring/web","d3-shape"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).nivo=e.nivo||{},e["lodash/uniq"],e.React,e.nivo,e.nivo,e.d3,e.nivo,e["react/jsx-runtime"],e["lodash/cloneDeep"],e.nivo,e["@react-spring/web"],e.d3)}(this,(function(e,n,o,t,i,r,a,l,d,s,c,u){"use strict";function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=h(n),v=h(d);function g(){return g=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},g.apply(this,arguments)}var y={container:{display:"flex",alignItems:"center"},sourceChip:{marginRight:7},targetChip:{marginLeft:7,marginRight:7}},f={center:r.sankeyCenter,justify:r.sankeyJustify,start:r.sankeyLeft,end:r.sankeyRight},k=Object.keys(f),m=function(e){return f[e]},x={layout:"horizontal",align:"center",sort:"auto",colors:{scheme:"nivo"},nodeOpacity:.75,nodeHoverOpacity:1,nodeHoverOthersOpacity:.15,nodeThickness:12,nodeSpacing:12,nodeInnerPadding:0,nodeBorderWidth:1,nodeBorderColor:{from:"color",modifiers:[["darker",.5]]},nodeBorderRadius:0,linkOpacity:.25,linkHoverOpacity:.6,linkHoverOthersOpacity:.15,linkContract:0,linkBlendMode:"multiply",enableLinkGradient:!1,enableLabels:!0,label:"id",labelPosition:"inside",labelPadding:9,labelOrientation:"horizontal",labelTextColor:{from:"color",modifiers:[["darker",.8]]},isInteractive:!0,nodeTooltip:function(e){var n=e.node;return l.jsx(a.BasicTooltip,{id:n.label,enableChip:!0,color:n.color})},linkTooltip:function(e){var n=e.link;return l.jsx(a.BasicTooltip,{id:l.jsxs("span",{style:y.container,children:[l.jsx(a.Chip,{color:n.source.color,style:y.sourceChip}),l.jsx("strong",{children:n.source.label})," > ",l.jsx("strong",{children:n.target.label}),l.jsx(a.Chip,{color:n.target.color,style:y.targetChip}),l.jsx("strong",{children:n.formattedValue})]})})},legends:[],layers:["links","nodes","labels","legends"],role:"img",animate:!0,motionConfig:"gentle"},b=function(e){return e.id},C=function(e){var n=e.data,i=e.valueFormat,a=e.layout,l=e.width,d=e.height,c=e.sort,u=e.align,h=e.colors,p=e.nodeThickness,g=e.nodeSpacing,y=e.nodeInnerPadding,f=e.nodeBorderColor,k=e.label,x=e.labelTextColor,C=o.useState(null),O=C[0],j=C[1],M=o.useState(null),L=M[0],T=M[1],B=o.useMemo((function(){if("auto"!==c)return"input"===c?null:"ascending"===c?function(e,n){return e.value-n.value}:"descending"===c?function(e,n){return n.value-e.value}:c}),[c]),w="input"===c?null:void 0,I=o.useMemo((function(){return"function"==typeof u?u:m(u)}),[u]),P=t.useTheme(),H=s.useOrdinalColorScale(h,"id"),S=s.useInheritedColor(f,P),W=t.usePropertyAccessor(k),F=s.useInheritedColor(x,P),q=t.useValueFormatter(i),N=o.useMemo((function(){return function(e){var n=e.data,o=e.formatValue,t=e.layout,i=e.alignFunction,a=e.sortFunction,l=e.linkSortMode,d=e.nodeThickness,s=e.nodeSpacing,c=e.nodeInnerPadding,u=e.width,h=e.height,p=e.getColor,g=e.getLabel,y=r.sankey().nodeAlign(i).nodeSort(a).linkSort(l).nodeWidth(d).nodePadding(s).size("horizontal"===t?[u,h]:[h,u]).nodeId(b),f=v.default(n);return y(f),f.nodes.forEach((function(e){if(e.color=p(e),e.label=g(e),e.formattedValue=o(e.value),"horizontal"===t)e.x=e.x0+c,e.y=e.y0,e.width=Math.max(e.x1-e.x0-2*c,0),e.height=Math.max(e.y1-e.y0,0);else{e.x=e.y0,e.y=e.x0+c,e.width=Math.max(e.y1-e.y0,0),e.height=Math.max(e.x1-e.x0-2*c,0);var n=e.x0,i=e.x1;e.x0=e.y0,e.x1=e.y1,e.y0=n,e.y1=i}})),f.links.forEach((function(e){e.formattedValue=o(e.value),e.color=e.source.color,e.pos0=e.y0,e.pos1=e.y1,e.thickness=e.width,delete e.y0,delete e.y1,delete e.width})),f}({data:n,formatValue:q,layout:a,alignFunction:I,sortFunction:B,linkSortMode:w,nodeThickness:p,nodeSpacing:g,nodeInnerPadding:y,width:l,height:d,getColor:H,getLabel:W})}),[n,q,a,I,B,w,p,g,y,l,d,H,W]),R=N.nodes,E=N.links,A=o.useMemo((function(){return R.map((function(e){return{id:e.id,label:e.label,color:e.color}}))}),[R]);return{nodes:R,links:E,legendData:A,getNodeBorderColor:S,currentNode:O,setCurrentNode:j,currentLink:L,setCurrentLink:T,getLabelTextColor:F}},O=function(e){var n=e.node,i=e.x,r=e.y,d=e.width,s=e.height,u=e.color,h=e.opacity,p=e.borderWidth,v=e.borderColor,g=e.borderRadius,y=e.setCurrent,f=e.isInteractive,k=e.onClick,m=e.tooltip,x=t.useMotionConfig(),b=x.animate,C=x.config,O=c.useSpring({x:i,y:r,width:d,height:s,opacity:h,color:u,config:C,immediate:!b}),j=a.useTooltip(),M=j.showTooltipFromEvent,L=j.hideTooltip,T=o.useCallback((function(e){y(n),M(o.createElement(m,{node:n}),e,"left")}),[y,n,M,m]),B=o.useCallback((function(e){M(o.createElement(m,{node:n}),e,"left")}),[M,n,m]),w=o.useCallback((function(){y(null),L()}),[y,L]),I=o.useCallback((function(e){null==k||k(n,e)}),[k,n]);return l.jsx(c.animated.rect,{x:O.x,y:O.y,rx:g,ry:g,width:O.width.to((function(e){return Math.max(e,0)})),height:O.height.to((function(e){return Math.max(e,0)})),fill:O.color,fillOpacity:O.opacity,strokeWidth:p,stroke:v,strokeOpacity:h,onMouseEnter:f?T:void 0,onMouseMove:f?B:void 0,onMouseLeave:f?w:void 0,onClick:f?I:void 0})},j=function(e){var n=e.nodes,o=e.nodeOpacity,t=e.nodeHoverOpacity,i=e.nodeHoverOthersOpacity,r=e.borderWidth,a=e.getBorderColor,d=e.borderRadius,s=e.setCurrentNode,c=e.currentNode,u=e.currentLink,h=e.isCurrentNode,p=e.isInteractive,v=e.onClick,g=e.tooltip,y=function(e){return c||u?h(e)?t:i:o};return l.jsx(l.Fragment,{children:n.map((function(e){return l.jsx(O,{node:e,x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,opacity:y(e),borderWidth:r,borderColor:a(e),borderRadius:d,setCurrent:s,isInteractive:p,onClick:v,tooltip:g},e.id)}))})},M=function(e){var n,o=e.id,t=e.layout,i=e.startColor,r=e.endColor;return n="horizontal"===t?{x1:"0%",x2:"100%",y1:"0%",y2:"0%"}:{x1:"0%",x2:"0%",y1:"0%",y2:"100%"},l.jsxs("linearGradient",g({id:o,spreadMethod:"pad"},n,{children:[l.jsx("stop",{offset:"0%",stopColor:i}),l.jsx("stop",{offset:"100%",stopColor:r})]}))},L=function(e){var n=e.link,i=e.layout,r=e.path,d=e.color,s=e.opacity,u=e.blendMode,h=e.enableGradient,p=e.setCurrent,v=e.tooltip,g=e.isInteractive,y=e.onClick,f=n.source.id+"."+n.target.id+"."+n.index,k=t.useMotionConfig(),m=k.animate,x=k.config,b=t.useAnimatedPath(r),C=c.useSpring({color:d,opacity:s,config:x,immediate:!m}),O=a.useTooltip(),j=O.showTooltipFromEvent,L=O.hideTooltip,T=o.useCallback((function(e){p(n),j(o.createElement(v,{link:n}),e,"left")}),[p,n,j,v]),B=o.useCallback((function(e){j(o.createElement(v,{link:n}),e,"left")}),[j,n,v]),w=o.useCallback((function(){p(null),L()}),[p,L]),I=o.useCallback((function(e){null==y||y(n,e)}),[y,n]);return l.jsxs(l.Fragment,{children:[h&&l.jsx(M,{id:f,layout:i,startColor:n.startColor||n.source.color,endColor:n.endColor||n.target.color}),l.jsx(c.animated.path,{fill:h?'url("#'+encodeURI(f)+'")':C.color,d:b,fillOpacity:C.opacity,onMouseEnter:g?T:void 0,onMouseMove:g?B:void 0,onMouseLeave:g?w:void 0,onClick:g?I:void 0,style:{mixBlendMode:u}})]})},T=function(e){var n=e.links,t=e.layout,i=e.linkOpacity,r=e.linkHoverOpacity,a=e.linkHoverOthersOpacity,d=e.linkContract,s=e.linkBlendMode,c=e.enableLinkGradient,h=e.setCurrentLink,p=e.currentLink,v=e.currentNode,g=e.isCurrentLink,y=e.isInteractive,f=e.onClick,k=e.tooltip,m=function(e){return v||p?g(e)?r:a:i},x=o.useMemo((function(){return"horizontal"===t?(e=u.line().curve(u.curveMonotoneX),function(n,o){var t=Math.max(1,n.thickness-2*o)/2,i=.12*(n.target.x0-n.source.x1),r=[[n.source.x1,n.pos0-t],[n.source.x1+i,n.pos0-t],[n.target.x0-i,n.pos1-t],[n.target.x0,n.pos1-t],[n.target.x0,n.pos1+t],[n.target.x0-i,n.pos1+t],[n.source.x1+i,n.pos0+t],[n.source.x1,n.pos0+t],[n.source.x1,n.pos0-t]];return e(r)+"Z"}):function(){var e=u.line().curve(u.curveMonotoneY);return function(n,o){var t=Math.max(1,n.thickness-2*o)/2,i=.12*(n.target.y0-n.source.y1),r=[[n.pos0+t,n.source.y1],[n.pos0+t,n.source.y1+i],[n.pos1+t,n.target.y0-i],[n.pos1+t,n.target.y0],[n.pos1-t,n.target.y0],[n.pos1-t,n.target.y0-i],[n.pos0-t,n.source.y1+i],[n.pos0-t,n.source.y1],[n.pos0+t,n.source.y1]];return e(r)+"Z"}}();var e}),[t]);return l.jsx(l.Fragment,{children:n.map((function(e){return l.jsx(L,{link:e,layout:t,path:x(e,d),color:e.color,opacity:m(e),blendMode:s,enableGradient:c,setCurrent:h,isInteractive:y,onClick:f,tooltip:k},e.source.id+"."+e.target.id+"."+e.index)}))})},B=function(e){var n=e.nodes,o=e.layout,i=e.width,r=e.height,a=e.labelPosition,d=e.labelPadding,s=e.labelOrientation,u=e.getLabelTextColor,h=t.useTheme(),p="vertical"===s?-90:0,v=n.map((function(e){var n,t,l;return"horizontal"===o?(t=e.y+e.height/2,e.x<i/2?"inside"===a?(n=e.x1+d,l="vertical"===s?"middle":"start"):(n=e.x-d,l="vertical"===s?"middle":"end"):"inside"===a?(n=e.x-d,l="vertical"===s?"middle":"end"):(n=e.x1+d,l="vertical"===s?"middle":"start")):"vertical"===o&&(n=e.x+e.width/2,e.y<r/2?"inside"===a?(t=e.y1+d,l="vertical"===s?"end":"middle"):(t=e.y-d,l="vertical"===s?"start":"middle"):"inside"===a?(t=e.y-d,l="vertical"===s?"start":"middle"):(t=e.y1+d,l="vertical"===s?"end":"middle")),{id:e.id,label:e.label,x:n,y:t,textAnchor:l,color:u(e)}})),y=t.useMotionConfig(),f=y.animate,k=y.config,m=c.useSprings(v.length,v.map((function(e){return{transform:"translate("+e.x+", "+e.y+") rotate("+p+")",color:e.color,config:k,immediate:!f}})));return l.jsx(l.Fragment,{children:m.map((function(e,n){var o=v[n];return l.jsx(c.animated.text,{dominantBaseline:"central",textAnchor:o.textAnchor,transform:e.transform,style:g({},h.labels.text,{fill:e.color,pointerEvents:"none"}),children:o.label},o.id)}))})},w=["isInteractive","animate","motionConfig","theme","renderWrapper"],I=function(e){var n=e.data,r=e.valueFormat,a=e.layout,d=void 0===a?x.layout:a,s=e.sort,c=void 0===s?x.sort:s,u=e.align,h=void 0===u?x.align:u,v=e.width,y=e.height,f=e.margin,k=e.colors,m=void 0===k?x.colors:k,b=e.nodeThickness,O=void 0===b?x.nodeThickness:b,M=e.nodeSpacing,L=void 0===M?x.nodeThickness:M,w=e.nodeInnerPadding,I=void 0===w?x.nodeInnerPadding:w,P=e.nodeBorderColor,H=void 0===P?x.nodeBorderColor:P,S=e.nodeOpacity,W=void 0===S?x.nodeOpacity:S,F=e.nodeHoverOpacity,q=void 0===F?x.nodeHoverOpacity:F,N=e.nodeHoverOthersOpacity,R=void 0===N?x.nodeHoverOthersOpacity:N,E=e.nodeBorderWidth,A=void 0===E?x.nodeBorderWidth:E,D=e.nodeBorderRadius,z=void 0===D?x.nodeBorderRadius:D,G=e.linkOpacity,V=void 0===G?x.linkOpacity:G,Z=e.linkHoverOpacity,_=void 0===Z?x.linkHoverOpacity:Z,J=e.linkHoverOthersOpacity,K=void 0===J?x.linkHoverOthersOpacity:J,U=e.linkContract,X=void 0===U?x.linkContract:U,Y=e.linkBlendMode,Q=void 0===Y?x.linkBlendMode:Y,$=e.enableLinkGradient,ee=void 0===$?x.enableLinkGradient:$,ne=e.enableLabels,oe=void 0===ne?x.enableLabels:ne,te=e.labelPosition,ie=void 0===te?x.labelPosition:te,re=e.labelPadding,ae=void 0===re?x.labelPadding:re,le=e.labelOrientation,de=void 0===le?x.labelOrientation:le,se=e.label,ce=void 0===se?x.label:se,ue=e.labelTextColor,he=void 0===ue?x.labelTextColor:ue,pe=e.nodeTooltip,ve=void 0===pe?x.nodeTooltip:pe,ge=e.linkTooltip,ye=void 0===ge?x.linkTooltip:ge,fe=e.isInteractive,ke=void 0===fe?x.isInteractive:fe,me=e.onClick,xe=e.legends,be=void 0===xe?x.legends:xe,Ce=e.layers,Oe=void 0===Ce?x.layers:Ce,je=e.role,Me=void 0===je?x.role:je,Le=e.ariaLabel,Te=e.ariaLabelledBy,Be=e.ariaDescribedBy,we=t.useDimensions(v,y,f),Ie=we.margin,Pe=we.innerWidth,He=we.innerHeight,Se=we.outerWidth,We=we.outerHeight,Fe=C({data:n,valueFormat:r,layout:d,width:Pe,height:He,sort:c,align:h,colors:m,nodeThickness:O,nodeSpacing:L,nodeInnerPadding:I,nodeBorderColor:H,label:ce,labelTextColor:he}),qe=Fe.nodes,Ne=Fe.links,Re=Fe.legendData,Ee=Fe.getNodeBorderColor,Ae=Fe.currentNode,De=Fe.setCurrentNode,ze=Fe.currentLink,Ge=Fe.setCurrentLink,Ve=Fe.getLabelTextColor,Ze=function(){return!1},_e=function(){return!1};if(ze&&(Ze=function(e){var n=e.id;return n===ze.source.id||n===ze.target.id},_e=function(e){var n=e.source,o=e.target;return n.id===ze.source.id&&o.id===ze.target.id}),Ae){var Je=[Ae.id];Ne.filter((function(e){var n=e.source,o=e.target;return n.id===Ae.id||o.id===Ae.id})).forEach((function(e){var n=e.source,o=e.target;Je.push(n.id),Je.push(o.id)})),Je=p.default(Je),Ze=function(e){var n=e.id;return Je.includes(n)},_e=function(e){var n=e.source,o=e.target;return n.id===Ae.id||o.id===Ae.id}}var Ke={links:Ne,nodes:qe,margin:Ie,width:v,height:y,outerWidth:Se,outerHeight:We},Ue={links:null,nodes:null,labels:null,legends:null};return Oe.includes("links")&&(Ue.links=l.jsx(T,{links:Ne,layout:d,linkContract:X,linkOpacity:V,linkHoverOpacity:_,linkHoverOthersOpacity:K,linkBlendMode:Q,enableLinkGradient:ee,setCurrentLink:Ge,currentNode:Ae,currentLink:ze,isCurrentLink:_e,isInteractive:ke,onClick:me,tooltip:ye},"links")),Oe.includes("nodes")&&(Ue.nodes=l.jsx(j,{nodes:qe,nodeOpacity:W,nodeHoverOpacity:q,nodeHoverOthersOpacity:R,borderWidth:A,borderRadius:z,getBorderColor:Ee,setCurrentNode:De,currentNode:Ae,currentLink:ze,isCurrentNode:Ze,isInteractive:ke,onClick:me,tooltip:ve},"nodes")),Oe.includes("labels")&&oe&&(Ue.labels=l.jsx(B,{nodes:qe,layout:d,width:Pe,height:He,labelPosition:ie,labelPadding:ae,labelOrientation:de,getLabelTextColor:Ve},"labels")),Oe.includes("legends")&&(Ue.legends=l.jsx(o.Fragment,{children:be.map((function(e,n){return l.jsx(i.BoxLegendSvg,g({},e,{containerWidth:Pe,containerHeight:He,data:Re}),"legend"+n)}))},"legends")),l.jsx(t.SvgWrapper,{width:Se,height:We,margin:Ie,role:Me,ariaLabel:Le,ariaLabelledBy:Te,ariaDescribedBy:Be,children:Oe.map((function(e,n){var t;return"function"==typeof e?l.jsx(o.Fragment,{children:o.createElement(e,Ke)},n):null!=(t=null==Ue?void 0:Ue[e])?t:null}))})},P=function(e){var n=e.isInteractive,o=void 0===n?x.isInteractive:n,i=e.animate,r=void 0===i?x.animate:i,a=e.motionConfig,d=void 0===a?x.motionConfig:a,s=e.theme,c=e.renderWrapper,u=function(e,n){if(null==e)return{};var o,t,i={},r=Object.keys(e);for(t=0;t<r.length;t++)o=r[t],n.indexOf(o)>=0||(i[o]=e[o]);return i}(e,w);return l.jsx(t.Container,{animate:r,isInteractive:o,motionConfig:d,renderWrapper:c,theme:s,children:l.jsx(I,g({isInteractive:o},u))})};e.ResponsiveSankey=function(e){return l.jsx(t.ResponsiveWrapper,{children:function(n){var o=n.width,t=n.height;return l.jsx(P,g({width:o,height:t},e))}})},e.Sankey=P,e.sankeyAlignmentFromProp=m,e.sankeyAlignmentPropKeys=k,e.sankeyAlignmentPropMapping=f,e.svgDefaultProps=x,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=nivo-sankey.umd.js.map |
{ | ||
"name": "@nivo/sankey", | ||
"version": "0.79.1", | ||
"version": "0.80.0", | ||
"license": "MIT", | ||
@@ -32,6 +32,6 @@ "author": { | ||
"dependencies": { | ||
"@nivo/colors": "0.79.1", | ||
"@nivo/legends": "0.79.1", | ||
"@nivo/tooltip": "0.79.0", | ||
"@react-spring/web": "9.3.1", | ||
"@nivo/colors": "0.80.0", | ||
"@nivo/legends": "0.80.0", | ||
"@nivo/tooltip": "0.80.0", | ||
"@react-spring/web": "9.4.5", | ||
"d3-sankey": "^0.12.3", | ||
@@ -42,8 +42,8 @@ "d3-shape": "^1.3.5", | ||
"devDependencies": { | ||
"@nivo/core": "0.79.0", | ||
"@nivo/core": "0.80.0", | ||
"@types/d3-sankey": "^0.11.2" | ||
}, | ||
"peerDependencies": { | ||
"@nivo/core": "0.79.0", | ||
"react": ">= 16.14.0 < 18.0.0" | ||
"@nivo/core": "0.80.0", | ||
"react": ">= 16.14.0 < 19.0.0" | ||
}, | ||
@@ -53,3 +53,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "f0a673005e918b2e2d3e635c6f214aa088bac5e1" | ||
"gitHead": "df352b82a7d3b7938fb3a1bd9be3f602cbc8a67f" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
245313
+ Added@nivo/colors@0.80.0(transitive)
+ Added@nivo/core@0.80.0(transitive)
+ Added@nivo/recompose@0.80.0(transitive)
+ Added@nivo/tooltip@0.80.0(transitive)
+ Added@react-spring/animated@9.4.5(transitive)
+ Added@react-spring/core@9.4.5(transitive)
+ Added@react-spring/rafz@9.4.5(transitive)
+ Added@react-spring/shared@9.4.5(transitive)
+ Added@react-spring/types@9.4.5(transitive)
+ Added@react-spring/web@9.4.5(transitive)
+ Addedreact@18.3.119.0.0(transitive)
+ Addedreact-dom@19.0.0(transitive)
+ Addedscheduler@0.25.0(transitive)
- Removed@nivo/colors@0.79.1(transitive)
- Removed@nivo/core@0.79.0(transitive)
- Removed@nivo/recompose@0.79.0(transitive)
- Removed@nivo/tooltip@0.79.0(transitive)
- Removed@react-spring/animated@9.3.2(transitive)
- Removed@react-spring/core@9.3.2(transitive)
- Removed@react-spring/rafz@9.3.2(transitive)
- Removed@react-spring/shared@9.3.2(transitive)
- Removed@react-spring/types@9.3.2(transitive)
- Removed@react-spring/web@9.3.1(transitive)
- Removedreact@17.0.2(transitive)
- Removedreact-dom@17.0.2(transitive)
- Removedscheduler@0.20.2(transitive)
Updated@nivo/colors@0.80.0
Updated@nivo/legends@0.80.0
Updated@nivo/tooltip@0.80.0
Updated@react-spring/web@9.4.5