react-sigma
Version:
Lightweight but powerful library for drawing network graphs built on top of SigmaJS
1 lines • 207 kB
JavaScript
var ReactSigma=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=21)}([function(e,t,i){var r=i(3);e.exports=i(7)(r.isElement,!0)},function(e,t){e.exports=void 0},function(e,t){!function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=115)}({115:function(e,t,i){"use strict";i.r(t),i(116),i(117),i(118),i(119),i(120),i(121),i(122),i(123),i(124),i(125),i(126),i(127),i(128),i(129),i(130),i(131),i(132),i(133),i(134),i(135),i(136),i(137),i(138),i(139),i(140),i(141);let r=window.sigma;r.renderers.def=r.renderers.canvas,t.default=r},116:function(e,t){(function(){(function(e){"use strict";var t={},i=function(e){var r,n,o,s,a;i.classes.dispatcher.extend(this);var l=this,d=e||{};if("string"==typeof d||d instanceof HTMLElement?d={renderers:[d]}:"[object Array]"===Object.prototype.toString.call(d)&&(d={renderers:d}),s=d.renderers||d.renderer||d.container,d.renderers&&0!==d.renderers.length||("string"==typeof s||s instanceof HTMLElement||"object"==typeof s&&"container"in s)&&(d.renderers=[s]),d.id){if(t[d.id])throw'sigma: Instance "'+d.id+'" already exists.';Object.defineProperty(this,"id",{value:d.id})}else{for(a=0;t[a];)a++;Object.defineProperty(this,"id",{value:""+a})}for(t[this.id]=this,this.settings=new i.classes.configurable(i.settings,d.settings||{}),Object.defineProperty(this,"graph",{value:new i.classes.graph(this.settings),configurable:!0}),Object.defineProperty(this,"middlewares",{value:[],configurable:!0}),Object.defineProperty(this,"cameras",{value:{},configurable:!0}),Object.defineProperty(this,"renderers",{value:{},configurable:!0}),Object.defineProperty(this,"renderersPerCamera",{value:{},configurable:!0}),Object.defineProperty(this,"cameraFrames",{value:{},configurable:!0}),Object.defineProperty(this,"camera",{get:function(){return this.cameras[0]}}),Object.defineProperty(this,"events",{value:["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","doubleClickNode","doubleClickNodes","rightClickNode","rightClickNodes","overNode","overNodes","outNode","outNodes","downNode","downNodes","upNode","upNodes"],configurable:!0}),this._handler=function(e){var t,i={};for(t in e.data)i[t]=e.data[t];i.renderer=e.target,this.dispatchEvent(e.type,i)}.bind(this),r=0,n=(o=d.renderers||[]).length;r<n;r++)this.addRenderer(o[r]);for(r=0,n=(o=d.middlewares||[]).length;r<n;r++)this.middlewares.push("string"==typeof o[r]?i.middlewares[o[r]]:o[r]);"object"==typeof d.graph&&d.graph&&(this.graph.read(d.graph),this.refresh()),window.addEventListener("resize",(function(){l.settings&&l.refresh()}))};if(i.prototype.addCamera=function(t){var r,n=this;if(!arguments.length){for(t=0;this.cameras[""+t];)t++;t=""+t}if(this.cameras[t])throw'sigma.addCamera: The camera "'+t+'" already exists.';return r=new i.classes.camera(t,this.graph,this.settings),this.cameras[t]=r,r.quadtree=new i.classes.quad,i.classes.edgequad!==e&&(r.edgequadtree=new i.classes.edgequad),r.bind("coordinatesUpdated",(function(e){n.renderCamera(r,r.isAnimated)})),this.renderersPerCamera[t]=[],r},i.prototype.killCamera=function(e){if(!(e="string"==typeof e?this.cameras[e]:e))throw"sigma.killCamera: The camera is undefined.";var t,i=this.renderersPerCamera[e.id];for(t=i.length-1;t>=0;t--)this.killRenderer(i[t]);return delete this.renderersPerCamera[e.id],delete this.cameraFrames[e.id],delete this.cameras[e.id],e.kill&&e.kill(),this},i.prototype.addRenderer=function(e){var t,r,n,o,s=e||{};if("string"==typeof s?s={container:document.getElementById(s)}:s instanceof HTMLElement&&(s={container:s}),"string"==typeof s.container&&(s.container=document.getElementById(s.container)),"id"in s)t=s.id;else{for(t=0;this.renderers[""+t];)t++;t=""+t}if(this.renderers[t])throw'sigma.addRenderer: The renderer "'+t+'" already exists.';if(r=(r="function"==typeof s.type?s.type:i.renderers[s.type])||i.renderers.def,n="camera"in s?s.camera instanceof i.classes.camera?s.camera:this.cameras[s.camera]||this.addCamera(s.camera):this.addCamera(),this.cameras[n.id]!==n)throw"sigma.addRenderer: The camera is not properly referenced.";return o=new r(this.graph,n,this.settings,s),this.renderers[t]=o,Object.defineProperty(o,"id",{value:t}),o.bind&&o.bind(["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","clickEdge","clickEdges","doubleClickNode","doubleClickNodes","doubleClickEdge","doubleClickEdges","rightClickNode","rightClickNodes","rightClickEdge","rightClickEdges","overNode","overNodes","overEdge","overEdges","outNode","outNodes","outEdge","outEdges","downNode","downNodes","downEdge","downEdges","upNode","upNodes","upEdge","upEdges"],this._handler),this.renderersPerCamera[n.id].push(o),o},i.prototype.killRenderer=function(e){if(!(e="string"==typeof e?this.renderers[e]:e))throw"sigma.killRenderer: The renderer is undefined.";var t=this.renderersPerCamera[e.camera.id],i=t.indexOf(e);return i>=0&&t.splice(i,1),e.kill&&e.kill(),delete this.renderers[e.id],this},i.prototype.refresh=function(t){var r,n,o,s,a,l,d=0;for(t=t||{},r=0,n=(s=this.middlewares||[]).length;r<n;r++)s[r].call(this,0===r?"":"tmp"+d+":",r===n-1?"ready:":"tmp"+ ++d+":");for(o in this.cameras)(a=this.cameras[o]).settings("autoRescale")&&this.renderersPerCamera[a.id]&&this.renderersPerCamera[a.id].length?i.middlewares.rescale.call(this,s.length?"ready:":"",a.readPrefix,{width:this.renderersPerCamera[a.id][0].width,height:this.renderersPerCamera[a.id][0].height}):i.middlewares.copy.call(this,s.length?"ready:":"",a.readPrefix),t.skipIndexation||(l=i.utils.getBoundaries(this.graph,a.readPrefix),a.quadtree.index(this.graph.nodes(),{prefix:a.readPrefix,bounds:{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY}}),a.edgequadtree!==e&&a.settings("drawEdges")&&a.settings("enableEdgeHovering")&&a.edgequadtree.index(this.graph,{prefix:a.readPrefix,bounds:{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY}}));for(r=0,n=(s=Object.keys(this.renderers)).length;r<n;r++)if(this.renderers[s[r]].process)if(this.settings("skipErrors"))try{this.renderers[s[r]].process()}catch(e){console.log('Warning: The renderer "'+s[r]+'" crashed on ".process()"')}else this.renderers[s[r]].process();return this.render(),this},i.prototype.render=function(){var e,t,i;for(e=0,t=(i=Object.keys(this.renderers)).length;e<t;e++)if(this.settings("skipErrors"))try{this.renderers[i[e]].render()}catch(t){this.settings("verbose")&&console.log('Warning: The renderer "'+i[e]+'" crashed on ".render()"')}else this.renderers[i[e]].render();return this},i.prototype.renderCamera=function(e,t){var i,r,n,o=this;if(t)for(i=0,r=(n=this.renderersPerCamera[e.id]).length;i<r;i++)if(this.settings("skipErrors"))try{n[i].render()}catch(e){this.settings("verbose")&&console.log('Warning: The renderer "'+n[i].id+'" crashed on ".render()"')}else n[i].render();else if(!this.cameraFrames[e.id]){for(i=0,r=(n=this.renderersPerCamera[e.id]).length;i<r;i++)if(this.settings("skipErrors"))try{n[i].render()}catch(e){this.settings("verbose")&&console.log('Warning: The renderer "'+n[i].id+'" crashed on ".render()"')}else n[i].render();this.cameraFrames[e.id]=requestAnimationFrame((function(){delete o.cameraFrames[e.id]}))}return this},i.prototype.kill=function(){var e;for(e in this.dispatchEvent("kill"),this.graph.kill(),delete this.middlewares,this.renderers)this.killRenderer(this.renderers[e]);for(e in this.cameras)this.killCamera(this.cameras[e]);for(e in delete this.renderers,delete this.cameras,this)this.hasOwnProperty(e)&&delete this[e];delete t[this.id]},i.instances=function(e){return arguments.length?t[e]:i.utils.extend({},t)},i.version="1.2.0",void 0!==this.sigma)throw"An object called sigma is already in the global scope.";this.sigma=i}).call(this)}).call(window)},117:function(e,t,i){(function(){!function(i){"use strict";if(i.conrad)throw new Error("conrad already exists");var r,n=!1,o={},s={},a=[],l={},d=[],c=!1,u={frameDuration:20,history:!0},g=Object.create(null);function h(e,t){var i,r,n,o,s,a,l=Array.isArray(e)?e:e.split(/ /);for(t=void 0===t?{}:t,i=0,n=l.length;i!==n;i+=1)if(a=l[i],g[a])for(s={type:a,data:t||{}},r=0,o=g[a].length;r!==o;r+=1)try{g[a][r].handler(s)}catch(e){}}function f(){var e,t,i,r,n=!1,o=E(),s=a.shift();if(i=s.job(),o=E()-o,s.done++,s.time+=o,s.currentTime+=o,s.weightTime=s.currentTime/(s.weight||1),s.averageTime=s.time/s.done,!(r=s.count?s.count<=s.done:!i)){for(e=0,t=a.length;e<t;e++)if(a[e].weightTime>s.weightTime){a.splice(e,0,s),n=!0;break}n||a.push(s)}return r?s:null}function p(e){var t=a.length;s[e.id]=e,e.status="running",t&&(e.weightTime=a[t-1].weightTime,e.currentTime=e.weightTime*(e.weight||1)),e.startTime=E(),h("jobStarted",x(e)),a.push(e)}function m(){var e,t,i;for(e in o)(t=o[e]).after?l[e]=t:p(t),delete o[e];for(n=!!a.length;a.length&&E()-r<u.frameDuration;)if(i=f())for(e in y(i.id),l)l[e].after===i.id&&(p(l[e]),delete l[e]);n?(r=E(),h("enterFrame"),setTimeout(m,0)):h("stop")}function y(e){var t,i,r,n,c=!1;if(Array.isArray(e))for(t=0,i=e.length;t<i;t++)y(e[t]);else{if("string"!=typeof e)throw new Error("[conrad.killJob] Wrong arguments.");for(t=0,i=(r=[s,l,o]).length;t<i;t++)e in r[t]&&(n=r[t][e],u.history&&(n.status="done",d.push(n)),h("jobEnded",x(n)),delete r[t][e],"function"==typeof n.end&&n.end(),c=!0);for(t=0,i=(r=a).length;t<i;t++)if(r[t].id===e){r.splice(t,1);break}if(!c)throw new Error('[conrad.killJob] Job "'+e+'" not found.')}return this}function v(e){var t=o[e]||s[e]||l[e];return t?b(t):null}function b(){var e,t,i={};for(e=arguments.length-1;e>=0;e--)for(t in arguments[e])i[t]=arguments[e][t];return i}function x(e){var t,i,r;if(!e)return e;if(Array.isArray(e))for(t=[],i=0,r=e.length;i<r;i++)t.push(x(e[i]));else if("object"==typeof e)for(i in t={},e)t[i]=x(e[i]);else t=e;return t}function w(e){var t,i=[];for(t in e)i.push(e[t]);return i}function E(){return Date.now?Date.now():(new Date).getTime()}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var S={hasJob:v,addJob:function e(t,i){var s,a,l;if(Array.isArray(t)){for(c=!0,s=0,a=t.length;s<a;s++)e(t[s].id,b(t[s],i));c=!1,n||(r=E(),h("start"),m())}else if("object"==typeof t)if("string"==typeof t.id)e(t.id,t);else{for(s in c=!0,t)"function"==typeof t[s]?e(s,b({job:t[s]},i)):e(s,b(t[s],i));c=!1,n||(r=E(),h("start"),m())}else{if("string"!=typeof t)throw new Error("[conrad.addJob] Wrong arguments.");if(v(t))throw new Error('[conrad.addJob] Job with id "'+t+'" already exists.');if("function"==typeof i)l={id:t,done:0,time:0,status:"waiting",currentTime:0,averageTime:0,weightTime:0,job:i};else{if("object"!=typeof i)throw new Error("[conrad.addJob] Wrong arguments.");l=b({id:t,done:0,time:0,status:"waiting",currentTime:0,averageTime:0,weightTime:0},i)}o[t]=l,h("jobAdded",x(l)),n||c||(r=E(),h("start"),m())}return this},killJob:y,killAll:function(){var e,t=b(o,s,l);if(u.history)for(e in t)t[e].status="done",d.push(t[e]),"function"==typeof t[e].end&&t[e].end();return o={},l={},s={},a=[],n=!1,this},settings:function(e,t){var i;if("string"==typeof a1&&1===arguments.length)return u[a1];for(var r in i="object"==typeof a1&&1===arguments.length&&a1||{},"string"==typeof a1&&(i[a1]=a2),i)void 0!==i[r]?u[r]=i[r]:delete u[r];return this},getStats:function(e,t){var i,r,n,a,c,u,g;if(!arguments.length){for(r in c=[],o)c.push(o[r]);for(r in l)c.push(l[r]);for(r in s)c.push(s[r]);c=c.concat(d)}if("string"==typeof e)switch(e){case"waiting":c=w(l);break;case"running":c=w(s);break;case"done":c=d;break;default:u=e}if(e instanceof RegExp&&(u=e),!u&&("string"==typeof t||t instanceof RegExp)&&(u=t),u){if(g="string"==typeof u,c instanceof Array)i=c;else if("object"==typeof c)for(r in i=[],c)i=i.concat(c[r]);else{for(r in i=[],o)i.push(o[r]);for(r in l)i.push(l[r]);for(r in s)i.push(s[r]);i=i.concat(d)}for(c=[],n=0,a=i.length;n<a;n++)(g?i[n].id===u:i[n].id.match(u))&&c.push(i[n])}return x(c)},isRunning:function(){return n},clearHistory:function(){return d=[],this},bind:function e(t,i){var r,n,o,s;if(arguments.length)if(1===arguments.length&&Object(arguments[0])===arguments[0])for(t in arguments[0])e(t,arguments[0][t]);else if(arguments.length>1)for(r=0,n=(s=Array.isArray(t)?t:t.split(/ /)).length;r!==n;r+=1)o=s[r],g[o]||(g[o]=[]),g[o].push({handler:i})},unbind:function(e,t){var i,r,n,o,s,a,l=Array.isArray(e)?e:e.split(/ /);if(arguments.length)if(t)for(i=0,r=l.length;i!==r;i+=1){if(a=l[i],g[a]){for(s=[],n=0,o=g[a].length;n!==o;n+=1)g[a][n].handler!==t&&s.push(g[a][n]);g[a]=s}g[a]&&0===g[a].length&&delete g[a]}else for(i=0,r=l.length;i!==r;i+=1)delete g[l[i]];else g=Object.create(null)},version:"0.1.0"};e.exports&&(t=e.exports=S),t.conrad=S,i.conrad=S}(this)}).call(window)},118:function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";var t,i=this;sigma.utils=sigma.utils||{},sigma.utils.extend=function(){var e,t,i={},r=arguments.length;for(e=r-1;e>=0;e--)for(t in arguments[e])i[t]=arguments[e][t];return i},sigma.utils.dateNow=function(){return Date.now?Date.now():(new Date).getTime()},sigma.utils.pkg=function(e){return(e||"").split(".").reduce((function(e,t){return t in e?e[t]:e[t]={}}),i)},sigma.utils.id=(t=0,function(){return++t});var r={};sigma.utils.floatColor=function(e){if(r[e])return r[e];var t=e,i=0,n=0,o=0;"#"===e[0]?3===(e=e.slice(1)).length?(i=parseInt(e.charAt(0)+e.charAt(0),16),n=parseInt(e.charAt(1)+e.charAt(1),16),o=parseInt(e.charAt(2)+e.charAt(2),16)):(i=parseInt(e.charAt(0)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(3),16),o=parseInt(e.charAt(4)+e.charAt(5),16)):e.match(/^ *rgba? *\(/)&&(i=+(e=e.match(/^ *rgba? *\( *([0-9]*) *, *([0-9]*) *, *([0-9]*) *(,.*)?\) *$/))[1],n=+e[2],o=+e[3]);var s=256*i*256+256*n+o;return r[t]=s,s},sigma.utils.zoomTo=function(e,t,i,r,n){var o,s,a,l=e.settings;(s=Math.max(l("zoomMin"),Math.min(l("zoomMax"),e.ratio*r)))!==e.ratio&&(a={x:t*(1-(r=s/e.ratio))+e.x,y:i*(1-r)+e.y,ratio:s},n&&n.duration?(o=sigma.misc.animation.killAll(e),n=sigma.utils.extend(n,{easing:o?"quadraticOut":"quadraticInOut"}),sigma.misc.animation.camera(e,a,n)):(e.goTo(a),n&&n.onComplete&&n.onComplete()))},sigma.utils.getQuadraticControlPoint=function(e,t,i,r){return{x:(e+i)/2+(r-t)/4,y:(t+r)/2+(e-i)/4}},sigma.utils.getPointOnQuadraticCurve=function(e,t,i,r,n,o,s){return{x:Math.pow(1-e,2)*t+2*(1-e)*e*o+Math.pow(e,2)*r,y:Math.pow(1-e,2)*i+2*(1-e)*e*s+Math.pow(e,2)*n}},sigma.utils.getPointOnBezierCurve=function(e,t,i,r,n,o,s,a,l){var d=Math.pow(1-e,3),c=3*e*Math.pow(1-e,2),u=3*Math.pow(e,2)*(1-e),g=Math.pow(e,3);return{x:d*t+c*o+u*a+g*r,y:d*i+c*s+u*l+g*n}},sigma.utils.getSelfLoopControlPoints=function(e,t,i){return{x1:e-7*i,y1:t,x2:e,y2:t+7*i}},sigma.utils.getDistance=function(e,t,i,r){return Math.sqrt(Math.pow(i-e,2)+Math.pow(r-t,2))},sigma.utils.getCircleIntersection=function(e,t,i,r,n,o){var s,a,l,d,c,u,g,h,f;return a=r-e,l=n-t,!((d=Math.sqrt(l*l+a*a))>i+o)&&!(d<Math.abs(i-o))&&(f=t+l*(s=(i*i-o*o+d*d)/(2*d))/d,{xi:(h=e+a*s/d)+(u=(c=Math.sqrt(i*i-s*s))/d*-l),xi_prime:h-u,yi:f+(g=a*(c/d)),yi_prime:f-g})},sigma.utils.isPointOnSegment=function(e,t,i,r,n,o,s){return Math.abs((t-r)*(n-i)-(e-i)*(o-r))/sigma.utils.getDistance(i,r,n,o)<s&&Math.min(i,n)<=e&&e<=Math.max(i,n)&&Math.min(r,o)<=t&&t<=Math.max(r,o)},sigma.utils.isPointOnQuadraticCurve=function(e,t,i,r,n,o,s,a,l){var d=sigma.utils.getDistance(i,r,n,o);if(Math.abs(e-i)>d||Math.abs(t-r)>d)return!1;for(var c,u=.5,g=sigma.utils.getDistance(e,t,i,r)<sigma.utils.getDistance(e,t,n,o)?-.01:.01,h=100,f=sigma.utils.getPointOnQuadraticCurve(u,i,r,n,o,s,a),p=sigma.utils.getDistance(e,t,f.x,f.y);h-- >0&&u>=0&&u<=1&&p>l&&(g>.001||g<-.001);)c=p,f=sigma.utils.getPointOnQuadraticCurve(u,i,r,n,o,s,a),(p=sigma.utils.getDistance(e,t,f.x,f.y))>c?u+=g=-g/2:u+g<0||u+g>1?(g/=2,p=c):u+=g;return p<l},sigma.utils.isPointOnBezierCurve=function(e,t,i,r,n,o,s,a,l,d,c){var u=sigma.utils.getDistance(i,r,s,a);if(Math.abs(e-i)>u||Math.abs(t-r)>u)return!1;for(var g,h=.5,f=sigma.utils.getDistance(e,t,i,r)<sigma.utils.getDistance(e,t,n,o)?-.01:.01,p=100,m=sigma.utils.getPointOnBezierCurve(h,i,r,n,o,s,a,l,d),y=sigma.utils.getDistance(e,t,m.x,m.y);p-- >0&&h>=0&&h<=1&&y>c&&(f>.001||f<-.001);)g=y,m=sigma.utils.getPointOnBezierCurve(h,i,r,n,o,s,a,l,d),(y=sigma.utils.getDistance(e,t,m.x,m.y))>g?h+=f=-f/2:h+f<0||h+f>1?(f/=2,y=g):h+=f;return y<c},sigma.utils.getX=function(t){return t.offsetX!==e&&t.offsetX||t.layerX!==e&&t.layerX||t.clientX!==e&&t.clientX},sigma.utils.getY=function(t){return t.offsetY!==e&&t.offsetY||t.layerY!==e&&t.layerY||t.clientY!==e&&t.clientY},sigma.utils.getPixelRatio=function(){var t=1;return window.screen.deviceXDPI!==e&&window.screen.logicalXDPI!==e&&window.screen.deviceXDPI>window.screen.logicalXDPI?t=window.screen.systemXDPI/window.screen.logicalXDPI:window.devicePixelRatio!==e&&(t=window.devicePixelRatio),t},sigma.utils.getWidth=function(t){var i=t.target.ownerSVGElement?t.target.ownerSVGElement.width:t.target.width;return"number"==typeof i&&i||i!==e&&i.baseVal!==e&&i.baseVal.value},sigma.utils.getCenter=function(e){var t=-1!==e.target.namespaceURI.indexOf("svg")?1:sigma.utils.getPixelRatio();return{x:sigma.utils.getWidth(e)/(2*t),y:sigma.utils.getHeight(e)/(2*t)}},sigma.utils.mouseCoords=function(e,t,i){return t=t||sigma.utils.getX(e),i=i||sigma.utils.getY(e),{x:t-sigma.utils.getCenter(e).x,y:i-sigma.utils.getCenter(e).y,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,shiftKey:e.shiftKey}},sigma.utils.getHeight=function(t){var i=t.target.ownerSVGElement?t.target.ownerSVGElement.height:t.target.height;return"number"==typeof i&&i||i!==e&&i.baseVal!==e&&i.baseVal.value},sigma.utils.getDelta=function(t){return t.wheelDelta!==e&&t.wheelDelta||t.detail!==e&&-t.detail},sigma.utils.getOffset=function(e){for(var t=0,i=0;e;)i+=parseInt(e.offsetTop),t+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:i,left:t}},sigma.utils.doubleClick=function(e,t,i){var r,n=0;e._doubleClickHandler=e._doubleClickHandler||{},e._doubleClickHandler[t]=e._doubleClickHandler[t]||[],(r=e._doubleClickHandler[t]).push((function(e){if(2==++n)return n=0,i(e);1===n&&setTimeout((function(){n=0}),sigma.settings.doubleClickTimeout)})),e.addEventListener(t,r[r.length-1],!1)},sigma.utils.unbindDoubleClick=function(e,t){for(var i,r=(e._doubleClickHandler||{})[t]||[];i=r.pop();)e.removeEventListener(t,i);delete(e._doubleClickHandler||{})[t]},sigma.utils.easings=sigma.utils.easings||{},sigma.utils.easings.linearNone=function(e){return e},sigma.utils.easings.quadraticIn=function(e){return e*e},sigma.utils.easings.quadraticOut=function(e){return e*(2-e)},sigma.utils.easings.quadraticInOut=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},sigma.utils.easings.cubicIn=function(e){return e*e*e},sigma.utils.easings.cubicOut=function(e){return--e*e*e+1},sigma.utils.easings.cubicInOut=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},sigma.utils.loadShader=function(e,t,i,r){var n=e.createShader(i);return e.shaderSource(n,t),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS)?n:(r&&r('Error compiling shader "'+n+'":'+e.getShaderInfoLog(n)),e.deleteShader(n),null)},sigma.utils.loadProgram=function(e,t,i,r,n){var o,s=e.createProgram();for(o=0;o<t.length;++o)e.attachShader(s,t[o]);if(i)for(o=0;o<i.length;++o)e.bindAttribLocation(s,locations?locations[o]:o,opt_attribs[o]);return e.linkProgram(s),e.getProgramParameter(s,e.LINK_STATUS)?s:(n&&n("Error in program linking: "+e.getProgramInfoLog(s)),e.deleteProgram(s),null)},sigma.utils.pkg("sigma.utils.matrices"),sigma.utils.matrices.translation=function(e,t){return[1,0,0,0,1,0,e,t,1]},sigma.utils.matrices.rotation=function(e,t){var i=Math.cos(e),r=Math.sin(e);return t?[i,-r,r,i]:[i,-r,0,r,i,0,0,0,1]},sigma.utils.matrices.scale=function(e,t){return t?[e,0,0,e]:[e,0,0,0,e,0,0,0,1]},sigma.utils.matrices.multiply=function(e,t,i){var r=i?2:3,n=e[0*r+0],o=e[0*r+1],s=e[0*r+2],a=e[1*r+0],l=e[1*r+1],d=e[1*r+2],c=e[2*r+0],u=e[2*r+1],g=e[2*r+2],h=t[0*r+0],f=t[0*r+1],p=t[0*r+2],m=t[1*r+0],y=t[1*r+1],v=t[1*r+2],b=t[2*r+0],x=t[2*r+1],w=t[2*r+2];return i?[n*h+o*m,n*f+o*y,a*h+l*m,a*f+l*y]:[n*h+o*m+s*b,n*f+o*y+s*x,n*p+o*v+s*w,a*h+l*m+d*b,a*f+l*y+d*x,a*p+l*v+d*w,c*h+u*m+g*b,c*f+u*y+g*x,c*p+u*v+g*w]}}).call(this)}).call(window)},119:function(e,t){(function(){!function(e){"use strict";var t,i=0,r=["ms","moz","webkit","o"];for(t=0;t<r.length&&!e.requestAnimationFrame;t++)e.requestAnimationFrame=e[r[t]+"RequestAnimationFrame"],e.cancelAnimationFrame=e[r[t]+"CancelAnimationFrame"]||e[r[t]+"CancelRequestAnimationFrame"];e.requestAnimationFrame||(e.requestAnimationFrame=function(t,r){var n=(new Date).getTime(),o=Math.max(0,16-(n-i)),s=e.setTimeout((function(){t(n+o)}),o);return i=n+o,s}),e.cancelAnimationFrame||(e.cancelAnimationFrame=function(e){clearTimeout(e)}),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t,i,r=Array.prototype.slice.call(arguments,1),n=this;return i=function(){return n.apply(this instanceof t&&e?this:e,r.concat(Array.prototype.slice.call(arguments)))},(t=function(){}).prototype=this.prototype,i.prototype=new t,i})}(this)}).call(window)},120:function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.settings"),sigma.settings=sigma.utils.extend(sigma.settings||{},{clone:!0,immutable:!0,verbose:!1,classPrefix:"sigma",defaultNodeType:"def",defaultEdgeType:"def",defaultLabelColor:"#000",defaultEdgeColor:"#000",defaultNodeColor:"#000",defaultLabelSize:14,edgeColor:"source",minArrowSize:0,font:"arial",fontStyle:"",labelColor:"default",labelSize:"fixed",labelSizeRatio:1,labelThreshold:8,webglOversamplingRatio:2,borderSize:0,defaultNodeBorderColor:"#000",hoverFont:"",singleHover:!0,hoverFontStyle:"",labelHoverShadow:"default",labelHoverShadowColor:"#000",nodeHoverColor:"node",defaultNodeHoverColor:"#000",labelHoverBGColor:"default",defaultHoverLabelBGColor:"#fff",labelHoverColor:"default",defaultLabelHoverColor:"#000",edgeHoverColor:"edge",edgeHoverSizeRatio:1,defaultEdgeHoverColor:"#000",edgeHoverExtremities:!1,drawEdges:!0,drawNodes:!0,drawLabels:!0,drawEdgeLabels:!1,batchEdgesDrawing:!1,hideEdgesOnMove:!1,canvasEdgesBatchSize:500,webglEdgesBatchSize:1e3,scalingMode:"inside",sideMargin:0,minEdgeSize:.5,maxEdgeSize:1,minNodeSize:1,maxNodeSize:8,touchEnabled:!0,mouseEnabled:!0,mouseWheelEnabled:!0,doubleClickEnabled:!0,eventsEnabled:!0,zoomingRatio:1.7,doubleClickZoomingRatio:2.2,zoomMin:.0625,zoomMax:2,mouseZoomDuration:200,doubleClickZoomDuration:200,mouseInertiaDuration:200,mouseInertiaRatio:3,touchInertiaDuration:200,touchInertiaRatio:3,doubleClickTimeout:300,doubleTapTimeout:300,dragTimeout:200,autoResize:!0,autoRescale:!0,enableCamera:!0,enableHovering:!0,enableEdgeHovering:!1,edgeHoverPrecision:5,rescaleIgnoreSize:!1,skipErrors:!1,nodesPowRatio:.5,edgesPowRatio:.5,animationsTime:200})}).call(this)}).call(window)},121:function(e,t,i){(function(){(function(){"use strict";var i=function(){Object.defineProperty(this,"_handlers",{value:{}})};i.prototype.bind=function(e,t){var i,r,n,o;if(1===arguments.length&&"object"==typeof arguments[0])for(e in arguments[0])this.bind(e,arguments[0][e]);else{if(2!==arguments.length||"function"!=typeof arguments[1])throw"bind: Wrong arguments.";for(i=0,r=(o="string"==typeof e?e.split(" "):e).length;i!==r;i+=1)(n=o[i])&&(this._handlers[n]||(this._handlers[n]=[]),this._handlers[n].push({handler:t}))}return this},i.prototype.unbind=function(e,t){var i,r,n,o,s,a,l,d="string"==typeof e?e.split(" "):e;if(!arguments.length){for(s in this._handlers)delete this._handlers[s];return this}if(t)for(i=0,r=d.length;i!==r;i+=1){if(l=d[i],this._handlers[l]){for(a=[],n=0,o=this._handlers[l].length;n!==o;n+=1)this._handlers[l][n].handler!==t&&a.push(this._handlers[l][n]);this._handlers[l]=a}this._handlers[l]&&0===this._handlers[l].length&&delete this._handlers[l]}else for(i=0,r=d.length;i!==r;i+=1)delete this._handlers[d[i]];return this},i.prototype.dispatchEvent=function(e,t){var i,r,n,o,s,a,l,d="string"==typeof e?e.split(" "):e;for(t=void 0===t?{}:t,i=0,r=d.length;i!==r;i+=1)if(l=d[i],this._handlers[l]){for(a=this.getEvent(l,t),s=[],n=0,o=this._handlers[l].length;n!==o;n+=1)this._handlers[l][n].handler(a),this._handlers[l][n].one||s.push(this._handlers[l][n]);this._handlers[l]=s}return this},i.prototype.getEvent=function(e,t){return{type:e,data:t||{},target:this}},i.extend=function(e,t){var r;for(r in i.prototype)i.prototype.hasOwnProperty(r)&&(e[r]=i.prototype[r]);i.apply(e,t)},void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.dispatcher=i):(e.exports&&(t=e.exports=i),t.dispatcher=i)}).call(this)}).call(window)},122:function(e,t,i){(function(){(function(){"use strict";var i=function(){var e,t,r={},n=Array.prototype.slice.call(arguments,0),o=function(e,t){var i,s,a,l;if(1!==arguments.length||"string"!=typeof e){if("object"==typeof e&&"string"==typeof t)return void 0!==(e||{})[t]?e[t]:o(t);for(i="object"==typeof e&&void 0===t?e:{},"string"==typeof e&&(i[e]=t),s=0,a=(l=Object.keys(i)).length;s<a;s++)r[l[s]]=i[l[s]];return this}if(void 0!==r[e])return r[e];for(s=0,a=n.length;s<a;s++)if(void 0!==n[s][e])return n[s][e]};for(o.embedObjects=function(){var e=n.concat(r).concat(Array.prototype.splice.call(arguments,0));return i.apply({},e)},e=0,t=arguments.length;e<t;e++)o(arguments[e]);return o};void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.configurable=i):(e.exports&&(t=e.exports=i),t.configurable=i)}).call(this)}).call(window)},123:function(e,t,i){(function(){(function(i){"use strict";var r=Object.create(null),n=Object.create(null),o=Object.create(null),s=Object.create(null),a=Object.create(null),l={immutable:!0,clone:!0},d=function(e){return l[e]},c=function(e){var t,i,n;for(t in n={settings:e||d,nodesArray:[],edgesArray:[],nodesIndex:Object.create(null),edgesIndex:Object.create(null),inNeighborsIndex:Object.create(null),outNeighborsIndex:Object.create(null),allNeighborsIndex:Object.create(null),inNeighborsCount:Object.create(null),outNeighborsCount:Object.create(null),allNeighborsCount:Object.create(null)},o)o[t].call(n);for(t in r)i=u(t,n,r[t]),this[t]=i,n[t]=i};function u(e,t,i){return function(){var r,n;for(r in a[e])a[e][r].apply(t,arguments);for(r in n=i.apply(t,arguments),s[e])s[e][r].apply(t,arguments);return n}}function g(e){var t;for(t in e)"hasOwnProperty"in e&&!e.hasOwnProperty(t)||delete e[t];return e}c.addMethod=function(e,t){if("string"!=typeof e||"function"!=typeof t||2!==arguments.length)throw"addMethod: Wrong arguments.";if(r[e]||c[e])throw'The method "'+e+'" already exists.';return r[e]=t,s[e]=Object.create(null),a[e]=Object.create(null),this},c.hasMethod=function(e){return!(!r[e]&&!c[e])},c.attach=function(e,t,i,r){if("string"!=typeof e||"string"!=typeof t||"function"!=typeof i||arguments.length<3||arguments.length>4)throw"attach: Wrong arguments.";var n;if("constructor"===e)n=o;else if(r){if(!a[e])throw'The method "'+e+'" does not exist.';n=a[e]}else{if(!s[e])throw'The method "'+e+'" does not exist.';n=s[e]}if(n[t])throw'A function "'+t+'" is already attached to the method "'+e+'".';return n[t]=i,this},c.attachBefore=function(e,t,i){return this.attach(e,t,i,!0)},c.addIndex=function(e,t){if("string"!=typeof e||Object(t)!==t||2!==arguments.length)throw"addIndex: Wrong arguments.";if(n[e])throw'The index "'+e+'" already exists.';var i;for(i in n[e]=t,t){if("function"!=typeof t[i])throw"The bindings must be functions.";c.attach(i,e,t[i])}return this},c.addMethod("addNode",(function(e){if(Object(e)!==e||1!==arguments.length)throw"addNode: Wrong arguments.";if("string"!=typeof e.id&&"number"!=typeof e.id)throw"The node must have a string or number id.";if(this.nodesIndex[e.id])throw'The node "'+e.id+'" already exists.';var t,i=e.id,r=Object.create(null);if(this.settings("clone"))for(t in e)"id"!==t&&(r[t]=e[t]);else r=e;return this.settings("immutable")?Object.defineProperty(r,"id",{value:i,enumerable:!0}):r.id=i,this.inNeighborsIndex[i]=Object.create(null),this.outNeighborsIndex[i]=Object.create(null),this.allNeighborsIndex[i]=Object.create(null),this.inNeighborsCount[i]=0,this.outNeighborsCount[i]=0,this.allNeighborsCount[i]=0,this.nodesArray.push(r),this.nodesIndex[r.id]=r,this})),c.addMethod("addEdge",(function(e){if(Object(e)!==e||1!==arguments.length)throw"addEdge: Wrong arguments.";if("string"!=typeof e.id&&"number"!=typeof e.id)throw"The edge must have a string or number id.";if("string"!=typeof e.source&&"number"!=typeof e.source||!this.nodesIndex[e.source])throw"The edge source must have an existing node id.";if("string"!=typeof e.target&&"number"!=typeof e.target||!this.nodesIndex[e.target])throw"The edge target must have an existing node id.";if(this.edgesIndex[e.id])throw'The edge "'+e.id+'" already exists.';var t,i=Object.create(null);if(this.settings("clone"))for(t in e)"id"!==t&&"source"!==t&&"target"!==t&&(i[t]=e[t]);else i=e;return this.settings("immutable")?(Object.defineProperty(i,"id",{value:e.id,enumerable:!0}),Object.defineProperty(i,"source",{value:e.source,enumerable:!0}),Object.defineProperty(i,"target",{value:e.target,enumerable:!0})):(i.id=e.id,i.source=e.source,i.target=e.target),this.edgesArray.push(i),this.edgesIndex[i.id]=i,this.inNeighborsIndex[i.target][i.source]||(this.inNeighborsIndex[i.target][i.source]=Object.create(null)),this.inNeighborsIndex[i.target][i.source][i.id]=i,this.outNeighborsIndex[i.source][i.target]||(this.outNeighborsIndex[i.source][i.target]=Object.create(null)),this.outNeighborsIndex[i.source][i.target][i.id]=i,this.allNeighborsIndex[i.source][i.target]||(this.allNeighborsIndex[i.source][i.target]=Object.create(null)),this.allNeighborsIndex[i.source][i.target][i.id]=i,i.target!==i.source&&(this.allNeighborsIndex[i.target][i.source]||(this.allNeighborsIndex[i.target][i.source]=Object.create(null)),this.allNeighborsIndex[i.target][i.source][i.id]=i),this.inNeighborsCount[i.target]++,this.outNeighborsCount[i.source]++,this.allNeighborsCount[i.target]++,this.allNeighborsCount[i.source]++,this})),c.addMethod("dropNode",(function(e){if("string"!=typeof e&&"number"!=typeof e||1!==arguments.length)throw"dropNode: Wrong arguments.";if(!this.nodesIndex[e])throw'The node "'+e+'" does not exist.';var t,i,r;for(delete this.nodesIndex[e],t=0,r=this.nodesArray.length;t<r;t++)if(this.nodesArray[t].id===e){this.nodesArray.splice(t,1);break}for(t=this.edgesArray.length-1;t>=0;t--)this.edgesArray[t].source!==e&&this.edgesArray[t].target!==e||this.dropEdge(this.edgesArray[t].id);for(i in delete this.inNeighborsIndex[e],delete this.outNeighborsIndex[e],delete this.allNeighborsIndex[e],delete this.inNeighborsCount[e],delete this.outNeighborsCount[e],delete this.allNeighborsCount[e],this.nodesIndex)delete this.inNeighborsIndex[i][e],delete this.outNeighborsIndex[i][e],delete this.allNeighborsIndex[i][e];return this})),c.addMethod("dropEdge",(function(e){if("string"!=typeof e&&"number"!=typeof e||1!==arguments.length)throw"dropEdge: Wrong arguments.";if(!this.edgesIndex[e])throw'The edge "'+e+'" does not exist.';var t,i,r;for(r=this.edgesIndex[e],delete this.edgesIndex[e],t=0,i=this.edgesArray.length;t<i;t++)if(this.edgesArray[t].id===e){this.edgesArray.splice(t,1);break}return delete this.inNeighborsIndex[r.target][r.source][r.id],Object.keys(this.inNeighborsIndex[r.target][r.source]).length||delete this.inNeighborsIndex[r.target][r.source],delete this.outNeighborsIndex[r.source][r.target][r.id],Object.keys(this.outNeighborsIndex[r.source][r.target]).length||delete this.outNeighborsIndex[r.source][r.target],delete this.allNeighborsIndex[r.source][r.target][r.id],Object.keys(this.allNeighborsIndex[r.source][r.target]).length||delete this.allNeighborsIndex[r.source][r.target],r.target!==r.source&&(delete this.allNeighborsIndex[r.target][r.source][r.id],Object.keys(this.allNeighborsIndex[r.target][r.source]).length||delete this.allNeighborsIndex[r.target][r.source]),this.inNeighborsCount[r.target]--,this.outNeighborsCount[r.source]--,this.allNeighborsCount[r.source]--,this.allNeighborsCount[r.target]--,this})),c.addMethod("kill",(function(){this.nodesArray.length=0,this.edgesArray.length=0,delete this.nodesArray,delete this.edgesArray,delete this.nodesIndex,delete this.edgesIndex,delete this.inNeighborsIndex,delete this.outNeighborsIndex,delete this.allNeighborsIndex,delete this.inNeighborsCount,delete this.outNeighborsCount,delete this.allNeighborsCount})),c.addMethod("clear",(function(){return this.nodesArray.length=0,this.edgesArray.length=0,g(this.nodesIndex),g(this.edgesIndex),g(this.nodesIndex),g(this.inNeighborsIndex),g(this.outNeighborsIndex),g(this.allNeighborsIndex),g(this.inNeighborsCount),g(this.outNeighborsCount),g(this.allNeighborsCount),this})),c.addMethod("read",(function(e){var t,i,r;for(t=0,r=(i=e.nodes||[]).length;t<r;t++)this.addNode(i[t]);for(t=0,r=(i=e.edges||[]).length;t<r;t++)this.addEdge(i[t]);return this})),c.addMethod("nodes",(function(e){if(!arguments.length)return this.nodesArray.slice(0);if(1===arguments.length&&("string"==typeof e||"number"==typeof e))return this.nodesIndex[e];if(1===arguments.length&&"[object Array]"===Object.prototype.toString.call(e)){var t,i,r=[];for(t=0,i=e.length;t<i;t++){if("string"!=typeof e[t]&&"number"!=typeof e[t])throw"nodes: Wrong arguments.";r.push(this.nodesIndex[e[t]])}return r}throw"nodes: Wrong arguments."})),c.addMethod("degree",(function(e,t){if(t={in:this.inNeighborsCount,out:this.outNeighborsCount}[t||""]||this.allNeighborsCount,"string"==typeof e||"number"==typeof e)return t[e];if("[object Array]"===Object.prototype.toString.call(e)){var i,r,n=[];for(i=0,r=e.length;i<r;i++){if("string"!=typeof e[i]&&"number"!=typeof e[i])throw"degree: Wrong arguments.";n.push(t[e[i]])}return n}throw"degree: Wrong arguments."})),c.addMethod("edges",(function(e){if(!arguments.length)return this.edgesArray.slice(0);if(1===arguments.length&&("string"==typeof e||"number"==typeof e))return this.edgesIndex[e];if(1===arguments.length&&"[object Array]"===Object.prototype.toString.call(e)){var t,i,r=[];for(t=0,i=e.length;t<i;t++){if("string"!=typeof e[t]&&"number"!=typeof e[t])throw"edges: Wrong arguments.";r.push(this.edgesIndex[e[t]])}return r}throw"edges: Wrong arguments."})),"undefined"!=typeof sigma?(sigma.classes=sigma.classes||Object.create(null),sigma.classes.graph=c):(e.exports&&(t=e.exports=c),t.graph=c)}).call(this)}).call(window)},124:function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.classes"),sigma.classes.camera=function(e,t,i,r){sigma.classes.dispatcher.extend(this),Object.defineProperty(this,"graph",{value:t}),Object.defineProperty(this,"id",{value:e}),Object.defineProperty(this,"readPrefix",{value:"read_cam"+e+":"}),Object.defineProperty(this,"prefix",{value:"cam"+e+":"}),this.x=0,this.y=0,this.ratio=1,this.angle=0,this.isAnimated=!1,this.settings="object"==typeof r&&r?i.embedObject(r):i},sigma.classes.camera.prototype.goTo=function(t){if(!this.settings("enableCamera"))return this;var i,r,n=t||{},o=["x","y","ratio","angle"];for(i=0,r=o.length;i<r;i++)if(n[o[i]]!==e){if("number"!=typeof n[o[i]]||isNaN(n[o[i]]))throw'Value for "'+o[i]+'" is not a number.';this[o[i]]=n[o[i]]}return this.dispatchEvent("coordinatesUpdated"),this},sigma.classes.camera.prototype.applyView=function(t,i,r){r=r||{},i=i!==e?i:this.prefix,t=t!==e?t:this.readPrefix;var n,o,s,a=r.nodes||this.graph.nodes(),l=r.edges||this.graph.edges(),d=Math.cos(this.angle)/this.ratio,c=Math.sin(this.angle)/this.ratio,u=Math.pow(this.ratio,this.settings("nodesPowRatio")),g=Math.pow(this.ratio,this.settings("edgesPowRatio")),h=(r.width||0)/2-this.x*d-this.y*c,f=(r.height||0)/2-this.y*d+this.x*c;for(n=0,o=a.length;n<o;n++)(s=a[n])[i+"x"]=(s[t+"x"]||0)*d+(s[t+"y"]||0)*c+h,s[i+"y"]=(s[t+"y"]||0)*d-(s[t+"x"]||0)*c+f,s[i+"size"]=(s[t+"size"]||0)/u;for(n=0,o=l.length;n<o;n++)l[n][i+"size"]=(l[n][t+"size"]||0)/g;return this},sigma.classes.camera.prototype.graphPosition=function(e,t,i){var r=0,n=0,o=Math.cos(this.angle),s=Math.sin(this.angle);return i||(r=-(this.x*o+this.y*s)/this.ratio,n=-(this.y*o-this.x*s)/this.ratio),{x:(e*o+t*s)/this.ratio+r,y:(t*o-e*s)/this.ratio+n}},sigma.classes.camera.prototype.cameraPosition=function(e,t,i){var r=0,n=0,o=Math.cos(this.angle),s=Math.sin(this.angle);return i||(r=-(this.x*o+this.y*s)/this.ratio,n=-(this.y*o-this.x*s)/this.ratio),{x:((e-r)*o-(t-n)*s)*this.ratio,y:((t-n)*o+(e-r)*s)*this.ratio}},sigma.classes.camera.prototype.getMatrix=function(){var e=sigma.utils.matrices.scale(1/this.ratio),t=sigma.utils.matrices.rotation(this.angle),i=sigma.utils.matrices.translation(-this.x,-this.y);return sigma.utils.matrices.multiply(i,sigma.utils.matrices.multiply(t,e))},sigma.classes.camera.prototype.getRectangle=function(e,t){var i=this.cameraPosition(e,0,!0),r=this.cameraPosition(0,t,!0),n=this.cameraPosition(e/2,t/2,!0),o=this.cameraPosition(e/4,0,!0).x,s=this.cameraPosition(0,t/4,!0).y;return{x1:this.x-n.x-o,y1:this.y-n.y-s,x2:this.x-n.x+o+i.x,y2:this.y-n.y-s+i.y,height:Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y+2*s,2))}}}).call(this)}).call(window)},125:function(e,t,i){(function(){(function(i){"use strict";var r={pointToSquare:function(e){return{x1:e.x-e.size,y1:e.y-e.size,x2:e.x+e.size,y2:e.y-e.size,height:2*e.size}},isAxisAligned:function(e){return e.x1===e.x2||e.y1===e.y2},axisAlignedTopPoints:function(e){return e.y1===e.y2&&e.x1<e.x2?e:e.x1===e.x2&&e.y2>e.y1?{x1:e.x1-e.height,y1:e.y1,x2:e.x1,y2:e.y1,height:e.height}:e.x1===e.x2&&e.y2<e.y1?{x1:e.x1,y1:e.y2,x2:e.x2+e.height,y2:e.y2,height:e.height}:{x1:e.x2,y1:e.y1-e.height,x2:e.x1,y2:e.y1-e.height,height:e.height}},lowerLeftCoor:function(e){var t=Math.sqrt(Math.pow(e.x2-e.x1,2)+Math.pow(e.y2-e.y1,2));return{x:e.x1-(e.y2-e.y1)*e.height/t,y:e.y1+(e.x2-e.x1)*e.height/t}},lowerRightCoor:function(e,t){return{x:t.x-e.x1+e.x2,y:t.y-e.y1+e.y2}},rectangleCorners:function(e){var t=this.lowerLeftCoor(e),i=this.lowerRightCoor(e,t);return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:t.x,y:t.y},{x:i.x,y:i.y}]},splitSquare:function(e){return[[{x:e.x,y:e.y},{x:e.x+e.width/2,y:e.y},{x:e.x,y:e.y+e.height/2},{x:e.x+e.width/2,y:e.y+e.height/2}],[{x:e.x+e.width/2,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width/2,y:e.y+e.height/2},{x:e.x+e.width,y:e.y+e.height/2}],[{x:e.x,y:e.y+e.height/2},{x:e.x+e.width/2,y:e.y+e.height/2},{x:e.x,y:e.y+e.height},{x:e.x+e.width/2,y:e.y+e.height}],[{x:e.x+e.width/2,y:e.y+e.height/2},{x:e.x+e.width,y:e.y+e.height/2},{x:e.x+e.width/2,y:e.y+e.height},{x:e.x+e.width,y:e.y+e.height}]]},axis:function(e,t){return[{x:e[1].x-e[0].x,y:e[1].y-e[0].y},{x:e[1].x-e[3].x,y:e[1].y-e[3].y},{x:t[0].x-t[2].x,y:t[0].y-t[2].y},{x:t[0].x-t[1].x,y:t[0].y-t[1].y}]},projection:function(e,t){var i=(e.x*t.x+e.y*t.y)/(Math.pow(t.x,2)+Math.pow(t.y,2));return{x:i*t.x,y:i*t.y}},axisCollision:function(e,t,i){for(var r=[],n=[],o=0;o<4;o++){var s=this.projection(t[o],e),a=this.projection(i[o],e);r.push(s.x*e.x+s.y*e.y),n.push(a.x*e.x+a.y*e.y)}var l=Math.max.apply(Math,r),d=Math.max.apply(Math,n),c=Math.min.apply(Math,r);return Math.min.apply(Math,n)<=l&&d>=c},collision:function(e,t){for(var i=this.axis(e,t),r=!0,n=0;n<4;n++)r=r&&this.axisCollision(i[n],e,t);return r}};function n(e,t){for(var i=[],r=0;r<4;r++)e.x2>=t[r][0].x&&e.x1<=t[r][1].x&&e.y1+e.height>=t[r][0].y&&e.y1<=t[r][2].y&&i.push(r);return i}function o(e,t){for(var i=[],n=0;n<4;n++)r.collision(e,t[n])&&i.push(n);return i}function s(e,t){var i,r,n=t.level+1,o=Math.round(t.bounds.width/2),s=Math.round(t.bounds.height/2),a=Math.round(t.bounds.x),d=Math.round(t.bounds.y);switch(e){case 0:i=a,r=d;break;case 1:i=a+o,r=d;break;case 2:i=a,r=d+s;break;case 3:i=a+o,r=d+s}return l({x:i,y:r,width:o,height:s},n,t.maxElements,t.maxLevel)}function a(e,t,r){if(r.level<r.maxLevel)for(var o=n(t,r.corners),l=0,d=o.length;l<d;l++)r.nodes[o[l]]===i&&(r.nodes[o[l]]=s(o[l],r)),a(e,t,r.nodes[o[l]]);else r.elements.push(e)}function l(e,t,i,n){return{level:t||0,bounds:e,corners:r.splitSquare(e),maxElements:i||20,maxLevel:n||4,elements:[],nodes:[]}}var d=function(){this._geom=r,this._tree=null,this._cache={query:!1,result:!1}};d.prototype.index=function(e,t){if(!t.bounds)throw"sigma.classes.quad.index: bounds information not given.";var i=t.prefix||"";this._tree=l(t.bounds,0,t.maxElements,t.maxLevel);for(var n=0,o=e.length;n<o;n++)a(e[n],r.pointToSquare({x:e[n][i+"x"],y:e[n][i+"y"],size:e[n][i+"size"]}),this._tree);return this._cache={query:!1,result:!1},this._tree},d.prototype.point=function(e,t){return this._tree&&function e(t,r){if(r.level<r.maxLevel){var n=function(e,t){var i=t.x+t.width/2,r=t.y+t.height/2,n=e.y<r,o=e.x<i;return n?o?0:1:o?2:3}(t,r.bounds);return r.nodes[n]!==i?e(t,r.nodes[n]):[]}return r.elements}({x:e,y:t},this._tree)||[]},d.prototype.area=function(e){var t,s,a=JSON.stringify(e);if(this._cache.query===a)return this._cache.result;r.isAxisAligned(e)?(t=n,s=r.axisAlignedTopPoints(e)):(t=o,s=r.rectangleCorners(e));var l=this._tree?function e(t,r,n,o){if(o=o||{},r.level<r.maxLevel)for(var s=n(t,r.corners),a=0,l=s.length;a<l;a++)r.nodes[s[a]]!==i&&e(t,r.nodes[s[a]],n,o);else for(var d=0,c=r.elements.length;d<c;d++)o[r.elements[d].id]===i&&(o[r.elements[d].id]=r.elements[d]);return o}(s,this._tree,t):[],d=[];for(var c in l)d.push(l[c]);return this._cache.query=a,this._cache.result=d,d},void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.quad=d):(e.exports&&(t=e.exports=d),t.quad=d)}).call(this)}).call(window)},126:function(e,t,i){(function(){(function(i){"use strict";var r={pointToSquare:function(e){return{x1:e.x-e.size,y1:e.y-e.size,x2:e.x+e.size,y2:e.y-e.size,height:2*e.size}},lineToSquare:function(e){return e.y1<e.y2?e.x1<e.x2?{x1:e.x1-e.size,y1:e.y1-e.size,x2:e.x2+e.size,y2:e.y1-e.size,height:e.y2-e.y1+2*e.size}:{x1:e.x2-e.size,y1:e.y1-e.size,x2:e.x1+e.size,y2:e.y1-e.size,height:e.y2-e.y1+2*e.size}:e.x1<e.x2?{x1:e.x1-e.size,y1:e.y2-e.size,x2:e.x2+e.size,y2:e.y2-e.size,height:e.y1-e.y2+2*e.size}:{x1:e.x2-e.size,y1:e.y2-e.size,x2:e.x1+e.size,y2:e.y2-e.size,height:e.y1-e.y2+2*e.size}},quadraticCurveToSquare:function(e,t){var i=sigma.utils.getPointOnQuadraticCurve(.5,e.x1,e.y1,e.x2,e.y2,t.x,t.y),r=Math.min(e.x1,e.x2,i.x),n=Math.max(e.x1,e.x2,i.x),o=Math.min(e.y1,e.y2,i.y),s=Math.max(e.y1,e.y2,i.y);return{x1:r-e.size,y1:o-e.size,x2:n+e.size,y2:o-e.size,height:s-o+2*e.size}},selfLoopToSquare:function(e){var t=sigma.utils.getSelfLoopControlPoints(e.x,e.y,e.size),i=Math.min(e.x,t.x1,t.x2),r=Math.max(e.x,t.x1,t.x2),n=Math.min(e.y,t.y1,t.y2),o=Math.max(e.y,t.y1,t.y2);return{x1:i-e.size,y1:n-e.size,x2:r+e.size,y2:n-e.size,height:o-n+2*e.size}},isAxisAligned:function(e){return e.x1===e.x2||e.y1===e.y2},axisAlignedTopPoints:function(e){return e.y1===e.y2&&e.x1<e.x2?e:e.x1===e.x2&&e.y2>e.y1?{x1:e.x1-e.height,y1:e.y1,x2:e.x1,y2:e.y1,height:e.height}:e.x1===e.x2&&e.y2<e.y1?{x1:e.x1,y1:e.y2,x2:e.x2+e.height,y2:e.y2,height:e.height}:{x1:e.x2,y1:e.y1-e.height,x2:e.x1,y2:e.y1-e.height,height:e.height}},lowerLeftCoor:function(e){var t=Math.sqrt(Math.pow(e.x2-e.x1,2)+Math.pow(e.y2-e.y1,2));return{x:e.x1-(e.y2-e.y1)*e.height/t,y:e.y1+(e.x2-e.x1)*e.height/t}},lowerRightCoor:function(e,t){return{x:t.x-e.x1+e.x2,y:t.y-e.y1+e.y2}},rectangleCorners:function(e){var t=this.lowerLeftCoor(e),i=this.lowerRightCoor(e,t);return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:t.x,y:t.y},{x:i.x,y:i.y}]},splitSquare:function(e){return[[{x:e.x,y:e.y},{x:e.x+e.width/2,y:e.y},{x:e.x,y:e.y+e.height/2},{x:e.x+e.width/2,y:e.y+e.height/2}],[{x:e.x+e.width/2,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width/2,y:e.y+e.height/2},{x:e.x+e.width,y:e.y+e.height/2}],[{x:e.x,y:e.y+e.height/2},{x:e.x+e.width/2,y:e.y+e.height/2},{x:e.x,y:e.y+e.height},{x:e.x+e.width/2,y:e.y+e.height}],[{x:e.x+e.width/2,y:e.y+e.height/2},{x:e.x+e.width,y:e.y+e.height/2},{x:e.x+e.width/2,y:e.y+e.height},{x:e.x+e.width,y:e.y+e.height}]]},axis:function(e,t){return[{x:e[1].x-e[0].x,y:e[1].y-e[0].y},{x:e[1].x-e[3].x,y:e[1].y-e[3].y},{x:t[0].x-t[2].x,y:t[0].y-t[2].y},{x:t[0].x-t[1].x,y:t[0].y-t[1].y}]},projection:function(e,t){var i=(e.x*t.x+e.y*t.y)/(Math.pow(t.x,2)+Math.pow(t.y,2));return{x:i*t.x,y:i*t.y}},axisCollision:function(e,t,i){for(var r=[],n=[],o=0;o<4;o++){var s=this.projection(t[o],e),a=this.projection(i[o],e);r.push(s.x*e.x+s.y*e.y),n.push(a.x*e.x+a.y*e.y)}var l=Math.max.apply(Math,r),d=Math.max.apply(Math,n),c=Math.min.apply(Math,r);return Math.min.apply(Math,n)<=l&&d>=c},collision:function(e,t){for(var i=this.axis(e,t),r=!0,n=0;n<4;n++)r=r&&this.axisCollision(i[n],e,t);return r}};function n(e,t){for(var i=[],r=0;r<4;r++)e.x2>=t[r][0].x&&e.x1<=t[r][1].x&&e.y1+e.height>=t[r][0].y&&e.y1<=t[r][2].y&&i.push(r);return i}function o(e,t){for(var i=[],n=0;n<4;n++)r.collision(e,t[n])&&i.push(n);return i}function s(e,t){var i,r,n=t.level+1,o=Math.round(t.bounds.width/2),s=Math.round(t.bounds.height/2),a=Math.round(t.bounds.x),d=Math.round(t.bounds.y);switch(e){case 0:i=a,r=d;break;case 1:i=a+o,r=d;break;case 2:i=a,r=d+s;break;case 3:i=a+o,r=d+s}return l({x:i,y:r,width:o,height:s},n,t.maxElements,t.maxLevel)}function a(e,t,r){if(r.level<r.maxLevel)for(var o=n(t,r.corners),l=0,d=o.length;l<d;l++)r.nodes[o[l]]===i&&(r.nodes[o[l]]=s(o[l],r)),a(e,t,r.nodes[o[l]]);else r.elements.push(e)}function l(e,t,i,n){return{level:t||0,bounds:e,corners:r.splitSquare(e),maxElements:i||40,maxLevel:n||8,elements:[],nodes:[]}}var d=function(){this._geom=r,this._tree=null,this._cache={query:!1,result:!1},this._enabled=!0};d.prototype.index=function(e,t){if(!this._enabled)return this._tree;if(!t.bounds)throw"sigma.classes.edgequad.index: bounds information not given.";var i,n,o,s,d,c=t.prefix||"";this._tree=l(t.bounds,0,t.maxElements,t.maxLevel);for(var u=e.edges(),g=0,h=u.length;g<h;g++)n=e.nodes(u[g].source),o=e.nodes(u[g].target),d={x1:n[c+"x"],y1:n[c+"y"],x2:o[c+"x"],y2:o[c+"y"],size:u[g][c+"size"]||0},"curve"===u[g].type||"curvedArrow"===u[g].type?n.id===o.id?(s={x:n[c+"x"],y:n[c+"y"],size:n[c+"size"]||0},a(u[g],r.selfLoopToSquare(s),this._tree)):(i=sigma.utils.getQuadraticControlPoint(d.x1,d.y1,d.x2,d.y2),a(u[g],r.quadraticCurveToSquare(d,i),this._tree)):a(u[g],r.lineToSquare(d),this._tree);return this._cache={query:!1,result:!1},this._tree},d.prototype.point=function(e,t){return this._enabled&&this._tree&&function e(t,r){if(r.level<r.maxLevel){var n=function(e,t){var i=t.x+t.width/2,r=t.y+t.height/2,n=e.y<r,o=e.x<i;return n?o?0:1:o?2:3}(t,r.bounds);return r.nodes[n]!==i?e(t,r.nodes[n]):[]}return r.elements}({x:e,y:t},this._tree)||[]},d.prototype.area=function(e){if(!this._enabled)return[];var t,s,a=JSON.stringify(e);if(this._cache.query===a)return this._cache.result;r.isAxisAligned(e)?(t=n,s=r.axisAlignedTopPoints(e)):(t=o,s=r.rectangleCorners(e));var l=this._tree?function e(t,r,n,o){if(o=o||{},r.level<r.maxLevel)for(var s=n(t,r.corners),a=0,l=s.length;a<l;a++)r.nodes[s[a]]!==i&&e(t,r.nodes[s[a]],n,o);else for(var d=0,c=r.elements.length;d<c;d++)o[r.elements[d].id]===i&&(o[r.elements[d].id]=r.elements[d]);return o}(s,this._tree,t):[],d=[];for(var c in l)d.push(l[c]);return this._cache.query=a,this._cache.result=d,d},void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.edgequad=d):(e.exports&&(t=e.exports=d),t.edgequad=d)}).call(this)}).call(window)},127:function(e,t){(function(){(function(e){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.captors"),sigma.captors.mouse=function(e,t,i){var r,n,o,s,a,l,d,c,u,g,h,f=this,p=e,m=t,y=i;function v(e){var t,i,g;if(y("mouseEnabled")&&(f.dispatchEvent("mousemove",sigma.utils.mouseCoords(e)),d))return c=!0,u=!0,h&&clearTimeout(h),h=setTimeout((function(){c=!1}),y("dragTimeout")),sigma.misc.animation.killAll(m),m.isMoving=!0,g=m.cameraPosition(sigma.utils.getX(e)-a,sigma.utils.getY(e)-l,!0),t=r-g.x,i=n-g.y,t===m.x&&i===m.y||(o=m.x,s=m.y,m.goTo({x:t,y:i})),e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}function b(e){if(y("mouseEnabled")&&d){d=!1,h&&clearTimeout(h),m.isMoving=!1;var t=sigma.utils.getX(e),i=sigma.utils.getY(e);c?(sigma.misc.animation.killAll(m),sigma.misc.animation.camera(m,{x:m.x+y("mouseInertiaRatio")*(m.x-o),y:m.y+y("mouseInertiaRatio")*(m.y-s)},{easing:"quadraticOut",duration:y("mouseInertiaDurati