@orbcharts/core 3.0.0-alpha.37 → 3.0.0-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orbcharts-core.es.js +6 -5
- package/dist/orbcharts-core.umd.js +1 -1
- package/dist/src/grid/gridObservables.d.ts +1 -1
- package/dist/src/types/ContextObserverGrid.d.ts +1 -1
- package/dist/src/types/Event.d.ts +28 -44
- package/package.json +1 -1
- package/src/grid/createGridContextObserver.ts +3 -3
- package/src/grid/gridObservables.ts +1 -1
- package/src/multiGrid/multiGridObservables.ts +3 -3
- package/src/types/ContextObserverGrid.ts +1 -1
- package/src/types/ContextObserverMultiGrid.ts +1 -1
- package/src/types/Event.ts +84 -53
- package/src/utils/d3Utils.ts +0 -1
- package/src/utils/observables.ts +6 -4
|
@@ -4084,10 +4084,10 @@ const ye = ({ datumList$: t, fullChartParams$: e, event$: n }) => {
|
|
|
4084
4084
|
return h == null ? [] : c.find((d) => d.id === h) ? [h] : [];
|
|
4085
4085
|
}
|
|
4086
4086
|
function l(c, h) {
|
|
4087
|
-
return h == null ? c.filter((d) => d.seriesLabel === h).map((d) => d.id)
|
|
4087
|
+
return h == null ? [] : c.filter((d) => d.seriesLabel === h).map((d) => d.id);
|
|
4088
4088
|
}
|
|
4089
4089
|
function u(c, h) {
|
|
4090
|
-
return h == null ? c.filter((d) => d.groupLabel === h).map((d) => d.id)
|
|
4090
|
+
return h == null ? [] : c.filter((d) => d.groupLabel === h).map((d) => d.id);
|
|
4091
4091
|
}
|
|
4092
4092
|
function f(c, h) {
|
|
4093
4093
|
return h == null ? [] : c.filter((d) => d.categoryLabel === h).map((d) => d.id);
|
|
@@ -4100,8 +4100,9 @@ const ye = ({ datumList$: t, fullChartParams$: e, event$: n }) => {
|
|
|
4100
4100
|
I(r),
|
|
4101
4101
|
R(async (h) => h)
|
|
4102
4102
|
).subscribe((h) => {
|
|
4103
|
+
console.log("data.fullChartParams.highlightTarget", h.fullChartParams.highlightTarget);
|
|
4103
4104
|
let d = [];
|
|
4104
|
-
h.fullChartParams.highlightTarget === "datum" ? d = s(h.datumList, h.target.id) : h.fullChartParams.highlightTarget === "series" ? d = l(h.datumList, h.target.seriesLabel) : h.fullChartParams.highlightTarget === "group" ? d = u(h.datumList, h.target.groupLabel) : h.fullChartParams.highlightTarget === "category" && (d = f(h.datumList, h.target.categoryLabel)), c.next(d);
|
|
4105
|
+
h.fullChartParams.highlightTarget === "datum" ? d = s(h.datumList, h.target.id) : h.fullChartParams.highlightTarget === "series" ? d = l(h.datumList, h.target.seriesLabel) : h.fullChartParams.highlightTarget === "group" ? d = u(h.datumList, h.target.groupLabel) : h.fullChartParams.highlightTarget === "category" && (d = f(h.datumList, h.target.categoryLabel)), console.log("ids", d), c.next(d);
|
|
4105
4106
|
}), function() {
|
|
4106
4107
|
r.next(void 0);
|
|
4107
4108
|
}));
|
|
@@ -4728,7 +4729,7 @@ const Rl = (t) => {
|
|
|
4728
4729
|
gridGraphicReverseScale$: s,
|
|
4729
4730
|
gridAxesSize$: l,
|
|
4730
4731
|
gridHighlight$: f,
|
|
4731
|
-
|
|
4732
|
+
existSeriesLabels$: c,
|
|
4732
4733
|
SeriesDataMap$: h,
|
|
4733
4734
|
GroupDataMap$: d,
|
|
4734
4735
|
visibleComputedData$: p
|
|
@@ -4890,7 +4891,7 @@ const zl = ({ data: t = [], dataFormatter: e, chartParams: n, layout: r }) => {
|
|
|
4890
4891
|
gridGraphicReverseScale$: y,
|
|
4891
4892
|
gridAxesSize$: $,
|
|
4892
4893
|
gridHighlight$: D,
|
|
4893
|
-
|
|
4894
|
+
existSeriesLabels$: v,
|
|
4894
4895
|
SeriesDataMap$: C,
|
|
4895
4896
|
GroupDataMap$: w,
|
|
4896
4897
|
visibleComputedData$: A
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function(_,Pt){typeof exports=="object"&&typeof module<"u"?Pt(exports):typeof define=="function"&&define.amd?define(["exports"],Pt):(_=typeof globalThis<"u"?globalThis:_||self,Pt(_["orbcharts-core"]={}))})(this,function(_){"use strict";const Pt={preset:{}},cn={top:60,right:60,bottom:60,left:60},fn={padding:cn,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#1b1e23",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:14,unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},pi=800,mi=500,j={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},gi={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},yi={type:"series",visibleFilter:(t,e,n,r)=>!0,seriesLabels:[],sort:null},hn={visibleFilter:(t,e,n,r)=>!0,gridData:{seriesDirection:"row",rowLabels:[],columnLabels:[]},valueAxis:{...j},groupAxis:{...gi},slotIndex:0,seriesSlotIndexes:null},vi={type:"grid",grid:{...hn},container:{gap:120,rowAmount:1,columnAmount:1}},Wt={...hn},bi={type:"multiGrid",gridList:[{...Wt}],container:{gap:120,rowAmount:1,columnAmount:1}},wi={type:"multiValue",visibleFilter:(t,e,n,r)=>!0,multiValue:[],xAxis:{...j},yAxis:{...j}},xi={type:"tree",visibleFilter:(t,e,n,r)=>!0,categoryLabels:[]},_i={type:"relationship",visibleFilter:(t,e,n,r)=>!0};function Bt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function $i(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function dn(t){let e,n,r;t.length!==2?(e=Bt,n=(u,l)=>Bt(t(u),l),r=(u,l)=>t(u)-l):(e=t===Bt||t===$i?t:Di,n=t,r=t);function i(u,l,s=0,f=u.length){if(s<f){if(e(l,l)!==0)return f;do{const c=s+f>>>1;n(u[c],l)<0?s=c+1:f=c}while(s<f)}return s}function a(u,l,s=0,f=u.length){if(s<f){if(e(l,l)!==0)return f;do{const c=s+f>>>1;n(u[c],l)<=0?s=c+1:f=c}while(s<f)}return s}function o(u,l,s=0,f=u.length){const c=i(u,l,s,f-1);return c>s&&r(u[c-1],l)>-r(u[c],l)?c-1:c}return{left:i,center:o,right:a}}function Di(){return 0}function Si(t){return t===null?NaN:+t}const pn=dn(Bt).right;dn(Si).center;class mn 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(gn(this,e))}has(e){return super.has(gn(this,e))}set(e,n){return super.set(Ai(this,e),n)}delete(e){return super.delete(Mi(this,e))}}function gn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ai({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Mi({_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 Pi=Math.sqrt(50),Ei=Math.sqrt(10),Fi=Math.sqrt(2);function qt(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Pi?10:a>=Ei?5:a>=Fi?2:1;let u,l,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(t*s),l=Math.round(e*s),u/s<t&&++u,l/s>e&&--l,s=-s):(s=Math.pow(10,i)*o,u=Math.round(t/s),l=Math.round(e/s),u*s<t&&++u,l*s>e&&--l),l<u&&.5<=n&&n<2?qt(t,e,n*2):[u,l,s]}function Ti(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?qt(e,t,n):qt(t,e,n);if(!(a>=i))return[];const u=a-i+1,l=new Array(u);if(r)if(o<0)for(let s=0;s<u;++s)l[s]=(a-s)/-o;else for(let s=0;s<u;++s)l[s]=(a-s)*o;else if(o<0)for(let s=0;s<u;++s)l[s]=(i+s)/-o;else for(let s=0;s<u;++s)l[s]=(i+s)*o;return l}function $e(t,e,n){return e=+e,t=+t,n=+n,qt(t,e,n)[2]}function Li(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?$e(e,t,n):$e(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Ii(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}var Oi={value:()=>{}};function yn(){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 jt(n)}function jt(t){this._=t}function Ni(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}})}jt.prototype=yn.prototype={constructor:jt,on:function(t,e){var n=this._,r=Ni(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=ki(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=vn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=vn(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 jt(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 ki(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function vn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Oi,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var De="http://www.w3.org/1999/xhtml";const bn={svg:"http://www.w3.org/2000/svg",xhtml:De,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Jt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),bn.hasOwnProperty(e)?{space:bn[e],local:t}:t}function Ri(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===De&&e.documentElement.namespaceURI===De?e.createElement(t):e.createElementNS(n,t)}}function Gi(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function wn(t){var e=Jt(t);return(e.local?Gi:Ri)(e)}function Vi(){}function Se(t){return t==null?Vi:function(){return this.querySelector(t)}}function zi(t){typeof t!="function"&&(t=Se(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),l,s,f=0;f<o;++f)(l=a[f])&&(s=t.call(l,l.__data__,f,a))&&("__data__"in l&&(s.__data__=l.__data__),u[f]=s);return new R(r,this._parents)}function Ui(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Hi(){return[]}function xn(t){return t==null?Hi:function(){return this.querySelectorAll(t)}}function Yi(t){return function(){return Ui(t.apply(this,arguments))}}function Xi(t){typeof t=="function"?t=Yi(t):t=xn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,l,s=0;s<u;++s)(l=o[s])&&(r.push(t.call(l,l.__data__,s,o)),i.push(l));return new R(r,i)}function _n(t){return function(){return this.matches(t)}}function $n(t){return function(e){return e.matches(t)}}var Wi=Array.prototype.find;function Bi(t){return function(){return Wi.call(this.children,t)}}function qi(){return this.firstElementChild}function ji(t){return this.select(t==null?qi:Bi(typeof t=="function"?t:$n(t)))}var Ji=Array.prototype.filter;function Ki(){return Array.from(this.children)}function Zi(t){return function(){return Ji.call(this.children,t)}}function Qi(t){return this.selectAll(t==null?Ki:Zi(typeof t=="function"?t:$n(t)))}function ta(t){typeof t!="function"&&(t=_n(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new R(r,this._parents)}function Dn(t){return new Array(t.length)}function ea(){return new R(this._enter||this._groups.map(Dn),this._parents)}function Kt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Kt.prototype={constructor:Kt,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 na(t){return function(){return t}}function ra(t,e,n,r,i,a){for(var o=0,u,l=e.length,s=a.length;o<s;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new Kt(t,a[o]);for(;o<l;++o)(u=e[o])&&(i[o]=u)}function ia(t,e,n,r,i,a,o){var u,l,s=new Map,f=e.length,c=a.length,h=new Array(f),d;for(u=0;u<f;++u)(l=e[u])&&(h[u]=d=o.call(l,l.__data__,u,e)+"",s.has(d)?i[u]=l:s.set(d,l));for(u=0;u<c;++u)d=o.call(t,a[u],u,a)+"",(l=s.get(d))?(r[u]=l,l.__data__=a[u],s.delete(d)):n[u]=new Kt(t,a[u]);for(u=0;u<f;++u)(l=e[u])&&s.get(h[u])===l&&(i[u]=l)}function aa(t){return t.__data__}function oa(t,e){if(!arguments.length)return Array.from(this,aa);var n=e?ia:ra,r=this._parents,i=this._groups;typeof t!="function"&&(t=na(t));for(var a=i.length,o=new Array(a),u=new Array(a),l=new Array(a),s=0;s<a;++s){var f=r[s],c=i[s],h=c.length,d=ua(t.call(f,f&&f.__data__,s,r)),p=d.length,m=u[s]=new Array(p),g=o[s]=new Array(p),y=l[s]=new Array(h);n(f,c,m,g,y,d,e);for(var D=0,x=0,S,v;D<p;++D)if(S=m[D]){for(D>=x&&(x=D+1);!(v=g[x])&&++x<p;);S._next=v||null}}return o=new R(o,r),o._enter=u,o._exit=l,o}function ua(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function sa(){return new R(this._exit||this._groups.map(Dn),this._parents)}function la(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 ca(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),l=0;l<o;++l)for(var s=n[l],f=r[l],c=s.length,h=u[l]=new Array(c),d,p=0;p<c;++p)(d=s[p]||f[p])&&(h[p]=d);for(;l<i;++l)u[l]=n[l];return new R(u,this._parents)}function fa(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function ha(t){t||(t=da);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,l=i[a]=new Array(u),s,f=0;f<u;++f)(s=o[f])&&(l[f]=s);l.sort(e)}return new R(i,this._parents).order()}function da(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function pa(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ma(){return Array.from(this)}function ga(){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 o=r[i];if(o)return o}return null}function ya(){let t=0;for(const e of this)++t;return t}function va(){return!this.node()}function ba(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,u;a<o;++a)(u=i[a])&&t.call(u,u.__data__,a,i);return this}function wa(t){return function(){this.removeAttribute(t)}}function xa(t){return function(){this.removeAttributeNS(t.space,t.local)}}function _a(t,e){return function(){this.setAttribute(t,e)}}function $a(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 Sa(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 Aa(t,e){var n=Jt(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?xa:wa:typeof e=="function"?n.local?Sa:Da:n.local?$a:_a)(n,e))}function Sn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Ma(t){return function(){this.style.removeProperty(t)}}function Ca(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Pa(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ea(t,e,n){return arguments.length>1?this.each((e==null?Ma:typeof e=="function"?Pa:Ca)(t,e,n??"")):pt(this.node(),t)}function pt(t,e){return t.style.getPropertyValue(e)||Sn(t).getComputedStyle(t,null).getPropertyValue(e)}function Fa(t){return function(){delete this[t]}}function Ta(t,e){return function(){this[t]=e}}function La(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ia(t,e){return arguments.length>1?this.each((e==null?Fa:typeof e=="function"?La:Ta)(t,e)):this.node()[t]}function An(t){return t.trim().split(/^|\s+/)}function Ae(t){return t.classList||new Mn(t)}function Mn(t){this._node=t,this._names=An(t.getAttribute("class")||"")}Mn.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 Cn(t,e){for(var n=Ae(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Pn(t,e){for(var n=Ae(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Oa(t){return function(){Cn(this,t)}}function Na(t){return function(){Pn(this,t)}}function ka(t,e){return function(){(e.apply(this,arguments)?Cn:Pn)(this,t)}}function Ra(t,e){var n=An(t+"");if(arguments.length<2){for(var r=Ae(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?ka:e?Oa:Na)(n,e))}function Ga(){this.textContent=""}function Va(t){return function(){this.textContent=t}}function za(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ua(t){return arguments.length?this.each(t==null?Ga:(typeof t=="function"?za:Va)(t)):this.node().textContent}function Ha(){this.innerHTML=""}function Ya(t){return function(){this.innerHTML=t}}function Xa(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Wa(t){return arguments.length?this.each(t==null?Ha:(typeof t=="function"?Xa:Ya)(t)):this.node().innerHTML}function Ba(){this.nextSibling&&this.parentNode.appendChild(this)}function qa(){return this.each(Ba)}function ja(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ja(){return this.each(ja)}function Ka(t){var e=typeof t=="function"?t:wn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Za(){return null}function Qa(t,e){var n=typeof t=="function"?t:wn(t),r=e==null?Za:typeof e=="function"?e:Se(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function to(){var t=this.parentNode;t&&t.removeChild(this)}function eo(){return this.each(to)}function no(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ro(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function io(t){return this.select(t?ro:no)}function ao(t){return arguments.length?this.property("__data__",t):this.node().__data__}function oo(t){return function(e){t.call(this,e,this.__data__)}}function uo(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 so(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 lo(t,e,n){return function(){var r=this.__on,i,a=oo(e);if(r){for(var o=0,u=r.length;o<u;++o)if((i=r[o]).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 co(t,e,n){var r=uo(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var l=0,s=u.length,f;l<s;++l)for(i=0,f=u[l];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?lo:so,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function En(t,e,n){var r=Sn(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 fo(t,e){return function(){return En(this,t,e)}}function ho(t,e){return function(){return En(this,t,e.apply(this,arguments))}}function po(t,e){return this.each((typeof e=="function"?ho:fo)(t,e))}function*mo(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Fn=[null];function R(t,e){this._groups=t,this._parents=e}function Et(){return new R([[document.documentElement]],Fn)}function go(){return this}R.prototype=Et.prototype={constructor:R,select:zi,selectAll:Xi,selectChild:ji,selectChildren:Qi,filter:ta,data:oa,enter:ea,exit:sa,join:la,merge:ca,selection:go,order:fa,sort:ha,call:pa,nodes:ma,node:ga,size:ya,empty:va,each:ba,attr:Aa,style:Ea,property:Ia,classed:Ra,text:Ua,html:Wa,raise:qa,lower:Ja,append:Ka,insert:Qa,remove:eo,clone:io,datum:ao,on:co,dispatch:po,[Symbol.iterator]:mo};function Zt(t){return typeof t=="string"?new R([[document.querySelector(t)]],[document.documentElement]):new R([[t]],Fn)}function Me(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Tn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ft(){}var Tt=.7,Qt=1/Tt,mt="\\s*([+-]?\\d+)\\s*",Lt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yo=/^#([0-9a-f]{3,8})$/,vo=new RegExp(`^rgb\\(${mt},${mt},${mt}\\)$`),bo=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),wo=new RegExp(`^rgba\\(${mt},${mt},${mt},${Lt}\\)$`),xo=new RegExp(`^rgba\\(${W},${W},${W},${Lt}\\)$`),_o=new RegExp(`^hsl\\(${Lt},${W},${W}\\)$`),$o=new RegExp(`^hsla\\(${Lt},${W},${W},${Lt}\\)$`),Ln={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};Me(Ft,ot,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:In,formatHex:In,formatHex8:Do,formatHsl:So,formatRgb:On,toString:On});function In(){return this.rgb().formatHex()}function Do(){return this.rgb().formatHex8()}function So(){return Vn(this).formatHsl()}function On(){return this.rgb().formatRgb()}function ot(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=yo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Nn(e):n===3?new k(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?te(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?te(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=vo.exec(t))?new k(e[1],e[2],e[3],1):(e=bo.exec(t))?new k(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=wo.exec(t))?te(e[1],e[2],e[3],e[4]):(e=xo.exec(t))?te(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_o.exec(t))?Gn(e[1],e[2]/100,e[3]/100,1):(e=$o.exec(t))?Gn(e[1],e[2]/100,e[3]/100,e[4]):Ln.hasOwnProperty(t)?Nn(Ln[t]):t==="transparent"?new k(NaN,NaN,NaN,0):null}function Nn(t){return new k(t>>16&255,t>>8&255,t&255,1)}function te(t,e,n,r){return r<=0&&(t=e=n=NaN),new k(t,e,n,r)}function Ao(t){return t instanceof Ft||(t=ot(t)),t?(t=t.rgb(),new k(t.r,t.g,t.b,t.opacity)):new k}function Ce(t,e,n,r){return arguments.length===1?Ao(t):new k(t,e,n,r??1)}function k(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Me(k,Ce,Tn(Ft,{brighter(t){return t=t==null?Qt:Math.pow(Qt,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new k(ut(this.r),ut(this.g),ut(this.b),ee(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:kn,formatHex:kn,formatHex8:Mo,formatRgb:Rn,toString:Rn}));function kn(){return`#${st(this.r)}${st(this.g)}${st(this.b)}`}function Mo(){return`#${st(this.r)}${st(this.g)}${st(this.b)}${st((isNaN(this.opacity)?1:this.opacity)*255)}`}function Rn(){const t=ee(this.opacity);return`${t===1?"rgb(":"rgba("}${ut(this.r)}, ${ut(this.g)}, ${ut(this.b)}${t===1?")":`, ${t})`}`}function ee(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ut(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function st(t){return t=ut(t),(t<16?"0":"")+t.toString(16)}function Gn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new H(t,e,n,r)}function Vn(t){if(t instanceof H)return new H(t.h,t.s,t.l,t.opacity);if(t instanceof Ft||(t=ot(t)),!t)return new H;if(t instanceof H)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),o=NaN,u=a-i,l=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=l<.5?a+i:2-a-i,o*=60):u=l>0&&l<1?0:o,new H(o,u,l,t.opacity)}function Co(t,e,n,r){return arguments.length===1?Vn(t):new H(t,e,n,r??1)}function H(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Me(H,Co,Tn(Ft,{brighter(t){return t=t==null?Qt:Math.pow(Qt,t),new H(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new H(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 k(Pe(t>=240?t-240:t+120,i,r),Pe(t,i,r),Pe(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new H(zn(this.h),ne(this.s),ne(this.l),ee(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=ee(this.opacity);return`${t===1?"hsl(":"hsla("}${zn(this.h)}, ${ne(this.s)*100}%, ${ne(this.l)*100}%${t===1?")":`, ${t})`}`}}));function zn(t){return t=(t||0)%360,t<0?t+360:t}function ne(t){return Math.max(0,Math.min(1,t||0))}function Pe(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 Ee=t=>()=>t;function Po(t,e){return function(n){return t+n*e}}function Eo(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 Fo(t){return(t=+t)==1?Un:function(e,n){return n-e?Eo(e,n,t):Ee(isNaN(e)?n:e)}}function Un(t,e){var n=e-t;return n?Po(t,n):Ee(isNaN(t)?e:t)}const re=function t(e){var n=Fo(e);function r(i,a){var o=n((i=Ce(i)).r,(a=Ce(a)).r),u=n(i.g,a.g),l=n(i.b,a.b),s=Un(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=l(f),i.opacity=s(f),i+""}}return r.gamma=t,r}(1);function To(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 Lo(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Io(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Le(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function Oo(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Y(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function No(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]=Le(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Fe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Te=new RegExp(Fe.source,"g");function ko(t){return function(){return t}}function Ro(t){return function(e){return t(e)+""}}function Hn(t,e){var n=Fe.lastIndex=Te.lastIndex=0,r,i,a,o=-1,u=[],l=[];for(t=t+"",e=e+"";(r=Fe.exec(t))&&(i=Te.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,l.push({i:o,x:Y(r,i)})),n=Te.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?l[0]?Ro(l[0].x):ko(e):(e=l.length,function(s){for(var f=0,c;f<e;++f)u[(c=l[f]).i]=c.x(s);return u.join("")})}function Le(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ee(e):(n==="number"?Y:n==="string"?(r=ot(e))?(e=r,re):Hn:e instanceof ot?re:e instanceof Date?Oo:Lo(e)?To:Array.isArray(e)?Io:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?No:Y)(t,e)}function Go(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Yn=180/Math.PI,Ie={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xn(t,e,n,r,i,a){var o,u,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Yn,skewX:Math.atan(l)*Yn,scaleX:o,scaleY:u}}var ie;function Vo(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ie:Xn(e.a,e.b,e.c,e.d,e.e,e.f)}function zo(t){return t==null||(ie||(ie=document.createElementNS("http://www.w3.org/2000/svg","g")),ie.setAttribute("transform",t),!(t=ie.transform.baseVal.consolidate()))?Ie:(t=t.matrix,Xn(t.a,t.b,t.c,t.d,t.e,t.f))}function Wn(t,e,n,r){function i(s){return s.length?s.pop()+" ":""}function a(s,f,c,h,d,p){if(s!==c||f!==h){var m=d.push("translate(",null,e,null,n);p.push({i:m-4,x:Y(s,c)},{i:m-2,x:Y(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(s,f,c,h){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:Y(s,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(s,f,c,h){s!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:Y(s,f)}):f&&c.push(i(c)+"skewX("+f+r)}function l(s,f,c,h,d,p){if(s!==c||f!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:Y(s,c)},{i:m-2,x:Y(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(s,f){var c=[],h=[];return s=t(s),f=t(f),a(s.translateX,s.translateY,f.translateX,f.translateY,c,h),o(s.rotate,f.rotate,c,h),u(s.skewX,f.skewX,c,h),l(s.scaleX,s.scaleY,f.scaleX,f.scaleY,c,h),s=f=null,function(d){for(var p=-1,m=h.length,g;++p<m;)c[(g=h[p]).i]=g.x(d);return c.join("")}}}var Uo=Wn(Vo,"px, ","px)","deg)"),Ho=Wn(zo,", ",")",")"),gt=0,It=0,Ot=0,Bn=1e3,ae,Nt,oe=0,lt=0,ue=0,kt=typeof performance=="object"&&performance.now?performance:Date,qn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Oe(){return lt||(qn(Yo),lt=kt.now()+ue)}function Yo(){lt=0}function se(){this._call=this._time=this._next=null}se.prototype=jn.prototype={constructor:se,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Oe():+n)+(e==null?0:+e),!this._next&&Nt!==this&&(Nt?Nt._next=this:ae=this,Nt=this),this._call=t,this._time=n,Ne()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ne())}};function jn(t,e,n){var r=new se;return r.restart(t,e,n),r}function Xo(){Oe(),++gt;for(var t=ae,e;t;)(e=lt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--gt}function Jn(){lt=(oe=kt.now())+ue,gt=It=0;try{Xo()}finally{gt=0,Bo(),lt=0}}function Wo(){var t=kt.now(),e=t-oe;e>Bn&&(ue-=e,oe=t)}function Bo(){for(var t,e=ae,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:ae=n);Nt=t,Ne(r)}function Ne(t){if(!gt){It&&(It=clearTimeout(It));var e=t-lt;e>24?(t<1/0&&(It=setTimeout(Jn,t-kt.now()-ue)),Ot&&(Ot=clearInterval(Ot))):(Ot||(oe=kt.now(),Ot=setInterval(Wo,Bn)),gt=1,qn(Jn))}}function Kn(t,e,n){var r=new se;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var qo=yn("start","end","cancel","interrupt"),jo=[],Zn=0,Qn=1,ke=2,le=3,tr=4,Re=5,ce=6;function fe(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Jo(t,n,{name:e,index:r,group:i,on:qo,tween:jo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Zn})}function Ge(t,e){var n=X(t,e);if(n.state>Zn)throw new Error("too late; already scheduled");return n}function B(t,e){var n=X(t,e);if(n.state>le)throw new Error("too late; already running");return n}function X(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Jo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=jn(a,0,n.time);function a(s){n.state=Qn,n.timer.restart(o,n.delay,n.time),n.delay<=s&&o(s-n.delay)}function o(s){var f,c,h,d;if(n.state!==Qn)return l();for(f in r)if(d=r[f],d.name===n.name){if(d.state===le)return Kn(o);d.state===tr?(d.state=ce,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=ce,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(Kn(function(){n.state===le&&(n.state=tr,n.timer.restart(u,n.delay,n.time),u(s))}),n.state=ke,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ke){for(n.state=le,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function u(s){for(var f=s<n.duration?n.ease.call(null,s/n.duration):(n.timer.restart(l),n.state=Re,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Re&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=ce,n.timer.stop(),delete r[e];for(var s in r)return;delete t.__transition}}function Ko(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>ke&&r.state<Re,r.state=ce,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Zo(t){return this.each(function(){Ko(this,t)})}function Qo(t,e){var n,r;return function(){var i=B(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function tu(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=B(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},l=0,s=i.length;l<s;++l)if(i[l].name===e){i[l]=u;break}l===s&&i.push(u)}a.tween=i}}function eu(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=X(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Qo:tu)(n,t,e))}function Ve(t,e,n){var r=t._id;return t.each(function(){var i=B(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return X(i,r).value[e]}}function er(t,e){var n;return(typeof e=="number"?Y:e instanceof ot?re:(n=ot(e))?(e=n,re):Hn)(t,e)}function nu(t){return function(){this.removeAttribute(t)}}function ru(t){return function(){this.removeAttributeNS(t.space,t.local)}}function iu(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function au(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function ou(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function uu(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function su(t,e){var n=Jt(t),r=n==="transform"?Ho:er;return this.attrTween(t,typeof e=="function"?(n.local?uu:ou)(n,r,Ve(this,"attr."+t,e)):e==null?(n.local?ru:nu)(n):(n.local?au:iu)(n,r,e))}function lu(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function cu(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function fu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&cu(t,a)),n}return i._value=e,i}function hu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&lu(t,a)),n}return i._value=e,i}function du(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=Jt(t);return this.tween(n,(r.local?fu:hu)(r,e))}function pu(t,e){return function(){Ge(this,t).delay=+e.apply(this,arguments)}}function mu(t,e){return e=+e,function(){Ge(this,t).delay=e}}function gu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?pu:mu)(e,t)):X(this.node(),e).delay}function yu(t,e){return function(){B(this,t).duration=+e.apply(this,arguments)}}function vu(t,e){return e=+e,function(){B(this,t).duration=e}}function bu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?yu:vu)(e,t)):X(this.node(),e).duration}function wu(t,e){if(typeof e!="function")throw new Error;return function(){B(this,t).ease=e}}function xu(t){var e=this._id;return arguments.length?this.each(wu(e,t)):X(this.node(),e).ease}function _u(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;B(this,t).ease=n}}function $u(t){if(typeof t!="function")throw new Error;return this.each(_u(this._id,t))}function Du(t){typeof t!="function"&&(t=_n(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new J(r,this._parents,this._name,this._id)}function Su(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),o=new Array(r),u=0;u<a;++u)for(var l=e[u],s=n[u],f=l.length,c=o[u]=new Array(f),h,d=0;d<f;++d)(h=l[d]||s[d])&&(c[d]=h);for(;u<r;++u)o[u]=e[u];return new J(o,this._parents,this._name,this._id)}function Au(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 Mu(t,e,n){var r,i,a=Au(e)?Ge:B;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function Cu(t,e){var n=this._id;return arguments.length<2?X(this.node(),n).on.on(t):this.each(Mu(n,t,e))}function Pu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Eu(){return this.on("end.remove",Pu(this._id))}function Fu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Se(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],l=u.length,s=a[o]=new Array(l),f,c,h=0;h<l;++h)(f=u[h])&&(c=t.call(f,f.__data__,h,u))&&("__data__"in f&&(c.__data__=f.__data__),s[h]=c,fe(s[h],e,n,h,s,X(f,n)));return new J(a,this._parents,e,n)}function Tu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=xn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var l=r[u],s=l.length,f,c=0;c<s;++c)if(f=l[c]){for(var h=t.call(f,f.__data__,c,l),d,p=X(f,n),m=0,g=h.length;m<g;++m)(d=h[m])&&fe(d,e,n,m,h,p);a.push(h),o.push(f)}return new J(a,o,e,n)}var Lu=Et.prototype.constructor;function Iu(){return new Lu(this._groups,this._parents)}function Ou(t,e){var n,r,i;return function(){var a=pt(this,t),o=(this.style.removeProperty(t),pt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function nr(t){return function(){this.style.removeProperty(t)}}function Nu(t,e,n){var r,i=n+"",a;return function(){var o=pt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function ku(t,e,n){var r,i,a;return function(){var o=pt(this,t),u=n(this),l=u+"";return u==null&&(l=u=(this.style.removeProperty(t),pt(this,t))),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u))}}function Ru(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var l=B(this,t),s=l.on,f=l.value[a]==null?u||(u=nr(e)):void 0;(s!==n||i!==f)&&(r=(n=s).copy()).on(o,i=f),l.on=r}}function Gu(t,e,n){var r=(t+="")=="transform"?Uo:er;return e==null?this.styleTween(t,Ou(t,r)).on("end.style."+t,nr(t)):typeof e=="function"?this.styleTween(t,ku(t,r,Ve(this,"style."+t,e))).each(Ru(this._id,t)):this.styleTween(t,Nu(t,r,e),n).on("end.style."+t,null)}function Vu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function zu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Vu(t,o,n)),r}return a._value=e,a}function Uu(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,zu(t,e,n??""))}function Hu(t){return function(){this.textContent=t}}function Yu(t){return function(){var e=t(this);this.textContent=e??""}}function Xu(t){return this.tween("text",typeof t=="function"?Yu(Ve(this,"text",t)):Hu(t==null?"":t+""))}function Wu(t){return function(e){this.textContent=t.call(this,e)}}function Bu(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Wu(i)),e}return r._value=t,r}function qu(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,Bu(t))}function ju(){for(var t=this._name,e=this._id,n=rr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,l,s=0;s<u;++s)if(l=o[s]){var f=X(l,e);fe(l,t,n,s,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new J(r,this._parents,t,n)}function Ju(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var s=B(this,r),f=s.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),s.on=e}),i===0&&a()})}var Ku=0;function J(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function rr(){return++Ku}var K=Et.prototype;J.prototype={constructor:J,select:Fu,selectAll:Tu,selectChild:K.selectChild,selectChildren:K.selectChildren,filter:Du,merge:Su,selection:Iu,transition:ju,call:K.call,nodes:K.nodes,node:K.node,size:K.size,empty:K.empty,each:K.each,on:Cu,attr:su,attrTween:du,style:Gu,styleTween:Uu,text:Xu,textTween:qu,remove:Eu,tween:eu,delay:gu,duration:bu,ease:xu,easeVarying:$u,end:Ju,[Symbol.iterator]:K[Symbol.iterator]};function Zu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Qu={time:null,delay:0,duration:250,ease:Zu};function ts(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 es(t){var e,n;t instanceof J?(e=t._id,t=t._name):(e=rr(),(n=Qu).time=Oe(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,l,s=0;s<u;++s)(l=o[s])&&fe(l,t,e,s,o,n||ts(l,e));return new J(r,this._parents,t,e)}Et.prototype.interrupt=Zo,Et.prototype.transition=es;function ns(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function he(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 yt(t){return t=he(Math.abs(t)),t?t[1]:NaN}function rs(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(n.substring(i-=u,i+u)),!((l+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function is(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var as=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function de(t){if(!(e=as.exec(t)))throw new Error("invalid format: "+t);var e;return new ze({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]})}de.prototype=ze.prototype;function ze(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+""}ze.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 os(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 ir;function us(t,e){var n=he(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(ir=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+he(t,Math.max(0,e+a-1))[0]}function ar(t,e){var n=he(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 or={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:ns,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)=>ar(t*100,e),r:ar,s:us,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ur(t){return t}var sr=Array.prototype.map,lr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ss(t){var e=t.grouping===void 0||t.thousands===void 0?ur:rs(sr.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?ur:is(sr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function s(c){c=de(c);var h=c.fill,d=c.align,p=c.sign,m=c.symbol,g=c.zero,y=c.width,D=c.comma,x=c.precision,S=c.trim,v=c.type;v==="n"?(D=!0,v="g"):or[v]||(x===void 0&&(x=12),S=!0,v="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var P=m==="$"?n:m==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b=m==="$"?r:/[%p]/.test(v)?o:"",A=or[v],C=/[defgprs%]/.test(v);x=x===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function ht(w){var z=P,N=b,Q,Mt,Ct;if(v==="c")N=A(w)+N,w="";else{w=+w;var tt=w<0||1/w<0;if(w=isNaN(w)?l:A(Math.abs(w),x),S&&(w=os(w)),tt&&+w==0&&p!=="+"&&(tt=!1),z=(tt?p==="("?p:u:p==="-"||p==="("?"":p)+z,N=(v==="s"?lr[8+ir/3]:"")+N+(tt&&p==="("?")":""),C){for(Q=-1,Mt=w.length;++Q<Mt;)if(Ct=w.charCodeAt(Q),48>Ct||Ct>57){N=(Ct===46?i+w.slice(Q+1):w.slice(Q))+N,w=w.slice(0,Q);break}}}D&&!g&&(w=e(w,1/0));var dt=z.length+w.length+N.length,et=dt<y?new Array(y-dt+1).join(h):"";switch(D&&g&&(w=e(et+w,et.length?y-N.length:1/0),et=""),d){case"<":w=z+w+N+et;break;case"=":w=z+et+w+N;break;case"^":w=et.slice(0,dt=et.length>>1)+z+w+N+et.slice(dt);break;default:w=et+z+w+N;break}return a(w)}return ht.toString=function(){return c+""},ht}function f(c,h){var d=s((c=de(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(yt(h)/3)))*3,m=Math.pow(10,-p),g=lr[8+p/3];return function(y){return d(m*y)+g}}return{format:s,formatPrefix:f}}var pe,Ue,cr;ls({thousands:",",grouping:[3],currency:["$",""]});function ls(t){return pe=ss(t),Ue=pe.format,cr=pe.formatPrefix,pe}function cs(t){return Math.max(0,-yt(Math.abs(t)))}function fs(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yt(e)/3)))*3-yt(Math.abs(t)))}function hs(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,yt(e)-yt(t))+1}function me(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const fr=Symbol("implicit");function hr(){var t=new mn,e=[],n=[],r=fr;function i(a){let o=t.get(a);if(o===void 0){if(r!==fr)return r;t.set(a,o=e.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new mn;for(const o of a)t.has(o)||t.set(o,e.push(o)-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 hr(e,n).unknown(r)},me.apply(i,arguments),i}function dr(){var t=hr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,l=0,s=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,p=d?i:r,m=d?r:i;a=(m-p)/Math.max(1,h-l+s*2),u&&(a=Math.floor(a)),p+=(m-p-a*(h-l))*f,o=a*(1-l),u&&(p=Math.round(p),o=Math.round(o));var g=Ii(h).map(function(y){return p+a*y});return n(d?g.reverse():g)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(h){return arguments.length?(u=!!h,c()):u},t.padding=function(h){return arguments.length?(l=Math.min(1,s=+h),c()):l},t.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),c()):l},t.paddingOuter=function(h){return arguments.length?(s=+h,c()):s},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return dr(e(),[r,i]).round(u).paddingInner(l).paddingOuter(s).align(f)},me.apply(c(),arguments)}function pr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return pr(e())},t}function ds(){return pr(dr.apply(null,arguments).paddingInner(1))}function ps(t){return function(){return t}}function ms(t){return+t}var mr=[0,1];function vt(t){return t}function He(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:ps(isNaN(e)?NaN:.5)}function gs(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function ys(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=He(i,r),a=n(o,a)):(r=He(r,i),a=n(a,o)),function(u){return a(r(u))}}function vs(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=He(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var l=pn(t,u,1,r)-1;return a[l](i[l](u))}}function bs(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function ws(){var t=mr,e=mr,n=Le,r,i,a,o=vt,u,l,s;function f(){var h=Math.min(t.length,e.length);return o!==vt&&(o=gs(t[0],t[h-1])),u=h>2?vs:ys,l=s=null,c}function c(h){return h==null||isNaN(h=+h)?a:(l||(l=u(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((s||(s=u(e,t.map(r),Y)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,ms),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=Go,f()},c.clamp=function(h){return arguments.length?(o=h?!0:vt,f()):o!==vt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,d){return r=h,i=d,f()}}function xs(){return ws()(vt,vt)}function _s(t,e,n,r){var i=Li(t,e,n),a;switch(r=de(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=fs(i,o))&&(r.precision=a),cr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=hs(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=cs(i))&&(r.precision=a-(r.type==="%")*2);break}}return Ue(r)}function gr(t){var e=t.domain;return t.ticks=function(n){var r=e();return Ti(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return _s(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,o=r[i],u=r[a],l,s,f=10;for(u<o&&(s=o,o=u,u=s,s=i,i=a,a=s);f-- >0;){if(s=$e(o,u,n),s===l)return r[i]=o,r[a]=u,e(r);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;l=s}return t},t}function yr(){var t=xs();return t.copy=function(){return bs(t,yr())},me.apply(t,arguments),gr(t)}function vr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[pn(r,l,0,n)]:a}function u(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return o}return o.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,u()):[t,e]},o.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,u()):i.slice()},o.invertExtent=function(l){var s=i.indexOf(l);return s<0?[NaN,NaN]:s<1?[t,r[0]]:s>=n?[r[n-1],e]:[r[s-1],r[s]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return vr().domain([t,e]).range(i).unknown(a)},me.apply(gr(o),arguments)}function Rt(t,e,n){this.k=t,this.x=e,this.y=n}Rt.prototype={constructor:Rt,scale:function(t){return t===1?this:new Rt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Rt(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+")"}},Rt.prototype;function q(t){return Object.prototype.toString.call(t)==="[object Object]"}function $s(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function nt(t,e){if(q(t)===!1||q(e)===!1)return Object.assign({},e);const n=(r,i)=>{const a=Object.assign({},i);for(let o of Object.keys(r)){if(!(o in i))continue;let u;q(r[o])&&q(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function Ds(t=0){try{let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}catch(e){console.error(e)}}function Ss(t,e){return e instanceof Function?e(t):Ue(e)(t)}function Gt(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function ge(t,e){return`${t}_series${e}`}function Ye(t,e){return`${t}_group${e}`}function Xe({transposedDataGrid:t,dataFormatter:e,chartType:n="grid"}){const r=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.rowLabels:e.grid.gridData.columnLabels;return t.map((i,a)=>r[a]!=null?r[a]:ge(n,a))}function br({transposedDataGrid:t,dataFormatter:e,chartType:n="multiGrid",gridIndex:r=0}){const i=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.rowLabels:e.grid.gridData.columnLabels;return t.map((a,o)=>i[o]!=null?i[o]:ge(`${n}_grid${r}`,o))}function wr({transposedDataGrid:t,dataFormatter:e,chartType:n="grid"}){if(t[0]==null)return[];const r=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.columnLabels:e.grid.gridData.rowLabels;return t[0].map((i,a)=>r[a]!=null?r[a]:Ye(n,a))}function xr({transposedDataGrid:t,dataFormatter:e,chartType:n="multiGrid",gridIndex:r=0}){if(t[0]==null)return[];const i=e.grid.gridData.seriesDirection==="row"?e.grid.gridData.columnLabels:e.grid.gridData.rowLabels;return t[0].map((a,o)=>i[o]!=null?i[o]:Ye(`${n}_grid${r}`,o))}function bt(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function ye(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return bt(e)}function As(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function We(t){const n=t.flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function Ms(t){const n=t.flat().flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function Cs(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||q(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return bt(r)}function _r(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((a,o)=>Math.max(a,o.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let a=0;a<n;a++)for(let o=0;o<r;o++)i[o][a]=e[a][o];return i}function Vt(t,e){return t<e.colors[e.colorScheme].series.length?e.colors[e.colorScheme].series[t]:e.colors[e.colorScheme].series[t%e.colors[e.colorScheme].series.length]}function zt(t,e,n,r){const{gap:i,rowAmount:a,columnAmount:o}=e,u=(t.width-i*(o-1))/o,l=(t.height-i*(a-1))/a,s=r*u+r*i,f=n*l+n*i,c=[s,f],h=[u/t.width,l/t.height];return{translate:c,scale:h}}function Ps(t,e){const n=new Map;let r=Object.assign([],t),i=[];return r.forEach((a,o)=>{Array.isArray(a)?a.forEach((u,l)=>{i.push({rowIndex:o,columnIndex:l,index:-1,datum:u})}):i.push({rowIndex:o,columnIndex:0,index:-1,datum:a})}),i.sort((a,o)=>e(a.datum,o.datum)),i=i.map((a,o)=>({...a,index:o})),i.forEach(a=>{n.set(String([a.rowIndex,a.columnIndex]),a.index)}),n}const Es=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=[];try{const a=(u=>{if(u){const l=Ps(e,n.sort);return(s,f,c)=>l.get(String([f,c]))}else return(l,s,f)=>l.length})(n.sort!=null),o=(u,l,s,f,c)=>{const h=Gt(n.type,l,s),d=n.seriesLabels[l]||ge("series",l),p=Vt(l,r),m=n.visibleFilter(u,l,s,t);return typeof u=="number"?{id:h,index:f,sortedIndex:c,label:h,description:"",data:{},value:u,seriesIndex:l,seriesLabel:d,color:p,visible:m}:{id:u.id?u.id:h,index:f,sortedIndex:c,label:u.label?u.label:h,description:u.description,data:u.data??{},value:u.value,seriesIndex:l,seriesLabel:d,color:p,visible:m}};e.forEach((u,l)=>{if(Array.isArray(u))u.forEach((s,f)=>{const c=a(i,l,f),h=o(s,l,f,i.length,c);i.push(h)});else{const s=a(i,l,0),f=o(u,l,0,i.length,s);i.push(f)}})}catch(a){throw Error(a)}return i};var Be=function(t,e){return Be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Be(t,e)};function Z(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Be(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Fs(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function u(f){try{s(r.next(f))}catch(c){o(c)}}function l(f){try{s(r.throw(f))}catch(c){o(c)}}function s(f){f.done?a(f.value):i(f.value).then(u,l)}s((r=r.apply(t,e||[])).next())})}function $r(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(f){return l([s,f])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=e.call(t,n)}catch(f){s=[6,f],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function wt(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function it(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}function xt(t){return this instanceof xt?(this.v=t,this):new xt(t)}function Ts(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i={},u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(p){return Promise.resolve(p).then(d,c)}}function u(d,p){r[d]&&(i[d]=function(m){return new Promise(function(g,y){a.push([d,m,g,y])>1||l(d,m)})},p&&(i[d]=p(i[d])))}function l(d,p){try{s(r[d](p))}catch(m){h(a[0][3],m)}}function s(d){d.value instanceof xt?Promise.resolve(d.value.v).then(f,c):h(a[0][2],d)}function f(d){l("next",d)}function c(d){l("throw",d)}function h(d,p){d(p),a.shift(),a.length&&l(a[0][0],a[0][1])}}function Ls(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof wt=="function"?wt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(u,l){o=t[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(s){a({value:s,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function T(t){return typeof t=="function"}function qe(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var je=qe(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
2
2
|
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function ve(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Ut=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=wt(o),l=u.next();!l.done;l=u.next()){var s=l.value;s.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(T(f))try{f()}catch(m){a=m instanceof je?m.errors:[m]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=wt(c),d=h.next();!d.done;d=h.next()){var p=d.value;try{Ar(p)}catch(m){a=a??[],m instanceof je?a=it(it([],rt(a)),rt(m.errors)):a.push(m)}}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new je(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Ar(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&ve(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ve(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Dr=Ut.EMPTY;function Sr(t){return t instanceof Ut||t&&"closed"in t&&T(t.remove)&&T(t.add)&&T(t.unsubscribe)}function Ar(t){T(t)?t():t.unsubscribe()}var Mr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Cr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,it([t,e],rt(n)))},clearTimeout:function(t){var e=Cr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Pr(t){Cr.setTimeout(function(){throw t})}function Je(){}function be(t){t()}var Ke=function(t){Z(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Sr(n)&&n.add(r)):r.destination=ks,r}return e.create=function(n,r,i){return new Ht(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ut),Is=Function.prototype.bind;function Ze(t,e){return Is.call(t,e)}var Os=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){we(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){we(r)}else we(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){we(n)}},t}(),Ht=function(t){Z(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(T(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Mr.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&Ze(n.next,u),error:n.error&&Ze(n.error,u),complete:n.complete&&Ze(n.complete,u)}):o=n}return a.destination=new Os(o),a}return e}(Ke);function we(t){Pr(t)}function Ns(t){throw t}var ks={closed:!0,next:Je,error:Ns,complete:Je},Qe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _t(t){return t}function Rs(t){return t.length===0?_t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var E=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,a=Vs(e)?e:new Ht(e,n,r);return be(function(){var o=i,u=o.operator,l=o.source;a.add(u?u.call(a,l):l?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Er(n),new n(function(i,a){var o=new Ht({next:function(u){try{e(u)}catch(l){a(l),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Qe]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Rs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Er(e),new e(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},t.create=function(e){return new t(e)},t}();function Er(t){var e;return(e=t??Mr.Promise)!==null&&e!==void 0?e:Promise}function Gs(t){return t&&T(t.next)&&T(t.error)&&T(t.complete)}function Vs(t){return t&&t instanceof Ke||Gs(t)&&Sr(t)}function zs(t){return T(t==null?void 0:t.lift)}function L(t){return function(e){if(zs(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function I(t,e,n,r,i){return new Us(t,e,n,r,i)}var Us=function(t){Z(e,t);function e(n,r,i,a,o,u){var l=t.call(this,n)||this;return l.onFinalize=o,l.shouldUnsubscribe=u,l._next=r?function(s){try{r(s)}catch(f){n.error(f)}}:t.prototype._next,l._error=a?function(s){try{a(s)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(s){n.error(s)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Ke),Hs=qe(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),F=function(t){Z(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Fr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Hs},e.prototype.next=function(n){var r=this;be(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=wt(r.currentObservers),u=o.next();!u.done;u=o.next()){var l=u.value;l.next(n)}}catch(s){i={error:s}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;be(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;be(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,a=i.hasError,o=i.isStopped,u=i.observers;return a||o?Dr:(this.currentObservers=null,u.push(n),new Ut(function(){r.currentObservers=null,ve(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r.thrownError,o=r.isStopped;i?n.error(a):o&&n.complete()},e.prototype.asObservable=function(){var n=new E;return n.source=this,n},e.create=function(n,r){return new Fr(n,r)},e}(E),Fr=function(t){Z(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Dr},e}(F),tn={now:function(){return(tn.delegate||Date).now()},delegate:void 0},Ys=function(t){Z(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=tn);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,l=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+l)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),l=0;l<u.length&&!n.closed;l+=a?1:2)n.next(u[l]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var l=i.now(),s=0,f=1;f<a.length&&a[f]<=l;f+=2)s=f;s&&a.splice(0,s+1)}},e}(F),Xs=function(t){Z(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Ut),en={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,it([t,e],rt(n)))},clearInterval:function(t){var e=en.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Ws=function(t){Z(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),en.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&en.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,a;try{this.work(n)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ve(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Xs),Tr=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=tn.now,t}(),Bs=function(t){Z(e,t);function e(n,r){r===void 0&&(r=Tr.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Tr),nn=new Bs(Ws),qs=nn,rn=new E(function(t){return t.complete()});function Lr(t){return t&&T(t.schedule)}function an(t){return t[t.length-1]}function js(t){return T(an(t))?t.pop():void 0}function $t(t){return Lr(an(t))?t.pop():void 0}function Ir(t,e){return typeof an(t)=="number"?t.pop():e}var Or=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Nr(t){return T(t==null?void 0:t.then)}function kr(t){return T(t[Qe])}function Rr(t){return Symbol.asyncIterator&&T(t==null?void 0:t[Symbol.asyncIterator])}function Gr(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Js(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Vr=Js();function zr(t){return T(t==null?void 0:t[Vr])}function Ur(t){return Ts(this,arguments,function(){var n,r,i,a;return $r(this,function(o){switch(o.label){case 0:n=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,xt(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,xt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,xt(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Hr(t){return T(t==null?void 0:t.getReader)}function G(t){if(t instanceof E)return t;if(t!=null){if(kr(t))return Ks(t);if(Or(t))return Zs(t);if(Nr(t))return Qs(t);if(Rr(t))return Yr(t);if(zr(t))return tl(t);if(Hr(t))return el(t)}throw Gr(t)}function Ks(t){return new E(function(e){var n=t[Qe]();if(T(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Zs(t){return new E(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Qs(t){return new E(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Pr)})}function tl(t){return new E(function(e){var n,r;try{for(var i=wt(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Yr(t){return new E(function(e){nl(t,e).catch(function(n){return e.error(n)})})}function el(t){return Yr(Ur(t))}function nl(t,e){var n,r,i,a;return Fs(this,void 0,void 0,function(){var o,u;return $r(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=Ls(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),i={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function at(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(a),!i)return a}function Xr(t,e){return e===void 0&&(e=0),L(function(n,r){n.subscribe(I(r,function(i){return at(r,t,function(){return r.next(i)},e)},function(){return at(r,t,function(){return r.complete()},e)},function(i){return at(r,t,function(){return r.error(i)},e)}))})}function Wr(t,e){return e===void 0&&(e=0),L(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function rl(t,e){return G(t).pipe(Wr(e),Xr(e))}function il(t,e){return G(t).pipe(Wr(e),Xr(e))}function al(t,e){return new E(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function ol(t,e){return new E(function(n){var r;return at(n,e,function(){r=t[Vr](),at(n,e,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(u){n.error(u);return}o?n.complete():n.next(a)},0,!0)}),function(){return T(r==null?void 0:r.return)&&r.return()}})}function Br(t,e){if(!t)throw new Error("Iterable cannot be null");return new E(function(n){at(n,e,function(){var r=t[Symbol.asyncIterator]();at(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function ul(t,e){return Br(Ur(t),e)}function sl(t,e){if(t!=null){if(kr(t))return rl(t,e);if(Or(t))return al(t,e);if(Nr(t))return il(t,e);if(Rr(t))return Br(t,e);if(zr(t))return ol(t,e);if(Hr(t))return ul(t,e)}throw Gr(t)}function Dt(t,e){return e?sl(t,e):G(t)}function Yt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return Dt(t,n)}var qr=qe(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function ll(t){return t instanceof Date&&!isNaN(t)}function M(t,e){return L(function(n,r){var i=0;n.subscribe(I(r,function(a){r.next(t.call(e,a,i++))}))})}var cl=Array.isArray;function fl(t,e){return cl(e)?t.apply(void 0,it([],rt(e))):t(e)}function hl(t){return M(function(e){return fl(t,e)})}var dl=Array.isArray,pl=Object.getPrototypeOf,ml=Object.prototype,gl=Object.keys;function yl(t){if(t.length===1){var e=t[0];if(dl(e))return{args:e,keys:null};if(vl(e)){var n=gl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function vl(t){return t&&typeof t=="object"&&pl(t)===ml}function bl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function U(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=js(t),i=yl(t),a=i.args,o=i.keys;if(a.length===0)return Dt([],n);var u=new E(wl(a,n,o?function(l){return bl(o,l)}:_t));return r?u.pipe(hl(r)):u}function wl(t,e,n){return n===void 0&&(n=_t),function(r){jr(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,l=function(f){jr(e,function(){var c=Dt(t[f],e),h=!1;c.subscribe(I(r,function(d){a[f]=d,h||(h=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},s=0;s<i;s++)l(s)},r)}}function jr(t,e,n){t?at(n,t,e):e()}function xl(t,e,n,r,i,a,o,u){var l=[],s=0,f=0,c=!1,h=function(){c&&!l.length&&!s&&e.complete()},d=function(m){return s<r?p(m):l.push(m)},p=function(m){s++;var g=!1;G(n(m,f++)).subscribe(I(e,function(y){e.next(y)},function(){g=!0},void 0,function(){if(g)try{s--;for(var y=function(){var D=l.shift();o||p(D)};l.length&&s<r;)y();h()}catch(D){e.error(D)}}))};return t.subscribe(I(e,d,function(){c=!0,h()})),function(){}}function Jr(t,e,n){return n===void 0&&(n=1/0),T(e)?Jr(function(r,i){return M(function(a,o){return e(r,a,i,o)})(G(t(r,i)))},n):(typeof e=="number"&&(n=e),L(function(r,i){return xl(r,i,t,n)}))}function on(t){return t===void 0&&(t=1/0),Jr(_t,t)}function _l(){return on(1)}function Kr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return _l()(Dt(t,$t(t)))}function $l(t){return new E(function(e){G(t()).subscribe(e)})}function Dl(t,e,n){return $l(function(){return t()?e:n})}function Sl(t,e,n){n===void 0&&(n=qs);var r=-1;return e!=null&&(Lr(e)?n=e:r=e),new E(function(i){var a=ll(t)?+t-n.now():t;a<0&&(a=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},a)})}function Al(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Ir(t,1/0),i=t;return i.length?i.length===1?G(i[0]):on(r)(Dt(i,n)):rn}var Ml=Array.isArray;function Cl(t){return t.length===1&&Ml(t[0])?t[0]:t}function Zr(t,e){return L(function(n,r){var i=0;n.subscribe(I(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function Qr(t){return L(function(e,n){var r=null,i=!1,a;r=e.subscribe(I(n,void 0,void 0,function(o){a=G(t(o,Qr(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Pl(t,e){return e===void 0&&(e=nn),L(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var s=a;a=null,r.next(s)}};function l(){var s=o+t,f=e.now();if(f<s){i=this.schedule(void 0,s-f),r.add(i);return}u()}n.subscribe(I(r,function(s){a=s,o=e.now(),i||(i=e.schedule(l,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function El(t){return L(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function Fl(t){return t<=0?function(){return rn}:L(function(e,n){var r=0;e.subscribe(I(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function St(t,e){return e===void 0&&(e=_t),t=t??Tl,L(function(n,r){var i,a=!0;n.subscribe(I(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function Tl(t,e){return t===e}function Ll(t){return t===void 0&&(t=Il),L(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function Il(){return new qr}function Ol(t,e){var n=arguments.length>=2;return function(r){return r.pipe(_t,Fl(1),n?El(e):Ll(function(){return new qr}))}}function Nl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Ir(t,1/0);return t=Cl(t),L(function(i,a){on(r)(Dt(it([i],rt(t)),n)).subscribe(a)})}function kl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Nl.apply(void 0,it([],rt(t)))}function un(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new F}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,l=u===void 0?!0:u;return function(s){var f,c,h,d=0,p=!1,m=!1,g=function(){c==null||c.unsubscribe(),c=void 0},y=function(){g(),f=h=void 0,p=m=!1},D=function(){var x=f;y(),x==null||x.unsubscribe()};return L(function(x,S){d++,!m&&!p&&g();var v=h=h??n();S.add(function(){d--,d===0&&!m&&!p&&(c=sn(D,l))}),v.subscribe(S),!f&&d>0&&(f=new Ht({next:function(P){return v.next(P)},error:function(P){m=!0,g(),c=sn(y,i,P),v.error(P)},complete:function(){p=!0,g(),c=sn(y,o),v.complete()}}),G(x).subscribe(f))})(s)}}function sn(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Ht({next:function(){i.unsubscribe(),t()}});return G(e.apply(void 0,it([],rt(n)))).subscribe(i)}}function $(t,e,n){var r,i=!1;return r=t,un({connector:function(){return new Ys(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function xe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return L(function(r,i){(n?Kr(t,r,n):Kr(t,r)).subscribe(i)})}function V(t,e){return L(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(I(r,function(l){i==null||i.unsubscribe();var s=0,f=a++;G(t(l,f)).subscribe(i=I(r,function(c){return r.next(e?e(l,c,f,s++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function O(t){return L(function(e,n){G(t).subscribe(I(n,function(){return n.complete()},Je)),!n.closed&&e.subscribe(n)})}function Rl(t,e){return L(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,l=u===void 0?!1:u,s=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,l&&(g(),h&&r.complete())},p=function(){c=null,h&&r.complete()},m=function(y){return c=G(t(y)).subscribe(I(r,d,p))},g=function(){if(s){s=!1;var y=f;f=null,r.next(y),!h&&m(y)}};n.subscribe(I(r,function(y){s=!0,f=y,!(c&&!c.closed)&&(o?g():m(y))},function(){h=!0,!(l&&s&&c&&!c.closed)&&r.complete()}))})}function Gl(t,e,n){e===void 0&&(e=nn);var r=Sl(t,e);return Rl(function(){return r},n)}const Xt=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new F,i=e.pipe(O(r),M(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),St()),a=n.pipe(O(r),Zr(c=>c.eventName==="mouseover"||c.eventName==="mousemove"),M(c=>c.datum?{id:c.datum.id,seriesLabel:c.datum.seriesLabel,groupLabel:c.datum.groupLabel,categoryLabel:c.datum.categoryLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null})),o=n.pipe(O(r),Zr(c=>c.eventName==="mouseout"),V(c=>i));function u(c,h){return h==null?[]:c.find(d=>d.id===h)?[h]:[]}function l(c,h){return h==null?c.filter(d=>d.seriesLabel===h).map(d=>d.id):[]}function s(c,h){return h==null?c.filter(d=>d.groupLabel===h).map(d=>d.id):[]}function f(c,h){return h==null?[]:c.filter(d=>d.categoryLabel===h).map(d=>d.id)}return new E(c=>(U({target:Al(a,o,i),datumList:t,fullChartParams:e}).pipe(O(r),V(async h=>h)).subscribe(h=>{let d=[];h.fullChartParams.highlightTarget==="datum"?d=u(h.datumList,h.target.id):h.fullChartParams.highlightTarget==="series"?d=l(h.datumList,h.target.seriesLabel):h.fullChartParams.highlightTarget==="group"?d=s(h.datumList,h.target.groupLabel):h.fullChartParams.highlightTarget==="category"&&(d=f(h.datumList,h.target.categoryLabel)),c.next(d)}),function(){r.next(void 0)}))},_e=({datumList$:t})=>t.pipe(M(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),ln=({datumList$:t})=>t.pipe(M(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),ti=({datumList$:t})=>t.pipe(M(e=>{const n=new Map;return e.filter(r=>r.categoryLabel!=null).forEach(r=>{const i=n.get(r.categoryLabel)??[];i.push(r),n.set(r.categoryLabel,i)}),n})),Vl=({subject:t,observer:e})=>{const n=Xt({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),r=_e({datumList$:e.computedData$}).pipe($(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},ct=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const a=r[0]??j.scaleDomain[0],o=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],l=i[1]??j.scaleRange[1],s=a==="auto"?e:a,f=o==="auto"?t:o,c=t-(t-s)/(1-u),h=f/l;return yr().domain([c,h]).range([0,n])},zl=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ds().domain(t).range(r).padding(n)},Ul=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let a=t.map((o,u)=>u);return r&&a.reverse(),vr().domain([-0,e+0]).range(a)},Hl={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Yl(t){return new E(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}function ei(t,e,n){const r=nt(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return nt(i,o)})),r}const Xl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new F,i=t.type;return function(o,u){Zt(o).selectAll("svg").remove();const l=Zt(o).append("svg");l.attr("xmlns:xlink","http://www.w3.org/1999/xlink").attr("xmls","http://www.w3.org/2000/svg").attr("version","1.1").style("position","absolute").classed("orbcharts__root",!0);const s=l.append("g");s.classed("orbcharts__layout",!0);const f=s.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new F,dataFormatter$:new F,plugins$:new F,chartParams$:new F,event$:new F},h=(b=>{const A=b||Pt,C=A.preset?A.preset:{};return{chartParams:C.chartParams?nt(C.chartParams,fn):fn,dataFormatter:C.dataFormatter?ei(C.dataFormatter,t,i):t,allPluginParams:C.allPluginParams?C.allPluginParams:{},description:C.description??""}})(u),d=c.data$.pipe($(1)),p=c.dataFormatter$.pipe(O(r),xe({}),M(b=>ei(b,h.dataFormatter,i)),$(1)),m=c.chartParams$.pipe(O(r),xe({}),M(b=>nt(b,h.chartParams)),$(1)),g=m.pipe(O(r),xe({}),M(b=>nt(b.padding??{},cn)));g.pipe(O(r),Ol()).subscribe(b=>{s.attr("transform",`translate(${b.left}, ${b.top})`)}),g.subscribe(b=>{s.transition().attr("transform",`translate(${b.left}, ${b.top})`)});const y=Yl(o).pipe(O(r),un()),D=Yt().pipe(kl(y.pipe(Pl(250)),y.pipe(Gl(250))),St((b,A)=>JSON.stringify(b)===JSON.stringify(A)),un()),x=D.subscribe(),S=U({rootSize:D,mergedPadding:g}).pipe(O(r),V(async b=>{const A=b.rootSize.width>0?b.rootSize.width:pi,C=b.rootSize.height>0?b.rootSize.height:mi;return{width:A-b.mergedPadding.left-b.mergedPadding.right,height:C-b.mergedPadding.top-b.mergedPadding.bottom,top:b.mergedPadding.top,right:b.mergedPadding.right,bottom:b.mergedPadding.bottom,left:b.mergedPadding.left,rootWidth:A,rootHeight:C}}),$(1));S.subscribe(b=>{l.attr("width",b.rootWidth).attr("height",b.rootHeight)});const v=U({data:d,dataFormatter:p,chartParams:m,layout:Dl(()=>Hl[i]===!0,S,Yt(void 0))}).pipe(O(r),V(async b=>b),V(b=>Yt(b).pipe(M(A=>{try{return e({data:A.data,dataFormatter:A.dataFormatter,chartParams:A.chartParams,layout:A.layout})}catch(C){throw console.error(C),new Error(C)}}),Qr(()=>rn))),$(1));v.subscribe();const P={};return c.plugins$.subscribe(b=>{if(!b)return;const A=f.selectAll("g.orbcharts__plugin").data(b,w=>w.name),C=A.enter().append("g").attr("class",w=>`orbcharts__plugin orbcharts__${w.name}`);A.exit().remove().each((w,z,N)=>{P[w.name]&&P[w.name].destroy()}),C.each((w,z,N)=>{const Q={fullParams$:new E,fullChartParams$:m,fullDataFormatter$:p,computedData$:v,layout$:S},Mt=n({observer:Q,subject:c}),tt={selection:Zt(N[z]),rootSelection:l,name:w.name,chartType:i,subject:c,observer:Mt};w.setPresetParams(h.allPluginParams[w.name]??{}),w.setContext(tt),P[tt.name]=w,w.init()})}),{...c,selection:l,destroy(){Zt(o).selectAll("svg").remove(),r.next(void 0),x.unsubscribe()}}}};class At{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new F,this.dataFormatter$=new F,this.plugins$=new F,this.chartParams$=new F,this.event$=new F;const u=Xl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,a);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}}class Wl extends At{constructor(e,n){super({defaultDataFormatter:yi,computedDataFn:Es,contextObserverFn:Vl},e,n)}}function ni(t){const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];try{const a=e.reduce((s,f)=>f.length>s?f.length:s,0),u=e.map((s,f)=>{if(s.length===a)return s;const c=Object.assign([],s);for(let h=c.length;h<a;h++)c[h]=null;return c}).map((s,f)=>s.map((c,h)=>{const d=n.grid.visibleFilter(c,f,h,t);return c==null?{id:"",label:"",data:{},value:null,_visible:d}:typeof c=="number"?{id:"",label:"",data:{},value:c,_visible:d}:{id:c.id??"",label:c.label??"",data:c.data??{},value:c.value,_visible:d}}));return _r(n.grid.gridData.seriesDirection,u)}catch{return[]}}function ri(t,e,n){const r=e.grid.groupAxis.position==="top"||e.grid.groupAxis.position==="bottom"?n.width:n.height,i=t[0]?t[0].length-1:0;return ct({maxValue:i,minValue:0,axisWidth:r,scaleDomain:[0,i],scaleRange:[0,1]})}function ii(t,e,n){const r=e.grid.valueAxis.position==="left"||e.grid.valueAxis.position==="right"?n.height:n.width,i=t.flat().filter(u=>u._visible!=!1),[a,o]=ye(i);return t.map((u,l)=>ct({maxValue:o,minValue:a,axisWidth:r,scaleDomain:[a,o],scaleRange:[0,1]}))}const Bl=t=>{const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a;try{const o=ni(t),u=ri(o,n,i),l=Xe({transposedDataGrid:o,dataFormatter:n,chartType:"grid"}),s=wr({transposedDataGrid:o,dataFormatter:n,chartType:"grid"}),f=ii(o,n,i),c=o.map((d,p)=>f[p](0));let h=0;a=o.map((d,p)=>d.map((m,g)=>{const y=Gt("grid",0,p,g),D=s[g],x=f[p],S=x(m.value??0),v=c[p],P={id:m.id?m.id:y,index:h,label:m.label?m.label:y,description:m.description??"",data:m.data,value:m.value,gridIndex:0,seriesIndex:p,seriesLabel:l[p],groupIndex:g,groupLabel:D,color:Vt(p,r),axisX:u(g),axisY:S,axisYFromZero:S-v,visible:m._visible};return h++,P}))}catch(o){throw Error(o)}return a},ai=({fullDataFormatter$:t,layout$:e})=>{const n=new F;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let l=0,s=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,s=u):a.position==="right"?(c=180,h=180,l=o,s=u):(c=180,s=u):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,l=o):(c=180,s=u)):i.position==="left"?a.position==="bottom"?(f=-90,s=u):a.position==="top"?(f=-90,h=180):(c=180,s=u):i.position==="right"&&(a.position==="bottom"?(f=-90,c=180,s=u,l=o):a.position==="top"?(f=-90,c=180,h=180,l=o):(c=180,s=u)),{translate:[l,s],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${l}px, ${s}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new E(i=>(U({fullDataFormatter:t,layout:e}).pipe(O(n),V(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.grid.groupAxis,yAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},oi=({gridAxesTransform$:t})=>t.pipe(M(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,a=e.rotateX*-1,o=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:a,rotateY:o,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${a}deg) rotateY(${o}deg)`}})),ui=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new F;function i({data:a,groupAxis:o,valueAxis:u,width:l,height:s}){let f=0,c=0,h=0,d=0;const p=o.position==="top"||o.position==="bottom"?l:s,m=0,g=a[0]?a[0].length-1:0,y=o.scaleDomain[0]==="auto"?m-o.scalePadding:o.scaleDomain[0]-o.scalePadding,D=o.scaleDomain[1]==="auto"?g+o.scalePadding:o.scaleDomain[1]+o.scalePadding,x=ct({maxValue:g,minValue:m,axisWidth:p,scaleDomain:[y,D],scaleRange:[0,1]}),S=x(m),v=x(g);f=S,h=(v-S)/p;const b=a.map((Mt,Ct)=>Mt.filter((tt,dt)=>dt>=y&&dt<=D&&tt.visible==!0)),A=We(b),C=u.position==="left"||u.position==="right"?s:l,ht=ct({maxValue:A[1],minValue:A[0],axisWidth:C,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),w=We(a),z=ht(w[0]),N=ht(w[1]);return c=z,d=(N-z)/C,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new E(a=>(U({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(r),V(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},si=({gridContainer$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>U({gridContainer:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(V(async r=>r),M(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[1]]):r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[0]]))),li=({fullDataFormatter$:t,layout$:e})=>{const n=new F;function r({xAxisPosition:i,yAxisPosition:a,width:o,height:u}){if((i==="bottom"||i==="top")&&(a==="left"||a==="right"))return{width:o,height:u};if((i==="left"||i==="right")&&(a==="bottom"||a==="top"))return{width:u,height:o}}return new E(i=>{U({fullDataFormatter:t,layout:e}).pipe(O(n),V(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.grid.groupAxis.position,yAxisPosition:a.fullDataFormatter.grid.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},ci=({computedData$:t})=>t.pipe(M(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),St((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),fi=({computedData$:t})=>t.pipe(M(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),hi=({computedData$:t,fullDataFormatter$:e})=>U({computedData:t,fullDataFormatter:e}).pipe(M(n=>!!(n.fullDataFormatter.grid.seriesSlotIndexes&&n.fullDataFormatter.grid.seriesSlotIndexes.length===n.computedData.length)),St()),di=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>U({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(V(async a=>a),M(a=>{const o=a.fullDataFormatter.grid;if(!!(o.seriesSlotIndexes&&o.seriesSlotIndexes.length===a.computedData.length))return a.computedData.map((l,s)=>{const f=o.seriesSlotIndexes[s]%a.fullDataFormatter.container.columnAmount,c=Math.floor(o.seriesSlotIndexes[s]/a.fullDataFormatter.container.columnAmount),{translate:h,scale:d}=zt(a.layout,a.fullDataFormatter.container,c,f);return{slotIndex:o.seriesSlotIndexes[s],rowIndex:c,columnIndex:f,translate:h,scale:d}});{const l=o.slotIndex%a.fullDataFormatter.container.columnAmount,s=Math.floor(o.slotIndex/a.fullDataFormatter.container.columnAmount);return a.computedData.map((f,c)=>{const{translate:h,scale:d}=zt(a.layout,a.fullDataFormatter.container,s,l);return{slotIndex:o.slotIndex,rowIndex:s,columnIndex:l,translate:h,scale:d}})}})),ql=({subject:t,observer:e})=>{const n=hi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe($(1)),r=di({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$}),i=ai({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe($(1)),a=oi({gridAxesTransform$:i}).pipe($(1)),o=ui({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe($(1)),u=si({gridContainer$:r,gridAxesTransform$:i,gridGraphicTransform$:o}),l=li({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe($(1)),s=e.computedData$.pipe(M(m=>m.flat())).pipe($(1)),f=Xt({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),c=ci({computedData$:e.computedData$}),h=_e({datumList$:s}).pipe($(1)),d=ln({datumList$:s}).pipe($(1)),p=fi({computedData$:e.computedData$}).pipe($(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,isSeriesPositionSeprate$:n,gridContainer$:r,gridAxesTransform$:i,gridAxesReverseTransform$:a,gridGraphicTransform$:o,gridGraphicReverseScale$:u,gridAxesSize$:l,gridHighlight$:f,existedSeriesLabels$:c,SeriesDataMap$:h,GroupDataMap$:d,visibleComputedData$:p}};class jl extends At{constructor(e,n){super({defaultDataFormatter:vi,computedDataFn:Bl,contextObserverFn:ql},e,n)}}function Jl({context:t,gridIndex:e,transposedDataGrid:n,gridSeriesLabels:r,SeriesLabelColorMap:i}){const{data:a=[],dataFormatter:o,chartParams:u,layout:l}=t;if(!a.length)return[];const s=ri(n,o,l),f=xr({transposedDataGrid:n,dataFormatter:o,chartType:"multiGrid",gridIndex:e}),c=ii(n,o,l),h=n.map((m,g)=>c[g](0));let d=0;return n.map((m,g)=>m.map((y,D)=>{const x=Gt("multiGrid",e,g,D),S=f[D],v=r[g],P=c[g],b=P(y.value??0),A=h[g],C={id:y.id?y.id:x,index:d,label:y.label?y.label:x,description:y.description??"",data:y.data,value:y.value,gridIndex:e,seriesIndex:g,seriesLabel:v,groupIndex:D,groupLabel:S,color:i.get(v),axisX:s(D),axisY:b,axisYFromZero:b-A,visible:y._visible};return d++,C}))}const Kl=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{const a=e.gridList[0]||Wt,o=t.map((d,p)=>({type:"grid",grid:{...e.gridList[p]||a},container:{...e.container}})),u=t.map((d,p)=>({data:d,dataFormatter:o[p],chartParams:n,layout:r})),l=t.map((d,p)=>ni(u[p])),s=new Set(o.map(m=>m.grid.slotIndex)).size!==o.length?br:Xe,f=l.map((d,p)=>s({transposedDataGrid:d,dataFormatter:o[p],chartType:"multiGrid",gridIndex:p})),c=new Map;let h=0;f.flat().forEach((d,p)=>{if(!c.has(d)){const m=Vt(h,n);c.set(d,m),h++}}),i=t.map((d,p)=>Jl({context:u[p],gridIndex:p,transposedDataGrid:l[p],gridSeriesLabels:f[p],SeriesLabelColorMap:c}))}catch(a){throw Error(a)}return i},Zl=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{function a({gridDataFormatter$:u,gridComputedData$:l,layout$:s,fullChartParams$:f,event$:c}){const h=hi({computedData$:l,fullDataFormatter$:u}).pipe($(1)),d=di({computedData$:l,fullDataFormatter$:u,fullChartParams$:f,layout$:s}).pipe($(1)),p=ai({fullDataFormatter$:u,layout$:s}).pipe($(1)),m=oi({gridAxesTransform$:p}).pipe($(1)),g=ui({computedData$:l,fullDataFormatter$:u,layout$:s}).pipe($(1)),y=si({gridContainer$:d,gridAxesTransform$:p,gridGraphicTransform$:g}),D=li({fullDataFormatter$:u,layout$:s}).pipe($(1)),x=l.pipe(M(C=>C.flat())).pipe($(1)),S=Xt({datumList$:x,fullChartParams$:f,event$:c}).pipe($(1)),v=ci({computedData$:l}),P=_e({datumList$:x}).pipe($(1)),b=ln({datumList$:x}).pipe($(1)),A=fi({computedData$:l}).pipe($(1));return{isSeriesPositionSeprate$:h,gridContainer$:d,gridAxesTransform$:p,gridAxesReverseTransform$:m,gridGraphicTransform$:g,gridGraphicReverseScale$:y,gridAxesSize$:D,gridHighlight$:S,existedSeriesLabels$:v,SeriesDataMap$:P,GroupDataMap$:b,visibleComputedData$:A}}const o=new F;return U({fullDataFormatter:t,computedData:e}).pipe(V(async u=>u),M(u=>{o.next(void 0);const l=u.fullDataFormatter.gridList[0]??Wt;return u.computedData.map((s,f)=>{const h={type:"grid",grid:{...u.fullDataFormatter.gridList[f]??l},container:{...u.fullDataFormatter.container}},d=Yt(h).pipe(O(o),$(1)),p=Yt(s).pipe(O(o),$(1));return a({gridDataFormatter$:d,gridComputedData$:p,layout$:n,fullChartParams$:r,event$:i})})}))},Ql=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>U({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(V(async a=>a),M(a=>{const o=a.fullDataFormatter.gridList[0]??Wt;return a.computedData.map((l,s)=>{const f=a.fullDataFormatter.gridList[s]??o;if(!!(f.seriesSlotIndexes&&f.seriesSlotIndexes.length===l.length))return l.map((h,d)=>{const p=f.seriesSlotIndexes[d]%a.fullDataFormatter.container.columnAmount,m=Math.floor(f.seriesSlotIndexes[d]/a.fullDataFormatter.container.columnAmount),{translate:g,scale:y}=zt(a.layout,a.fullDataFormatter.container,m,p);return{slotIndex:f.seriesSlotIndexes[d],rowIndex:m,columnIndex:p,translate:g,scale:y}});{const h=f.slotIndex%a.fullDataFormatter.container.columnAmount,d=Math.floor(f.slotIndex/a.fullDataFormatter.container.columnAmount);return l.map((p,m)=>{const{translate:g,scale:y}=zt(a.layout,a.fullDataFormatter.container,d,h);return{slotIndex:f.slotIndex,rowIndex:d,columnIndex:h,translate:g,scale:y}})}})})),tc=({subject:t,observer:e})=>{const n=Zl({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),r=Ql({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,multiGridEachDetail$:n,multiGridContainer$:r}};class ec extends At{constructor(e,n){super({defaultDataFormatter:bi,computedDataFn:Kl,contextObserverFn:tc},e,n)}}const nc=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a=[];try{const o=e.map((x,S)=>x.map((v,P)=>typeof v=="number"?{id:"",label:"",description:"",data:{},categoryLabel:"",value:v}:{id:v.id??"",label:v.label??"",description:v.description??"",data:v.data??{},categoryLabel:v.categoryLabel??"",value:v.value})),[u,l]=ye(o.map(x=>x[0])),[s,f]=ye(o.map(x=>x[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=ct({maxValue:l,minValue:u,axisWidth:c,scaleDomain:[u,l],scaleRange:[0,1]}),p=ct({maxValue:f,minValue:s,axisWidth:h,scaleDomain:[s,f],scaleRange:[0,1]}),m=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?l:n.xAxis.scaleDomain[1]],g=[n.yAxis.scaleDomain[0]==="auto"?s:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]],y=(x,S,v,P)=>v===0&&x.value!=null&&(x.value<m[0]||x.value>m[1])||v===1&&x.value!=null&&(x.value<g[0]||x.value>g[1])?!1:n.visibleFilter(x,S,v,P);let D=0;a=o.map((x,S)=>x.map((v,P)=>{const b=D;D++;const A=Gt(n.type,S,P),C=y(v,S,P,t);return{id:v.id?v.id:A,index:b,label:v.label?v.label:A,description:v.description??"",data:v.data,value:v.value,categoryIndex:0,categoryLabel:"",axis:P==0?d(v.value):p(v.value),visible:C,color:""}}))}catch(o){throw Error(o)}return a},rc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class ic extends At{constructor(e,n){super({defaultDataFormatter:wi,computedDataFn:nc,contextObserverFn:rc},e,n)}}const ac=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],a=[];try{let o=[],u=[];if(e.nodes)o=e.nodes,u=e.edges;else if(e[0])o=e[0],u=e[1];else return{nodes:[],edges:[]};i=o.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,categoryIndex:0,categoryLabel:"",color:"",startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:n.visibleFilter(c,0,h,t)}));const l=new Map(i.map(c=>[c.id,c]));a=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:l.get(c.start),startNodeId:c.start,endNode:l.get(c.end),endNodeId:c.end,visible:n.visibleFilter(c,1,h,t)}));const s=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(l).forEach(([c,h])=>{h.startNodes=s.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id)})}catch(o){throw Error(o)}return{nodes:i,edges:a}},oc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class uc extends At{constructor(e,n){super({defaultDataFormatter:_i,computedDataFn:ac,contextObserverFn:oc},e,n)}}const sc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=new Map(n.categoryLabels.map((o,u)=>[o,u]));let a={id:"",index:0,label:"",description:"",categoryIndex:0,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(q(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const f=new Map;e.forEach(h=>{if(!h.parent)s=h;else{const d=f.get(h.parent)??[];d.push(h),f.set(h.parent,d)}});const c=h=>({id:h.id,label:h.label,data:h.data,value:h.value,categoryLabel:h.categoryLabel,children:(f.get(h.id)??[]).map(d=>c(d))});return s?c(s):{id:""}}();let u=0;const l=(s,f,c)=>{const h=f+1,d=n.visibleFilter(s,f,c,t),p=s.categoryLabel??null;let m=0;p!=null&&(i.has(p)||i.set(p,i.size),m=i.get(p)??0);const g=u;return u++,{id:s.id,index:g,level:f,seq:c,label:s.label??"",description:s.description??"",categoryIndex:m,categoryLabel:p,color:Vt(m,r),data:s.data??{},value:s.value,visible:d,children:(s.children??[]).map((y,D)=>l(y,h,D))}};a=l(o,0,0)}catch(o){throw Error(o)}return a},lc=({computedData$:t})=>t.pipe(M(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),cc=({nodeList$:t,fullDataFormatter$:e})=>{const n=e.pipe(M(r=>r.categoryLabels),St((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length));return U({nodeList:t,categoryLabels:n}).pipe(V(async r=>r),M(r=>{const i=new Set(r.categoryLabels),a=new Set(r.nodeList.filter(o=>o.visible).map(o=>o.categoryLabel));return Array.from(a).forEach(o=>{i.has(o)||i.add(o)}),Array.from(i).forEach(o=>{a.has(o)||a.delete(o)}),Array.from(i)}),St((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length))},fc=({computedData$:t})=>t.pipe(M(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)})),hc=({subject:t,observer:e})=>{const n=lc({computedData$:e.computedData$}).pipe($(1)),r=Xt({datumList$:n,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),i=cc({nodeList$:n,fullDataFormatter$:e.fullDataFormatter$}).pipe($(1)),a=ti({datumList$:n}).pipe($(1)),o=fc({computedData$:e.computedData$}).pipe($(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,treeHighlight$:r,existCategoryLabels$:i,CategoryDataMap$:a,visibleComputedData$:o}};class dc extends At{constructor(e,n){super({defaultDataFormatter:xi,computedDataFn:sc,contextObserverFn:hc},e,n)}}function pc({name:t,defaultParams:e,initFn:n}){const r=new F,i=new F,a=new WeakMap;let o=()=>{},u,l=e;return{params$:i,name:t,defaultParams:e,init(){u&&(o=n(u)??(()=>{}),a.set(u.selection,u))},destroy(){o(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:s=>{l=nt(s,e)},setContext:s=>{u=s,u.observer.fullParams$=i.pipe(O(r),xe({}),M(f=>nt(f,l)),$(1))}}}const ft=()=>function(e,n){return function(i){return class{constructor(){const o=pc({name:e,defaultParams:n,initFn:i});this.params$=o.params$,this.name=o.name,this.defaultParams=o.defaultParams,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},mc=ft(),gc=ft(),yc=ft(),vc=ft(),bc=ft(),wc=ft(),xc=ft();_.GridChart=jl,_.MultiGridChart=ec,_.MultiValueChart=ic,_.RelationshipChart=uc,_.SeriesChart=Wl,_.TreeChart=dc,_.calcGridContainerPosition=zt,_.categoryDataMapObservable=ti,_.createAxisLinearScale=ct,_.createAxisPointScale=zl,_.createAxisQuantizeScale=Ul,_.createDefaultDatumId=Gt,_.createDefaultGroupLabel=Ye,_.createDefaultSeriesLabel=ge,_.createGridGroupLabels=wr,_.createGridSeriesLabels=Xe,_.createMultiGridGroupLabels=xr,_.createMultiGridSeriesLabels=br,_.defineGridPlugin=gc,_.defineMultiGridPlugin=yc,_.defineMultiValuePlugin=vc,_.defineNoneDataPlugin=bc,_.defineRelationshipPlugin=wc,_.defineSeriesPlugin=mc,_.defineTreePlugin=xc,_.formatCommaNumber=Ds,_.formatValueToLabel=Ss,_.getMinAndMax=bt,_.getMinAndMaxGrid=We,_.getMinAndMaxMultiGrid=Ms,_.getMinAndMaxMultiValue=Cs,_.getMinAndMaxSeries=As,_.getMinAndMaxValue=ye,_.groupDataMapObservable=ln,_.highlightObservable=Xt,_.isFunction=$s,_.isPlainObject=q,_.mergeOptionsWithDefault=nt,_.seriesColorPredicate=Vt,_.seriesDataMapObservable=_e,_.transposeData=_r,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function ve(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Ut=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=wt(o),l=u.next();!l.done;l=u.next()){var s=l.value;s.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(T(f))try{f()}catch(m){a=m instanceof je?m.errors:[m]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=wt(c),d=h.next();!d.done;d=h.next()){var p=d.value;try{Ar(p)}catch(m){a=a??[],m instanceof je?a=it(it([],rt(a)),rt(m.errors)):a.push(m)}}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new je(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Ar(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&ve(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ve(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Dr=Ut.EMPTY;function Sr(t){return t instanceof Ut||t&&"closed"in t&&T(t.remove)&&T(t.add)&&T(t.unsubscribe)}function Ar(t){T(t)?t():t.unsubscribe()}var Mr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Cr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,it([t,e],rt(n)))},clearTimeout:function(t){var e=Cr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Pr(t){Cr.setTimeout(function(){throw t})}function Je(){}function be(t){t()}var Ke=function(t){Z(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Sr(n)&&n.add(r)):r.destination=ks,r}return e.create=function(n,r,i){return new Ht(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ut),Is=Function.prototype.bind;function Ze(t,e){return Is.call(t,e)}var Os=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){we(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){we(r)}else we(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){we(n)}},t}(),Ht=function(t){Z(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(T(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Mr.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&Ze(n.next,u),error:n.error&&Ze(n.error,u),complete:n.complete&&Ze(n.complete,u)}):o=n}return a.destination=new Os(o),a}return e}(Ke);function we(t){Pr(t)}function Ns(t){throw t}var ks={closed:!0,next:Je,error:Ns,complete:Je},Qe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function _t(t){return t}function Rs(t){return t.length===0?_t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var E=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,a=Vs(e)?e:new Ht(e,n,r);return be(function(){var o=i,u=o.operator,l=o.source;a.add(u?u.call(a,l):l?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Er(n),new n(function(i,a){var o=new Ht({next:function(u){try{e(u)}catch(l){a(l),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Qe]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Rs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Er(e),new e(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},t.create=function(e){return new t(e)},t}();function Er(t){var e;return(e=t??Mr.Promise)!==null&&e!==void 0?e:Promise}function Gs(t){return t&&T(t.next)&&T(t.error)&&T(t.complete)}function Vs(t){return t&&t instanceof Ke||Gs(t)&&Sr(t)}function zs(t){return T(t==null?void 0:t.lift)}function L(t){return function(e){if(zs(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function I(t,e,n,r,i){return new Us(t,e,n,r,i)}var Us=function(t){Z(e,t);function e(n,r,i,a,o,u){var l=t.call(this,n)||this;return l.onFinalize=o,l.shouldUnsubscribe=u,l._next=r?function(s){try{r(s)}catch(f){n.error(f)}}:t.prototype._next,l._error=a?function(s){try{a(s)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(s){n.error(s)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Ke),Hs=qe(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),F=function(t){Z(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Fr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Hs},e.prototype.next=function(n){var r=this;be(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=wt(r.currentObservers),u=o.next();!u.done;u=o.next()){var l=u.value;l.next(n)}}catch(s){i={error:s}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;be(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;be(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,a=i.hasError,o=i.isStopped,u=i.observers;return a||o?Dr:(this.currentObservers=null,u.push(n),new Ut(function(){r.currentObservers=null,ve(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r.thrownError,o=r.isStopped;i?n.error(a):o&&n.complete()},e.prototype.asObservable=function(){var n=new E;return n.source=this,n},e.create=function(n,r){return new Fr(n,r)},e}(E),Fr=function(t){Z(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Dr},e}(F),tn={now:function(){return(tn.delegate||Date).now()},delegate:void 0},Ys=function(t){Z(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=tn);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,l=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+l)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),l=0;l<u.length&&!n.closed;l+=a?1:2)n.next(u[l]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var l=i.now(),s=0,f=1;f<a.length&&a[f]<=l;f+=2)s=f;s&&a.splice(0,s+1)}},e}(F),Xs=function(t){Z(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Ut),en={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,it([t,e],rt(n)))},clearInterval:function(t){var e=en.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Ws=function(t){Z(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),en.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&en.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,a;try{this.work(n)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ve(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Xs),Tr=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=tn.now,t}(),Bs=function(t){Z(e,t);function e(n,r){r===void 0&&(r=Tr.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Tr),nn=new Bs(Ws),qs=nn,rn=new E(function(t){return t.complete()});function Lr(t){return t&&T(t.schedule)}function an(t){return t[t.length-1]}function js(t){return T(an(t))?t.pop():void 0}function $t(t){return Lr(an(t))?t.pop():void 0}function Ir(t,e){return typeof an(t)=="number"?t.pop():e}var Or=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Nr(t){return T(t==null?void 0:t.then)}function kr(t){return T(t[Qe])}function Rr(t){return Symbol.asyncIterator&&T(t==null?void 0:t[Symbol.asyncIterator])}function Gr(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Js(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Vr=Js();function zr(t){return T(t==null?void 0:t[Vr])}function Ur(t){return Ts(this,arguments,function(){var n,r,i,a;return $r(this,function(o){switch(o.label){case 0:n=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,xt(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,xt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,xt(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Hr(t){return T(t==null?void 0:t.getReader)}function G(t){if(t instanceof E)return t;if(t!=null){if(kr(t))return Ks(t);if(Or(t))return Zs(t);if(Nr(t))return Qs(t);if(Rr(t))return Yr(t);if(zr(t))return tl(t);if(Hr(t))return el(t)}throw Gr(t)}function Ks(t){return new E(function(e){var n=t[Qe]();if(T(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Zs(t){return new E(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Qs(t){return new E(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Pr)})}function tl(t){return new E(function(e){var n,r;try{for(var i=wt(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Yr(t){return new E(function(e){nl(t,e).catch(function(n){return e.error(n)})})}function el(t){return Yr(Ur(t))}function nl(t,e){var n,r,i,a;return Fs(this,void 0,void 0,function(){var o,u;return $r(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=Ls(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),i={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function at(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(a),!i)return a}function Xr(t,e){return e===void 0&&(e=0),L(function(n,r){n.subscribe(I(r,function(i){return at(r,t,function(){return r.next(i)},e)},function(){return at(r,t,function(){return r.complete()},e)},function(i){return at(r,t,function(){return r.error(i)},e)}))})}function Wr(t,e){return e===void 0&&(e=0),L(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function rl(t,e){return G(t).pipe(Wr(e),Xr(e))}function il(t,e){return G(t).pipe(Wr(e),Xr(e))}function al(t,e){return new E(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function ol(t,e){return new E(function(n){var r;return at(n,e,function(){r=t[Vr](),at(n,e,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(u){n.error(u);return}o?n.complete():n.next(a)},0,!0)}),function(){return T(r==null?void 0:r.return)&&r.return()}})}function Br(t,e){if(!t)throw new Error("Iterable cannot be null");return new E(function(n){at(n,e,function(){var r=t[Symbol.asyncIterator]();at(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function ul(t,e){return Br(Ur(t),e)}function sl(t,e){if(t!=null){if(kr(t))return rl(t,e);if(Or(t))return al(t,e);if(Nr(t))return il(t,e);if(Rr(t))return Br(t,e);if(zr(t))return ol(t,e);if(Hr(t))return ul(t,e)}throw Gr(t)}function Dt(t,e){return e?sl(t,e):G(t)}function Yt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return Dt(t,n)}var qr=qe(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function ll(t){return t instanceof Date&&!isNaN(t)}function M(t,e){return L(function(n,r){var i=0;n.subscribe(I(r,function(a){r.next(t.call(e,a,i++))}))})}var cl=Array.isArray;function fl(t,e){return cl(e)?t.apply(void 0,it([],rt(e))):t(e)}function hl(t){return M(function(e){return fl(t,e)})}var dl=Array.isArray,pl=Object.getPrototypeOf,ml=Object.prototype,gl=Object.keys;function yl(t){if(t.length===1){var e=t[0];if(dl(e))return{args:e,keys:null};if(vl(e)){var n=gl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function vl(t){return t&&typeof t=="object"&&pl(t)===ml}function bl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function U(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=js(t),i=yl(t),a=i.args,o=i.keys;if(a.length===0)return Dt([],n);var u=new E(wl(a,n,o?function(l){return bl(o,l)}:_t));return r?u.pipe(hl(r)):u}function wl(t,e,n){return n===void 0&&(n=_t),function(r){jr(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,l=function(f){jr(e,function(){var c=Dt(t[f],e),h=!1;c.subscribe(I(r,function(d){a[f]=d,h||(h=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},s=0;s<i;s++)l(s)},r)}}function jr(t,e,n){t?at(n,t,e):e()}function xl(t,e,n,r,i,a,o,u){var l=[],s=0,f=0,c=!1,h=function(){c&&!l.length&&!s&&e.complete()},d=function(m){return s<r?p(m):l.push(m)},p=function(m){s++;var g=!1;G(n(m,f++)).subscribe(I(e,function(y){e.next(y)},function(){g=!0},void 0,function(){if(g)try{s--;for(var y=function(){var D=l.shift();o||p(D)};l.length&&s<r;)y();h()}catch(D){e.error(D)}}))};return t.subscribe(I(e,d,function(){c=!0,h()})),function(){}}function Jr(t,e,n){return n===void 0&&(n=1/0),T(e)?Jr(function(r,i){return M(function(a,o){return e(r,a,i,o)})(G(t(r,i)))},n):(typeof e=="number"&&(n=e),L(function(r,i){return xl(r,i,t,n)}))}function on(t){return t===void 0&&(t=1/0),Jr(_t,t)}function _l(){return on(1)}function Kr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return _l()(Dt(t,$t(t)))}function $l(t){return new E(function(e){G(t()).subscribe(e)})}function Dl(t,e,n){return $l(function(){return t()?e:n})}function Sl(t,e,n){n===void 0&&(n=qs);var r=-1;return e!=null&&(Lr(e)?n=e:r=e),new E(function(i){var a=ll(t)?+t-n.now():t;a<0&&(a=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},a)})}function Al(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Ir(t,1/0),i=t;return i.length?i.length===1?G(i[0]):on(r)(Dt(i,n)):rn}var Ml=Array.isArray;function Cl(t){return t.length===1&&Ml(t[0])?t[0]:t}function Zr(t,e){return L(function(n,r){var i=0;n.subscribe(I(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function Qr(t){return L(function(e,n){var r=null,i=!1,a;r=e.subscribe(I(n,void 0,void 0,function(o){a=G(t(o,Qr(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Pl(t,e){return e===void 0&&(e=nn),L(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var s=a;a=null,r.next(s)}};function l(){var s=o+t,f=e.now();if(f<s){i=this.schedule(void 0,s-f),r.add(i);return}u()}n.subscribe(I(r,function(s){a=s,o=e.now(),i||(i=e.schedule(l,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function El(t){return L(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function Fl(t){return t<=0?function(){return rn}:L(function(e,n){var r=0;e.subscribe(I(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function St(t,e){return e===void 0&&(e=_t),t=t??Tl,L(function(n,r){var i,a=!0;n.subscribe(I(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function Tl(t,e){return t===e}function Ll(t){return t===void 0&&(t=Il),L(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function Il(){return new qr}function Ol(t,e){var n=arguments.length>=2;return function(r){return r.pipe(_t,Fl(1),n?El(e):Ll(function(){return new qr}))}}function Nl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t),r=Ir(t,1/0);return t=Cl(t),L(function(i,a){on(r)(Dt(it([i],rt(t)),n)).subscribe(a)})}function kl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Nl.apply(void 0,it([],rt(t)))}function un(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new F}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,l=u===void 0?!0:u;return function(s){var f,c,h,d=0,p=!1,m=!1,g=function(){c==null||c.unsubscribe(),c=void 0},y=function(){g(),f=h=void 0,p=m=!1},D=function(){var x=f;y(),x==null||x.unsubscribe()};return L(function(x,S){d++,!m&&!p&&g();var v=h=h??n();S.add(function(){d--,d===0&&!m&&!p&&(c=sn(D,l))}),v.subscribe(S),!f&&d>0&&(f=new Ht({next:function(P){return v.next(P)},error:function(P){m=!0,g(),c=sn(y,i,P),v.error(P)},complete:function(){p=!0,g(),c=sn(y,o),v.complete()}}),G(x).subscribe(f))})(s)}}function sn(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Ht({next:function(){i.unsubscribe(),t()}});return G(e.apply(void 0,it([],rt(n)))).subscribe(i)}}function $(t,e,n){var r,i=!1;return r=t,un({connector:function(){return new Ys(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function xe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=$t(t);return L(function(r,i){(n?Kr(t,r,n):Kr(t,r)).subscribe(i)})}function V(t,e){return L(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(I(r,function(l){i==null||i.unsubscribe();var s=0,f=a++;G(t(l,f)).subscribe(i=I(r,function(c){return r.next(e?e(l,c,f,s++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function O(t){return L(function(e,n){G(t).subscribe(I(n,function(){return n.complete()},Je)),!n.closed&&e.subscribe(n)})}function Rl(t,e){return L(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,l=u===void 0?!1:u,s=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,l&&(g(),h&&r.complete())},p=function(){c=null,h&&r.complete()},m=function(y){return c=G(t(y)).subscribe(I(r,d,p))},g=function(){if(s){s=!1;var y=f;f=null,r.next(y),!h&&m(y)}};n.subscribe(I(r,function(y){s=!0,f=y,!(c&&!c.closed)&&(o?g():m(y))},function(){h=!0,!(l&&s&&c&&!c.closed)&&r.complete()}))})}function Gl(t,e,n){e===void 0&&(e=nn);var r=Sl(t,e);return Rl(function(){return r},n)}const Xt=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new F,i=e.pipe(O(r),M(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),St()),a=n.pipe(O(r),Zr(c=>c.eventName==="mouseover"||c.eventName==="mousemove"),M(c=>c.datum?{id:c.datum.id,seriesLabel:c.datum.seriesLabel,groupLabel:c.datum.groupLabel,categoryLabel:c.datum.categoryLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null})),o=n.pipe(O(r),Zr(c=>c.eventName==="mouseout"),V(c=>i));function u(c,h){return h==null?[]:c.find(d=>d.id===h)?[h]:[]}function l(c,h){return h==null?[]:c.filter(d=>d.seriesLabel===h).map(d=>d.id)}function s(c,h){return h==null?[]:c.filter(d=>d.groupLabel===h).map(d=>d.id)}function f(c,h){return h==null?[]:c.filter(d=>d.categoryLabel===h).map(d=>d.id)}return new E(c=>(U({target:Al(a,o,i),datumList:t,fullChartParams:e}).pipe(O(r),V(async h=>h)).subscribe(h=>{console.log("data.fullChartParams.highlightTarget",h.fullChartParams.highlightTarget);let d=[];h.fullChartParams.highlightTarget==="datum"?d=u(h.datumList,h.target.id):h.fullChartParams.highlightTarget==="series"?d=l(h.datumList,h.target.seriesLabel):h.fullChartParams.highlightTarget==="group"?d=s(h.datumList,h.target.groupLabel):h.fullChartParams.highlightTarget==="category"&&(d=f(h.datumList,h.target.categoryLabel)),console.log("ids",d),c.next(d)}),function(){r.next(void 0)}))},_e=({datumList$:t})=>t.pipe(M(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),ln=({datumList$:t})=>t.pipe(M(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),ti=({datumList$:t})=>t.pipe(M(e=>{const n=new Map;return e.filter(r=>r.categoryLabel!=null).forEach(r=>{const i=n.get(r.categoryLabel)??[];i.push(r),n.set(r.categoryLabel,i)}),n})),Vl=({subject:t,observer:e})=>{const n=Xt({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),r=_e({datumList$:e.computedData$}).pipe($(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},ct=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const a=r[0]??j.scaleDomain[0],o=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],l=i[1]??j.scaleRange[1],s=a==="auto"?e:a,f=o==="auto"?t:o,c=t-(t-s)/(1-u),h=f/l;return yr().domain([c,h]).range([0,n])},zl=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ds().domain(t).range(r).padding(n)},Ul=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let a=t.map((o,u)=>u);return r&&a.reverse(),vr().domain([-0,e+0]).range(a)},Hl={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Yl(t){return new E(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}function ei(t,e,n){const r=nt(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return nt(i,o)})),r}const Xl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new F,i=t.type;return function(o,u){Zt(o).selectAll("svg").remove();const l=Zt(o).append("svg");l.attr("xmlns:xlink","http://www.w3.org/1999/xlink").attr("xmls","http://www.w3.org/2000/svg").attr("version","1.1").style("position","absolute").classed("orbcharts__root",!0);const s=l.append("g");s.classed("orbcharts__layout",!0);const f=s.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new F,dataFormatter$:new F,plugins$:new F,chartParams$:new F,event$:new F},h=(b=>{const A=b||Pt,C=A.preset?A.preset:{};return{chartParams:C.chartParams?nt(C.chartParams,fn):fn,dataFormatter:C.dataFormatter?ei(C.dataFormatter,t,i):t,allPluginParams:C.allPluginParams?C.allPluginParams:{},description:C.description??""}})(u),d=c.data$.pipe($(1)),p=c.dataFormatter$.pipe(O(r),xe({}),M(b=>ei(b,h.dataFormatter,i)),$(1)),m=c.chartParams$.pipe(O(r),xe({}),M(b=>nt(b,h.chartParams)),$(1)),g=m.pipe(O(r),xe({}),M(b=>nt(b.padding??{},cn)));g.pipe(O(r),Ol()).subscribe(b=>{s.attr("transform",`translate(${b.left}, ${b.top})`)}),g.subscribe(b=>{s.transition().attr("transform",`translate(${b.left}, ${b.top})`)});const y=Yl(o).pipe(O(r),un()),D=Yt().pipe(kl(y.pipe(Pl(250)),y.pipe(Gl(250))),St((b,A)=>JSON.stringify(b)===JSON.stringify(A)),un()),x=D.subscribe(),S=U({rootSize:D,mergedPadding:g}).pipe(O(r),V(async b=>{const A=b.rootSize.width>0?b.rootSize.width:pi,C=b.rootSize.height>0?b.rootSize.height:mi;return{width:A-b.mergedPadding.left-b.mergedPadding.right,height:C-b.mergedPadding.top-b.mergedPadding.bottom,top:b.mergedPadding.top,right:b.mergedPadding.right,bottom:b.mergedPadding.bottom,left:b.mergedPadding.left,rootWidth:A,rootHeight:C}}),$(1));S.subscribe(b=>{l.attr("width",b.rootWidth).attr("height",b.rootHeight)});const v=U({data:d,dataFormatter:p,chartParams:m,layout:Dl(()=>Hl[i]===!0,S,Yt(void 0))}).pipe(O(r),V(async b=>b),V(b=>Yt(b).pipe(M(A=>{try{return e({data:A.data,dataFormatter:A.dataFormatter,chartParams:A.chartParams,layout:A.layout})}catch(C){throw console.error(C),new Error(C)}}),Qr(()=>rn))),$(1));v.subscribe();const P={};return c.plugins$.subscribe(b=>{if(!b)return;const A=f.selectAll("g.orbcharts__plugin").data(b,w=>w.name),C=A.enter().append("g").attr("class",w=>`orbcharts__plugin orbcharts__${w.name}`);A.exit().remove().each((w,z,N)=>{P[w.name]&&P[w.name].destroy()}),C.each((w,z,N)=>{const Q={fullParams$:new E,fullChartParams$:m,fullDataFormatter$:p,computedData$:v,layout$:S},Mt=n({observer:Q,subject:c}),tt={selection:Zt(N[z]),rootSelection:l,name:w.name,chartType:i,subject:c,observer:Mt};w.setPresetParams(h.allPluginParams[w.name]??{}),w.setContext(tt),P[tt.name]=w,w.init()})}),{...c,selection:l,destroy(){Zt(o).selectAll("svg").remove(),r.next(void 0),x.unsubscribe()}}}};class At{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new F,this.dataFormatter$=new F,this.plugins$=new F,this.chartParams$=new F,this.event$=new F;const u=Xl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,a);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}}class Wl extends At{constructor(e,n){super({defaultDataFormatter:yi,computedDataFn:Es,contextObserverFn:Vl},e,n)}}function ni(t){const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];try{const a=e.reduce((s,f)=>f.length>s?f.length:s,0),u=e.map((s,f)=>{if(s.length===a)return s;const c=Object.assign([],s);for(let h=c.length;h<a;h++)c[h]=null;return c}).map((s,f)=>s.map((c,h)=>{const d=n.grid.visibleFilter(c,f,h,t);return c==null?{id:"",label:"",data:{},value:null,_visible:d}:typeof c=="number"?{id:"",label:"",data:{},value:c,_visible:d}:{id:c.id??"",label:c.label??"",data:c.data??{},value:c.value,_visible:d}}));return _r(n.grid.gridData.seriesDirection,u)}catch{return[]}}function ri(t,e,n){const r=e.grid.groupAxis.position==="top"||e.grid.groupAxis.position==="bottom"?n.width:n.height,i=t[0]?t[0].length-1:0;return ct({maxValue:i,minValue:0,axisWidth:r,scaleDomain:[0,i],scaleRange:[0,1]})}function ii(t,e,n){const r=e.grid.valueAxis.position==="left"||e.grid.valueAxis.position==="right"?n.height:n.width,i=t.flat().filter(u=>u._visible!=!1),[a,o]=ye(i);return t.map((u,l)=>ct({maxValue:o,minValue:a,axisWidth:r,scaleDomain:[a,o],scaleRange:[0,1]}))}const Bl=t=>{const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a;try{const o=ni(t),u=ri(o,n,i),l=Xe({transposedDataGrid:o,dataFormatter:n,chartType:"grid"}),s=wr({transposedDataGrid:o,dataFormatter:n,chartType:"grid"}),f=ii(o,n,i),c=o.map((d,p)=>f[p](0));let h=0;a=o.map((d,p)=>d.map((m,g)=>{const y=Gt("grid",0,p,g),D=s[g],x=f[p],S=x(m.value??0),v=c[p],P={id:m.id?m.id:y,index:h,label:m.label?m.label:y,description:m.description??"",data:m.data,value:m.value,gridIndex:0,seriesIndex:p,seriesLabel:l[p],groupIndex:g,groupLabel:D,color:Vt(p,r),axisX:u(g),axisY:S,axisYFromZero:S-v,visible:m._visible};return h++,P}))}catch(o){throw Error(o)}return a},ai=({fullDataFormatter$:t,layout$:e})=>{const n=new F;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let l=0,s=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,s=u):a.position==="right"?(c=180,h=180,l=o,s=u):(c=180,s=u):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,l=o):(c=180,s=u)):i.position==="left"?a.position==="bottom"?(f=-90,s=u):a.position==="top"?(f=-90,h=180):(c=180,s=u):i.position==="right"&&(a.position==="bottom"?(f=-90,c=180,s=u,l=o):a.position==="top"?(f=-90,c=180,h=180,l=o):(c=180,s=u)),{translate:[l,s],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${l}px, ${s}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new E(i=>(U({fullDataFormatter:t,layout:e}).pipe(O(n),V(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.grid.groupAxis,yAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},oi=({gridAxesTransform$:t})=>t.pipe(M(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,a=e.rotateX*-1,o=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:a,rotateY:o,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${a}deg) rotateY(${o}deg)`}})),ui=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new F;function i({data:a,groupAxis:o,valueAxis:u,width:l,height:s}){let f=0,c=0,h=0,d=0;const p=o.position==="top"||o.position==="bottom"?l:s,m=0,g=a[0]?a[0].length-1:0,y=o.scaleDomain[0]==="auto"?m-o.scalePadding:o.scaleDomain[0]-o.scalePadding,D=o.scaleDomain[1]==="auto"?g+o.scalePadding:o.scaleDomain[1]+o.scalePadding,x=ct({maxValue:g,minValue:m,axisWidth:p,scaleDomain:[y,D],scaleRange:[0,1]}),S=x(m),v=x(g);f=S,h=(v-S)/p;const b=a.map((Mt,Ct)=>Mt.filter((tt,dt)=>dt>=y&&dt<=D&&tt.visible==!0)),A=We(b),C=u.position==="left"||u.position==="right"?s:l,ht=ct({maxValue:A[1],minValue:A[0],axisWidth:C,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),w=We(a),z=ht(w[0]),N=ht(w[1]);return c=z,d=(N-z)/C,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new E(a=>(U({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(r),V(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},si=({gridContainer$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>U({gridContainer:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(V(async r=>r),M(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[1]]):r.gridContainer.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainer[a].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainer[a].scale[0]]))),li=({fullDataFormatter$:t,layout$:e})=>{const n=new F;function r({xAxisPosition:i,yAxisPosition:a,width:o,height:u}){if((i==="bottom"||i==="top")&&(a==="left"||a==="right"))return{width:o,height:u};if((i==="left"||i==="right")&&(a==="bottom"||a==="top"))return{width:u,height:o}}return new E(i=>{U({fullDataFormatter:t,layout:e}).pipe(O(n),V(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.grid.groupAxis.position,yAxisPosition:a.fullDataFormatter.grid.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},ci=({computedData$:t})=>t.pipe(M(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),St((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),fi=({computedData$:t})=>t.pipe(M(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),hi=({computedData$:t,fullDataFormatter$:e})=>U({computedData:t,fullDataFormatter:e}).pipe(M(n=>!!(n.fullDataFormatter.grid.seriesSlotIndexes&&n.fullDataFormatter.grid.seriesSlotIndexes.length===n.computedData.length)),St()),di=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>U({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(V(async a=>a),M(a=>{const o=a.fullDataFormatter.grid;if(!!(o.seriesSlotIndexes&&o.seriesSlotIndexes.length===a.computedData.length))return a.computedData.map((l,s)=>{const f=o.seriesSlotIndexes[s]%a.fullDataFormatter.container.columnAmount,c=Math.floor(o.seriesSlotIndexes[s]/a.fullDataFormatter.container.columnAmount),{translate:h,scale:d}=zt(a.layout,a.fullDataFormatter.container,c,f);return{slotIndex:o.seriesSlotIndexes[s],rowIndex:c,columnIndex:f,translate:h,scale:d}});{const l=o.slotIndex%a.fullDataFormatter.container.columnAmount,s=Math.floor(o.slotIndex/a.fullDataFormatter.container.columnAmount);return a.computedData.map((f,c)=>{const{translate:h,scale:d}=zt(a.layout,a.fullDataFormatter.container,s,l);return{slotIndex:o.slotIndex,rowIndex:s,columnIndex:l,translate:h,scale:d}})}})),ql=({subject:t,observer:e})=>{const n=hi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe($(1)),r=di({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$}),i=ai({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe($(1)),a=oi({gridAxesTransform$:i}).pipe($(1)),o=ui({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe($(1)),u=si({gridContainer$:r,gridAxesTransform$:i,gridGraphicTransform$:o}),l=li({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe($(1)),s=e.computedData$.pipe(M(m=>m.flat())).pipe($(1)),f=Xt({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),c=ci({computedData$:e.computedData$}),h=_e({datumList$:s}).pipe($(1)),d=ln({datumList$:s}).pipe($(1)),p=fi({computedData$:e.computedData$}).pipe($(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,isSeriesPositionSeprate$:n,gridContainer$:r,gridAxesTransform$:i,gridAxesReverseTransform$:a,gridGraphicTransform$:o,gridGraphicReverseScale$:u,gridAxesSize$:l,gridHighlight$:f,existSeriesLabels$:c,SeriesDataMap$:h,GroupDataMap$:d,visibleComputedData$:p}};class jl extends At{constructor(e,n){super({defaultDataFormatter:vi,computedDataFn:Bl,contextObserverFn:ql},e,n)}}function Jl({context:t,gridIndex:e,transposedDataGrid:n,gridSeriesLabels:r,SeriesLabelColorMap:i}){const{data:a=[],dataFormatter:o,chartParams:u,layout:l}=t;if(!a.length)return[];const s=ri(n,o,l),f=xr({transposedDataGrid:n,dataFormatter:o,chartType:"multiGrid",gridIndex:e}),c=ii(n,o,l),h=n.map((m,g)=>c[g](0));let d=0;return n.map((m,g)=>m.map((y,D)=>{const x=Gt("multiGrid",e,g,D),S=f[D],v=r[g],P=c[g],b=P(y.value??0),A=h[g],C={id:y.id?y.id:x,index:d,label:y.label?y.label:x,description:y.description??"",data:y.data,value:y.value,gridIndex:e,seriesIndex:g,seriesLabel:v,groupIndex:D,groupLabel:S,color:i.get(v),axisX:s(D),axisY:b,axisYFromZero:b-A,visible:y._visible};return d++,C}))}const Kl=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{const a=e.gridList[0]||Wt,o=t.map((d,p)=>({type:"grid",grid:{...e.gridList[p]||a},container:{...e.container}})),u=t.map((d,p)=>({data:d,dataFormatter:o[p],chartParams:n,layout:r})),l=t.map((d,p)=>ni(u[p])),s=new Set(o.map(m=>m.grid.slotIndex)).size!==o.length?br:Xe,f=l.map((d,p)=>s({transposedDataGrid:d,dataFormatter:o[p],chartType:"multiGrid",gridIndex:p})),c=new Map;let h=0;f.flat().forEach((d,p)=>{if(!c.has(d)){const m=Vt(h,n);c.set(d,m),h++}}),i=t.map((d,p)=>Jl({context:u[p],gridIndex:p,transposedDataGrid:l[p],gridSeriesLabels:f[p],SeriesLabelColorMap:c}))}catch(a){throw Error(a)}return i},Zl=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{function a({gridDataFormatter$:u,gridComputedData$:l,layout$:s,fullChartParams$:f,event$:c}){const h=hi({computedData$:l,fullDataFormatter$:u}).pipe($(1)),d=di({computedData$:l,fullDataFormatter$:u,fullChartParams$:f,layout$:s}).pipe($(1)),p=ai({fullDataFormatter$:u,layout$:s}).pipe($(1)),m=oi({gridAxesTransform$:p}).pipe($(1)),g=ui({computedData$:l,fullDataFormatter$:u,layout$:s}).pipe($(1)),y=si({gridContainer$:d,gridAxesTransform$:p,gridGraphicTransform$:g}),D=li({fullDataFormatter$:u,layout$:s}).pipe($(1)),x=l.pipe(M(C=>C.flat())).pipe($(1)),S=Xt({datumList$:x,fullChartParams$:f,event$:c}).pipe($(1)),v=ci({computedData$:l}),P=_e({datumList$:x}).pipe($(1)),b=ln({datumList$:x}).pipe($(1)),A=fi({computedData$:l}).pipe($(1));return{isSeriesPositionSeprate$:h,gridContainer$:d,gridAxesTransform$:p,gridAxesReverseTransform$:m,gridGraphicTransform$:g,gridGraphicReverseScale$:y,gridAxesSize$:D,gridHighlight$:S,existSeriesLabels$:v,SeriesDataMap$:P,GroupDataMap$:b,visibleComputedData$:A}}const o=new F;return U({fullDataFormatter:t,computedData:e}).pipe(V(async u=>u),M(u=>{o.next(void 0);const l=u.fullDataFormatter.gridList[0]??Wt;return u.computedData.map((s,f)=>{const h={type:"grid",grid:{...u.fullDataFormatter.gridList[f]??l},container:{...u.fullDataFormatter.container}},d=Yt(h).pipe(O(o),$(1)),p=Yt(s).pipe(O(o),$(1));return a({gridDataFormatter$:d,gridComputedData$:p,layout$:n,fullChartParams$:r,event$:i})})}))},Ql=({computedData$:t,fullDataFormatter$:e,fullChartParams$:n,layout$:r})=>U({computedData:t,fullDataFormatter:e,fullChartParams:n,layout:r}).pipe(V(async a=>a),M(a=>{const o=a.fullDataFormatter.gridList[0]??Wt;return a.computedData.map((l,s)=>{const f=a.fullDataFormatter.gridList[s]??o;if(!!(f.seriesSlotIndexes&&f.seriesSlotIndexes.length===l.length))return l.map((h,d)=>{const p=f.seriesSlotIndexes[d]%a.fullDataFormatter.container.columnAmount,m=Math.floor(f.seriesSlotIndexes[d]/a.fullDataFormatter.container.columnAmount),{translate:g,scale:y}=zt(a.layout,a.fullDataFormatter.container,m,p);return{slotIndex:f.seriesSlotIndexes[d],rowIndex:m,columnIndex:p,translate:g,scale:y}});{const h=f.slotIndex%a.fullDataFormatter.container.columnAmount,d=Math.floor(f.slotIndex/a.fullDataFormatter.container.columnAmount);return l.map((p,m)=>{const{translate:g,scale:y}=zt(a.layout,a.fullDataFormatter.container,d,h);return{slotIndex:f.slotIndex,rowIndex:d,columnIndex:h,translate:g,scale:y}})}})})),tc=({subject:t,observer:e})=>{const n=Zl({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),r=Ql({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,fullChartParams$:e.fullChartParams$,layout$:e.layout$});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,multiGridEachDetail$:n,multiGridContainer$:r}};class ec extends At{constructor(e,n){super({defaultDataFormatter:bi,computedDataFn:Kl,contextObserverFn:tc},e,n)}}const nc=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a=[];try{const o=e.map((x,S)=>x.map((v,P)=>typeof v=="number"?{id:"",label:"",description:"",data:{},categoryLabel:"",value:v}:{id:v.id??"",label:v.label??"",description:v.description??"",data:v.data??{},categoryLabel:v.categoryLabel??"",value:v.value})),[u,l]=ye(o.map(x=>x[0])),[s,f]=ye(o.map(x=>x[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=ct({maxValue:l,minValue:u,axisWidth:c,scaleDomain:[u,l],scaleRange:[0,1]}),p=ct({maxValue:f,minValue:s,axisWidth:h,scaleDomain:[s,f],scaleRange:[0,1]}),m=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?l:n.xAxis.scaleDomain[1]],g=[n.yAxis.scaleDomain[0]==="auto"?s:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]],y=(x,S,v,P)=>v===0&&x.value!=null&&(x.value<m[0]||x.value>m[1])||v===1&&x.value!=null&&(x.value<g[0]||x.value>g[1])?!1:n.visibleFilter(x,S,v,P);let D=0;a=o.map((x,S)=>x.map((v,P)=>{const b=D;D++;const A=Gt(n.type,S,P),C=y(v,S,P,t);return{id:v.id?v.id:A,index:b,label:v.label?v.label:A,description:v.description??"",data:v.data,value:v.value,categoryIndex:0,categoryLabel:"",axis:P==0?d(v.value):p(v.value),visible:C,color:""}}))}catch(o){throw Error(o)}return a},rc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class ic extends At{constructor(e,n){super({defaultDataFormatter:wi,computedDataFn:nc,contextObserverFn:rc},e,n)}}const ac=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],a=[];try{let o=[],u=[];if(e.nodes)o=e.nodes,u=e.edges;else if(e[0])o=e[0],u=e[1];else return{nodes:[],edges:[]};i=o.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,categoryIndex:0,categoryLabel:"",color:"",startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:n.visibleFilter(c,0,h,t)}));const l=new Map(i.map(c=>[c.id,c]));a=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:l.get(c.start),startNodeId:c.start,endNode:l.get(c.end),endNodeId:c.end,visible:n.visibleFilter(c,1,h,t)}));const s=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(l).forEach(([c,h])=>{h.startNodes=s.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id)})}catch(o){throw Error(o)}return{nodes:i,edges:a}},oc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class uc extends At{constructor(e,n){super({defaultDataFormatter:_i,computedDataFn:ac,contextObserverFn:oc},e,n)}}const sc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=new Map(n.categoryLabels.map((o,u)=>[o,u]));let a={id:"",index:0,label:"",description:"",categoryIndex:0,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(q(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const f=new Map;e.forEach(h=>{if(!h.parent)s=h;else{const d=f.get(h.parent)??[];d.push(h),f.set(h.parent,d)}});const c=h=>({id:h.id,label:h.label,data:h.data,value:h.value,categoryLabel:h.categoryLabel,children:(f.get(h.id)??[]).map(d=>c(d))});return s?c(s):{id:""}}();let u=0;const l=(s,f,c)=>{const h=f+1,d=n.visibleFilter(s,f,c,t),p=s.categoryLabel??null;let m=0;p!=null&&(i.has(p)||i.set(p,i.size),m=i.get(p)??0);const g=u;return u++,{id:s.id,index:g,level:f,seq:c,label:s.label??"",description:s.description??"",categoryIndex:m,categoryLabel:p,color:Vt(m,r),data:s.data??{},value:s.value,visible:d,children:(s.children??[]).map((y,D)=>l(y,h,D))}};a=l(o,0,0)}catch(o){throw Error(o)}return a},lc=({computedData$:t})=>t.pipe(M(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),cc=({nodeList$:t,fullDataFormatter$:e})=>{const n=e.pipe(M(r=>r.categoryLabels),St((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length));return U({nodeList:t,categoryLabels:n}).pipe(V(async r=>r),M(r=>{const i=new Set(r.categoryLabels),a=new Set(r.nodeList.filter(o=>o.visible).map(o=>o.categoryLabel));return Array.from(a).forEach(o=>{i.has(o)||i.add(o)}),Array.from(i).forEach(o=>{a.has(o)||a.delete(o)}),Array.from(i)}),St((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length))},fc=({computedData$:t})=>t.pipe(M(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)})),hc=({subject:t,observer:e})=>{const n=lc({computedData$:e.computedData$}).pipe($(1)),r=Xt({datumList$:n,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe($(1)),i=cc({nodeList$:n,fullDataFormatter$:e.fullDataFormatter$}).pipe($(1)),a=ti({datumList$:n}).pipe($(1)),o=fc({computedData$:e.computedData$}).pipe($(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,treeHighlight$:r,existCategoryLabels$:i,CategoryDataMap$:a,visibleComputedData$:o}};class dc extends At{constructor(e,n){super({defaultDataFormatter:xi,computedDataFn:sc,contextObserverFn:hc},e,n)}}function pc({name:t,defaultParams:e,initFn:n}){const r=new F,i=new F,a=new WeakMap;let o=()=>{},u,l=e;return{params$:i,name:t,defaultParams:e,init(){u&&(o=n(u)??(()=>{}),a.set(u.selection,u))},destroy(){o(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:s=>{l=nt(s,e)},setContext:s=>{u=s,u.observer.fullParams$=i.pipe(O(r),xe({}),M(f=>nt(f,l)),$(1))}}}const ft=()=>function(e,n){return function(i){return class{constructor(){const o=pc({name:e,defaultParams:n,initFn:i});this.params$=o.params$,this.name=o.name,this.defaultParams=o.defaultParams,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},mc=ft(),gc=ft(),yc=ft(),vc=ft(),bc=ft(),wc=ft(),xc=ft();_.GridChart=jl,_.MultiGridChart=ec,_.MultiValueChart=ic,_.RelationshipChart=uc,_.SeriesChart=Wl,_.TreeChart=dc,_.calcGridContainerPosition=zt,_.categoryDataMapObservable=ti,_.createAxisLinearScale=ct,_.createAxisPointScale=zl,_.createAxisQuantizeScale=Ul,_.createDefaultDatumId=Gt,_.createDefaultGroupLabel=Ye,_.createDefaultSeriesLabel=ge,_.createGridGroupLabels=wr,_.createGridSeriesLabels=Xe,_.createMultiGridGroupLabels=xr,_.createMultiGridSeriesLabels=br,_.defineGridPlugin=gc,_.defineMultiGridPlugin=yc,_.defineMultiValuePlugin=vc,_.defineNoneDataPlugin=bc,_.defineRelationshipPlugin=wc,_.defineSeriesPlugin=mc,_.defineTreePlugin=xc,_.formatCommaNumber=Ds,_.formatValueToLabel=Ss,_.getMinAndMax=bt,_.getMinAndMaxGrid=We,_.getMinAndMaxMultiGrid=Ms,_.getMinAndMaxMultiValue=Cs,_.getMinAndMaxSeries=As,_.getMinAndMaxValue=ye,_.groupDataMapObservable=ln,_.highlightObservable=Xt,_.isFunction=$s,_.isPlainObject=q,_.mergeOptionsWithDefault=nt,_.seriesColorPredicate=Vt,_.seriesDataMapObservable=_e,_.transposeData=_r,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -25,7 +25,7 @@ export declare const gridAxesSizeObservable: ({ fullDataFormatter$, layout$ }: {
|
|
|
25
25
|
width: number;
|
|
26
26
|
height: number;
|
|
27
27
|
}>;
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const existSeriesLabelsObservable: ({ computedData$ }: {
|
|
29
29
|
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
|
30
30
|
}) => Observable<string[]>;
|
|
31
31
|
export declare const gridVisibleComputedDataObservable: ({ computedData$ }: {
|
|
@@ -16,7 +16,7 @@ export interface ContextObserverGridDetail {
|
|
|
16
16
|
height: number;
|
|
17
17
|
}>;
|
|
18
18
|
gridHighlight$: Observable<string[]>;
|
|
19
|
-
|
|
19
|
+
existSeriesLabels$: Observable<string[]>;
|
|
20
20
|
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
|
|
21
21
|
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
|
|
22
22
|
visibleComputedData$: Observable<ComputedDataGrid>;
|
|
@@ -1,72 +1,56 @@
|
|
|
1
1
|
import { ChartType } from './Chart';
|
|
2
|
-
import { ComputedDatumBase } from './ComputedData';
|
|
3
2
|
import { ComputedDataSeries, ComputedDatumSeries } from './ComputedDataSeries';
|
|
4
3
|
import { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid';
|
|
5
4
|
import { ComputedDataMultiGrid } from './ComputedDataMultiGrid';
|
|
6
|
-
import { ComputedDatumMultiValue } from './ComputedDataMultiValue';
|
|
5
|
+
import { ComputedDataMultiValue, ComputedDatumMultiValue } from './ComputedDataMultiValue';
|
|
7
6
|
import { ComputedDataRelationship, ComputedNode } from './ComputedDataRelationship';
|
|
8
7
|
import { ComputedDataTree } from './ComputedDataTree';
|
|
9
8
|
import { HighlightTarget } from './ChartParams';
|
|
10
9
|
|
|
11
10
|
export type EventName = 'click' | 'mouseover' | 'mousemove' | 'mouseout' | 'dragstart' | 'drag' | 'dragend' | 'resize' | 'transitionMove' | 'transitionEnd';
|
|
12
|
-
export type EventTypeMap<T extends ChartType> = T extends 'series' ? EventSeries : T extends 'grid' ? EventGrid : T extends 'multiGrid' ? EventMultiGrid : T extends 'multiValue' ? EventMultiValue : T extends 'relationship' ? EventRelationship : T extends 'tree' ? EventTree : EventBase
|
|
13
|
-
export interface EventBase {
|
|
11
|
+
export type EventTypeMap<T extends ChartType> = T extends 'series' ? EventSeries : T extends 'grid' ? EventGrid : T extends 'multiGrid' ? EventMultiGrid : T extends 'multiValue' ? EventMultiValue : T extends 'relationship' ? EventRelationship : T extends 'tree' ? EventTree : EventBase<any>;
|
|
12
|
+
export interface EventBase<T extends ChartType> {
|
|
13
|
+
type: T;
|
|
14
14
|
eventName: EventName;
|
|
15
15
|
pluginName: string;
|
|
16
|
-
type: ChartType;
|
|
17
16
|
event: MouseEvent | undefined;
|
|
18
17
|
highlightTarget: HighlightTarget;
|
|
19
|
-
datum: ComputedDatumBase | null;
|
|
20
18
|
tween?: number;
|
|
21
19
|
}
|
|
22
|
-
export interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
series: ComputedDatumSeries[];
|
|
20
|
+
export interface EventBaseSeriesValue<DatumType, DataType> {
|
|
21
|
+
data: DataType;
|
|
22
|
+
series: DatumType[];
|
|
26
23
|
seriesIndex: number;
|
|
27
24
|
seriesLabel: string;
|
|
28
|
-
datum:
|
|
25
|
+
datum: DatumType | null;
|
|
29
26
|
}
|
|
30
|
-
export interface
|
|
31
|
-
|
|
32
|
-
data: ComputedDataGrid;
|
|
33
|
-
series: ComputedDatumGrid[];
|
|
34
|
-
seriesIndex: number;
|
|
35
|
-
seriesLabel: string;
|
|
36
|
-
groups: ComputedDatumGrid[];
|
|
37
|
-
groupIndex: number;
|
|
38
|
-
groupLabel: string;
|
|
39
|
-
datum: ComputedDatumGrid | null;
|
|
40
|
-
}
|
|
41
|
-
export interface EventMultiGrid extends EventBase {
|
|
42
|
-
type: 'multiGrid';
|
|
43
|
-
data: ComputedDataMultiGrid;
|
|
27
|
+
export interface EventBaseGridValue<DatumType, DataType> {
|
|
28
|
+
data: DataType;
|
|
44
29
|
gridIndex: number;
|
|
45
|
-
series:
|
|
30
|
+
series: DatumType[];
|
|
46
31
|
seriesIndex: number;
|
|
47
32
|
seriesLabel: string;
|
|
48
|
-
|
|
33
|
+
groups: DatumType[];
|
|
49
34
|
groupIndex: number;
|
|
50
35
|
groupLabel: string;
|
|
51
|
-
datum:
|
|
52
|
-
}
|
|
53
|
-
export interface EventMultiValue extends EventBase {
|
|
54
|
-
type: 'multiValue';
|
|
55
|
-
datum: ComputedDatumMultiValue | null;
|
|
36
|
+
datum: DatumType | null;
|
|
56
37
|
}
|
|
57
|
-
export interface
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
category: ComputedNode[];
|
|
38
|
+
export interface EventBaseCategoryValue<DatumType, DataType> {
|
|
39
|
+
data: DataType;
|
|
40
|
+
category: DatumType[];
|
|
61
41
|
categoryIndex: number;
|
|
62
42
|
categoryLabel: string;
|
|
63
|
-
datum:
|
|
43
|
+
datum: DatumType | null;
|
|
64
44
|
}
|
|
65
|
-
export interface
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
45
|
+
export interface EventSeries extends EventBase<'series'>, EventBaseSeriesValue<ComputedDatumSeries, ComputedDataSeries> {
|
|
46
|
+
}
|
|
47
|
+
export interface EventGrid extends EventBase<'grid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataGrid> {
|
|
48
|
+
}
|
|
49
|
+
export interface EventMultiGrid extends EventBase<'multiGrid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataMultiGrid> {
|
|
50
|
+
}
|
|
51
|
+
export interface EventMultiValue extends EventBase<'multiValue'>, EventBaseCategoryValue<ComputedDatumMultiValue, ComputedDataMultiValue> {
|
|
52
|
+
}
|
|
53
|
+
export interface EventRelationship extends EventBase<'relationship'>, EventBaseCategoryValue<ComputedNode, ComputedDataRelationship> {
|
|
54
|
+
}
|
|
55
|
+
export interface EventTree extends EventBase<'tree'>, EventBaseCategoryValue<ComputedDataTree, ComputedDataTree> {
|
|
72
56
|
}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
gridGraphicTransformObservable,
|
|
11
11
|
gridGraphicReverseScaleObservable,
|
|
12
12
|
gridAxesSizeObservable,
|
|
13
|
-
|
|
13
|
+
existSeriesLabelsObservable,
|
|
14
14
|
gridVisibleComputedDataObservable,
|
|
15
15
|
isSeriesPositionSeprateObservable,
|
|
16
16
|
gridContainerObservable } from './gridObservables'
|
|
@@ -79,7 +79,7 @@ export const createGridContextObserver: ContextObserverFn<'grid'> = ({ subject,
|
|
|
79
79
|
shareReplay(1)
|
|
80
80
|
)
|
|
81
81
|
|
|
82
|
-
const
|
|
82
|
+
const existSeriesLabels$ = existSeriesLabelsObservable({
|
|
83
83
|
computedData$: observer.computedData$,
|
|
84
84
|
})
|
|
85
85
|
|
|
@@ -116,7 +116,7 @@ export const createGridContextObserver: ContextObserverFn<'grid'> = ({ subject,
|
|
|
116
116
|
gridGraphicReverseScale$,
|
|
117
117
|
gridAxesSize$,
|
|
118
118
|
gridHighlight$,
|
|
119
|
-
|
|
119
|
+
existSeriesLabels$,
|
|
120
120
|
SeriesDataMap$,
|
|
121
121
|
GroupDataMap$,
|
|
122
122
|
visibleComputedData$,
|
|
@@ -380,7 +380,7 @@ export const gridAxesSizeObservable = ({ fullDataFormatter$, layout$ }: {
|
|
|
380
380
|
// return highlightObservable ({ datumList$, fullChartParams$, event$ })
|
|
381
381
|
// }
|
|
382
382
|
|
|
383
|
-
export const
|
|
383
|
+
export const existSeriesLabelsObservable = ({ computedData$ }: { computedData$: Observable<ComputedDataTypeMap<'grid'>> }) => {
|
|
384
384
|
return computedData$.pipe(
|
|
385
385
|
map(data => {
|
|
386
386
|
return data
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
gridGraphicReverseScaleObservable,
|
|
37
37
|
gridAxesReverseTransformObservable,
|
|
38
38
|
gridAxesSizeObservable,
|
|
39
|
-
|
|
39
|
+
existSeriesLabelsObservable,
|
|
40
40
|
gridVisibleComputedDataObservable,
|
|
41
41
|
isSeriesPositionSeprateObservable,
|
|
42
42
|
gridContainerObservable } from '../grid/gridObservables'
|
|
@@ -128,7 +128,7 @@ export const multiGridEachDetailObservable = ({ fullDataFormatter$, computedData
|
|
|
128
128
|
shareReplay(1)
|
|
129
129
|
)
|
|
130
130
|
|
|
131
|
-
const
|
|
131
|
+
const existSeriesLabels$ = existSeriesLabelsObservable({
|
|
132
132
|
computedData$: gridComputedData$,
|
|
133
133
|
})
|
|
134
134
|
|
|
@@ -160,7 +160,7 @@ export const multiGridEachDetailObservable = ({ fullDataFormatter$, computedData
|
|
|
160
160
|
gridGraphicReverseScale$,
|
|
161
161
|
gridAxesSize$,
|
|
162
162
|
gridHighlight$,
|
|
163
|
-
|
|
163
|
+
existSeriesLabels$,
|
|
164
164
|
SeriesDataMap$,
|
|
165
165
|
GroupDataMap$,
|
|
166
166
|
visibleComputedData$,
|
|
@@ -18,7 +18,7 @@ export interface ContextObserverGridDetail {
|
|
|
18
18
|
gridGraphicReverseScale$: Observable<[number, number][]>
|
|
19
19
|
gridAxesSize$: Observable<{ width: number; height: number; }>
|
|
20
20
|
gridHighlight$: Observable<string[]>
|
|
21
|
-
|
|
21
|
+
existSeriesLabels$: Observable<string[]>
|
|
22
22
|
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
|
23
23
|
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
|
24
24
|
visibleComputedData$: Observable<ComputedDataGrid>
|
|
@@ -19,7 +19,7 @@ export interface ContextObserverMultiGrid<PluginParams> extends ContextObserverB
|
|
|
19
19
|
// gridGraphicReverseScale$: Observable<[number, number][]>
|
|
20
20
|
// gridAxesSize$: Observable<{ width: number; height: number; }>
|
|
21
21
|
// gridHighlight$: Observable<string[]>
|
|
22
|
-
//
|
|
22
|
+
// existSeriesLabels$: Observable<string[]>
|
|
23
23
|
// SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
|
24
24
|
// GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
|
25
25
|
// visibleComputedData$: Observable<ComputedDataGrid>
|
package/src/types/Event.ts
CHANGED
|
@@ -41,82 +41,113 @@ export type EventTypeMap<T extends ChartType> = T extends 'series' ? EventSeries
|
|
|
41
41
|
: T extends 'multiValue' ? EventMultiValue
|
|
42
42
|
: T extends 'relationship' ? EventRelationship
|
|
43
43
|
: T extends 'tree' ? EventTree
|
|
44
|
-
: EventBase
|
|
44
|
+
: EventBase<any>
|
|
45
45
|
|
|
46
|
-
export interface EventBase {
|
|
46
|
+
export interface EventBase<T extends ChartType> {
|
|
47
|
+
type: T
|
|
47
48
|
eventName: EventName
|
|
48
49
|
pluginName: string
|
|
49
|
-
// data: EventData
|
|
50
|
-
type: ChartType
|
|
51
50
|
event: MouseEvent | undefined
|
|
52
51
|
highlightTarget: HighlightTarget
|
|
53
|
-
datum: ComputedDatumBase | null
|
|
52
|
+
// datum: ComputedDatumBase | null
|
|
54
53
|
tween?: number
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
export interface
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
series: ComputedDatumSeries[]
|
|
56
|
+
export interface EventBaseSeriesValue<DatumType, DataType> {
|
|
57
|
+
data: DataType
|
|
58
|
+
series: DatumType[]
|
|
61
59
|
seriesIndex: number
|
|
62
60
|
seriesLabel: string
|
|
63
|
-
datum:
|
|
64
|
-
// highlightTarget: 'series' | 'datum' | 'none'
|
|
65
|
-
// highlightLabel: string | null
|
|
66
|
-
// highlightId: string | null
|
|
61
|
+
datum: DatumType | null
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
export interface
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
series:
|
|
64
|
+
export interface EventBaseGridValue<DatumType, DataType> {
|
|
65
|
+
data: DataType
|
|
66
|
+
gridIndex: number
|
|
67
|
+
series: DatumType[]
|
|
73
68
|
seriesIndex: number
|
|
74
69
|
seriesLabel: string
|
|
75
|
-
groups:
|
|
70
|
+
groups: DatumType[]
|
|
76
71
|
groupIndex: number
|
|
77
72
|
groupLabel: string
|
|
78
|
-
datum:
|
|
79
|
-
// highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
|
80
|
-
// highlightLabel: string | null
|
|
81
|
-
// highlightId: string | null
|
|
73
|
+
datum: DatumType | null
|
|
82
74
|
}
|
|
83
75
|
|
|
84
|
-
export interface
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
seriesLabel: string
|
|
91
|
-
group: ComputedDatumGrid[]
|
|
92
|
-
groupIndex: number
|
|
93
|
-
groupLabel: string
|
|
94
|
-
datum: ComputedDatumGrid | null
|
|
95
|
-
// highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
|
96
|
-
// highlightLabel: string | null
|
|
97
|
-
// highlightId: string | null
|
|
76
|
+
export interface EventBaseCategoryValue<DatumType, DataType> {
|
|
77
|
+
data: DataType
|
|
78
|
+
category: DatumType[]
|
|
79
|
+
categoryIndex: number
|
|
80
|
+
categoryLabel: string
|
|
81
|
+
datum: DatumType | null
|
|
98
82
|
}
|
|
99
83
|
|
|
100
|
-
export interface
|
|
101
|
-
type: '
|
|
102
|
-
|
|
84
|
+
export interface EventSeries extends EventBase<'series'>, EventBaseSeriesValue<ComputedDatumSeries, ComputedDataSeries> {
|
|
85
|
+
// type: 'series'
|
|
86
|
+
// data: ComputedDataSeries
|
|
87
|
+
// series: ComputedDatumSeries[]
|
|
88
|
+
// seriesIndex: number
|
|
89
|
+
// seriesLabel: string
|
|
90
|
+
// datum: ComputedDatumSeries | null
|
|
91
|
+
// // highlightTarget: 'series' | 'datum' | 'none'
|
|
92
|
+
// // highlightLabel: string | null
|
|
93
|
+
// // highlightId: string | null
|
|
103
94
|
}
|
|
104
95
|
|
|
105
|
-
export interface
|
|
106
|
-
type: '
|
|
107
|
-
data:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
export interface EventGrid extends EventBase<'grid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataGrid> {
|
|
97
|
+
// type: 'grid'
|
|
98
|
+
// data: ComputedDataGrid
|
|
99
|
+
// series: ComputedDatumGrid[]
|
|
100
|
+
// seriesIndex: number
|
|
101
|
+
// seriesLabel: string
|
|
102
|
+
// groups: ComputedDatumGrid[]
|
|
103
|
+
// groupIndex: number
|
|
104
|
+
// groupLabel: string
|
|
105
|
+
// datum: ComputedDatumGrid | null
|
|
106
|
+
// // highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
|
107
|
+
// // highlightLabel: string | null
|
|
108
|
+
// // highlightId: string | null
|
|
112
109
|
}
|
|
113
110
|
|
|
114
|
-
export interface
|
|
115
|
-
type: '
|
|
116
|
-
data:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
export interface EventMultiGrid extends EventBase<'multiGrid'>, EventBaseGridValue<ComputedDatumGrid, ComputedDataMultiGrid> {
|
|
112
|
+
// type: 'multiGrid'
|
|
113
|
+
// data: ComputedDataMultiGrid
|
|
114
|
+
// gridIndex: number
|
|
115
|
+
// series: ComputedDatumGrid[]
|
|
116
|
+
// seriesIndex: number
|
|
117
|
+
// seriesLabel: string
|
|
118
|
+
// group: ComputedDatumGrid[]
|
|
119
|
+
// groupIndex: number
|
|
120
|
+
// groupLabel: string
|
|
121
|
+
// datum: ComputedDatumGrid | null
|
|
122
|
+
// // highlightTarget: 'series' | 'group' | 'datum' | 'none'
|
|
123
|
+
// // highlightLabel: string | null
|
|
124
|
+
// // highlightId: string | null
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface EventMultiValue extends EventBase<'multiValue'>, EventBaseCategoryValue<ComputedDatumMultiValue, ComputedDataMultiValue> {
|
|
128
|
+
// type: 'multiValue'
|
|
129
|
+
// data: ComputedDataMultiValue
|
|
130
|
+
// category: ComputedDatumMultiValue[]
|
|
131
|
+
// categoryIndex: number
|
|
132
|
+
// categoryLabel: string
|
|
133
|
+
// datum: ComputedDatumMultiValue | null
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface EventRelationship extends EventBase<'relationship'>, EventBaseCategoryValue<ComputedNode, ComputedDataRelationship> {
|
|
137
|
+
// type: 'relationship'
|
|
138
|
+
// data: ComputedDataRelationship
|
|
139
|
+
// category: ComputedNode[]
|
|
140
|
+
// categoryIndex: number
|
|
141
|
+
// categoryLabel: string
|
|
142
|
+
// datum: ComputedNode | null
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface EventTree extends EventBase<'tree'>, EventBaseCategoryValue<ComputedDataTree, ComputedDataTree> {
|
|
146
|
+
// type: 'tree'
|
|
147
|
+
// data: ComputedDataTree
|
|
148
|
+
// category: ComputedDataTree[]
|
|
149
|
+
// categoryIndex: number
|
|
150
|
+
// categoryLabel: string
|
|
151
|
+
// datum: ComputedDataTree | null
|
|
121
152
|
}
|
|
122
153
|
|
package/src/utils/d3Utils.ts
CHANGED
|
@@ -15,7 +15,6 @@ export const createAxisLinearScale = ({
|
|
|
15
15
|
scaleDomain: [number | 'auto', number | 'auto']
|
|
16
16
|
scaleRange: [number, number] // 0-1
|
|
17
17
|
}) => {
|
|
18
|
-
|
|
19
18
|
// -- 無值補上預設值 --
|
|
20
19
|
const domainMin: number | 'auto' = scaleDomain[0] ?? DATA_FORMATTER_VALUE_AXIS.scaleDomain[0]
|
|
21
20
|
const domainMax: number | 'auto' = scaleDomain[1] ?? DATA_FORMATTER_VALUE_AXIS.scaleDomain[1]
|
package/src/utils/observables.ts
CHANGED
|
@@ -91,14 +91,14 @@ export const highlightObservable = ({ datumList$, fullChartParams$, event$ }: {
|
|
|
91
91
|
|
|
92
92
|
function getSeriesIds (datumList: ComputedDatumTypeMap<'series' | 'grid'>[], seriesLabel: string | null) {
|
|
93
93
|
return seriesLabel == null
|
|
94
|
-
?
|
|
95
|
-
:
|
|
94
|
+
? []
|
|
95
|
+
: datumList.filter(d => d.seriesLabel === seriesLabel).map(d => d.id)
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
function getGroupIds (datumList: ComputedDatumTypeMap<'grid'>[], groupLabel: string | null) {
|
|
99
99
|
return groupLabel == null
|
|
100
|
-
?
|
|
101
|
-
:
|
|
100
|
+
? []
|
|
101
|
+
: datumList.filter(d => (d as ComputedDatumTypeMap<"grid">).groupLabel === groupLabel).map(d => d.id)
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
function getCategoryIds (datumList: ComputedDatumTypeMap<'multiValue' | 'relationship' | 'tree'>[], categoryLabel: string | null) {
|
|
@@ -116,6 +116,7 @@ export const highlightObservable = ({ datumList$, fullChartParams$, event$ }: {
|
|
|
116
116
|
takeUntil(destroy$),
|
|
117
117
|
switchMap(async d => d)
|
|
118
118
|
).subscribe(data => {
|
|
119
|
+
console.log('data.fullChartParams.highlightTarget', data.fullChartParams.highlightTarget)
|
|
119
120
|
let ids: string[] = []
|
|
120
121
|
if (data.fullChartParams.highlightTarget === 'datum') {
|
|
121
122
|
ids = getDatumIds(data.datumList, data.target.id)
|
|
@@ -126,6 +127,7 @@ export const highlightObservable = ({ datumList$, fullChartParams$, event$ }: {
|
|
|
126
127
|
} else if (data.fullChartParams.highlightTarget === 'category') {
|
|
127
128
|
ids = getCategoryIds(data.datumList as ComputedDatumTypeMap<'multiValue' | 'relationship' | 'tree'>[], data.target.categoryLabel)
|
|
128
129
|
}
|
|
130
|
+
console.log('ids', ids)
|
|
129
131
|
subscriber.next(ids)
|
|
130
132
|
})
|
|
131
133
|
|