chartformers 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -0
- package/dist/chartformers.css +1 -0
- package/dist/chartformers.es.js +4011 -0
- package/dist/chartformers.umd.js +37 -0
- package/dist/charts/barchart.d.ts +13 -0
- package/dist/charts/piechart.d.ts +10 -0
- package/dist/charts/stacked-barchart-variants/grouped-barchart.d.ts +3 -0
- package/dist/charts/stacked-barchart-variants/percentage-barchart.d.ts +3 -0
- package/dist/charts/stacked-barchart-variants/stacked-barchart.d.ts +7 -0
- package/dist/charts/stacked-barchart-variants/types.d.ts +21 -0
- package/dist/components/tooltip.d.ts +16 -0
- package/dist/data/constants.d.ts +96 -0
- package/dist/hooks/useContainerSize.d.ts +7 -0
- package/dist/hooks/useD3.d.ts +3 -0
- package/dist/hooks/useLayerIndex.d.ts +1 -0
- package/dist/hooks/useParentSize.d.ts +12 -0
- package/dist/hooks/useUIControls.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/types.d.ts +4 -0
- package/dist/utils.d.ts +8 -0
- package/package.json +72 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
(function(xt,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],W):(xt=typeof globalThis<"u"?globalThis:xt||self,W(xt.chartformers={},xt.React,xt.ReactDOM))})(this,(function(xt,W,Me){"use strict";var Ce={exports:{}},de={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var In;function ti(){if(In)return de;In=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,a){var s=null;if(a!==void 0&&(s=""+a),i.key!==void 0&&(s=""+i.key),"key"in i){a={};for(var o in i)o!=="key"&&(a[o]=i[o])}else a=i;return i=a.ref,{$$typeof:t,type:r,key:s,ref:i!==void 0?i:null,props:a}}return de.Fragment=e,de.jsx=n,de.jsxs=n,de}var ge={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var On;function ei(){return On||(On=1,process.env.NODE_ENV!=="production"&&(function(){function t(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===x?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case D:return"Fragment";case H:return"Profiler";case A:return"StrictMode";case V:return"Suspense";case B:return"SuspenseList";case G:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case v:return"Portal";case I:return g.displayName||"Context";case S:return(g._context.displayName||"Context")+".Consumer";case M:var _=g.render;return g=g.displayName,g||(g=_.displayName||_.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case F:return _=g.displayName||null,_!==null?_:t(g.type)||"Memo";case j:_=g._payload,g=g._init;try{return t(g(_))}catch{}}return null}function e(g){return""+g}function n(g){try{e(g);var _=!1}catch{_=!0}if(_){_=console;var N=_.error,Y=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return N.call(_,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Y),e(g)}}function r(g){if(g===D)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===j)return"<...>";try{var _=t(g);return _?"<"+_+">":"<...>"}catch{return"<...>"}}function i(){var g=b.A;return g===null?null:g.getOwner()}function a(){return Error("react-stack-top-frame")}function s(g){if(m.call(g,"key")){var _=Object.getOwnPropertyDescriptor(g,"key").get;if(_&&_.isReactWarning)return!1}return g.key!==void 0}function o(g,_){function N(){C||(C=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",_))}N.isReactWarning=!0,Object.defineProperty(g,"key",{get:N,configurable:!0})}function c(){var g=t(this.type);return k[g]||(k[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function l(g,_,N,Y,Q,st){var nt=N.ref;return g={$$typeof:y,type:g,key:_,props:N,_owner:Y},(nt!==void 0?nt:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:c}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:st}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function u(g,_,N,Y,Q,st){var nt=_.children;if(nt!==void 0)if(Y)if(T(nt)){for(Y=0;Y<nt.length;Y++)h(nt[Y]);Object.freeze&&Object.freeze(nt)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(nt);if(m.call(_,"key")){nt=t(g);var it=Object.keys(_).filter(function(ht){return ht!=="key"});Y=0<it.length?"{key: someKey, "+it.join(": ..., ")+": ...}":"{key: someKey}",q[nt+Y]||(it=0<it.length?"{"+it.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,Y,nt,it,nt),q[nt+Y]=!0)}if(nt=null,N!==void 0&&(n(N),nt=""+N),s(_)&&(n(_.key),nt=""+_.key),"key"in _){N={};for(var ot in _)ot!=="key"&&(N[ot]=_[ot])}else N=_;return nt&&o(N,typeof g=="function"?g.displayName||g.name||"Unknown":g),l(g,nt,N,i(),Q,st)}function h(g){f(g)?g._store&&(g._store.validated=1):typeof g=="object"&&g!==null&&g.$$typeof===j&&(g._payload.status==="fulfilled"?f(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function f(g){return typeof g=="object"&&g!==null&&g.$$typeof===y}var d=W,y=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),I=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),x=Symbol.for("react.client.reference"),b=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,m=Object.prototype.hasOwnProperty,T=Array.isArray,at=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(g){return g()}};var C,k={},$=d.react_stack_bottom_frame.bind(d,a)(),z=at(r(a)),q={};ge.Fragment=D,ge.jsx=function(g,_,N){var Y=1e4>b.recentlyCreatedOwnerStacks++;return u(g,_,N,!1,Y?Error("react-stack-top-frame"):$,Y?at(r(g)):z)},ge.jsxs=function(g,_,N){var Y=1e4>b.recentlyCreatedOwnerStacks++;return u(g,_,N,!0,Y?Error("react-stack-top-frame"):$,Y?at(r(g)):z)}})()),ge}var zn;function ni(){return zn||(zn=1,process.env.NODE_ENV==="production"?Ce.exports=ti():Ce.exports=ei()),Ce.exports}var R=ni();function pe(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ri(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jn(t){let e,n,r;t.length!==2?(e=pe,n=(o,c)=>pe(t(o),c),r=(o,c)=>t(o)-c):(e=t===pe||t===ri?t:ii,n=t,r=t);function i(o,c,l=0,u=o.length){if(l<u){if(e(c,c)!==0)return u;do{const h=l+u>>>1;n(o[h],c)<0?l=h+1:u=h}while(l<u)}return l}function a(o,c,l=0,u=o.length){if(l<u){if(e(c,c)!==0)return u;do{const h=l+u>>>1;n(o[h],c)<=0?l=h+1:u=h}while(l<u)}return l}function s(o,c,l=0,u=o.length){const h=i(o,c,l,u-1);return h>l&&r(o[h-1],c)>-r(o[h],c)?h-1:h}return{left:i,center:s,right:a}}function ii(){return 0}function ai(t){return t===null?NaN:+t}const si=jn(pe).right;jn(ai).center;class Fn extends Map{constructor(e,n=ci){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Yn(this,e))}has(e){return super.has(Yn(this,e))}set(e,n){return super.set(oi(this,e),n)}delete(e){return super.delete(li(this,e))}}function Yn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function oi({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function li({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function ci(t){return t!==null&&typeof t=="object"?t.valueOf():t}const ui=Math.sqrt(50),fi=Math.sqrt(10),hi=Math.sqrt(2);function Le(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=ui?10:a>=fi?5:a>=hi?2:1;let o,c,l;return i<0?(l=Math.pow(10,-i)/s,o=Math.round(t*l),c=Math.round(e*l),o/l<t&&++o,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*s,o=Math.round(t/l),c=Math.round(e/l),o*l<t&&++o,c*l>e&&--c),c<o&&.5<=n&&n<2?Le(t,e,n*2):[o,c,l]}function di(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,s]=r?Le(e,t,n):Le(t,e,n);if(!(a>=i))return[];const o=a-i+1,c=new Array(o);if(r)if(s<0)for(let l=0;l<o;++l)c[l]=(a-l)/-s;else for(let l=0;l<o;++l)c[l]=(a-l)*s;else if(s<0)for(let l=0;l<o;++l)c[l]=(i+l)/-s;else for(let l=0;l<o;++l)c[l]=(i+l)*s;return c}function cn(t,e,n){return e=+e,t=+t,n=+n,Le(t,e,n)[2]}function gi(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?cn(e,t,n):cn(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function $t(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function pi(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r<i;)a[r]=t+r*n;return a}const mi=yi(Math.random);function yi(t){return function(n,r=0,i=n.length){let a=i-(r=+r);for(;a;){const s=t()*a--|0,o=n[a+r];n[a+r]=n[s+r],n[s+r]=o}return n}}function xi(t){return t}var un=1,fn=2,hn=3,me=4,Bn=1e-6;function vi(t){return"translate("+t+",0)"}function _i(t){return"translate(0,"+t+")"}function bi(t){return e=>+t(e)}function wi(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ki(){return!this.__axis}function Vn(t,e){var n=[],r=null,i=null,a=6,s=6,o=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=t===un||t===me?-1:1,u=t===me||t===fn?"x":"y",h=t===un||t===hn?vi:_i;function f(d){var y=r??(e.ticks?e.ticks.apply(e,n):e.domain()),v=i??(e.tickFormat?e.tickFormat.apply(e,n):xi),D=Math.max(a,0)+o,A=e.range(),H=+A[0]+c,S=+A[A.length-1]+c,I=(e.bandwidth?wi:bi)(e.copy(),c),M=d.selection?d.selection():d,V=M.selectAll(".domain").data([null]),B=M.selectAll(".tick").data(y,e).order(),F=B.exit(),j=B.enter().append("g").attr("class","tick"),G=B.select("line"),x=B.select("text");V=V.merge(V.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),B=B.merge(j),G=G.merge(j.append("line").attr("stroke","currentColor").attr(u+"2",l*a)),x=x.merge(j.append("text").attr("fill","currentColor").attr(u,l*D).attr("dy",t===un?"0em":t===hn?"0.71em":"0.32em")),d!==M&&(V=V.transition(d),B=B.transition(d),G=G.transition(d),x=x.transition(d),F=F.transition(d).attr("opacity",Bn).attr("transform",function(b){return isFinite(b=I(b))?h(b+c):this.getAttribute("transform")}),j.attr("opacity",Bn).attr("transform",function(b){var m=this.parentNode.__axis;return h((m&&isFinite(m=m(b))?m:I(b))+c)})),F.remove(),V.attr("d",t===me||t===fn?s?"M"+l*s+","+H+"H"+c+"V"+S+"H"+l*s:"M"+c+","+H+"V"+S:s?"M"+H+","+l*s+"V"+c+"H"+S+"V"+l*s:"M"+H+","+c+"H"+S),B.attr("opacity",1).attr("transform",function(b){return h(I(b)+c)}),G.attr(u+"2",l*a),x.attr(u,l*D).text(v),M.filter(ki).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===fn?"start":t===me?"end":"middle"),M.each(function(){this.__axis=I})}return f.scale=function(d){return arguments.length?(e=d,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(d){return arguments.length?(n=d==null?[]:Array.from(d),f):n.slice()},f.tickValues=function(d){return arguments.length?(r=d==null?null:Array.from(d),f):r&&r.slice()},f.tickFormat=function(d){return arguments.length?(i=d,f):i},f.tickSize=function(d){return arguments.length?(a=s=+d,f):a},f.tickSizeInner=function(d){return arguments.length?(a=+d,f):a},f.tickSizeOuter=function(d){return arguments.length?(s=+d,f):s},f.tickPadding=function(d){return arguments.length?(o=+d,f):o},f.offset=function(d){return arguments.length?(c=+d,f):c},f}function jt(t){return Vn(hn,t)}function Ft(t){return Vn(me,t)}var Ai={value:()=>{}};function Wn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Pe(n)}function Pe(t){this._=t}function Si(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Pe.prototype=Wn.prototype={constructor:Pe,on:function(t,e){var n=this._,r=Si(t+"",n),i,a=-1,s=r.length;if(arguments.length<2){for(;++a<s;)if((i=(t=r[a]).type)&&(i=Ni(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<s;)if(i=(t=r[a]).type)n[i]=Xn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Xn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Pe(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Ni(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Xn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Ai,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var dn="http://www.w3.org/1999/xhtml";const Un={svg:"http://www.w3.org/2000/svg",xhtml:dn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function De(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Un.hasOwnProperty(e)?{space:Un[e],local:t}:t}function $i(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===dn&&e.documentElement.namespaceURI===dn?e.createElement(t):e.createElementNS(n,t)}}function Ti(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Kn(t){var e=De(t);return(e.local?Ti:$i)(e)}function Ei(){}function gn(t){return t==null?Ei:function(){return this.querySelector(t)}}function Ri(t){typeof t!="function"&&(t=gn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],s=a.length,o=r[i]=new Array(s),c,l,u=0;u<s;++u)(c=a[u])&&(l=t.call(c,c.__data__,u,a))&&("__data__"in c&&(l.__data__=c.__data__),o[u]=l);return new mt(r,this._parents)}function Mi(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ci(){return[]}function Jn(t){return t==null?Ci:function(){return this.querySelectorAll(t)}}function Li(t){return function(){return Mi(t.apply(this,arguments))}}function Pi(t){typeof t=="function"?t=Li(t):t=Jn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var s=e[a],o=s.length,c,l=0;l<o;++l)(c=s[l])&&(r.push(t.call(c,c.__data__,l,s)),i.push(c));return new mt(r,i)}function Gn(t){return function(){return this.matches(t)}}function Zn(t){return function(e){return e.matches(t)}}var Di=Array.prototype.find;function Hi(t){return function(){return Di.call(this.children,t)}}function Ii(){return this.firstElementChild}function Oi(t){return this.select(t==null?Ii:Hi(typeof t=="function"?t:Zn(t)))}var zi=Array.prototype.filter;function ji(){return Array.from(this.children)}function Fi(t){return function(){return zi.call(this.children,t)}}function Yi(t){return this.selectAll(t==null?ji:Fi(typeof t=="function"?t:Zn(t)))}function Bi(t){typeof t!="function"&&(t=Gn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],s=a.length,o=r[i]=[],c,l=0;l<s;++l)(c=a[l])&&t.call(c,c.__data__,l,a)&&o.push(c);return new mt(r,this._parents)}function qn(t){return new Array(t.length)}function Vi(){return new mt(this._enter||this._groups.map(qn),this._parents)}function He(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}He.prototype={constructor:He,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Wi(t){return function(){return t}}function Xi(t,e,n,r,i,a){for(var s=0,o,c=e.length,l=a.length;s<l;++s)(o=e[s])?(o.__data__=a[s],r[s]=o):n[s]=new He(t,a[s]);for(;s<c;++s)(o=e[s])&&(i[s]=o)}function Ui(t,e,n,r,i,a,s){var o,c,l=new Map,u=e.length,h=a.length,f=new Array(u),d;for(o=0;o<u;++o)(c=e[o])&&(f[o]=d=s.call(c,c.__data__,o,e)+"",l.has(d)?i[o]=c:l.set(d,c));for(o=0;o<h;++o)d=s.call(t,a[o],o,a)+"",(c=l.get(d))?(r[o]=c,c.__data__=a[o],l.delete(d)):n[o]=new He(t,a[o]);for(o=0;o<u;++o)(c=e[o])&&l.get(f[o])===c&&(i[o]=c)}function Ki(t){return t.__data__}function Ji(t,e){if(!arguments.length)return Array.from(this,Ki);var n=e?Ui:Xi,r=this._parents,i=this._groups;typeof t!="function"&&(t=Wi(t));for(var a=i.length,s=new Array(a),o=new Array(a),c=new Array(a),l=0;l<a;++l){var u=r[l],h=i[l],f=h.length,d=Gi(t.call(u,u&&u.__data__,l,r)),y=d.length,v=o[l]=new Array(y),D=s[l]=new Array(y),A=c[l]=new Array(f);n(u,h,v,D,A,d,e);for(var H=0,S=0,I,M;H<y;++H)if(I=v[H]){for(H>=S&&(S=H+1);!(M=D[S])&&++S<y;);I._next=M||null}}return s=new mt(s,r),s._enter=o,s._exit=c,s}function Gi(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Zi(){return new mt(this._exit||this._groups.map(qn),this._parents)}function qi(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Qi(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,s=Math.min(i,a),o=new Array(i),c=0;c<s;++c)for(var l=n[c],u=r[c],h=l.length,f=o[c]=new Array(h),d,y=0;y<h;++y)(d=l[y]||u[y])&&(f[y]=d);for(;c<i;++c)o[c]=n[c];return new mt(o,this._parents)}function ta(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],s;--i>=0;)(s=r[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function ea(t){t||(t=na);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var s=n[a],o=s.length,c=i[a]=new Array(o),l,u=0;u<o;++u)(l=s[u])&&(c[u]=l);c.sort(e)}return new mt(i,this._parents).order()}function na(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ra(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ia(){return Array.from(this)}function aa(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var s=r[i];if(s)return s}return null}function sa(){let t=0;for(const e of this)++t;return t}function oa(){return!this.node()}function la(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,s=i.length,o;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this}function ca(t){return function(){this.removeAttribute(t)}}function ua(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fa(t,e){return function(){this.setAttribute(t,e)}}function ha(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function da(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ga(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function pa(t,e){var n=De(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?ua:ca:typeof e=="function"?n.local?ga:da:n.local?ha:fa)(n,e))}function Qn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ma(t){return function(){this.style.removeProperty(t)}}function ya(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xa(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function va(t,e,n){return arguments.length>1?this.each((e==null?ma:typeof e=="function"?xa:ya)(t,e,n??"")):ie(this.node(),t)}function ie(t,e){return t.style.getPropertyValue(e)||Qn(t).getComputedStyle(t,null).getPropertyValue(e)}function _a(t){return function(){delete this[t]}}function ba(t,e){return function(){this[t]=e}}function wa(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function ka(t,e){return arguments.length>1?this.each((e==null?_a:typeof e=="function"?wa:ba)(t,e)):this.node()[t]}function tr(t){return t.trim().split(/^|\s+/)}function pn(t){return t.classList||new er(t)}function er(t){this._node=t,this._names=tr(t.getAttribute("class")||"")}er.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function nr(t,e){for(var n=pn(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function rr(t,e){for(var n=pn(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Aa(t){return function(){nr(this,t)}}function Sa(t){return function(){rr(this,t)}}function Na(t,e){return function(){(e.apply(this,arguments)?nr:rr)(this,t)}}function $a(t,e){var n=tr(t+"");if(arguments.length<2){for(var r=pn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Na:e?Aa:Sa)(n,e))}function Ta(){this.textContent=""}function Ea(t){return function(){this.textContent=t}}function Ra(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ma(t){return arguments.length?this.each(t==null?Ta:(typeof t=="function"?Ra:Ea)(t)):this.node().textContent}function Ca(){this.innerHTML=""}function La(t){return function(){this.innerHTML=t}}function Pa(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Da(t){return arguments.length?this.each(t==null?Ca:(typeof t=="function"?Pa:La)(t)):this.node().innerHTML}function Ha(){this.nextSibling&&this.parentNode.appendChild(this)}function Ia(){return this.each(Ha)}function Oa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function za(){return this.each(Oa)}function ja(t){var e=typeof t=="function"?t:Kn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Fa(){return null}function Ya(t,e){var n=typeof t=="function"?t:Kn(t),r=e==null?Fa:typeof e=="function"?e:gn(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ba(){var t=this.parentNode;t&&t.removeChild(this)}function Va(){return this.each(Ba)}function Wa(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Xa(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ua(t){return this.select(t?Xa:Wa)}function Ka(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ja(t){return function(e){t.call(this,e,this.__data__)}}function Ga(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Za(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function qa(t,e,n){return function(){var r=this.__on,i,a=Ja(e);if(r){for(var s=0,o=r.length;s<o;++s)if((i=r[s]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Qa(t,e,n){var r=Ga(t+""),i,a=r.length,s;if(arguments.length<2){var o=this.node().__on;if(o){for(var c=0,l=o.length,u;c<l;++c)for(i=0,u=o[c];i<a;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(o=e?qa:Za,i=0;i<a;++i)this.each(o(r[i],e,n));return this}function ir(t,e,n){var r=Qn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function ts(t,e){return function(){return ir(this,t,e)}}function es(t,e){return function(){return ir(this,t,e.apply(this,arguments))}}function ns(t,e){return this.each((typeof e=="function"?es:ts)(t,e))}function*rs(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,s;i<a;++i)(s=r[i])&&(yield s)}var ar=[null];function mt(t,e){this._groups=t,this._parents=e}function ye(){return new mt([[document.documentElement]],ar)}function is(){return this}mt.prototype=ye.prototype={constructor:mt,select:Ri,selectAll:Pi,selectChild:Oi,selectChildren:Yi,filter:Bi,data:Ji,enter:Vi,exit:Zi,join:qi,merge:Qi,selection:is,order:ta,sort:ea,call:ra,nodes:ia,node:aa,size:sa,empty:oa,each:la,attr:pa,style:va,property:ka,classed:$a,text:Ma,html:Da,raise:Ia,lower:za,append:ja,insert:Ya,remove:Va,clone:Ua,datum:Ka,on:Qa,dispatch:ns,[Symbol.iterator]:rs};function vt(t){return typeof t=="string"?new mt([[document.querySelector(t)]],[document.documentElement]):new mt([[t]],ar)}function mn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sr(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function xe(){}var ve=.7,Ie=1/ve,ae="\\s*([+-]?\\d+)\\s*",_e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",as=/^#([0-9a-f]{3,8})$/,ss=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),os=new RegExp(`^rgb\\(${Tt},${Tt},${Tt}\\)$`),ls=new RegExp(`^rgba\\(${ae},${ae},${ae},${_e}\\)$`),cs=new RegExp(`^rgba\\(${Tt},${Tt},${Tt},${_e}\\)$`),us=new RegExp(`^hsl\\(${_e},${Tt},${Tt}\\)$`),fs=new RegExp(`^hsla\\(${_e},${Tt},${Tt},${_e}\\)$`),or={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};mn(xe,Gt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:lr,formatHex:lr,formatHex8:hs,formatHsl:ds,formatRgb:cr,toString:cr});function lr(){return this.rgb().formatHex()}function hs(){return this.rgb().formatHex8()}function ds(){return gr(this).formatHsl()}function cr(){return this.rgb().formatRgb()}function Gt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=as.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ur(e):n===3?new dt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Oe(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Oe(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ss.exec(t))?new dt(e[1],e[2],e[3],1):(e=os.exec(t))?new dt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ls.exec(t))?Oe(e[1],e[2],e[3],e[4]):(e=cs.exec(t))?Oe(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=us.exec(t))?dr(e[1],e[2]/100,e[3]/100,1):(e=fs.exec(t))?dr(e[1],e[2]/100,e[3]/100,e[4]):or.hasOwnProperty(t)?ur(or[t]):t==="transparent"?new dt(NaN,NaN,NaN,0):null}function ur(t){return new dt(t>>16&255,t>>8&255,t&255,1)}function Oe(t,e,n,r){return r<=0&&(t=e=n=NaN),new dt(t,e,n,r)}function gs(t){return t instanceof xe||(t=Gt(t)),t?(t=t.rgb(),new dt(t.r,t.g,t.b,t.opacity)):new dt}function yn(t,e,n,r){return arguments.length===1?gs(t):new dt(t,e,n,r??1)}function dt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}mn(dt,yn,sr(xe,{brighter(t){return t=t==null?Ie:Math.pow(Ie,t),new dt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ve:Math.pow(ve,t),new dt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new dt(Zt(this.r),Zt(this.g),Zt(this.b),ze(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:fr,formatHex:fr,formatHex8:ps,formatRgb:hr,toString:hr}));function fr(){return`#${qt(this.r)}${qt(this.g)}${qt(this.b)}`}function ps(){return`#${qt(this.r)}${qt(this.g)}${qt(this.b)}${qt((isNaN(this.opacity)?1:this.opacity)*255)}`}function hr(){const t=ze(this.opacity);return`${t===1?"rgb(":"rgba("}${Zt(this.r)}, ${Zt(this.g)}, ${Zt(this.b)}${t===1?")":`, ${t})`}`}function ze(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Zt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function qt(t){return t=Zt(t),(t<16?"0":"")+t.toString(16)}function dr(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new kt(t,e,n,r)}function gr(t){if(t instanceof kt)return new kt(t.h,t.s,t.l,t.opacity);if(t instanceof xe||(t=Gt(t)),!t)return new kt;if(t instanceof kt)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,o=a-i,c=(a+i)/2;return o?(e===a?s=(n-r)/o+(n<r)*6:n===a?s=(r-e)/o+2:s=(e-n)/o+4,o/=c<.5?a+i:2-a-i,s*=60):o=c>0&&c<1?0:s,new kt(s,o,c,t.opacity)}function ms(t,e,n,r){return arguments.length===1?gr(t):new kt(t,e,n,r??1)}function kt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}mn(kt,ms,sr(xe,{brighter(t){return t=t==null?Ie:Math.pow(Ie,t),new kt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ve:Math.pow(ve,t),new kt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new dt(xn(t>=240?t-240:t+120,i,r),xn(t,i,r),xn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new kt(pr(this.h),je(this.s),je(this.l),ze(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ze(this.opacity);return`${t===1?"hsl(":"hsla("}${pr(this.h)}, ${je(this.s)*100}%, ${je(this.l)*100}%${t===1?")":`, ${t})`}`}}));function pr(t){return t=(t||0)%360,t<0?t+360:t}function je(t){return Math.max(0,Math.min(1,t||0))}function xn(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const vn=t=>()=>t;function ys(t,e){return function(n){return t+n*e}}function xs(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function vs(t){return(t=+t)==1?mr:function(e,n){return n-e?xs(e,n,t):vn(isNaN(e)?n:e)}}function mr(t,e){var n=e-t;return n?ys(t,n):vn(isNaN(t)?e:t)}const Fe=(function t(e){var n=vs(e);function r(i,a){var s=n((i=yn(i)).r,(a=yn(a)).r),o=n(i.g,a.g),c=n(i.b,a.b),l=mr(i.opacity,a.opacity);return function(u){return i.r=s(u),i.g=o(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function _s(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function bs(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ws(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Yt(t[s],e[s]);for(;s<n;++s)a[s]=e[s];return function(o){for(s=0;s<r;++s)a[s]=i[s](o);return a}}function ks(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function At(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function As(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Yt(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var _n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bn=new RegExp(_n.source,"g");function Ss(t){return function(){return t}}function Ns(t){return function(e){return t(e)+""}}function yr(t,e){var n=_n.lastIndex=bn.lastIndex=0,r,i,a,s=-1,o=[],c=[];for(t=t+"",e=e+"";(r=_n.exec(t))&&(i=bn.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),o[s]?o[s]+=a:o[++s]=a),(r=r[0])===(i=i[0])?o[s]?o[s]+=i:o[++s]=i:(o[++s]=null,c.push({i:s,x:At(r,i)})),n=bn.lastIndex;return n<e.length&&(a=e.slice(n),o[s]?o[s]+=a:o[++s]=a),o.length<2?c[0]?Ns(c[0].x):Ss(e):(e=c.length,function(l){for(var u=0,h;u<e;++u)o[(h=c[u]).i]=h.x(l);return o.join("")})}function Yt(t,e){var n=typeof e,r;return e==null||n==="boolean"?vn(e):(n==="number"?At:n==="string"?(r=Gt(e))?(e=r,Fe):yr:e instanceof Gt?Fe:e instanceof Date?ks:bs(e)?_s:Array.isArray(e)?ws:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?As:At)(t,e)}function $s(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var xr=180/Math.PI,wn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function vr(t,e,n,r,i,a){var s,o,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(o=Math.sqrt(n*n+r*r))&&(n/=o,r/=o,c/=o),t*r<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*xr,skewX:Math.atan(c)*xr,scaleX:s,scaleY:o}}var Ye;function Ts(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?wn:vr(e.a,e.b,e.c,e.d,e.e,e.f)}function Es(t){return t==null||(Ye||(Ye=document.createElementNS("http://www.w3.org/2000/svg","g")),Ye.setAttribute("transform",t),!(t=Ye.transform.baseVal.consolidate()))?wn:(t=t.matrix,vr(t.a,t.b,t.c,t.d,t.e,t.f))}function _r(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,u,h,f,d,y){if(l!==h||u!==f){var v=d.push("translate(",null,e,null,n);y.push({i:v-4,x:At(l,h)},{i:v-2,x:At(u,f)})}else(h||f)&&d.push("translate("+h+e+f+n)}function s(l,u,h,f){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:At(l,u)})):u&&h.push(i(h)+"rotate("+u+r)}function o(l,u,h,f){l!==u?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:At(l,u)}):u&&h.push(i(h)+"skewX("+u+r)}function c(l,u,h,f,d,y){if(l!==h||u!==f){var v=d.push(i(d)+"scale(",null,",",null,")");y.push({i:v-4,x:At(l,h)},{i:v-2,x:At(u,f)})}else(h!==1||f!==1)&&d.push(i(d)+"scale("+h+","+f+")")}return function(l,u){var h=[],f=[];return l=t(l),u=t(u),a(l.translateX,l.translateY,u.translateX,u.translateY,h,f),s(l.rotate,u.rotate,h,f),o(l.skewX,u.skewX,h,f),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,f),l=u=null,function(d){for(var y=-1,v=f.length,D;++y<v;)h[(D=f[y]).i]=D.x(d);return h.join("")}}}var Rs=_r(Ts,"px, ","px)","deg)"),Ms=_r(Es,", ",")",")"),se=0,be=0,we=0,br=1e3,Be,ke,Ve=0,Qt=0,We=0,Ae=typeof performance=="object"&&performance.now?performance:Date,wr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function kn(){return Qt||(wr(Cs),Qt=Ae.now()+We)}function Cs(){Qt=0}function Xe(){this._call=this._time=this._next=null}Xe.prototype=kr.prototype={constructor:Xe,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?kn():+n)+(e==null?0:+e),!this._next&&ke!==this&&(ke?ke._next=this:Be=this,ke=this),this._call=t,this._time=n,An()},stop:function(){this._call&&(this._call=null,this._time=1/0,An())}};function kr(t,e,n){var r=new Xe;return r.restart(t,e,n),r}function Ls(){kn(),++se;for(var t=Be,e;t;)(e=Qt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--se}function Ar(){Qt=(Ve=Ae.now())+We,se=be=0;try{Ls()}finally{se=0,Ds(),Qt=0}}function Ps(){var t=Ae.now(),e=t-Ve;e>br&&(We-=e,Ve=t)}function Ds(){for(var t,e=Be,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Be=n);ke=t,An(r)}function An(t){if(!se){be&&(be=clearTimeout(be));var e=t-Qt;e>24?(t<1/0&&(be=setTimeout(Ar,t-Ae.now()-We)),we&&(we=clearInterval(we))):(we||(Ve=Ae.now(),we=setInterval(Ps,br)),se=1,wr(Ar))}}function Sr(t,e,n){var r=new Xe;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Hs=Wn("start","end","cancel","interrupt"),Is=[],Nr=0,$r=1,Sn=2,Ue=3,Tr=4,Nn=5,Ke=6;function Je(t,e,n,r,i,a){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;Os(t,n,{name:e,index:r,group:i,on:Hs,tween:Is,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Nr})}function $n(t,e){var n=St(t,e);if(n.state>Nr)throw new Error("too late; already scheduled");return n}function Et(t,e){var n=St(t,e);if(n.state>Ue)throw new Error("too late; already running");return n}function St(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Os(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=kr(a,0,n.time);function a(l){n.state=$r,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,h,f,d;if(n.state!==$r)return c();for(u in r)if(d=r[u],d.name===n.name){if(d.state===Ue)return Sr(s);d.state===Tr?(d.state=Ke,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[u]):+u<e&&(d.state=Ke,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[u])}if(Sr(function(){n.state===Ue&&(n.state=Tr,n.timer.restart(o,n.delay,n.time),o(l))}),n.state=Sn,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Sn){for(n.state=Ue,i=new Array(f=n.tween.length),u=0,h=-1;u<f;++u)(d=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=d);i.length=h+1}}function o(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Nn,1),h=-1,f=i.length;++h<f;)i[h].call(t,u);n.state===Nn&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Ke,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function zs(t,e){var n=t.__transition,r,i,a=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((r=n[s]).name!==e){a=!1;continue}i=r.state>Sn&&r.state<Nn,r.state=Ke,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[s]}a&&delete t.__transition}}function js(t){return this.each(function(){zs(this,t)})}function Fs(t,e){var n,r;return function(){var i=Et(this,t),a=i.tween;if(a!==n){r=n=a;for(var s=0,o=r.length;s<o;++s)if(r[s].name===e){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function Ys(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Et(this,t),s=a.tween;if(s!==r){i=(r=s).slice();for(var o={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=o;break}c===l&&i.push(o)}a.tween=i}}function Bs(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=St(this.node(),n).tween,i=0,a=r.length,s;i<a;++i)if((s=r[i]).name===t)return s.value;return null}return this.each((e==null?Fs:Ys)(n,t,e))}function Tn(t,e,n){var r=t._id;return t.each(function(){var i=Et(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return St(i,r).value[e]}}function Er(t,e){var n;return(typeof e=="number"?At:e instanceof Gt?Fe:(n=Gt(e))?(e=n,Fe):yr)(t,e)}function Vs(t){return function(){this.removeAttribute(t)}}function Ws(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Xs(t,e,n){var r,i=n+"",a;return function(){var s=this.getAttribute(t);return s===i?null:s===r?a:a=e(r=s,n)}}function Us(t,e,n){var r,i=n+"",a;return function(){var s=this.getAttributeNS(t.space,t.local);return s===i?null:s===r?a:a=e(r=s,n)}}function Ks(t,e,n){var r,i,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=o+"",s===c?null:s===r&&c===i?a:(i=c,a=e(r=s,o)))}}function Js(t,e,n){var r,i,a;return function(){var s,o=n(this),c;return o==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=o+"",s===c?null:s===r&&c===i?a:(i=c,a=e(r=s,o)))}}function Gs(t,e){var n=De(t),r=n==="transform"?Ms:Er;return this.attrTween(t,typeof e=="function"?(n.local?Js:Ks)(n,r,Tn(this,"attr."+t,e)):e==null?(n.local?Ws:Vs)(n):(n.local?Us:Xs)(n,r,e))}function Zs(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function qs(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Qs(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&qs(t,a)),n}return i._value=e,i}function to(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Zs(t,a)),n}return i._value=e,i}function eo(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=De(t);return this.tween(n,(r.local?Qs:to)(r,e))}function no(t,e){return function(){$n(this,t).delay=+e.apply(this,arguments)}}function ro(t,e){return e=+e,function(){$n(this,t).delay=e}}function io(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?no:ro)(e,t)):St(this.node(),e).delay}function ao(t,e){return function(){Et(this,t).duration=+e.apply(this,arguments)}}function so(t,e){return e=+e,function(){Et(this,t).duration=e}}function oo(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ao:so)(e,t)):St(this.node(),e).duration}function lo(t,e){if(typeof e!="function")throw new Error;return function(){Et(this,t).ease=e}}function co(t){var e=this._id;return arguments.length?this.each(lo(e,t)):St(this.node(),e).ease}function uo(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Et(this,t).ease=n}}function fo(t){if(typeof t!="function")throw new Error;return this.each(uo(this._id,t))}function ho(t){typeof t!="function"&&(t=Gn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],s=a.length,o=r[i]=[],c,l=0;l<s;++l)(c=a[l])&&t.call(c,c.__data__,l,a)&&o.push(c);return new Pt(r,this._parents,this._name,this._id)}function go(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),s=new Array(r),o=0;o<a;++o)for(var c=e[o],l=n[o],u=c.length,h=s[o]=new Array(u),f,d=0;d<u;++d)(f=c[d]||l[d])&&(h[d]=f);for(;o<r;++o)s[o]=e[o];return new Pt(s,this._parents,this._name,this._id)}function po(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function mo(t,e,n){var r,i,a=po(e)?$n:Et;return function(){var s=a(this,t),o=s.on;o!==r&&(i=(r=o).copy()).on(e,n),s.on=i}}function yo(t,e){var n=this._id;return arguments.length<2?St(this.node(),n).on.on(t):this.each(mo(n,t,e))}function xo(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function vo(){return this.on("end.remove",xo(this._id))}function _o(t){var e=this._name,n=this._id;typeof t!="function"&&(t=gn(t));for(var r=this._groups,i=r.length,a=new Array(i),s=0;s<i;++s)for(var o=r[s],c=o.length,l=a[s]=new Array(c),u,h,f=0;f<c;++f)(u=o[f])&&(h=t.call(u,u.__data__,f,o))&&("__data__"in u&&(h.__data__=u.__data__),l[f]=h,Je(l[f],e,n,f,l,St(u,n)));return new Pt(a,this._parents,e,n)}function bo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jn(t));for(var r=this._groups,i=r.length,a=[],s=[],o=0;o<i;++o)for(var c=r[o],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var f=t.call(u,u.__data__,h,c),d,y=St(u,n),v=0,D=f.length;v<D;++v)(d=f[v])&&Je(d,e,n,v,f,y);a.push(f),s.push(u)}return new Pt(a,s,e,n)}var wo=ye.prototype.constructor;function ko(){return new wo(this._groups,this._parents)}function Ao(t,e){var n,r,i;return function(){var a=ie(this,t),s=(this.style.removeProperty(t),ie(this,t));return a===s?null:a===n&&s===r?i:i=e(n=a,r=s)}}function Rr(t){return function(){this.style.removeProperty(t)}}function So(t,e,n){var r,i=n+"",a;return function(){var s=ie(this,t);return s===i?null:s===r?a:a=e(r=s,n)}}function No(t,e,n){var r,i,a;return function(){var s=ie(this,t),o=n(this),c=o+"";return o==null&&(c=o=(this.style.removeProperty(t),ie(this,t))),s===c?null:s===r&&c===i?a:(i=c,a=e(r=s,o))}}function $o(t,e){var n,r,i,a="style."+e,s="end."+a,o;return function(){var c=Et(this,t),l=c.on,u=c.value[a]==null?o||(o=Rr(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(s,i=u),c.on=r}}function To(t,e,n){var r=(t+="")=="transform"?Rs:Er;return e==null?this.styleTween(t,Ao(t,r)).on("end.style."+t,Rr(t)):typeof e=="function"?this.styleTween(t,No(t,r,Tn(this,"style."+t,e))).each($o(this._id,t)):this.styleTween(t,So(t,r,e),n).on("end.style."+t,null)}function Eo(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Ro(t,e,n){var r,i;function a(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&Eo(t,s,n)),r}return a._value=e,a}function Mo(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Ro(t,e,n??""))}function Co(t){return function(){this.textContent=t}}function Lo(t){return function(){var e=t(this);this.textContent=e??""}}function Po(t){return this.tween("text",typeof t=="function"?Lo(Tn(this,"text",t)):Co(t==null?"":t+""))}function Do(t){return function(e){this.textContent=t.call(this,e)}}function Ho(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Do(i)),e}return r._value=t,r}function Io(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Ho(t))}function Oo(){for(var t=this._name,e=this._id,n=Mr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,c,l=0;l<o;++l)if(c=s[l]){var u=St(c,e);Je(c,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Pt(r,this._parents,t,n)}function zo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,s){var o={value:s},c={value:function(){--i===0&&a()}};n.each(function(){var l=Et(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(o),e._.interrupt.push(o),e._.end.push(c)),l.on=e}),i===0&&a()})}var jo=0;function Pt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Mr(){return++jo}var Dt=ye.prototype;Pt.prototype={constructor:Pt,select:_o,selectAll:bo,selectChild:Dt.selectChild,selectChildren:Dt.selectChildren,filter:ho,merge:go,selection:ko,transition:Oo,call:Dt.call,nodes:Dt.nodes,node:Dt.node,size:Dt.size,empty:Dt.empty,each:Dt.each,on:yo,attr:Gs,attrTween:eo,style:To,styleTween:Mo,text:Po,textTween:Io,remove:vo,tween:Bs,delay:io,duration:oo,ease:co,easeVarying:fo,end:zo,[Symbol.iterator]:Dt[Symbol.iterator]};function Fo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Yo={time:null,delay:0,duration:250,ease:Fo};function Bo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Vo(t){var e,n;t instanceof Pt?(e=t._id,t=t._name):(e=Mr(),(n=Yo).time=kn(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var s=r[a],o=s.length,c,l=0;l<o;++l)(c=s[l])&&Je(c,t,e,l,s,n||Bo(c,e));return new Pt(r,this._parents,t,e)}ye.prototype.interrupt=js,ye.prototype.transition=Vo;const En=Math.PI,Rn=2*En,te=1e-6,Wo=Rn-te;function Cr(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function Xo(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Cr;const n=10**e;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Uo{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Cr:Xo(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,r,i){this._append`Q${+e},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(e,n,r,i,a,s){this._append`C${+e},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(e,n,r,i,a){if(e=+e,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,o=this._y1,c=r-e,l=i-n,u=s-e,h=o-n,f=u*u+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>te)if(!(Math.abs(h*c-l*u)>te)||!a)this._append`L${this._x1=e},${this._y1=n}`;else{let d=r-s,y=i-o,v=c*c+l*l,D=d*d+y*y,A=Math.sqrt(v),H=Math.sqrt(f),S=a*Math.tan((En-Math.acos((v+f-D)/(2*A*H)))/2),I=S/H,M=S/A;Math.abs(I-1)>te&&this._append`L${e+I*u},${n+I*h}`,this._append`A${a},${a},0,0,${+(h*d>u*y)},${this._x1=e+M*c},${this._y1=n+M*l}`}}arc(e,n,r,i,a,s){if(e=+e,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),c=r*Math.sin(i),l=e+o,u=n+c,h=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${l},${u}`:(Math.abs(this._x1-l)>te||Math.abs(this._y1-u)>te)&&this._append`L${l},${u}`,r&&(f<0&&(f=f%Rn+Rn),f>Wo?this._append`A${r},${r},0,1,${h},${e-o},${n-c}A${r},${r},0,1,${h},${this._x1=l},${this._y1=u}`:f>te&&this._append`A${r},${r},0,${+(f>=En)},${h},${this._x1=e+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(e,n,r,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Ko(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Ge(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function oe(t){return t=Ge(Math.abs(t)),t?t[1]:NaN}function Jo(t,e){return function(n,r){for(var i=n.length,a=[],s=0,o=t[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),a.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=t[s=(s+1)%t.length];return a.reverse().join(e)}}function Go(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Zo=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ze(t){if(!(e=Zo.exec(t)))throw new Error("invalid format: "+t);var e;return new Mn({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ze.prototype=Mn.prototype;function Mn(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Mn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function qo(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Lr;function Qo(t,e){var n=Ge(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Lr=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ge(t,Math.max(0,e+a-1))[0]}function Pr(t,e){var n=Ge(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Dr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ko,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Pr(t*100,e),r:Pr,s:Qo,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Hr(t){return t}var Ir=Array.prototype.map,Or=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function tl(t){var e=t.grouping===void 0||t.thousands===void 0?Hr:Jo(Ir.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?Hr:Go(Ir.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function l(h){h=Ze(h);var f=h.fill,d=h.align,y=h.sign,v=h.symbol,D=h.zero,A=h.width,H=h.comma,S=h.precision,I=h.trim,M=h.type;M==="n"?(H=!0,M="g"):Dr[M]||(S===void 0&&(S=12),I=!0,M="g"),(D||f==="0"&&d==="=")&&(D=!0,f="0",d="=");var V=v==="$"?n:v==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",B=v==="$"?r:/[%p]/.test(M)?s:"",F=Dr[M],j=/[defgprs%]/.test(M);S=S===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function G(x){var b=V,m=B,T,at,C;if(M==="c")m=F(x)+m,x="";else{x=+x;var k=x<0||1/x<0;if(x=isNaN(x)?c:F(Math.abs(x),S),I&&(x=qo(x)),k&&+x==0&&y!=="+"&&(k=!1),b=(k?y==="("?y:o:y==="-"||y==="("?"":y)+b,m=(M==="s"?Or[8+Lr/3]:"")+m+(k&&y==="("?")":""),j){for(T=-1,at=x.length;++T<at;)if(C=x.charCodeAt(T),48>C||C>57){m=(C===46?i+x.slice(T+1):x.slice(T))+m,x=x.slice(0,T);break}}}H&&!D&&(x=e(x,1/0));var $=b.length+x.length+m.length,z=$<A?new Array(A-$+1).join(f):"";switch(H&&D&&(x=e(z+x,z.length?A-m.length:1/0),z=""),d){case"<":x=b+x+m+z;break;case"=":x=b+z+x+m;break;case"^":x=z.slice(0,$=z.length>>1)+b+x+m+z.slice($);break;default:x=z+b+x+m;break}return a(x)}return G.toString=function(){return h+""},G}function u(h,f){var d=l((h=Ze(h),h.type="f",h)),y=Math.max(-8,Math.min(8,Math.floor(oe(f)/3)))*3,v=Math.pow(10,-y),D=Or[8+y/3];return function(A){return d(v*A)+D}}return{format:l,formatPrefix:u}}var qe,ee,zr;el({thousands:",",grouping:[3],currency:["$",""]});function el(t){return qe=tl(t),ee=qe.format,zr=qe.formatPrefix,qe}function nl(t){return Math.max(0,-oe(Math.abs(t)))}function rl(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(oe(e)/3)))*3-oe(Math.abs(t)))}function il(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,oe(e)-oe(t))+1}function Cn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const jr=Symbol("implicit");function Fr(){var t=new Fn,e=[],n=[],r=jr;function i(a){let s=t.get(a);if(s===void 0){if(r!==jr)return r;t.set(a,s=e.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new Fn;for(const s of a)t.has(s)||t.set(s,e.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Fr(e,n).unknown(r)},Cn.apply(i,arguments),i}function le(){var t=Fr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,s,o=!1,c=0,l=0,u=.5;delete t.unknown;function h(){var f=e().length,d=i<r,y=d?i:r,v=d?r:i;a=(v-y)/Math.max(1,f-c+l*2),o&&(a=Math.floor(a)),y+=(v-y-a*(f-c))*u,s=a*(1-c),o&&(y=Math.round(y),s=Math.round(s));var D=pi(f).map(function(A){return y+a*A});return n(d?D.reverse():D)}return t.domain=function(f){return arguments.length?(e(f),h()):e()},t.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},t.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,o=!0,h()},t.bandwidth=function(){return s},t.step=function(){return a},t.round=function(f){return arguments.length?(o=!!f,h()):o},t.padding=function(f){return arguments.length?(c=Math.min(1,l=+f),h()):c},t.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),h()):c},t.paddingOuter=function(f){return arguments.length?(l=+f,h()):l},t.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),h()):u},t.copy=function(){return le(e(),[r,i]).round(o).paddingInner(c).paddingOuter(l).align(u)},Cn.apply(h(),arguments)}function al(t){return function(){return t}}function sl(t){return+t}var Yr=[0,1];function ce(t){return t}function Ln(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:al(isNaN(e)?NaN:.5)}function ol(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function ll(t,e,n){var r=t[0],i=t[1],a=e[0],s=e[1];return i<r?(r=Ln(i,r),a=n(s,a)):(r=Ln(r,i),a=n(a,s)),function(o){return a(r(o))}}function cl(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),s=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<r;)i[s]=Ln(t[s],t[s+1]),a[s]=n(e[s],e[s+1]);return function(o){var c=si(t,o,1,r)-1;return a[c](i[c](o))}}function ul(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function fl(){var t=Yr,e=Yr,n=Yt,r,i,a,s=ce,o,c,l;function u(){var f=Math.min(t.length,e.length);return s!==ce&&(s=ol(t[0],t[f-1])),o=f>2?cl:ll,c=l=null,h}function h(f){return f==null||isNaN(f=+f)?a:(c||(c=o(t.map(r),e,n)))(r(s(f)))}return h.invert=function(f){return s(i((l||(l=o(e,t.map(r),At)))(f)))},h.domain=function(f){return arguments.length?(t=Array.from(f,sl),u()):t.slice()},h.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},h.rangeRound=function(f){return e=Array.from(f),n=$s,u()},h.clamp=function(f){return arguments.length?(s=f?!0:ce,u()):s!==ce},h.interpolate=function(f){return arguments.length?(n=f,u()):n},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,d){return r=f,i=d,u()}}function hl(){return fl()(ce,ce)}function dl(t,e,n,r){var i=gi(t,e,n),a;switch(r=Ze(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=rl(i,s))&&(r.precision=a),zr(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=il(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=nl(i))&&(r.precision=a-(r.type==="%")*2);break}}return ee(r)}function gl(t){var e=t.domain;return t.ticks=function(n){var r=e();return di(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return dl(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,s=r[i],o=r[a],c,l,u=10;for(o<s&&(l=s,s=o,o=l,l=i,i=a,a=l);u-- >0;){if(l=cn(s,o,n),l===c)return r[i]=s,r[a]=o,e(r);if(l>0)s=Math.floor(s/l)*l,o=Math.ceil(o/l)*l;else if(l<0)s=Math.ceil(s*l)/l,o=Math.floor(o*l)/l;else break;c=l}return t},t}function ne(){var t=hl();return t.copy=function(){return ul(t,ne())},Cn.apply(t,arguments),gl(t)}function Se(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(r*6,++r*6);return n}const Br=Se("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Vr=Se("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Wr=Se("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Xr=Se("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Ur=Se("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function lt(t){return function(){return t}}const Kr=Math.abs,ft=Math.atan2,re=Math.cos,pl=Math.max,Pn=Math.min,Rt=Math.sin,ue=Math.sqrt,gt=1e-12,Ne=Math.PI,Qe=Ne/2,tn=2*Ne;function ml(t){return t>1?0:t<-1?Ne:Math.acos(t)}function Jr(t){return t>=1?Qe:t<=-1?-Qe:Math.asin(t)}function yl(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);e=r}return t},()=>new Uo(e)}function xl(t){return t.innerRadius}function vl(t){return t.outerRadius}function _l(t){return t.startAngle}function bl(t){return t.endAngle}function wl(t){return t&&t.padAngle}function kl(t,e,n,r,i,a,s,o){var c=n-t,l=r-e,u=s-i,h=o-a,f=h*c-u*l;if(!(f*f<gt))return f=(u*(e-a)-h*(t-i))/f,[t+f*c,e+f*l]}function en(t,e,n,r,i,a,s){var o=t-n,c=e-r,l=(s?a:-a)/ue(o*o+c*c),u=l*c,h=-l*o,f=t+u,d=e+h,y=n+u,v=r+h,D=(f+y)/2,A=(d+v)/2,H=y-f,S=v-d,I=H*H+S*S,M=i-a,V=f*v-y*d,B=(S<0?-1:1)*ue(pl(0,M*M*I-V*V)),F=(V*S-H*B)/I,j=(-V*H-S*B)/I,G=(V*S+H*B)/I,x=(-V*H+S*B)/I,b=F-D,m=j-A,T=G-D,at=x-A;return b*b+m*m>T*T+at*at&&(F=G,j=x),{cx:F,cy:j,x01:-u,y01:-h,x11:F*(i/M-1),y11:j*(i/M-1)}}function Gr(){var t=xl,e=vl,n=lt(0),r=null,i=_l,a=bl,s=wl,o=null,c=yl(l);function l(){var u,h,f=+t.apply(this,arguments),d=+e.apply(this,arguments),y=i.apply(this,arguments)-Qe,v=a.apply(this,arguments)-Qe,D=Kr(v-y),A=v>y;if(o||(o=u=c()),d<f&&(h=d,d=f,f=h),!(d>gt))o.moveTo(0,0);else if(D>tn-gt)o.moveTo(d*re(y),d*Rt(y)),o.arc(0,0,d,y,v,!A),f>gt&&(o.moveTo(f*re(v),f*Rt(v)),o.arc(0,0,f,v,y,A));else{var H=y,S=v,I=y,M=v,V=D,B=D,F=s.apply(this,arguments)/2,j=F>gt&&(r?+r.apply(this,arguments):ue(f*f+d*d)),G=Pn(Kr(d-f)/2,+n.apply(this,arguments)),x=G,b=G,m,T;if(j>gt){var at=Jr(j/f*Rt(F)),C=Jr(j/d*Rt(F));(V-=at*2)>gt?(at*=A?1:-1,I+=at,M-=at):(V=0,I=M=(y+v)/2),(B-=C*2)>gt?(C*=A?1:-1,H+=C,S-=C):(B=0,H=S=(y+v)/2)}var k=d*re(H),$=d*Rt(H),z=f*re(M),q=f*Rt(M);if(G>gt){var g=d*re(S),_=d*Rt(S),N=f*re(I),Y=f*Rt(I),Q;if(D<Ne)if(Q=kl(k,$,N,Y,g,_,z,q)){var st=k-Q[0],nt=$-Q[1],it=g-Q[0],ot=_-Q[1],ht=1/Rt(ml((st*it+nt*ot)/(ue(st*st+nt*nt)*ue(it*it+ot*ot)))/2),L=ue(Q[0]*Q[0]+Q[1]*Q[1]);x=Pn(G,(f-L)/(ht-1)),b=Pn(G,(d-L)/(ht+1))}else x=b=0}B>gt?b>gt?(m=en(N,Y,k,$,d,b,A),T=en(g,_,z,q,d,b,A),o.moveTo(m.cx+m.x01,m.cy+m.y01),b<G?o.arc(m.cx,m.cy,b,ft(m.y01,m.x01),ft(T.y01,T.x01),!A):(o.arc(m.cx,m.cy,b,ft(m.y01,m.x01),ft(m.y11,m.x11),!A),o.arc(0,0,d,ft(m.cy+m.y11,m.cx+m.x11),ft(T.cy+T.y11,T.cx+T.x11),!A),o.arc(T.cx,T.cy,b,ft(T.y11,T.x11),ft(T.y01,T.x01),!A))):(o.moveTo(k,$),o.arc(0,0,d,H,S,!A)):o.moveTo(k,$),!(f>gt)||!(V>gt)?o.lineTo(z,q):x>gt?(m=en(z,q,g,_,f,-x,A),T=en(k,$,N,Y,f,-x,A),o.lineTo(m.cx+m.x01,m.cy+m.y01),x<G?o.arc(m.cx,m.cy,x,ft(m.y01,m.x01),ft(T.y01,T.x01),!A):(o.arc(m.cx,m.cy,x,ft(m.y01,m.x01),ft(m.y11,m.x11),!A),o.arc(0,0,f,ft(m.cy+m.y11,m.cx+m.x11),ft(T.cy+T.y11,T.cx+T.x11),A),o.arc(T.cx,T.cy,x,ft(T.y11,T.x11),ft(T.y01,T.x01),!A))):o.arc(0,0,f,M,I,A)}if(o.closePath(),u)return o=null,u+""||null}return l.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Ne/2;return[re(h)*u,Rt(h)*u]},l.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:lt(+u),l):t},l.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:lt(+u),l):e},l.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:lt(+u),l):n},l.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:lt(+u),l):r},l.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:lt(+u),l):i},l.endAngle=function(u){return arguments.length?(a=typeof u=="function"?u:lt(+u),l):a},l.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:lt(+u),l):s},l.context=function(u){return arguments.length?(o=u??null,l):o},l}function Zr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Al(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Sl(t){return t}function Nl(){var t=Sl,e=Al,n=null,r=lt(0),i=lt(tn),a=lt(0);function s(o){var c,l=(o=Zr(o)).length,u,h,f=0,d=new Array(l),y=new Array(l),v=+r.apply(this,arguments),D=Math.min(tn,Math.max(-tn,i.apply(this,arguments)-v)),A,H=Math.min(Math.abs(D)/l,a.apply(this,arguments)),S=H*(D<0?-1:1),I;for(c=0;c<l;++c)(I=y[d[c]=c]=+t(o[c],c,o))>0&&(f+=I);for(e!=null?d.sort(function(M,V){return e(y[M],y[V])}):n!=null&&d.sort(function(M,V){return n(o[M],o[V])}),c=0,h=f?(D-l*S)/f:0;c<l;++c,v=A)u=d[c],I=y[u],A=v+(I>0?I*h:0)+S,y[u]={data:o[u],index:c,value:I,startAngle:v,endAngle:A,padAngle:H};return y}return s.value=function(o){return arguments.length?(t=typeof o=="function"?o:lt(+o),s):t},s.sortValues=function(o){return arguments.length?(e=o,n=null,s):e},s.sort=function(o){return arguments.length?(n=o,e=null,s):n},s.startAngle=function(o){return arguments.length?(r=typeof o=="function"?o:lt(+o),s):r},s.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:lt(+o),s):i},s.padAngle=function(o){return arguments.length?(a=typeof o=="function"?o:lt(+o),s):a},s}function Dn(t,e){if((s=t.length)>1)for(var n=1,r,i,a=t[e[0]],s,o=a.length;n<s;++n)for(i=a,a=t[e[n]],r=0;r<o;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Hn(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function $l(t,e){return t[e]}function Tl(t){const e=[];return e.key=t,e}function nn(){var t=lt([]),e=Hn,n=Dn,r=$l;function i(a){var s=Array.from(t.apply(this,arguments),Tl),o,c=s.length,l=-1,u;for(const h of a)for(o=0,++l;o<c;++o)(s[o][l]=[0,+r(h,s[o].key,l,a)]).data=h;for(o=0,u=Zr(e(s));o<c;++o)s[u[o]].index=o;return n(s,u),s}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:lt(Array.from(a)),i):t},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:lt(+a),i):r},i.order=function(a){return arguments.length?(e=a==null?Hn:typeof a=="function"?a:lt(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(n=a??Dn,i):n},i}function El(t,e){if((r=t.length)>0){for(var n,r,i=0,a=t[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=t[n][i][1]||0;if(s)for(n=0;n<r;++n)t[n][i][1]/=s}Dn(t,e)}}function $e(t,e,n){this.k=t,this.x=e,this.y=n}$e.prototype={constructor:$e,scale:function(t){return t===1?this:new $e(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new $e(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},$e.prototype;const Ht=(t,e)=>{const n=W.useRef(null);return W.useEffect(()=>{e!==void 0&&n.current&&t(vt(n.current))},e===null?void 0:e),n};function Te(){const t=W.useRef(null),[e,n]=W.useState({width:0,height:0});return W.useEffect(()=>{const r=t.current;if(!r||!r.parentElement)return;const i=r.parentElement,a=()=>{const o=i.getBoundingClientRect();n({width:o.width,height:o.height})};a();const s=new ResizeObserver(()=>a());return s.observe(i),()=>s.disconnect()},[]),[t,e]}function rn(){const[t,e]=W.useState(null);return W.useEffect(()=>{const n=typeof document<"u"?document.getElementById("UI-controls"):null;e(n)},[]),t}const _t=t=>{try{return JSON.parse(JSON.stringify(t))}catch{return console.log("error when cloning object : "),Array.isArray(t)?[]:null}},fe=["#34D399","#6ee7b7","#10b981","#059669","#bef264","#a3e635","#84cc16","#86efac","#4ade80","#16a34a","#5eead4","#2dd4bf","#14b8a6","#67e8f9","#22d3ee","#06b6d4","#7dd3fc","#38bdf8","#0ea5e9","#93c5fd","#60a5fa","#3b82f6","#a5b4fc","#818cf8","#6366f1","#a78bfa","#8b5cf6","#7c3aed","#d8b4fe","#c084fc","#a855f7","#f9a8d4","#f472b6","#ec4899","#fb7185","#f43f5e","#db2777","#fca5a5","#f87171","#ef4444","#fdba74","#fb923c","#f97316","#fcd34d","#fbbf24","#f59e0b","#fde047","#facc15","#eab308"];mi([...Wr,...Vr,...Xr,...Ur,...Br]);const qr=[...Wr,...Vr,...Xr,...Ur,...Br],bt=(t,e=!0)=>{const n=e?[...fe,...qr]:[...qr,...fe];return t<n.length?n[t]:n[t%n.length]},he=t=>t<fe.length?fe[t]:fe[t%fe.length],Bt=t=>ee(",")(t);function Rl(t,e,n){const{top:r}=e.getBoundingClientRect(),i=t.clientY-r;return{pixelY:i,dataY:n.invert(i)}}const Vt={tooltip:"_tooltip_4lu3m_3","tooltip--arrow-up":"_tooltip--arrow-up_4lu3m_73","tooltip--arrow-down":"_tooltip--arrow-down_4lu3m_101",title:"_title_4lu3m_167","text-small":"_text-small_4lu3m_213","right-label":"_right-label_4lu3m_225"},an=({pCount:t})=>R.jsxs("div",{id:"tooltip",className:`${Vt.tooltip}`,children:[!t&&R.jsx("p",{className:`${Vt["text-small"]}`}),t===3&&R.jsxs(R.Fragment,{children:[R.jsx("p",{className:`title ${Vt.title}`}),R.jsx("p",{className:`top-label ${Vt["right-label"]}`}),R.jsx("p",{className:`bottom-label ${Vt["right-label"]}`})]})]}),sn=(t,e="tooltip")=>t.select(`#${e}`).style("pointer-events","none").style("position","fixed").style("left","auto").style("top","auto").style("bottom","auto").style("right","auto").style("padding","8px 5px").style("max-width","200px").style("opacity",0);function on(t,e){const{e:n,svg:r,yScale:i}=e,{pixelY:a}=Rl(n,r,i),s=a<100?"bottom":"top",{offsetWidth:o,offsetHeight:c}=t.node()||{},l=typeof document<"u"?document.documentElement.clientWidth:0,u=n.x-o/2;let h=0;if(u<0)h=0;else if(u+o>l){const d=u+o-l;h=u-d}else h=u;const f=s==="top"?Vt["tooltip--arrow-down"]:Vt["tooltip--arrow-up"];t.attr("class",`${Vt.tooltip} ${f}`).style("left",h+"px").style("top",s==="top"?n.y-(c+20)+"px":n.y+30+"px")}const It="#d1d5db",tt={"controls-container":"_controls-container_18scr_1","fill-container":"_fill-container_18scr_25","controls-label":"_controls-label_18scr_41",disabled:"_disabled_18scr_67","controls-checkbox":"_controls-checkbox_18scr_75","chart-svg":"_chart-svg_18scr_89"},Qr={rotatedAxisText:"_rotatedAxisText_f02qn_1",axisText:"_axisText_f02qn_11"},Ee=t=>{const e=W.useRef([]);return W.useEffect(()=>{const n=e.current;if(t.length===0){e.current=[];return}const r=t.some(a=>n.includes(a)),i=t.filter(a=>!n.includes(a));if(!r){e.current=[...t];return}if(i.length>0){e.current=[...n,...i];return}},[t]),e};function Ml({data:t,color:{idx:e=0,type:n="fixed"}={idx:0,type:"fixed"},orientation:r="vertical"}){const[i,a]=Te(),{width:s,height:o}=a,[c,l]=W.useState(!1),u=Ee(t.map(D=>D.label)),h=rn(),f=R.jsx("div",{id:"controls",className:`${tt["controls-container"]} ${h?tt["fill-container"]:""}`,children:R.jsxs("label",{className:tt["controls-label"],children:[R.jsx("input",{type:"checkbox",className:tt["controls-checkbox"],checked:c,onChange:D=>l(D.target.checked)}),"Sort"]})}),d={idx:e,type:n},y=750,v=Ht(D=>{if(s===0||o===0)return;const A={top:20,right:30,bottom:r==="vertical"?50:30,left:r==="vertical"?25:50},H=c?_t(t).sort((C,k)=>k.value-C.value):_t(t),S=D.select("svg"),I=S.node(),M=S.select(".plot-area").attr("transform","translate("+A.left+","+A.top+")"),V=sn(D).style("opacity",0),F=s>1024?Qr.axisText:Qr.rotatedAxisText,j=s-A.left-A.right,G=o-A.top-A.bottom,x=le().domain(H.map(C=>C.label)).rangeRound(r==="vertical"?[0,j]:[G,0]).padding(.1),b=ne().domain([0,$t(H,C=>C.value)??0]).rangeRound(r==="vertical"?[G,0]:[0,j]),m=r==="vertical"?jt(x).tickValues(x.domain()).scale(x).tickSizeOuter(0):jt(b).ticks(null,"s");M.select(".x-axis").attr("transform",`translate(0, ${G})`).transition().duration(y).call(m).selectAll("text").attr("class",F),ne().domain([0,$t(H,C=>C.value)??0]).rangeRound([o-A.bottom,A.top]);const T=r==="vertical"?Ft(b).ticks(null,"s"):Ft(x).tickSizeOuter(0);M.select(".y-axis").attr("transform","translate(0, 0)").transition().duration(y).call(T);const at=C=>{const{idx:k,type:$}=d,z=u.current.findIndex(q=>q===C.label);return he($==="fixed"?k:k+z)};M.selectAll(".bar").data(H,C=>C.label).join(C=>C.append("rect").attr("class","bar").attr("x",function(k){return r==="vertical"?x(k.label)??0:b(0)}).attr("width",function(k){return r==="vertical"?x.bandwidth():0}).attr("y",function(k){return r==="vertical"?b(0):x(k.label)??0}).attr("height",function(){return r==="vertical"?0:x.bandwidth()}).attr("fill",at).transition().duration(y).attr("y",function(k){return r==="vertical"?b(k.value):x(k.label)??0}).attr("width",function(k){return r==="vertical"?x.bandwidth():b(k.value)}).attr("height",function(k){return r==="vertical"?b(0)-b(k.value):x.bandwidth()}),void 0,C=>C.transition().duration(y).attr("fill",It).attr("height",0).attr("y",o).style("opacity",0).remove()).on("mouseover",(C,k)=>{M.selectAll("rect.bar").filter($=>$.label===k.label).style("stroke","#71717a").style("stroke-width",1),V.style("opacity",1).select("p").text(k.label+` : ${ee(",")(k.value)}`),vt(".x-axis").selectAll("text").filter($=>$===k.label).style("font-weight","bold")}).on("mousemove",(C,k)=>{on(V,{e:C,svg:I,yScale:b})}).on("mouseout",(C,k)=>{M.selectAll("rect.bar").filter($=>$.label===k.label).style("stroke","none").style("stroke-width",0),V.style("opacity",0),vt(".x-axis").selectAll("text").filter($=>$===k.label).style("font-weight","normal")}).transition().duration(y).attr("fill",at).attr("x",function(C){return r==="vertical"?x(C.label)??0:b(0)}).attr("width",function(C){return r==="vertical"?x.bandwidth():b(C.value)}).attr("y",function(C){return r==="vertical"?b(C.value):x(C.label)??0}).attr("height",function(C){return r==="vertical"?b(0)-b(C.value):x.bandwidth()})},[t,d,s,o,c,r]);return R.jsxs("div",{ref:i,style:{width:s,height:o,display:"flex",flexDirection:"column"},children:[h&&Me.createPortal(f,h),R.jsxs("div",{ref:v,className:`${tt["fill-container"]}`,style:{display:"flex",flexDirection:"column",position:"relative"},children:[R.jsx("svg",{className:`${tt["chart-svg"]} ${tt["fill-container"]}`,style:{},viewBox:`0 0 ${s} ${o}`,children:R.jsxs("g",{className:"plot-area",children:[R.jsx("g",{className:"y-axis"}),R.jsx("g",{className:"x-axis"})]})}),!h&&R.jsxs("label",{className:tt["controls-label"],style:{position:"absolute",right:"12px",top:"6px"},children:[R.jsx("input",{type:"checkbox",className:tt["controls-checkbox"],checked:c,onChange:D=>l(D.target.checked)}),"Sort"]}),R.jsx(an,{})]})]})}function ln(){const t=W.useRef(null),[e,n]=W.useState({width:0,height:0});return W.useEffect(()=>{const r=t.current;if(!r)return;const i=new ResizeObserver(([a])=>{a?.contentRect&&n({width:a.contentRect.width,height:a.contentRect.height})});return i.observe(r,{box:"border-box"}),n({width:r.offsetWidth,height:r.offsetHeight}),()=>{i.disconnect()}},[]),[t,e]}const Mt={legend:"_legend_7ftsg_1","legend-active":"_legend-active_7ftsg_1","legend-rect":"_legend-rect_7ftsg_21","legend-label":"_legend-label_7ftsg_35",pieSlice:"_pieSlice_7ftsg_77",pieSliceNotHovered:"_pieSliceNotHovered_7ftsg_87",animateNotHovered:"_animateNotHovered_7ftsg_1",pieSliceExit:"_pieSliceExit_7ftsg_111",animateHide:"_animateHide_7ftsg_1",pieLabelEnter:"_pieLabelEnter_7ftsg_129",showText:"_showText_7ftsg_1",pieLabelUnhover:"_pieLabelUnhover_7ftsg_153",pieLabelUpdate:"_pieLabelUpdate_7ftsg_183",pieLabelExit:"_pieLabelExit_7ftsg_197"};function Cl({data:t,innerRadius:e=0,sortWithLegends:n=!1,colorIdx:r=0}){const[i,a]=Te(),{width:s,height:o}=a,[c,l]=ln(),{width:u,height:h}=l,f=Ee(t.map(B=>B.label)),[d,y]=W.useState([]),[v,D]=W.useState(!1),[A,H]=W.useState(""),S=750,I=Ht(B=>{const j=(n&&v?_t(t).sort((x,b)=>x.value-b.value):t).map(x=>x.label);B.selectAll(".legend-item").data([...j],x=>x).join(x=>{const b=x.append("div").attr("class",function(m){return`${Mt[m===A?"legend-active":"legend"]} legend-item`}).style("left","-10px").style("top",function(m,T){return`${T*20+10}px`}).style("opacity",0);return b.append("div").attr("class",`rect ${Mt["legend-rect"]}`).style("background-color",m=>he(f.current.findIndex(T=>T===m)+r)),b.append("span").attr("class",Mt["legend-label"]).style("color",m=>"#333").text(m=>m),b.transition().duration(S).style("left","6px").style("opacity",1),b},x=>(x.attr("class",b=>`
|
|
23
|
+
${Mt[b===A?"legend-active":"legend"]} legend-item`).transition().duration(S).style("top",function(b,m){return`${m*20+10}px`}).style("left","6px").style("opacity",1).select("div.rect").attr("class",`rect ${Mt["legend-rect"]}`).style("background-color",b=>he(f.current.findIndex(m=>m===b)+r)),x.select("span").style("color",b=>"#333").text(b=>b),x),x=>x.transition().duration(S).style("opacity",0).style("left","30px").remove()).on("mouseover",(x,b)=>{H(b)}).on("mouseout",()=>{H("")})},[t,r,u,h,A,v,n]),M=Ht(B=>{if(u===0||h===0)return;const F={x:u/2,y:h/2},j={top:10,right:20,bottom:10,left:20},G=t,x=u-(j.left+j.right),b=h-(j.top+j.bottom),m=Math.min(x,b)/2,T=G.reduce((L,rt)=>L+rt.value,0),at=B.select(".plot-area").attr("transform","translate("+F.x+","+F.y+")"),C=Nl().value(function(L){return L.value}).sort(function(L,rt){return v?pe(L.value,rt.value):0}),k=_t(G),$=C(k),z=_t(k);y(C(z));let q=z.length>k.length;const g=d.map(L=>L.data.label),_=$.map(L=>L.data.label);g.every(L=>q?!1:_.includes(L)?!0:(q=!0,!1));const N=d.length===0,Q=Gr().innerRadius(e*m).outerRadius(m-12),st=Gr().innerRadius(e*m).outerRadius(m),nt=(L,rt)=>{const J=Yt(rt==="exit"?L.endAngle:L.startAngle,rt==="exit"?L.startAngle:L.endAngle),Z=L.data.label===A;return function(ct){return L.endAngle=J(ct),Z?st(L)||"":Q(L)||""}};at.selectAll("path").data($,function(L){return L.data.label}).join(L=>{const rt=L.append("path").attr("class",Mt.pieSlice).attr("fill",function(J){const Z=f.current.findIndex(ct=>ct===J.data.label)+r;return he(Z)});return rt.transition().duration(S).delay(N?0:S).attr("d",Q).attrTween("d",function(J){if(!N)return nt(J,"not exit");const Z=Yt(0,J.startAngle),ct=Yt(0,J.endAngle),Ct=J.data.label===A;return function(Ot){return J.startAngle=Z(Ot),J.endAngle=ct(Ot),Ct?st(J):Q(J)}}),rt},L=>{const rt=L;return L.transition().duration(S).attr("fill",function(J,Z){const ct=f.current.findIndex(Ct=>Ct===J.data.label)+r;return he(ct)}).attrTween("d",function(J){const Z=d.find(wt=>wt.data.label===J.data.label),ct=Z&&Z.startAngle?Z.startAngle:0,Ct=Yt(ct,J.startAngle),Ot=Z&&Z.endAngle?Z.endAngle:0,Wt=Yt(Ot,J.endAngle),Xt=J.data.label===A;return function(wt){return J.startAngle=Ct(wt),J.endAngle=Wt(wt),Xt?st(J)||"":Q(J)||""}}),rt},L=>L.attr("class",Mt.pieSliceExit).transition().duration(S).attr("fill",It).attrTween("d",function(rt){return nt(rt,"exit")}).remove()).on("mouseover",function(L,rt){H(rt.data.label)}).on("mouseout",()=>{H("")});const ot=L=>G.length===1?"translate(0, 0)":`translate(${Q.centroid(L)})`,ht=L=>{const rt=L.value/T;return ee(".1%")(rt)};at.selectAll("text").data($,function(L){return L.data.label}).join(L=>{const rt=L.append("text").text(ht).attr("class",Mt.pieLabelEnter);return rt.merge(rt).transition().duration(S).delay(S).attr("transform",ot),rt},L=>{const rt=L.text(ht);return L.merge(rt).attr("class",Mt.pieLabelUpdate).transition().duration(A!==""?250:S).style("opacity",function(J){const Z=A===J.data.label;return A===""||Z?1:0}).attr("transform",ot),rt},L=>L.transition().duration(S/2).attr("class",Mt.pieLabelExit).remove())},[t,r,e,u,h,v,A]),V=s>o;return R.jsxs("div",{ref:i,style:{width:s,height:o,position:"relative",display:"flex",flexDirection:V?"row":"column",overflow:"hidden"},children:[R.jsx("div",{ref:c,style:{flex:1,position:"relative",display:"flex"},children:R.jsx("svg",{ref:M,className:`${tt["chart-svg"]} ${tt["fill-container"]}`,viewBox:`0 0 ${u} ${h}`,children:R.jsx("g",{className:"plot-area"})})}),R.jsx("div",{style:{width:V?s>480?"180px":"100px":"100%",height:V?"100%":o>400?"180px":"100px",flexShrink:0,overflowY:"auto",background:"rgba(255, 255, 255)",borderLeft:V?"1px solid #ddd":"none",borderTop:V?"none":"1px solid #ddd",padding:"0px"},children:R.jsx("div",{ref:I,className:"legends-content",style:{display:"flex",flexDirection:"column",gap:"6px",padding:"8px 8px 16px 8px",boxSizing:"border-box",position:"relative"}})}),R.jsxs("label",{className:tt["controls-label"],style:{position:"absolute",left:"12px",top:"6px"},children:[R.jsx("input",{type:"checkbox",className:tt["controls-checkbox"],checked:v,onChange:B=>D(B.target.checked)}),"Sort"]})]})}const K={"legends-container":"_legends-container_brzcg_1","legend-container":"_legend-container_brzcg_61","legend-container-active":"_legend-container-active_brzcg_61","legend-container-inactive":"_legend-container-inactive_brzcg_61","legend-rect":"_legend-rect_brzcg_105","legend-label":"_legend-label_brzcg_121",rect:"_rect_brzcg_201",rectCard:"_rectCard_brzcg_201",rectLegendNotHovered:"_rectLegendNotHovered_brzcg_221",legend:"_legend_brzcg_1",rectHoveredLegend:"_rectHoveredLegend_brzcg_257",rectCardLegendHovered:"_rectCardLegendHovered_brzcg_267",rectLegendHovered:"_rectLegendHovered_brzcg_279",rotatedAxisText:"_rotatedAxisText_brzcg_301",axisText:"_axisText_brzcg_311",hoveredAxisText:"_hoveredAxisText_brzcg_321",yAxisLabel:"_yAxisLabel_brzcg_335"};function Ll({data:t,focusOnPlot:e=!1,colorIdx:n=0,orientation:r="vertical"}){const[i,a]=Te(),{width:s,height:o}=a,[c,l]=ln(),{height:u}=l,[h,f]=W.useState(null),[d,y]=W.useState(!1),[v,D]=W.useState(["all"]),[A,H]=W.useState(!1),[S,I]=W.useState(""),[M,V]=W.useState(!1),B=rn(),F=t;W.useEffect(()=>{D(["all"]),y(!0)},[F]),W.useEffect(()=>{D(["all"])},[e]);const j=750;W.useEffect(()=>{let $;return d&&($=setTimeout(()=>{y(!1)},j+500)),()=>{clearTimeout($)}},[d]);const G=B?o:o-u,x=[s,G,v,n,e],b=_t(F),m=b.length===0?[]:Object.keys(b[0]).filter($=>$!=="label"&&$!=="total"),T=Ee(m),at=Ht($=>{if(d)return;const z=80;$.selectAll(".legend-item").data([...m],g=>g).join(g=>{const _=g.append("div").attr("class",function(N){return`
|
|
24
|
+
${v.includes(N)?K[e?"legend-container-active":"legend-container-inactive"]:K["legend-container"]}
|
|
25
|
+
legend-item
|
|
26
|
+
`}).style("left",(N,Y)=>`${Y*z}px`).style("top","-53px").style("opacity",0);return _.append("div").attr("class",K["legend-rect"]).style("background",N=>{if(!e&&v.includes(N))return It;const Y=T.current.findIndex(Q=>Q===N)+n;return bt(Y)}),_.append("span").attr("class",K["legend-label"]).style("color",N=>!e&&v.includes(N)?"#d1d5db":"#333").text(N=>N),_.transition().duration(j).style("top","0px").style("opacity",1),_},g=>(g.attr("class",_=>`
|
|
27
|
+
${v.includes(_)?K[e?"legend-container-active":"legend-container-inactive"]:K["legend-container"]}
|
|
28
|
+
legend-item`).transition().duration(j).style("top","0px").style("left",(_,N)=>`${N*z}px`).style("opacity",1).select(`.${K["legend-rect"]}`).style("background",_=>{if(!e&&v.includes(_))return It;const N=T.current.findIndex(Y=>Y===_)+n;return bt(N)}),g.select(`.${K["legend-label"]}`).style("color",_=>!e&&v.includes(_)?It:"#333").text(_=>_),g),g=>g.style("color",It).transition().duration(j).style("opacity",0).style("top","53px").remove()).on("mouseover",function(g,_){d||I(_)}).on("mouseout",function(g,_){d||(I(""),A&&H(!1))}).on("click",(g,_)=>{D(N=>{let Y=[];return e?N[0]===_?Y=["all"]:Y=[_]:N.includes(_)?Y=N.filter(Q=>Q!==_):Y=[...N,_],Y}),H(!0)})},[...x,m,d]),C=R.jsxs("div",{ref:c,className:`${tt["controls-container"]} ${B?tt["fill-container"]:""}`,children:[R.jsxs("label",{className:tt["controls-label"],style:{paddingRight:"12px"},children:[R.jsx("input",{type:"checkbox",className:tt["controls-checkbox"],checked:M,onChange:$=>V($.target.checked)}),"Sort"]}),R.jsx("div",{ref:at,id:"stacked-barchart-legends",className:`${K["legends-container"]}`})]}),k=Ht($=>{if(s===0||G===0||S!==""&&d)return;const z={top:20,right:30,bottom:30,left:40},q=s>1024,g=e?m:m.filter(p=>!v.includes(p));b.forEach(p=>{const O=g.reduce((P,ut)=>{const pt=p[ut];return P+(typeof pt=="number"?pt:0)},0);p.total=O});const _=b,N=M?_t(_).sort(function(p,O){return e?v[0]==="all"?p.total-O.total:Number(p[v[0]])-Number(O[v[0]]):p.total-O.total}):_,Y=s-z.left-z.right,Q=G-z.top-z.bottom,st=$.select("svg"),nt=st.node(),it=st.select(".plot-area").attr("transform","translate("+z.left+","+z.top+")"),ot=sn($).style("opacity",0);let ht=!1;h===null&&(ht=!0,f(_t(b)));const L=N.map(function(p){return p.label}),rt=le().domain(L).rangeRound(r==="vertical"?[0,Y]:[Q,0]).paddingInner(.1).align(.2),J=e?v[0]==="all"?$t(b,p=>p.total):$t(b,p=>p[v[0]]):$t(b,p=>p.total),Z=ne().domain([0,J??0]).range(r==="vertical"?[Q,0]:[0,Y]),ct=q?K.axisText:K.rotatedAxisText,Ct=[],Ot=r==="vertical"?jt(rt).tickValues(rt.domain()).tickSizeOuter(0):jt(Z).tickValues(Z.domain()).ticks(null,"s").tickSizeOuter(0);it.select(".x-axis").attr("transform",`translate(0,${Q})`).transition().duration(j).call(Ot).selectAll("text").style("cursor","pointer").attr("dy",q?"1em":".20em").attr("dx",q?"0em":"-.8em").attr("class",ct);const Wt=r==="vertical"?Ft(Z).ticks(null,"s"):Ft(rt).tickSizeOuter(0);it.select(".y-axis").transition().duration(ht?0:j).call(Wt);const wt=nn().keys(g)(N).map(p=>{const O=p.key,P=p.map(ut=>{const pt=ut.data.label;return{...ut,key:`${O} - ${pt}`,barKey:O}});return P.key=O,P}),Ut=it.selectAll(".serie").data(wt,p=>p.key).join(p=>p.append("g").attr("class","serie").attr("fill",P=>{const ut=T.current.findIndex(Re=>Re===P.key)+n;return bt(ut)}).style("opacity",P=>{if(S!=="")if(e){if(v[0]==="all")return P.key===S||A?1:.25}else return A?1:P.key===S?.25:1;return e?v[0]==="all"||P.key===v[0]?1:0:1}).style("pointer-events",P=>e?v[0]==="all"||P.key===v[0]?"auto":"none":"auto"),p=>p.transition().duration(j).attr("fill",P=>{const ut=T.current.findIndex(Re=>Re===P.key)+n;return bt(ut)}).style("opacity",P=>{if(S!=="")if(e){if(v[0]==="all")return P.key===S||A?1:.25}else return A?1:P.key===S?.25:1;return e?v[0]==="all"||P.key===v[0]?1:0:1}).style("pointer-events",P=>e?v[0]==="all"||P.key===v[0]?"auto":"none":"auto"),p=>p.transition().duration(j).attr("fill",It).style("opacity",0).selectAll("rect").attr("y",Q).attr("height",0).remove()),Kt=p=>rt(p.data.label+"")??0,Jt=rt.bandwidth(),zt=p=>{const O=r==="vertical"?Q:Y;return ht?0:v[0]==="all"?Z(r==="vertical"?p[1]:p[0]):e&&r!=="vertical"?Z(0):O-(Z(p[0])-Z(p[1]))},Lt=p=>{const O=r==="vertical"?Z(p[0])-Z(p[1]):Z(p[1])-Z(p[0]);return isNaN(O)||O<0?0:O},Nt=p=>r==="vertical"?Kt(p):zt(p),yt=p=>r==="vertical"?Jt:Lt(p),E=p=>r==="vertical"?zt(p):Kt(p),X=p=>r==="vertical"?Lt(p):Jt,et=p=>{if(p.barKey===S)return"none";const O=yt(p),P=X(p);return g.indexOf(p.barKey)===g.length-1||p.barKey===v[0]?r==="vertical"?`${O+P} ${O} ${P}`:`${O+P+O}`:r==="vertical"?`${P} ${O}`:`${O} ${P}`},w=p=>{const O=yt(p),P=g.indexOf(p.barKey)===g.length-1||p.barKey===v[0];return r==="vertical"?P?0:O*-1:0},U=p=>S!==""&&S===p.barKey&&e?`rect ${K.rectLegendHovered}`:`rect ${K.rect}`;Ut.selectAll("rect").data(p=>p,p=>p.data.label).join(p=>p.append("rect").attr("class",`rect ${tt.rect}`).attr("x",function(P){return r==="vertical"?Nt(P):Z(0)}).attr("width",function(P){return r==="vertical"?yt(P):0}).attr("y",P=>{if(r==="vertical"){if(!Ct.includes(P.data.label))return Q;const ut=v[0]==="all"?Z(P[1]):P.key.startsWith(v[0])?Q-(Z(P[0])-Z(P[1])):Z(P[1]),pt=Z(P[0])-Z(P[1]),Re=isNaN(pt)||pt<0?0:pt,Hl=ut+Re;return ht?Q-(z.bottom+z.top):Hl}else return E(P)}).attr("height",function(P){return r==="vertical"?0:X(P)}).attr("stroke-dasharray",et).attr("stroke-dashoffset",w).transition().duration(j).attr("x",Nt).attr("width",yt).attr("height",X).attr("y",E),void 0,p=>p.transition().duration(j).attr("opacity",0).attr("y",Q).attr("height",0).remove()).attr("class",U).attr("stroke-dasharray",et).attr("stroke-dashoffset",w).transition().duration(j).attr("x",Nt).attr("width",yt).attr("height",X).attr("y",E).on("start",function(){}).on("end",function(){}),Ut.selectAll("rect").on("mouseover",function(p,O){vt(r==="vertical"?".x-axis":".y-axis").selectAll("text").filter(pt=>pt===O.data.label).attr("class",(r==="vertical"?ct:"")+" "+K.hoveredAxisText),ot.style("opacity",1).select("p.title").text(O.data.label);const P=O.data[O.barKey],{total:ut}=O.data;ot.select("p.top-label").text(O.barKey+" : "+Bt(P)),ot.select("p.bottom-label").text(v[0]==="all"?`Total : ${Bt(ut)}`:"~")}).on("touch",function(p,O){vt(r==="vertical"?".x-axis":".y-axis").selectAll("text").filter(P=>P===O.data.label)}).on("mousemove",(p,O)=>{on(ot,{e:p,svg:nt,yScale:Z})}).on("mouseout",function(p,O){vt(r==="vertical"?".x-axis":".y-axis").selectAll("text").filter(P=>P===O.data.label).attr("class",r==="vertical"?ct:""),ot.style("opacity",0)})},[...x,M,b,m,S,A,d,r]);return R.jsxs("div",{ref:i,style:{width:`${s}px`,height:`${o}px`,display:"flex",flexDirection:"column"},children:[B?Me.createPortal(C,B):C,R.jsxs("div",{ref:k,className:`${tt["fill-container"]}`,style:{display:"flex",flexDirection:"column"},children:[R.jsx("svg",{className:`${tt["chart-svg"]} ${tt["fill-container"]}`,viewBox:`0 0 ${s} ${G}`,children:R.jsxs("g",{className:"plot-area",children:[R.jsx("g",{className:"plot-rects"}),R.jsx("g",{className:"y-axis"}),R.jsx("g",{className:"x-axis"})]})}),R.jsx(an,{pCount:3})]})]})}function Pl({data:t,colorIdx:e=0,orientation:n="vertical"}){const[r,i]=Te(),{width:a,height:s}=i,[o,c]=ln(),{height:l}=c,[u,h]=W.useState(null),[f,d]=W.useState(!1),[y,v]=W.useState("all"),[D,A]=W.useState(!1),[H,S]=W.useState(""),[I,M]=W.useState(!1),V=rn(),B=t;W.useEffect(()=>{v("all"),d(!0),M(!1)},[B]);const F=750;W.useEffect(()=>{let k;return f&&(k=setTimeout(()=>{d(!1)},F+500)),()=>{clearTimeout(k)}},[f]);const j=V?s:s-l,G=[a,j,y,e],x=_t(B),b=x.length===0?[]:Object.keys(x[0]).filter(k=>k!=="label"&&k!=="total"),m=Ee(b),T=Ht(k=>{if(f)return;const $=80;k.selectAll(".legend-item").data([...b],q=>q).join(q=>{const g=q.append("div").attr("class",function(_){return`
|
|
29
|
+
${y===_?K["legend-container-active"]:K["legend-container"]}
|
|
30
|
+
legend-item`}).style("left",(_,N)=>`${N*$}px`).style("top","-53px").style("opacity",0);return g.append("div").attr("class",K["legend-rect"]).style("background",_=>{const N=m.current.findIndex(Y=>Y===_)+e;return bt(N)}),g.append("span").attr("class",K["legend-label"]).text(_=>_),g.transition().duration(F).style("top","0px").style("opacity",1),g},q=>(q.attr("class",g=>`
|
|
31
|
+
${y===g?K["legend-container-active"]:K["legend-container"]}
|
|
32
|
+
legend-item`).transition().duration(F).style("top","0px").style("left",(g,_)=>`${_*$}px`).style("opacity",1).select(`.${K["legend-rect"]}`).style("background",g=>{const _=m.current.findIndex(N=>N===g)+e;return bt(_)}),q.select(`.${K["legend-label"]}`).text(g=>g),q),q=>q.transition().duration(F).style("opacity",0).style("top","53px").remove().remove()).on("click",(q,g)=>{v(_=>_===g?(M(!1),"all"):g)}).on("mouseover",(q,g)=>{S(g)}).on("mouseout",(q,g)=>{S("")})},[...G,b,f]),at=R.jsxs("div",{ref:o,className:`${tt["controls-container"]} ${V?tt["fill-container"]:""}`,children:[R.jsxs("label",{className:tt["controls-label"],style:{paddingRight:"12px"},children:[R.jsx("input",{type:"checkbox",className:`${tt["controls-checkbox"]} ${y==="all"?tt.disabled:""}`,checked:I,onChange:k=>M(k.target.checked),disabled:y==="all"}),"Sort"]}),R.jsx("div",{ref:T,id:"stacked-barchart-legends",className:`${K["legends-container"]}`})]}),C=Ht(k=>{if(a===0||j===0||H!==""&&f)return;const $={top:20,right:30,bottom:30,left:40},z=a>1024;x.forEach(function(E){E.total=b.reduce((X,et)=>{const w=E[et];return X+(typeof w=="number"?w:Number(w))},0)});const q=x,g=I?_t(q).sort(function(E,X){return Number(E[y])-Number(X[y])}):q,_=a-$.left-$.right,N=j-$.top-$.bottom,Y=k.select("svg"),Q=Y.node(),st=Y.select(".plot-area").attr("transform","translate("+$.left+","+$.top+")"),nt=sn(k).style("opacity",0);let it=!1;u===null&&(it=!0,h(_t(x)));const ot=z?K.axisText:K.rotatedAxisText,ht=g.map(function(E){return E.label}),L=le().domain(ht).rangeRound(n==="vertical"?[0,_]:[N,0]).paddingInner(.1).align(.2),rt=y==="all"?$t(x,E=>$t(Object.entries(E).filter(([X])=>X!=="total"&&X!=="label").map(([,X])=>X))):$t(x,E=>E[y]),J=ne().domain([0,rt??0]).range(n==="vertical"?[N,0]:[0,_]),Z=n==="vertical"?jt(L).tickValues(L.domain()).tickSizeOuter(0):jt(J).tickValues(J.domain()).ticks(null,"s").tickSizeOuter(0);st.select(".x-axis").attr("transform",`translate(0,${N})`).transition().duration(F).call(Z).selectAll("text").style("cursor","pointer").attr("dy",z?"1em":".20em").attr("dx",z?"0em":"-.8em").attr("class",ot);const ct=n==="vertical"?Ft(J).ticks(null,"s"):Ft(L).tickSizeOuter(0);st.select(".y-axis").attr("transform","translate(0,0)").transition().duration(F).call(ct);const Ot=nn().keys(b)(g).map(E=>{const X=E.key,et=E.map(w=>({...w,key:`${X} - ${w.data.label}`,barKey:X}));return et.key=X,et}),Wt=E=>H!==""?`rect
|
|
33
|
+
${H===E.barKey?K.rectLegendHovered:K.rectLegendNotHovered}`:`rect ${K.rect}`;let Xt=st.selectAll(".serie").data(Ot,function(E){return E.key}).join(E=>E.append("g").attr("class","serie").attr("fill",function(et){const w=m.current.findIndex(U=>U===et.key)+e;return bt(w)}).style("opacity",et=>y==="all"||et.key===y?1:0).style("pointer-events",et=>y==="all"||et.key===y?"auto":"none"),E=>E.transition().duration(F).attr("fill",function(et){const w=m.current.findIndex(U=>U===et.key)+e;return bt(w)}).style("opacity",et=>y==="all"||et.key===y?1:0).style("pointer-events",et=>y==="all"||et.key===y?"auto":"none"),E=>E.transition().duration(F).style("opacity",0).attr("fill","grey").selectAll("rect").attr("y",N).attr("height",0).remove());const wt=E=>{const X=L(E.data.label+"")??0;if(y==="all"){const et=b.indexOf(E.barKey)||0;return X+et*(L.bandwidth()/b.length)}return X},Ut=()=>y==="all"?L.bandwidth()/b.length:L.bandwidth(),Kt=E=>n==="vertical"?N-(J(E[0])-J(E[1])):J(0),Jt=E=>{const X=n==="vertical"?J(E[0])-J(E[1]):J(E[1])-J(E[0]);return isNaN(X)||X<0?0:X},zt=E=>n==="vertical"?wt(E):Kt(E),Lt=E=>n==="vertical"?Ut():Jt(E),Nt=E=>n==="vertical"?Kt(E):wt(E),yt=E=>n==="vertical"?Jt(E):Ut();Xt.selectAll("rect").data(E=>E,E=>E.data.label).join(E=>{let X;return X=E.append("rect").attr("class",Wt).attr("x",function(et){return n==="vertical"?zt(et):0}).attr("width",function(et){return n==="vertical"?y==="all"?L.bandwidth()/b.length:L.bandwidth():0}).attr("y",function(et){return n==="vertical"?it?N-($.bottom+$.top):N:Nt(et)}).attr("height",function(et){return n==="vertical"?0:y==="all"?L.bandwidth()/b.length:L.bandwidth()}).transition().duration(F).attr("x",zt).attr("width",Lt).attr("height",yt).attr("y",Nt),X},void 0,E=>E.attr("fill",It).transition().duration(F).attr("opacity",0).attr("height",0).attr("y",N+$.bottom).remove()).attr("class",Wt).transition().duration(F).attr("x",zt).attr("width",Lt).attr("height",yt).attr("y",Nt),Xt.selectAll("rect").on("mouseover",function(E,X){vt(n==="vertical"?".x-axis":".y-axis").selectAll("text").filter(p=>p===X.data.label).attr("class",(n==="vertical"?ot:"")+" "+K.hoveredAxisText),nt.style("opacity",1).select("p.title").text(X.data.label);const et=X.data[X.barKey],{total:w}=X.data,U=et/w*100;ee(".1f")(U)+"",nt.select("p.top-label").text(X.barKey+" : "+Bt(et)),nt.select("p.bottom-label").text(y==="all"?`Total : ${Bt(w)}`:"~")}).on("touch",function(E,X){vt(".x-axis").selectAll("text").filter(et=>et===X.data.label).attr("class",ot)}).on("mousemove",(E,X)=>{on(nt,{e:E,svg:Q,yScale:J})}).on("mouseout",function(E,X){vt(n==="vertical"?".x-axis":".y-axis").selectAll("text").filter(et=>et===X.data.label).attr("class",n==="vertical"?ot:""),nt.style("opacity",0)})},[...G,I,x,b,H,D,n,f]);return R.jsxs("div",{ref:r,style:{width:a,height:s,display:"flex",flexDirection:"column"},children:[V?Me.createPortal(at,V):at,R.jsxs("div",{ref:C,className:`${tt["fill-container"]}`,style:{display:"flex",flexDirection:"column"},children:[R.jsx("svg",{className:`${tt["chart-svg"]} ${tt["fill-container"]}`,viewBox:`0 0 ${a} ${j}`,children:R.jsxs("g",{className:"plot-area",children:[R.jsx("g",{className:"plot-rects"}),R.jsx("g",{className:"y-axis"}),R.jsx("g",{className:"x-axis"})]})}),R.jsx(an,{pCount:3})]})]})}function Dl({data:t,colorIdx:e=0,orientation:n="vertical"}){const[r,i]=Te(),{width:a,height:s}=i,[o,c]=W.useState(""),[l,u]=W.useState(!0),[h,f]=W.useState(!1),[d,y]=ln(),{height:v}=y,[D,A]=W.useState("all"),H=rn(),S=t;W.useEffect(()=>{A("all"),u(!0),f(!0)},[S]);const I=750;W.useEffect(()=>{let m;return h&&(m=setTimeout(()=>{f(!1)},I+500)),()=>{clearTimeout(m)}},[h]);const M=H?s:s-v,V=[a,M,D,e],B=_t(S),F=B.length===0?[]:Object.keys(B[0]).filter(m=>m!=="label"&&m!=="total"),j=Ee(F),G=Ht(m=>{if(h)return;const T=80;m.selectAll(".legend-item").data([...F],C=>C).join(C=>{const k=C.append("div").attr("class",function($){return`
|
|
34
|
+
${D===$?K["legend-container-active"]:K["legend-container"]}
|
|
35
|
+
legend-item`}).style("left",($,z)=>`${z*T}px`).style("top","-53px").style("opacity",0);return k.append("div").attr("class",K["legend-rect"]).style("background",$=>{const z=j.current.findIndex(q=>q===$)+e;return bt(z)}),k.append("span").attr("class",K["legend-label"]).text($=>$),k.transition().duration(I).style("top","0px").style("opacity",1),k},C=>(C.attr("class",k=>`
|
|
36
|
+
${D===k?K["legend-container-active"]:K["legend-container"]}
|
|
37
|
+
legend-item`).transition().duration(I).style("top","0px").style("left",(k,$)=>`${$*T}px`).style("opacity",1).select(`.${K["legend-rect"]}`).style("background",k=>{const $=j.current.findIndex(z=>z===k)+e;return bt($)}),C.select(`.${K["legend-label"]}`).text(k=>k),C),C=>C.transition().duration(I).style("opacity",0).style("top","53px").remove().remove().remove()).on("mouseover",(C,k)=>{c(k)}).on("mouseout",function(C){c("")})},[...V,F,h]),x=R.jsxs("div",{ref:d,className:`${tt["controls-container"]} ${H?tt["fill-container"]:""}`,children:[R.jsxs("label",{className:tt["controls-label"],style:{paddingRight:"12px"},children:[R.jsx("input",{type:"checkbox",className:tt["controls-checkbox"],checked:l,onChange:m=>u(m.target.checked)}),"Percentage"]}),R.jsx("div",{ref:G,id:"stacked-barchart-legends",className:`${K["legends-container"]}`})]}),b=Ht(m=>{if(a===0||M===0||o!==""&&h)return;const T={top:20,right:30,bottom:30,left:40},at=a>1024;B.forEach(function(w){w.total=F.reduce((U,p)=>{const O=w[p];return U+(typeof O=="number"?O:Number(O))},0)});const k=B.filter(w=>w?.total&&w.total>0),$=a-T.left-T.right,z=M-T.top-T.bottom,q=m.select("svg"),g=q.node(),_=q.select(".plot-area").attr("transform","translate("+T.left+","+T.top+")"),N=sn(m).style("opacity",0),Y=at?K.axisText:K.rotatedAxisText,Q=k.map(function(w){return w.label}),st=le().domain(Q).rangeRound(n==="vertical"?[0,$]:[z,0]).paddingInner(.1).align(.2),nt=$t(B,w=>w.total),it=ne().domain([0,l?1:nt||0]).nice().range(n==="vertical"?[z,0]:[0,$]),ot=le().rangeRound([0,$]).paddingInner(.1).align(.2),ht=k.map(function(w){return w.label});ot.domain(ht);const L=[],rt=n==="vertical"?jt(st).tickValues(st.domain()).tickSizeOuter(0):jt(it).tickValues(it.domain()).ticks(null,l?".0%":"s").tickSizeOuter(0);_.select(".x-axis").attr("transform",`translate(0,${z})`).transition().duration(I).call(rt).selectAll("text").style("cursor","pointer").attr("dy",at?"1em":".20em").attr("dx",at?"0em":"-.8em").attr("class",Y);const J=$t(B,w=>w.total),Z=ne().domain([0,l?1:J||0]).nice().range([z,0]),ct=n==="vertical"?Ft(it).ticks(null,l?".0%":"s"):Ft(st).tickSizeOuter(0);_.select(".y-axis").attr("transform","translate(0,0)").transition().duration(I).call(ct);const Ct=nn().order(Hn).offset(El),Wt=(l?Ct.keys(F)(k):nn().keys(F)(k)).map(w=>{const U=w.key,p=w.map(O=>{const P=O.data.label;return{...O,key:`${U} - ${P}`,barKey:U}});return p.key=U,p});let Xt=_.selectAll(".serie").data(Wt,function(w){return w.key}).join(w=>w.append("g").attr("class","serie").attr("fill",function(p){const O=j.current.findIndex(P=>P===p.key)+e;return bt(O)}).style("opacity",1).style("pointer-events","auto"),w=>w.transition().duration(I).attr("fill",function(p){const O=j.current.findIndex(P=>P===p.key)+e;return bt(O)}).style("opacity",1).style("pointer-events","auto"),w=>w.transition().duration(I).style("opacity",0).attr("fill",It).selectAll("rect").attr("y",z).attr("height",0).remove());const wt=w=>st(w.data.label+"")??0,Ut=st.bandwidth(),Kt=w=>it(n==="vertical"?w[1]:w[0]),Jt=w=>{const U=n==="vertical"?it(w[0])-it(w[1]):it(w[1])-it(w[0]);return isNaN(U)||U<0?0:U},zt=w=>n==="vertical"?wt(w):Kt(w),Lt=w=>n==="vertical"?Ut:Jt(w),Nt=w=>n==="vertical"?Kt(w):wt(w),yt=w=>n==="vertical"?Jt(w):Ut;function E(w){if(w.barKey===o)return"none";const U=Lt(w),p=yt(w);return F.indexOf(w.barKey)===F.length-1||w.barKey===D[0]?n==="vertical"?`${U+p} ${U} ${p}`:`${U+p+U}`:n==="vertical"?`${p} ${U}`:`${U} ${p}`}function X(w){const U=Lt(w),p=F.indexOf(w.barKey)===F.length-1;return n==="vertical"?p?0:U*-1:0}const et=w=>o!==""&&o===w.barKey?`rect ${K.rectLegendHovered}`:`rect ${K.rect}`;Xt.selectAll("rect").data(w=>w,w=>w.data.label).join(w=>{let U;return U=w.append("rect").attr("class",et).attr("x",function(p){return n==="vertical"?ot(p.data.label+"")??0:it(0)}).attr("width",function(p){return n==="vertical"?st.bandwidth():0}).attr("y",function(p){if(n==="vertical"){if(!L.includes(p.data.label+""))return z-T.bottom;const O=it(p[1]),P=it(p[0])-it(p[1]),ut=isNaN(P)||P<0?0:P;return O+ut}else return Nt(p)}).attr("height",function(p){return n==="vertical"?0:yt(p)}).attr("stroke-dasharray",E).attr("stroke-dashoffset",X).transition().duration(I).attr("x",zt).attr("width",Lt).attr("height",yt).attr("y",Nt),U},void 0,w=>w.transition().duration(I).attr("opacity",0).attr("height",0).attr("y",z).remove()).attr("class",et).attr("stroke-dasharray",E).attr("stroke-dashoffset",X).transition().duration(I).attr("x",zt).attr("width",Lt).attr("height",yt).attr("y",Nt),Xt.selectAll("rect").on("mouseover",function(w,U){vt(".x-axis").selectAll("text").filter(pt=>pt===U.data.name).attr("class",Y+" "+tt.hoveredAxisText),N.style("opacity",1).select("p.title").text(U.data.label);const p=U.data[U.barKey]||0,O=U.data.total||0,P=p/O*100,ut=ee(".1f")(P)+"%";N.select("p.top-label").text(U.barKey+" : "+(l?ut:Bt(p))),N.select("p.bottom-label").text(l?`(${Bt(p)} of ${Bt(O)})`:`Total : ${Bt(O)}`)}).on("touch",function(w,U){vt(".x-axis").selectAll("text").filter(p=>p===U.data.label).attr("class",Y)}).on("mousemove",(w,U)=>{on(N,{e:w,svg:g,yScale:Z})}).on("mouseout",function(w,U){vt(".x-axis").selectAll("text").filter(p=>p===U.data.name).attr("class",Y),N.style("opacity",0)})},[...V,B,F,l,o,n,h]);return R.jsxs("div",{ref:r,style:{width:a,height:s,display:"flex",flexDirection:"column"},children:[H?Me.createPortal(x,H):x,R.jsxs("div",{ref:b,className:`${tt["fill-container"]}`,style:{display:"flex",flexDirection:"column"},children:[R.jsx("svg",{className:`${tt["chart-svg"]} ${tt["fill-container"]}`,viewBox:`0 0 ${a} ${M}`,children:R.jsxs("g",{className:"plot-area",children:[R.jsx("g",{className:"plot-rects"}),R.jsx("g",{className:"y-axis"}),R.jsx("g",{className:"x-axis"})]})}),R.jsx(an,{pCount:3})]})]})}xt.BarChart=Ml,xt.GroupedBarChart=Pl,xt.PercentageBarChart=Dl,xt.PieChart=Cl,xt.StackedBarChart=Ll,Object.defineProperty(xt,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { pointData } from '../types';
|
|
3
|
+
type BarchartProps = {
|
|
4
|
+
data: pointData[];
|
|
5
|
+
color?: {
|
|
6
|
+
idx?: number;
|
|
7
|
+
type?: 'fixed' | 'colorful';
|
|
8
|
+
};
|
|
9
|
+
orientation?: 'horizontal' | 'vertical';
|
|
10
|
+
};
|
|
11
|
+
export declare function BarChart({ data, color: { idx, // default idx
|
|
12
|
+
type, }, orientation }: BarchartProps): React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { pointData } from '../types';
|
|
3
|
+
type PiechartProps = {
|
|
4
|
+
data: pointData[];
|
|
5
|
+
innerRadius?: number;
|
|
6
|
+
sortWithLegends?: boolean;
|
|
7
|
+
colorIdx?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function PieChart({ data, innerRadius, sortWithLegends, colorIdx }: PiechartProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StackedBarChartProps } from './types';
|
|
3
|
+
type StackedBarChartPropsExtended = StackedBarChartProps & {
|
|
4
|
+
focusOnPlot?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function StackedBarChart({ data, focusOnPlot, colorIdx, orientation }: StackedBarChartPropsExtended): React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface LayeredData {
|
|
2
|
+
label: string;
|
|
3
|
+
total?: number;
|
|
4
|
+
[subject: string]: number | string | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface SortedLayer {
|
|
7
|
+
label: string;
|
|
8
|
+
value: number | string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export type ExtendedSeriesPoint = d3.SeriesPoint<LayeredData> & {
|
|
11
|
+
key: string;
|
|
12
|
+
barKey: string;
|
|
13
|
+
};
|
|
14
|
+
export type ExtendedSeries = ExtendedSeriesPoint[] & {
|
|
15
|
+
key: string;
|
|
16
|
+
};
|
|
17
|
+
export interface StackedBarChartProps {
|
|
18
|
+
data: LayeredData[];
|
|
19
|
+
colorIdx?: number;
|
|
20
|
+
orientation?: 'vertical' | 'horizontal';
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import * as d3 from 'd3';
|
|
3
|
+
type ITooltip = {
|
|
4
|
+
pCount?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const Tooltip: FunctionComponent<ITooltip>;
|
|
7
|
+
export declare const SankeyTooltip: FunctionComponent;
|
|
8
|
+
export declare const getTooltip: (svg: d3.Selection<(SVGAElement | HTMLDivElement), any, any, any>, id?: string) => d3.Selection<d3.BaseType, any, any, any>;
|
|
9
|
+
type PositioningProps = {
|
|
10
|
+
e: MouseEvent;
|
|
11
|
+
svg: SVGSVGElement;
|
|
12
|
+
yScale: d3.ScaleLinear<number, number>;
|
|
13
|
+
};
|
|
14
|
+
export declare function moveTooltip(tooltip: any, positionProps: PositioningProps): void;
|
|
15
|
+
export declare function hideTooltip(tooltip: any): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export declare const inactiveColor = "#d1d5db";
|
|
2
|
+
export declare const englishFreq: {
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
}[];
|
|
6
|
+
export declare const germanFreq: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: number;
|
|
9
|
+
}[];
|
|
10
|
+
export declare const sampleData: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: number;
|
|
13
|
+
}[];
|
|
14
|
+
export declare const categoryDataV1: {
|
|
15
|
+
label: string;
|
|
16
|
+
value: number;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const categoryDataV2: {
|
|
19
|
+
label: string;
|
|
20
|
+
value: number;
|
|
21
|
+
}[];
|
|
22
|
+
export declare const categoryDataV3: {
|
|
23
|
+
label: string;
|
|
24
|
+
value: number;
|
|
25
|
+
}[];
|
|
26
|
+
export declare const year1: {
|
|
27
|
+
label: string;
|
|
28
|
+
"Mandatory Math": number;
|
|
29
|
+
"Interest Math": number;
|
|
30
|
+
English: number;
|
|
31
|
+
"Bahasa Indonesia": number;
|
|
32
|
+
Physics: number;
|
|
33
|
+
Chemistry: number;
|
|
34
|
+
Biology: number;
|
|
35
|
+
Economy: number;
|
|
36
|
+
Geography: number;
|
|
37
|
+
"Social Science": number;
|
|
38
|
+
"Country History": number;
|
|
39
|
+
"World History": number;
|
|
40
|
+
}[];
|
|
41
|
+
export declare const year2: {
|
|
42
|
+
label: string;
|
|
43
|
+
"Interest Math": number;
|
|
44
|
+
"Bahasa Indonesia": number;
|
|
45
|
+
Physics: number;
|
|
46
|
+
Chemistry: number;
|
|
47
|
+
Biology: number;
|
|
48
|
+
"Quantum Physics": number;
|
|
49
|
+
}[];
|
|
50
|
+
export declare const stackedData: {
|
|
51
|
+
label: string;
|
|
52
|
+
coal: number;
|
|
53
|
+
gas: number;
|
|
54
|
+
solar: number;
|
|
55
|
+
}[];
|
|
56
|
+
export declare const stackedDataVar1: {
|
|
57
|
+
label: string;
|
|
58
|
+
coal: number;
|
|
59
|
+
gas: number;
|
|
60
|
+
solar: number;
|
|
61
|
+
wind: number;
|
|
62
|
+
}[];
|
|
63
|
+
export declare const stackedDataVar2: {
|
|
64
|
+
label: string;
|
|
65
|
+
coal: number;
|
|
66
|
+
gas: number;
|
|
67
|
+
solar: number;
|
|
68
|
+
hydro: number;
|
|
69
|
+
}[];
|
|
70
|
+
export declare const stackData1: {
|
|
71
|
+
label: string;
|
|
72
|
+
alpha: number;
|
|
73
|
+
beta: number;
|
|
74
|
+
gamma: number;
|
|
75
|
+
delta: number;
|
|
76
|
+
epsilon: number;
|
|
77
|
+
zeta: number;
|
|
78
|
+
}[];
|
|
79
|
+
export declare const stackData2: {
|
|
80
|
+
label: string;
|
|
81
|
+
alpha: number;
|
|
82
|
+
beta: number;
|
|
83
|
+
delta: number;
|
|
84
|
+
epsilon: number;
|
|
85
|
+
theta: number;
|
|
86
|
+
}[];
|
|
87
|
+
export declare const stackData3: {
|
|
88
|
+
label: string;
|
|
89
|
+
alpha: number;
|
|
90
|
+
beta: number;
|
|
91
|
+
delta: number;
|
|
92
|
+
epsilon: number;
|
|
93
|
+
iota: number;
|
|
94
|
+
kappa: number;
|
|
95
|
+
lambda: number;
|
|
96
|
+
}[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import * as d3 from "d3";
|
|
3
|
+
export declare const useD3: <T extends HTMLElement | SVGSVGElement>(renderChartFn: (selection: d3.Selection<T, unknown, null, undefined>) => void, dependencies: React.DependencyList | null) => React.RefObject<T | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLayerIndex: (next: string[]) => import('react').RefObject<string[]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface Size {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Custom hook that observes and returns the dimensions of the element's parent.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* const [ref, size] = useParentSize<HTMLDivElement>();
|
|
10
|
+
* return <div ref={ref}>Parent is {size.width} x {size.height}</div>;
|
|
11
|
+
*/
|
|
12
|
+
export declare function useParentSize<T extends HTMLElement>(): readonly [import('react').RefObject<T | null>, Size];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useUIControls(): HTMLElement | null;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BarChart } from './charts/barchart';
|
|
2
|
+
export { PieChart } from './charts/piechart';
|
|
3
|
+
export { StackedBarChart } from './charts/stacked-barchart-variants/stacked-barchart';
|
|
4
|
+
export { GroupedBarChart } from './charts/stacked-barchart-variants/grouped-barchart';
|
|
5
|
+
export { PercentageBarChart } from './charts/stacked-barchart-variants/percentage-barchart';
|
package/dist/types.d.ts
ADDED
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const cloneObj: (arr: any) => any;
|
|
2
|
+
export declare const indexColor: (i: number, assortedColorFirst?: boolean) => string;
|
|
3
|
+
export declare const indexSelectedColor: (i: number) => string;
|
|
4
|
+
export declare const basicFormat: (num: number) => string;
|
|
5
|
+
export declare function getMouseYInData(e: MouseEvent, svg: SVGSVGElement, yScale: d3.ScaleLinear<number, number>): {
|
|
6
|
+
pixelY: number;
|
|
7
|
+
dataY: number;
|
|
8
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "chartformers",
|
|
3
|
+
"version": "1.0.36",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "Petrando Richard",
|
|
6
|
+
"main": "dist/chartformers.umd.js",
|
|
7
|
+
"module": "dist/chartformers.es.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"react",
|
|
14
|
+
"react-chart",
|
|
15
|
+
"react-charts",
|
|
16
|
+
"react-component",
|
|
17
|
+
"chart",
|
|
18
|
+
"charts",
|
|
19
|
+
"chart-library",
|
|
20
|
+
"d3",
|
|
21
|
+
"d3js",
|
|
22
|
+
"d3-react",
|
|
23
|
+
"d3-chart",
|
|
24
|
+
"svg",
|
|
25
|
+
"visualization",
|
|
26
|
+
"data-visualization",
|
|
27
|
+
"data-viz",
|
|
28
|
+
"dataviz",
|
|
29
|
+
"interactive-chart",
|
|
30
|
+
"responsive-chart",
|
|
31
|
+
"animated-chart",
|
|
32
|
+
"transition",
|
|
33
|
+
"general-update-pattern",
|
|
34
|
+
"sortable-chart",
|
|
35
|
+
"sortable-pie",
|
|
36
|
+
"animated-pie-chart"
|
|
37
|
+
],
|
|
38
|
+
"license": "ISC",
|
|
39
|
+
"type": "module",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/d3": "^7.4.3",
|
|
45
|
+
"@types/node": "^24.10.0",
|
|
46
|
+
"@types/react": "^19.2.2",
|
|
47
|
+
"@types/react-dom": "^19.2.2",
|
|
48
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
49
|
+
"d3": "^7.9.0",
|
|
50
|
+
"d3-selection": "^3.0.0",
|
|
51
|
+
"react": "^19.2.0",
|
|
52
|
+
"react-dom": "^19.2.0",
|
|
53
|
+
"tsconfig-paths": "^4.2.0",
|
|
54
|
+
"typescript": "^5.9.3",
|
|
55
|
+
"vite": "^7.1.12",
|
|
56
|
+
"vite-plugin-dts": "^4.5.4"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"d3": "^7.9.0",
|
|
60
|
+
"d3-selection": "^3.0.0",
|
|
61
|
+
"react": "^19.2.0",
|
|
62
|
+
"react-dom": "^19.2.0"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
69
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
70
|
+
"build": "vite build --config vite.config.ts"
|
|
71
|
+
}
|
|
72
|
+
}
|