Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aframe-forcegraph-component

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aframe-forcegraph-component - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

4

dist/aframe-forcegraph-component.min.js

@@ -1,3 +0,3 @@

!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var r=n(3),i=n(11);AFRAME.registerComponent("forcegraph",{schema:{jsonUrl:{type:"string"},nodes:{parse:JSON.parse,default:"[]"},links:{parse:JSON.parse,default:"[]"},numDimensions:{type:"number",default:3},nodeRelSize:{type:"number",default:4},lineOpacity:{type:"number",default:.2},autoColorBy:{type:"string"},idField:{type:"string",default:"id"},valField:{type:"string",default:"val"},nameField:{type:"string",default:"name"},colorField:{type:"string",default:"color"},linkSourceField:{type:"string",default:"source"},linkTargetField:{type:"string",default:"target"},warmupTicks:{type:"int",default:0},cooldownTicks:{type:"int",default:1/0},cooldownTime:{type:"int",default:15e3},alphaDecay:{type:"number",default:.0228},velocityDecay:{type:"number",default:.4}},init:function(){this.state={},this.state.tooltipEl=document.createElement("a-text"),document.querySelector("a-entity[camera], a-camera").appendChild(this.state.tooltipEl),this.state.tooltipEl.setAttribute("position","0 -0.5 -1"),this.state.tooltipEl.setAttribute("width",2),this.state.tooltipEl.setAttribute("align","center"),this.state.tooltipEl.setAttribute("color","lavender"),this.state.tooltipEl.setAttribute("value",""),this.cameraObj=document.querySelector("[camera], a-camera").object3D.children.filter(function(t){return"PerspectiveCamera"===t.type})[0],this.state.forceLayout=r.forceSimulation().force("link",r.forceLink()).force("charge",r.forceManyBody()).force("center",r.forceCenter()).stop()},remove:function(){this.state.tooltipEl.remove()},update:function(t){function e(){(l++>o.cooldownTicks||new Date-f>o.cooldownTime)&&r.state.forceLayout.stop(),o.nodes.forEach(function(t){var e=t.__sphere;e.position.x=t.x,e.position.y=t.y||0,e.position.z=t.z||0}),o.links.forEach(function(t){var e=t.__line;e.geometry.vertices=[new THREE.Vector3(t.source.x,t.source.y||0,t.source.z||0),new THREE.Vector3(t.target.x,t.target.y||0,t.target.z||0)],e.geometry.verticesNeedUpdate=!0,e.geometry.computeBoundingSphere()})}function n(t,e,n){if(e){var r=["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],i=t.filter(function(t){return!t[n]}),o={};i.forEach(function(t){o[t[e]]=null}),Object.keys(o).forEach(function(t,e){o[t]=e}),i.forEach(function(t){t[n]=parseInt(r[o[t[e]]%r.length].slice(1),16)})}}var r=this,o=this.data,a=AFRAME.utils.diff(o,t);"jsonUrl"in a&&o.jsonUrl&&i.get(o.jsonUrl).then(function(t,e){o.nodes=e.nodes,o.links=e.links,r.update(o)}),n(o.nodes,o.autoColorBy,o.colorField),o.links.forEach(function(t){t.source=t[o.linkSourceField],t.target=t[o.linkTargetField],t.id=[t.source,t.target].join(" > ")});var s=this.el.object3D;s.children.forEach(s.remove),o.nodes.forEach(function(t){var e=new THREE.MeshLambertMaterial({color:t[o.colorField]||16777130,transparent:!0});e.opacity=.75;var n=new THREE.Mesh(new THREE.SphereGeometry(Math.cbrt(t[o.valField]||1)*o.nodeRelSize,8,8),e);n.name=t[o.nameField],s.add(t.__sphere=n)});var u=new THREE.LineBasicMaterial({color:15790320,transparent:!0});u.opacity=o.lineOpacity,o.links.forEach(function(t){var e=new THREE.Line(new THREE.Geometry,u);e.geometry.vertices=[new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,0)],s.add(t.__line=e)}),r.state.forceLayout.stop().alpha(1).alphaDecay(o.alphaDecay).velocityDecay(o.velocityDecay).numDimensions(o.numDimensions).nodes(o.nodes).force("link").id(function(t){return t[o.idField]}).links(o.links);for(var c=0;c<o.warmupTicks;c++)r.state.forceLayout.tick();var l=0,f=new Date;r.state.forceLayout.on("tick",e).restart()},tick:function(t,e){var n=new THREE.Raycaster;n.setFromCamera(new THREE.Vector2(0,0),this.cameraObj);var r=n.intersectObjects(this.el.object3D.children).filter(function(t){return t.object.name});this.state.tooltipEl.setAttribute("value",r.length?r[0].object.name:"")}})},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function a(){d&&p&&(d=!1,p.length?y=p.concat(y):v=-1,y.length&&s())}function s(){if(!d){var t=i(a);d=!0;for(var e=y.length;e;){for(p=y,y=[];++v<e;)p&&p[v].run();v=-1,e=y.length}p=null,d=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var l,f,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(t){f=r}}();var p,y=[],d=!1,v=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];y.push(new u(t,e)),1!==y.length||d||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(t,e,n){if(isNaN(e))return t;var r,i,o,a,s,u,c=t._root,l={data:n},f=t._x0,h=t._x1;if(!c)return t._root=l,t;for(;c.length;)if((a=e>=(i=(f+h)/2))?f=i:h=i,r=c,!(c=c[s=+a]))return r[s]=l,t;if(o=+t._x.call(null,c.data),e===o)return l.next=c,r?r[s]=l:t._root=l,t;do r=r?r[s]=new Array(2):t._root=new Array(2),(a=e>=(i=(f+h)/2))?f=i:h=i;while((s=+a)===(u=+(o>=i)));return r[u]=c,r[s]=l,t}function n(t){var n,r,i=t.length,o=new Array(i),a=1/0,s=-(1/0);for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t[n]))||(o[n]=r,r<a&&(a=r),r>s&&(s=r));for(s<a&&(a=this._x0,s=this._x1),this.cover(a).cover(s),n=0;n<i;++n)e(this,o[n],t[n]);return this}function r(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function i(t){return t[0]}function o(t,e){var n=new a(null==e?i:e,NaN,NaN);return null==t?n:n.addAll(t)}function a(t,e,n){this._x=t,this._x0=e,this._x1=n,this._root=void 0}function s(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var u=function(t){var n=+this._x.call(null,t);return e(this.cover(n),n,t)},c=function(t){if(isNaN(t=+t))return this;var e=this._x0,n=this._x1;if(isNaN(e))n=(e=Math.floor(t))+1;else{if(!(e>t||t>n))return this;var r,i,o=n-e,a=this._root;switch(i=+(t<(e+n)/2)){case 0:do r=new Array(2),r[i]=a,a=r;while(o*=2,n=e+o,t>n);break;case 1:do r=new Array(2),r[i]=a,a=r;while(o*=2,e=n-o,e>t)}this._root&&this._root.length&&(this._root=a)}return this._x0=e,this._x1=n,this},l=function(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t},f=function(t){return arguments.length?this.cover(+t[0][0]).cover(+t[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]},h=function(t,e,n){this.node=t,this.x0=e,this.x1=n},p=function(t,e){var n,r,i,o,a,s=this._x0,u=this._x1,c=[],l=this._root;for(l&&c.push(new h(l,s,u)),null==e?e=1/0:(s=t-e,u=t+e);o=c.pop();)if(!(!(l=o.node)||(r=o.x0)>u||(i=o.x1)<s))if(l.length){var f=(r+i)/2;c.push(new h(l[1],f,i),new h(l[0],r,f)),(a=+(t>=f))&&(o=c[c.length-1],c[c.length-1]=c[c.length-1-a],c[c.length-1-a]=o)}else{var p=t-+this._x.call(null,l.data);p<e&&(e=p,s=t-p,u=t+p,n=l.data)}return n},y=function(t){if(isNaN(o=+this._x.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l=this._root,f=this._x0,h=this._x1;if(!l)return this;if(l.length)for(;;){if((s=o>=(a=(f+h)/2))?f=a:h=a,e=l,!(l=l[u=+s]))return this;if(!l.length)break;e[u+1&1]&&(n=e,c=u)}for(;l.data!==t;)if(r=l,!(l=l.next))return this;return(i=l.next)&&delete l.next,r?(i?r.next=i:delete r.next,this):e?(i?e[u]=i:delete e[u],(l=e[0]||e[1])&&l===(e[1]||e[0])&&!l.length&&(n?n[c]=l:this._root=l),this):(this._root=i,this)},d=function(){return this._root},v=function(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t},_=function(t){var e,n,r,i,o=[],a=this._root;for(a&&o.push(new h(a,this._x0,this._x1));e=o.pop();)if(!t(a=e.node,r=e.x0,i=e.x1)&&a.length){var s=(r+i)/2;(n=a[1])&&o.push(new h(n,s,i)),(n=a[0])&&o.push(new h(n,r,s))}return this},x=function(t){var e,n=[],r=[];for(this._root&&n.push(new h(this._root,this._x0,this._x1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.x1,u=(a+s)/2;(o=i[0])&&n.push(new h(o,a,u)),(o=i[1])&&n.push(new h(o,u,s))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.x1);return this},g=function(t){return arguments.length?(this._x=t,this):this._x},w=o.prototype=a.prototype;w.copy=function(){var t,e,n=new a(this._x,this._x0,this._x1),r=this._root;if(!r)return n;if(!r.length)return n._root=s(r),n;for(t=[{source:r,target:n._root=new Array(2)}];r=t.pop();)for(var i=0;i<2;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(2)}):r.target[i]=s(e));return n},w.add=u,w.addAll=n,w.cover=c,w.data=l,w.extent=f,w.find=p,w.remove=y,w.removeAll=r,w.root=d,w.size=v,w.visit=_,w.visitAfter=x,w.x=g,t.binarytree=o,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,r){r(e,n(2),n(6),n(8),n(4),n(5),n(7))}(this,function(t,e,n,r,i,o,a){"use strict";function s(t){return t.x+t.vx}function u(t){return t.y+t.vy}function c(t){return t.z+t.vz}function l(t){return t.index}function f(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function h(t){return t.x}function p(t){return t.y}function y(t){return t.z}var d=function(t,e,n){function r(){var r,o,a=i.length,s=0,u=0,c=0;for(r=0;r<a;++r)o=i[r],s+=o.x||0,u+=o.y||0,c+=o.z||0;for(s=s/a-t,u=u/a-e,c=c/a-n,r=0;r<a;++r)o=i[r],s&&(o.x-=s),u&&(o.y-=u),c&&(o.z-=c)}var i;return null==t&&(t=0),null==e&&(e=0),null==n&&(n=0),r.initialize=function(t){i=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r.z=function(t){return arguments.length?(n=+t,r):n},r},v=function(t){return function(){return t}},_=function(){return 1e-6*(Math.random()-.5)},x=function(t){function i(){function t(t,e,n,r,i,o,a){var s=[e,n,r,i,o,a],u=s[0],c=s[1],l=s[2],h=s[f],y=s[f+1],T=s[f+2],N=t.data,b=t.r,z=w+b;if(!N)return u>v+z||h<v-z||f>1&&(c>x+z||y<x-z)||f>2&&(l>g+z||T<g-z);if(N.index>d.index){var A=v-N.x-N.vx,E=f>1?x-N.y-N.vy:0,M=f>2?g-N.z-N.vz:0,k=A*A+E*E+M*M;k<z*z&&(0===A&&(A=_(),k+=A*A),f>1&&0===E&&(E=_(),k+=E*E),f>2&&0===M&&(M=_(),k+=M*M),k=(z-(k=Math.sqrt(k)))/k*p,d.vx+=(A*=k)*(z=(b*=b)/(m+b)),f>1&&(d.vy+=(E*=k)*z),f>2&&(d.vz+=(M*=k)*z),N.vx-=A*(z=1-z),f>1&&(N.vy-=E*z),f>2&&(N.vz-=M*z))}}for(var i,a,d,v,x,g,w,m,T=l.length,N=0;N<y;++N)for(a=(1===f?e.binarytree(l,s):2===f?n.quadtree(l,s,u):3===f?r.octree(l,s,u,c):null).visitAfter(o),i=0;i<T;++i)d=l[i],w=h[d.index],m=w*w,v=d.x+d.vx,f>1&&(x=d.y+d.vy),f>2&&(g=d.z+d.vz),a.visit(t)}function o(t){if(t.data)return t.r=h[t.data.index];for(var e=t.r=0;e<Math.pow(2,f);++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function a(){if(l){var e,n,r=l.length;for(h=new Array(r),e=0;e<r;++e)n=l[e],h[n.index]=+t(n,e,l)}}var l,f,h,p=1,y=1;return"function"!=typeof t&&(t=v(null==t?1:+t)),i.initialize=function(t,e){l=t,f=e,a()},i.iterations=function(t){return arguments.length?(y=+t,i):y},i.strength=function(t){return arguments.length?(p=+t,i):p},i.radius=function(e){return arguments.length?(t="function"==typeof e?e:v(+e),a(),i):t},i},g=function(t){function e(t){return 1/Math.min(p[t.source.index],p[t.target.index])}function n(e){for(var n=0,r=t.length;n<w;++n)for(var i,o,a,c,l,f=0,p=0,d=0,v=0;f<r;++f)i=t[f],o=i.source,a=i.target,p=a.x+a.vx-o.x-o.vx||_(),h>1&&(d=a.y+a.vy-o.y-o.vy||_()),h>2&&(v=a.z+a.vz-o.z-o.vz||_()),c=Math.sqrt(p*p+d*d+v*v),c=(c-u[f])/c*e*s[f],p*=c,d*=c,v*=c,a.vx-=p*(l=y[f]),h>1&&(a.vy-=d*l),h>2&&(a.vz-=v*l),o.vx+=p*(l=1-l),h>1&&(o.vy+=d*l),h>2&&(o.vz+=v*l)}function r(){if(c){var e,n,r=c.length,l=t.length,h=i.map(c,d);for(e=0,p=new Array(r);e<l;++e)n=t[e],n.index=e,"object"!=typeof n.source&&(n.source=f(h,n.source)),"object"!=typeof n.target&&(n.target=f(h,n.target)),p[n.source.index]=(p[n.source.index]||0)+1,p[n.target.index]=(p[n.target.index]||0)+1;for(e=0,y=new Array(l);e<l;++e)n=t[e],y[e]=p[n.source.index]/(p[n.source.index]+p[n.target.index]);s=new Array(l),o(),u=new Array(l),a()}}function o(){if(c)for(var e=0,n=t.length;e<n;++e)s[e]=+x(t[e],e,t)}function a(){if(c)for(var e=0,n=t.length;e<n;++e)u[e]=+g(t[e],e,t)}var s,u,c,h,p,y,d=l,x=e,g=v(30),w=1;return null==t&&(t=[]),n.initialize=function(t,e){c=t,h=e,r()},n.links=function(e){return arguments.length?(t=e,r(),n):t},n.id=function(t){return arguments.length?(d=t,n):d},n.iterations=function(t){return arguments.length?(w=+t,n):w},n.strength=function(t){return arguments.length?(x="function"==typeof t?t:v(+t),o(),n):x},n.distance=function(t){return arguments.length?(g="function"==typeof t?t:v(+t),a(),n):g},n},w=3,m=10,T=Math.PI*(3-Math.sqrt(5)),N=Math.PI/24,b=function(t,e){function n(){r(),x.call("tick",c),f<h&&(_.stop(),x.call("end",c))}function r(){var e,n,r=t.length;for(f+=(y-f)*p,v.each(function(t){t(f)}),e=0;e<r;++e)n=t[e],null==n.fx?n.x+=n.vx*=d:(n.x=n.fx,n.vx=0),l>1&&(null==n.fy?n.y+=n.vy*=d:(n.y=n.fy,n.vy=0)),l>2&&(null==n.fz?n.z+=n.vz*=d:(n.z=n.fz,n.vz=0))}function s(){for(var e,n=0,r=t.length;n<r;++n){if(e=t[n],e.index=n,isNaN(e.x)||l>1&&isNaN(e.y)||l>2&&isNaN(e.z)){var i=m*(l>2?Math.cbrt(n):l>1?Math.sqrt(n):n),o=n*T,a=n*N;e.x=i*(l>1?Math.cos(o):1),l>1&&(e.y=i*Math.sin(o)),l>2&&(e.z=i*Math.sin(a))}(isNaN(e.vx)||l>1&&isNaN(e.vy)||l>2&&isNaN(e.vz))&&(e.vx=0,l>1&&(e.vy=0),l>2&&(e.vz=0))}}function u(e){return e.initialize&&e.initialize(t,l),e}e=e||2;var c,l=Math.min(w,Math.max(1,Math.round(e))),f=1,h=.001,p=1-Math.pow(h,1/300),y=0,d=.6,v=i.map(),_=a.timer(n),x=o.dispatch("tick","end");return null==t&&(t=[]),s(),c={tick:r,restart:function(){return _.restart(n),c},stop:function(){return _.stop(),c},numDimensions:function(t){return arguments.length?(l=Math.min(w,Math.max(1,Math.round(t))),v.each(u),c):l},nodes:function(e){return arguments.length?(t=e,s(),v.each(u),c):t},alpha:function(t){return arguments.length?(f=+t,c):f},alphaMin:function(t){return arguments.length?(h=+t,c):h},alphaDecay:function(t){return arguments.length?(p=+t,c):+p},alphaTarget:function(t){return arguments.length?(y=+t,c):y},velocityDecay:function(t){return arguments.length?(d=1-t,c):1-d},force:function(t,e){return arguments.length>1?(null==e?v.remove(t):v.set(t,u(e)),c):v.get(t)},find:function(){var e,n,r,i,o,a,s=Array.prototype.slice.call(arguments),u=s.shift()||0,c=(l>1?s.shift():null)||0,f=(l>2?s.shift():null)||0,h=s.shift()||1/0,p=0,y=t.length;for(h*=h,p=0;p<y;++p)o=t[p],e=u-o.x,n=c-(o.y||0),r=f-(o.z||0),i=e*e+n*n+r*r,i<h&&(a=o,h=i);return a},on:function(t,e){return arguments.length>1?(x.on(t,e),c):x.on(t)}}},z=function(){function t(t){var i,f=s.length,d=(1===u?e.binarytree(s,h):2===u?n.quadtree(s,h,p):3===u?r.octree(s,h,p,y):null).visitAfter(o);for(l=t,i=0;i<f;++i)c=s[i],d.visit(a)}function i(){if(s){var t,e,n=s.length;for(f=new Array(n),t=0;t<n;++t)e=s[t],f[e.index]=+d(e,t,s)}}function o(t){var e,n,r,i,o,a,s=0;if(t.length){for(r=i=o=a=0;a<4;++a)(e=t[a])&&(n=e.value)&&(s+=n,r+=n*(e.x||0),i+=n*(e.y||0),o+=n*(e.z||0));t.x=r/s,u>1&&(t.y=i/s),u>2&&(t.z=o/s)}else{e=t,e.x=e.data.x,u>1&&(e.y=e.data.y),u>2&&(e.z=e.data.z);do s+=f[e.data.index];while(e=e.next)}t.value=s}function a(t,e,n,r,i){if(!t.value)return!0;var o=[n,r,i][u-1],a=t.x-c.x,s=u>1?t.y-c.y:0,h=u>2?t.z-c.z:0,p=o-e,y=a*a+s*s+h*h;if(p*p/w<y)return y<g&&(0===a&&(a=_(),y+=a*a),u>1&&0===s&&(s=_(),y+=s*s),u>2&&0===h&&(h=_(),y+=h*h),y<x&&(y=Math.sqrt(x*y)),c.vx+=a*t.value*l/y,u>1&&(c.vy+=s*t.value*l/y),u>2&&(c.vz+=h*t.value*l/y)),!0;if(!(t.length||y>=g)){(t.data!==c||t.next)&&(0===a&&(a=_(),y+=a*a),u>1&&0===s&&(s=_(),y+=s*s),u>2&&0===h&&(h=_(),y+=h*h),y<x&&(y=Math.sqrt(x*y)));do t.data!==c&&(p=f[t.data.index]*l/y,c.vx+=a*p,u>1&&(c.vy+=s*p),u>2&&(c.vz+=h*p));while(t=t.next)}}var s,u,c,l,f,d=v(-30),x=1,g=1/0,w=.81;return t.initialize=function(t,e){s=t,u=e,i()},t.strength=function(e){return arguments.length?(d="function"==typeof e?e:v(+e),i(),t):d},t.distanceMin=function(e){return arguments.length?(x=e*e,t):Math.sqrt(x)},t.distanceMax=function(e){return arguments.length?(g=e*e,t):Math.sqrt(g)},t.theta=function(e){return arguments.length?(w=e*e,t):Math.sqrt(w)},t},A=function(t){function e(t){for(var e,n=0,a=r.length;n<a;++n)e=r[n],e.vx+=(o[n]-e.x)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),o=new Array(n),e=0;e<n;++e)i[e]=isNaN(o[e]=+t(r[e],e,r))?0:+a(r[e],e,r)}}var r,i,o,a=v(.1);return"function"!=typeof t&&(t=v(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(a="function"==typeof t?t:v(+t),n(),e):a},e.x=function(r){return arguments.length?(t="function"==typeof r?r:v(+r),n(),e):t},e},E=function(t){function e(t){for(var e,n=0,a=r.length;n<a;++n)e=r[n],e.vy+=(o[n]-e.y)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),o=new Array(n),e=0;e<n;++e)i[e]=isNaN(o[e]=+t(r[e],e,r))?0:+a(r[e],e,r)}}var r,i,o,a=v(.1);return"function"!=typeof t&&(t=v(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(a="function"==typeof t?t:v(+t),n(),e):a},e.y=function(r){return arguments.length?(t="function"==typeof r?r:v(+r),n(),e):t},e},M=function(t){function e(t){for(var e,n=0,a=r.length;n<a;++n)e=r[n],e.vz+=(o[n]-e.z)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),o=new Array(n),e=0;e<n;++e)i[e]=isNaN(o[e]=+t(r[e],e,r))?0:+a(r[e],e,r)}}var r,i,o,a=v(.1);return"function"!=typeof t&&(t=v(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(a="function"==typeof t?t:v(+t),n(),e):a},e.z=function(r){return arguments.length?(t="function"==typeof r?r:v(+r),n(),e):t},e};t.forceCenter=d,t.forceCollide=x,t.forceLink=g,t.forceManyBody=z,t.forceSimulation=b,t.forceX=A,t.forceY=E,t.forceZ=M,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(){}function n(t,n){var r=new e;if(t instanceof e)t.each(function(t,e){r.set(e,t)});else if(Array.isArray(t)){var i,o=-1,a=t.length;if(null==n)for(;++o<a;)r.set(o,t[o]);else for(;++o<a;)r.set(n(i=t[o],o,t),i)}else if(t)for(var s in t)r.set(s,t[s]);return r}function r(){return{}}function i(t,e,n){t[e]=n}function o(){return n()}function a(t,e,n){t.set(e,n)}function s(){}function u(t,e){var n=new s;if(t instanceof s)t.each(function(t){n.add(t)});else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}var c="$";e.prototype=n.prototype={constructor:e,has:function(t){return c+t in this},get:function(t){return this[c+t]},set:function(t,e){return this[c+t]=e,this},remove:function(t){var e=c+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===c&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===c&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===c&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===c&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===c&&++t;return t},empty:function(){for(var t in this)if(t[0]===c)return!1;return!0},each:function(t){for(var e in this)e[0]===c&&t(this[e],e.slice(1),this)}};var l=function(){function t(e,r,i,o){if(r>=l.length)return null!=u?u(e):null!=s?e.sort(s):e;for(var a,c,f,h=-1,p=e.length,y=l[r++],d=n(),v=i();++h<p;)(f=d.get(a=y(c=e[h])+""))?f.push(c):d.set(a,[c]);return d.each(function(e,n){o(v,n,t(e,r,i,o))}),v}function e(t,n){if(++n>l.length)return t;var r,i=f[n-1];return null!=u&&n>=l.length?r=t.entries():(r=[],t.each(function(t,i){r.push({key:i,values:e(t,n)})})),null!=i?r.sort(function(t,e){return i(t.key,e.key)}):r}var s,u,c,l=[],f=[];return c={object:function(e){return t(e,0,r,i)},map:function(e){return t(e,0,o,a)},entries:function(n){return e(t(n,0,o,a),0)},key:function(t){return l.push(t),c},sortKeys:function(t){return f[l.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return u=t,c}}},f=n.prototype;s.prototype=u.prototype={constructor:s,has:f.has,add:function(t){return t+="",this[c+t]=t,this},remove:f.remove,clear:f.clear,values:f.keys,size:f.size,empty:f.empty,each:f.each};var h=function(t){var e=[];for(var n in t)e.push(n);return e},p=function(t){var e=[];for(var n in t)e.push(t[n]);return e},y=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e};t.nest=l,t.set=u,t.map=n,t.keys=h,t.values=p,t.entries=y,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new n(i)}function n(t){this._=t}function r(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function i(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function o(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=a,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}var a={value:function(){}};n.prototype=e.prototype={constructor:n,on:function(t,e){var n,a=this._,s=r(t+"",a),u=-1,c=s.length;{if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<c;)if(n=(t=s[u]).type)a[n]=o(a[n],t.name,e);else if(null==e)for(n in a)a[n]=o(a[n],t.name,null);return this}for(;++u<c;)if((n=(t=s[u]).type)&&(n=i(a[n],t.name)))return n}},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,n=r.length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}},t.dispatch=e,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,c,l,f,h,p=t._root,y={data:r},d=t._x0,v=t._y0,_=t._x1,x=t._y1;if(!p)return t._root=y,t;for(;p.length;)if((c=e>=(o=(d+_)/2))?d=o:_=o,(l=n>=(a=(v+x)/2))?v=a:x=a,i=p,!(p=p[f=l<<1|c]))return i[f]=y,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&n===u)return y.next=p,i?i[f]=y:t._root=y,t;do i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(d+_)/2))?d=o:_=o,(l=n>=(a=(v+x)/2))?v=a:x=a;while((f=l<<1|c)===(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=y,t}function n(t){var n,r,i,o,a=t.length,s=new Array(a),u=new Array(a),c=1/0,l=1/0,f=-(1/0),h=-(1/0);for(r=0;r<a;++r)isNaN(i=+this._x.call(null,n=t[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=i,u[r]=o,i<c&&(c=i),i>f&&(f=i),o<l&&(l=o),o>h&&(h=o));for(f<c&&(c=this._x0,f=this._x1),h<l&&(l=this._y0,h=this._y1),this.cover(c,l).cover(f,h),r=0;r<a;++r)e(this,s[r],u[r],t[r]);return this}function r(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function i(t){return t[0]}function o(t){return t[1]}function a(t,e,n){var r=new s(null==e?i:e,null==n?o:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function s(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function u(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var c=function(t){var n=+this._x.call(null,t),r=+this._y.call(null,t);return e(this.cover(n,r),n,r,t)},l=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{if(!(n>t||t>i||r>e||e>o))return this;var a,s,u=i-n,c=this._root;switch(s=(e<(r+o)/2)<<1|t<(n+i)/2){case 0:do a=new Array(4),a[s]=c,c=a;while(u*=2,i=n+u,o=r+u,t>i||e>o);break;case 1:do a=new Array(4),a[s]=c,c=a;while(u*=2,n=i-u,o=r+u,n>t||e>o);break;case 2:do a=new Array(4),a[s]=c,c=a;while(u*=2,i=n+u,r=o-u,t>i||r>e);break;case 3:do a=new Array(4),a[s]=c,c=a;while(u*=2,n=i-u,r=o-u,n>t||r>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},f=function(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t},h=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},p=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i},y=function(t,e,n){var r,i,o,a,s,u,c,l=this._x0,f=this._y0,h=this._x1,y=this._y1,d=[],v=this._root;for(v&&d.push(new p(v,l,f,h,y)),null==n?n=1/0:(l=t-n,f=e-n,h=t+n,y=e+n,n*=n);u=d.pop();)if(!(!(v=u.node)||(i=u.x0)>h||(o=u.y0)>y||(a=u.x1)<l||(s=u.y1)<f))if(v.length){var _=(i+a)/2,x=(o+s)/2;d.push(new p(v[3],_,x,a,s),new p(v[2],i,x,_,s),new p(v[1],_,o,a,x),new p(v[0],i,o,_,x)),(c=(e>=x)<<1|t>=_)&&(u=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=u)}else{var g=t-+this._x.call(null,v.data),w=e-+this._y.call(null,v.data),m=g*g+w*w;if(m<n){var T=Math.sqrt(n=m);l=t-T,f=e-T,h=t+T,y=e+T,r=v.data}}return r},d=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l,f,h,p=this._root,y=this._x0,d=this._y0,v=this._x1,_=this._y1;if(!p)return this;if(p.length)for(;;){if((c=o>=(s=(y+v)/2))?y=s:v=s,(l=a>=(u=(d+_)/2))?d=u:_=u,e=p,!(p=p[f=l<<1|c]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[h]=p:this._root=p),this):(this._root=i,this)},v=function(){return this._root},_=function(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t},x=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new p(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var c=(r+o)/2,l=(i+a)/2;(n=u[3])&&s.push(new p(n,c,l,o,a)),(n=u[2])&&s.push(new p(n,r,l,c,a)),(n=u[1])&&s.push(new p(n,c,i,o,l)),(n=u[0])&&s.push(new p(n,r,i,c,l))}return this},g=function(t){var e,n=[],r=[];for(this._root&&n.push(new p(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,c=e.y1,l=(a+u)/2,f=(s+c)/2;(o=i[0])&&n.push(new p(o,a,s,l,f)),(o=i[1])&&n.push(new p(o,l,s,u,f)),(o=i[2])&&n.push(new p(o,a,f,l,c)),(o=i[3])&&n.push(new p(o,l,f,u,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},w=function(t){return arguments.length?(this._x=t,this):this._x},m=function(t){return arguments.length?(this._y=t,this):this._y},T=a.prototype=s.prototype;T.copy=function(){var t,e,n=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=u(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=u(e));return n},T.add=c,T.addAll=n,T.cover=l,T.data=f,T.extent=h,T.find=y,T.remove=d,T.removeAll=r,T.root=v,T.size=_,T.visit=x,T.visitAfter=g,T.x=w,T.y=m,t.quadtree=a,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(){return _||(w(n),_=g.now()+x)}function n(){_=0}function r(){this._call=this._time=this._next=null}function i(t,e,n){var i=new r;return i.restart(t,e,n),i}function o(){e(),++h;for(var t,n=l;n;)(t=_-n._time)>=0&&n._call.call(null,t),n=n._next;--h}function a(){_=(v=g.now())+x,h=p=0;try{o()}finally{h=0,u(),_=0}}function s(){var t=g.now(),e=t-v;e>d&&(x-=e,v=t)}function u(){for(var t,e,n=l,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:l=e);f=t,c(r)}function c(t){if(!h){p&&(p=clearTimeout(p));var e=t-_;e>24?(t<1/0&&(p=setTimeout(a,e)),y&&(y=clearInterval(y))):(y||(v=_,y=setInterval(s,d)),h=1,w(a))}}var l,f,h=0,p=0,y=0,d=1e3,v=0,_=0,x=0,g="object"==typeof performance&&performance.now?performance:Date,w="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};r.prototype=i.prototype={constructor:r,restart:function(t,n,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?e():+r)+(null==n?0:+n),this._next||f===this||(f?f._next=this:l=this,f=this),this._call=t,this._time=r,c()},stop:function(){this._call&&(this._call=null,this._time=1/0,c())}};var m=function(t,e,n){var i=new r;return e=null==e?0:+e,i.restart(function(n){i.stop(),t(n+e)},e,n),i},T=function(t,n,i){var o=new r,a=n;return null==n?(o.restart(t,n,i),o):(n=+n,i=null==i?e():+i,o.restart(function e(r){r+=a,o.restart(e,a+=n,i),t(r)},n,i),o)};t.now=e,t.timer=i,t.timerFlush=o,t.timeout=m,t.interval=T,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(t,e,n,r,i){if(isNaN(e)||isNaN(n)||isNaN(r))return t;var o,a,s,u,c,l,f,h,p,y,d,v,_=t._root,x={data:i},g=t._x0,w=t._y0,m=t._z0,T=t._x1,N=t._y1,b=t._z1;if(!_)return t._root=x,t;for(;_.length;)if((h=e>=(a=(g+T)/2))?g=a:T=a,(p=n>=(s=(w+N)/2))?w=s:N=s,(y=r>=(u=(m+b)/2))?m=u:b=u,o=_,!(_=_[d=y<<2|p<<1|h]))return o[d]=x,t;if(c=+t._x.call(null,_.data),l=+t._y.call(null,_.data),f=+t._z.call(null,_.data),e===c&&n===l&&r===f)return x.next=_,o?o[d]=x:t._root=x,t;do o=o?o[d]=new Array(8):t._root=new Array(8),(h=e>=(a=(g+T)/2))?g=a:T=a,(p=n>=(s=(w+N)/2))?w=s:N=s,(y=r>=(u=(m+b)/2))?m=u:b=u;while((d=y<<2|p<<1|h)===(v=(f>=u)<<2|(l>=s)<<1|c>=a));return o[v]=_,o[d]=x,t}function n(t){var n,r,i,o,a,s=t.length,u=new Array(s),c=new Array(s),l=new Array(s),f=1/0,h=1/0,p=1/0,y=-(1/0),d=-(1/0),v=-(1/0);for(r=0;r<s;++r)isNaN(i=+this._x.call(null,n=t[r]))||isNaN(o=+this._y.call(null,n))||isNaN(a=+this._z.call(null,n))||(u[r]=i,c[r]=o,l[r]=a,i<f&&(f=i),i>y&&(y=i),o<h&&(h=o),o>d&&(d=o),a<p&&(p=a),a>v&&(v=a));for(y<f&&(f=this._x0,y=this._x1),d<h&&(h=this._y0,d=this._y1),v<p&&(p=this._z0,v=this._z1),this.cover(f,h,p).cover(y,d,v),r=0;r<s;++r)e(this,u[r],c[r],l[r],t[r]);return this}function r(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function i(t){return t[0]}function o(t){return t[1]}function a(t){return t[2]}function s(t,e,n,r){var s=new u(null==e?i:e,null==n?o:n,null==r?a:r,NaN,NaN,NaN,NaN,NaN,NaN);return null==t?s:s.addAll(t)}function u(t,e,n,r,i,o,a,s,u){this._x=t,this._y=e,this._z=n,this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this._root=void 0}function c(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var l=function(t){var n=+this._x.call(null,t),r=+this._y.call(null,t),i=+this._z.call(null,t);return e(this.cover(n,r,i),n,r,i,t)},f=function(t,e,n){if(isNaN(t=+t)||isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,o=this._z0,a=this._x1,s=this._y1,u=this._z1;if(isNaN(r))a=(r=Math.floor(t))+1,s=(i=Math.floor(e))+1,u=(o=Math.floor(n))+1;else{if(!(r>t||t>a||i>e||e>s||o>n||n>u))return this;var c,l,f=a-r,h=this._root;switch(l=(n<(o+u)/2)<<2|(e<(i+s)/2)<<1|t<(r+a)/2){case 0:do c=new Array(8),c[l]=h,
h=c;while(f*=2,a=r+f,s=i+f,u=o+f,t>a||e>s||n>u);break;case 1:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,s=i+f,u=o+f,r>t||e>s||n>u);break;case 2:do c=new Array(8),c[l]=h,h=c;while(f*=2,a=r+f,i=s-f,u=o+f,t>a||i>e||n>u);break;case 3:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,i=s-f,u=o+f,r>t||i>e||n>u);break;case 4:do c=new Array(8),c[l]=h,h=c;while(f*=2,a=r+f,s=i+f,o=u-f,t>a||e>s||o>n);break;case 5:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,s=i+f,o=u-f,r>t||e>s||o>n);break;case 6:do c=new Array(8),c[l]=h,h=c;while(f*=2,a=r+f,i=s-f,o=u-f,t>a||i>e||o>n);break;case 7:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,i=s-f,o=u-f,r>t||i>e||o>n)}this._root&&this._root.length&&(this._root=h)}return this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this},h=function(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t},p=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1],+t[0][2]).cover(+t[1][0],+t[1][1],+t[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]},y=function(t,e,n,r,i,o,a){this.node=t,this.x0=e,this.y0=n,this.z0=r,this.x1=i,this.y1=o,this.z1=a},d=function(t,e,n,r){var i,o,a,s,u,c,l,f,h,p=this._x0,d=this._y0,v=this._z0,_=this._x1,x=this._y1,g=this._z1,w=[],m=this._root;for(m&&w.push(new y(m,p,d,v,_,x,g)),null==r?r=1/0:(p=t-r,d=e-r,v=n-r,_=t+r,x=e+r,g=n+r,r*=r);f=w.pop();)if(!(!(m=f.node)||(o=f.x0)>_||(a=f.y0)>x||(s=f.z0)>g||(u=f.x1)<p||(c=f.y1)<d||(l=f.z1)<v))if(m.length){var T=(o+u)/2,N=(a+c)/2,b=(s+l)/2;w.push(new y(m[7],T,N,b,u,c,l),new y(m[6],o,N,b,T,c,l),new y(m[5],T,a,b,u,N,l),new y(m[4],o,a,b,T,N,l),new y(m[3],T,N,s,u,c,b),new y(m[2],o,N,s,T,c,b),new y(m[1],T,a,s,u,N,b),new y(m[0],o,a,s,T,N,b)),(h=(n>=b)<<2|(e>=N)<<1|t>=T)&&(f=w[w.length-1],w[w.length-1]=w[w.length-1-h],w[w.length-1-h]=f)}else{var z=t-+this._x.call(null,m.data),A=e-+this._y.call(null,m.data),E=n-+this._z.call(null,m.data),M=z*z+A*A+E*E;if(M<r){var k=Math.sqrt(r=M);p=t-k,d=e-k,v=n-k,_=t+k,x=e+k,g=n+k,i=m.data}}return i},v=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t))||isNaN(s=+this._z.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l,f,h,p,y,d,v=this._root,_=this._x0,x=this._y0,g=this._z0,w=this._x1,m=this._y1,T=this._z1;if(!v)return this;if(v.length)for(;;){if((f=o>=(u=(_+w)/2))?_=u:w=u,(h=a>=(c=(x+m)/2))?x=c:m=c,(p=s>=(l=(g+T)/2))?g=l:T=l,e=v,!(v=v[y=p<<2|h<<1|f]))return this;if(!v.length)break;(e[y+1&7]||e[y+2&7]||e[y+3&7]||e[y+4&7]||e[y+5&7]||e[y+6&7]||e[y+7&7])&&(n=e,d=y)}for(;v.data!==t;)if(r=v,!(v=v.next))return this;return(i=v.next)&&delete v.next,r?(i?r.next=i:delete r.next,this):e?(i?e[y]=i:delete e[y],(v=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&v===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!v.length&&(n?n[d]=v:this._root=v),this):(this._root=i,this)},_=function(){return this._root},x=function(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t},g=function(t){var e,n,r,i,o,a,s,u,c=[],l=this._root;for(l&&c.push(new y(l,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=c.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,o=e.z0,a=e.x1,s=e.y1,u=e.z1)&&l.length){var f=(r+a)/2,h=(i+s)/2,p=(o+u)/2;(n=l[7])&&c.push(new y(n,f,h,p,a,s,u)),(n=l[6])&&c.push(new y(n,r,h,p,f,s,u)),(n=l[5])&&c.push(new y(n,f,i,p,a,h,u)),(n=l[4])&&c.push(new y(n,r,i,p,f,h,u)),(n=l[3])&&c.push(new y(n,f,h,o,a,s,p)),(n=l[2])&&c.push(new y(n,r,h,o,f,s,p)),(n=l[1])&&c.push(new y(n,f,i,o,a,h,p)),(n=l[0])&&c.push(new y(n,r,i,o,f,h,p))}return this},w=function(t){var e,n=[],r=[];for(this._root&&n.push(new y(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.z0,c=e.x1,l=e.y1,f=e.z1,h=(a+c)/2,p=(s+l)/2,d=(u+f)/2;(o=i[0])&&n.push(new y(o,a,s,u,h,p,d)),(o=i[1])&&n.push(new y(o,h,s,u,c,p,d)),(o=i[2])&&n.push(new y(o,a,p,u,h,l,d)),(o=i[3])&&n.push(new y(o,h,p,u,c,l,d)),(o=i[4])&&n.push(new y(o,a,s,d,h,p,f)),(o=i[5])&&n.push(new y(o,h,s,d,c,p,f)),(o=i[6])&&n.push(new y(o,a,p,d,h,l,f)),(o=i[7])&&n.push(new y(o,h,p,d,c,l,f))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.z0,e.x1,e.y1,e.z1);return this},m=function(t){return arguments.length?(this._x=t,this):this._x},T=function(t){return arguments.length?(this._y=t,this):this._y},N=function(t){return arguments.length?(this._z=t,this):this._z},b=s.prototype=u.prototype;b.copy=function(){var t,e,n=new u(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root;if(!r)return n;if(!r.length)return n._root=c(r),n;for(t=[{source:r,target:n._root=new Array(8)}];r=t.pop();)for(var i=0;i<8;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(8)}):r.target[i]=c(e));return n},b.add=l,b.addAll=n,b.cover=f,b.data=h,b.extent=p,b.find=d,b.remove=v,b.removeAll=r,b.root=_,b.size=x,b.visit=g,b.visitAfter=w,b.x=m,b.y=T,b.z=N,t.octree=s,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){var r,i;/**
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");var r=n(3),i=n(11);AFRAME.registerComponent("forcegraph",{schema:{jsonUrl:{type:"string"},nodes:{parse:JSON.parse,default:"[]"},links:{parse:JSON.parse,default:"[]"},numDimensions:{type:"number",default:3},nodeRelSize:{type:"number",default:4},lineOpacity:{type:"number",default:.2},autoColorBy:{type:"string"},idField:{type:"string",default:"id"},valField:{type:"string",default:"val"},nameField:{type:"string",default:"name"},colorField:{type:"string",default:"color"},linkSourceField:{type:"string",default:"source"},linkTargetField:{type:"string",default:"target"},warmupTicks:{type:"int",default:0},cooldownTicks:{type:"int",default:1/0},cooldownTime:{type:"int",default:15e3},alphaDecay:{type:"number",default:.0228},velocityDecay:{type:"number",default:.4}},init:function(){this.state={},this.state.tooltipEl=document.createElement("a-text"),document.querySelector("a-entity[camera], a-camera").appendChild(this.state.tooltipEl),this.state.tooltipEl.setAttribute("position","0 -0.5 -1"),this.state.tooltipEl.setAttribute("width",2),this.state.tooltipEl.setAttribute("align","center"),this.state.tooltipEl.setAttribute("color","lavender"),this.state.tooltipEl.setAttribute("value",""),this.cameraObj=document.querySelector("[camera], a-camera").object3D.children.filter(function(t){return"PerspectiveCamera"===t.type})[0],this.state.forceLayout=r.forceSimulation().force("link",r.forceLink()).force("charge",r.forceManyBody()).force("center",r.forceCenter()).stop()},remove:function(){this.state.tooltipEl.remove()},update:function(t){function e(){(l++>o.cooldownTicks||new Date-f>o.cooldownTime)&&r.state.forceLayout.stop(),o.nodes.forEach(function(t){var e=t.__sphere;e.position.x=t.x,e.position.y=t.y||0,e.position.z=t.z||0}),o.links.forEach(function(t){var e=t.__line;e.geometry.vertices=[new THREE.Vector3(t.source.x,t.source.y||0,t.source.z||0),new THREE.Vector3(t.target.x,t.target.y||0,t.target.z||0)],e.geometry.verticesNeedUpdate=!0,e.geometry.computeBoundingSphere()})}function n(t,e,n){if(e){var r=["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],i=t.filter(function(t){return!t[n]}),o={};i.forEach(function(t){o[t[e]]=null}),Object.keys(o).forEach(function(t,e){o[t]=e}),i.forEach(function(t){t[n]=parseInt(r[o[t[e]]%r.length].slice(1),16)})}}var r=this,o=this.data,a=AFRAME.utils.diff(o,t);"jsonUrl"in a&&o.jsonUrl&&i.get(o.jsonUrl).then(function(t,e){o.nodes=e.nodes,o.links=e.links,r.update(o)}),n(o.nodes,o.autoColorBy,o.colorField),o.links.forEach(function(t){t.source=t[o.linkSourceField],t.target=t[o.linkTargetField],t.id=[t.source,t.target].join(" > ")});for(var s=this.el.object3D;s.children.length;)s.remove(s.children[0]);o.nodes.forEach(function(t){var e=new THREE.MeshLambertMaterial({color:t[o.colorField]||16777130,transparent:!0});e.opacity=.75;var n=new THREE.Mesh(new THREE.SphereGeometry(Math.cbrt(t[o.valField]||1)*o.nodeRelSize,8,8),e);n.name=t[o.nameField],s.add(t.__sphere=n)});var u=new THREE.LineBasicMaterial({color:15790320,transparent:!0});u.opacity=o.lineOpacity,o.links.forEach(function(t){var e=new THREE.Line(new THREE.Geometry,u);e.geometry.vertices=[new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,0)],s.add(t.__line=e)}),r.state.forceLayout.stop().alpha(1).alphaDecay(o.alphaDecay).velocityDecay(o.velocityDecay).numDimensions(o.numDimensions).nodes(o.nodes).force("link").id(function(t){return t[o.idField]}).links(o.links);for(var c=0;c<o.warmupTicks;c++)r.state.forceLayout.tick();var l=0,f=new Date;r.state.forceLayout.on("tick",e).restart()},tick:function(t,e){var n=new THREE.Raycaster;n.setFromCamera(new THREE.Vector2(0,0),this.cameraObj);var r=n.intersectObjects(this.el.object3D.children).filter(function(t){return t.object.name});this.state.tooltipEl.setAttribute("value",r.length?r[0].object.name:"")}})},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function a(){d&&p&&(d=!1,p.length?y=p.concat(y):v=-1,y.length&&s())}function s(){if(!d){var t=i(a);d=!0;for(var e=y.length;e;){for(p=y,y=[];++v<e;)p&&p[v].run();v=-1,e=y.length}p=null,d=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function c(){}var l,f,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(t){f=r}}();var p,y=[],d=!1,v=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];y.push(new u(t,e)),1!==y.length||d||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(t,e,n){if(isNaN(e))return t;var r,i,o,a,s,u,c=t._root,l={data:n},f=t._x0,h=t._x1;if(!c)return t._root=l,t;for(;c.length;)if((a=e>=(i=(f+h)/2))?f=i:h=i,r=c,!(c=c[s=+a]))return r[s]=l,t;if(o=+t._x.call(null,c.data),e===o)return l.next=c,r?r[s]=l:t._root=l,t;do r=r?r[s]=new Array(2):t._root=new Array(2),(a=e>=(i=(f+h)/2))?f=i:h=i;while((s=+a)===(u=+(o>=i)));return r[u]=c,r[s]=l,t}function n(t){var n,r,i=t.length,o=new Array(i),a=1/0,s=-(1/0);for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t[n]))||(o[n]=r,r<a&&(a=r),r>s&&(s=r));for(s<a&&(a=this._x0,s=this._x1),this.cover(a).cover(s),n=0;n<i;++n)e(this,o[n],t[n]);return this}function r(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function i(t){return t[0]}function o(t,e){var n=new a(null==e?i:e,NaN,NaN);return null==t?n:n.addAll(t)}function a(t,e,n){this._x=t,this._x0=e,this._x1=n,this._root=void 0}function s(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var u=function(t){var n=+this._x.call(null,t);return e(this.cover(n),n,t)},c=function(t){if(isNaN(t=+t))return this;var e=this._x0,n=this._x1;if(isNaN(e))n=(e=Math.floor(t))+1;else{if(!(e>t||t>n))return this;var r,i,o=n-e,a=this._root;switch(i=+(t<(e+n)/2)){case 0:do r=new Array(2),r[i]=a,a=r;while(o*=2,n=e+o,t>n);break;case 1:do r=new Array(2),r[i]=a,a=r;while(o*=2,e=n-o,e>t)}this._root&&this._root.length&&(this._root=a)}return this._x0=e,this._x1=n,this},l=function(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t},f=function(t){return arguments.length?this.cover(+t[0][0]).cover(+t[1][0]):isNaN(this._x0)?void 0:[[this._x0],[this._x1]]},h=function(t,e,n){this.node=t,this.x0=e,this.x1=n},p=function(t,e){var n,r,i,o,a,s=this._x0,u=this._x1,c=[],l=this._root;for(l&&c.push(new h(l,s,u)),null==e?e=1/0:(s=t-e,u=t+e);o=c.pop();)if(!(!(l=o.node)||(r=o.x0)>u||(i=o.x1)<s))if(l.length){var f=(r+i)/2;c.push(new h(l[1],f,i),new h(l[0],r,f)),(a=+(t>=f))&&(o=c[c.length-1],c[c.length-1]=c[c.length-1-a],c[c.length-1-a]=o)}else{var p=t-+this._x.call(null,l.data);p<e&&(e=p,s=t-p,u=t+p,n=l.data)}return n},y=function(t){if(isNaN(o=+this._x.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l=this._root,f=this._x0,h=this._x1;if(!l)return this;if(l.length)for(;;){if((s=o>=(a=(f+h)/2))?f=a:h=a,e=l,!(l=l[u=+s]))return this;if(!l.length)break;e[u+1&1]&&(n=e,c=u)}for(;l.data!==t;)if(r=l,!(l=l.next))return this;return(i=l.next)&&delete l.next,r?(i?r.next=i:delete r.next,this):e?(i?e[u]=i:delete e[u],(l=e[0]||e[1])&&l===(e[1]||e[0])&&!l.length&&(n?n[c]=l:this._root=l),this):(this._root=i,this)},d=function(){return this._root},v=function(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t},_=function(t){var e,n,r,i,o=[],a=this._root;for(a&&o.push(new h(a,this._x0,this._x1));e=o.pop();)if(!t(a=e.node,r=e.x0,i=e.x1)&&a.length){var s=(r+i)/2;(n=a[1])&&o.push(new h(n,s,i)),(n=a[0])&&o.push(new h(n,r,s))}return this},x=function(t){var e,n=[],r=[];for(this._root&&n.push(new h(this._root,this._x0,this._x1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.x1,u=(a+s)/2;(o=i[0])&&n.push(new h(o,a,u)),(o=i[1])&&n.push(new h(o,u,s))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.x1);return this},g=function(t){return arguments.length?(this._x=t,this):this._x},w=o.prototype=a.prototype;w.copy=function(){var t,e,n=new a(this._x,this._x0,this._x1),r=this._root;if(!r)return n;if(!r.length)return n._root=s(r),n;for(t=[{source:r,target:n._root=new Array(2)}];r=t.pop();)for(var i=0;i<2;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(2)}):r.target[i]=s(e));return n},w.add=u,w.addAll=n,w.cover=c,w.data=l,w.extent=f,w.find=p,w.remove=y,w.removeAll=r,w.root=d,w.size=v,w.visit=_,w.visitAfter=x,w.x=g,t.binarytree=o,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,r){r(e,n(2),n(6),n(8),n(4),n(5),n(7))}(this,function(t,e,n,r,i,o,a){"use strict";function s(t){return t.x+t.vx}function u(t){return t.y+t.vy}function c(t){return t.z+t.vz}function l(t){return t.index}function f(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function h(t){return t.x}function p(t){return t.y}function y(t){return t.z}var d=function(t,e,n){function r(){var r,o,a=i.length,s=0,u=0,c=0;for(r=0;r<a;++r)o=i[r],s+=o.x||0,u+=o.y||0,c+=o.z||0;for(s=s/a-t,u=u/a-e,c=c/a-n,r=0;r<a;++r)o=i[r],s&&(o.x-=s),u&&(o.y-=u),c&&(o.z-=c)}var i;return null==t&&(t=0),null==e&&(e=0),null==n&&(n=0),r.initialize=function(t){i=t},r.x=function(e){return arguments.length?(t=+e,r):t},r.y=function(t){return arguments.length?(e=+t,r):e},r.z=function(t){return arguments.length?(n=+t,r):n},r},v=function(t){return function(){return t}},_=function(){return 1e-6*(Math.random()-.5)},x=function(t){function i(){function t(t,e,n,r,i,o,a){var s=[e,n,r,i,o,a],u=s[0],c=s[1],l=s[2],h=s[f],y=s[f+1],T=s[f+2],N=t.data,b=t.r,z=w+b;if(!N)return u>v+z||h<v-z||f>1&&(c>x+z||y<x-z)||f>2&&(l>g+z||T<g-z);if(N.index>d.index){var A=v-N.x-N.vx,E=f>1?x-N.y-N.vy:0,M=f>2?g-N.z-N.vz:0,k=A*A+E*E+M*M;k<z*z&&(0===A&&(A=_(),k+=A*A),f>1&&0===E&&(E=_(),k+=E*E),f>2&&0===M&&(M=_(),k+=M*M),k=(z-(k=Math.sqrt(k)))/k*p,d.vx+=(A*=k)*(z=(b*=b)/(m+b)),f>1&&(d.vy+=(E*=k)*z),f>2&&(d.vz+=(M*=k)*z),N.vx-=A*(z=1-z),f>1&&(N.vy-=E*z),f>2&&(N.vz-=M*z))}}for(var i,a,d,v,x,g,w,m,T=l.length,N=0;N<y;++N)for(a=(1===f?e.binarytree(l,s):2===f?n.quadtree(l,s,u):3===f?r.octree(l,s,u,c):null).visitAfter(o),i=0;i<T;++i)d=l[i],w=h[d.index],m=w*w,v=d.x+d.vx,f>1&&(x=d.y+d.vy),f>2&&(g=d.z+d.vz),a.visit(t)}function o(t){if(t.data)return t.r=h[t.data.index];for(var e=t.r=0;e<Math.pow(2,f);++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function a(){if(l){var e,n,r=l.length;for(h=new Array(r),e=0;e<r;++e)n=l[e],h[n.index]=+t(n,e,l)}}var l,f,h,p=1,y=1;return"function"!=typeof t&&(t=v(null==t?1:+t)),i.initialize=function(t,e){l=t,f=e,a()},i.iterations=function(t){return arguments.length?(y=+t,i):y},i.strength=function(t){return arguments.length?(p=+t,i):p},i.radius=function(e){return arguments.length?(t="function"==typeof e?e:v(+e),a(),i):t},i},g=function(t){function e(t){return 1/Math.min(p[t.source.index],p[t.target.index])}function n(e){for(var n=0,r=t.length;n<w;++n)for(var i,o,a,c,l,f=0,p=0,d=0,v=0;f<r;++f)i=t[f],o=i.source,a=i.target,p=a.x+a.vx-o.x-o.vx||_(),h>1&&(d=a.y+a.vy-o.y-o.vy||_()),h>2&&(v=a.z+a.vz-o.z-o.vz||_()),c=Math.sqrt(p*p+d*d+v*v),c=(c-u[f])/c*e*s[f],p*=c,d*=c,v*=c,a.vx-=p*(l=y[f]),h>1&&(a.vy-=d*l),h>2&&(a.vz-=v*l),o.vx+=p*(l=1-l),h>1&&(o.vy+=d*l),h>2&&(o.vz+=v*l)}function r(){if(c){var e,n,r=c.length,l=t.length,h=i.map(c,d);for(e=0,p=new Array(r);e<l;++e)n=t[e],n.index=e,"object"!=typeof n.source&&(n.source=f(h,n.source)),"object"!=typeof n.target&&(n.target=f(h,n.target)),p[n.source.index]=(p[n.source.index]||0)+1,p[n.target.index]=(p[n.target.index]||0)+1;for(e=0,y=new Array(l);e<l;++e)n=t[e],y[e]=p[n.source.index]/(p[n.source.index]+p[n.target.index]);s=new Array(l),o(),u=new Array(l),a()}}function o(){if(c)for(var e=0,n=t.length;e<n;++e)s[e]=+x(t[e],e,t)}function a(){if(c)for(var e=0,n=t.length;e<n;++e)u[e]=+g(t[e],e,t)}var s,u,c,h,p,y,d=l,x=e,g=v(30),w=1;return null==t&&(t=[]),n.initialize=function(t,e){c=t,h=e,r()},n.links=function(e){return arguments.length?(t=e,r(),n):t},n.id=function(t){return arguments.length?(d=t,n):d},n.iterations=function(t){return arguments.length?(w=+t,n):w},n.strength=function(t){return arguments.length?(x="function"==typeof t?t:v(+t),o(),n):x},n.distance=function(t){return arguments.length?(g="function"==typeof t?t:v(+t),a(),n):g},n},w=3,m=10,T=Math.PI*(3-Math.sqrt(5)),N=Math.PI/24,b=function(t,e){function n(){r(),x.call("tick",c),f<h&&(_.stop(),x.call("end",c))}function r(){var e,n,r=t.length;for(f+=(y-f)*p,v.each(function(t){t(f)}),e=0;e<r;++e)n=t[e],null==n.fx?n.x+=n.vx*=d:(n.x=n.fx,n.vx=0),l>1&&(null==n.fy?n.y+=n.vy*=d:(n.y=n.fy,n.vy=0)),l>2&&(null==n.fz?n.z+=n.vz*=d:(n.z=n.fz,n.vz=0))}function s(){for(var e,n=0,r=t.length;n<r;++n){if(e=t[n],e.index=n,isNaN(e.x)||l>1&&isNaN(e.y)||l>2&&isNaN(e.z)){var i=m*(l>2?Math.cbrt(n):l>1?Math.sqrt(n):n),o=n*T,a=n*N;e.x=i*(l>1?Math.cos(o):1),l>1&&(e.y=i*Math.sin(o)),l>2&&(e.z=i*Math.sin(a))}(isNaN(e.vx)||l>1&&isNaN(e.vy)||l>2&&isNaN(e.vz))&&(e.vx=0,l>1&&(e.vy=0),l>2&&(e.vz=0))}}function u(e){return e.initialize&&e.initialize(t,l),e}e=e||2;var c,l=Math.min(w,Math.max(1,Math.round(e))),f=1,h=.001,p=1-Math.pow(h,1/300),y=0,d=.6,v=i.map(),_=a.timer(n),x=o.dispatch("tick","end");return null==t&&(t=[]),s(),c={tick:r,restart:function(){return _.restart(n),c},stop:function(){return _.stop(),c},numDimensions:function(t){return arguments.length?(l=Math.min(w,Math.max(1,Math.round(t))),v.each(u),c):l},nodes:function(e){return arguments.length?(t=e,s(),v.each(u),c):t},alpha:function(t){return arguments.length?(f=+t,c):f},alphaMin:function(t){return arguments.length?(h=+t,c):h},alphaDecay:function(t){return arguments.length?(p=+t,c):+p},alphaTarget:function(t){return arguments.length?(y=+t,c):y},velocityDecay:function(t){return arguments.length?(d=1-t,c):1-d},force:function(t,e){return arguments.length>1?(null==e?v.remove(t):v.set(t,u(e)),c):v.get(t)},find:function(){var e,n,r,i,o,a,s=Array.prototype.slice.call(arguments),u=s.shift()||0,c=(l>1?s.shift():null)||0,f=(l>2?s.shift():null)||0,h=s.shift()||1/0,p=0,y=t.length;for(h*=h,p=0;p<y;++p)o=t[p],e=u-o.x,n=c-(o.y||0),r=f-(o.z||0),i=e*e+n*n+r*r,i<h&&(a=o,h=i);return a},on:function(t,e){return arguments.length>1?(x.on(t,e),c):x.on(t)}}},z=function(){function t(t){var i,f=s.length,d=(1===u?e.binarytree(s,h):2===u?n.quadtree(s,h,p):3===u?r.octree(s,h,p,y):null).visitAfter(o);for(l=t,i=0;i<f;++i)c=s[i],d.visit(a)}function i(){if(s){var t,e,n=s.length;for(f=new Array(n),t=0;t<n;++t)e=s[t],f[e.index]=+d(e,t,s)}}function o(t){var e,n,r,i,o,a,s=0;if(t.length){for(r=i=o=a=0;a<4;++a)(e=t[a])&&(n=e.value)&&(s+=n,r+=n*(e.x||0),i+=n*(e.y||0),o+=n*(e.z||0));t.x=r/s,u>1&&(t.y=i/s),u>2&&(t.z=o/s)}else{e=t,e.x=e.data.x,u>1&&(e.y=e.data.y),u>2&&(e.z=e.data.z);do s+=f[e.data.index];while(e=e.next)}t.value=s}function a(t,e,n,r,i){if(!t.value)return!0;var o=[n,r,i][u-1],a=t.x-c.x,s=u>1?t.y-c.y:0,h=u>2?t.z-c.z:0,p=o-e,y=a*a+s*s+h*h;if(p*p/w<y)return y<g&&(0===a&&(a=_(),y+=a*a),u>1&&0===s&&(s=_(),y+=s*s),u>2&&0===h&&(h=_(),y+=h*h),y<x&&(y=Math.sqrt(x*y)),c.vx+=a*t.value*l/y,u>1&&(c.vy+=s*t.value*l/y),u>2&&(c.vz+=h*t.value*l/y)),!0;if(!(t.length||y>=g)){(t.data!==c||t.next)&&(0===a&&(a=_(),y+=a*a),u>1&&0===s&&(s=_(),y+=s*s),u>2&&0===h&&(h=_(),y+=h*h),y<x&&(y=Math.sqrt(x*y)));do t.data!==c&&(p=f[t.data.index]*l/y,c.vx+=a*p,u>1&&(c.vy+=s*p),u>2&&(c.vz+=h*p));while(t=t.next)}}var s,u,c,l,f,d=v(-30),x=1,g=1/0,w=.81;return t.initialize=function(t,e){s=t,u=e,i()},t.strength=function(e){return arguments.length?(d="function"==typeof e?e:v(+e),i(),t):d},t.distanceMin=function(e){return arguments.length?(x=e*e,t):Math.sqrt(x)},t.distanceMax=function(e){return arguments.length?(g=e*e,t):Math.sqrt(g)},t.theta=function(e){return arguments.length?(w=e*e,t):Math.sqrt(w)},t},A=function(t){function e(t){for(var e,n=0,a=r.length;n<a;++n)e=r[n],e.vx+=(o[n]-e.x)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),o=new Array(n),e=0;e<n;++e)i[e]=isNaN(o[e]=+t(r[e],e,r))?0:+a(r[e],e,r)}}var r,i,o,a=v(.1);return"function"!=typeof t&&(t=v(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(a="function"==typeof t?t:v(+t),n(),e):a},e.x=function(r){return arguments.length?(t="function"==typeof r?r:v(+r),n(),e):t},e},E=function(t){function e(t){for(var e,n=0,a=r.length;n<a;++n)e=r[n],e.vy+=(o[n]-e.y)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),o=new Array(n),e=0;e<n;++e)i[e]=isNaN(o[e]=+t(r[e],e,r))?0:+a(r[e],e,r)}}var r,i,o,a=v(.1);return"function"!=typeof t&&(t=v(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(a="function"==typeof t?t:v(+t),n(),e):a},e.y=function(r){return arguments.length?(t="function"==typeof r?r:v(+r),n(),e):t},e},M=function(t){function e(t){for(var e,n=0,a=r.length;n<a;++n)e=r[n],e.vz+=(o[n]-e.z)*i[n]*t}function n(){if(r){var e,n=r.length;for(i=new Array(n),o=new Array(n),e=0;e<n;++e)i[e]=isNaN(o[e]=+t(r[e],e,r))?0:+a(r[e],e,r)}}var r,i,o,a=v(.1);return"function"!=typeof t&&(t=v(null==t?0:+t)),e.initialize=function(t){r=t,n()},e.strength=function(t){return arguments.length?(a="function"==typeof t?t:v(+t),n(),e):a},e.z=function(r){return arguments.length?(t="function"==typeof r?r:v(+r),n(),e):t},e};t.forceCenter=d,t.forceCollide=x,t.forceLink=g,t.forceManyBody=z,t.forceSimulation=b,t.forceX=A,t.forceY=E,t.forceZ=M,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(){}function n(t,n){var r=new e;if(t instanceof e)t.each(function(t,e){r.set(e,t)});else if(Array.isArray(t)){var i,o=-1,a=t.length;if(null==n)for(;++o<a;)r.set(o,t[o]);else for(;++o<a;)r.set(n(i=t[o],o,t),i)}else if(t)for(var s in t)r.set(s,t[s]);return r}function r(){return{}}function i(t,e,n){t[e]=n}function o(){return n()}function a(t,e,n){t.set(e,n)}function s(){}function u(t,e){var n=new s;if(t instanceof s)t.each(function(t){n.add(t)});else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}var c="$";e.prototype=n.prototype={constructor:e,has:function(t){return c+t in this},get:function(t){return this[c+t]},set:function(t,e){return this[c+t]=e,this},remove:function(t){var e=c+t;return e in this&&delete this[e]},clear:function(){for(var t in this)t[0]===c&&delete this[t]},keys:function(){var t=[];for(var e in this)e[0]===c&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)e[0]===c&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)e[0]===c&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)e[0]===c&&++t;return t},empty:function(){for(var t in this)if(t[0]===c)return!1;return!0},each:function(t){for(var e in this)e[0]===c&&t(this[e],e.slice(1),this)}};var l=function(){function t(e,r,i,o){if(r>=l.length)return null!=u?u(e):null!=s?e.sort(s):e;for(var a,c,f,h=-1,p=e.length,y=l[r++],d=n(),v=i();++h<p;)(f=d.get(a=y(c=e[h])+""))?f.push(c):d.set(a,[c]);return d.each(function(e,n){o(v,n,t(e,r,i,o))}),v}function e(t,n){if(++n>l.length)return t;var r,i=f[n-1];return null!=u&&n>=l.length?r=t.entries():(r=[],t.each(function(t,i){r.push({key:i,values:e(t,n)})})),null!=i?r.sort(function(t,e){return i(t.key,e.key)}):r}var s,u,c,l=[],f=[];return c={object:function(e){return t(e,0,r,i)},map:function(e){return t(e,0,o,a)},entries:function(n){return e(t(n,0,o,a),0)},key:function(t){return l.push(t),c},sortKeys:function(t){return f[l.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return u=t,c}}},f=n.prototype;s.prototype=u.prototype={constructor:s,has:f.has,add:function(t){return t+="",this[c+t]=t,this},remove:f.remove,clear:f.clear,values:f.keys,size:f.size,empty:f.empty,each:f.each};var h=function(t){var e=[];for(var n in t)e.push(n);return e},p=function(t){var e=[];for(var n in t)e.push(t[n]);return e},y=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e};t.nest=l,t.set=u,t.map=n,t.keys=h,t.values=p,t.entries=y,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(){for(var t,e=0,r=arguments.length,i={};e<r;++e){if(!(t=arguments[e]+"")||t in i)throw new Error("illegal type: "+t);i[t]=[]}return new n(i)}function n(t){this._=t}function r(t,e){return t.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}function i(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function o(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=a,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}var a={value:function(){}};n.prototype=e.prototype={constructor:n,on:function(t,e){var n,a=this._,s=r(t+"",a),u=-1,c=s.length;{if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++u<c;)if(n=(t=s[u]).type)a[n]=o(a[n],t.name,e);else if(null==e)for(n in a)a[n]=o(a[n],t.name,null);return this}for(;++u<c;)if((n=(t=s[u]).type)&&(n=i(a[n],t.name)))return n}},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new n(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,n=r.length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}},t.dispatch=e,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,u,c,l,f,h,p=t._root,y={data:r},d=t._x0,v=t._y0,_=t._x1,x=t._y1;if(!p)return t._root=y,t;for(;p.length;)if((c=e>=(o=(d+_)/2))?d=o:_=o,(l=n>=(a=(v+x)/2))?v=a:x=a,i=p,!(p=p[f=l<<1|c]))return i[f]=y,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&n===u)return y.next=p,i?i[f]=y:t._root=y,t;do i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(o=(d+_)/2))?d=o:_=o,(l=n>=(a=(v+x)/2))?v=a:x=a;while((f=l<<1|c)===(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=y,t}function n(t){var n,r,i,o,a=t.length,s=new Array(a),u=new Array(a),c=1/0,l=1/0,f=-(1/0),h=-(1/0);for(r=0;r<a;++r)isNaN(i=+this._x.call(null,n=t[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=i,u[r]=o,i<c&&(c=i),i>f&&(f=i),o<l&&(l=o),o>h&&(h=o));for(f<c&&(c=this._x0,f=this._x1),h<l&&(l=this._y0,h=this._y1),this.cover(c,l).cover(f,h),r=0;r<a;++r)e(this,s[r],u[r],t[r]);return this}function r(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function i(t){return t[0]}function o(t){return t[1]}function a(t,e,n){var r=new s(null==e?i:e,null==n?o:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function s(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function u(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var c=function(t){var n=+this._x.call(null,t),r=+this._y.call(null,t);return e(this.cover(n,r),n,r,t)},l=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{if(!(n>t||t>i||r>e||e>o))return this;var a,s,u=i-n,c=this._root;switch(s=(e<(r+o)/2)<<1|t<(n+i)/2){case 0:do a=new Array(4),a[s]=c,c=a;while(u*=2,i=n+u,o=r+u,t>i||e>o);break;case 1:do a=new Array(4),a[s]=c,c=a;while(u*=2,n=i-u,o=r+u,n>t||e>o);break;case 2:do a=new Array(4),a[s]=c,c=a;while(u*=2,i=n+u,r=o-u,t>i||r>e);break;case 3:do a=new Array(4),a[s]=c,c=a;while(u*=2,n=i-u,r=o-u,n>t||r>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},f=function(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t},h=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},p=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i},y=function(t,e,n){var r,i,o,a,s,u,c,l=this._x0,f=this._y0,h=this._x1,y=this._y1,d=[],v=this._root;for(v&&d.push(new p(v,l,f,h,y)),null==n?n=1/0:(l=t-n,f=e-n,h=t+n,y=e+n,n*=n);u=d.pop();)if(!(!(v=u.node)||(i=u.x0)>h||(o=u.y0)>y||(a=u.x1)<l||(s=u.y1)<f))if(v.length){var _=(i+a)/2,x=(o+s)/2;d.push(new p(v[3],_,x,a,s),new p(v[2],i,x,_,s),new p(v[1],_,o,a,x),new p(v[0],i,o,_,x)),(c=(e>=x)<<1|t>=_)&&(u=d[d.length-1],d[d.length-1]=d[d.length-1-c],d[d.length-1-c]=u)}else{var g=t-+this._x.call(null,v.data),w=e-+this._y.call(null,v.data),m=g*g+w*w;if(m<n){var T=Math.sqrt(n=m);l=t-T,f=e-T,h=t+T,y=e+T,r=v.data}}return r},d=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l,f,h,p=this._root,y=this._x0,d=this._y0,v=this._x1,_=this._y1;if(!p)return this;if(p.length)for(;;){if((c=o>=(s=(y+v)/2))?y=s:v=s,(l=a>=(u=(d+_)/2))?d=u:_=u,e=p,!(p=p[f=l<<1|c]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(n?n[h]=p:this._root=p),this):(this._root=i,this)},v=function(){return this._root},_=function(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t},x=function(t){var e,n,r,i,o,a,s=[],u=this._root;for(u&&s.push(new p(u,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(u=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&u.length){var c=(r+o)/2,l=(i+a)/2;(n=u[3])&&s.push(new p(n,c,l,o,a)),(n=u[2])&&s.push(new p(n,r,l,c,a)),(n=u[1])&&s.push(new p(n,c,i,o,l)),(n=u[0])&&s.push(new p(n,r,i,c,l))}return this},g=function(t){var e,n=[],r=[];for(this._root&&n.push(new p(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.x1,c=e.y1,l=(a+u)/2,f=(s+c)/2;(o=i[0])&&n.push(new p(o,a,s,l,f)),(o=i[1])&&n.push(new p(o,l,s,u,f)),(o=i[2])&&n.push(new p(o,a,f,l,c)),(o=i[3])&&n.push(new p(o,l,f,u,c))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},w=function(t){return arguments.length?(this._x=t,this):this._x},m=function(t){return arguments.length?(this._y=t,this):this._y},T=a.prototype=s.prototype;T.copy=function(){var t,e,n=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=u(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=u(e));return n},T.add=c,T.addAll=n,T.cover=l,T.data=f,T.extent=h,T.find=y,T.remove=d,T.removeAll=r,T.root=v,T.size=_,T.visit=x,T.visitAfter=g,T.x=w,T.y=m,t.quadtree=a,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(){return _||(w(n),_=g.now()+x)}function n(){_=0}function r(){this._call=this._time=this._next=null}function i(t,e,n){var i=new r;return i.restart(t,e,n),i}function o(){e(),++h;for(var t,n=l;n;)(t=_-n._time)>=0&&n._call.call(null,t),n=n._next;--h}function a(){_=(v=g.now())+x,h=p=0;try{o()}finally{h=0,u(),_=0}}function s(){var t=g.now(),e=t-v;e>d&&(x-=e,v=t)}function u(){for(var t,e,n=l,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:l=e);f=t,c(r)}function c(t){if(!h){p&&(p=clearTimeout(p));var e=t-_;e>24?(t<1/0&&(p=setTimeout(a,e)),y&&(y=clearInterval(y))):(y||(v=_,y=setInterval(s,d)),h=1,w(a))}}var l,f,h=0,p=0,y=0,d=1e3,v=0,_=0,x=0,g="object"==typeof performance&&performance.now?performance:Date,w="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};r.prototype=i.prototype={constructor:r,restart:function(t,n,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?e():+r)+(null==n?0:+n),this._next||f===this||(f?f._next=this:l=this,f=this),this._call=t,this._time=r,c()},stop:function(){this._call&&(this._call=null,this._time=1/0,c())}};var m=function(t,e,n){var i=new r;return e=null==e?0:+e,i.restart(function(n){i.stop(),t(n+e)},e,n),i},T=function(t,n,i){var o=new r,a=n;return null==n?(o.restart(t,n,i),o):(n=+n,i=null==i?e():+i,o.restart(function e(r){r+=a,o.restart(e,a+=n,i),t(r)},n,i),o)};t.now=e,t.timer=i,t.timerFlush=o,t.timeout=m,t.interval=T,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){!function(t,n){n(e)}(this,function(t){"use strict";function e(t,e,n,r,i){if(isNaN(e)||isNaN(n)||isNaN(r))return t;var o,a,s,u,c,l,f,h,p,y,d,v,_=t._root,x={data:i},g=t._x0,w=t._y0,m=t._z0,T=t._x1,N=t._y1,b=t._z1;if(!_)return t._root=x,t;for(;_.length;)if((h=e>=(a=(g+T)/2))?g=a:T=a,(p=n>=(s=(w+N)/2))?w=s:N=s,(y=r>=(u=(m+b)/2))?m=u:b=u,o=_,!(_=_[d=y<<2|p<<1|h]))return o[d]=x,t;if(c=+t._x.call(null,_.data),l=+t._y.call(null,_.data),f=+t._z.call(null,_.data),e===c&&n===l&&r===f)return x.next=_,o?o[d]=x:t._root=x,t;do o=o?o[d]=new Array(8):t._root=new Array(8),(h=e>=(a=(g+T)/2))?g=a:T=a,(p=n>=(s=(w+N)/2))?w=s:N=s,(y=r>=(u=(m+b)/2))?m=u:b=u;while((d=y<<2|p<<1|h)===(v=(f>=u)<<2|(l>=s)<<1|c>=a));return o[v]=_,o[d]=x,t}function n(t){var n,r,i,o,a,s=t.length,u=new Array(s),c=new Array(s),l=new Array(s),f=1/0,h=1/0,p=1/0,y=-(1/0),d=-(1/0),v=-(1/0);for(r=0;r<s;++r)isNaN(i=+this._x.call(null,n=t[r]))||isNaN(o=+this._y.call(null,n))||isNaN(a=+this._z.call(null,n))||(u[r]=i,c[r]=o,l[r]=a,i<f&&(f=i),i>y&&(y=i),o<h&&(h=o),o>d&&(d=o),a<p&&(p=a),a>v&&(v=a));for(y<f&&(f=this._x0,y=this._x1),d<h&&(h=this._y0,d=this._y1),v<p&&(p=this._z0,v=this._z1),this.cover(f,h,p).cover(y,d,v),r=0;r<s;++r)e(this,u[r],c[r],l[r],t[r]);return this}function r(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function i(t){return t[0]}function o(t){return t[1]}function a(t){return t[2]}function s(t,e,n,r){var s=new u(null==e?i:e,null==n?o:n,null==r?a:r,NaN,NaN,NaN,NaN,NaN,NaN);return null==t?s:s.addAll(t)}function u(t,e,n,r,i,o,a,s,u){this._x=t,this._y=e,this._z=n,this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this._root=void 0}function c(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var l=function(t){var n=+this._x.call(null,t),r=+this._y.call(null,t),i=+this._z.call(null,t);return e(this.cover(n,r,i),n,r,i,t)},f=function(t,e,n){if(isNaN(t=+t)||isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,o=this._z0,a=this._x1,s=this._y1,u=this._z1;if(isNaN(r))a=(r=Math.floor(t))+1,s=(i=Math.floor(e))+1,u=(o=Math.floor(n))+1;else{if(!(r>t||t>a||i>e||e>s||o>n||n>u))return this;var c,l,f=a-r,h=this._root;switch(l=(n<(o+u)/2)<<2|(e<(i+s)/2)<<1|t<(r+a)/2){case 0:do c=new Array(8),
c[l]=h,h=c;while(f*=2,a=r+f,s=i+f,u=o+f,t>a||e>s||n>u);break;case 1:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,s=i+f,u=o+f,r>t||e>s||n>u);break;case 2:do c=new Array(8),c[l]=h,h=c;while(f*=2,a=r+f,i=s-f,u=o+f,t>a||i>e||n>u);break;case 3:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,i=s-f,u=o+f,r>t||i>e||n>u);break;case 4:do c=new Array(8),c[l]=h,h=c;while(f*=2,a=r+f,s=i+f,o=u-f,t>a||e>s||o>n);break;case 5:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,s=i+f,o=u-f,r>t||e>s||o>n);break;case 6:do c=new Array(8),c[l]=h,h=c;while(f*=2,a=r+f,i=s-f,o=u-f,t>a||i>e||o>n);break;case 7:do c=new Array(8),c[l]=h,h=c;while(f*=2,r=a-f,i=s-f,o=u-f,r>t||i>e||o>n)}this._root&&this._root.length&&(this._root=h)}return this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=u,this},h=function(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t},p=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1],+t[0][2]).cover(+t[1][0],+t[1][1],+t[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]},y=function(t,e,n,r,i,o,a){this.node=t,this.x0=e,this.y0=n,this.z0=r,this.x1=i,this.y1=o,this.z1=a},d=function(t,e,n,r){var i,o,a,s,u,c,l,f,h,p=this._x0,d=this._y0,v=this._z0,_=this._x1,x=this._y1,g=this._z1,w=[],m=this._root;for(m&&w.push(new y(m,p,d,v,_,x,g)),null==r?r=1/0:(p=t-r,d=e-r,v=n-r,_=t+r,x=e+r,g=n+r,r*=r);f=w.pop();)if(!(!(m=f.node)||(o=f.x0)>_||(a=f.y0)>x||(s=f.z0)>g||(u=f.x1)<p||(c=f.y1)<d||(l=f.z1)<v))if(m.length){var T=(o+u)/2,N=(a+c)/2,b=(s+l)/2;w.push(new y(m[7],T,N,b,u,c,l),new y(m[6],o,N,b,T,c,l),new y(m[5],T,a,b,u,N,l),new y(m[4],o,a,b,T,N,l),new y(m[3],T,N,s,u,c,b),new y(m[2],o,N,s,T,c,b),new y(m[1],T,a,s,u,N,b),new y(m[0],o,a,s,T,N,b)),(h=(n>=b)<<2|(e>=N)<<1|t>=T)&&(f=w[w.length-1],w[w.length-1]=w[w.length-1-h],w[w.length-1-h]=f)}else{var z=t-+this._x.call(null,m.data),A=e-+this._y.call(null,m.data),E=n-+this._z.call(null,m.data),M=z*z+A*A+E*E;if(M<r){var k=Math.sqrt(r=M);p=t-k,d=e-k,v=n-k,_=t+k,x=e+k,g=n+k,i=m.data}}return i},v=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t))||isNaN(s=+this._z.call(null,t)))return this;var e,n,r,i,o,a,s,u,c,l,f,h,p,y,d,v=this._root,_=this._x0,x=this._y0,g=this._z0,w=this._x1,m=this._y1,T=this._z1;if(!v)return this;if(v.length)for(;;){if((f=o>=(u=(_+w)/2))?_=u:w=u,(h=a>=(c=(x+m)/2))?x=c:m=c,(p=s>=(l=(g+T)/2))?g=l:T=l,e=v,!(v=v[y=p<<2|h<<1|f]))return this;if(!v.length)break;(e[y+1&7]||e[y+2&7]||e[y+3&7]||e[y+4&7]||e[y+5&7]||e[y+6&7]||e[y+7&7])&&(n=e,d=y)}for(;v.data!==t;)if(r=v,!(v=v.next))return this;return(i=v.next)&&delete v.next,r?(i?r.next=i:delete r.next,this):e?(i?e[y]=i:delete e[y],(v=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&v===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!v.length&&(n?n[d]=v:this._root=v),this):(this._root=i,this)},_=function(){return this._root},x=function(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t},g=function(t){var e,n,r,i,o,a,s,u,c=[],l=this._root;for(l&&c.push(new y(l,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=c.pop();)if(!t(l=e.node,r=e.x0,i=e.y0,o=e.z0,a=e.x1,s=e.y1,u=e.z1)&&l.length){var f=(r+a)/2,h=(i+s)/2,p=(o+u)/2;(n=l[7])&&c.push(new y(n,f,h,p,a,s,u)),(n=l[6])&&c.push(new y(n,r,h,p,f,s,u)),(n=l[5])&&c.push(new y(n,f,i,p,a,h,u)),(n=l[4])&&c.push(new y(n,r,i,p,f,h,u)),(n=l[3])&&c.push(new y(n,f,h,o,a,s,p)),(n=l[2])&&c.push(new y(n,r,h,o,f,s,p)),(n=l[1])&&c.push(new y(n,f,i,o,a,h,p)),(n=l[0])&&c.push(new y(n,r,i,o,f,h,p))}return this},w=function(t){var e,n=[],r=[];for(this._root&&n.push(new y(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,u=e.z0,c=e.x1,l=e.y1,f=e.z1,h=(a+c)/2,p=(s+l)/2,d=(u+f)/2;(o=i[0])&&n.push(new y(o,a,s,u,h,p,d)),(o=i[1])&&n.push(new y(o,h,s,u,c,p,d)),(o=i[2])&&n.push(new y(o,a,p,u,h,l,d)),(o=i[3])&&n.push(new y(o,h,p,u,c,l,d)),(o=i[4])&&n.push(new y(o,a,s,d,h,p,f)),(o=i[5])&&n.push(new y(o,h,s,d,c,p,f)),(o=i[6])&&n.push(new y(o,a,p,d,h,l,f)),(o=i[7])&&n.push(new y(o,h,p,d,c,l,f))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.z0,e.x1,e.y1,e.z1);return this},m=function(t){return arguments.length?(this._x=t,this):this._x},T=function(t){return arguments.length?(this._y=t,this):this._y},N=function(t){return arguments.length?(this._z=t,this):this._z},b=s.prototype=u.prototype;b.copy=function(){var t,e,n=new u(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root;if(!r)return n;if(!r.length)return n._root=c(r),n;for(t=[{source:r,target:n._root=new Array(8)}];r=t.pop();)for(var i=0;i<8;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(8)}):r.target[i]=c(e));return n},b.add=l,b.addAll=n,b.cover=f,b.data=h,b.extent=p,b.find=d,b.remove=v,b.removeAll=r,b.root=_,b.size=x,b.visit=g,b.visitAfter=w,b.x=m,b.y=T,b.z=N,t.octree=s,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){var r,i;/**
* @preserve jquery-param (c) 2015 KNOWLEDGECODE | MIT

@@ -4,0 +4,0 @@ */

@@ -91,3 +91,3 @@ /* global AFRAME */

var el3d = this.el.object3D;
el3d.children.forEach(el3d.remove); // Clear the place
while(el3d.children.length){ el3d.remove(el3d.children[0]) } // Clear the place

@@ -94,0 +94,0 @@ elData.nodes.forEach(function(node) {

{
"name": "aframe-forcegraph-component",
"version": "1.4.0",
"version": "1.5.0",
"description": "A 3D Force-Directed Graph component for A-Frame.",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc