@templmf/temp-solf-lmf 0.0.92 → 0.0.94
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/@antv/algorithm@0.1.26/es2022/algorithm.mjs +3 -0
- package/@antv/component@2.1.7/es2022/component.mjs +15 -0
- package/@antv/event-emitter@0.1.3/es2022/event-emitter.mjs +3 -0
- package/@antv/g-canvas@2.0.48/es2022/g-canvas.mjs +18 -0
- package/@antv/g-plugin-dragndrop@2.0.38/es2022/g-plugin-dragndrop.mjs +18 -0
- package/@antv/g6 +13 -0
- package/@antv/g6@5.1.1/es2022/g6.mjs +125 -0
- package/@antv/g@6.1.28/es2022/g.mjs +15 -0
- package/@antv/graphlib@2.0.4/es2022/graphlib.mjs +3 -0
- package/@antv/hierarchy@0.7.1/es2022/hierarchy.mjs +3 -0
- package/@antv/layout@2.0.0/es2022/layout.mjs +20 -0
- package/@antv/util@3.3.11/es2022/util.mjs +3 -0
- package/bubblesets-js@2.3.4/es2022/bubblesets-js.mjs +4 -0
- package/echarts +8 -0
- package/echarts@6.0.0/es2022/echarts.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/bar/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/bar/installPictorialBar.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/boxplot/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/candlestick/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/chord/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/custom/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/effectScatter/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/funnel/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/gauge/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/graph/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/heatmap/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/line/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/lines/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/map/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/parallel/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/pie/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/radar/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/sankey/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/scatter/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/sunburst/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/themeRiver/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/tree/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/chart/treemap/install.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/export/charts.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/export/components.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/export/core.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/export/features.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/export/renderers.mjs +3 -0
- package/echarts@6.0.0/es2022/lib/extension.mjs +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* esm.sh - @antv/algorithm@0.1.26 */
|
|
2
|
+
var vt=function(r,e){var t=r.nodes,n=r.edges,a=[],i={};if(!t)throw new Error("invalid nodes data!");return t&&t.forEach(function(u,o){i[u.id]=o;var d=[];a.push(d)}),n&&n.forEach(function(u){var o=u.source,d=u.target,v=i[o],s=i[d];!v&&v!==0||!s&&s!==0||(a[v][s]=1,e||(a[s][v]=1))}),a},kr=vt;var lt=function(r,e){return r===e},Le=(function(){function f(r,e){e===void 0&&(e=null),this.value=r,this.next=e}return f.prototype.toString=function(r){return r?r(this.value):"".concat(this.value)},f})();var ct=(function(){function f(r){r===void 0&&(r=lt),this.head=null,this.tail=null,this.compare=r}return f.prototype.prepend=function(r){var e=new Le(r,this.head);return this.head=e,this.tail||(this.tail=e),this},f.prototype.append=function(r){var e=new Le(r);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},f.prototype.delete=function(r){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,r);)e=this.head,this.head=this.head.next;var t=this.head;if(t!==null)for(;t.next;)this.compare(t.next.value,r)?(e=t.next,t.next=t.next.next):t=t.next;return this.compare(this.tail.value,r)&&(this.tail=t),e},f.prototype.find=function(r){var e=r.value,t=e===void 0?void 0:e,n=r.callback,a=n===void 0?void 0:n;if(!this.head)return null;for(var i=this.head;i;){if(a&&a(i.value)||t!==void 0&&this.compare(i.value,t))return i;i=i.next}return null},f.prototype.deleteTail=function(){var r=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,r;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,r},f.prototype.deleteHead=function(){if(!this.head)return null;var r=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),r},f.prototype.fromArray=function(r){var e=this;return r.forEach(function(t){return e.append(t)}),this},f.prototype.toArray=function(){for(var r=[],e=this.head;e;)r.push(e),e=e.next;return r},f.prototype.reverse=function(){for(var r=this.head,e=null,t=null;r;)t=r.next,r.next=e,e=r,r=t;this.tail=this.head,this.head=e},f.prototype.toString=function(r){return r===void 0&&(r=void 0),this.toArray().map(function(e){return e.toString(r)}).toString()},f})(),Jr=ct;var ht=(function(){function f(){this.linkedList=new Jr}return f.prototype.isEmpty=function(){return!this.linkedList.head},f.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},f.prototype.enqueue=function(r){this.linkedList.append(r)},f.prototype.dequeue=function(){var r=this.linkedList.deleteHead();return r?r.value:null},f.prototype.toString=function(r){return this.linkedList.toString(r)},f})(),Me=ht;var nr=function(r,e,t){e===void 0&&(e=[]);var n=e.filter(function(o){return o.source===r||o.target===r});if(t==="target"){var a=function(d){return d.source===r};return n.filter(a).map(function(o){return o.target})}if(t==="source"){var i=function(d){return d.target===r};return n.filter(i).map(function(o){return o.source})}var u=function(d){return d.source===r?d.target:d.source};return n.map(u)},we=function(r,e){return e.filter(function(t){return t.source===r})},qr=function(r,e){return e.filter(function(t){return t.source===r||t.target===r})},Xr=function(r){r===void 0&&(r=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),t="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(r,"-").concat(e).concat(t)};function pt(f){f===void 0&&(f={});var r=f,e=function(){},t=(function(){var n={};return function(a){var i=a.next,u=i;return n[u]?!1:(n[u]=!0,!0)}})();return r.allowTraversal=f.allowTraversal||t,r.enter=f.enter||e,r.leave=f.leave||e,r}var gt=function(r,e,t,n){n===void 0&&(n=!0);var a=pt(t),i=new Me,u=r.edges,o=u===void 0?[]:u;i.enqueue(e);for(var d="",v=function(){var c=i.dequeue();a.enter({current:c,previous:d}),nr(c,o,n?"target":void 0).forEach(function(l){a.allowTraversal({previous:d,current:c,next:l})&&i.enqueue(l)}),a.leave({current:c,previous:d}),d=c};!i.isEmpty();)v()},Ce=gt;var mt=function(r){for(var e=r.nodes,t=e===void 0?[]:e,n=r.edges,a=n===void 0?[]:n,i=[],u={},o=[],d=function l(h){o.push(h),u[h.id]=!0;for(var g=nr(h.id,a),p=function(b){var L=g[b];if(!u[L]){var M=t.filter(function(w){return w.id===L});M.length>0&&l(M[0])}},m=0;m<g.length;++m)p(m)},v=0;v<t.length;v++){var s=t[v];if(!u[s.id]){d(s);for(var c=[];o.length>0;)c.push(o.pop());i.push(c)}}return i},ae=function(r){for(var e=r.nodes,t=e===void 0?[]:e,n=r.edges,a=n===void 0?[]:n,i=[],u={},o={},d={},v=[],s=0,c=function p(m){o[m.id]=s,d[m.id]=s,s+=1,i.push(m),u[m.id]=!0;for(var E=nr(m.id,a,"target").filter(function(S){return t.map(function(y){return y.id}).indexOf(S)>-1}),b=function(y){var I=E[y];if(!o[I]&&o[I]!==0){var O=t.filter(function(A){return A.id===I});O.length>0&&p(O[0]),d[m.id]=Math.min(d[m.id],d[I])}else u[I]&&(d[m.id]=Math.min(d[m.id],o[I]))},L=0;L<E.length;L++)b(L);if(d[m.id]===o[m.id]){for(var M=[];i.length>0;){var w=i.pop();if(u[w.id]=!1,M.push(w),w===m)break}M.length>0&&v.push(M)}},l=0,h=t;l<h.length;l++){var g=h[l];!o[g.id]&&o[g.id]!==0&&c(g)}return v};function Vr(f,r){return r?ae(f):mt(f)}var zr=function(r){var e={},t=r.nodes,n=t===void 0?[]:t,a=r.edges,i=a===void 0?[]:a;return n.forEach(function(u){e[u.id]={degree:0,inDegree:0,outDegree:0}}),i.forEach(function(u){e[u.source].degree++,e[u.source].outDegree++,e[u.target].degree++,e[u.target].inDegree++}),e},Fr=zr,xe=function(r,e){var t=zr(r);return t[e]?zr(r)[e].inDegree:0},Ie=function(r,e){var t=zr(r);return t[e]?zr(r)[e].outDegree:0};function bt(f){f===void 0&&(f={});var r=f,e=function(){},t=(function(){var n={};return function(a){var i=a.next;return n[i]?!1:(n[i]=!0,!0)}})();return r.allowTraversal=f.allowTraversal||t,r.enter=f.enter||e,r.leave=f.leave||e,r}function _e(f,r,e,t,n){n===void 0&&(n=!0),t.enter({current:r,previous:e});var a=f.edges,i=a===void 0?[]:a;nr(r,i,n?"target":void 0).forEach(function(u){t.allowTraversal({previous:e,current:r,next:u})&&_e(f,u,r,t,n)}),t.leave({current:r,previous:e})}function Pr(f,r,e,t){t===void 0&&(t=!0),_e(f,r,"",bt(e),t)}var Et=function(r){var e=null,t=r.nodes,n=t===void 0?[]:t,a={},i={},u={},o={};n.forEach(function(s){i[s.id]=s});for(var d={enter:function(c){var l=c.current,h=c.previous;if(u[l]){e={};for(var g=l,p=h;p!==l;)e[g]=p,g=p,p=a[p];e[g]=p}else u[l]=l,delete i[l],a[l]=h},leave:function(c){var l=c.current;o[l]=l,delete u[l]},allowTraversal:function(c){var l=c.next;return e?!1:!o[l]}};Object.keys(i).length;){var v=Object.keys(i)[0];Pr(r,v,d)}return e},oe=function(r,e,t){var n,a;t===void 0&&(t=!0);for(var i=[],u=Vr(r,!1),o=0,d=u;o<d.length;o++){var v=d[o];if(v.length)for(var s=v[0],c=s.id,l=[s],h=(n={},n[c]=s,n),g=(a={},a[c]=new Set,a);l.length>0;)for(var p=l.pop(),m=p.id,E=nr(m,r.edges),b=function(w){var S,y=E[w],I=r.nodes.find(function(R){return R.id===y});if(y===m)i.push((S={},S[y]=p,S));else if(!(y in g))h[y]=p,l.push(I),g[y]=new Set([p]);else if(!g[m].has(I)){for(var O=!0,A=[I,p],_=h[m];g[y].size&&!g[y].has(_)&&(A.push(_),_!==h[_.id]);)_=h[_.id];if(A.push(_),e&&t?(O=!1,A.findIndex(function(R){return e.indexOf(R.id)>-1})>-1&&(O=!0)):e&&!t&&A.findIndex(function(R){return e.indexOf(R.id)>-1})>-1&&(O=!1),O){for(var z={},q=1;q<A.length;q+=1)z[A[q-1].id]=A[q];A.length&&(z[A[A.length-1].id]=A[0]),i.push(z)}g[y].add(p)}},L=0;L<E.length;L+=1)b(L)}return i},ue=function(r,e,t){t===void 0&&(t=!0);for(var n=[],a=new Set,i=[],u=[],o={},d={},v=function(_){for(var z=[_];z.length>0;){var q=z.pop();a.has(q)&&(a.delete(q),i[q.id].forEach(function(R){z.push(R)}),i[q.id].clear())}},s=function A(_,z,q){var R=!1;if(e&&t===!1&&e.indexOf(_.id)>-1)return R;n.push(_),a.add(_);for(var B=q[_.id],H=0;H<B.length;H+=1){var G=o[B[H]];if(G===z){for(var N={},C=1;C<n.length;C+=1)N[n[C-1].id]=n[C];n.length&&(N[n[n.length-1].id]=n[0]),u.push(N),R=!0}else a.has(G)||A(G,z,q)&&(R=!0)}if(R)v(_);else for(var H=0;H<B.length;H+=1){var G=o[B[H]];i[G.id].has(_)||i[G.id].add(_)}return n.pop(),R},c=r.nodes,l=c===void 0?[]:c,h=0;h<l.length;h+=1){var g=l[h],p=g.id;d[p]=h,o[h]=g}if(e&&t)for(var m=function(_){var z=e[_];d[l[_].id]=d[z],d[z]=0,o[0]=l.find(function(q){return q.id===z}),o[d[l[_].id]]=l[_]},h=0;h<e.length;h++)m(h);for(var E=function(_){for(var z,q,R=1/0,B=0;B<_.length;B+=1)for(var H=_[B],G=0;G<H.length;G++){var N=d[H[G].id];N<R&&(R=N,q=B)}for(var C=_[q],k=[],B=0;B<C.length;B+=1){var j=C[B];k[j.id]=[];for(var D=0,Y=nr(j.id,r.edges,"target").filter(function(lr){return C.map(function(ur){return ur.id}).indexOf(lr)>-1});D<Y.length;D++){var X=Y[D];X===j.id&&!(t===!1&&e.indexOf(j.id)>-1)?u.push((z={},z[j.id]=j,z)):k[j.id].push(d[X])}}return{component:C,adjList:k,minIdx:R}},b=0;b<l.length;){var L=l.filter(function(A){return d[A.id]>=b}),M=ae({nodes:L,edges:r.edges}).filter(function(A){return A.length>1});if(M.length===0)break;var w=E(M),S=w.minIdx,y=w.adjList,I=w.component;if(I.length>1){I.forEach(function(A){i[A.id]=new Set});var O=o[S];if(e&&t&&e.indexOf(O.id)===-1)return u;s(O,O,y),b=S+1}else break}return u},ye=function(r,e,t,n){return n===void 0&&(n=!0),e?ue(r,t,n):oe(r,t,n)},fe=Et;import{__spreadArray as Se}from"/tslib@^2.0.0?target=es2022";import{isArray as Nt}from"/@antv/util@^2.0.13?target=es2022";var Lt=function(r,e,t){for(var n=1/0,a,i=0;i<e.length;i++){var u=e[i].id;!t[u]&&r[u]<=n&&(n=r[u],a=e[i])}return a},Mt=function(r,e,t,n){var a=r.nodes,i=a===void 0?[]:a,u=r.edges,o=u===void 0?[]:u,d=[],v={},s={},c={};i.forEach(function(b,L){var M=b.id;d.push(M),s[M]=1/0,M===e&&(s[M]=0)});for(var l=i.length,h=function(L){var M=Lt(s,i,v),w=M.id;if(v[w]=!0,s[w]===1/0)return"continue";var S=[];t?S=we(w,o):S=qr(w,o),S.forEach(function(y){var I=y.target,O=y.source,A=I===w?O:I,_=n&&y[n]?y[n]:1;s[A]>s[M.id]+_?(s[A]=s[M.id]+_,c[A]=[M.id]):s[A]===s[M.id]+_&&c[A].push(M.id)})},g=0;g<l;g++)h(g);c[e]=[e];var p={};for(var m in s)s[m]!==1/0&&ke(e,m,c,p);var E={};for(var m in p)E[m]=p[m][0];return{length:s,path:E,allPath:p}},Or=Mt;function ke(f,r,e,t){if(f===r)return[f];if(t[r])return t[r];for(var n=[],a=0,i=e[r];a<i.length;a++){var u=i[a],o=ke(f,u,e,t);if(!o)return;for(var d=0,v=o;d<v.length;d++){var s=v[d];Nt(s)?n.push(Se(Se([],s,!0),[r],!1)):n.push([s,r])}}return t[r]=n,t[r]}var De=function(r,e,t,n,a){var i=Or(r,e,n,a),u=i.length,o=i.path,d=i.allPath;return{length:u[t],path:o[t],allPath:d[t]}},Ae=function(r,e,t,n){var a;if(e===t)return[[e]];var i=r.edges,u=i===void 0?[]:i,o=[e],d=(a={},a[e]=!0,a),v=[],s=[],c=n?nr(e,u,"target"):nr(e,u);for(v.push(c);o.length>0&&v.length>0;){var l=v[v.length-1];if(l.length){var h=l.shift();h&&(o.push(h),d[h]=!0,c=n?nr(h,u,"target"):nr(h,u),v.push(c.filter(function(m){return!d[m]})))}else{var g=o.pop();d[g]=!1,v.pop();continue}if(o[o.length-1]===t){var p=o.map(function(E){return E});s.push(p);var g=o.pop();d[g]=!1,v.pop()}}return s};var wt=function(r,e){for(var t=kr(r,e),n=[],a=t.length,i=0;i<a;i+=1){n[i]=[];for(var u=0;u<a;u+=1)i===u?n[i][u]=0:t[i][u]===0||!t[i][u]?n[i][u]=1/0:n[i][u]=t[i][u]}for(var o=0;o<a;o+=1)for(var i=0;i<a;i+=1)for(var u=0;u<a;u+=1)n[i][u]>n[i][o]+n[o][u]&&(n[i][u]=n[i][o]+n[o][u]);return n},Wr=wt;var Ct=function(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t="weight"),n===void 0&&(n=1e3);var a=r.nodes,i=a===void 0?[]:a,u=r.edges,o=u===void 0?[]:u,d={},v={};i.forEach(function(L,M){var w=Xr();L.clusterId=w,d[w]={id:w,nodes:[L]},v[L.id]={node:L,idx:M}});var s=kr(r,e),c=[],l={};s.forEach(function(L,M){var w=0,S=i[M].id;l[S]={},L.forEach(function(y,I){if(y){w+=y;var O=i[I].id;l[S][O]=y}}),c.push(w)});for(var h=0,g=function(){var M=!1;if(i.forEach(function(w){var S={};Object.keys(l[w.id]).forEach(function(R){var B=l[w.id][R],H=v[R].node,G=H.clusterId;S[G]||(S[G]=0),S[G]+=B});var y=-1/0,I=[];if(Object.keys(S).forEach(function(R){y<S[R]?(y=S[R],I=[R]):y===S[R]&&I.push(R)}),!(I.length===1&&I[0]===w.clusterId)){var O=I.indexOf(w.clusterId);if(O>=0&&I.splice(O,1),I&&I.length){M=!0;var A=d[w.clusterId],_=A.nodes.indexOf(w);A.nodes.splice(_,1);var z=Math.floor(Math.random()*I.length),q=d[I[z]];q.nodes.push(w),w.clusterId=q.id}}}),!M)return"break";h++};h<n;){var p=g();if(p==="break")break}Object.keys(d).forEach(function(L){var M=d[L];(!M.nodes||!M.nodes.length)&&delete d[L]});var m=[],E={};o.forEach(function(L){var M=L.source,w=L.target,S=L[t]||1,y=v[M].node.clusterId,I=v[w].node.clusterId,O="".concat(y,"---").concat(I);if(E[O])E[O].weight+=S,E[O].count++;else{var A={source:y,target:I,weight:S,count:1};E[O]=A,m.push(A)}});var b=[];return Object.keys(d).forEach(function(L){b.push(d[L])}),{clusters:b,clusterEdges:m}},Oe=Ct;import{clone as yt}from"/@antv/util@^2.0.13?target=es2022";import{clone as xt}from"/@antv/util@^2.0.13?target=es2022";var It=(function(){function f(r){this.arr=r}return f.prototype.getArr=function(){return this.arr||[]},f.prototype.add=function(r){var e,t=r.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new f(t);if(!t?.length)return new f(this.arr);if(this.arr.length===t.length){var n=[];for(var a in this.arr)n[a]=this.arr[a]+t[a];return new f(n)}},f.prototype.subtract=function(r){var e,t=r.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new f(t);if(!t?.length)return new f(this.arr);if(this.arr.length===t.length){var n=[];for(var a in this.arr)n[a]=this.arr[a]-t[a];return new f(n)}},f.prototype.avg=function(r){var e=[];if(r!==0)for(var t in this.arr)e[t]=this.arr[t]/r;return new f(e)},f.prototype.negate=function(){var r=[];for(var e in this.arr)r[e]=-this.arr[e];return new f(r)},f.prototype.squareEuclideanDistance=function(r){var e,t=r.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!t?.length)return 0;if(this.arr.length===t.length){var n=0;for(var a in this.arr)n+=Math.pow(this.arr[a]-r.arr[a],2);return n}},f.prototype.euclideanDistance=function(r){var e,t=r.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!t?.length)return 0;if(this.arr.length===t.length){var n=0;for(var a in this.arr)n+=Math.pow(this.arr[a]-r.arr[a],2);return Math.sqrt(n)}else console.error("The two vectors are unequal in length.")},f.prototype.normalize=function(){var r=[],e=xt(this.arr);e.sort(function(i,u){return i-u});var t=e[e.length-1],n=e[0];for(var a in this.arr)r[a]=(this.arr[a]-n)/(t-n);return new f(r)},f.prototype.norm2=function(){var r;if(!(!((r=this.arr)===null||r===void 0)&&r.length))return 0;var e=0;for(var t in this.arr)e+=Math.pow(this.arr[t],2);return Math.sqrt(e)},f.prototype.dot=function(r){var e,t=r.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!t?.length)return 0;if(this.arr.length===t.length){var n=0;for(var a in this.arr)n+=this.arr[a]*r.arr[a];return n}else console.error("The two vectors are unequal in length.")},f.prototype.equal=function(r){var e,t=r.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==t?.length)return!1;for(var n in this.arr)if(this.arr[n]!==t[n])return!1;return!0},f})(),or=It;var Gr=function(r,e){e===void 0&&(e=void 0);var t=[];return r.forEach(function(n){e===void 0&&t.push(n),n[e]!==void 0&&t.push(n[e])}),t};import{uniq as je}from"/@antv/util@^2.0.13?target=es2022";var mr;(function(f){f.EuclideanDistance="euclideanDistance"})(mr||(mr={}));var _t=function(r,e,t){var n=[];e?.length?n=e:(r.forEach(function(i){n=n.concat(Object.keys(i))}),n=je(n));var a={};return n.forEach(function(i){var u=[];r.forEach(function(o){o[i]!==void 0&&o[i]!==""&&u.push(o[i])}),u.length&&!t?.includes(i)&&(a[i]=je(u))}),a},Ur=function(r,e,t){var n=_t(r,e,t),a=[];if(!Object.keys(n).length)return a;var i=Object.values(n),u=i.every(function(o){return o.every(function(d){return typeof d=="number"})});return r.forEach(function(o,d){var v=[];Object.keys(n).forEach(function(s){var c=o[s],l=n[s],h=l.findIndex(function(m){return c===m}),g=[];if(u)g.push(c);else for(var p=0;p<l.length;p++)p===h?g.push(1):g.push(0);v=v.concat(g)}),a[d]=v}),a},se=function(r,e,t,n){t===void 0&&(t=mr.EuclideanDistance);var a=0;switch(t){case mr.EuclideanDistance:a=new or(r).euclideanDistance(new or(e));break;default:break}return a};var Te=function(r,e,t,n){for(var a=e.length,i=2*n,u=0,o=0;o<a;o++)for(var d=r[o].clusterId,v=0;v<a;v++){var s=r[v].clusterId;if(d===s){var c=e[o][v]||0,l=t[o]||0,h=t[v]||0;u+=c-l*h/i}}return u*=1/i,u},de=function(r,e){r===void 0&&(r=[]);for(var t=r.length,n=new or([]),a=0;a<t;a++)n=n.add(new or(e[a]));var i=n.avg(t);i.normalize();for(var u=0,a=0;a<t;a++){var o=new or(e[a]),d=o.squareEuclideanDistance(i);u+=d}var v=[];r.forEach(function(){v.push([])});for(var a=0;a<t;a++){var o=new or(e[a]);r[a].clusterInertial=0;for(var s=0;s<t;s++){if(a===s){v[a][s]=0;continue}var c=new or(e[s]);v[a][s]=o.squareEuclideanDistance(c),r[a].clusterInertial+=v[a][s]}}for(var l=0,h=2*t*u,a=0;a<t;a++)for(var g=r[a].clusterId,s=0;s<t;s++){var p=r[s].clusterId;if(!(a===s||g!==p)){var m=r[a].clusterInertial*r[s].clusterInertial/Math.pow(h,2)-v[a][s]/h;l+=m}}return Number(l.toFixed(4))},St=function(r,e,t,n,a,i,u,o,d){e===void 0&&(e=!1),t===void 0&&(t="weight"),n===void 0&&(n=1e-4),a===void 0&&(a=!1),i===void 0&&(i=void 0),u===void 0&&(u=[]),o===void 0&&(o=["id"]),d===void 0&&(d=1);var v=r.nodes,s=v===void 0?[]:v,c=r.edges,l=c===void 0?[]:c,h=[];if(a){s.forEach(function(N,C){N.properties=N.properties||{},N.originIndex=C});var g=[];s.every(function(N){return N.hasOwnProperty("nodeType")})&&(g=Array.from(new Set(s.map(function(N){return N.nodeType}))),s.forEach(function(N){N.properties.nodeType=g.findIndex(function(C){return C===N.nodeType})}));var p=Gr(s,i);h=Ur(p,u,o)}var m=1,E={},b={};s.forEach(function(N,C){var k=String(m++);N.clusterId=k,E[k]={id:k,nodes:[N]},b[N.id]={node:N,idx:C}});var L=kr(r,e),M=[],w={},S=0;L.forEach(function(N,C){var k=0,j=s[C].id;w[j]={},N.forEach(function(D,Y){if(D){k+=D;var X=s[Y].id;w[j][X]=D,S+=D}}),M.push(k)}),S/=2;for(var y=1/0,I=1/0,O=0,A=[],_={};;){a&&s.every(function(N){return N.hasOwnProperty("properties")})?y=Te(s,L,M,S)+de(s,h)*d:y=Te(s,L,M,S),O===0&&(I=y,A=s,_=E);var z=y>0&&y>I&&y-I<n;if(y>I&&(A=s.map(function(N){return{node:N,clusterId:N.clusterId}}),_=yt(E),I=y),z||O>100)break;O++,Object.keys(E).forEach(function(N){var C=0;l.forEach(function(k){var j=k.source,D=k.target,Y=b[j].node.clusterId,X=b[D].node.clusterId;(Y===N&&X!==N||X===N&&Y!==N)&&(C=C+(k[t]||1))}),E[N].sumTot=C}),s.forEach(function(N,C){var k=E[N.clusterId],j=0,D,Y=M[C]/(2*S),X=0,vr=k.nodes;vr.forEach(function(hr){var fr=b[hr.id].idx;X+=L[C][fr]||0});var lr=X-k.sumTot*Y,ur=vr.filter(function(hr){return hr.id!==N.id}),_r=[];ur.forEach(function(hr,fr){_r[fr]=h[hr.originIndex]});var ar=de(ur,h)*d,yr=w[N.id];if(Object.keys(yr).forEach(function(hr){var fr=b[hr].node,Tr=fr.clusterId;if(Tr!==N.clusterId){var br=E[Tr],Nr=br.nodes;if(!(!Nr||!Nr.length)){var T=0;Nr.forEach(function(V){var W=b[V.id].idx;T+=L[C][W]||0});var $=T-br.sumTot*Y,F=Nr.concat([N]),P=[];F.forEach(function(V,W){P[W]=h[V.originIndex]});var Z=de(F,h)*d,x=$-lr;a&&(x=$+Z-(lr+ar)),x>j&&(j=x,D=br)}}}),j>0){D.nodes.push(N);var er=N.clusterId;N.clusterId=D.id;var Br=k.nodes.indexOf(N);k.nodes.splice(Br,1);var cr=0,Hr=0;l.forEach(function(hr){var fr=hr.source,Tr=hr.target,br=b[fr].node.clusterId,Nr=b[Tr].node.clusterId;(br===D.id&&Nr!==D.id||Nr===D.id&&br!==D.id)&&(cr=cr+(hr[t]||1)),(br===er&&Nr!==er||Nr===er&&br!==er)&&(Hr=Hr+(hr[t]||1))}),D.sumTot=cr,k.sumTot=Hr}})}var q={},R=0;Object.keys(_).forEach(function(N){var C=_[N];if(!C.nodes||!C.nodes.length){delete _[N];return}var k=String(R+1);k!==N&&(C.id=k,C.nodes=C.nodes.map(function(j){return{id:j.id,clusterId:k}}),_[k]=C,q[N]=k,delete _[N],R++)}),A.forEach(function(N){var C=N.node,k=N.clusterId;C&&(C.clusterId=k,C.clusterId&&q[C.clusterId]&&(C.clusterId=q[C.clusterId]))});var B=[],H={};l.forEach(function(N){var C=N.source,k=N.target,j=N[t]||1,D=b[C].node.clusterId,Y=b[k].node.clusterId;if(!(!D||!Y)){var X="".concat(D,"---").concat(Y);if(H[X])H[X].weight+=j,H[X].count++;else{var vr={source:D,target:Y,weight:j,count:1};H[X]=vr,B.push(vr)}}});var G=[];return Object.keys(_).forEach(function(N){G.push(_[N])}),{clusters:G,clusterEdges:B}},Yr=St;var kt=function(r,e,t,n,a,i,u,o){return e===void 0&&(e=!1),t===void 0&&(t="weight"),n===void 0&&(n=1e-4),a===void 0&&(a=void 0),i===void 0&&(i=[]),u===void 0&&(u=["id"]),o===void 0&&(o=1),Yr(r,e,t,n,!0,a,i,u,o)},Re=kt;import{clone as Dt}from"/@antv/util@^2.0.13?target=es2022";var At=function(r,e){var t;e===void 0&&(e=1);for(var n=Dt(r),a=n.nodes,i=a===void 0?[]:a,u=n.edges,o=u===void 0?[]:u,d=function(){var c=Fr({nodes:i,edges:o}),l=Object.keys(c);l.sort(function(p,m){var E,b;return((E=c[p])===null||E===void 0?void 0:E.degree)-((b=c[m])===null||b===void 0?void 0:b.degree)});var h=l[0];if(!i.length||((t=c[h])===null||t===void 0?void 0:t.degree)>=e)return"break";var g=i.findIndex(function(p){return p.id===h});i.splice(g,1),o=o.filter(function(p){return!(p.source===h||p.target===h)})};;){var v=d();if(v==="break")break}return{nodes:i,edges:o}},qe=At;import{isEqual as Ot,uniq as jt}from"/@antv/util@^2.0.13?target=es2022";var Fe=function(r,e,t){var n=[];switch(r){case mr.EuclideanDistance:n=e[t];break;default:n=[];break}return n},Tt=function(r,e,t,n,a,i){e===void 0&&(e=3),t===void 0&&(t=void 0),n===void 0&&(n=[]),a===void 0&&(a=["id"]),i===void 0&&(i=mr.EuclideanDistance);var u=r.nodes,o=u===void 0?[]:u,d=r.edges,v=d===void 0?[]:d,s={clusters:[{id:"0",nodes:o}],clusterEdges:[]};if(i===mr.EuclideanDistance&&!o.every(function(k){return k.hasOwnProperty(t)}))return s;var c=[],l=[];if(i===mr.EuclideanDistance&&(c=Gr(o,t),l=Ur(c,n,a)),!l.length)return s;for(var h=jt(l.map(function(k){return k.join("")})),g=Math.min(e,o.length,h.length),p=0;p<o.length;p++)o[p].originIndex=p;for(var m=[],E=[],b=[],p=0;p<g;p++)if(p===0){var L=Math.floor(Math.random()*o.length);switch(i){case mr.EuclideanDistance:m[p]=l[L];break;default:m[p]=[];break}E.push(L),b[p]=[o[L]],o[L].clusterId=String(p)}else{for(var M=-1/0,w=0,S=function(D){if(!E.includes(D)){for(var Y=0,X=0;X<m.length;X++){var vr=0;switch(i){case mr.EuclideanDistance:vr=se(l[o[D].originIndex],m[X],i);break;default:break}Y+=vr}var lr=Y/m.length;lr>M&&!m.find(function(ur){return Ot(ur,Fe(i,l,o[D].originIndex))})&&(M=lr,w=D)}},y=0;y<o.length;y++)S(y);m[p]=Fe(i,l,w),E.push(w),b[p]=[o[w]],o[w].clusterId=String(p)}for(var I=0;;){for(var p=0;p<o.length;p++){var O=0,A=1/0;if(!(I===0&&E.includes(p))){for(var _=0;_<m.length;_++){var z=0;switch(i){case mr.EuclideanDistance:z=se(l[p],m[_],i);break;default:break}z<A&&(A=z,O=_)}if(o[p].clusterId!==void 0)for(var q=b[Number(o[p].clusterId)].length-1;q>=0;q--)b[Number(o[p].clusterId)][q].id===o[p].id&&b[Number(o[p].clusterId)].splice(q,1);o[p].clusterId=String(O),b[O].push(o[p])}}for(var R=!1,p=0;p<b.length;p++){for(var B=b[p],H=new or([]),_=0;_<B.length;_++)H=H.add(new or(l[B[_].originIndex]));var G=H.avg(B.length);G.equal(new or(m[p]))||(R=!0,m[p]=G.getArr())}if(I++,o.every(function(k){return k.clusterId!==void 0})&&R||I>=1e3)break}var N=[],C={};return v.forEach(function(k){var j,D,Y=k.source,X=k.target,vr=(j=o.find(function(ar){return ar.id===Y}))===null||j===void 0?void 0:j.clusterId,lr=(D=o.find(function(ar){return ar.id===X}))===null||D===void 0?void 0:D.clusterId,ur="".concat(vr,"---").concat(lr);if(C[ur])C[ur].count++;else{var _r={source:vr,target:lr,count:1};C[ur]=_r,N.push(_r)}}),{clusters:b,clusterEdges:N}},Ge=Tt;var Rt=function(r,e){var t=new or(e),n=t.norm2(),a=new or(r),i=a.norm2(),u=t.dot(a),o=n*i,d=o?u/o:0;return d},Zr=Rt;import{clone as qt}from"/@antv/util@^2.0.13?target=es2022";var Ft=function(r,e,t,n,a){r===void 0&&(r=[]),t===void 0&&(t=void 0),n===void 0&&(n=[]),a===void 0&&(a=[]);var i=qt(r.filter(function(c){return c.id!==e.id})),u=r.findIndex(function(c){return c.id===e.id}),o=Gr(r,t),d=Ur(o,n,a),v=d[u],s=[];return i.forEach(function(c,l){if(c.id!==e.id){var h=d[l],g=Zr(h,v);s.push(g),c.cosineSimilarity=g}}),i.sort(function(c,l){return l.cosineSimilarity-c.cosineSimilarity}),{allCosineSimilarity:s,similarNodes:i}},Ue=Ft;var Gt=(function(){function f(r){this.count=r.length,this.parent={};for(var e=0,t=r;e<t.length;e++){var n=t[e];this.parent[n]=n}}return f.prototype.find=function(r){for(;this.parent[r]!==r;)r=this.parent[r];return r},f.prototype.union=function(r,e){var t=this.find(r),n=this.find(e);t!==n&&(t<n?(this.parent[e]!==e&&this.union(this.parent[e],r),this.parent[e]=this.parent[r]):(this.parent[r]!==r&&this.union(this.parent[r],e),this.parent[r]=this.parent[e]))},f.prototype.connected=function(r,e){return this.find(r)===this.find(e)},f})(),Be=Gt;var Ut=function(r,e){return r-e},Bt=(function(){function f(r){r===void 0&&(r=Ut),this.compareFn=r,this.list=[]}return f.prototype.getLeft=function(r){return 2*r+1},f.prototype.getRight=function(r){return 2*r+2},f.prototype.getParent=function(r){return r===0?null:Math.floor((r-1)/2)},f.prototype.isEmpty=function(){return this.list.length<=0},f.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},f.prototype.delMin=function(){var r=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),r},f.prototype.insert=function(r){if(r!==null){this.list.push(r);var e=this.list.length-1;return this.moveUp(e),!0}return!1},f.prototype.moveUp=function(r){for(var e=this.getParent(r);r&&r>0&&this.compareFn(this.list[e],this.list[r])>0;){var t=this.list[e];this.list[e]=this.list[r],this.list[r]=t,r=e,e=this.getParent(r)}},f.prototype.moveDown=function(r){var e,t=r,n=this.getLeft(r),a=this.getRight(r),i=this.list.length;n!==null&&n<i&&this.compareFn(this.list[t],this.list[n])>0?t=n:a!==null&&a<i&&this.compareFn(this.list[t],this.list[a])>0&&(t=a),r!==t&&(e=[this.list[t],this.list[r]],this.list[r]=e[0],this.list[t]=e[1],this.moveDown(t))},f})(),He=Bt;var Ht=function(r,e){var t=[],n=r.nodes,a=n===void 0?[]:n,i=r.edges,u=i===void 0?[]:i;if(a.length===0)return t;var o=a[0],d=new Set;d.add(o);var v=function(p,m){return e?p.weight-m.weight:0},s=new He(v);for(qr(o.id,u).forEach(function(g){s.insert(g)});!s.isEmpty();){var c=s.delMin(),l=c.source,h=c.target;d.has(l)&&d.has(h)||(t.push(c),d.has(l)||(d.add(l),qr(l,u).forEach(function(g){s.insert(g)})),d.has(h)||(d.add(h),qr(h,u).forEach(function(g){s.insert(g)})))}return t},Ve=function(r,e){var t=[],n=r.nodes,a=n===void 0?[]:n,i=r.edges,u=i===void 0?[]:i;if(a.length===0)return t;var o=u.map(function(l){return l});e&&o.sort(function(l,h){return l.weight-h.weight});for(var d=new Be(a.map(function(l){return l.id}));o.length>0;){var v=o.shift(),s=v.source,c=v.target;d.connected(s,c)||(t.push(v),d.union(s,c))}return t},Vt=function(r,e,t){var n={prim:Ht,kruskal:Ve};return t?n[t](r,e):Ve(r,e)},ze=Vt;var zt=function(r,e,t){typeof e!="number"&&(e=1e-6),typeof t!="number"&&(t=.85);for(var n=1,a=0,i=1e3,u=r.nodes,o=u===void 0?[]:u,d=r.edges,v=d===void 0?[]:d,s=o.length,c,l={},h={},g=0;g<s;++g){var p=o[g],m=p.id;l[m]=1/s,h[m]=1/s}for(var E=Fr(r);i>0&&n>e;){a=0;for(var g=0;g<s;++g){var p=o[g],m=p.id;if(c=0,E[p.id].inDegree===0)l[m]=0;else{for(var b=nr(m,v,"source"),L=0;L<b.length;++L){var M=b[L],w=E[M].outDegree;w>0&&(c+=h[M]/w)}l[m]=t*c,a+=l[m]}}a=(1-a)/s,n=0;for(var g=0;g<s;++g){var p=o[g],m=p.id;c=l[m]+a,n+=Math.abs(c-h[m]),h[m]=c}i-=1}return h},Pe=zt;import{__spreadArray as Xe}from"/tslib@^2.0.0?target=es2022";import{clone as Qt}from"/@antv/util@^2.0.13?target=es2022";var Pt=-1,Kr=-1,ve="-1",Mr="-1",le=-1;var We=(function(){function f(r,e,t,n){r===void 0&&(r=Pt),e===void 0&&(e=Kr),t===void 0&&(t=Kr),n===void 0&&(n=ve),this.id=r,this.from=e,this.to=t,this.label=n}return f})();var Wt=(function(){function f(r,e){r===void 0&&(r=Kr),e===void 0&&(e=Mr),this.id=r,this.label=e,this.edges=[],this.edgeMap={}}return f.prototype.addEdge=function(r){this.edges.push(r),this.edgeMap[r.id]=r},f})();var ce=(function(){function f(r,e,t){r===void 0&&(r=Kr),e===void 0&&(e=!0),t===void 0&&(t=!1),this.id=r,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=t}return f.prototype.getNodeNum=function(){return this.nodes.length},f.prototype.addNode=function(r,e){if(!this.nodeMap[r]){var t=new Wt(r,e);this.nodes.push(t),this.nodeMap[r]=t,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(r)}},f.prototype.addEdge=function(r,e,t,n){if((this.edgeIdAutoIncrease||r===void 0)&&(r=this.counter++),!(this.nodeMap[e]&&this.nodeMap[t]&&this.nodeMap[t].edgeMap[r])){var a=new We(r,e,t,n);if(this.edges.push(a),this.edgeMap[r]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[n]||(this.edgeLabelMap[n]=[]),this.edgeLabelMap[n].push(a),!this.directed){var i=new We(r,t,e,n);this.nodeMap[t].addEdge(i),this.edgeLabelMap[n].push(i)}}},f})();var jr=(function(){function f(r,e,t,n,a){this.fromNode=r,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:t||Mr,edgeLabel:n||ve,nodeLabel2:a||Mr}}return f.prototype.equalTo=function(r){return this.fromNode===r.formNode&&this.toNode===r.toNode&&this.nodeEdgeNodeLabel===r.nodeEdgeNodeLabel},f.prototype.notEqualTo=function(r){return!this.equalTo(r)},f})(),Qe=(function(){function f(){this.rmpath=[],this.dfsEdgeList=[]}return f.prototype.equalTo=function(r){var e=this.dfsEdgeList.length,t=r.length;if(e!==t)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==r[n])return!1;return!0},f.prototype.notEqualTo=function(r){return!this.equalTo(r)},f.prototype.pushBack=function(r,e,t,n,a){return this.dfsEdgeList.push(new jr(r,e,t,n,a)),this.dfsEdgeList},f.prototype.toGraph=function(r,e){r===void 0&&(r=le),e===void 0&&(e=!1);var t=new ce(r,!0,e);return this.dfsEdgeList.forEach(function(n){var a=n.fromNode,i=n.toNode,u=n.nodeEdgeNodeLabel,o=u.nodeLabel1,d=u.edgeLabel,v=u.nodeLabel2;o!==Mr&&t.addNode(a,o),v!==Mr&&t.addNode(i,v),o!==Mr&&v!==o&&t.addEdge(void 0,a,i,d)}),t},f.prototype.buildRmpath=function(){this.rmpath=[];for(var r=void 0,e=this.dfsEdgeList.length,t=e-1;t>=0;t--){var n=this.dfsEdgeList[t],a=n.fromNode,i=n.toNode;a<i&&(r===void 0||i===r)&&(this.rmpath.push(t),r=a)}return this.rmpath},f.prototype.getNodeNum=function(){var r={};return this.dfsEdgeList.forEach(function(e){r[e.fromNode]||(r[e.fromNode]=!0),r[e.toNode]||(r[e.toNode]=!0)}),Object.keys(r).length},f})(),re=(function(){function f(r){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!r){for(;r;){var e=r.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,r=r.preNode}this.edges=this.edges.reverse()}}return f.prototype.hasNode=function(r){return this.nodesUsed[r.id]===1},f.prototype.hasEdge=function(r){return this.edgesUsed[r.id]===1},f})(),$t=(function(){function f(r){var e=r.graphs,t=r.minSupport,n=t===void 0?2:t,a=r.minNodeNum,i=a===void 0?1:a,u=r.maxNodeNum,o=u===void 0?4:u,d=r.top,v=d===void 0?10:d,s=r.directed,c=s===void 0?!1:s,l=r.verbose,h=l===void 0?!1:l;this.graphs=e,this.dfsCode=new Qe,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=n,this.top=v,this.directed=c,this.counter=0,this.maxNodeNum=o,this.minNodeNum=i,this.verbose=h,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return f.prototype.findForwardRootEdges=function(r,e){var t=this,n=[],a=r.nodeMap;return e.edges.forEach(function(i){(t.directed||e.label<=a[i.to].label)&&n.push(i)}),n},f.prototype.findBackwardEdge=function(r,e,t,n){if(!this.directed&&e===t)return null;for(var a=r.nodeMap,i=a[t.to],u=i.edges,o=u.length,d=0;d<o;d++){var v=u[d];if(!(n.hasEdge(v)||v.to!==e.from)){if(this.directed){if(a[e.from].label<a[t.to].label||a[e.from].label===a[t.to].label&&e.label<=v.label)return v}else if(e.label<v.label||e.label===v.label&&a[e.to].label<=a[t.to].label)return v}}return null},f.prototype.findForwardPureEdges=function(r,e,t,n){for(var a=[],i=e.to,u=r.nodeMap[i].edges,o=u.length,d=0;d<o;d++){var v=u[d],s=r.nodeMap[v.to];t<=s.label&&!n.hasNode(s)&&a.push(v)}return a},f.prototype.findForwardRmpathEdges=function(r,e,t,n){for(var a=[],i=r.nodeMap,u=i[e.to].label,o=i[e.from],d=o.edges,v=d.length,s=0;s<v;s++){var c=d[s],l=i[c.to].label;e.to===c.to||t>l||n.hasNode(i[c.to])||(e.label<c.label||e.label===c.label&&u<=l)&&a.push(c)}return a},f.prototype.getSupport=function(r){var e={};return r.forEach(function(t){e[t.graphId]||(e[t.graphId]=!0)}),Object.keys(e).length},f.prototype.findMinLabel=function(r){var e=void 0;return Object.keys(r).forEach(function(t){var n=r[t],a=n.nodeLabel1,i=n.edgeLabel,u=n.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:i,nodeLabel2:u};return}(a<e.nodeLabel1||a===e.nodeLabel1&&i<e.edgeLabel||a===e.nodeLabel1&&i===e.edgeLabel&&u<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:i,nodeLabel2:u})}),e},f.prototype.isMin=function(){var r=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var t=this.directed,n=e.toGraph(le,t),a=n.nodeMap,i=new Qe,u={};n.nodes.forEach(function(s){var c=r.findForwardRootEdges(n,s);c.forEach(function(l){var h=a[l.to],g="".concat(s.label,"-").concat(l.label,"-").concat(h.label);u[g]||(u[g]={projected:[],nodeLabel1:s.label,edgeLabel:l.label,nodeLabel2:h.label});var p={graphId:n.id,edge:l,preNode:null};u[g].projected.push(p)})});var o=this.findMinLabel(u);if(o){i.dfsEdgeList.push(new jr(0,1,o.nodeLabel1,o.edgeLabel,o.nodeLabel2));var d=function s(c){for(var l=i.buildRmpath(),h=i.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,g=i.dfsEdgeList[l[0]].toNode,p={},m=!1,E=0,b=t?-1:0,L=function(H){if(m)return"break";c.forEach(function(G){var N=new re(G),C=r.findBackwardEdge(n,N.edges[l[H]],N.edges[l[0]],N);C&&(p[C.label]||(p[C.label]={projected:[],edgeLabel:C.label}),p[C.label].projected.push({graphId:n.id,edge:p,preNode:G}),E=i.dfsEdgeList[l[H]].fromNode,m=!0)})},M=l.length-1;M>b;M--){var w=L(M);if(w==="break")break}if(m){var S=r.findMinLabel(p);i.dfsEdgeList.push(new jr(g,E,Mr,S.edgeLabel,Mr));var y=i.dfsEdgeList.length-1;return r.dfsCode.dfsEdgeList[y]!==i.dfsEdgeList[y]?!1:s(p[S.edgeLabel].projected)}var I={};m=!1;var O=0;c.forEach(function(B){var H=new re(B),G=r.findForwardPureEdges(n,H.edges[l[0]],h,H);G.length>0&&(m=!0,O=g,G.forEach(function(N){var C="".concat(N.label,"-").concat(a[N.to].label);I[C]||(I[C]={projected:[],edgeLabel:N.label,nodeLabel2:a[N.to].label}),I[C].projected.push({graphId:n.id,edge:N,preNode:B})}))});for(var A=l.length,_=function(H){if(m)return"break";var G=l[H];c.forEach(function(N){var C=new re(N),k=r.findForwardRmpathEdges(n,C.edges[G],h,C);k.length>0&&(m=!0,O=i.dfsEdgeList[G].fromNode,k.forEach(function(j){var D="".concat(j.label,"-").concat(a[j.to].label);I[D]||(I[D]={projected:[],edgeLabel:j.label,nodeLabel2:a[j.to].label}),I[D].projected.push({graphId:n.id,edge:j,preNode:N})}))})},M=0;M<A;M++){var z=_(M);if(z==="break")break}if(!m)return!0;var q=r.findMinLabel(I);i.dfsEdgeList.push(new jr(O,g+1,Mr,q.edgeLabel,q.nodeLabel2));var R=i.dfsEdgeList.length-1;return e.dfsEdgeList[R]!==i.dfsEdgeList[R]?!1:s(I["".concat(q.edgeLabel,"-").concat(q.nodeLabel2)].projected)},v="".concat(o.nodeLabel1,"-").concat(o.edgeLabel,"-").concat(o.nodeLabel2);return d(u[v].projected)}},f.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var r=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Qt(r))}},f.prototype.subGraphMining=function(r){var e=this,t=this.getSupport(r);if(!(t<this.minSupport)&&this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),i=this.dfsCode.dfsEdgeList[a[0]].toNode,u=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,o={},d={};r.forEach(function(v){for(var s=e.graphs[v.graphId],c=s.nodeMap,l=new re(v),h=a.length-1;h>=0;h--){var g=e.findBackwardEdge(s,l.edges[a[h]],l.edges[a[0]],l);if(g){var p="".concat(e.dfsCode.dfsEdgeList[a[h]].fromNode,"-").concat(g.label);d[p]||(d[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[h]].fromNode,edgeLabel:g.label}),d[p].projected.push({graphId:v.graphId,edge:g,preNode:v})}}if(!(n>=e.maxNodeNum)){var m=e.findForwardPureEdges(s,l.edges[a[0]],u,l);m.forEach(function(b){var L="".concat(i,"-").concat(b.label,"-").concat(c[b.to].label);o[L]||(o[L]={projected:[],fromNodeId:i,edgeLabel:b.label,nodeLabel2:c[b.to].label}),o[L].projected.push({graphId:v.graphId,edge:b,preNode:v})});for(var E=function(L){var M=e.findForwardRmpathEdges(s,l.edges[a[L]],u,l);M.forEach(function(w){var S="".concat(e.dfsCode.dfsEdgeList[a[L]].fromNode,"-").concat(w.label,"-").concat(c[w.to].label);o[S]||(o[S]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[L]].fromNode,edgeLabel:w.label,nodeLabel2:c[w.to].label}),o[S].projected.push({graphId:v.graphId,edge:w,preNode:v})})},h=0;h<a.length;h++)E(h)}}),Object.keys(d).forEach(function(v){var s=d[v],c=s.toNodeId,l=s.edgeLabel;e.dfsCode.dfsEdgeList.push(new jr(i,c,"-1",l,"-1")),e.subGraphMining(d[v].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(o).forEach(function(v){var s=o[v],c=s.fromNodeId,l=s.edgeLabel,h=s.nodeLabel2;e.dfsCode.dfsEdgeList.push(new jr(c,i+1,Mr,l,h)),e.subGraphMining(o[v].projected),e.dfsCode.dfsEdgeList.pop()})}},f.prototype.generate1EdgeFrequentSubGraphs=function(){var r=this.graphs,e=this.directed,t=this.minSupport,n=this.frequentSize1Subgraphs,a={},i={},u={},o={};return Object.keys(r).forEach(function(d){var v=r[d],s=v.nodeMap;v.nodes.forEach(function(c,l){var h=c.label,g="".concat(d,"-").concat(h);if(!u[g]){var p=a[h]||0;p++,a[h]=p}u[g]={graphKey:d,label:h},c.edges.forEach(function(m){var E=h,b=s[m.to].label;if(!e&&E>b){var L=b;b=E,E=L}var M=m.label,w="".concat(d,"-").concat(E,"-").concat(M,"-").concat(b),S="".concat(E,"-").concat(M,"-").concat(b);if(!i[S]){var y=i[S]||0;y++,i[S]=y}o[w]={graphId:d,nodeLabel1:E,edgeLabel:M,nodeLabel2:b}})})}),Object.keys(a).forEach(function(d){var v=a[d];if(!(v<t)){var s={nodes:[],edges:[]};s.nodes.push({id:"0",label:d}),n.push(s)}}),n},f.prototype.run=function(){var r=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,t=this.directed,n={};Object.keys(e).forEach(function(a){var i=e[a],u=i.nodeMap;i.nodes.forEach(function(o){var d=r.findForwardRootEdges(i,o);d.forEach(function(v){var s=u[v.to],c="".concat(o.label,"-").concat(v.label,"-").concat(s.label);n[c]||(n[c]={projected:[],nodeLabel1:o.label,edgeLabel:v.label,nodeLabel2:s.label});var l={graphId:a,edge:v,preNode:null};n[c].projected.push(l)})})}),Object.keys(n).forEach(function(a){var i=n[a],u=i.projected,o=i.nodeLabel1,d=i.edgeLabel,v=i.nodeLabel2;r.dfsCode.dfsEdgeList.push(new jr(0,1,o,d,v)),r.subGraphMining(u),r.dfsCode.dfsEdgeList.pop()})}},f})(),Jt=function(r,e,t,n){var a={};return Object.keys(r).forEach(function(i,u){var o=r[i],d=new ce(u,!0,e),v={};o.nodes.forEach(function(s,c){d.addNode(c,s[t]),v[s.id]=c}),o.edges.forEach(function(s,c){var l=v[s.source],h=v[s.target];d.addEdge(-1,l,h,s[n])}),d&&d.getNodeNum()&&(a[d.id]=d)}),a},Xt=function(r,e,t){var n=[];return r.forEach(function(a){var i={nodes:[],edges:[]};a.nodes.forEach(function(u){var o;i.nodes.push((o={id:"".concat(u.id)},o[e]=u.label,o))}),a.edges.forEach(function(u){var o;i.edges.push((o={source:"".concat(u.from),target:"".concat(u.to)},o[t]=u.label,o))}),n.push(i)}),n},$e="cluster",Yt=function(r){var e=r.graphs,t=r.directed,n=t===void 0?!1:t,a=r.nodeLabelProp,i=a===void 0?$e:a,u=r.edgeLabelProp,o=u===void 0?$e:u,d=Jt(e,n,i,o),v=r.minSupport,s=r.maxNodeNum,c=r.minNodeNum,l=r.verbose,h=r.top,g={graphs:d,minSupport:v,maxNodeNum:s,minNodeNum:c,top:h,verbose:l,directed:n},p=new $t(g);p.run();var m=Xt(p.frequentSubgraphs,i,o);return m},Je=Yt;var Ye=function(r,e,t,n){t===void 0&&(t="cluster"),n===void 0&&(n=2);var a=[],i=r.nodes;return e.forEach(function(u,o){a.push(tt(i,u,o,t,n))}),a},tt=function(r,e,t,n,a){var i=[t],u=[],o={};return e.forEach(function(d,v){if(d<=a&&t!==v){i.push(v),u.push(r[v]);var s=r[v][n];o[s]?(o[s].count++,o[s].dists.push(d)):o[s]={count:1,dists:[d]}}}),Object.keys(o).forEach(function(d){o[d].dists=o[d].dists.sort(function(v,s){return v-s})}),{nodeIdx:t,nodeId:r[t].id,nodeIdxs:i,neighbors:u,neighborNum:i.length-1,nodeLabelCountMap:o}},Zt=function(r,e,t,n,a){var i=Math.ceil(t/e),u={},o=0;return n.forEach(function(d,v){for(var s=0,c=0,l=d.nodeIdxs,h=d.neighborNum-1;s<i;){for(var g=l[1+Math.floor(Math.random()*h)],p=0;(u["".concat(v,"-").concat(g)]||u["".concat(g,"-").concat(v)])&&(g=Math.floor(Math.random()*e),p++,!(p>2*e)););if(p<2*e&&(u["".concat(v,"-").concat(g)]={start:v,end:g,distance:a[v][g]},s++,o++,o>=t))return u;if(c++,c>2*e)break}if(s<i){var m=i-s;i=(i+m)/(e-v-1)}}),u},ee=function(r,e,t,n){var a=t.nodes;return n||(n={}),Object.keys(r).forEach(function(i){var u,o;if(!(n&&n[i])){n[i]={nodes:[],edges:[]};var d=r[i],v=(u=e[d.start])===null||u===void 0?void 0:u.nodeIdxs,s=(o=e[d.end])===null||o===void 0?void 0:o.nodeIdxs;if(!(!v||!s)){var c=new Set(s),l=v.filter(function(E){return c.has(E)});if(!(!l||!l.length)){for(var h={},g=l.length,p=0;p<g;p++){var m=a[l[p]];n[i].nodes.push(m),h[m.id]=!0}t.edges.forEach(function(E){h[E.source]&&h[E.target]&&n[i].edges.push(E)})}}}}),n},te=function(r,e,t,n){var a,i,u={};r.nodes.forEach(function(d){u[d.id]=d});var o=0;return!(!((a=e?.edges)===null||a===void 0)&&a.length)||((i=e?.nodes)===null||i===void 0?void 0:i.length)<2?0:(r.edges.forEach(function(d){var v=u[d.source][t],s=u[d.target][t],c=e?.nodes[0][t],l=e?.nodes[1][t],h=e?.edges[0][n];d[n]===h&&(v===c&&s===l||v===l&&s===c)&&o++}),o)},Kt=function(r,e,t){for(var n=1/0,a=0,i=function(d){var v=r[d],s=Object.keys(v).sort(function(E,b){return v[E]-v[b]}),c=10,l=[];s.forEach(function(E,b){l[b%c]||(l[b%c]={graphs:[],totalCount:0,aveCount:0}),l[b%c].graphs.push(E),l[b%c].totalCount+=v[E]});var h=0,g=[];l.forEach(function(E){var b=E.totalCount/E.graphs.length;E.aveCount=b,g.push(b);var L=0,M=E.length;E.graphs.forEach(function(w,S){var y=v[w];E.graphs.forEach(function(I,O){S!==O&&(L+=Math.abs(y-v[I]))})}),L/=M*(M-1)/2,h+=L}),h/=l.length;var p=0;g.forEach(function(E,b){g.forEach(function(L,M){b!==M&&(p+=Math.abs(E-L))}),p/=g.length*(g.length-1)/2});var m=p-h;n<m&&(n=m,a=d)},u=0;u<e;u++)i(u);return{structure:t[a],structureCountMap:r[a]}},Ze=function(r,e){var t={},n={};return r.forEach(function(a,i){t[a.id]={idx:i,node:a,degree:0,inDegree:0,outDegree:0};var u=a[e];n[u]||(n[u]=[]),n[u].push(a)}),{nodeMap:t,nodeLabelMap:n}},Ke=function(r,e,t){var n={},a={};return r.forEach(function(i,u){n["".concat(Xr)]={idx:u,edge:i};var o=i[e];a[o]||(a[o]=[]),a[o].push(i);var d=t[i.source];d&&(d.degree++,d.outDegree++);var v=t[i.target];v&&(v.degree++,v.inDegree++)}),{edgeMap:n,edgeLabelMap:a}},rt=function(r,e,t){var n=e.length,a={};return e.forEach(function(i,u){for(var o=t?0:u+1,d=r[u].id,v=o;v<n;v++)if(u!==v){var s=r[v].id,c=i[v];a["".concat(d,"-").concat(s)]=c,t||(a["".concat(s,"-").concat(d)]=c)}}),a},rn=function(r,e,t,n,a,i,u,o,d,v,s){var c,l="".concat(e.id,"-").concat(t.id);if(v&&v[l])return v[l];var h=s?s[l]:void 0;if(!h){var g=(c={},c[l]={start:n[e.id].idx,end:n[t.id].idx,distance:a},c);s=ee(g,i,r,s),h=s[l]}return te(h,u,o,d)},et=function(r,e,t,n){var a,i,u,o=(a=r[e])===null||a===void 0?void 0:a.degree,d=(i=r[e])===null||i===void 0?void 0:i.inDegree,v=(u=r[e])===null||u===void 0?void 0:u.outDegree;return r[e]===void 0&&(o=1/0,d=1/0,v=1/0,n[e].forEach(function(s){var c=t[s.id].degree;o>c&&(o=c);var l=t[s.id].inDegree;d>l&&(d=l);var h=t[s.id].outDegree;v>h&&(v=h)}),r[e]={degree:o,inDegree:d,outDegree:v}),{minPatternNodeLabelDegree:o,minPatternNodeLabelInDegree:d,minPatternNodeLabelOutDegree:v}},en=function(r,e,t,n,a,i,u){var o;if(t===void 0&&(t=!1),i===void 0&&(i="cluster"),u===void 0&&(u="cluster"),!(!r||!r.nodes)){var d=r.nodes.length;if(d){var v=Wr(r,t),s=Wr(e,t),c=rt(r.nodes,v,t),l=rt(e.nodes,s,t),h=Ze(r.nodes,i),g=h.nodeMap,p=h.nodeLabelMap,m=Ze(e.nodes,i),E=m.nodeMap,b=m.nodeLabelMap;Ke(r.edges,u,g);var L=Ke(e.edges,u,E).edgeLabelMap,M=[];s?.forEach(function(T){M=M.concat(T)}),a||(a=Math.max.apply(Math,Xe(Xe([],M,!1),[2],!1))),n||(n=a);var w=Ye(r,v,i,n),S=Ye(e,s,i,n),y=Math.min(100,d*(d-1)/2),I=Zt(n,d,y,w,v),O=ee(I,w,r),A=10,_=1,z=1,q=4,R={graphs:O,nodeLabelProp:i,edgeLabelProp:u,minSupport:_,minNodeNum:z,maxNodeNum:q,directed:t},B=Je(R).slice(0,A),H=B.length,G=[];B.forEach(function(T,$){G[$]={},Object.keys(O).forEach(function(F){var P=O[F],Z=te(P,T,i,u);G[$][F]=Z})});var N=Kt(G,H,B),C=N.structure,k=N.structureCountMap,j=e.nodes[0],D=[],Y=(o=e.nodes[0])===null||o===void 0?void 0:o[i],X=-1/0;e.nodes.forEach(function(T){var $=T[i],F=p[$];F?.length>X&&(X=F.length,D=F,Y=$,j=T)});var vr={},lr={},ur={},_r={},ar={},yr={};Object.keys(b).forEach(function(T,$){ar[T]=[],t&&(yr[T]=[]);var F=-1/0,P=b[T],Z={};P.forEach(function(Q){var U=l["".concat(j.id,"-").concat(Q.id)];if(U&&ar[T].push(U),F<U&&(F=U),Z["".concat(j.id,"-").concat(Q.id)]={start:0,end:E[Q.id].idx,distance:U},t){var K=l["".concat(Q.id,"-").concat(j.id)];K&&yr[T].push(K)}}),ar[T]=ar[T].sort(function(Q,U){return Q-U}),t&&(yr[T]=yr[T].sort(function(Q,U){return Q-U})),lr=ee(Z,S,e,lr);var x=[];if(Object.keys(Z).forEach(function(Q){if(ur[Q]){x.push(ur[Q]);return}var U=lr[Q];ur[Q]=te(U,C,i,u),x.push(ur[Q])}),x=x.sort(function(Q,U){return U-Q}),_r["".concat(j.id,"-").concat(T)]=x,T!==Y)for(var V=D?.length||0,W=function(U){var K=D[U],pr=w[g[K.id].idx],rr=pr.nodeLabelCountMap[T],Dr=b[T].length;if(!rr||rr.count<Dr)return D.splice(U,1),"continue";for(var Rr=!1,sr=0;sr<Dr;sr++)if(rr.dists[sr]>ar[T][sr]){Rr=!0;break}if(Rr)return D.splice(U,1),"continue";var Er={};pr.neighbors.forEach(function(dr){var Lr=c["".concat(K.id,"-").concat(dr.id)];Er["".concat(K.id,"-").concat(dr.id)]={start:g[K.id].idx,end:g[dr.id].idx,distance:Lr}}),O=ee(Er,w,r,O);var wr=[];Object.keys(Er).forEach(function(dr){if(k[dr]){wr.push(k[dr]);return}var Lr=O[dr];k[dr]=te(Lr,C,i,u),wr.push(k[dr])}),wr=wr.sort(function(dr,Lr){return Lr-dr});for(var Sr=!1,sr=0;sr<Dr;sr++)if(wr[sr]<x[sr]){Sr=!0;break}if(Sr)return D.splice(U,1),"continue"},ir=V-1;ir>=0;ir--)W(ir)});var er=[];D?.forEach(function(T){for(var $=g[T.id].idx,F=tt(r.nodes,v[$],$,i,a),P=F.neighbors,Z=P.length,x=!1,V=Z-1;V>=0;V--){if(P.length+1<e.nodes.length){x=!0;return}var W=P[V],ir=W[i];if(!b[ir]||!b[ir].length){P.splice(V,1);continue}if(!ar[ir]||!ar[ir].length){P.splice(V,1);continue}var Q="".concat(T.id,"-").concat(W.id),U=c[Q],K=ar[ir].length-1,pr=ar[ir][K];if(U>pr){P.splice(V,1);continue}if(t){var rr="".concat(W.id,"-").concat(T.id),Dr=c[rr];K=yr[ir].length-1;var Rr=yr[ir][K];if(Dr>Rr){P.splice(V,1);continue}}var sr=k[Q]?k[Q]:rn(r,T,W,g,U,w,C,i,u,k,O),Er="".concat(j.id,"-").concat(ir),wr=_r[Er][_r[Er].length-1];if(sr<wr){P.splice(V,1);continue}var Sr=et(vr,ir,E,b),dr=Sr.minPatternNodeLabelDegree,Lr=Sr.minPatternNodeLabelInDegree,xr=Sr.minPatternNodeLabelOutDegree;if(g[W.id].degree<dr){P.splice(V,1);continue}}x||er.push({nodes:[T].concat(P)})});var Br=Or(e,j.id,!1).length,cr={};t?(Object.keys(Br).forEach(function(T){var $=E[T].node[i];cr[$]?cr[$].push(Br[T]):cr[$]=[Br[T]]}),Object.keys(cr).forEach(function(T){cr[T].sort(function($,F){return $-F})})):cr=ar;for(var Hr=er.length,hr=function($){var F=er[$],P=F.nodes[0],Z={},x={};F.nodes.forEach(function(J,gr){x[J.id]={idx:gr,node:J,degree:0,inDegree:0,outDegree:0};var tr=J[i];Z[tr]?Z[tr]++:Z[tr]=1});var V=[],W={};r.edges.forEach(function(J){x[J.source]&&x[J.target]&&(V.push(J),W[J[u]]?W[J[u]]++:W[J[u]]=1,x[J.source].degree++,x[J.target].degree++,x[J.source].outDegree++,x[J.target].inDegree++)});for(var ir=Object.keys(L).length,Q=!1,U=0;U<ir;U++){var K=Object.keys(L)[U];if(!W[K]||W[K]<L[K].length){Q=!0;break}}if(Q)return er.splice($,1),"continue";var pr=V.length;if(pr<e.edges.length)return er.splice($,1),"break";for(var rr=!1,Dr=function(gr){var tr=V[gr],Cr=tr[u],Ar=L[Cr];if(!Ar||!Ar.length)return W[Cr]--,Ar&&W[Cr]<Ar.length?(rr=!0,"break"):(V.splice(gr,1),x[tr.source].degree--,x[tr.target].degree--,x[tr.source].outDegree--,x[tr.target].inDegree--,"continue");var ge=x[tr.source].node[i],me=x[tr.target].node[i],ie=!1;if(Ar.forEach(function(be){var Ee=E[be.source].node,Ne=E[be.target].node;Ee[i]===ge&&Ne[i]===me&&(ie=!0),!t&&Ee[i]===me&&Ne[i]===ge&&(ie=!0)}),!ie)return W[Cr]--,Ar&&W[Cr]<Ar.length?(rr=!0,"break"):(V.splice(gr,1),x[tr.source].degree--,x[tr.target].degree--,x[tr.source].outDegree--,x[tr.target].inDegree--,"continue")},U=pr-1;U>=0;U--){var Rr=Dr(U);if(Rr==="break")break}if(rr)return er.splice($,1),"continue";F.edges=V;var sr=Or(F,F.nodes[0].id,!1).length;if(Object.keys(sr).reverse().forEach(function(J){if(!(J===F.nodes[0].id||rr)){if(sr[J]===1/0){var gr=x[J].node[i];if(Z[gr]--,Z[gr]<b[gr].length){rr=!0;return}var tr=F.nodes.indexOf(x[J].node);F.nodes.splice(tr,1),x[J]=void 0;return}var Cr=g[J].node[i];if(!cr[Cr]||!cr[Cr].length||sr[J]>cr[Cr][cr[Cr].length-1]){var gr=x[J].node[i];if(Z[gr]--,Z[gr]<b[gr].length){rr=!0;return}var tr=F.nodes.indexOf(x[J].node);F.nodes.splice(tr,1),x[J]=void 0}}}),rr)return er.splice($,1),"continue";for(var Er=!0,wr=0;Er&&!rr;){Er=!1;var Sr=t?x[P.id].degree<E[j.id].degree||x[P.id].inDegree<E[j.id].inDegree||x[P.id].outDegree<E[j.id].outDegree:x[P.id].degree<E[j.id].degree;if(Sr){rr=!0;break}if(Z[P[i]]<b[P[i]].length){rr=!0;break}for(var dr=F.nodes.length,Lr=dr-1;Lr>=0;Lr--){var xr=F.nodes[Lr],he=x[xr.id].degree,at=x[xr.id].inDegree,ot=x[xr.id].outDegree,ut=xr[i],ne=et(vr,ut,E,b),pe=ne.minPatternNodeLabelDegree,ft=ne.minPatternNodeLabelInDegree,st=ne.minPatternNodeLabelOutDegree,dt=t?he<pe||at<ft||ot<st:he<pe;if(dt){if(Z[xr[i]]--,Z[xr[i]]<b[xr[i]].length){rr=!0;break}F.nodes.splice(Lr,1),x[xr.id]=void 0,Er=!0}}if(rr||!Er&&wr!==0)break;pr=V.length;for(var Qr=pr-1;Qr>=0;Qr--){var Ir=V[Qr];if(!x[Ir.source]||!x[Ir.target]){V.splice(Qr,1);var $r=Ir[u];if(W[$r]--,x[Ir.source]&&(x[Ir.source].degree--,x[Ir.source].outDegree--),x[Ir.target]&&(x[Ir.target].degree--,x[Ir.target].inDegree--),L[$r]&&W[$r]<L[$r].length){rr=!0;break}Er=!0}}wr++}if(rr||rr||F.nodes.length<e.nodes.length||V.length<e.edges.length)return er.splice($,1),"continue"},fr=Hr-1;fr>=0;fr--){var Tr=hr(fr);if(Tr==="break")break}for(var br=er.length,Nr=function($){var F=er[$],P={};F.edges.forEach(function(V){var W="".concat(V.source,"-").concat(V.target,"-").concat(V.label);P[W]?P[W]++:P[W]=1});for(var Z=function(W){var ir=er[W],Q={};ir.edges.forEach(function(K){var pr="".concat(K.source,"-").concat(K.target,"-").concat(K.label);Q[pr]?Q[pr]++:Q[pr]=1});var U=!0;Object.keys(Q).length!==Object.keys(P).length?U=!1:Object.keys(P).forEach(function(K){Q[K]!==P[K]&&(U=!1)}),U&&er.splice(W,1)},x=br-1;x>$;x--)Z(x);br=er.length},fr=0;fr<=br-1;fr++)Nr(fr);return er}}},nt=en;var tn=(function(){function f(r){r===void 0&&(r=10),this.linkedList=new Jr,this.maxStep=r}return Object.defineProperty(f.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),f.prototype.isEmpty=function(){return!this.linkedList.head},f.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},f.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},f.prototype.push=function(r){this.linkedList.prepend(r),this.length>this.maxStep&&this.linkedList.deleteTail()},f.prototype.pop=function(){var r=this.linkedList.deleteHead();return r?r.value:null},f.prototype.toArray=function(){return this.linkedList.toArray().map(function(r){return r.value})},f.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},f})(),it=tn;var nn=fe;var aa={getAdjMatrix:kr,breadthFirstSearch:Ce,connectedComponent:Vr,getDegree:Fr,getInDegree:xe,getOutDegree:Ie,detectCycle:fe,detectDirectedCycle:nn,detectAllCycles:ye,detectAllDirectedCycle:ue,detectAllUndirectedCycle:oe,depthFirstSearch:Pr,dijkstra:Or,findAllPath:Ae,findShortestPath:De,floydWarshall:Wr,labelPropagation:Oe,louvain:Yr,iLouvain:Re,kCore:qe,kMeans:Ge,cosineSimilarity:Zr,nodesCosineSimilarity:Ue,minimumSpanningTree:ze,pageRank:Pe,getNeighbors:nr,Stack:it,GADDI:nt};export{nt as GADDI,it as Stack,Ce as breadthFirstSearch,Vr as connectedComponent,Zr as cosineSimilarity,aa as default,Pr as depthFirstSearch,ye as detectAllCycles,ue as detectAllDirectedCycle,oe as detectAllUndirectedCycle,fe as detectCycle,nn as detectDirectedCycle,Or as dijkstra,Ae as findAllPath,De as findShortestPath,Wr as floydWarshall,kr as getAdjMatrix,Fr as getDegree,xe as getInDegree,nr as getNeighbors,Ie as getOutDegree,Re as iLouvain,qe as kCore,Ge as kMeans,Oe as labelPropagation,Yr as louvain,ze as minimumSpanningTree,Ue as nodesCosineSimilarity,Pe as pageRank};
|
|
3
|
+
//# sourceMappingURL=algorithm.mjs.map
|