🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@nivo/circle-packing

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nivo/circle-packing - npm Package Compare versions

Comparing version

to
0.93.0

2

dist/nivo-circle-packing.cjs.js

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

"use strict";var e=require("react"),o=require("@nivo/core"),r=require("d3-hierarchy"),i=require("lodash/cloneDeep.js"),n=require("lodash/sortBy.js"),t=require("@nivo/theming"),l=require("@nivo/colors"),a=require("@nivo/tooltip"),s=require("react/jsx-runtime"),u=require("@react-spring/web");function d(e){var o=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),o.default=e,Object.freeze(o)}var c=d(e);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},v.apply(null,arguments)}function f(e,o){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==o.indexOf(i))continue;r[i]=e[i]}return r}var h,p=function(e){var a,s=e.data,u=e.id,d=e.value,c=e.valueFormat,v=e.width,f=e.height,h=e.padding,p=e.leavesOnly,m=e.colors,C=e.colorBy,b=e.inheritColorFromParent,x=e.childColor,y=o.usePropertyAccessor(u),g=o.usePropertyAccessor(d),M=o.useValueFormatter(c),k=l.useOrdinalColorScale(m,C),j=t.useTheme(),E=l.useInheritedColor(x,j),P=i(s),I=r.hierarchy(P).sum(g),w=r.pack().size([v,f]).padding(h)(I),F=p?w.leaves():w.descendants(),W=n(F,"depth"),R=null!=(a=I.value)?a:0,L=W.reduce((function(e,o){var r,i=y(o.data),n=o.value,t=100*n/R,l=o.ancestors().map((function(e){return y(e.data)}));o.parent&&(r=e.find((function(e){return e.id===y(o.parent.data)})));var a={id:i,path:l,value:n,percentage:t,formattedValue:c?M(n):t.toFixed(2)+"%",x:o.x,y:o.y,radius:o.r,color:"",data:o.data,depth:o.depth,height:o.height};return b&&r&&a.depth>1?a.color=E(r):a.color=k(a),[].concat(e,[a])}),[]);return L},m=function(o,r,i,n){return e.useMemo((function(){if(!r)return o;var e=o.find((function(e){return e.id===r}));if(!e)return o;var t=Math.min(i,n)/(2*e.radius),l=i/2-e.x*t,a=n/2-e.y*t;return o.map((function(e){return v({},e,{x:e.x*t+l,y:e.y*t+a,radius:e.radius*t})}))}),[o,r,i,n])},C=function(r){var i=r.nodes,n=r.label,a=r.filter,s=r.skipRadius,u=r.textColor,d=o.usePropertyAccessor(n),c=t.useTheme(),v=l.useInheritedColor(u,c),f=e.useMemo((function(){return i.filter((function(e){return e.radius>=s})).map((function(e){return{label:d(e),textColor:v(e),node:e}}))}),[i,s,d,v]);return e.useMemo((function(){return a?f.filter(a):f}),[f,a])},b=function(o,r){var i=r.onMouseEnter,n=r.onMouseMove,t=r.onMouseLeave,l=r.onClick;return e.useMemo((function(){return{onMouseEnter:i?function(e){i(o,e)}:void 0,onMouseMove:n?function(e){n(o,e)}:void 0,onMouseLeave:t?function(e){t(o,e)}:void 0,onClick:l?function(e){l(o,e)}:void 0}}),[o,i,n,t,l])},x=function(r){var i=r.nodes,t=r.canvasEl,l=r.margin,a=e.useMemo((function(){return n(i,"height")}),[i]);return e.useCallback((function(e){if(!t.current)return null;var r=o.getRelativeCursor(t.current,e),i=r[0],n=r[1];return a.find((function(e){return o.getDistance(e.x,e.y,i-l.left,n-l.top)<=e.radius}))}),[t,l,a])},y=function(o){var r=o.nodes;return e.useMemo((function(){return{nodes:r}}),[r])},g={id:"id",value:"value",padding:0,leavesOnly:!1,layers:["circles","labels"],colors:{scheme:"nivo"},colorBy:"depth",inheritColorFromParent:!1,childColor:{from:"color",modifiers:[["darker",.3]]},borderWidth:0,borderColor:{from:"color",modifiers:[["darker",.3]]},defs:[],fill:[],enableLabels:!1,label:"id",labelTextColor:{from:"color",modifiers:[["darker",1.6]]},labelsSkipRadius:8,isInteractive:!0,tooltip:function(e){var o=e.id,r=e.formattedValue,i=e.color;return s.jsx(a.BasicTooltip,{id:o,value:r,enableChip:!0,color:i})},animate:!0,motionConfig:"gentle",role:"img",pixelRatio:"undefined"!=typeof window&&null!=(h=window.devicePixelRatio)?h:1},M=function(e){return u.to([e],(function(e){return Math.max(0,e)}))},k=function(r){var i=r.nodes,n=r.borderWidth,d=r.borderColor,f=r.component,h=r.isInteractive,p=r.onMouseEnter,m=r.onMouseMove,C=r.onMouseLeave,b=r.onClick,x=r.tooltip,y=a.useTooltip(),g=y.showTooltipFromEvent,k=y.hideTooltip,j=e.useMemo((function(){if(h)return function(o,r){g(e.createElement(x,o),r),null==p||p(o,r)}}),[h,g,x,p]),E=e.useMemo((function(){if(h)return function(o,r){g(e.createElement(x,o),r),null==m||m(o,r)}}),[h,g,x,m]),P=e.useMemo((function(){if(h)return function(e,o){k(),null==C||C(e,o)}}),[h,k,C]),I=e.useMemo((function(){if(h)return function(e,o){null==b||b(e,o)}}),[h,b]),w=o.useMotionConfig(),F=w.animate,W=w.config,R=t.useTheme(),L=l.useInheritedColor(d,R),O=e.useMemo((function(){return function(e){return{enter:function(o){return{x:o.x,y:o.y,radius:0,color:o.color,borderColor:e(o),opacity:0}},update:function(o){return{x:o.x,y:o.y,radius:o.radius,color:o.color,borderColor:e(o),opacity:1}},leave:function(o){return{x:o.x,y:o.y,radius:0,color:o.color,borderColor:e(o),opacity:0}}}}(L)}),[L]),T=u.useTransition(i,{keys:function(e){return e.id},initial:O.update,from:O.enter,enter:O.update,update:O.update,leave:O.leave,config:W,immediate:!F});return s.jsx(s.Fragment,{children:T((function(e,o){return c.createElement(f,{key:o.id,node:o,style:v({},e,{radius:M(e.radius),borderWidth:n}),onMouseEnter:j,onMouseMove:E,onMouseLeave:P,onClick:I})}))})},j=function(e){var o=e.node,r=e.style,i=e.onMouseEnter,n=e.onMouseMove,t=e.onMouseLeave,l=e.onClick,a=b(o,{onMouseEnter:i,onMouseMove:n,onMouseLeave:t,onClick:l});return s.jsx(u.animated.circle,{cx:r.x,cy:r.y,r:r.radius,fill:o.fill||r.color,stroke:r.borderColor,strokeWidth:r.borderWidth,opacity:r.opacity,onMouseEnter:a.onMouseEnter,onMouseMove:a.onMouseMove,onMouseLeave:a.onMouseLeave,onClick:a.onClick},o.id)},E=function(r){var i=r.nodes,n=r.label,t=r.filter,l=r.skipRadius,a=r.textColor,d=r.component,c=o.useMotionConfig(),f=c.animate,h=c.config,p=C({nodes:i,label:n,filter:t,skipRadius:l,textColor:a}),m=e.useMemo((function(){return{enter:function(e){return{x:e.node.x,y:e.node.y,radius:e.node.radius,textColor:e.textColor,opacity:0}},update:function(e){return{x:e.node.x,y:e.node.y,radius:e.node.radius,textColor:e.textColor,opacity:1}},leave:function(e){return{x:e.node.x,y:e.node.y,radius:e.node.radius,textColor:e.textColor,opacity:0}}}}),[]),b=u.useTransition(p,{keys:function(e){return e.node.id},initial:m.update,from:m.enter,enter:m.update,update:m.update,leave:m.leave,config:h,immediate:!f});return s.jsx(s.Fragment,{children:b((function(o,r){return e.createElement(d,{key:r.node.id,label:r.label,style:v({},o,{radius:M(o.radius)}),node:r.node})}))})},P=function(e){var o=e.node,r=e.label,i=e.style,n=t.useTheme();return s.jsx(u.animated.text,{x:i.x,y:i.y,textAnchor:"middle",dominantBaseline:"central",style:v({},n.labels.text,{fill:i.textColor,opacity:i.opacity,pointerEvents:"none"}),children:r},o.id)},I=["theme","isInteractive","animate","motionConfig","renderWrapper"],w=function(r){var i=r.data,n=r.id,t=void 0===n?g.id:n,l=r.value,a=void 0===l?g.value:l,u=r.valueFormat,d=r.width,c=r.height,v=r.margin,f=r.padding,h=void 0===f?g.padding:f,C=r.leavesOnly,b=void 0===C?g.leavesOnly:C,x=r.colors,M=void 0===x?g.colors:x,I=r.colorBy,w=void 0===I?g.colorBy:I,F=r.inheritColorFromParent,W=void 0===F?g.inheritColorFromParent:F,R=r.childColor,L=void 0===R?g.childColor:R,O=r.borderWidth,T=void 0===O?g.borderWidth:O,S=r.borderColor,B=void 0===S?g.borderColor:S,q=r.circleComponent,H=void 0===q?j:q,D=r.defs,z=void 0===D?g.defs:D,A=r.fill,V=void 0===A?g.fill:A,K=r.enableLabels,N=void 0===K?g.enableLabels:K,Z=r.label,G=void 0===Z?g.label:Z,J=r.labelsFilter,Q=r.labelsSkipRadius,U=void 0===Q?g.labelsSkipRadius:Q,X=r.labelTextColor,Y=void 0===X?g.labelTextColor:X,$=r.labelComponent,_=void 0===$?P:$,ee=r.layers,oe=void 0===ee?g.layers:ee,re=r.isInteractive,ie=r.onMouseEnter,ne=r.onMouseMove,te=r.onMouseLeave,le=r.onClick,ae=r.tooltip,se=void 0===ae?g.tooltip:ae,ue=r.zoomedId,de=r.role,ce=void 0===de?g.role:de,ve=o.useDimensions(d,c,v),fe=ve.outerWidth,he=ve.outerHeight,pe=ve.margin,me=ve.innerWidth,Ce=ve.innerHeight,be=p({data:i,id:t,value:a,valueFormat:u,width:me,height:Ce,padding:h,leavesOnly:b,colors:M,colorBy:w,inheritColorFromParent:W,childColor:L}),xe=m(be,ue,me,Ce),ye=e.useMemo((function(){return o.bindDefs(z,xe,V,{targetKey:"fill"})}),[z,xe,V]),ge={circles:null,labels:null};oe.includes("circles")&&(ge.circles=s.jsx(k,{nodes:xe,borderWidth:T,borderColor:B,isInteractive:re,onMouseEnter:ie,onMouseMove:ne,onMouseLeave:te,onClick:le,component:H,tooltip:se},"circles")),N&&oe.includes("labels")&&(ge.labels=s.jsx(E,{nodes:xe,label:G,filter:J,skipRadius:U,textColor:Y,component:_},"labels"));var Me=y({nodes:be});return s.jsx(o.SvgWrapper,{width:fe,height:he,margin:pe,defs:ye,role:ce,children:oe.map((function(o,r){return void 0!==ge[o]?ge[o]:"function"==typeof o?s.jsx(e.Fragment,{children:e.createElement(o,Me)},r):null}))})},F=function(e){var r=e.theme,i=e.isInteractive,n=void 0===i?g.isInteractive:i,t=e.animate,l=void 0===t?g.animate:t,a=e.motionConfig,u=void 0===a?g.motionConfig:a,d=e.renderWrapper,c=f(e,I);return s.jsx(o.Container,{isInteractive:n,animate:l,motionConfig:u,renderWrapper:d,theme:r,children:s.jsx(w,v({isInteractive:n},c))})},W=function(e,o){return u.to([e,o],(function(e,o){return e-o}))},R=function(e){return u.to([e],(function(e){return 2*e}))},L=function(e){var o,r,i=e.node,n=e.style,t=e.onMouseEnter,l=e.onMouseMove,a=e.onMouseLeave,d=e.onClick,c=R(n.radius),v=b(i,{onMouseEnter:t,onMouseMove:l,onMouseLeave:a,onClick:d});return s.jsx(u.animated.div,{style:{position:"absolute",top:W(n.y,n.radius),left:W(n.x,n.radius),height:c,width:c,borderRadius:n.radius,backgroundColor:n.color,borderWidth:(o=n.borderWidth,r=n.radius,u.to([r],(function(e){return Math.min(o,e)}))),borderStyle:"solid",borderColor:n.borderColor,boxSizing:"border-box"},onMouseEnter:v.onMouseEnter,onMouseMove:v.onMouseMove,onMouseLeave:v.onMouseLeave,onClick:v.onClick})},O=function(e){var o=e.node,r=e.label,i=e.style,n=t.useTheme(),l=R(i.radius);return s.jsx(u.animated.div,{style:v({},n.labels.text,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",top:W(i.y,i.radius),left:W(i.x,i.radius),width:l,height:l,color:i.textColor,opacity:i.opacity,pointerEvents:"none"}),children:r},o.id)},T=["theme","isInteractive","animate","motionConfig"],S=function(r){var i=r.data,n=r.id,t=void 0===n?g.id:n,l=r.value,a=void 0===l?g.value:l,u=r.valueFormat,d=r.width,c=r.height,v=r.margin,f=r.padding,h=void 0===f?g.padding:f,C=r.leavesOnly,b=void 0===C?g.leavesOnly:C,x=r.colors,M=void 0===x?g.colors:x,j=r.colorBy,P=void 0===j?g.colorBy:j,I=r.inheritColorFromParent,w=void 0===I?g.inheritColorFromParent:I,F=r.childColor,W=void 0===F?g.childColor:F,R=r.borderWidth,T=void 0===R?g.borderWidth:R,S=r.borderColor,B=void 0===S?g.borderColor:S,q=r.circleComponent,H=void 0===q?L:q,D=r.enableLabels,z=void 0===D?g.enableLabels:D,A=r.label,V=void 0===A?g.label:A,K=r.labelsFilter,N=r.labelsSkipRadius,Z=void 0===N?g.labelsSkipRadius:N,G=r.labelTextColor,J=void 0===G?g.labelTextColor:G,Q=r.labelComponent,U=void 0===Q?O:Q,X=r.layers,Y=void 0===X?g.layers:X,$=r.isInteractive,_=r.onMouseEnter,ee=r.onMouseMove,oe=r.onMouseLeave,re=r.onClick,ie=r.tooltip,ne=void 0===ie?g.tooltip:ie,te=r.zoomedId,le=r.role,ae=void 0===le?g.role:le,se=o.useDimensions(d,c,v),ue=se.outerWidth,de=se.outerHeight,ce=se.margin,ve=se.innerWidth,fe=se.innerHeight,he=p({data:i,id:t,value:a,valueFormat:u,width:ve,height:fe,padding:h,leavesOnly:b,colors:M,colorBy:P,inheritColorFromParent:w,childColor:W}),pe=m(he,te,ve,fe),me={circles:null,labels:null};Y.includes("circles")&&(me.circles=s.jsx(k,{nodes:pe,borderWidth:T,borderColor:B,isInteractive:$,onMouseEnter:_,onMouseMove:ee,onMouseLeave:oe,onClick:re,component:H,tooltip:ne},"circles")),z&&Y.includes("labels")&&(me.labels=s.jsx(E,{nodes:pe,label:V,filter:K,skipRadius:Z,textColor:J,component:U},"labels"));var Ce=y({nodes:he});return s.jsx("div",{role:ae,style:{position:"relative",overflow:"hidden",width:ue,height:de},children:s.jsx("div",{style:{position:"absolute",top:ce.top,left:ce.left},children:Y.map((function(o,r){return void 0!==me[o]?me[o]:"function"==typeof o?s.jsx(e.Fragment,{children:e.createElement(o,Ce)},r):null}))})})},B=function(e){var r=e.theme,i=e.isInteractive,n=void 0===i?g.isInteractive:i,t=e.animate,l=void 0===t?g.animate:t,a=e.motionConfig,u=void 0===a?g.motionConfig:a,d=f(e,T);return s.jsx(o.Container,{isInteractive:n,animate:l,motionConfig:u,theme:r,children:s.jsx(S,v({isInteractive:n},d))})},q=["isInteractive","theme"],H=function(r){var i=r.data,n=r.id,u=void 0===n?g.id:n,d=r.value,c=void 0===d?g.value:d,v=r.valueFormat,f=r.width,h=r.height,b=r.margin,y=r.padding,M=void 0===y?g.padding:y,k=r.leavesOnly,j=void 0===k?g.leavesOnly:k,E=r.colors,P=void 0===E?g.colors:E,I=r.colorBy,w=void 0===I?g.colorBy:I,F=r.inheritColorFromParent,W=void 0===F?g.inheritColorFromParent:F,R=r.childColor,L=void 0===R?g.childColor:R,O=r.borderWidth,T=void 0===O?g.borderWidth:O,S=r.borderColor,B=void 0===S?g.borderColor:S,q=r.enableLabels,H=void 0===q?g.enableLabels:q,D=r.label,z=void 0===D?g.label:D,A=r.labelsFilter,V=r.labelsSkipRadius,K=void 0===V?g.labelsSkipRadius:V,N=r.labelTextColor,Z=void 0===N?g.labelTextColor:N,G=r.isInteractive,J=r.onMouseMove,Q=r.onClick,U=r.tooltip,X=void 0===U?g.tooltip:U,Y=r.zoomedId,$=r.role,_=void 0===$?g.role:$,ee=r.pixelRatio,oe=void 0===ee?g.pixelRatio:ee,re=e.useRef(null),ie=t.useTheme(),ne=o.useDimensions(f,h,b),te=ne.margin,le=ne.innerWidth,ae=ne.innerHeight,se=ne.outerWidth,ue=ne.outerHeight,de=p({data:i,id:u,value:c,valueFormat:v,width:le,height:ae,padding:M,leavesOnly:j,colors:P,colorBy:w,inheritColorFromParent:W,childColor:L}),ce=m(de,Y,le,ae),ve=C({nodes:ce,label:z,filter:A,skipRadius:K,textColor:Z}),fe=l.useInheritedColor(B,ie);e.useEffect((function(){if(re.current){re.current.width=se*oe,re.current.height=ue*oe;var e=re.current.getContext("2d");e.scale(oe,oe),e.fillStyle=ie.background,e.fillRect(0,0,se,ue),e.save(),e.translate(te.left,te.top),ce.forEach((function(o){T>0&&(e.strokeStyle=fe(o),e.lineWidth=T),e.beginPath(),e.arc(o.x,o.y,o.radius,0,2*Math.PI),e.fillStyle=o.color,e.fill(),T>0&&e.stroke()})),H&&(e.textAlign="center",e.textBaseline="middle",e.font=ie.labels.text.fontSize+"px "+ie.labels.text.fontFamily,ve.forEach((function(o){e.fillStyle=o.textColor,e.fillText(""+o.label,o.node.x,o.node.y)})))}}),[re,le,ae,se,ue,te.top,te.left,ie,oe,ce,H,ve,T,fe]);var he=x({nodes:ce,canvasEl:re,margin:te}),pe=a.useTooltip(),me=pe.showTooltipFromEvent,Ce=pe.hideTooltip,be=e.useCallback((function(o){var r=he(o);r?(null==J||J(r,o),me(e.createElement(X,r),o)):Ce()}),[he,me,X,Ce]),xe=e.useCallback((function(){Ce()}),[Ce]),ye=e.useCallback((function(e){if(Q){var o=he(e);o&&Q(o,e)}}),[he,Q]);return s.jsx("canvas",{ref:re,width:se*oe,height:ue*oe,style:{width:se,height:ue,cursor:G?"auto":"normal"},role:_,onMouseEnter:G?be:void 0,onMouseMove:G?be:void 0,onMouseLeave:G?xe:void 0,onClick:G?ye:void 0})},D=function(e){var r=e.isInteractive,i=void 0===r?g.isInteractive:r,n=e.theme,t=f(e,q);return s.jsx(o.Container,{isInteractive:i,theme:n,children:s.jsx(H,v({isInteractive:i},t))})};exports.CirclePacking=F,exports.CirclePackingCanvas=D,exports.CirclePackingHtml=B,exports.InnerCirclePackingHtml=S,exports.ResponsiveCirclePacking=function(e){return s.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,i=o.height;return s.jsx(F,v({width:r,height:i},e))}})},exports.ResponsiveCirclePackingCanvas=function(e){return s.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,i=o.height;return s.jsx(D,v({width:r,height:i},e))}})},exports.ResponsiveCirclePackingHtml=function(e){return s.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,i=o.height;return s.jsx(B,v({width:r,height:i},e))}})},exports.defaultProps=g,exports.useCirclePacking=p,exports.useCirclePackingLabels=C,exports.useCirclePackingLayerContext=y,exports.useCirclePackingZoom=m,exports.useMouseCircleDetection=x,exports.useNodeMouseHandlers=b;
"use strict";var e=require("react"),o=require("@nivo/core"),r=require("d3-hierarchy"),i=require("lodash/cloneDeep.js"),n=require("lodash/sortBy.js"),t=require("@nivo/theming"),l=require("@nivo/colors"),a=require("@nivo/tooltip"),s=require("react/jsx-runtime"),u=require("@react-spring/web");function d(e){var o=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),o.default=e,Object.freeze(o)}var c=d(e);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},v.apply(null,arguments)}function f(e,o){if(null==e)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==o.indexOf(i))continue;r[i]=e[i]}return r}var h,p=function(e){var a,s=e.data,u=e.id,d=e.value,c=e.valueFormat,v=e.width,f=e.height,h=e.padding,p=e.leavesOnly,m=e.colors,C=e.colorBy,b=e.inheritColorFromParent,x=e.childColor,y=o.usePropertyAccessor(u),g=o.usePropertyAccessor(d),M=o.useValueFormatter(c),k=l.useOrdinalColorScale(m,C),j=t.useTheme(),E=l.useInheritedColor(x,j),P=i(s),I=r.hierarchy(P).sum(g),w=r.pack().size([v,f]).padding(h)(I),F=p?w.leaves():w.descendants(),W=n(F,"depth"),R=null!=(a=I.value)?a:0,L=W.reduce((function(e,o){var r,i=y(o.data),n=o.value,t=100*n/R,l=o.ancestors().map((function(e){return y(e.data)}));o.parent&&(r=e.find((function(e){return e.id===y(o.parent.data)})));var a={id:i,path:l,value:n,percentage:t,formattedValue:c?M(n):t.toFixed(2)+"%",x:o.x,y:o.y,radius:o.r,color:"",data:o.data,depth:o.depth,height:o.height};return b&&r&&a.depth>1?a.color=E(r):a.color=k(a),[].concat(e,[a])}),[]);return L},m=function(o,r,i,n){return e.useMemo((function(){if(!r)return o;var e=o.find((function(e){return e.id===r}));if(!e)return o;var t=Math.min(i,n)/(2*e.radius),l=i/2-e.x*t,a=n/2-e.y*t;return o.map((function(e){return v({},e,{x:e.x*t+l,y:e.y*t+a,radius:e.radius*t})}))}),[o,r,i,n])},C=function(r){var i=r.nodes,n=r.label,a=r.filter,s=r.skipRadius,u=r.textColor,d=o.usePropertyAccessor(n),c=t.useTheme(),v=l.useInheritedColor(u,c),f=e.useMemo((function(){return i.filter((function(e){return e.radius>=s})).map((function(e){return{label:d(e),textColor:v(e),node:e}}))}),[i,s,d,v]);return e.useMemo((function(){return a?f.filter(a):f}),[f,a])},b=function(o,r){var i=r.onMouseEnter,n=r.onMouseMove,t=r.onMouseLeave,l=r.onClick;return e.useMemo((function(){return{onMouseEnter:i?function(e){i(o,e)}:void 0,onMouseMove:n?function(e){n(o,e)}:void 0,onMouseLeave:t?function(e){t(o,e)}:void 0,onClick:l?function(e){l(o,e)}:void 0}}),[o,i,n,t,l])},x=function(r){var i=r.nodes,t=r.canvasEl,l=r.margin,a=e.useMemo((function(){return n(i,"height")}),[i]);return e.useCallback((function(e){if(!t.current)return null;var r=o.getRelativeCursor(t.current,e),i=r[0],n=r[1];return a.find((function(e){return o.getDistance(e.x,e.y,i-l.left,n-l.top)<=e.radius}))}),[t,l,a])},y=function(o){var r=o.nodes;return e.useMemo((function(){return{nodes:r}}),[r])},g={id:"id",value:"value",padding:0,leavesOnly:!1,layers:["circles","labels"],colors:{scheme:"nivo"},colorBy:"depth",inheritColorFromParent:!1,childColor:{from:"color",modifiers:[["darker",.3]]},borderWidth:0,borderColor:{from:"color",modifiers:[["darker",.3]]},defs:[],fill:[],enableLabels:!1,label:"id",labelTextColor:{from:"color",modifiers:[["darker",1.6]]},labelsSkipRadius:8,isInteractive:!0,tooltip:function(e){var o=e.id,r=e.formattedValue,i=e.color;return s.jsx(a.BasicTooltip,{id:o,value:r,enableChip:!0,color:i})},animate:!0,motionConfig:"gentle",role:"img",pixelRatio:"undefined"!=typeof window&&null!=(h=window.devicePixelRatio)?h:1},M=function(e){return u.to([e],(function(e){return Math.max(0,e)}))},k=function(r){var i=r.nodes,n=r.borderWidth,d=r.borderColor,f=r.component,h=r.isInteractive,p=r.onMouseEnter,m=r.onMouseMove,C=r.onMouseLeave,b=r.onClick,x=r.tooltip,y=a.useTooltip(),g=y.showTooltipFromEvent,k=y.hideTooltip,j=e.useMemo((function(){if(h)return function(o,r){g(e.createElement(x,o),r),null==p||p(o,r)}}),[h,g,x,p]),E=e.useMemo((function(){if(h)return function(o,r){g(e.createElement(x,o),r),null==m||m(o,r)}}),[h,g,x,m]),P=e.useMemo((function(){if(h)return function(e,o){k(),null==C||C(e,o)}}),[h,k,C]),I=e.useMemo((function(){if(h)return function(e,o){null==b||b(e,o)}}),[h,b]),w=o.useMotionConfig(),F=w.animate,W=w.config,R=t.useTheme(),L=l.useInheritedColor(d,R),O=e.useMemo((function(){return function(e){return{enter:function(o){return{x:o.x,y:o.y,radius:0,color:o.color,borderColor:e(o),opacity:0}},update:function(o){return{x:o.x,y:o.y,radius:o.radius,color:o.color,borderColor:e(o),opacity:1}},leave:function(o){return{x:o.x,y:o.y,radius:0,color:o.color,borderColor:e(o),opacity:0}}}}(L)}),[L]),T=u.useTransition(i,{keys:function(e){return e.id},initial:O.update,from:O.enter,enter:O.update,update:O.update,leave:O.leave,config:W,immediate:!F});return s.jsx(s.Fragment,{children:T((function(e,o){return c.createElement(f,{key:o.id,node:o,style:v({},e,{radius:M(e.radius),borderWidth:n}),onMouseEnter:j,onMouseMove:E,onMouseLeave:P,onClick:I})}))})},j=function(e){var o=e.node,r=e.style,i=e.onMouseEnter,n=e.onMouseMove,t=e.onMouseLeave,l=e.onClick,a=b(o,{onMouseEnter:i,onMouseMove:n,onMouseLeave:t,onClick:l});return s.jsx(u.animated.circle,{cx:r.x,cy:r.y,r:r.radius,fill:o.fill||r.color,stroke:r.borderColor,strokeWidth:r.borderWidth,opacity:r.opacity,onMouseEnter:a.onMouseEnter,onMouseMove:a.onMouseMove,onMouseLeave:a.onMouseLeave,onClick:a.onClick},o.id)},E=function(r){var i=r.nodes,n=r.label,t=r.filter,l=r.skipRadius,a=r.textColor,d=r.component,c=o.useMotionConfig(),f=c.animate,h=c.config,p=C({nodes:i,label:n,filter:t,skipRadius:l,textColor:a}),m=e.useMemo((function(){return{enter:function(e){return{x:e.node.x,y:e.node.y,radius:e.node.radius,textColor:e.textColor,opacity:0}},update:function(e){return{x:e.node.x,y:e.node.y,radius:e.node.radius,textColor:e.textColor,opacity:1}},leave:function(e){return{x:e.node.x,y:e.node.y,radius:e.node.radius,textColor:e.textColor,opacity:0}}}}),[]),b=u.useTransition(p,{keys:function(e){return e.node.id},initial:m.update,from:m.enter,enter:m.update,update:m.update,leave:m.leave,config:h,immediate:!f});return s.jsx(s.Fragment,{children:b((function(o,r){return e.createElement(d,{key:r.node.id,label:r.label,style:v({},o,{radius:M(o.radius)}),node:r.node})}))})},P=function(e){var o=e.node,r=e.label,i=e.style,n=t.useTheme();return s.jsx(u.animated.text,{x:i.x,y:i.y,textAnchor:"middle",dominantBaseline:"central",style:v({},n.labels.text,{fill:i.textColor,opacity:i.opacity,pointerEvents:"none"}),children:r},o.id)},I=["theme","isInteractive","animate","motionConfig","renderWrapper"],w=function(r){var i=r.data,n=r.id,t=void 0===n?g.id:n,l=r.value,a=void 0===l?g.value:l,u=r.valueFormat,d=r.width,c=r.height,v=r.margin,f=r.padding,h=void 0===f?g.padding:f,C=r.leavesOnly,b=void 0===C?g.leavesOnly:C,x=r.colors,M=void 0===x?g.colors:x,I=r.colorBy,w=void 0===I?g.colorBy:I,F=r.inheritColorFromParent,W=void 0===F?g.inheritColorFromParent:F,R=r.childColor,L=void 0===R?g.childColor:R,O=r.borderWidth,T=void 0===O?g.borderWidth:O,S=r.borderColor,B=void 0===S?g.borderColor:S,q=r.circleComponent,H=void 0===q?j:q,D=r.defs,z=void 0===D?g.defs:D,A=r.fill,V=void 0===A?g.fill:A,K=r.enableLabels,N=void 0===K?g.enableLabels:K,Z=r.label,G=void 0===Z?g.label:Z,J=r.labelsFilter,Q=r.labelsSkipRadius,U=void 0===Q?g.labelsSkipRadius:Q,X=r.labelTextColor,Y=void 0===X?g.labelTextColor:X,$=r.labelComponent,_=void 0===$?P:$,ee=r.layers,oe=void 0===ee?g.layers:ee,re=r.isInteractive,ie=r.onMouseEnter,ne=r.onMouseMove,te=r.onMouseLeave,le=r.onClick,ae=r.tooltip,se=void 0===ae?g.tooltip:ae,ue=r.zoomedId,de=r.role,ce=void 0===de?g.role:de,ve=o.useDimensions(d,c,v),fe=ve.outerWidth,he=ve.outerHeight,pe=ve.margin,me=ve.innerWidth,Ce=ve.innerHeight,be=p({data:i,id:t,value:a,valueFormat:u,width:me,height:Ce,padding:h,leavesOnly:b,colors:M,colorBy:w,inheritColorFromParent:W,childColor:L}),xe=m(be,ue,me,Ce),ye=e.useMemo((function(){return o.bindDefs(z,xe,V,{targetKey:"fill"})}),[z,xe,V]),ge={circles:null,labels:null};oe.includes("circles")&&(ge.circles=s.jsx(k,{nodes:xe,borderWidth:T,borderColor:B,isInteractive:re,onMouseEnter:ie,onMouseMove:ne,onMouseLeave:te,onClick:le,component:H,tooltip:se},"circles")),N&&oe.includes("labels")&&(ge.labels=s.jsx(E,{nodes:xe,label:G,filter:J,skipRadius:U,textColor:Y,component:_},"labels"));var Me=y({nodes:be});return s.jsx(o.SvgWrapper,{width:fe,height:he,margin:pe,defs:ye,role:ce,children:oe.map((function(o,r){return void 0!==ge[o]?ge[o]:"function"==typeof o?s.jsx(e.Fragment,{children:e.createElement(o,Me)},r):null}))})},F=function(e){var r=e.theme,i=e.isInteractive,n=void 0===i?g.isInteractive:i,t=e.animate,l=void 0===t?g.animate:t,a=e.motionConfig,u=void 0===a?g.motionConfig:a,d=e.renderWrapper,c=f(e,I);return s.jsx(o.Container,{isInteractive:n,animate:l,motionConfig:u,renderWrapper:d,theme:r,children:s.jsx(w,v({isInteractive:n},c))})},W=function(e,o){return u.to([e,o],(function(e,o){return e-o}))},R=function(e){return u.to([e],(function(e){return 2*e}))},L=function(e){var o,r,i=e.node,n=e.style,t=e.onMouseEnter,l=e.onMouseMove,a=e.onMouseLeave,d=e.onClick,c=R(n.radius),v=b(i,{onMouseEnter:t,onMouseMove:l,onMouseLeave:a,onClick:d});return s.jsx(u.animated.div,{style:{position:"absolute",top:W(n.y,n.radius),left:W(n.x,n.radius),height:c,width:c,borderRadius:n.radius,backgroundColor:n.color,borderWidth:(o=n.borderWidth,r=n.radius,u.to([r],(function(e){return Math.min(o,e)}))),borderStyle:"solid",borderColor:n.borderColor,boxSizing:"border-box"},onMouseEnter:v.onMouseEnter,onMouseMove:v.onMouseMove,onMouseLeave:v.onMouseLeave,onClick:v.onClick})},O=function(e){var o=e.node,r=e.label,i=e.style,n=t.useTheme(),l=R(i.radius);return s.jsx(u.animated.div,{style:v({},n.labels.text,{position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",top:W(i.y,i.radius),left:W(i.x,i.radius),width:l,height:l,color:i.textColor,opacity:i.opacity,pointerEvents:"none"}),children:r},o.id)},T=["theme","isInteractive","animate","motionConfig"],S=function(r){var i=r.data,n=r.id,t=void 0===n?g.id:n,l=r.value,a=void 0===l?g.value:l,u=r.valueFormat,d=r.width,c=r.height,v=r.margin,f=r.padding,h=void 0===f?g.padding:f,C=r.leavesOnly,b=void 0===C?g.leavesOnly:C,x=r.colors,M=void 0===x?g.colors:x,j=r.colorBy,P=void 0===j?g.colorBy:j,I=r.inheritColorFromParent,w=void 0===I?g.inheritColorFromParent:I,F=r.childColor,W=void 0===F?g.childColor:F,R=r.borderWidth,T=void 0===R?g.borderWidth:R,S=r.borderColor,B=void 0===S?g.borderColor:S,q=r.circleComponent,H=void 0===q?L:q,D=r.enableLabels,z=void 0===D?g.enableLabels:D,A=r.label,V=void 0===A?g.label:A,K=r.labelsFilter,N=r.labelsSkipRadius,Z=void 0===N?g.labelsSkipRadius:N,G=r.labelTextColor,J=void 0===G?g.labelTextColor:G,Q=r.labelComponent,U=void 0===Q?O:Q,X=r.layers,Y=void 0===X?g.layers:X,$=r.isInteractive,_=r.onMouseEnter,ee=r.onMouseMove,oe=r.onMouseLeave,re=r.onClick,ie=r.tooltip,ne=void 0===ie?g.tooltip:ie,te=r.zoomedId,le=r.role,ae=void 0===le?g.role:le,se=o.useDimensions(d,c,v),ue=se.outerWidth,de=se.outerHeight,ce=se.margin,ve=se.innerWidth,fe=se.innerHeight,he=p({data:i,id:t,value:a,valueFormat:u,width:ve,height:fe,padding:h,leavesOnly:b,colors:M,colorBy:P,inheritColorFromParent:w,childColor:W}),pe=m(he,te,ve,fe),me={circles:null,labels:null};Y.includes("circles")&&(me.circles=s.jsx(k,{nodes:pe,borderWidth:T,borderColor:B,isInteractive:$,onMouseEnter:_,onMouseMove:ee,onMouseLeave:oe,onClick:re,component:H,tooltip:ne},"circles")),z&&Y.includes("labels")&&(me.labels=s.jsx(E,{nodes:pe,label:V,filter:K,skipRadius:Z,textColor:J,component:U},"labels"));var Ce=y({nodes:he});return s.jsx("div",{role:ae,style:{position:"relative",overflow:"hidden",width:ue,height:de},children:s.jsx("div",{style:{position:"absolute",top:ce.top,left:ce.left},children:Y.map((function(o,r){return void 0!==me[o]?me[o]:"function"==typeof o?s.jsx(e.Fragment,{children:e.createElement(o,Ce)},r):null}))})})},B=function(e){var r=e.theme,i=e.isInteractive,n=void 0===i?g.isInteractive:i,t=e.animate,l=void 0===t?g.animate:t,a=e.motionConfig,u=void 0===a?g.motionConfig:a,d=f(e,T);return s.jsx(o.Container,{isInteractive:n,animate:l,motionConfig:u,theme:r,children:s.jsx(S,v({isInteractive:n},d))})},q=["isInteractive","theme"],H=function(r){var i=r.data,n=r.id,u=void 0===n?g.id:n,d=r.value,c=void 0===d?g.value:d,v=r.valueFormat,f=r.width,h=r.height,b=r.margin,y=r.padding,M=void 0===y?g.padding:y,k=r.leavesOnly,j=void 0===k?g.leavesOnly:k,E=r.colors,P=void 0===E?g.colors:E,I=r.colorBy,w=void 0===I?g.colorBy:I,F=r.inheritColorFromParent,W=void 0===F?g.inheritColorFromParent:F,R=r.childColor,L=void 0===R?g.childColor:R,O=r.borderWidth,T=void 0===O?g.borderWidth:O,S=r.borderColor,B=void 0===S?g.borderColor:S,q=r.enableLabels,H=void 0===q?g.enableLabels:q,D=r.label,z=void 0===D?g.label:D,A=r.labelsFilter,V=r.labelsSkipRadius,K=void 0===V?g.labelsSkipRadius:V,N=r.labelTextColor,Z=void 0===N?g.labelTextColor:N,G=r.isInteractive,J=r.onMouseMove,Q=r.onClick,U=r.tooltip,X=void 0===U?g.tooltip:U,Y=r.zoomedId,$=r.role,_=void 0===$?g.role:$,ee=r.pixelRatio,oe=void 0===ee?g.pixelRatio:ee,re=e.useRef(null),ie=t.useTheme(),ne=o.useDimensions(f,h,b),te=ne.margin,le=ne.innerWidth,ae=ne.innerHeight,se=ne.outerWidth,ue=ne.outerHeight,de=p({data:i,id:u,value:c,valueFormat:v,width:le,height:ae,padding:M,leavesOnly:j,colors:P,colorBy:w,inheritColorFromParent:W,childColor:L}),ce=m(de,Y,le,ae),ve=C({nodes:ce,label:z,filter:A,skipRadius:K,textColor:Z}),fe=l.useInheritedColor(B,ie);e.useEffect((function(){if(re.current){re.current.width=se*oe,re.current.height=ue*oe;var e=re.current.getContext("2d");e.scale(oe,oe),e.fillStyle=ie.background,e.fillRect(0,0,se,ue),e.save(),e.translate(te.left,te.top),ce.forEach((function(o){T>0&&(e.strokeStyle=fe(o),e.lineWidth=T),e.beginPath(),e.arc(o.x,o.y,o.radius,0,2*Math.PI),e.fillStyle=o.color,e.fill(),T>0&&e.stroke()})),H&&(e.textAlign="center",e.textBaseline="middle",e.font=ie.labels.text.fontSize+"px "+ie.labels.text.fontFamily,ve.forEach((function(o){e.fillStyle=o.textColor,e.fillText(""+o.label,o.node.x,o.node.y)})))}}),[re,le,ae,se,ue,te.top,te.left,ie,oe,ce,H,ve,T,fe]);var he=x({nodes:ce,canvasEl:re,margin:te}),pe=a.useTooltip(),me=pe.showTooltipFromEvent,Ce=pe.hideTooltip,be=e.useCallback((function(o){var r=he(o);r?(null==J||J(r,o),me(e.createElement(X,r),o)):Ce()}),[he,me,X,Ce,J]),xe=e.useCallback((function(){Ce()}),[Ce]),ye=e.useCallback((function(e){if(Q){var o=he(e);o&&Q(o,e)}}),[he,Q]);return s.jsx("canvas",{ref:re,width:se*oe,height:ue*oe,style:{width:se,height:ue,cursor:G?"auto":"normal"},role:_,onMouseEnter:G?be:void 0,onMouseMove:G?be:void 0,onMouseLeave:G?xe:void 0,onClick:G?ye:void 0})},D=function(e){var r=e.isInteractive,i=void 0===r?g.isInteractive:r,n=e.theme,t=f(e,q);return s.jsx(o.Container,{isInteractive:i,theme:n,children:s.jsx(H,v({isInteractive:i},t))})};exports.CirclePacking=F,exports.CirclePackingCanvas=D,exports.CirclePackingHtml=B,exports.InnerCirclePackingHtml=S,exports.ResponsiveCirclePacking=function(e){return s.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,i=o.height;return s.jsx(F,v({width:r,height:i},e))}})},exports.ResponsiveCirclePackingCanvas=function(e){return s.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,i=o.height;return s.jsx(D,v({width:r,height:i},e))}})},exports.ResponsiveCirclePackingHtml=function(e){return s.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,i=o.height;return s.jsx(B,v({width:r,height:i},e))}})},exports.defaultProps=g,exports.useCirclePacking=p,exports.useCirclePackingLabels=C,exports.useCirclePackingLayerContext=y,exports.useCirclePackingZoom=m,exports.useMouseCircleDetection=x,exports.useNodeMouseHandlers=b;
//# sourceMappingURL=nivo-circle-packing.cjs.js.map
import { CirclePackingSvgProps } from './types';
export declare const CirclePacking: <RawDatum>({ theme, isInteractive, animate, motionConfig, renderWrapper, ...otherProps }: Partial<Omit<CirclePackingSvgProps<RawDatum>, "height" | "width" | "data">> & Pick<CirclePackingSvgProps<RawDatum>, "height" | "width" | "data">) => import("react/jsx-runtime").JSX.Element;
export declare const CirclePacking: <RawDatum>({ theme, isInteractive, animate, motionConfig, renderWrapper, ...otherProps }: Partial<Omit<CirclePackingSvgProps<RawDatum>, "data" | "width" | "height">> & Pick<CirclePackingSvgProps<RawDatum>, "data" | "width" | "height">) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=CirclePacking.d.ts.map
import { CirclePackingCanvasProps } from './types';
export declare const CirclePackingCanvas: <RawDatum>({ isInteractive, theme, ...otherProps }: Partial<Omit<CirclePackingCanvasProps<RawDatum>, "height" | "width" | "data">> & Pick<CirclePackingCanvasProps<RawDatum>, "height" | "width" | "data">) => import("react/jsx-runtime").JSX.Element;
export declare const CirclePackingCanvas: <RawDatum>({ isInteractive, theme, ...otherProps }: Partial<Omit<CirclePackingCanvasProps<RawDatum>, "data" | "width" | "height">> & Pick<CirclePackingCanvasProps<RawDatum>, "data" | "width" | "height">) => import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=CirclePackingCanvas.d.ts.map
import { CirclePackingHtmlProps } from './types';
type InnerCirclePackingHtmlProps<RawDatum> = Partial<Omit<CirclePackingHtmlProps<RawDatum>, 'data' | 'width' | 'height' | 'isInteractive' | 'animate' | 'motionConfig'>> & Pick<CirclePackingHtmlProps<RawDatum>, 'data' | 'width' | 'height' | 'isInteractive'>;
export declare const InnerCirclePackingHtml: <RawDatum>({ data, id, value, valueFormat, width, height, margin: partialMargin, padding, leavesOnly, colors, colorBy, inheritColorFromParent, childColor, borderWidth, borderColor, circleComponent, enableLabels, label, labelsFilter, labelsSkipRadius, labelTextColor, labelComponent, layers, isInteractive, onMouseEnter, onMouseMove, onMouseLeave, onClick, tooltip, zoomedId, role, }: InnerCirclePackingHtmlProps<RawDatum>) => import("react/jsx-runtime").JSX.Element;
export declare const CirclePackingHtml: <RawDatum>({ theme, isInteractive, animate, motionConfig, ...otherProps }: Partial<Omit<CirclePackingHtmlProps<RawDatum>, "height" | "width" | "data">> & Pick<CirclePackingHtmlProps<RawDatum>, "height" | "width" | "data">) => import("react/jsx-runtime").JSX.Element;
export declare const CirclePackingHtml: <RawDatum>({ theme, isInteractive, animate, motionConfig, ...otherProps }: Partial<Omit<CirclePackingHtmlProps<RawDatum>, "data" | "width" | "height">> & Pick<CirclePackingHtmlProps<RawDatum>, "data" | "width" | "height">) => import("react/jsx-runtime").JSX.Element;
export {};
//# sourceMappingURL=CirclePackingHtml.d.ts.map

@@ -8,3 +8,3 @@ import { SpringValue } from '@react-spring/web';

*/
export declare const interpolateRadius: (radiusValue: SpringValue<number>) => import("@react-spring/core").Interpolation<number, any>;
export declare const interpolateRadius: (radiusValue: SpringValue<number>) => import("@react-spring/web").Interpolation<number, any>;
type CirclesProps<RawDatum> = {

@@ -11,0 +11,0 @@ nodes: ComputedDatum<RawDatum>[];

import { MouseEvent, MutableRefObject } from 'react';
import { CirclePackingCommonProps, CirclePackingCustomLayerProps, ComputedDatum, MouseHandlers } from './types';
export declare const useCirclePacking: <RawDatum>({ data, id, value, valueFormat, width, height, padding, leavesOnly, colors, colorBy, inheritColorFromParent, childColor, }: {
data: RawDatum;
id: import("@nivo/core").PropertyAccessor<RawDatum, string>;
value: import("@nivo/core").PropertyAccessor<RawDatum, number>;
valueFormat?: import("@nivo/core").ValueFormat<number, void> | undefined;
data: CirclePackingCommonProps<RawDatum>["data"];
id: CirclePackingCommonProps<RawDatum>["id"];
value: CirclePackingCommonProps<RawDatum>["value"];
valueFormat?: CirclePackingCommonProps<RawDatum>["valueFormat"];
width: number;
height: number;
padding: number;
leavesOnly: boolean;
colors: import("@nivo/colors").OrdinalColorScaleConfig<Omit<ComputedDatum<RawDatum>, "color" | "fill">>;
colorBy: "id" | "depth";
inheritColorFromParent: boolean;
childColor: import("@nivo/colors").InheritedColorConfig<ComputedDatum<RawDatum>>;
padding: CirclePackingCommonProps<RawDatum>["padding"];
leavesOnly: CirclePackingCommonProps<RawDatum>["leavesOnly"];
colors: CirclePackingCommonProps<RawDatum>["colors"];
colorBy: CirclePackingCommonProps<RawDatum>["colorBy"];
inheritColorFromParent: CirclePackingCommonProps<RawDatum>["inheritColorFromParent"];
childColor: CirclePackingCommonProps<RawDatum>["childColor"];
}) => ComputedDatum<RawDatum>[];
export declare const useCirclePackingZoom: <RawDatum>(nodes: ComputedDatum<RawDatum>[], zoomedId: string | null | undefined, width: number, height: number) => ComputedDatum<RawDatum>[];
export declare const useCirclePackingZoom: <RawDatum>(nodes: ComputedDatum<RawDatum>[], zoomedId: CirclePackingCommonProps<RawDatum>["zoomedId"], width: number, height: number) => ComputedDatum<RawDatum>[];
export declare const useCirclePackingLabels: <RawDatum>({ nodes, label, filter, skipRadius, textColor, }: {
nodes: ComputedDatum<RawDatum>[];
label: import("@nivo/core").PropertyAccessor<ComputedDatum<RawDatum>, string>;
filter: ((label: import("./types").ComputedLabel<RawDatum>) => boolean) | undefined;
skipRadius: number;
textColor: import("@nivo/colors").InheritedColorConfig<ComputedDatum<RawDatum>>;
label: CirclePackingCommonProps<RawDatum>["label"];
filter: CirclePackingCommonProps<RawDatum>["labelsFilter"];
skipRadius: CirclePackingCommonProps<RawDatum>["labelsSkipRadius"];
textColor: CirclePackingCommonProps<RawDatum>["labelTextColor"];
}) => {

@@ -29,3 +29,3 @@ label: string | number;

}[];
export declare const useNodeMouseHandlers: <RawDatum>(node: ComputedDatum<RawDatum>, { onMouseEnter, onMouseMove, onMouseLeave, onClick }: MouseHandlers<RawDatum>) => Partial<Record<"onClick" | "onMouseEnter" | "onMouseLeave" | "onMouseMove", (event: MouseEvent) => void>>;
export declare const useNodeMouseHandlers: <RawDatum>(node: ComputedDatum<RawDatum>, { onMouseEnter, onMouseMove, onMouseLeave, onClick }: MouseHandlers<RawDatum>) => Partial<Record<"onMouseEnter" | "onMouseMove" | "onMouseLeave" | "onClick", (event: MouseEvent) => void>>;
export declare const useMouseCircleDetection: <RawDatum>({ nodes, canvasEl, margin, }: {

@@ -32,0 +32,0 @@ nodes: ComputedDatum<RawDatum>[];

@@ -9,3 +9,3 @@ import { OrdinalColorScaleConfig } from '@nivo/colors';

layers: CirclePackingLayerId[];
colors: OrdinalColorScaleConfig<any>;
colors: OrdinalColorScaleConfig;
colorBy: "depth";

@@ -12,0 +12,0 @@ inheritColorFromParent: boolean;

{
"name": "@nivo/circle-packing",
"version": "0.92.2",
"version": "0.93.0",
"license": "MIT",

@@ -39,6 +39,6 @@ "author": {

"dependencies": {
"@nivo/colors": "0.92.2",
"@nivo/core": "0.92.2",
"@nivo/theming": "0.92.0",
"@nivo/tooltip": "0.92.2",
"@nivo/colors": "0.93.0",
"@nivo/core": "0.93.0",
"@nivo/theming": "0.93.0",
"@nivo/tooltip": "0.93.0",
"@react-spring/web": "9.4.5 || ^9.7.2",

@@ -55,3 +55,3 @@ "@types/d3-hierarchy": "^1.1.8",

},
"gitHead": "204ff516ab45656e0197965d6e3458388cc8a8e3"
"gitHead": "83293c9d3d4c8fd10e92077f6d8e64057e15221d"
}

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

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

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

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

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

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