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

sigma

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sigma - npm Package Compare versions

Comparing version 2.0.0-alpha13 to 2.0.0-alpha14

2

build/sigma.min.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Sigma=t():e.Sigma=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=11)}([function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,h,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(r=this._events[e],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(o(r))for(s=Array.prototype.slice.call(arguments,1),l=r.slice(),i=l.length,h=0;h<i;h++)l[h].apply(this,s);return!0},r.prototype.addListener=function(e,t){var i;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(r)){for(s=a;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),h=r(12),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h),u=r(4),c={easing:"quadraticInOut",duration:150},d=function(e){function t(e){n(this,t),e=e||{};var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.x=.5,r.y=.5,r.angle=0,r.ratio=1,r.width=e.width||0,r.height=e.height||0,r.nextFrame=null,r.previousState=r.getState(),r.enabled=!0,r}return o(t,e),a(t,[{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"getState",value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:"getPreviousState",value:function(){var e=this.previousState;return{x:e.x,y:e.y,angle:e.angle,ratio:e.ratio}}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"graphToViewport",value:function(e,t,r){var n=Math.min(e.width,e.height),i=n/e.width,o=n/e.height;return{x:(t-this.x+this.ratio/2/i)*(n/this.ratio),y:(this.y-r+this.ratio/2/o)*(n/this.ratio)}}},{key:"viewportToGraph",value:function(e,t,r){var n=Math.min(e.width,e.height),i=n/e.width,o=n/e.height;return{x:this.ratio/n*t+this.x-this.ratio/2/i,y:-(this.ratio/n*r-this.y-this.ratio/2/o)}}},{key:"viewRectangle",value:function(e){var t=0*this.width/8,r=0*this.height/8,n=this.viewportToGraph(e,0-t,0-r),i=this.viewportToGraph(e,this.width+t,0-r),o=this.viewportToGraph(e,0,this.height+r);return{x1:n.x,y1:n.y,x2:i.x,y2:i.y,height:i.y-o.y}}},{key:"setState",value:function(e){return this.enabled?(this.previousState=this.getState(),"x"in e&&(this.x=e.x),"y"in e&&(this.y=e.y),"angle"in e&&(this.angle=e.angle),"ratio"in e&&(this.ratio=e.ratio),this.emit("updated",this.getState()),this):this}},{key:"resize",value:function(e){return this.enabled?("width"in e&&(this.width=e.width),"height"in e&&(this.height=e.height),this.emit("resized",this.getDimensions()),this):this}},{key:"animate",value:function(e,t,r){var n=this;if(!this.enabled)return this;t=(0,u.assign)({},c,t);var i="function"==typeof t.easing?t.easing:l[t.easing];this.nextFrame&&cancelAnimationFrame(this.nextFrame);var o=Date.now(),a=this.getState(),s=function s(){var h=(Date.now()-o)/t.duration;if(h>=1)return n.nextFrame=null,n.setState(e),void("function"==typeof r&&r());var l=i(h),u={};"x"in e&&(u.x=a.x+(e.x-a.x)*l),"y"in e&&(u.y=a.y+(e.y-a.y)*l),"angle"in e&&(u.angle=a.angle+(e.angle-a.angle)*l),"ratio"in e&&(u.ratio=a.ratio+(e.ratio-a.ratio)*l),n.setState(u),n.nextFrame=requestAnimationFrame(s)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.nextFrame=requestAnimationFrame(s)):s()}},{key:"animatedZoom",value:function(e){return e?"number"==typeof e?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||1.5)},e):this.animate({ratio:this.ratio/1.5})}},{key:"animatedUnzoom",value:function(e){return e?"number"==typeof e?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||1.5)},e):this.animate({ratio:1.5*this.ratio})}},{key:"animatedReset",value:function(e){return this.animate({x:0,y:0,ratio:1,angle:0},e)}}]),t}(s.EventEmitter);t.default=d},function(e,t,r){"use strict";function n(e){if(void 0!==s[e])return s[e];var t=0,r=0,n=0;if("#"===e[0])4===e.length?(t=parseInt(e.charAt(1)+e.charAt(1),16),r=parseInt(e.charAt(2)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(4),16),n=parseInt(e.charAt(5)+e.charAt(6),16));else if(h.test(e)){var i=e.match(l);t=+i[1],r=+i[2],n=+i[3]}var o=256*t*256+256*r+n;return s[e]=o,o}function i(e,t){var r=e.angle,n=e.ratio,i=e.x,o=e.y,s=t.width,h=t.height,l=(0,a.identity)(),u=Math.min(s,h),c=(0,a.translate)((0,a.identity)(),-i,-o),d=(0,a.scale)((0,a.identity)(),1/n),f=(0,a.rotate)((0,a.identity)(),-r),v=(0,a.scale)((0,a.identity)(),u/s*2,u/h*2);return(0,a.multiply)(l,v),(0,a.multiply)(l,f),(0,a.multiply)(l,d),(0,a.multiply)(l,c),l}function o(e,t,r,n){var i=n||new Uint8Array(4);return e.readPixels(t,r,1,1,e.RGBA,e.UNSIGNED_BYTE,i),i}Object.defineProperty(t,"__esModule",{value:!0}),t.floatColor=n,t.matrixFromCamera=i,t.extractPixel=o;var a=r(20),s={},h=/^\s*rgba?\s*\(/,l=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)\s*(,.*)?\)\s*$/},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),s=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),t}(a.EventEmitter);t.default=s},function(e,t,r){"use strict";function n(e){e=e||{};for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,o=r.length;i<o;i++)if(r[i])for(var a in r[i])e[a]=r[i][a];return e}Object.defineProperty(t,"__esModule",{value:!0}),t.assign=n},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r,n){return e===r||t===n}function o(e,t,r,n,i,o,a){return e<n+o&&e+r>n&&t<i+a&&t+r>i}function a(e,t,r,n,i,o,a,s){return e<i+a&&e+r>i&&t<o+s&&t+n>o}function s(e,t,r,n,i,o){var a=r+i/2,s=n+o/2,h=t<s,l=e<a;return h?l?w:_:l?x:E}function h(e,t){for(var r=[0,0];r.length;){var n=r.pop(),i=r.pop(),o=4*i+v,a=4*i+2*v,s=4*i+3*v,h=4*i+4*v,l=t[i+g],u=t[i+m],c=t[i+y],d=t[i+b],f=c/2,p=d/2;t[o+g]=l,t[o+m]=u,t[o+y]=f,t[o+b]=p,t[a+g]=l+f,t[a+m]=u,t[a+y]=f,t[a+b]=p,t[s+g]=l,t[s+m]=u+p,t[s+y]=f,t[s+b]=p,t[h+g]=l+f,t[h+m]=u+p,t[h+y]=f,t[h+b]=p,n<e-1&&(r.push(h,n+1),r.push(s,n+1),r.push(a,n+1),r.push(o,n+1))}}function l(e,t,r,n,i,a,s){for(var h=i-s,l=a-s,u=2*s,c=0,d=0;;){if(c>=e)return r[d]=r[d]||[],void r[d].push(n);var f=4*d+v,p=4*d+2*v,w=4*d+3*v,_=4*d+4*v,x=o(h,l,u,t[f+g],t[f+m],t[f+y],t[f+b]),E=o(h,l,u,t[p+g],t[p+m],t[p+y],t[p+b]),A=o(h,l,u,t[w+g],t[w+m],t[w+y],t[w+b]),L=o(h,l,u,t[_+g],t[_+m],t[_+y],t[_+b]),O=x+E+A+L;if(0===O)throw new Error("sigma/quadtree.insertNode: no collision (level: "+c+", key: "+n+", x: "+i+", y: "+a+", size: "+s+").");if(3===O)throw new Error("sigma/quadtree.insertNode: 3 impossible collisions (level: "+c+", key: "+n+", x: "+i+", y: "+a+", size: "+s+").");if(O>1)return r[d]=r[d]||[],void r[d].push(n);c++,x&&(d=f),E&&(d=p),A&&(d=w),L&&(d=_)}}function u(e,t,r,n,i,o,s){for(var h=[0,0],l=[],u=void 0;h.length;){var c=h.pop(),d=h.pop();if(u=r[d],u&&(0,f.default)(l,u),!(c>=e)){var p=4*d+v,w=4*d+2*v,_=4*d+3*v,x=4*d+4*v,E=a(n,i,o,s,t[p+g],t[p+m],t[p+y],t[p+b]),A=a(n,i,o,s,t[w+g],t[w+m],t[w+y],t[w+b]),L=a(n,i,o,s,t[_+g],t[_+m],t[_+y],t[_+b]),O=a(n,i,o,s,t[x+g],t[x+m],t[x+y],t[x+b]);E&&h.push(p,c+1),A&&h.push(w,c+1),L&&h.push(_,c+1),O&&h.push(x,c+1)}}return l}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),d=r(13),f=function(e){return e&&e.__esModule?e:{default:e}}(d),v=4,p=5,g=0,m=1,y=2,b=3,w=1,_=2,x=3,E=4,A=function(){function e(t){n(this,e),t=t||{};var r=Math.pow(4,p);this.data=new Float32Array(v*((4*r-1)/3)),this.containers={},this.cache=null,this.lastRectangle=null,t.boundaries?this.resize(t.boundaries):this.resize({x:0,y:0,width:1,height:1}),"function"==typeof t.filter&&(this.nodeFilter=t.filter)}return c(e,[{key:"add",value:function(e,t,r,n){return l(p,this.data,this.containers,e,t,r,n),this}},{key:"resize",value:function(e){this.clear(),this.data[g]=e.x,this.data[m]=e.y,this.data[y]=e.width,this.data[b]=e.height,h(p,this.data)}},{key:"clear",value:function(){return this.containers={},this}},{key:"point",value:function(e,t){var r=[],n=0,i=0;do{this.containers[n]&&r.push.apply(r,this.containers[n]);n=4*n+s(e,t,this.data[n+g],this.data[n+m],this.data[n+y],this.data[n+b])*v,i++}while(i<=p);return r}},{key:"rectangle",value:function(e,t,r,n,o){var a=this.lastRectangle;if(a&&e===a.x1&&r===a.x2&&t===a.y1&&n===a.y2&&o===a.height)return this.cache;if(this.lastRectangle={x1:e,y1:t,x2:r,y2:n,height:o},!i(e,t,r,n))throw new Error("sigma/quadtree.rectangle: shifted view is not yet implemented.");var s=u(p,this.data,this.containers,e,t,Math.abs(e-r)||Math.abs(t-n),o);return this.cache=s,this.cache}}]),e}();t.default=A},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(1),l=n(h),u=r(14),c=n(u),d=r(15),f=function(e){function t(e,r){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n.container=e,n.camera=r,n.enabled=!0,n.hasDragged=!1,n.downStartTime=null,n.lastMouseX=null,n.lastMouseY=null,n.isMouseDown=!1,n.isMoving=!1,n.movingTimeout=null,n.startCameraState=null,n.lastCameraState=null,n.clicks=0,n.doubleClickTimeout=null,n.wheelLock=!1,n.handleClick=n.handleClick.bind(n),n.handleDown=n.handleDown.bind(n),n.handleUp=n.handleUp.bind(n),n.handleMove=n.handleMove.bind(n),n.handleWheel=n.handleWheel.bind(n),n.handleOut=n.handleOut.bind(n),e.addEventListener("click",n.handleClick,!1),e.addEventListener("mousedown",n.handleDown,!1),e.addEventListener("mousemove",n.handleMove,!1),e.addEventListener("DOMMouseScroll",n.handleWheel,!1),e.addEventListener("mousewheel",n.handleWheel,!1),e.addEventListener("mouseout",n.handleOut,!1),document.addEventListener("mouseup",n.handleUp,!1),n}return a(t,e),s(t,[{key:"kill",value:function(){var e=this.container;e.removeEventListener("click",this.handleClick),e.removeEventListener("mousedown",this.handleDown),e.removeEventListener("mousemove",this.handleMove),e.removeEventListener("DOMMouseScroll",this.handleWheel),e.removeEventListener("mousewheel",this.handleWheel),e.removeEventListener("mouseout",this.handleOut),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(e){var t=this;if(this.enabled){if(2===++this.clicks)return this.clicks=0,clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null,this.handleDoubleClick(e);setTimeout(function(){t.clicks=0,t.doubleClickTimeout=null},300),this.emit("click",(0,d.getMouseCoords)(e))}}},{key:"handleDoubleClick",value:function(e){if(this.enabled){var t=(0,d.getCenter)(e),r=this.camera.getState(),n=r.ratio/2.2,i={width:this.container.offsetWidth,height:this.container.offsetHeight},o=(0,d.getX)(e),a=(0,d.getY)(e),s=new l.default;s.ratio=n,s.x=r.x,s.y=r.y;var h=this.camera.viewportToGraph(i,o,a),u=this.camera.viewportToGraph(i,t.x,t.y),c=s.viewportToGraph(i,o,a),f=s.viewportToGraph(i,t.x,t.y),v=c.x-f.x-h.x+u.x,p=c.y-f.y-h.y+u.y;return this.camera.animate({x:r.x-v,y:r.y-p,ratio:n},{easing:"quadraticInOut",duration:200}),e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}}},{key:"handleDown",value:function(e){this.enabled&&(this.startCameraState=this.camera.getState(),this.lastCameraState=this.startCameraState,this.lastMouseX=(0,d.getX)(e),this.lastMouseY=(0,d.getY)(e),this.hasDragged=!1,this.downStartTime=Date.now(),e.which,this.isMouseDown=!0,this.emit("mousedown",(0,d.getMouseCoords)(e)))}},{key:"handleUp",value:function(e){if(this.enabled&&this.isMouseDown){this.isMouseDown=!1,this.movingTimeout&&(this.movingTimeout=null,clearTimeout(this.movingTimeout));var t=(0,d.getX)(e),r=(0,d.getY)(e),n=this.camera.getState(),i=this.camera.getPreviousState();this.isMoving?this.camera.animate({x:n.x+3*(n.x-i.x),y:n.y+3*(n.y-i.y)},{duration:200,easing:"quadraticOut"}):this.lastMouseX===t&&this.lastMouseY===r||this.camera.setState({x:n.x,y:n.y}),this.isMoving=!1,this.hasDragged=!1,this.emit("mouseup",(0,d.getMouseCoords)(e))}}},{key:"handleMove",value:function(e){var t=this;if(this.enabled){if(this.emit("mousemove",(0,d.getMouseCoords)(e)),this.isMouseDown){this.isMoving=!0,this.hasDragged=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=setTimeout(function(){t.movingTimeout=null,t.isMoving=!1},200);var r={width:this.container.offsetWidth,height:this.container.offsetHeight},n=(0,d.getX)(e),i=(0,d.getY)(e),o=this.camera.viewportToGraph(r,this.lastMouseX,this.lastMouseY),a=this.camera.viewportToGraph(r,n,i),s=o.x-a.x,h=o.y-a.y,l=this.camera.getState(),u=l.x+s,c=l.y+h;this.camera.setState({x:u,y:c}),this.lastMouseX=n,this.lastMouseY=i}return e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}}},{key:"handleWheel",value:function(e){var t=this;if(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!this.enabled)return!1;var r=(0,d.getWheelDelta)(e);if(!r)return!1;if(this.wheelLock)return!1;this.wheelLock=!0;var n=r>0?1/1.7:1.7,i=this.camera.getState(),o=n*i.ratio,a=(0,d.getCenter)(e),s={width:this.container.offsetWidth,height:this.container.offsetHeight},h=(0,d.getX)(e),u=(0,d.getY)(e),c=new l.default;c.ratio=o,c.x=i.x,c.y=i.y;var f=this.camera.viewportToGraph(s,h,u),v=this.camera.viewportToGraph(s,a.x,a.y),p=c.viewportToGraph(s,h,u),g=c.viewportToGraph(s,a.x,a.y),m=p.x-g.x-f.x+v.x,y=p.y-g.y-f.y+v.y;return this.camera.animate({x:i.x-m,y:i.y-y,ratio:o},{easing:"linear",duration:200},function(){return t.wheelLock=!1}),!1}},{key:"handleOut",value:function(){}}]),t}(c.default);t.default=f},function(e,t,r){"use strict";function n(e,t){var r=document.createElement(e);if(!t)return r;for(var n in t)if("style"===n)for(var i in t[n])r.style[i]=t[n][i];else r.setAttribute(n,t[n]);return r}function i(){var e=window.screen;return void 0!==e.deviceXDPI&&void 0!==e.logicalXDPI&&e.deviceXDPI>e.logicalXDPI?e.systemXDPI/e.logicalXDPI:void 0!==window.devicePixelRatio?window.devicePixelRatio:1}function o(e){var t=a(e.x,2),r=t[0],n=t[1],i=a(e.y,2),o=i[0],s=i[1],h=Math.max(n-r,s-o),l=(n+r)/2,u=(s+o)/2,c=function(e){return{x:.5+(e.x-l)/h,y:.5+(e.y-u)/h}};return c.inverse=function(e){return{x:l+h*(e.x-.5),y:u+h*(e.y-.5)}},c.ratio=h,c}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.createElement=n,t.getPixelRatio=i,t.createNormalizationFunction=o},function(e,t){e.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNodes&&"boolean"==typeof e.multi}},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return function(){function t(r){i(this,t),this.programs=e.map(function(e){return new e(r)})}return a(t,[{key:"allocate",value:function(e){this.programs.forEach(function(t){return t.allocate(e)})}},{key:"process",value:function(){var e=arguments;this.programs.forEach(function(t){return t.process.apply(t,n(e))})}},{key:"computeIndices",value:function(){this.programs.forEach(function(e){"function"==typeof e.computeIndices&&e.computeIndices()})}},{key:"bufferData",value:function(){this.programs.forEach(function(e){return e.bufferData()})}},{key:"render",value:function(){var e=arguments;this.programs.forEach(function(t){t.bind(),t.bufferData(),t.render.apply(t,n(e))})}}]),t}()}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.createCompoundProgram=o;var s=r(19),h=function(){function e(t,r,n){i(this,e),this.vertexShaderSource=r,this.fragmentShaderSource=n,this.load(t)}return a(e,[{key:"load",value:function(e){return this.vertexShader=(0,s.loadVertexShader)(e,this.vertexShaderSource),this.fragmentShader=(0,s.loadFragmentShader)(e,this.fragmentShaderSource),this.program=(0,s.loadProgram)(e,[this.vertexShader,this.fragmentShader]),this.program}}]),e}();t.default=h},function(e,t,r){"use strict";function n(e,t,r){var n=r.labelSize,i=r.labelFont,o=r.labelWeight;e.fillStyle="#000",e.font=o+" "+n+"px "+i,e.fillText(t.label,t.x+t.size+3,t.y+n/3)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLRenderer=t.MouseCaptor=t.QuadTree=t.Camera=t.Renderer=void 0;var i=r(3),o=n(i),a=r(1),s=n(a),h=r(5),l=n(h),u=r(6),c=n(u),d=r(16),f=n(d);t.Renderer=o.default,t.Camera=s.default,t.QuadTree=l.default,t.MouseCaptor=c.default,t.WebGLRenderer=f.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.linear=function(e){return e},t.quadraticIn=function(e){return e*e},t.quadraticOut=function(e){return e*(2-e)},t.quadraticInOut=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},t.cubicIn=function(e){return e*e*e},t.cubicOut=function(e){return--e*e*e+1},t.cubicInOut=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},function(e,t){e.exports=function(e,t){var r=e.length,n=t.length;if(0!==n){e.length+=t.length;for(var i=0;i<n;i++)e[r+i]=t[i]}}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),s=function(e){function t(e,r){n(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.container=e,o.camera=r,o}return o(t,e),t}(a.EventEmitter);t.default=s},function(e,t,r){"use strict";function n(e){if(void 0!==e.offsetX)return e.offsetX;if(void 0!==e.layerX)return e.layerX;if(void 0!==e.clientX)return e.clientX;throw new Error("sigma/captors/utils.getX: could not extract x from event.")}function i(e){if(void 0!==e.offsetY)return e.offsetY;if(void 0!==e.layerY)return e.layerY;if(void 0!==e.clientY)return e.clientY;throw new Error("sigma/captors/utils.getY: could not extract y from event.")}function o(e){var t=e.target.ownerSVGElement?e.target.ownerSVGElement.width:e.target.width;if("number"==typeof t)return t;if(void 0!==t&&void 0!==t.baseVal)return t.baseVal.value;throw new Error("sigma/captors/utils.getWidth: could not extract width from event.")}function a(e){var t=e.target.ownerSVGElement?e.target.ownerSVGElement.height:e.target.height;if("number"==typeof t)return t;if(void 0!==t&&void 0!==t.baseVal)return t.baseVal.value;throw new Error("sigma/captors/utils.getHeight: could not extract height from event.")}function s(e){var t=-1!==e.target.namespaceURI.indexOf("svg")?1:(0,u.getPixelRatio)();return{x:o(e)/(2*t),y:a(e)/(2*t)}}function h(e){return{x:n(e),y:i(e),clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,shiftKey:e.shiftKey}}function l(e){if(void 0!==e.wheelDelta)return e.wheelDelta/360;if(void 0!==e.detail)return e.detail/-9;throw new Error("sigma/captors/utils.getDelta: could not extract delta from event.")}Object.defineProperty(t,"__esModule",{value:!0}),t.getX=n,t.getY=i,t.getWidth=o,t.getHeight=a,t.getCenter=s,t.getMouseCoords=h,t.getWheelDelta=l;var u=r(7)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(17),l=r(8),u=n(l),c=r(3),d=n(c),f=r(1),v=n(f),p=r(6),g=n(p),m=r(5),y=n(m),b=r(18),w=n(b),_=r(23),x=n(_),E=r(10),A=n(E),L=r(26),O=n(L),P=r(4),T=r(7),M=r(2),k=r(28),S=r(29),C=(0,T.getPixelRatio)(),R=(0,T.getPixelRatio)(),D={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,zIndex:!1,labelFont:"Arial",labelSize:14,labelWeight:"normal"},N=function(e){function t(e,r,n){i(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(n=n||{},a.settings=(0,P.assign)({},D,n),!(0,u.default)(e))throw new Error("sigma/renderers/webgl: invalid graph instance.");if(!(r instanceof HTMLElement))throw new Error("sigma/renderers/webgl: container should be an html element.");a.graph=e,a.captors={},a.container=r,a.elements={},a.contexts={},a.listeners={},a.quadtree=new y.default,a.nodeOrder={},a.nodeDataCache={},a.edgeOrder={},a.nodeExtent=null,a.edgeExtent=null,a.normalizationFunction=null,a.width=0,a.height=0,a.highlightedNodes=new Set,a.previousVisibleNodes=new Set,a.displayedLabels=new Set,a.hoveredNode=null,a.wasRenderedInThisFrame=!1,a.renderFrame=null,a.renderHighlightedNodesFrame=null,a.needToProcess=!1,a.needToSoftProcess=!1,a.createContext("edges"),a.createContext("nodes"),a.createContext("labels",!1),a.createContext("hovers",!1),a.createContext("mouse",!1);var s=a.contexts.nodes;return s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.enable(s.BLEND),s=a.contexts.edges,s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.enable(s.BLEND),a.nodePrograms={def:new w.default(a.contexts.nodes)},a.edgePrograms={def:new x.default(a.contexts.edges)},a.resize(),a.camera=new v.default({width:a.width,height:a.height}),a.bindCameraHandlers(),a.captors={mouse:new g.default(a.elements.mouse,a.camera)},a.bindEventHandlers(),a.bindGraphHandlers(),a.process(),a.render(),a}return a(t,e),s(t,[{key:"createContext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=(0,T.createElement)("canvas",{class:"sigma-"+e,style:{position:"absolute"}});this.elements[e]=r,this.container.appendChild(r);var n={preserveDrawingBuffer:!1,antialias:!1},i=void 0;return t?(i=r.getContext("webgl",n),i||(i=r.getContext("webgl",n)),i||(i=r.getContext("experimental-webgl",n))):i=r.getContext("2d",n),this.contexts[e]=i,this}},{key:"bindCameraHandlers",value:function(){var e=this;return this.listeners.camera=function(){e.scheduleRender()},this.camera.on("updated",this.listeners.camera),this}},{key:"bindEventHandlers",value:function(){var e=this;this.listeners.handleResize=function(){e.needToSoftProcess=!0,e.scheduleRender()},window.addEventListener("resize",this.listeners.handleResize);var t=function(e,t,r,n,i){return e>r-i&&e<r+i&&t>n-i&&t<n+i&&Math.sqrt(Math.pow(e-r,2)+Math.pow(t-n,2))<i},r=function(t,r){var n=e.camera.viewportToGraph(e,t,r);return e.quadtree.point(n.x,1-n.y)};return this.listeners.handleMove=function(n){for(var i=Math.pow(e.camera.getState().ratio,.5),o=r(n.x,n.y),a=1/0,s=null,h=0,l=o.length;h<l;h++){var u=o[h],c=e.nodeDataCache[u],d=e.camera.graphToViewport(e,c.x,c.y),f=c.size/i;if(t(n.x,n.y,d.x,d.y,f)){var v=Math.sqrt(Math.pow(n.x-d.x,2)+Math.pow(n.y-d.y,2));v<a&&(a=v,s=u)}}if(s)return e.hoveredNode=s,e.emit("overNode",{node:s}),e.scheduleHighlightedNodesRender();if(e.hoveredNode){var p=e.nodeDataCache[e.hoveredNode],g=e.camera.graphToViewport(e,p.x,p.y),m=p.size/i;if(!t(n.x,n.y,g.x,g.y,m))return e.hoveredNode=null,e.emit("outNode",{node:e.hoveredNode}),e.scheduleHighlightedNodesRender()}},this.listeners.handleDown=function(n){for(var i=Math.pow(e.camera.getState().ratio,.5),o=r(n.x,n.y),a=0,s=o.length;a<s;a++){var h=o[a],l=e.nodeDataCache[h],u=e.camera.graphToViewport(e,l.x,l.y),c=l.size/i;if(t(n.x,n.y,u.x,u.y,c))return e.emit("downNode",{node:h})}},this.listeners.handleClick=function(n){for(var i=Math.pow(e.camera.getState().ratio,.5),o=r(n.x,n.y),a=0,s=o.length;a<s;a++){var h=o[a],l=e.nodeDataCache[h],u=e.camera.graphToViewport(e,l.x,l.y),c=l.size/i;if(t(n.x,n.y,u.x,u.y,c))return e.emit("clickNode",{node:h})}return e.emit("clickStage")},this.captors.mouse.on("mousemove",this.listeners.handleMove),this.captors.mouse.on("mousedown",this.listeners.handleDown),this.captors.mouse.on("click",this.listeners.handleClick),this}},{key:"bindGraphHandlers",value:function(){var e=this,t=this.graph;return this.listeners.graphUpdate=function(){e.needToProcess=!0,e.scheduleRender()},this.listeners.softGraphUpdate=function(){e.needToSoftProcess=!0,e.scheduleRender()},t.on("nodeAdded",this.listeners.graphUpdate),t.on("nodeDropped",this.listeners.graphUpdate),t.on("nodeAttributesUpdated",this.listeners.softGraphUpdate),t.on("edgeAdded",this.listeners.graphUpdate),t.on("nodeDropped",this.listeners.graphUpdate),t.on("edgeAttributesUpdated",this.listeners.softGraphUpdate),t.on("cleared",this.listeners.graphUpdate),this}},{key:"process",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.graph;this.quadtree.clear();var r=["x","y"];this.settings.zIndex&&(r.push("z"),this.edgeExtent=(0,h.edgeExtent)(t,["z"])),this.nodeExtent=(0,h.nodeExtent)(t,r),this.normalizationFunction=(0,T.createNormalizationFunction)(this.nodeExtent);var n=this.nodePrograms.def;e||(n.allocate(t.order),this.nodeOrder={});var i=t.nodes();this.settings.zIndex&&(i=(0,S.zIndexOrdering)(this.edgeExtent.z,function(e){return t.getNodeAttribute(e,"z")},i));for(var o=0,a=i.length;o<a;o++){var s=i[o];this.nodeOrder[s]=o;var l=t.getNodeAttributes(s),u=this.normalizationFunction(l),c=(0,P.assign)({},l,u);this.quadtree.add(s,c.x,1-c.y,c.size/this.width),this.nodeDataCache[s]=c,n.process(c,o)}n.bufferData();var d=this.edgePrograms.def;e||(d.allocate(t.size),this.edgeOrder={});var f=t.edges();this.settings.zIndex&&(f=(0,S.zIndexOrdering)(this.edgeExtent.z,function(e){return t.getEdgeAttribute(e,"z")},f));for(var v=0,p=f.length;v<p;v++){var g=f[v];this.edgeOrder[g]=v;var m=t.getEdgeAttributes(g),y=t.extremities(g),b=this.nodeDataCache[y[0]],w=this.nodeDataCache[y[1]];d.process(b,w,m,v)}return e||"function"!=typeof d.computeIndices||(this.edgeIndicesArray=d.computeIndices()),d.bufferData(),this}},{key:"processNode",value:function(e){var t=this.nodePrograms.def,r=this.graph.getNodeAttributes(e);return t.process(r,this.nodeOrder[e]),this}},{key:"processEdge",value:function(e){var t=this.graph,r=this.edgePrograms.def,n=t.getEdgeAttributes(e),i=t.extremities(e),o=t.getNodeAttributes(i[0]),a=t.getNodeAttributes(i[1]);return r.process(o,a,n,this.edgeOrder[e]),this}},{key:"getCamera",value:function(){return this.camera}},{key:"getMouseCaptor",value:function(){return this.captors.mouse}},{key:"resize",value:function(e,t){var r=this.width,n=this.height;if(arguments.length>1?(this.width=e,this.height=t):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight),r===this.width&&n===this.height)return this;this.camera&&this.camera.resize({width:this.width,height:this.height});for(var i in this.elements){var o=this.elements[i];o.style.width=this.width+"px",o.style.height=this.height+"px"}for(var a in this.contexts){var s=this.contexts[a];s.scale?(this.elements[a].setAttribute("width",this.width*C+"px"),this.elements[a].setAttribute("height",this.height*C+"px"),1!==C&&s.scale(C,C)):(this.elements[a].setAttribute("width",this.width*R+"px"),this.elements[a].setAttribute("height",this.height*R+"px")),s.viewport&&s.viewport(0,0,this.width*R,this.height*R)}return this}},{key:"clear",value:function(){return this.contexts.labels.clearRect(0,0,this.width,this.height),this}},{key:"render",value:function(){this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null,this.needToProcess=!1,this.needToSoftProcess=!1);var e=this.camera.isAnimated()||this.captors.mouse.isMoving||this.captors.mouse.hasDragged||this.captors.mouse.wheelLock;this.resize(),this.clear();var t=this.camera.getState(),r=(0,M.matrixFromCamera)(t,{width:this.width,height:this.height}),n=void 0;if(n=this.nodePrograms.def,n.render({matrix:r,width:this.width,height:this.height,ratio:t.ratio,nodesPowRatio:.5,scalingRatio:R}),this.settings.hideEdgesOnMove&&e||(n=this.edgePrograms.def,n.render({matrix:r,width:this.width,height:this.height,ratio:t.ratio,nodesPowRatio:.5,edgesPowRatio:.5,scalingRatio:R})),this.settings.hideLabelsOnMove&&e)return this;var i=void 0;if(t.ratio>=1)i=this.graph.nodes();else{var o=this.camera.viewRectangle(this);i=this.quadtree.rectangle(o.x1,1-o.y1,o.x2,1-o.y2,o.height)}if(!this.settings.renderLabels)return this;for(var a=(0,k.labelsToDisplayFromGrid)({cache:this.nodeDataCache,camera:this.camera,displayedLabels:this.displayedLabels,previousVisibleNodes:this.previousVisibleNodes,visibleNodes:i}),s=this.contexts.labels,h=Math.pow(t.ratio,.5),l=0,u=a.length;l<u;l++){var c=this.nodeDataCache[a[l]],d=this.camera.graphToViewport(this,c.x,c.y),f=d.x,v=d.y,p=c.size/h;(0,A.default)(s,{label:c.label,size:p,x:f,y:v},this.settings)}return this.previousVisibleNodes=new Set(i),this.displayedLabels=new Set(a),this.renderHighlightedNodes(),this}},{key:"renderHighlightedNodes",value:function(){var e=this,t=this.camera,r=Math.pow(t.getState().ratio,.5),n=this.contexts.hovers;n.clearRect(0,0,this.width,this.height);var i=function(i){var o=e.nodeDataCache[i],a=t.graphToViewport(e,o.x,o.y),s=a.x,h=a.y,l=o.size/r;(0,O.default)(n,{label:o.label,color:o.color,size:l,x:s,y:h},e.settings)};this.hoveredNode&&i(this.hoveredNode),this.highlightedNodes.forEach(i)}},{key:"scheduleRender",value:function(){var e=this;if(this.renderFrame)return this;this.renderFrame=requestAnimationFrame(function(){(e.needToProcess||e.needToSoftProcess)&&e.process(e.needToSoftProcess),e.renderFrame=null,e.needToProcess=!1,e.needToSoftProcess=!1,e.render()})}},{key:"scheduleHighlightedNodesRender",value:function(){var e=this;if(this.renderHighlightedNodesFrame||this.renderFrame)return this;this.renderHighlightedNodesFrame=requestAnimationFrame(function(){e.renderHighlightedNodesFrame=null,e.renderHighlightedNodes()})}},{key:"highlightNode",value:function(e){return this.highlightedNodes.add(e),this.scheduleHighlightedNodesRender(),this}},{key:"unhighlightNode",value:function(e){return this.highlightedNodes.delete(e),this.scheduleHighlightedNodesRender(),this}},{key:"kill",value:function(){var e=this.graph;this.camera.removeListener("updated",this.listeners.camera),window.removeEventListener("resize",this.listeners.handleResize),this.captors.mouse.kill(),e.removeListener("nodeAdded",this.listeners.graphUpdate),e.removeListener("nodeDropped",this.listeners.graphUpdate),e.removeListener("nodeAttributesUpdated",this.listeners.softGraphUpdate),e.removeListener("edgeAdded",this.listeners.graphUpdate),e.removeListener("nodeDropped",this.listeners.graphUpdate),e.removeListener("edgeAttributesUpdated",this.listeners.softGraphUpdate),e.removeListener("cleared",this.listeners.graphUpdate),this.quadtree=null,this.nodeOrder=null,this.nodeDataCache=null,this.edgeOrder=null,this.highlightedNodes=null,this.previousVisibleNodes=null,this.displayedLabels=null;for(var t=this.container;t.firstChild;)t.removeChild(t.firstChild)}}]),t}(d.default);t.default=N},function(e,t,r){function n(e,t){if(!o(e))throw new Error("graphology-metrics/extent: the given graph is not a valid graphology instance.");var r,n,i,a,s,h,l,u=[].concat(t),c=e.nodes(),d={};for(s=0;s<u.length;s++)a=u[s],d[a]=[1/0,-1/0];for(h=0,l=c.length;h<l;h++)for(r=c[h],n=e.getNodeAttributes(r),s=0;s<u.length;s++)a=u[s],i=n[a],i<d[a][0]&&(d[a][0]=i),i>d[a][1]&&(d[a][1]=i);return"string"==typeof t?d[t]:d}function i(e,t){if(!o(e))throw new Error("graphology-metrics/extent: the given graph is not a valid graphology instance.");var r,n,i,a,s,h,l,u=[].concat(t),c=e.edges(),d={};for(s=0;s<u.length;s++)a=u[s],d[a]=[1/0,-1/0];for(h=0,l=c.length;h<l;h++)for(r=c[h],n=e.getEdgeAttributes(r),s=0;s<u.length;s++)a=u[s],i=n[a],i<d[a][0]&&(d[a][0]=i),i>d[a][1]&&(d[a][1]=i);return"string"==typeof t?d[t]:d}var o=r(8),a=n;a.nodeExtent=n,a.edgeExtent=i,e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(9),l=n(h),u=r(2),c=r(21),d=n(c),f=r(22),v=n(f),p=4,g=function(e){function t(e){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,d.default,v.default));r.gl=e,r.array=null,r.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,r.buffer);var n=r.program;return r.positionLocation=e.getAttribLocation(n,"a_position"),r.sizeLocation=e.getAttribLocation(n,"a_size"),r.colorLocation=e.getAttribLocation(n,"a_color"),r.resolutionLocation=e.getUniformLocation(n,"u_resolution"),r.matrixLocation=e.getUniformLocation(n,"u_matrix"),r.ratioLocation=e.getUniformLocation(n,"u_ratio"),r.scaleLocation=e.getUniformLocation(n,"u_scale"),e.enableVertexAttribArray(r.positionLocation),e.enableVertexAttribArray(r.sizeLocation),e.enableVertexAttribArray(r.colorLocation),e.vertexAttribPointer(r.positionLocation,2,e.FLOAT,!1,p*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(r.sizeLocation,1,e.FLOAT,!1,p*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(r.colorLocation,1,e.FLOAT,!1,p*Float32Array.BYTES_PER_ELEMENT,12),r}return a(t,e),s(t,[{key:"allocate",value:function(e){this.array=new Float32Array(1*p*e)}},{key:"process",value:function(e,t){var r=(0,u.floatColor)(e.color),n=1*t*p,i=this.array;i[n++]=e.x,i[n++]=e.y,i[n++]=e.size,i[n]=r}},{key:"bufferData",value:function(){var e=this.gl;e.bufferData(e.ARRAY_BUFFER,this.array,e.DYNAMIC_DRAW)}},{key:"render",value:function(e){var t=this.gl,r=this.program;t.useProgram(r),t.uniform2f(this.resolutionLocation,e.width,e.height),t.uniform1f(this.ratioLocation,1/Math.pow(e.ratio,e.nodesPowRatio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.drawArrays(t.POINTS,0,this.array.length/p)}}]),t}(l.default);t.default=g},function(e,t,r){"use strict";function n(e,t,r){var n="VERTEX"===e?t.VERTEX_SHADER:t.FRAGMENT_SHADER,i=t.createShader(n);if(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(i);throw t.deleteShader(i),new Error("sigma/renderers/weblg/shaders/utils.loadShader: error while compiling the shader:\n"+o+"\n"+r)}return i}function i(e,t){var r=e.createProgram(),n=void 0,i=void 0;for(n=0,i=t.length;n<i;n++)e.attachShader(r,t[n]);if(e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS))throw e.deleteProgram(r),new Error("sigma/renderers/weblg/shaders/utils.loadProgram: error while linking the program.");return r}Object.defineProperty(t,"__esModule",{value:!0}),t.loadProgram=i;var o=n.bind(null,"VERTEX"),a=n.bind(null,"FRAGMENT");t.loadVertexShader=o,t.loadFragmentShader=a},function(e,t,r){"use strict";function n(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function i(e,t,r){return e[0]=t,e[4]=arguments.length>2?r:t,e}function o(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[3]=-r,e[4]=n,e}function a(e,t,r){return e[6]=t,e[7]=r,e}function s(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],h=e[6],l=e[7],u=e[8],c=t[0],d=t[1],f=t[2],v=t[3],p=t[4],g=t[5],m=t[6],y=t[7],b=t[8];return e[0]=c*r+d*o+f*h,e[1]=c*n+d*a+f*l,e[2]=c*i+d*s+f*u,e[3]=v*r+p*o+g*h,e[4]=v*n+p*a+g*l,e[5]=v*i+p*s+g*u,e[6]=m*r+y*o+b*h,e[7]=m*n+y*a+b*l,e[8]=m*i+y*s+b*u,e}Object.defineProperty(t,"__esModule",{value:!0}),t.identity=n,t.scale=i,t.rotate=o,t.translate=a,t.multiply=s},function(e,t){e.exports="attribute vec2 a_position;\nattribute float a_size;\nattribute float a_color;\n\nuniform vec2 u_resolution;\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 color;\nvarying float border;\n\nvoid main() {\n\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 border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n float c = a_color;\n color.b = mod(c, 256.0); c = floor(c / 256.0);\n color.g = mod(c, 256.0); c = floor(c / 256.0);\n color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;\n color.a = 1.0;\n}\n"},function(e,t){e.exports="precision mediump float;\n\nvarying vec4 color;\nvarying float border;\n\nconst float radius = 0.5;\n\nvoid main(void) {\n vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);\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 > border)\n t = 1.0;\n else if (dist > 0.0)\n t = dist / border;\n\n gl_FragColor = mix(color0, color, t);\n}\n"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(9),l=n(h),u=r(2),c=r(24),d=n(c),f=r(25),v=n(f),p=function(e){function t(e){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,d.default,v.default));r.gl=e,r.array=null,r.indicesArray=null,r.buffer=e.createBuffer(),r.indicesBuffer=e.createBuffer(),r.positionLocation=e.getAttribLocation(r.program,"a_position"),r.normalLocation=e.getAttribLocation(r.program,"a_normal"),r.thicknessLocation=e.getAttribLocation(r.program,"a_thickness"),r.colorLocation=e.getAttribLocation(r.program,"a_color"),r.resolutionLocation=e.getUniformLocation(r.program,"u_resolution"),r.ratioLocation=e.getUniformLocation(r.program,"u_ratio"),r.matrixLocation=e.getUniformLocation(r.program,"u_matrix"),r.scaleLocation=e.getUniformLocation(r.program,"u_scale"),r.bind();var n="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,a=n||e.getExtension("OES_element_index_uint");return r.canUse32BitsIndices=!!a,r.IndicesArray=r.canUse32BitsIndices?Uint32Array:Uint16Array,r.indicesType=r.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,r}return a(t,e),s(t,[{key:"bind",value:function(){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.enableVertexAttribArray(this.positionLocation),e.enableVertexAttribArray(this.normalLocation),e.enableVertexAttribArray(this.thicknessLocation),e.enableVertexAttribArray(this.colorLocation),e.vertexAttribPointer(this.positionLocation,2,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(this.normalLocation,2,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(this.thicknessLocation,1,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.colorLocation,1,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,20)}},{key:"allocate",value:function(e){this.array=new Float32Array(24*e)}},{key:"process",value:function(e,t,r,n){if(e.hidden||t.hidden||r.hidden)for(var i=m+24;m<i;m++)this.array[m]=0;var o=r.size||1,a=e.x,s=e.y,h=t.x,l=t.y,c=(0,u.floatColor)(r.color),d=h-a,f=l-s,v=d*d+f*f,p=0,g=0;v&&(v=1/Math.sqrt(v),p=-f*v,g=d*v);var m=24*n,y=this.array;y[m++]=a,y[m++]=s,y[m++]=p,y[m++]=g,y[m++]=o,y[m++]=c,y[m++]=a,y[m++]=s,y[m++]=-p,y[m++]=-g,y[m++]=o,y[m++]=c,y[m++]=h,y[m++]=l,y[m++]=p,y[m++]=g,y[m++]=o,y[m++]=c,y[m++]=h,y[m++]=l,y[m++]=-p,y[m++]=-g,y[m++]=o,y[m]=c}},{key:"computeIndices",value:function(){for(var e=this.array.length/6,t=e+e/2,r=new this.IndicesArray(t),n=0,i=0;n<t;n+=4)r[i++]=n,r[i++]=n+1,r[i++]=n+2,r[i++]=n+2,r[i++]=n+1,r[i++]=n+3;this.indicesArray=r}},{key:"bufferData",value:function(){var e=this.gl;e.bufferData(e.ARRAY_BUFFER,this.array,e.DYNAMIC_DRAW),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)}},{key:"render",value:function(e){var t=this.gl,r=this.program;t.useProgram(r),t.uniform2f(this.resolutionLocation,e.width,e.height),t.uniform1f(this.ratioLocation,e.ratio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.scaleLocation,e.scalingRatio),t.drawElements(t.TRIANGLES,this.indicesArray.length,this.indicesType,0)}}]),t}(l.default);t.default=p},function(e,t){e.exports="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_thickness;\nattribute float a_color;\n\nuniform vec2 u_resolution;\nuniform float u_ratio;\nuniform mat3 u_matrix;\nuniform float u_scale;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.8;\n\nvoid main() {\n\n // Computing thickness in pixels\n float pow_ratio = 1.0 / pow(u_ratio, 0.5);\n float thickness = a_thickness / 2.0 * pow_ratio / u_scale;\n\n // Adding a small feather for AA\n thickness += feather;\n\n // Computing delta relative to viewport\n vec2 delta = (a_normal * thickness) / u_resolution;\n\n vec2 position = (u_matrix * vec3(a_position, 1)).xy;\n position += delta;\n\n // Applying\n gl_Position = vec4(position, 0, 1);\n\n v_normal = a_normal;\n v_thickness = thickness;\n\n // Extract the color:\n float c = a_color;\n v_color.b = mod(c, 256.0); c = floor(c / 256.0);\n v_color.g = mod(c, 256.0); c = floor(c / 256.0);\n v_color.r = mod(c, 256.0); c = floor(c / 256.0); v_color /= 255.0;\n v_color.a = 1.0;\n}\n"},function(e,t){e.exports="precision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.8;\nconst vec4 color0 = 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, color0, t);\n}\n"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){var n=r.labelSize,i=r.labelFont,o=r.labelWeight;e.font=o+" "+n+"px "+i,e.beginPath(),e.fillStyle="#fff",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var s=e.measureText(t.label).width,l=Math.round(t.x-n/2-2),u=Math.round(t.y-n/2-2),c=Math.round(s+n/2+t.size+9),d=Math.round(n+4),f=Math.round(n/2+2);e.moveTo(l,u+f),e.moveTo(l,u+f),e.arcTo(l,u,l+f,u,f),e.lineTo(l+c,u),e.lineTo(l+c,u+d),e.lineTo(l+f,u+d),e.arcTo(l,u+d,l,u+d-f,f),e.lineTo(l,u+f),e.closePath(),e.fill(),e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,(0,a.default)(e,t),(0,h.default)(e,t,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=r(27),a=n(o),s=r(10),h=n(s)},function(e,t,r){"use strict";function n(e,t){e.fillStyle=t.color,e.beginPath(),e.arc(t.x,t.y,t.size,0,i,!0),e.closePath(),e.fill()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i=2*Math.PI},function(e,t,r){"use strict";var n={width:200,height:150},i={width:400,height:300};t.labelsToDisplayFromGrid=function(e){var t=e.cache,r=e.camera,o=e.displayedLabels,a=e.previousVisibleNodes,s=e.visibleNodes,h=r.getState(),l=r.getPreviousState(),u=r.getDimensions(),c=h.ratio<l.ratio,d=h.x!==l.x||h.y!==l.x,f=h.ratio>l.ratio,v=!c&&!f&&h.ratio>=1;if(f&&Math.trunc(10*h.ratio)%3!=0)return Array.from(o);if(v&&0!==o.size)return Array.from(o);for(var p=h.ratio>=1.3?i:n,g=u.width%p.width,m=p.width+g/Math.floor(u.width/p.width),y=u.height%p.height,b=p.height+y/Math.floor(u.height/p.height),w={},_=new Set,x=[],E=0,A=s.length;E<A;E++){var L=s[E],O=t[L];if(!d||c||f||o.has(L)||!a.has(L)){var P=r.graphToViewport(u,O.x,O.y),T=Math.floor(P.x/m),M=Math.floor(P.y/b),k=T+";"+M;if((c||d&&!f)&&o.has(L))_.add(k),x.push(L);else if(!_.has(k))if(void 0===w[k])w[k]=L;else{var S=w[k],C=t[S];(O.size>C.size||O.size===C.size&&L>S)&&(w[k]=L)}}}for(var R in w)x.push(w[R]);return x}},function(e,t,r){"use strict";var n=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.zIndexOrdering=function(e,t,r){var i=(r.length,n(e,2)),o=i[0],a=i[1],s=a-o;return 0===s||s===-1/0?r:r.sort(function(e,r){var n=t(e),i=t(r);return n<i?-1:n>i?1:0})}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Sigma=t():e.Sigma=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=11)}([function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,i,s,h,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(r=this._events[e],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(o(r))for(s=Array.prototype.slice.call(arguments,1),l=r.slice(),i=l.length,h=0;h<i;h++)l[h].apply(this,s);return!0},r.prototype.addListener=function(e,t){var i;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,i,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],a=r.length,i=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(r)){for(s=a;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],n(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(0),h=r(12),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(h),u=r(4),c={easing:"quadraticInOut",duration:150},d=function(e){function t(e){n(this,t),e=e||{};var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.x=.5,r.y=.5,r.angle=0,r.ratio=1,r.width=e.width||0,r.height=e.height||0,r.nextFrame=null,r.previousState=r.getState(),r.enabled=!0,r}return o(t,e),a(t,[{key:"enable",value:function(){return this.enabled=!0,this}},{key:"disable",value:function(){return this.enabled=!1,this}},{key:"getState",value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:"getPreviousState",value:function(){var e=this.previousState;return{x:e.x,y:e.y,angle:e.angle,ratio:e.ratio}}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"isAnimated",value:function(){return!!this.nextFrame}},{key:"graphToViewport",value:function(e,t,r){var n=Math.min(e.width,e.height),i=n/e.width,o=n/e.height;return{x:(t-this.x+this.ratio/2/i)*(n/this.ratio),y:(this.y-r+this.ratio/2/o)*(n/this.ratio)}}},{key:"viewportToGraph",value:function(e,t,r){var n=Math.min(e.width,e.height),i=n/e.width,o=n/e.height;return{x:this.ratio/n*t+this.x-this.ratio/2/i,y:-(this.ratio/n*r-this.y-this.ratio/2/o)}}},{key:"viewRectangle",value:function(e){var t=0*this.width/8,r=0*this.height/8,n=this.viewportToGraph(e,0-t,0-r),i=this.viewportToGraph(e,this.width+t,0-r),o=this.viewportToGraph(e,0,this.height+r);return{x1:n.x,y1:n.y,x2:i.x,y2:i.y,height:i.y-o.y}}},{key:"setState",value:function(e){return this.enabled?(this.previousState=this.getState(),"x"in e&&(this.x=e.x),"y"in e&&(this.y=e.y),"angle"in e&&(this.angle=e.angle),"ratio"in e&&(this.ratio=e.ratio),this.emit("updated",this.getState()),this):this}},{key:"resize",value:function(e){return this.enabled?("width"in e&&(this.width=e.width),"height"in e&&(this.height=e.height),this.emit("resized",this.getDimensions()),this):this}},{key:"animate",value:function(e,t,r){var n=this;if(!this.enabled)return this;t=(0,u.assign)({},c,t);var i="function"==typeof t.easing?t.easing:l[t.easing];this.nextFrame&&cancelAnimationFrame(this.nextFrame);var o=Date.now(),a=this.getState(),s=function s(){var h=(Date.now()-o)/t.duration;if(h>=1)return n.nextFrame=null,n.setState(e),void("function"==typeof r&&r());var l=i(h),u={};"x"in e&&(u.x=a.x+(e.x-a.x)*l),"y"in e&&(u.y=a.y+(e.y-a.y)*l),"angle"in e&&(u.angle=a.angle+(e.angle-a.angle)*l),"ratio"in e&&(u.ratio=a.ratio+(e.ratio-a.ratio)*l),n.setState(u),n.nextFrame=requestAnimationFrame(s)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.nextFrame=requestAnimationFrame(s)):s()}},{key:"animatedZoom",value:function(e){return e?"number"==typeof e?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||1.5)},e):this.animate({ratio:this.ratio/1.5})}},{key:"animatedUnzoom",value:function(e){return e?"number"==typeof e?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||1.5)},e):this.animate({ratio:1.5*this.ratio})}},{key:"animatedReset",value:function(e){return this.animate({x:0,y:0,ratio:1,angle:0},e)}}]),t}(s.EventEmitter);t.default=d},function(e,t,r){"use strict";function n(e){if(void 0!==s[e])return s[e];var t=0,r=0,n=0;if("#"===e[0])4===e.length?(t=parseInt(e.charAt(1)+e.charAt(1),16),r=parseInt(e.charAt(2)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(4),16),n=parseInt(e.charAt(5)+e.charAt(6),16));else if(h.test(e)){var i=e.match(l);t=+i[1],r=+i[2],n=+i[3]}var o=256*t*256+256*r+n;return s[e]=o,o}function i(e,t){var r=e.angle,n=e.ratio,i=e.x,o=e.y,s=t.width,h=t.height,l=(0,a.identity)(),u=Math.min(s,h),c=(0,a.translate)((0,a.identity)(),-i,-o),d=(0,a.scale)((0,a.identity)(),1/n),f=(0,a.rotate)((0,a.identity)(),-r),v=(0,a.scale)((0,a.identity)(),u/s*2,u/h*2);return(0,a.multiply)(l,v),(0,a.multiply)(l,f),(0,a.multiply)(l,d),(0,a.multiply)(l,c),l}function o(e,t,r,n){var i=n||new Uint8Array(4);return e.readPixels(t,r,1,1,e.RGBA,e.UNSIGNED_BYTE,i),i}Object.defineProperty(t,"__esModule",{value:!0}),t.floatColor=n,t.matrixFromCamera=i,t.extractPixel=o;var a=r(20),s={},h=/^\s*rgba?\s*\(/,l=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)\s*(,.*)?\)\s*$/},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),s=function(e){function t(){return n(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),t}(a.EventEmitter);t.default=s},function(e,t,r){"use strict";function n(e){e=e||{};for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,o=r.length;i<o;i++)if(r[i])for(var a in r[i])e[a]=r[i][a];return e}Object.defineProperty(t,"__esModule",{value:!0}),t.assign=n},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r,n){return e===r||t===n}function o(e,t,r,n,i,o,a){return e<n+o&&e+r>n&&t<i+a&&t+r>i}function a(e,t,r,n,i,o,a,s){return e<i+a&&e+r>i&&t<o+s&&t+n>o}function s(e,t,r,n,i,o){var a=r+i/2,s=n+o/2,h=t<s,l=e<a;return h?l?w:_:l?x:E}function h(e,t){for(var r=[0,0];r.length;){var n=r.pop(),i=r.pop(),o=4*i+v,a=4*i+2*v,s=4*i+3*v,h=4*i+4*v,l=t[i+g],u=t[i+m],c=t[i+y],d=t[i+b],f=c/2,p=d/2;t[o+g]=l,t[o+m]=u,t[o+y]=f,t[o+b]=p,t[a+g]=l+f,t[a+m]=u,t[a+y]=f,t[a+b]=p,t[s+g]=l,t[s+m]=u+p,t[s+y]=f,t[s+b]=p,t[h+g]=l+f,t[h+m]=u+p,t[h+y]=f,t[h+b]=p,n<e-1&&(r.push(h,n+1),r.push(s,n+1),r.push(a,n+1),r.push(o,n+1))}}function l(e,t,r,n,i,a,s){for(var h=i-s,l=a-s,u=2*s,c=0,d=0;;){if(c>=e)return r[d]=r[d]||[],void r[d].push(n);var f=4*d+v,p=4*d+2*v,w=4*d+3*v,_=4*d+4*v,x=o(h,l,u,t[f+g],t[f+m],t[f+y],t[f+b]),E=o(h,l,u,t[p+g],t[p+m],t[p+y],t[p+b]),A=o(h,l,u,t[w+g],t[w+m],t[w+y],t[w+b]),L=o(h,l,u,t[_+g],t[_+m],t[_+y],t[_+b]),O=x+E+A+L;if(0===O)throw new Error("sigma/quadtree.insertNode: no collision (level: "+c+", key: "+n+", x: "+i+", y: "+a+", size: "+s+").");if(3===O)throw new Error("sigma/quadtree.insertNode: 3 impossible collisions (level: "+c+", key: "+n+", x: "+i+", y: "+a+", size: "+s+").");if(O>1)return r[d]=r[d]||[],void r[d].push(n);c++,x&&(d=f),E&&(d=p),A&&(d=w),L&&(d=_)}}function u(e,t,r,n,i,o,s){for(var h=[0,0],l=[],u=void 0;h.length;){var c=h.pop(),d=h.pop();if(u=r[d],u&&(0,f.default)(l,u),!(c>=e)){var p=4*d+v,w=4*d+2*v,_=4*d+3*v,x=4*d+4*v,E=a(n,i,o,s,t[p+g],t[p+m],t[p+y],t[p+b]),A=a(n,i,o,s,t[w+g],t[w+m],t[w+y],t[w+b]),L=a(n,i,o,s,t[_+g],t[_+m],t[_+y],t[_+b]),O=a(n,i,o,s,t[x+g],t[x+m],t[x+y],t[x+b]);E&&h.push(p,c+1),A&&h.push(w,c+1),L&&h.push(_,c+1),O&&h.push(x,c+1)}}return l}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),d=r(13),f=function(e){return e&&e.__esModule?e:{default:e}}(d),v=4,p=5,g=0,m=1,y=2,b=3,w=1,_=2,x=3,E=4,A=function(){function e(t){n(this,e),t=t||{};var r=Math.pow(4,p);this.data=new Float32Array(v*((4*r-1)/3)),this.containers={},this.cache=null,this.lastRectangle=null,t.boundaries?this.resize(t.boundaries):this.resize({x:0,y:0,width:1,height:1}),"function"==typeof t.filter&&(this.nodeFilter=t.filter)}return c(e,[{key:"add",value:function(e,t,r,n){return l(p,this.data,this.containers,e,t,r,n),this}},{key:"resize",value:function(e){this.clear(),this.data[g]=e.x,this.data[m]=e.y,this.data[y]=e.width,this.data[b]=e.height,h(p,this.data)}},{key:"clear",value:function(){return this.containers={},this}},{key:"point",value:function(e,t){var r=[],n=0,i=0;do{this.containers[n]&&r.push.apply(r,this.containers[n]);n=4*n+s(e,t,this.data[n+g],this.data[n+m],this.data[n+y],this.data[n+b])*v,i++}while(i<=p);return r}},{key:"rectangle",value:function(e,t,r,n,o){var a=this.lastRectangle;if(a&&e===a.x1&&r===a.x2&&t===a.y1&&n===a.y2&&o===a.height)return this.cache;if(this.lastRectangle={x1:e,y1:t,x2:r,y2:n,height:o},!i(e,t,r,n))throw new Error("sigma/quadtree.rectangle: shifted view is not yet implemented.");var s=u(p,this.data,this.containers,e,t,Math.abs(e-r)||Math.abs(t-n),o);return this.cache=s,this.cache}}]),e}();t.default=A},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(1),l=n(h),u=r(14),c=n(u),d=r(15),f=function(e){function t(e,r){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n.container=e,n.camera=r,n.enabled=!0,n.hasDragged=!1,n.downStartTime=null,n.lastMouseX=null,n.lastMouseY=null,n.isMouseDown=!1,n.isMoving=!1,n.movingTimeout=null,n.startCameraState=null,n.lastCameraState=null,n.clicks=0,n.doubleClickTimeout=null,n.wheelLock=!1,n.handleClick=n.handleClick.bind(n),n.handleDown=n.handleDown.bind(n),n.handleUp=n.handleUp.bind(n),n.handleMove=n.handleMove.bind(n),n.handleWheel=n.handleWheel.bind(n),n.handleOut=n.handleOut.bind(n),e.addEventListener("click",n.handleClick,!1),e.addEventListener("mousedown",n.handleDown,!1),e.addEventListener("mousemove",n.handleMove,!1),e.addEventListener("DOMMouseScroll",n.handleWheel,!1),e.addEventListener("mousewheel",n.handleWheel,!1),e.addEventListener("mouseout",n.handleOut,!1),document.addEventListener("mouseup",n.handleUp,!1),n}return a(t,e),s(t,[{key:"kill",value:function(){var e=this.container;e.removeEventListener("click",this.handleClick),e.removeEventListener("mousedown",this.handleDown),e.removeEventListener("mousemove",this.handleMove),e.removeEventListener("DOMMouseScroll",this.handleWheel),e.removeEventListener("mousewheel",this.handleWheel),e.removeEventListener("mouseout",this.handleOut),document.removeEventListener("mouseup",this.handleUp)}},{key:"handleClick",value:function(e){var t=this;if(this.enabled){if(2===++this.clicks)return this.clicks=0,clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null,this.handleDoubleClick(e);setTimeout(function(){t.clicks=0,t.doubleClickTimeout=null},300),this.emit("click",(0,d.getMouseCoords)(e))}}},{key:"handleDoubleClick",value:function(e){if(this.enabled){var t=(0,d.getCenter)(e),r=this.camera.getState(),n=r.ratio/2.2,i={width:this.container.offsetWidth,height:this.container.offsetHeight},o=(0,d.getX)(e),a=(0,d.getY)(e),s=new l.default;s.ratio=n,s.x=r.x,s.y=r.y;var h=this.camera.viewportToGraph(i,o,a),u=this.camera.viewportToGraph(i,t.x,t.y),c=s.viewportToGraph(i,o,a),f=s.viewportToGraph(i,t.x,t.y),v=c.x-f.x-h.x+u.x,p=c.y-f.y-h.y+u.y;return this.camera.animate({x:r.x-v,y:r.y-p,ratio:n},{easing:"quadraticInOut",duration:200}),e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}}},{key:"handleDown",value:function(e){this.enabled&&(this.startCameraState=this.camera.getState(),this.lastCameraState=this.startCameraState,this.lastMouseX=(0,d.getX)(e),this.lastMouseY=(0,d.getY)(e),this.hasDragged=!1,this.downStartTime=Date.now(),e.which,this.isMouseDown=!0,this.emit("mousedown",(0,d.getMouseCoords)(e)))}},{key:"handleUp",value:function(e){if(this.enabled&&this.isMouseDown){this.isMouseDown=!1,this.movingTimeout&&(this.movingTimeout=null,clearTimeout(this.movingTimeout));var t=(0,d.getX)(e),r=(0,d.getY)(e),n=this.camera.getState(),i=this.camera.getPreviousState();this.isMoving?this.camera.animate({x:n.x+3*(n.x-i.x),y:n.y+3*(n.y-i.y)},{duration:200,easing:"quadraticOut"}):this.lastMouseX===t&&this.lastMouseY===r||this.camera.setState({x:n.x,y:n.y}),this.isMoving=!1,this.hasDragged=!1,this.emit("mouseup",(0,d.getMouseCoords)(e))}}},{key:"handleMove",value:function(e){var t=this;if(this.enabled){if(this.emit("mousemove",(0,d.getMouseCoords)(e)),this.isMouseDown){this.isMoving=!0,this.hasDragged=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=setTimeout(function(){t.movingTimeout=null,t.isMoving=!1},200);var r={width:this.container.offsetWidth,height:this.container.offsetHeight},n=(0,d.getX)(e),i=(0,d.getY)(e),o=this.camera.viewportToGraph(r,this.lastMouseX,this.lastMouseY),a=this.camera.viewportToGraph(r,n,i),s=o.x-a.x,h=o.y-a.y,l=this.camera.getState(),u=l.x+s,c=l.y+h;this.camera.setState({x:u,y:c}),this.lastMouseX=n,this.lastMouseY=i}return e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}}},{key:"handleWheel",value:function(e){var t=this;if(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!this.enabled)return!1;var r=(0,d.getWheelDelta)(e);if(!r)return!1;if(this.wheelLock)return!1;this.wheelLock=!0;var n=r>0?1/1.7:1.7,i=this.camera.getState(),o=n*i.ratio,a=(0,d.getCenter)(e),s={width:this.container.offsetWidth,height:this.container.offsetHeight},h=(0,d.getX)(e),u=(0,d.getY)(e),c=new l.default;c.ratio=o,c.x=i.x,c.y=i.y;var f=this.camera.viewportToGraph(s,h,u),v=this.camera.viewportToGraph(s,a.x,a.y),p=c.viewportToGraph(s,h,u),g=c.viewportToGraph(s,a.x,a.y),m=p.x-g.x-f.x+v.x,y=p.y-g.y-f.y+v.y;return this.camera.animate({x:i.x-m,y:i.y-y,ratio:o},{easing:"linear",duration:200},function(){return t.wheelLock=!1}),!1}},{key:"handleOut",value:function(){}}]),t}(c.default);t.default=f},function(e,t,r){"use strict";function n(e,t){var r=document.createElement(e);if(!t)return r;for(var n in t)if("style"===n)for(var i in t[n])r.style[i]=t[n][i];else r.setAttribute(n,t[n]);return r}function i(){var e=window.screen;return void 0!==e.deviceXDPI&&void 0!==e.logicalXDPI&&e.deviceXDPI>e.logicalXDPI?e.systemXDPI/e.logicalXDPI:void 0!==window.devicePixelRatio?window.devicePixelRatio:1}function o(e){var t=a(e.x,2),r=t[0],n=t[1],i=a(e.y,2),o=i[0],s=i[1],h=Math.max(n-r,s-o),l=(n+r)/2,u=(s+o)/2,c=function(e){return{x:.5+(e.x-l)/h,y:.5+(e.y-u)/h}};return c.inverse=function(e){return{x:l+h*(e.x-.5),y:u+h*(e.y-.5)}},c.ratio=h,c}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.createElement=n,t.getPixelRatio=i,t.createNormalizationFunction=o},function(e,t){e.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNodes&&"boolean"==typeof e.multi}},function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e){return function(){function t(r){i(this,t),this.programs=e.map(function(e){return new e(r)})}return a(t,[{key:"allocate",value:function(e){this.programs.forEach(function(t){return t.allocate(e)})}},{key:"process",value:function(){var e=arguments;this.programs.forEach(function(t){return t.process.apply(t,n(e))})}},{key:"computeIndices",value:function(){this.programs.forEach(function(e){"function"==typeof e.computeIndices&&e.computeIndices()})}},{key:"bufferData",value:function(){this.programs.forEach(function(e){return e.bufferData()})}},{key:"render",value:function(){var e=arguments;this.programs.forEach(function(t){t.bind(),t.bufferData(),t.render.apply(t,n(e))})}}]),t}()}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.createCompoundProgram=o;var s=r(19),h=function(){function e(t,r,n){i(this,e),this.vertexShaderSource=r,this.fragmentShaderSource=n,this.load(t)}return a(e,[{key:"load",value:function(e){return this.vertexShader=(0,s.loadVertexShader)(e,this.vertexShaderSource),this.fragmentShader=(0,s.loadFragmentShader)(e,this.fragmentShaderSource),this.program=(0,s.loadProgram)(e,[this.vertexShader,this.fragmentShader]),this.program}}]),e}();t.default=h},function(e,t,r){"use strict";function n(e,t,r){var n=r.labelSize,i=r.labelFont,o=r.labelWeight;e.fillStyle="#000",e.font=o+" "+n+"px "+i,e.fillText(t.label,t.x+t.size+3,t.y+n/3)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.WebGLRenderer=t.MouseCaptor=t.QuadTree=t.Camera=t.Renderer=void 0;var i=r(3),o=n(i),a=r(1),s=n(a),h=r(5),l=n(h),u=r(6),c=n(u),d=r(16),f=n(d);t.Renderer=o.default,t.Camera=s.default,t.QuadTree=l.default,t.MouseCaptor=c.default,t.WebGLRenderer=f.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.linear=function(e){return e},t.quadraticIn=function(e){return e*e},t.quadraticOut=function(e){return e*(2-e)},t.quadraticInOut=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},t.cubicIn=function(e){return e*e*e},t.cubicOut=function(e){return--e*e*e+1},t.cubicInOut=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},function(e,t){e.exports=function(e,t){var r=e.length,n=t.length;if(0!==n){e.length+=t.length;for(var i=0;i<n;i++)e[r+i]=t[i]}}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),s=function(e){function t(e,r){n(this,t);var o=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.container=e,o.camera=r,o}return o(t,e),t}(a.EventEmitter);t.default=s},function(e,t,r){"use strict";function n(e){if(void 0!==e.offsetX)return e.offsetX;if(void 0!==e.layerX)return e.layerX;if(void 0!==e.clientX)return e.clientX;throw new Error("sigma/captors/utils.getX: could not extract x from event.")}function i(e){if(void 0!==e.offsetY)return e.offsetY;if(void 0!==e.layerY)return e.layerY;if(void 0!==e.clientY)return e.clientY;throw new Error("sigma/captors/utils.getY: could not extract y from event.")}function o(e){var t=e.target.ownerSVGElement?e.target.ownerSVGElement.width:e.target.width;if("number"==typeof t)return t;if(void 0!==t&&void 0!==t.baseVal)return t.baseVal.value;throw new Error("sigma/captors/utils.getWidth: could not extract width from event.")}function a(e){var t=e.target.ownerSVGElement?e.target.ownerSVGElement.height:e.target.height;if("number"==typeof t)return t;if(void 0!==t&&void 0!==t.baseVal)return t.baseVal.value;throw new Error("sigma/captors/utils.getHeight: could not extract height from event.")}function s(e){var t=-1!==e.target.namespaceURI.indexOf("svg")?1:(0,u.getPixelRatio)();return{x:o(e)/(2*t),y:a(e)/(2*t)}}function h(e){return{x:n(e),y:i(e),clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,shiftKey:e.shiftKey}}function l(e){if(void 0!==e.wheelDelta)return e.wheelDelta/360;if(void 0!==e.detail)return e.detail/-9;throw new Error("sigma/captors/utils.getDelta: could not extract delta from event.")}Object.defineProperty(t,"__esModule",{value:!0}),t.getX=n,t.getY=i,t.getWidth=o,t.getHeight=a,t.getCenter=s,t.getMouseCoords=h,t.getWheelDelta=l;var u=r(7)},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(17),l=r(8),u=n(l),c=r(3),d=n(c),f=r(1),v=n(f),p=r(6),g=n(p),m=r(5),y=n(m),b=r(18),w=n(b),_=r(23),x=n(_),E=r(10),A=n(E),L=r(26),O=n(L),P=r(4),T=r(7),M=r(2),k=r(28),S=r(29),C=(0,T.getPixelRatio)(),R=(0,T.getPixelRatio)(),D={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,zIndex:!1,labelFont:"Arial",labelSize:14,labelWeight:"normal"},N=function(e){function t(e,r,n){i(this,t);var a=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(n=n||{},a.settings=(0,P.assign)({},D,n),!(0,u.default)(e))throw new Error("sigma/renderers/webgl: invalid graph instance.");if(!(r instanceof HTMLElement))throw new Error("sigma/renderers/webgl: container should be an html element.");a.graph=e,a.captors={},a.container=r,a.elements={},a.contexts={},a.listeners={},a.quadtree=new y.default,a.nodeOrder={},a.nodeDataCache={},a.edgeOrder={},a.nodeExtent=null,a.edgeExtent=null,a.normalizationFunction=null,a.width=0,a.height=0,a.highlightedNodes=new Set,a.previousVisibleNodes=new Set,a.displayedLabels=new Set,a.hoveredNode=null,a.wasRenderedInThisFrame=!1,a.renderFrame=null,a.renderHighlightedNodesFrame=null,a.needToProcess=!1,a.needToSoftProcess=!1,a.createContext("edges"),a.createContext("nodes"),a.createContext("labels",!1),a.createContext("hovers",!1),a.createContext("mouse",!1);var s=a.contexts.nodes;return s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.enable(s.BLEND),s=a.contexts.edges,s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA),s.enable(s.BLEND),a.nodePrograms={def:new w.default(a.contexts.nodes)},a.edgePrograms={def:new x.default(a.contexts.edges)},a.resize(),a.camera=new v.default({width:a.width,height:a.height}),a.bindCameraHandlers(),a.captors={mouse:new g.default(a.elements.mouse,a.camera)},a.bindEventHandlers(),a.bindGraphHandlers(),a.process(),a.render(),a}return a(t,e),s(t,[{key:"createContext",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=(0,T.createElement)("canvas",{class:"sigma-"+e,style:{position:"absolute"}});this.elements[e]=r,this.container.appendChild(r);var n={preserveDrawingBuffer:!1,antialias:!1},i=void 0;return t?(i=r.getContext("webgl",n),i||(i=r.getContext("webgl",n)),i||(i=r.getContext("experimental-webgl",n))):i=r.getContext("2d",n),this.contexts[e]=i,this}},{key:"bindCameraHandlers",value:function(){var e=this;return this.listeners.camera=function(){e.scheduleRender()},this.camera.on("updated",this.listeners.camera),this}},{key:"bindEventHandlers",value:function(){var e=this;this.listeners.handleResize=function(){e.needToSoftProcess=!0,e.scheduleRender()},window.addEventListener("resize",this.listeners.handleResize);var t=function(e,t,r,n,i){return e>r-i&&e<r+i&&t>n-i&&t<n+i&&Math.sqrt(Math.pow(e-r,2)+Math.pow(t-n,2))<i},r=function(t,r){var n=e.camera.viewportToGraph(e,t,r);return e.quadtree.point(n.x,1-n.y)};return this.listeners.handleMove=function(n){for(var i=Math.pow(e.camera.getState().ratio,.5),o=r(n.x,n.y),a=1/0,s=null,h=0,l=o.length;h<l;h++){var u=o[h],c=e.nodeDataCache[u],d=e.camera.graphToViewport(e,c.x,c.y),f=c.size/i;if(t(n.x,n.y,d.x,d.y,f)){var v=Math.sqrt(Math.pow(n.x-d.x,2)+Math.pow(n.y-d.y,2));v<a&&(a=v,s=u)}}if(s)return e.hoveredNode=s,e.emit("overNode",{node:s}),e.scheduleHighlightedNodesRender();if(e.hoveredNode){var p=e.nodeDataCache[e.hoveredNode],g=e.camera.graphToViewport(e,p.x,p.y),m=p.size/i;if(!t(n.x,n.y,g.x,g.y,m))return e.hoveredNode=null,e.emit("outNode",{node:e.hoveredNode}),e.scheduleHighlightedNodesRender()}},this.listeners.handleDown=function(n){for(var i=Math.pow(e.camera.getState().ratio,.5),o=r(n.x,n.y),a=0,s=o.length;a<s;a++){var h=o[a],l=e.nodeDataCache[h],u=e.camera.graphToViewport(e,l.x,l.y),c=l.size/i;if(t(n.x,n.y,u.x,u.y,c))return e.emit("downNode",{node:h})}},this.listeners.handleClick=function(n){for(var i=Math.pow(e.camera.getState().ratio,.5),o=r(n.x,n.y),a=0,s=o.length;a<s;a++){var h=o[a],l=e.nodeDataCache[h],u=e.camera.graphToViewport(e,l.x,l.y),c=l.size/i;if(t(n.x,n.y,u.x,u.y,c))return e.emit("clickNode",{node:h})}return e.emit("clickStage")},this.captors.mouse.on("mousemove",this.listeners.handleMove),this.captors.mouse.on("mousedown",this.listeners.handleDown),this.captors.mouse.on("click",this.listeners.handleClick),this}},{key:"bindGraphHandlers",value:function(){var e=this,t=this.graph;return this.listeners.graphUpdate=function(){e.needToProcess=!0,e.scheduleRender()},this.listeners.softGraphUpdate=function(){e.needToSoftProcess=!0,e.scheduleRender()},t.on("nodeAdded",this.listeners.graphUpdate),t.on("nodeDropped",this.listeners.graphUpdate),t.on("nodeAttributesUpdated",this.listeners.softGraphUpdate),t.on("edgeAdded",this.listeners.graphUpdate),t.on("nodeDropped",this.listeners.graphUpdate),t.on("edgeAttributesUpdated",this.listeners.softGraphUpdate),t.on("cleared",this.listeners.graphUpdate),this}},{key:"process",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.graph;this.quadtree.clear();var r=["x","y"];this.settings.zIndex&&(r.push("z"),this.edgeExtent=(0,h.edgeExtent)(t,["z"])),this.nodeExtent=(0,h.nodeExtent)(t,r),this.normalizationFunction=(0,T.createNormalizationFunction)(this.nodeExtent);var n=this.nodePrograms.def;e||(n.allocate(t.order),this.nodeOrder={});var i=t.nodes();this.settings.zIndex&&(i=(0,S.zIndexOrdering)(this.edgeExtent.z,function(e){return t.getNodeAttribute(e,"z")},i));for(var o=0,a=i.length;o<a;o++){var s=i[o];this.nodeOrder[s]=o;var l=t.getNodeAttributes(s),u=this.normalizationFunction(l),c=(0,P.assign)({},l,u);this.quadtree.add(s,c.x,1-c.y,c.size/this.width),this.nodeDataCache[s]=c,n.process(c,o)}n.bufferData();var d=this.edgePrograms.def;e||(d.allocate(t.size),this.edgeOrder={});var f=t.edges();this.settings.zIndex&&(f=(0,S.zIndexOrdering)(this.edgeExtent.z,function(e){return t.getEdgeAttribute(e,"z")},f));for(var v=0,p=f.length;v<p;v++){var g=f[v];this.edgeOrder[g]=v;var m=t.getEdgeAttributes(g),y=t.extremities(g),b=this.nodeDataCache[y[0]],w=this.nodeDataCache[y[1]];d.process(b,w,m,v)}return e||"function"!=typeof d.computeIndices||d.computeIndices(),d.bufferData(),this}},{key:"processNode",value:function(e){var t=this.nodePrograms.def,r=this.graph.getNodeAttributes(e);return t.process(r,this.nodeOrder[e]),this}},{key:"processEdge",value:function(e){var t=this.graph,r=this.edgePrograms.def,n=t.getEdgeAttributes(e),i=t.extremities(e),o=t.getNodeAttributes(i[0]),a=t.getNodeAttributes(i[1]);return r.process(o,a,n,this.edgeOrder[e]),this}},{key:"getCamera",value:function(){return this.camera}},{key:"getMouseCaptor",value:function(){return this.captors.mouse}},{key:"resize",value:function(e,t){var r=this.width,n=this.height;if(arguments.length>1?(this.width=e,this.height=t):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight),r===this.width&&n===this.height)return this;this.camera&&this.camera.resize({width:this.width,height:this.height});for(var i in this.elements){var o=this.elements[i];o.style.width=this.width+"px",o.style.height=this.height+"px"}for(var a in this.contexts){var s=this.contexts[a];s.scale?(this.elements[a].setAttribute("width",this.width*C+"px"),this.elements[a].setAttribute("height",this.height*C+"px"),1!==C&&s.scale(C,C)):(this.elements[a].setAttribute("width",this.width*R+"px"),this.elements[a].setAttribute("height",this.height*R+"px")),s.viewport&&s.viewport(0,0,this.width*R,this.height*R)}return this}},{key:"clear",value:function(){return this.contexts.labels.clearRect(0,0,this.width,this.height),this}},{key:"render",value:function(){this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null,this.needToProcess=!1,this.needToSoftProcess=!1);var e=this.camera.isAnimated()||this.captors.mouse.isMoving||this.captors.mouse.hasDragged||this.captors.mouse.wheelLock;this.resize(),this.clear();var t=this.camera.getState(),r=(0,M.matrixFromCamera)(t,{width:this.width,height:this.height}),n=void 0;if(n=this.nodePrograms.def,n.render({matrix:r,width:this.width,height:this.height,ratio:t.ratio,nodesPowRatio:.5,scalingRatio:R}),this.settings.hideEdgesOnMove&&e||(n=this.edgePrograms.def,n.render({matrix:r,width:this.width,height:this.height,ratio:t.ratio,nodesPowRatio:.5,edgesPowRatio:.5,scalingRatio:R})),this.settings.hideLabelsOnMove&&e)return this;var i=void 0;if(t.ratio>=1)i=this.graph.nodes();else{var o=this.camera.viewRectangle(this);i=this.quadtree.rectangle(o.x1,1-o.y1,o.x2,1-o.y2,o.height)}if(!this.settings.renderLabels)return this;for(var a=(0,k.labelsToDisplayFromGrid)({cache:this.nodeDataCache,camera:this.camera,displayedLabels:this.displayedLabels,previousVisibleNodes:this.previousVisibleNodes,visibleNodes:i}),s=this.contexts.labels,h=Math.pow(t.ratio,.5),l=0,u=a.length;l<u;l++){var c=this.nodeDataCache[a[l]],d=this.camera.graphToViewport(this,c.x,c.y),f=d.x,v=d.y,p=c.size/h;(0,A.default)(s,{label:c.label,size:p,x:f,y:v},this.settings)}return this.previousVisibleNodes=new Set(i),this.displayedLabels=new Set(a),this.renderHighlightedNodes(),this}},{key:"renderHighlightedNodes",value:function(){var e=this,t=this.camera,r=Math.pow(t.getState().ratio,.5),n=this.contexts.hovers;n.clearRect(0,0,this.width,this.height);var i=function(i){var o=e.nodeDataCache[i],a=t.graphToViewport(e,o.x,o.y),s=a.x,h=a.y,l=o.size/r;(0,O.default)(n,{label:o.label,color:o.color,size:l,x:s,y:h},e.settings)};this.hoveredNode&&i(this.hoveredNode),this.highlightedNodes.forEach(i)}},{key:"scheduleRender",value:function(){var e=this;if(this.renderFrame)return this;this.renderFrame=requestAnimationFrame(function(){(e.needToProcess||e.needToSoftProcess)&&e.process(e.needToSoftProcess),e.renderFrame=null,e.needToProcess=!1,e.needToSoftProcess=!1,e.render()})}},{key:"scheduleHighlightedNodesRender",value:function(){var e=this;if(this.renderHighlightedNodesFrame||this.renderFrame)return this;this.renderHighlightedNodesFrame=requestAnimationFrame(function(){e.renderHighlightedNodesFrame=null,e.renderHighlightedNodes()})}},{key:"highlightNode",value:function(e){return this.highlightedNodes.add(e),this.scheduleHighlightedNodesRender(),this}},{key:"unhighlightNode",value:function(e){return this.highlightedNodes.delete(e),this.scheduleHighlightedNodesRender(),this}},{key:"kill",value:function(){var e=this.graph;this.camera.removeListener("updated",this.listeners.camera),window.removeEventListener("resize",this.listeners.handleResize),this.captors.mouse.kill(),e.removeListener("nodeAdded",this.listeners.graphUpdate),e.removeListener("nodeDropped",this.listeners.graphUpdate),e.removeListener("nodeAttributesUpdated",this.listeners.softGraphUpdate),e.removeListener("edgeAdded",this.listeners.graphUpdate),e.removeListener("nodeDropped",this.listeners.graphUpdate),e.removeListener("edgeAttributesUpdated",this.listeners.softGraphUpdate),e.removeListener("cleared",this.listeners.graphUpdate),this.quadtree=null,this.nodeOrder=null,this.nodeDataCache=null,this.edgeOrder=null,this.highlightedNodes=null,this.previousVisibleNodes=null,this.displayedLabels=null;for(var t=this.container;t.firstChild;)t.removeChild(t.firstChild)}}]),t}(d.default);t.default=N},function(e,t,r){function n(e,t){if(!o(e))throw new Error("graphology-metrics/extent: the given graph is not a valid graphology instance.");var r,n,i,a,s,h,l,u=[].concat(t),c=e.nodes(),d={};for(s=0;s<u.length;s++)a=u[s],d[a]=[1/0,-1/0];for(h=0,l=c.length;h<l;h++)for(r=c[h],n=e.getNodeAttributes(r),s=0;s<u.length;s++)a=u[s],i=n[a],i<d[a][0]&&(d[a][0]=i),i>d[a][1]&&(d[a][1]=i);return"string"==typeof t?d[t]:d}function i(e,t){if(!o(e))throw new Error("graphology-metrics/extent: the given graph is not a valid graphology instance.");var r,n,i,a,s,h,l,u=[].concat(t),c=e.edges(),d={};for(s=0;s<u.length;s++)a=u[s],d[a]=[1/0,-1/0];for(h=0,l=c.length;h<l;h++)for(r=c[h],n=e.getEdgeAttributes(r),s=0;s<u.length;s++)a=u[s],i=n[a],i<d[a][0]&&(d[a][0]=i),i>d[a][1]&&(d[a][1]=i);return"string"==typeof t?d[t]:d}var o=r(8),a=n;a.nodeExtent=n,a.edgeExtent=i,e.exports=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(9),l=n(h),u=r(2),c=r(21),d=n(c),f=r(22),v=n(f),p=4,g=function(e){function t(e){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,d.default,v.default));r.gl=e,r.array=null,r.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,r.buffer);var n=r.program;return r.positionLocation=e.getAttribLocation(n,"a_position"),r.sizeLocation=e.getAttribLocation(n,"a_size"),r.colorLocation=e.getAttribLocation(n,"a_color"),r.resolutionLocation=e.getUniformLocation(n,"u_resolution"),r.matrixLocation=e.getUniformLocation(n,"u_matrix"),r.ratioLocation=e.getUniformLocation(n,"u_ratio"),r.scaleLocation=e.getUniformLocation(n,"u_scale"),e.enableVertexAttribArray(r.positionLocation),e.enableVertexAttribArray(r.sizeLocation),e.enableVertexAttribArray(r.colorLocation),e.vertexAttribPointer(r.positionLocation,2,e.FLOAT,!1,p*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(r.sizeLocation,1,e.FLOAT,!1,p*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(r.colorLocation,1,e.FLOAT,!1,p*Float32Array.BYTES_PER_ELEMENT,12),r}return a(t,e),s(t,[{key:"allocate",value:function(e){this.array=new Float32Array(1*p*e)}},{key:"process",value:function(e,t){var r=(0,u.floatColor)(e.color),n=1*t*p,i=this.array;if(e.hidden)return i[n++]=0,i[n++]=0,i[n++]=0,void(i[n++]=0);i[n++]=e.x,i[n++]=e.y,i[n++]=e.size,i[n]=r}},{key:"bufferData",value:function(){var e=this.gl;e.bufferData(e.ARRAY_BUFFER,this.array,e.DYNAMIC_DRAW)}},{key:"render",value:function(e){var t=this.gl,r=this.program;t.useProgram(r),t.uniform2f(this.resolutionLocation,e.width,e.height),t.uniform1f(this.ratioLocation,1/Math.pow(e.ratio,e.nodesPowRatio)),t.uniform1f(this.scaleLocation,e.scalingRatio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.drawArrays(t.POINTS,0,this.array.length/p)}}]),t}(l.default);t.default=g},function(e,t,r){"use strict";function n(e,t,r){var n="VERTEX"===e?t.VERTEX_SHADER:t.FRAGMENT_SHADER,i=t.createShader(n);if(t.shaderSource(i,r),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(i);throw t.deleteShader(i),new Error("sigma/renderers/weblg/shaders/utils.loadShader: error while compiling the shader:\n"+o+"\n"+r)}return i}function i(e,t){var r=e.createProgram(),n=void 0,i=void 0;for(n=0,i=t.length;n<i;n++)e.attachShader(r,t[n]);if(e.linkProgram(r),!e.getProgramParameter(r,e.LINK_STATUS))throw e.deleteProgram(r),new Error("sigma/renderers/weblg/shaders/utils.loadProgram: error while linking the program.");return r}Object.defineProperty(t,"__esModule",{value:!0}),t.loadProgram=i;var o=n.bind(null,"VERTEX"),a=n.bind(null,"FRAGMENT");t.loadVertexShader=o,t.loadFragmentShader=a},function(e,t,r){"use strict";function n(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function i(e,t,r){return e[0]=t,e[4]=arguments.length>2?r:t,e}function o(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[3]=-r,e[4]=n,e}function a(e,t,r){return e[6]=t,e[7]=r,e}function s(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],h=e[6],l=e[7],u=e[8],c=t[0],d=t[1],f=t[2],v=t[3],p=t[4],g=t[5],m=t[6],y=t[7],b=t[8];return e[0]=c*r+d*o+f*h,e[1]=c*n+d*a+f*l,e[2]=c*i+d*s+f*u,e[3]=v*r+p*o+g*h,e[4]=v*n+p*a+g*l,e[5]=v*i+p*s+g*u,e[6]=m*r+y*o+b*h,e[7]=m*n+y*a+b*l,e[8]=m*i+y*s+b*u,e}Object.defineProperty(t,"__esModule",{value:!0}),t.identity=n,t.scale=i,t.rotate=o,t.translate=a,t.multiply=s},function(e,t){e.exports="attribute vec2 a_position;\nattribute float a_size;\nattribute float a_color;\n\nuniform vec2 u_resolution;\nuniform float u_ratio;\nuniform float u_scale;\nuniform mat3 u_matrix;\n\nvarying vec4 color;\nvarying float border;\n\nvoid main() {\n\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 border = (1.0 / u_ratio) * (0.5 / a_size);\n\n // Extract the color:\n float c = a_color;\n color.b = mod(c, 256.0); c = floor(c / 256.0);\n color.g = mod(c, 256.0); c = floor(c / 256.0);\n color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;\n color.a = 1.0;\n}\n"},function(e,t){e.exports="precision mediump float;\n\nvarying vec4 color;\nvarying float border;\n\nconst float radius = 0.5;\n\nvoid main(void) {\n vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);\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 > border)\n t = 1.0;\n else if (dist > 0.0)\n t = dist / border;\n\n gl_FragColor = mix(color0, color, t);\n}\n"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(9),l=n(h),u=r(2),c=r(24),d=n(c),f=r(25),v=n(f),p=function(e){function t(e){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,d.default,v.default));r.gl=e,r.array=null,r.indicesArray=null,r.buffer=e.createBuffer(),r.indicesBuffer=e.createBuffer(),r.positionLocation=e.getAttribLocation(r.program,"a_position"),r.normalLocation=e.getAttribLocation(r.program,"a_normal"),r.thicknessLocation=e.getAttribLocation(r.program,"a_thickness"),r.colorLocation=e.getAttribLocation(r.program,"a_color"),r.resolutionLocation=e.getUniformLocation(r.program,"u_resolution"),r.ratioLocation=e.getUniformLocation(r.program,"u_ratio"),r.matrixLocation=e.getUniformLocation(r.program,"u_matrix"),r.scaleLocation=e.getUniformLocation(r.program,"u_scale"),r.bind();var n="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,a=n||e.getExtension("OES_element_index_uint");return r.canUse32BitsIndices=!!a,r.IndicesArray=r.canUse32BitsIndices?Uint32Array:Uint16Array,r.indicesType=r.canUse32BitsIndices?e.UNSIGNED_INT:e.UNSIGNED_SHORT,r}return a(t,e),s(t,[{key:"bind",value:function(){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indicesBuffer),e.enableVertexAttribArray(this.positionLocation),e.enableVertexAttribArray(this.normalLocation),e.enableVertexAttribArray(this.thicknessLocation),e.enableVertexAttribArray(this.colorLocation),e.vertexAttribPointer(this.positionLocation,2,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0),e.vertexAttribPointer(this.normalLocation,2,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,8),e.vertexAttribPointer(this.thicknessLocation,1,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,16),e.vertexAttribPointer(this.colorLocation,1,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,20)}},{key:"allocate",value:function(e){this.array=new Float32Array(24*e)}},{key:"process",value:function(e,t,r,n){if(e.hidden||t.hidden||r.hidden)for(var i=24*n,o=i+24;i<o;i++)this.array[i]=0;else{var a=r.size||1,s=e.x,h=e.y,l=t.x,c=t.y,d=(0,u.floatColor)(r.color),f=l-s,v=c-h,p=f*f+v*v,g=0,m=0;p&&(p=1/Math.sqrt(p),g=-v*p,m=f*p);var y=24*n,b=this.array;b[y++]=s,b[y++]=h,b[y++]=g,b[y++]=m,b[y++]=a,b[y++]=d,b[y++]=s,b[y++]=h,b[y++]=-g,b[y++]=-m,b[y++]=a,b[y++]=d,b[y++]=l,b[y++]=c,b[y++]=g,b[y++]=m,b[y++]=a,b[y++]=d,b[y++]=l,b[y++]=c,b[y++]=-g,b[y++]=-m,b[y++]=a,b[y]=d}}},{key:"computeIndices",value:function(){for(var e=this.array.length/6,t=e+e/2,r=new this.IndicesArray(t),n=0,i=0;n<t;n+=4)r[i++]=n,r[i++]=n+1,r[i++]=n+2,r[i++]=n+2,r[i++]=n+1,r[i++]=n+3;this.indicesArray=r}},{key:"bufferData",value:function(){var e=this.gl;e.bufferData(e.ARRAY_BUFFER,this.array,e.DYNAMIC_DRAW),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indicesArray,e.STATIC_DRAW)}},{key:"render",value:function(e){var t=this.gl,r=this.program;t.useProgram(r),t.uniform2f(this.resolutionLocation,e.width,e.height),t.uniform1f(this.ratioLocation,e.ratio),t.uniformMatrix3fv(this.matrixLocation,!1,e.matrix),t.uniform1f(this.scaleLocation,e.scalingRatio),t.drawElements(t.TRIANGLES,this.indicesArray.length,this.indicesType,0)}}]),t}(l.default);t.default=p},function(e,t){e.exports="attribute vec2 a_position;\nattribute vec2 a_normal;\nattribute float a_thickness;\nattribute float a_color;\n\nuniform vec2 u_resolution;\nuniform float u_ratio;\nuniform mat3 u_matrix;\nuniform float u_scale;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.8;\n\nvoid main() {\n\n // Computing thickness in pixels\n float pow_ratio = 1.0 / pow(u_ratio, 0.5);\n float thickness = a_thickness / 2.0 * pow_ratio / u_scale;\n\n // Adding a small feather for AA\n thickness += feather;\n\n // Computing delta relative to viewport\n vec2 delta = (a_normal * thickness) / u_resolution;\n\n vec2 position = (u_matrix * vec3(a_position, 1)).xy;\n position += delta;\n\n // Applying\n gl_Position = vec4(position, 0, 1);\n\n v_normal = a_normal;\n v_thickness = thickness;\n\n // Extract the color:\n float c = a_color;\n v_color.b = mod(c, 256.0); c = floor(c / 256.0);\n v_color.g = mod(c, 256.0); c = floor(c / 256.0);\n v_color.r = mod(c, 256.0); c = floor(c / 256.0); v_color /= 255.0;\n v_color.a = 1.0;\n}\n"},function(e,t){e.exports="precision mediump float;\n\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_thickness;\n\nconst float feather = 0.8;\nconst vec4 color0 = 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, color0, t);\n}\n"},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){var n=r.labelSize,i=r.labelFont,o=r.labelWeight;e.font=o+" "+n+"px "+i,e.beginPath(),e.fillStyle="#fff",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var s=e.measureText(t.label).width,l=Math.round(t.x-n/2-2),u=Math.round(t.y-n/2-2),c=Math.round(s+n/2+t.size+9),d=Math.round(n+4),f=Math.round(n/2+2);e.moveTo(l,u+f),e.moveTo(l,u+f),e.arcTo(l,u,l+f,u,f),e.lineTo(l+c,u),e.lineTo(l+c,u+d),e.lineTo(l+f,u+d),e.arcTo(l,u+d,l,u+d-f,f),e.lineTo(l,u+f),e.closePath(),e.fill(),e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,(0,a.default)(e,t),(0,h.default)(e,t,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=r(27),a=n(o),s=r(10),h=n(s)},function(e,t,r){"use strict";function n(e,t){e.fillStyle=t.color,e.beginPath(),e.arc(t.x,t.y,t.size,0,i,!0),e.closePath(),e.fill()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var i=2*Math.PI},function(e,t,r){"use strict";var n={width:200,height:150},i={width:400,height:300};t.labelsToDisplayFromGrid=function(e){var t=e.cache,r=e.camera,o=e.displayedLabels,a=e.previousVisibleNodes,s=e.visibleNodes,h=r.getState(),l=r.getPreviousState(),u=r.getDimensions(),c=h.ratio<l.ratio,d=h.x!==l.x||h.y!==l.x,f=h.ratio>l.ratio,v=!c&&!f&&h.ratio>=1;if(f&&Math.trunc(10*h.ratio)%3!=0)return Array.from(o);if(v&&0!==o.size)return Array.from(o);for(var p=h.ratio>=1.3?i:n,g=u.width%p.width,m=p.width+g/Math.floor(u.width/p.width),y=u.height%p.height,b=p.height+y/Math.floor(u.height/p.height),w={},_=new Set,x=[],E=0,A=s.length;E<A;E++){var L=s[E],O=t[L];if(!d||c||f||o.has(L)||!a.has(L)){var P=r.graphToViewport(u,O.x,O.y),T=Math.floor(P.x/m),M=Math.floor(P.y/b),k=T+";"+M;if((c||d&&!f)&&o.has(L))_.add(k),x.push(L);else if(!_.has(k))if(void 0===w[k])w[k]=L;else{var S=w[k],C=t[S];(O.size>C.size||O.size===C.size&&L>S)&&(w[k]=L)}}}for(var R in w)x.push(w[R]);return x}},function(e,t,r){"use strict";var n=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.zIndexOrdering=function(e,t,r){var i=(r.length,n(e,2)),o=i[0],a=i[1],s=a-o;return 0===s||s===-1/0?r:r.sort(function(e,r){var n=t(e),i=t(r);return n<i?-1:n>i?1:0})}}])});
{
"name": "sigma",
"version": "2.0.0-alpha13",
"version": "2.0.0-alpha14",
"description": "A JavaScript library dedicated to graph drawing.",

@@ -5,0 +5,0 @@ "homepage": "http://sigmajs.org",

@@ -555,3 +555,3 @@ 'use strict';

// Computing edge indices if necessary
if (!keepArrays && typeof edgeProgram.computeIndices === 'function') this.edgeIndicesArray = edgeProgram.computeIndices();
if (!keepArrays && typeof edgeProgram.computeIndices === 'function') edgeProgram.computeIndices();

@@ -558,0 +558,0 @@ edgeProgram.bufferData();

@@ -48,3 +48,4 @@ 'use strict';

var POINTS = 4,
ATTRIBUTES = 6;
ATTRIBUTES = 6,
STRIDE = POINTS * ATTRIBUTES;

@@ -127,5 +128,5 @@ var EdgeProgram = function (_Program) {

if (sourceData.hidden || targetData.hidden || data.hidden) {
for (var l = i + POINTS * ATTRIBUTES; i < l; i++) {
this.array[i] = 0;
}
for (var _i = offset * STRIDE, l = _i + STRIDE; _i < l; _i++) {
this.array[_i] = 0;
}return;
}

@@ -200,9 +201,9 @@

for (var _i = 0, c = 0; _i < size; _i += 4) {
indices[c++] = _i;
indices[c++] = _i + 1;
indices[c++] = _i + 2;
indices[c++] = _i + 2;
indices[c++] = _i + 1;
indices[c++] = _i + 3;
for (var i = 0, c = 0; i < size; i += 4) {
indices[c++] = i;
indices[c++] = i + 1;
indices[c++] = i + 2;
indices[c++] = i + 2;
indices[c++] = i + 1;
indices[c++] = i + 3;
}

@@ -209,0 +210,0 @@

@@ -96,2 +96,11 @@ 'use strict';

if (data.hidden) {
array[i++] = 0;
array[i++] = 0;
array[i++] = 0;
array[i++] = 0;
return;
}
array[i++] = data.x;

@@ -98,0 +107,0 @@ array[i++] = data.y;

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

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

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