sigma
Version:
A JavaScript library aimed at visualizing graphs of thousands of nodes and edges.
1 lines • 97.3 kB
JavaScript
var Sigma;(()=>{var t={796:t=>{t.exports=function(t,e){var r=e.length;if(0!==r){var i=t.length;t.length+=r;for(var n=0;n<r;n++)t[i+n]=e[n]}}},187:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}g(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&g(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function l(t,e,r,i){var n,o,a,l;if(s(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),(n=h(t))>0&&a.length>n&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,l=c,console&&console.warn&&console.warn(l)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=c.bind(i);return n.listener=r,i.wrapFn=n,n}function d(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):p(n,n.length)}function f(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function g(t,e,r,i){if("function"==typeof t.on)i.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(o){i.once&&t.removeEventListener(e,n),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||n(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return h(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var h=o[t];if(void 0===h)return!1;if("function"==typeof h)i(h,this,e);else{var l=h.length,c=p(h,l);for(r=0;r<l;++r)i(c[r],this,e)}return!0},o.prototype.addListener=function(t,e){return l(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return l(this,t,e,!0)},o.prototype.once=function(t,e){return s(e),this.on(t,u(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return s(e),this.prependListener(t,u(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,i,n,o,a;if(s(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,a||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},186:t=>{t.exports=function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.addUndirectedEdgeWithKey&&"function"==typeof t.dropNode&&"boolean"==typeof t.multi}},973:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i="precision mediump float;\n\nvarying vec4 v_color;\n\nvoid main(void) {\n gl_FragColor = v_color;\n}\n"},912:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_radius;\nattribute vec4 a_color;\nattribute vec3 a_barycentric;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadWidthLengthRatio = 0.66;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl and\n // edge.clamped.vert.glsl. Please read it to get better comments on what's\n // happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n float adaptedWebGLNodeRadius = a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio;\n float adaptedWebGLArrowHeadHalfWidth = adaptedWebGLArrowHeadLength * arrowHeadWidthLengthRatio / 2.0;\n\n float da = a_barycentric.x;\n float db = a_barycentric.y;\n float dc = a_barycentric.z;\n\n vec2 delta = vec2(\n da * (adaptedWebGLNodeRadius * unitNormal.y)\n + db * ((adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.y + adaptedWebGLArrowHeadHalfWidth * unitNormal.x)\n + dc * ((adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.y - adaptedWebGLArrowHeadHalfWidth * unitNormal.x),\n\n da * (-adaptedWebGLNodeRadius * unitNormal.x)\n + db * (-(adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.x + adaptedWebGLArrowHeadHalfWidth * unitNormal.y)\n + dc * (-(adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength) * unitNormal.x - adaptedWebGLArrowHeadHalfWidth * unitNormal.y)\n );\n\n vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;\n\n gl_Position = vec4(position, 0, 1);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n"},620:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i="attribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\nattribute float a_radius;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\nconst float arrowHeadLengthThicknessRatio = 2.5;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // These first computations are taken from edge.vert.glsl. Please read it to\n // get better comments on what's happening:\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n float webGLThickness = pixelsThickness * u_correctionRatio;\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here, we move the point to leave space for the arrow head:\n float direction = sign(a_radius);\n float adaptedWebGLNodeRadius = direction * a_radius * 2.0 * u_correctionRatio * u_sqrtZoomRatio;\n float adaptedWebGLArrowHeadLength = adaptedWebGLThickness * 2.0 * arrowHeadLengthThicknessRatio;\n\n vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (adaptedWebGLNodeRadius + adaptedWebGLArrowHeadLength);\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness + compensationVector, 1)).xy, 0, 1);\n\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}\n"},498:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i="precision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.001;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n float dist = length(v_normal) * v_thickness;\n\n float t = smoothstep(\n v_thickness - feather,\n v_thickness,\n dist\n );\n\n gl_FragColor = mix(v_color, transparent, t);\n}\n"},223:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i='attribute vec4 a_color;\nattribute vec2 a_normal;\nattribute vec2 a_position;\n\nuniform mat3 u_matrix;\nuniform float u_sqrtZoomRatio;\nuniform float u_correctionRatio;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float minThickness = 1.7;\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n float normalLength = length(a_normal);\n vec2 unitNormal = a_normal / normalLength;\n\n // We require edges to be at least `minThickness` pixels thick *on screen*\n // (so we need to compensate the SQRT zoom ratio):\n float pixelsThickness = max(normalLength, minThickness * u_sqrtZoomRatio);\n\n // Then, we need to retrieve the normalized thickness of the edge in the WebGL\n // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction\n // ratio:\n float webGLThickness = pixelsThickness * u_correctionRatio;\n\n // Finally, we adapt the edge thickness to the "SQRT rule" in sigma (so that\n // items are not too big when zoomed in, and not too small when zoomed out).\n // The exact computation should be `adapted = value * zoom / sqrt(zoom)`, but\n // it\'s simpler like this:\n float adaptedWebGLThickness = webGLThickness * u_sqrtZoomRatio;\n\n // Here is the proper position of the vertex\n gl_Position = vec4((u_matrix * vec3(a_position + unitNormal * adaptedWebGLThickness, 1)).xy, 0, 1);\n\n // For the fragment shader though, we need a thickness that takes the "magic"\n // correction ratio into account (as in webGLThickness), but so that the\n // antialiasing effect does not depend on the zoom level. So here\'s yet\n // another thickness version:\n v_thickness = webGLThickness / u_sqrtZoomRatio;\n\n v_normal = unitNormal;\n v_color = a_color;\n v_color.a *= bias;\n}\n'},262:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i="precision mediump float;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float radius = 0.5;\nconst vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);\n\nvoid main(void) {\n vec2 m = gl_PointCoord - vec2(0.5, 0.5);\n float dist = radius - length(m);\n\n float t = 0.0;\n if (dist > v_border)\n t = 1.0;\n else if (dist > 0.0)\n t = dist / v_border;\n\n gl_FragColor = mix(transparent, v_color, t);\n}\n"},106:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>i});const i="attribute vec2 a_position;\nattribute float a_size;\nattribute vec4 a_color;\n\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 v_color;\nvarying float v_border;\n\nconst float bias = 255.0 / 254.0;\n\nvoid main() {\n gl_Position = vec4(\n (u_matrix * vec3(a_position, 1)).xy,\n 0,\n 1\n );\n\n // Multiply the point size twice:\n // - x SCALING_RATIO to correct the canvas scaling\n // - x 2 to correct the formulae\n gl_PointSize = a_size * u_ratio * u_scale * 2.0;\n\n v_border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n v_color = a_color;\n v_color.a *= bias;\n}\n"},764:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(751),s=o(r(358)),h=r(928),l=r(699),c=1.5,u=function(t){function e(){var e=t.call(this)||this;return e.x=.5,e.y=.5,e.angle=0,e.ratio=1,e.minRatio=null,e.maxRatio=null,e.nextFrame=null,e.previousState=null,e.enabled=!0,e.previousState=e.getState(),e}return n(e,t),e.from=function(t){return(new e).setState(t)},e.prototype.enable=function(){return this.enabled=!0,this},e.prototype.disable=function(){return this.enabled=!1,this},e.prototype.getState=function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}},e.prototype.hasState=function(t){return this.x===t.x&&this.y===t.y&&this.ratio===t.ratio&&this.angle===t.angle},e.prototype.getPreviousState=function(){var t=this.previousState;return t?{x:t.x,y:t.y,angle:t.angle,ratio:t.ratio}:null},e.prototype.getBoundedRatio=function(t){var e=t;return"number"==typeof this.minRatio&&(e=Math.max(e,this.minRatio)),"number"==typeof this.maxRatio&&(e=Math.min(e,this.maxRatio)),e},e.prototype.validateState=function(t){var e={};return"number"==typeof t.x&&(e.x=t.x),"number"==typeof t.y&&(e.y=t.y),"number"==typeof t.angle&&(e.angle=t.angle),"number"==typeof t.ratio&&(e.ratio=this.getBoundedRatio(t.ratio)),e},e.prototype.isAnimated=function(){return!!this.nextFrame},e.prototype.setState=function(t){if(!this.enabled)return this;this.previousState=this.getState();var e=this.validateState(t);return"number"==typeof e.x&&(this.x=e.x),"number"==typeof e.y&&(this.y=e.y),"number"==typeof e.angle&&(this.angle=e.angle),"number"==typeof e.ratio&&(this.ratio=e.ratio),this.hasState(this.previousState)||this.emit("updated",this.getState()),this},e.prototype.updateState=function(t){return this.setState(t(this.getState())),this},e.prototype.animate=function(t,e,r){var i=this;if(this.enabled){var n=Object.assign({},a.ANIMATE_DEFAULTS,e),o=this.validateState(t),l="function"==typeof n.easing?n.easing:s.default[n.easing],c=Date.now(),u=this.getState(),d=function(){var t=(Date.now()-c)/n.duration;if(t>=1)return i.nextFrame=null,i.setState(o),void(i.animationCallback&&(i.animationCallback.call(null),i.animationCallback=void 0));var e=l(t),r={};"number"==typeof o.x&&(r.x=u.x+(o.x-u.x)*e),"number"==typeof o.y&&(r.y=u.y+(o.y-u.y)*e),"number"==typeof o.angle&&(r.angle=u.angle+(o.angle-u.angle)*e),"number"==typeof o.ratio&&(r.ratio=u.ratio+(o.ratio-u.ratio)*e),i.setState(r),i.nextFrame=(0,h.requestFrame)(d)};this.nextFrame?((0,h.cancelFrame)(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=(0,h.requestFrame)(d)):d(),this.animationCallback=r}},e.prototype.animatedZoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio/t});this.animate({ratio:this.ratio/(t.factor||c)},t)}else this.animate({ratio:this.ratio/c})},e.prototype.animatedUnzoom=function(t){if(t){if("number"==typeof t)return this.animate({ratio:this.ratio*t});this.animate({ratio:this.ratio*(t.factor||c)},t)}else this.animate({ratio:this.ratio*c})},e.prototype.animatedReset=function(t){this.animate({x:.5,y:.5,ratio:1,angle:0},t)},e.prototype.copy=function(){return e.from(this.getState())},e}(l.TypedEventEmitter);e.default=u},291:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},o.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getWheelDelta=e.getTouchCoords=e.getTouchesArray=e.getWheelCoords=e.getMouseCoords=e.getPosition=void 0;var a=r(699);function s(t,e){var r=e.getBoundingClientRect();return{x:t.clientX-r.left,y:t.clientY-r.top}}function h(t,e){var r=o(o({},s(t,e)),{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0},original:t});return r}function l(t){for(var e=[],r=0,i=Math.min(t.length,2);r<i;r++)e.push(t[r]);return e}function c(t){if(void 0!==t.deltaY)return-3*t.deltaY/360;if(void 0!==t.detail)return t.detail/-9;throw new Error("Captor: could not extract delta from event.")}e.getPosition=s,e.getMouseCoords=h,e.getWheelCoords=function(t,e){return o(o({},h(t,e)),{delta:c(t)})},e.getTouchesArray=l,e.getTouchCoords=function(t,e){return{touches:l(t.touches).map((function(t){return s(t,e)})),original:t}},e.getWheelDelta=c;var u=function(t){function e(e,r){var i=t.call(this)||this;return i.container=e,i.renderer=r,i}return n(e,t),e}(a.TypedEventEmitter);e.default=u},269:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return a(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});var h=s(r(291)),l=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.enabled=!0,i.draggedEvents=0,i.downStartTime=null,i.lastMouseX=null,i.lastMouseY=null,i.isMouseDown=!1,i.isMoving=!1,i.movingTimeout=null,i.startCameraState=null,i.clicks=0,i.doubleClickTimeout=null,i.currentWheelDirection=0,i.handleClick=i.handleClick.bind(i),i.handleRightClick=i.handleRightClick.bind(i),i.handleDown=i.handleDown.bind(i),i.handleUp=i.handleUp.bind(i),i.handleMove=i.handleMove.bind(i),i.handleWheel=i.handleWheel.bind(i),i.handleOut=i.handleOut.bind(i),e.addEventListener("click",i.handleClick,!1),e.addEventListener("contextmenu",i.handleRightClick,!1),e.addEventListener("mousedown",i.handleDown,!1),e.addEventListener("wheel",i.handleWheel,!1),e.addEventListener("mouseout",i.handleOut,!1),document.addEventListener("mousemove",i.handleMove,!1),document.addEventListener("mouseup",i.handleUp,!1),i}return n(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("click",this.handleClick),t.removeEventListener("contextmenu",this.handleRightClick),t.removeEventListener("mousedown",this.handleDown),t.removeEventListener("wheel",this.handleWheel),t.removeEventListener("mouseout",this.handleOut),document.removeEventListener("mousemove",this.handleMove),document.removeEventListener("mouseup",this.handleUp)},e.prototype.handleClick=function(t){var e=this;if(this.enabled){if(this.clicks++,2===this.clicks)return this.clicks=0,"number"==typeof this.doubleClickTimeout&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(t);setTimeout((function(){e.clicks=0,e.doubleClickTimeout=null}),300),this.draggedEvents<3&&this.emit("click",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleRightClick=function(t){this.enabled&&this.emit("rightClick",(0,h.getMouseCoords)(t,this.container))},e.prototype.handleDoubleClick=function(t){if(this.enabled){t.preventDefault(),t.stopPropagation();var e=(0,h.getMouseCoords)(t,this.container);if(this.emit("doubleClick",e),!e.sigmaDefaultPrevented){var r=this.renderer.getCamera(),i=r.getBoundedRatio(r.getState().ratio/2.2);r.animate(this.renderer.getViewportZoomedState((0,h.getPosition)(t,this.container),i),{easing:"quadraticInOut",duration:200})}}},e.prototype.handleDown=function(t){if(this.enabled){if(0===t.button){this.startCameraState=this.renderer.getCamera().getState();var e=(0,h.getPosition)(t,this.container),r=e.x,i=e.y;this.lastMouseX=r,this.lastMouseY=i,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit("mousedown",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleUp=function(t){var e=this;if(this.enabled&&this.isMouseDown){var r=this.renderer.getCamera();this.isMouseDown=!1,"number"==typeof this.movingTimeout&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var i=(0,h.getPosition)(t,this.container),n=i.x,o=i.y,a=r.getState(),s=r.getPreviousState()||{x:0,y:0};this.isMoving?r.animate({x:a.x+3*(a.x-s.x),y:a.y+3*(a.y-s.y)},{duration:200,easing:"quadraticOut"}):this.lastMouseX===n&&this.lastMouseY===o||r.setState({x:a.x,y:a.y}),this.isMoving=!1,setTimeout((function(){e.draggedEvents=0,e.renderer.refresh()}),0),this.emit("mouseup",(0,h.getMouseCoords)(t,this.container))}},e.prototype.handleMove=function(t){var e=this;if(this.enabled){var r=(0,h.getMouseCoords)(t,this.container);if(this.emit("mousemovebody",r),t.target===this.container&&this.emit("mousemove",r),!r.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,"number"==typeof this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){e.movingTimeout=null,e.isMoving=!1}),100);var i=this.renderer.getCamera(),n=(0,h.getPosition)(t,this.container),o=n.x,a=n.y,s=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),l=this.renderer.viewportToFramedGraph({x:o,y:a}),c=s.x-l.x,u=s.y-l.y,d=i.getState(),f=d.x+c,p=d.y+u;i.setState({x:f,y:p}),this.lastMouseX=o,this.lastMouseY=a,t.preventDefault(),t.stopPropagation()}}},e.prototype.handleWheel=function(t){var e=this;if(this.enabled){t.preventDefault(),t.stopPropagation();var r=(0,h.getWheelDelta)(t);if(r){var i=(0,h.getWheelCoords)(t,this.container);if(this.emit("wheel",i),!i.sigmaDefaultPrevented){var n=r>0?1/1.7:1.7,o=this.renderer.getCamera(),a=o.getBoundedRatio(o.getState().ratio*n),s=r>0?1:-1,l=Date.now();this.currentWheelDirection===s&&this.lastWheelTriggerTime&&l-this.lastWheelTriggerTime<50||(o.animate(this.renderer.getViewportZoomedState((0,h.getPosition)(t,this.container),a),{easing:"quadraticOut",duration:250},(function(){e.currentWheelDirection=0})),this.currentWheelDirection=s,this.lastWheelTriggerTime=l)}}}},e.prototype.handleOut=function(){},e}(h.default);e.default=l},508:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&o(e,t,r);return a(e,t),e},h=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a};Object.defineProperty(e,"__esModule",{value:!0});var l=s(r(291)),c=function(t){function e(e,r){var i=t.call(this,e,r)||this;return i.enabled=!0,i.isMoving=!1,i.hasMoved=!1,i.touchMode=0,i.startTouchesPositions=[],i.handleStart=i.handleStart.bind(i),i.handleLeave=i.handleLeave.bind(i),i.handleMove=i.handleMove.bind(i),e.addEventListener("touchstart",i.handleStart,!1),e.addEventListener("touchend",i.handleLeave,!1),e.addEventListener("touchcancel",i.handleLeave,!1),e.addEventListener("touchmove",i.handleMove,!1),i}return n(e,t),e.prototype.kill=function(){var t=this.container;t.removeEventListener("touchstart",this.handleStart),t.removeEventListener("touchend",this.handleLeave),t.removeEventListener("touchcancel",this.handleLeave),t.removeEventListener("touchmove",this.handleMove)},e.prototype.getDimensions=function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}},e.prototype.dispatchRelatedMouseEvent=function(t,e,r,i){var n=r||e.touches[0],o=new MouseEvent(t,{clientX:n.clientX,clientY:n.clientY,altKey:e.altKey,ctrlKey:e.ctrlKey});o.isFakeSigmaMouseEvent=!0,(i||this.container).dispatchEvent(o)},e.prototype.handleStart=function(t){var e=this;if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousedown",t);var r=(0,l.getTouchesArray)(t.touches);if(this.touchMode=r.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=r.map((function(t){return(0,l.getPosition)(t,e.container)})),this.lastTouches=r,this.lastTouchesPositions=this.startTouchesPositions,2===this.touchMode){var i=h(this.startTouchesPositions,2),n=i[0],o=n.x,a=n.y,s=i[1],c=s.x,u=s.y;this.startTouchesAngle=Math.atan2(u-a,c-o),this.startTouchesDistance=Math.sqrt(Math.pow(c-o,2)+Math.pow(u-a,2))}this.emit("touchdown",(0,l.getTouchCoords)(t,this.container))}},e.prototype.handleLeave=function(t){if(this.enabled){switch(t.preventDefault(),0===t.touches.length&&this.lastTouches&&this.lastTouches.length&&(this.dispatchRelatedMouseEvent("mouseup",t,this.lastTouches[0],document),this.hasMoved||this.dispatchRelatedMouseEvent("click",t,this.lastTouches[0])),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(1===t.touches.length){this.handleStart(t),t.preventDefault();break}case 1:if(this.isMoving){var e=this.renderer.getCamera(),r=e.getState(),i=e.getPreviousState()||{x:0,y:0};e.animate({x:r.x+3*(r.x-i.x),y:r.y+3*(r.y-i.y)},{duration:200,easing:"quadraticOut"})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0}this.emit("touchup",(0,l.getTouchCoords)(t,this.container))}},e.prototype.handleMove=function(t){var e,r=this;if(this.enabled){t.preventDefault(),1===t.touches.length&&this.dispatchRelatedMouseEvent("mousemove",t);var i=(0,l.getTouchesArray)(t.touches),n=i.map((function(t){return(0,l.getPosition)(t,r.container)}));if(this.lastTouches=i,this.lastTouchesPositions=n,this.hasMoved||(this.hasMoved=n.some((function(t,e){var i=r.startTouchesPositions[e];return t.x!==i.x||t.y!==i.y}))),this.hasMoved){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout((function(){r.isMoving=!1}),200);var o=this.renderer.getCamera(),a=this.startCameraState;switch(this.touchMode){case 1:var s=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),c=s.x,u=s.y,d=this.renderer.viewportToFramedGraph(n[0]),f=d.x,p=d.y;o.setState({x:a.x+c-f,y:a.y+u-p});break;case 2:var g={},v=n[0],m=v.x,y=v.y,b=n[1],_=b.x,x=b.y,w=Math.atan2(x-y,_-m)-this.startTouchesAngle,E=Math.hypot(x-y,_-m)/this.startTouchesDistance,L=o.getBoundedRatio(a.ratio/E);g.ratio=L,g.angle=a.angle+w;var F=this.getDimensions(),C=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:a}),A=Math.min(F.width,F.height),T=A/F.width,P=L/A;p=y-A/2/(A/F.height),f=(e=h([(f=m-A/2/T)*Math.cos(-g.angle)-p*Math.sin(-g.angle),p*Math.cos(-g.angle)+f*Math.sin(-g.angle)],2))[0],p=e[1],g.x=C.x-f*P,g.y=C.y+p*P,o.setState(g)}this.emit("touchmove",(0,l.getTouchCoords)(t,this.container))}}},e}(l.default);e.default=c},730:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.edgeLabelsToDisplayFromNodes=e.LabelGrid=void 0;var r=function(){function t(t,e){this.key=t,this.size=e}return t.compare=function(t,e){return t.size>e.size?-1:t.size<e.size||t.key>e.key?1:-1},t}(),i=function(){function t(){this.width=0,this.height=0,this.cellSize=0,this.columns=0,this.rows=0,this.cells={}}return t.prototype.resizeAndClear=function(t,e){this.width=t.width,this.height=t.height,this.cellSize=e,this.columns=Math.ceil(t.width/e),this.rows=Math.ceil(t.height/e),this.cells={}},t.prototype.getIndex=function(t){var e=Math.floor(t.x/this.cellSize);return Math.floor(t.y/this.cellSize)*this.columns+e},t.prototype.add=function(t,e,i){var n=new r(t,e),o=this.getIndex(i),a=this.cells[o];a||(a=[],this.cells[o]=a),a.push(n)},t.prototype.organize=function(){for(var t in this.cells)this.cells[t].sort(r.compare)},t.prototype.getLabelsToDisplay=function(t,e){var r=this.cellSize*this.cellSize,i=r/t/t*e/r,n=Math.ceil(i),o=[];for(var a in this.cells)for(var s=this.cells[a],h=0;h<Math.min(n,s.length);h++)o.push(s[h].key);return o},t}();e.LabelGrid=i,e.edgeLabelsToDisplayFromNodes=function(t){var e=t.graph,r=t.hoveredNode,i=t.highlightedNodes,n=t.displayedNodeLabels,o=[];return e.forEachEdge((function(t,e,a,s){(a===r||s===r||i.has(a)||i.has(s)||n.has(a)&&n.has(s))&&o.push(t)})),o}},134:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rectangleCollidesWithQuad=e.squareCollidesWithQuad=e.getCircumscribedAlignedRectangle=e.isRectangleAligned=void 0;var n=i(r(796)),o=!1;function a(t){return t.x1===t.x2||t.y1===t.y2}function s(t){var e=Math.sqrt(Math.pow(t.x2-t.x1,2)+Math.pow(t.y2-t.y1,2)),r=(t.y1-t.y2)*t.height/e,i=(t.x2-t.x1)*t.height/e,n={x:t.x1,y:t.y1},o={x:t.x2,y:t.y2},a={x:t.x1+r,y:t.y1+i},s={x:t.x2+r,y:t.y2+i},h=Math.min(n.x,o.x,a.x,s.x),l=Math.max(n.x,o.x,a.x,s.x),c=Math.min(n.y,o.y,a.y,s.y);return{x1:h,y1:c,x2:l,y2:c,height:Math.max(n.y,o.y,a.y,s.y)-c}}function h(t,e,r,i,n,o,a){return t<i+o&&t+r>i&&e<n+a&&e+r>n}function l(t,e,r,i,n,o,a,s){return t<n+a&&t+r>n&&e<o+s&&e+i>o}function c(t,e,r,i,n,o){var a=t<r+n/2;return e<i+o/2?a?1:2:a?3:4}e.isRectangleAligned=a,e.getCircumscribedAlignedRectangle=s,e.squareCollidesWithQuad=h,e.rectangleCollidesWithQuad=l;var u=function(){function t(t){var e;void 0===t&&(t={}),this.containers=((e={})[5460]=[],e),this.cache=null,this.lastRectangle=null;var r=Math.pow(4,5);this.data=new Float32Array((4*r-1)/3*4),t.boundaries?this.resize(t.boundaries):this.resize({x:0,y:0,width:1,height:1})}return t.prototype.add=function(t,e,r,i){return function(t,e,r,i,n,a,s){for(var l=n-s,c=a-s,u=2*s,d=0,f=0;;){if(d>=5)return r[f]=r[f]||[],void r[f].push(i);var p=4*f+4,g=4*f+8,v=4*f+12,m=4*f+16,y=h(l,c,u,e[p+0],e[p+1],e[p+2],e[p+3]),b=h(l,c,u,e[g+0],e[g+1],e[g+2],e[g+3]),_=h(l,c,u,e[v+0],e[v+1],e[v+2],e[v+3]),x=h(l,c,u,e[m+0],e[m+1],e[m+2],e[m+3]),w=[y,b,_,x].reduce((function(t,e){return e?t+1:t}),0);if(0===w&&0===d)return r[5460].push(i),void(!o&&r[5460].length>=5&&(o=!0,console.warn("sigma/quadtree.insertNode: At least 5 nodes are outside the global quadtree zone. You might have a problem with the normalization function or the custom bounding box.")));if(0===w)throw new Error("sigma/quadtree.insertNode: no collision (level: ".concat(d,", key: ").concat(i,", x: ").concat(n,", y: ").concat(a,", size: ").concat(s,")."));if(3===w)throw new Error("sigma/quadtree.insertNode: 3 impossible collisions (level: ".concat(d,", key: ").concat(i,", x: ").concat(n,", y: ").concat(a,", size: ").concat(s,")."));if(w>1)return r[f]=r[f]||[],void r[f].push(i);d++,y&&(f=p),b&&(f=g),_&&(f=v),x&&(f=m)}}(0,this.data,this.containers,t,e,r,i),this},t.prototype.resize=function(t){this.clear(),this.data[0]=t.x,this.data[1]=t.y,this.data[2]=t.width,this.data[3]=t.height,function(t,e){for(var r=[0,0];r.length;){var i=r.pop(),n=r.pop(),o=4*n+4,a=4*n+8,s=4*n+12,h=4*n+16,l=e[n+0],c=e[n+1],u=e[n+2]/2,d=e[n+3]/2;e[o+0]=l,e[o+1]=c,e[o+2]=u,e[o+3]=d,e[a+0]=l+u,e[a+1]=c,e[a+2]=u,e[a+3]=d,e[s+0]=l,e[s+1]=c+d,e[s+2]=u,e[s+3]=d,e[h+0]=l+u,e[h+1]=c+d,e[h+2]=u,e[h+3]=d,i<4&&(r.push(h,i+1),r.push(s,i+1),r.push(a,i+1),r.push(o,i+1))}}(0,this.data)},t.prototype.clear=function(){var t;return this.containers=((t={})[5460]=[],t),this},t.prototype.point=function(t,e){var r=this.containers[5460].slice(),i=0,o=0;do{this.containers[i]&&(0,n.default)(r,this.containers[i]),i=4*i+4*c(t,e,this.data[i+0],this.data[i+1],this.data[i+2],this.data[i+3]),o++}while(o<=5);return r},t.prototype.rectangle=function(t,e,r,i,o){var h=this.lastRectangle;return h&&t===h.x1&&r===h.x2&&e===h.y1&&i===h.y2&&o===h.height||(this.lastRectangle={x1:t,y1:e,x2:r,y2:i,height:o},a(this.lastRectangle)||(this.lastRectangle=s(this.lastRectangle)),this.cache=function(t,e,r,i,o,a,s){for(var h,c=[0,0],u=[];c.length;){var d=c.pop(),f=c.pop();if((h=r[f])&&(0,n.default)(u,h),!(d>=5)){var p=4*f+4,g=4*f+8,v=4*f+12,m=4*f+16,y=l(i,o,a,s,e[p+0],e[p+1],e[p+2],e[p+3]),b=l(i,o,a,s,e[g+0],e[g+1],e[g+2],e[g+3]),_=l(i,o,a,s,e[v+0],e[v+1],e[v+2],e[v+3]),x=l(i,o,a,s,e[m+0],e[m+1],e[m+2],e[m+3]);y&&c.push(p,d+1),b&&c.push(g,d+1),_&&c.push(v,d+1),x&&c.push(m,d+1)}}return u}(0,this.data,this.containers,t,e,Math.abs(t-r)||Math.abs(e-i),o),(0,n.default)(this.cache,this.containers[5460])),this.cache},t}();e.default=u},265:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(159)),s=o(r(764)),h=o(r(134)),l=o(r(269)),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.Camera=s.default,e.QuadTree=h.default,e.MouseCaptor=l.default,e.Sigma=a.default,e}(a.default);t.exports=c},942:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,i,n){var o=n.edgeLabelSize,a=n.edgeLabelFont,s=n.edgeLabelWeight,h=n.edgeLabelColor.attribute?e[n.edgeLabelColor.attribute]||n.edgeLabelColor.color||"#000":n.edgeLabelColor.color,l=e.label;if(l){t.fillStyle=h,t.font="".concat(s," ").concat(o,"px ").concat(a);var c,u,d=r.size,f=i.size,p=r.x,g=r.y,v=i.x,m=i.y,y=v-p,b=m-g,_=Math.sqrt(y*y+b*b);if(!(_<d+f)){c=((p+=y*d/_)+(v-=y*f/_))/2,u=((g+=b*d/_)+(m-=b*f/_))/2,y=v-p,b=m-g,_=Math.sqrt(y*y+b*b);var x,w=t.measureText(l).width;if(w>_){for(l+="…",w=t.measureText(l).width;w>_&&l.length>1;)l=l.slice(0,-2)+"…",w=t.measureText(l).width;if(l.length<4)return}x=y>0?b>0?Math.acos(y/_):Math.asin(b/_):b>0?Math.acos(y/_)+Math.PI:Math.asin(y/_)+Math.PI/2,t.save(),t.translate(c,u),t.rotate(x),t.fillText(l,-w/2,e.size/2+o),t.restore()}}}},61:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(622));e.default=function(t,e,r){var i=r.labelSize,o=r.labelFont,a=r.labelWeight;if(t.font="".concat(a," ").concat(i,"px ").concat(o),t.fillStyle="#FFF",t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=8,t.shadowColor="#000","string"==typeof e.label){var s=t.measureText(e.label).width,h=Math.round(s+5),l=Math.round(i+4),c=Math.max(e.size,i/2)+2,u=Math.asin(l/2/c),d=Math.sqrt(Math.abs(Math.pow(c,2)-Math.pow(l/2,2)));t.beginPath(),t.moveTo(e.x+d,e.y+l/2),t.lineTo(e.x+c+h,e.y+l/2),t.lineTo(e.x+c+h,e.y-l/2),t.lineTo(e.x+d,e.y-l/2),t.arc(e.x,e.y,c,u,-u),t.closePath(),t.fill()}else t.beginPath(),t.arc(e.x,e.y,e.size+2,0,2*Math.PI),t.closePath(),t.fill();t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,(0,n.default)(t,e,r)}},622:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){if(e.label){var i=r.labelSize,n=r.labelFont,o=r.labelWeight,a=r.labelColor.attribute?e[r.labelColor.attribute]||r.labelColor.color||"#000":r.labelColor.color;t.fillStyle=a,t.font="".concat(o," ").concat(i,"px ").concat(n),t.fillText(e.label,e.x+e.size+3,e.y+i/3)}}},195:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.createEdgeCompoundProgram=e.AbstractEdgeProgram=void 0;var o=function(t){function e(e,r,i,n,o){return t.call(this,e,r,i,n,o)||this}return n(e,t),e}(r(171).AbstractProgram);e.AbstractEdgeProgram=o,e.createEdgeCompoundProgram=function(t){return function(){function e(e,r){this.programs=t.map((function(t){return new t(e,r)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.computeIndices=function(){this.programs.forEach((function(t){return t.computeIndices()}))},e.prototype.render=function(t){this.programs.forEach((function(e){e.bind(),e.bufferData(),e.render(t)}))},e.prototype.process=function(t,e,r,i,n){this.programs.forEach((function(o){return o.process(t,e,r,i,n)}))},e}()}},909:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.createNodeCompoundProgram=e.AbstractNodeProgram=void 0;var o=function(t){function e(e,r,i,n,o){var a=t.call(this,e,r,i,n,o)||this;a.positionLocation=e.getAttribLocation(a.program,"a_position"),a.sizeLocation=e.getAttribLocation(a.program,"a_size"),a.colorLocation=e.getAttribLocation(a.program,"a_color");var s=e.getUniformLocation(a.program,"u_matrix");if(null===s)throw new Error("AbstractNodeProgram: error while getting matrixLocation");a.matrixLocation=s;var h=e.getUniformLocation(a.program,"u_ratio");if(null===h)throw new Error("AbstractNodeProgram: error while getting ratioLocation");a.ratioLocation=h;var l=e.getUniformLocation(a.program,"u_scale");if(null===l)throw new Error("AbstractNodeProgram: error while getting scaleLocation");return a.scaleLocation=l,a}return n(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.sizeLocation),t.enableVertexAttribArray(this.colorLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.sizeLocation,1,t.FLOAT,!1,this.attributes*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,this.attributes*Float32Array.BYTES_PER_ELEMENT,12)},e}(r(171).AbstractProgram);e.AbstractNodeProgram=o,e.createNodeCompoundProgram=function(t){return function(){function e(e,r){this.programs=t.map((function(t){return new t(e,r)}))}return e.prototype.bufferData=function(){this.programs.forEach((function(t){return t.bufferData()}))},e.prototype.allocate=function(t){this.programs.forEach((function(e){return e.allocate(t)}))},e.prototype.bind=function(){},e.prototype.render=function(t){this.programs.forEach((function(e){e.bind(),e.bufferData(),e.render(t)}))},e.prototype.process=function(t,e,r){this.programs.forEach((function(i){return i.process(t,e,r)}))},e}()}},171:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractProgram=void 0;var i=r(706),n=function(){function t(t,e,r,n,o){this.array=new Float32Array,this.points=n,this.attributes=o,this.gl=t,this.vertexShaderSource=e,this.fragmentShaderSource=r;var a=t.createBuffer();if(null===a)throw new Error("AbstractProgram: error while creating the buffer");this.buffer=a,t.bindBuffer(t.ARRAY_BUFFER,this.buffer),this.vertexShader=(0,i.loadVertexShader)(t,this.vertexShaderSource),this.fragmentShader=(0,i.loadFragmentShader)(t,this.fragmentShaderSource),this.program=(0,i.loadProgram)(t,[this.vertexShader,this.fragmentShader])}return t.prototype.bufferData=function(){var t=this.gl;t.bufferData(t.ARRAY_BUFFER,this.array,t.DYNAMIC_DRAW)},t.prototype.allocate=function(t){this.array=new Float32Array(this.points*this.attributes*t)},t.prototype.hasNothingToRender=function(){return 0===this.array.length},t}();e.AbstractProgram=n},569:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(195),o=i(r(805)),a=i(r(483)),s=(0,n.createEdgeCompoundProgram)([a.default,o.default]);e.default=s},805:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(928),s=o(r(912)),h=o(r(973)),l=function(t){function e(e){var r=t.call(this,e,s.default,h.default,3,9)||this;r.positionLocation=e.getAttribLocation(r.program,"a_position"),r.colorLocation=e.getAttribLocation(r.program,"a_color"),r.normalLocation=e.getAttribLocation(r.program,"a_normal"),r.radiusLocation=e.getAttribLocation(r.program,"a_radius"),r.barycentricLocation=e.getAttribLocation(r.program,"a_barycentric");var i=e.getUniformLocation(r.program,"u_matrix");if(null===i)throw new Error("EdgeArrowHeadProgram: error while getting matrixLocation");r.matrixLocation=i;var n=e.getUniformLocation(r.program,"u_sqrtZoomRatio");if(null===n)throw new Error("EdgeArrowHeadProgram: error while getting sqrtZoomRatioLocation");r.sqrtZoomRatioLocation=n;var o=e.getUniformLocation(r.program,"u_correctionRatio");if(null===o)throw new Error("EdgeArrowHeadProgram: error while getting correctionRatioLocation");return r.correctionRatioLocation=o,r.bind(),r}return n(e,t),e.prototype.bind=function(){var t=this.gl;t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.radiusLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.barycentricLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.radiusLocation,1,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,16),t.vertexAttribPointer(this.colorLocation,4,t.UNSIGNED_BYTE,!0,9*Float32Array.BYTES_PER_ELEMENT,20),t.vertexAttribPointer(this.barycentricLocation,3,t.FLOAT,!1,9*Float32Array.BYTES_PER_ELEMENT,24)},e.prototype.computeIndices=function(){},e.prototype.process=function(t,e,r,i,n){if(i)for(var o=27*n,s=o+27;o<s;o++)this.array[o]=0;else{var h=r.size||1,l=e.size||1,c=t.x,u=t.y,d=e.x,f=e.y,p=(0,a.floatColor)(r.color),g=d-c,v=f-u,m=g*g+v*v,y=0,b=0;m&&(y=-v*(m=1/Math.sqrt(m))*h,b=g*m*h);var _=27*n,x=this.array;x[_++]=d,x[_++]=f,x[_++]=-y,x[_++]=-b,x[_++]=l,x[_++]=p,x[_++]=1,x[_++]=0,x[_++]=0,x[_++]=d,x[_++]=f,x[_++]=-y,x[_++]=-b,x[_++]=l,x[_++]=p,x[_++]=0,x[_++]=1,x[_++]=0,x[_++]=d,x[_++]=f,x[_++]=-y,x[_++]=-b,x[_++]=l,x[_++]=p,x[_++]=0,x[_++]=0,x[_]=1}},e.prototype.render=function(t){if(!this.hasNothingToRender()){var e=this.gl,r=this.program;e.useProgram(r),e.uniformMatrix3fv(this.matrixLocation,!1,t.matrix),e.uniform1f(this.sqrtZoomRatioLocation,Math.sqrt(t.ratio)),e.uniform1f(this.correctionRatioLocation,t.correctionRatio),e.drawArrays(e.TRIANGLES,0,this.array.length/9)}},e}(r(195).AbstractEdgeProgram);e.default=l},483:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(195),s=r(928),h=o(r(620)),l=o(r(498)),c=function(t){function e(e){var r=t.call(this,e,h.default,l.default,4,6)||this,i=e.createBuffer();if(null===i)throw new Error("EdgeClampedProgram: error while getting resolutionLocation");r.indicesBuffer=i,r.positionLocation=e.getAttribLocation(r.program,"a_position"),r.colorLocation=e.getAttribLocation(r.program,"a_color"),r.normalLocation=e.getAttribLocation(r.program,"a_normal"),r.radiusLocation=e.getAttribLocation(r.program,"a_radius");var n=e.getUniformLocation(r.program,"u_matrix");if(null===n)throw new Error("EdgeClampedProgram: error while getting matrixLocation");r.matrixLocation=n;var o=e.getUniformLocation(r.program,"u_sqrtZoomRatio");if(null===o)throw new Error("EdgeClampedProgram: error while getting cameraRatioLocation");r.sqrtZoomRatioLocation=o;var a=e.getUniformLocation(r.program,"u_correctionRatio");if(null===a)throw new Error("EdgeClampedProgram: error while getting viewportRatioLocation");return r.correctionRatioLocation=a,r.canUse32BitsIndices=(0,s.canUse32BitsIndices)(e),r.IndicesArray=r.canUse32BitsIndices?Uint32Array:Uint16Array,r.indicesArray=new r.IndicesArray,r.indicesType=r.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,r.bind(),r}return n(e,t),e.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.normalLocation),t.enableVertexAttribArray(this.colorLocation),t.enableVertexAttribArray(this.radiusLocation),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0),t.vertexAttribPointer(this.normalLocation,2,t.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,8),t.vertexAttribPointer(this.colorL