!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.f6=e():t.f6=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=406)}({10:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n(11),e),o(n(12),e),o(n(13),e),o(n(14),e),o(n(15),e),o(n(16),e)},11:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelize=e.isString=void 0;e.isString=function(t){return"string"==typeof t};var r,o,i=/-(\w)/g;e.camelize=(r=function(t){return t.replace(i,(function(t,e){return e?e.toUpperCase():""}))},o=Object.create(null),function(t){return o[t]||(o[t]=r(t))})},12:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},13:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNumber=e.isNaN=e.isNumber=void 0;e.isNumber=function(t){return"number"==typeof t};e.isNaN=function(t){return Number.isNaN(Number(t))};e.toNumber=function(t){var n=parseFloat(t);return e.isNaN(n)?t:n}},14:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.traverseTreeUp=e.scaleMatrix=e.getAdjMatrix=e.floydWarshall=e.getDegree=void 0;e.getDegree=function(t,e,n){for(var r=[],o=0;oe[r][i]+e[i][o]&&(e[r][o]=e[r][i]+e[i][o]);return e};e.getAdjMatrix=function(t,e){var n=t.nodes,r=t.edges,o=[],i={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){i[t.id]=e;o.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,u=i[n],a=i[r];o[u][a]=1,e||(o[a][u]=1)})),o};e.scaleMatrix=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n};e.traverseTreeUp=function(t,e){"function"==typeof e&&function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)}(t,e)}},15:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;nc[1]?c[0]:c[1])+s(t)}:function(t){return c+s(t)}:function(t){return t.size?u.isArray(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+s(t):t.size+s(t):10+s(t)}}t.nodeSize=i;var d=t.edges;t.degrees=u.getDegree(e.length,t.nodeIdxMap,d),t.getMass||(t.getMass=function(e){return t.degrees[t.nodeIdxMap[e.id]]||1}),t.run()}else t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,n=t.edges,r=t.maxIteration;if("undefined"!=typeof window){var o=0;this.timeInterval=window.setInterval((function(){var i=[],u=[];if(e){e.forEach((function(t,e){i[2*e]=0,i[2*e+1]=0,u[2*e]=0,u[2*e+1]=0})),t.calRepulsive(i,e),n&&t.calAttractive(i,n),t.calGravity(i,e);var a=Math.max(.02,t.interval-.002*o);t.updateVelocity(i,u,a,e);var c=[];e.forEach((function(t){c.push({x:t.x,y:t.y})})),t.updatePosition(u,a,e),t.tick&&t.tick();var s=0;e.forEach((function(t,e){var n=t.x-c[e].x,r=t.y-c[e].y;s+=Math.sqrt(n*n+r*r)})),(s/=e.length)=r&&(t.onLayoutEnd&&t.onLayoutEnd(),window.clearInterval(t.timeInterval))}}),0)}},e.prototype.calRepulsive=function(t,e){var n=this.getMass,r=this.nodeStrength,o=this.factor,i=this.coulombDisScale,u=this.preventOverlap,a=this.nodeSize;e.forEach((function(c,s){var f=n?n(c):1;e.forEach((function(e,d){if(!(s>=d)){var l=c.x-e.x,p=c.y-e.y,y=Math.sqrt(l*l+p*p)+.01,h=(y+.1)*i,v=l/y,g=p/y,b=(r(c)+r(e))/2*o/(h*h),m=n?n(e):1;if(t[2*s]+=v*b,t[2*s+1]+=g*b,t[2*d]-=v*b,t[2*d+1]-=g*b,u&&y<(a(c)+a(e))/2){var x=(r(c)+r(e))/2/(y*y);t[2*s]+=v*x/f,t[2*s+1]+=g*x/f,t[2*d]-=v*x/m,t[2*d+1]-=g*x/m}}}))}))},e.prototype.calAttractive=function(t,e){var n=this.nodeMap,r=this.nodeIdxMap,o=this.linkDistance,i=this.edgeStrength,u=this.getMass;e.forEach((function(e,a){var c=n[e.source],s=n[e.target],f=s.x-c.x,d=s.y-c.y,l=Math.sqrt(f*f+d*d)+.01,p=f/l,y=d/l,h=((o(e)||1)-l)*i(e),v=r[e.source],g=r[e.target],b=u?u(c):1,m=u?u(s):1;t[2*v]-=p*h/b,t[2*v+1]-=y*h/b,t[2*g]+=p*h/m,t[2*g+1]+=y*h/m}))},e.prototype.calGravity=function(t,e){for(var n=this.center,r=this.gravity,o=this.degrees,i=e.length,a=0;ao.maxSpeed){var s=o.maxSpeed/c;u*=s,a*=s}e[2*r]=u,e[2*r+1]=a}))},e.prototype.updatePosition=function(t,e,n){n.forEach((function(n,r){if(u.isNumber(n.fx)&&u.isNumber(n.fy))return n.x=n.fx,void(n.y=n.fy);var o=t[2*r]*e,i=t[2*r+1]*e;n.x+=o,n.y+=i}))},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(i.Base);e.GForceLayout=c},406:function(t,e,n){"use strict";n.r(e);var r=n(178);e.default=r.GForceLayout},7:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Base=void 0;var r=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}();e.Base=r}}).default})); //# sourceMappingURL=gForceLayout.js.map