vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
388 KiB

  1. /**
  2. * vis.js
  3. * https://github.com/almende/vis
  4. *
  5. * A dynamic, browser-based visualization library.
  6. *
  7. * @version 4.16.0
  8. * @date 2016-04-07
  9. *
  10. * @license
  11. * Copyright (C) 2011-2016 Almende B.V, http://almende.com
  12. *
  13. * Vis.js is dual licensed under both
  14. *
  15. * * The Apache 2.0 License
  16. * http://www.apache.org/licenses/LICENSE-2.0
  17. *
  18. * and
  19. *
  20. * * The MIT License
  21. * http://opensource.org/licenses/MIT
  22. *
  23. * Vis.js may be distributed under either license.
  24. */
  25. "use strict";!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vis=t():e.vis=t()}(this,function(){return function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){t.util=i(1),t.DOMutil=i(7),t.DataSet=i(8),t.DataView=i(10),t.Queue=i(9),t.Network=i(11),t.network={Images:i(12),dotparser:i(77),gephiParser:i(78),allOptions:i(72)},t.network.convertDot=function(e){return t.network.dotparser.DOTToGraph(e)},t.network.convertGephi=function(e,i){return t.network.gephiParser.parseGephi(e,i)},t.moment=i(2),t.Hammer=i(58),t.keycharm=i(65)},function(e,t,i){var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=i(2),s=i(6);t.isNumber=function(e){return e instanceof Number||"number"==typeof e},t.recursiveDOMDelete=function(e){if(e)for(;e.hasChildNodes()===!0;)t.recursiveDOMDelete(e.firstChild),e.removeChild(e.firstChild)},t.giveRange=function(e,t,i,o){if(t==e)return.5;var n=1/(t-e);return Math.max(0,(o-e)*n)},t.isString=function(e){return e instanceof String||"string"==typeof e},t.isDate=function(e){if(e instanceof Date)return!0;if(t.isString(e)){var i=r.exec(e);if(i)return!0;if(!isNaN(Date.parse(e)))return!0}return!1},t.randomUUID=function(){return s.v4()},t.assignAllKeys=function(e,t){for(var i in e)e.hasOwnProperty(i)&&"object"!==o(e[i])&&(e[i]=t)},t.fillIfDefined=function(e,i){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];for(var s in e)void 0!==i[s]&&("object"!==o(i[s])?void 0!==i[s]&&null!==i[s]||void 0===e[s]||n!==!0?e[s]=i[s]:delete e[s]:"object"===o(e[s])&&t.fillIfDefined(e[s],i[s],n))},t.protoExtend=function(e,t){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)e[n]=o[n]}return e},t.extend=function(e,t){for(var i=1;i<arguments.length;i++){var o=arguments[i];for(var n in o)o.hasOwnProperty(n)&&(e[n]=o[n])}return e},t.selectiveExtend=function(e,t,i){if(!Array.isArray(e))throw new Error("Array with property names expected as first argument");for(var o=2;o<arguments.length;o++)for(var n=arguments[o],s=0;s<e.length;s++){var r=e[s];n.hasOwnProperty(r)&&(t[r]=n[r])}return t},t.selectiveDeepExtend=function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s=2;s<arguments.length;s++)for(var r=arguments[s],a=0;a<e.length;a++){var h=e[a];if(r.hasOwnProperty(h))if(o[h]&&o[h].constructor===Object)void 0===i[h]&&(i[h]={}),i[h].constructor===Object?t.deepExtend(i[h],o[h],!1,n):null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h];else{if(Array.isArray(o[h]))throw new TypeError("Arrays are not supported by deepExtend");null===o[h]&&void 0!==i[h]&&n===!0?delete i[h]:i[h]=o[h]}}return i},t.selectiveNotDeepExtend=function(e,i,o){var n=arguments.length<=3||void 0===arguments[3]?!1:arguments[3];if(Array.isArray(o))throw new TypeError("Arrays are not supported by deepExtend");for(var s in o)if(o.hasOwnProperty(s)&&-1==e.indexOf(s))if(o[s]&&o[s].constructor===Object)void 0===i[s]&&(i[s]={}),i[s].constructor===Object?t.deepExtend(i[s],o[s]):null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];else if(Array.isArray(o[s])){i[s]=[];for(var r=0;r<o[s].length;r++)i[s].push(o[s][r])}else null===o[s]&&void 0!==i[s]&&n===!0?delete i[s]:i[s]=o[s];return i},t.deepExtend=function(e,i,o,n){for(var s in i)if(i.hasOwnProperty(s)||o===!0)if(i[s]&&i[s].constructor===Object)void 0===e[s]&&(e[s]={}),e[s].constructor===Object?t.deepExtend(e[s],i[s],o):null===i[s]&&void 0!==e[s]&&n===!0?delete e[s]:e[s]=i[s];else if(Array.isArray(i[s])){e[s]=[];for(var r=0;r<i[s].length;r++)e[s].push(i[s][r])}else null===i[s]&&void 0!==e[s]&&n===!0?delete e[s]:e[s]=i[s];return e},t.equalArray=function(e,t){if(e.length!=t.length)re
  26. a&&re(e,H(e,"Month")+a*o),n&&t.updateOffset(e,r||a))}function lt(e,t){var i=e||Ne(),o=Ue(i,this).startOf("day"),n=this.diff(o,"days",!0),s=-6>n?"sameElse":-1>n?"lastWeek":0>n?"lastDay":1>n?"sameDay":2>n?"nextDay":7>n?"nextWeek":"sameElse",r=t&&(x(t[s])?t[s]():t[s]);return this.format(r||this.localeData().calendar(s,this,Ne(i)))}function ct(){return new v(this)}function ut(e,t){var i=y(e)?e:Ne(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?+this>+i:+i<+this.clone().startOf(t)):!1}function ft(e,t){var i=y(e)?e:Ne(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?+i>+this:+this.clone().endOf(t)<+i):!1}function pt(e,t,i){return this.isAfter(e,i)&&this.isBefore(t,i)}function vt(e,t){var i,o=y(e)?e:Ne(e);return this.isValid()&&o.isValid()?(t=z(t||"millisecond"),"millisecond"===t?+this===+o:(i=+o,+this.clone().startOf(t)<=i&&i<=+this.clone().endOf(t))):!1}function yt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function gt(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function bt(e,t,i){var o,n,s,r;return this.isValid()?(o=Ue(e,this),o.isValid()?(n=6e4*(o.utcOffset()-this.utcOffset()),t=z(t),"year"===t||"month"===t||"quarter"===t?(r=mt(this,o),"quarter"===t?r/=3:"year"===t&&(r/=12)):(s=this-o,r="second"===t?s/1e3:"minute"===t?s/6e4:"hour"===t?s/36e5:"day"===t?(s-n)/864e5:"week"===t?(s-n)/6048e5:s),i?r:g(r)):NaN):NaN}function mt(e,t){var i,o,n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return 0>t-s?(i=e.clone().add(n-1,"months"),o=(t-s)/(s-i)):(i=e.clone().add(n+1,"months"),o=(t-s)/(i-s)),-(n+o)}function _t(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function wt(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?x(Date.prototype.toISOString)?this.toDate().toISOString():G(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):G(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function kt(e){var i=G(this,e||t.defaultFormat);return this.localeData().postformat(i)}function xt(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ne(e).isValid())?ot({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Ot(e){return this.from(Ne(),e)}function Et(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ne(e).isValid())?ot({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Mt(e){return this.to(Ne(),e)}function Dt(e){var t;return void 0===e?this._locale._abbr:(t=I(e),null!=t&&(this._locale=t),this)}function St(){return this._locale}function Ct(e){switch(e=z(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Tt(e){return e=z(e),void 0===e||"millisecond"===e?this:this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms")}function Pt(){return+this._d-6e4*(this._offset||0)}function Bt(){return Math.floor(+this/1e3)}function Ft(){return this._offset?new Date(+this):this._d}function It(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function jt(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Nt(){return this.isValid()?this.toISOString():null}function zt(){return c(this)}function Rt(){return a({},l(this))}function At(){return l(this).overflow}function Ht(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Lt(e,t){U(0,[e,e.length],0,t)}function Wt(e){return qt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Yt(e){return qt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Ut(){return xe(this.year(),1,4)}function Vt(){var e=this.localeData()._week;return xe(this.year(),e.dow,e.doy)}function qt(e,t
  27. if(t&&t.order){var l=this.get(t);for(i=0,o=l.length;o>i;i++)n=l[i],s=n[this._fieldId],e(n,s)}else for(i=0,o=d.length;o>i;i++)s=d[i],n=this._getItem(s,a),r&&!r(n)||e(n,s)},o.prototype.map=function(e,t){var i,o,n,s,r=t&&t.filter,a=t&&t.type||this._options.type,h=[],d=this._data,l=Object.keys(d);for(i=0,o=l.length;o>i;i++)n=l[i],s=this._getItem(n,a),r&&!r(s)||h.push(e(s,n));return t&&t.order&&this._sort(h,t.order),h},o.prototype._filterFields=function(e,t){if(!e)return e;var i,o,n={},s=Object.keys(e),r=s.length;if(Array.isArray(t))for(i=0;r>i;i++)o=s[i],-1!=t.indexOf(o)&&(n[o]=e[o]);else for(i=0;r>i;i++)o=s[i],t.hasOwnProperty(o)&&(n[t[o]]=e[o]);return n},o.prototype._sort=function(e,t){if(s.isString(t)){var i=t;e.sort(function(e,t){var o=e[i],n=t[i];return o>n?1:n>o?-1:0})}else{if("function"!=typeof t)throw new TypeError("Order must be a function or a string");e.sort(t)}},o.prototype.remove=function(e,t){var i,o,n,s=[];if(Array.isArray(e))for(i=0,o=e.length;o>i;i++)n=this._remove(e[i]),null!=n&&s.push(n);else n=this._remove(e),null!=n&&s.push(n);return s.length&&this._trigger("remove",{items:s},t),s},o.prototype._remove=function(e){if(s.isNumber(e)||s.isString(e)){if(this._data[e])return delete this._data[e],this.length--,e}else if(e instanceof Object){var t=e[this._fieldId];if(void 0!==t&&this._data[t])return delete this._data[t],this.length--,t}return null},o.prototype.clear=function(e){var t=Object.keys(this._data);return this._data={},this.length=0,this._trigger("remove",{items:t},e),t},o.prototype.max=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||d>r)&&(s=h,r=d)}return s},o.prototype.min=function(e){var t,i,o=this._data,n=Object.keys(o),s=null,r=null;for(t=0,i=n.length;i>t;t++){var a=n[t],h=o[a],d=h[e];null!=d&&(!s||r>d)&&(s=h,r=d)}return s},o.prototype.distinct=function(e){var t,i,o,n=this._data,r=Object.keys(n),a=[],h=this._options.type&&this._options.type[e]||null,d=0;for(t=0,o=r.length;o>t;t++){var l=r[t],c=n[l],u=c[e],f=!1;for(i=0;d>i;i++)if(a[i]==u){f=!0;break}f||void 0===u||(a[d]=u,d++)}if(h)for(t=0,o=a.length;o>t;t++)a[t]=s.convert(a[t],h);return a},o.prototype._addItem=function(e){var t=e[this._fieldId];if(void 0!=t){if(this._data[t])throw new Error("Cannot add item: item with id "+t+" already exists")}else t=s.randomUUID(),e[this._fieldId]=t;var i,o,n={},r=Object.keys(e);for(i=0,o=r.length;o>i;i++){var a=r[i],h=this._type[a];n[a]=s.convert(e[a],h)}return this._data[t]=n,this.length++,t},o.prototype._getItem=function(e,t){var i,o,n,r,a=this._data[e];if(!a)return null;var h={},d=Object.keys(a);if(t)for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=s.convert(o,t[i]);else for(n=0,r=d.length;r>n;n++)i=d[n],o=a[i],h[i]=o;return h},o.prototype._updateItem=function(e){var t=e[this._fieldId];if(void 0==t)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(e)+")");var i=this._data[t];if(!i)throw new Error("Cannot update item: no item with id "+t+" found");for(var o=Object.keys(e),n=0,r=o.length;r>n;n++){var a=o[n],h=this._type[a];i[a]=s.convert(e[a],h)}return t},e.exports=o},function(e,t){function i(e){this.delay=null,this.max=1/0,this._queue=[],this._timeout=null,this._extended=null,this.setOptions(e)}i.prototype.setOptions=function(e){e&&"undefined"!=typeof e.delay&&(this.delay=e.delay),e&&"undefined"!=typeof e.max&&(this.max=e.max),this._flushIfNeeded()},i.extend=function(e,t){var o=new i(t);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){o.flush()};var n=[{name:"flush",original:void 0}];if(t&&t.replace)for(var s=0;s<t.replace.length;s++){var r=t.replace[s];n.push({name:r,original:e[r]}),o.replace(e,r)}return o._extended={object:e,methods:n},o},i.prototype.destroy=function(){if(this.flush(),this._extended){for(var e=this._extended.object,t=this._extended.methods,i=0;i<t.length;i++){var o=t[i];o.original?e[o.name]=o.original:delete e[o.name]}this._extended=null}},i.prototype.replace=function(e,t){var i=this,o=e[t];if(!o)throw new Error("Method "+t+" undefined"
  28. }Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),r=i(16),a=o(r),h=i(17),d=o(h),l=i(19),c=o(l),u=i(21),f=o(u),p=i(22),v=o(p),y=i(23),g=o(y),b=i(25),m=o(b),_=i(26),w=o(_),k=i(27),x=o(k),O=i(28),E=o(O),M=i(29),D=o(M),S=i(30),C=o(S),T=i(31),P=o(T),B=i(32),F=o(B),I=i(33),j=o(I),N=i(34),z=(o(N),i(1)),R=function(){function e(t,i,o,s,r){n(this,e),this.options=z.bridgeObject(r),this.globalOptions=r,this.body=i,this.edges=[],this.id=void 0,this.imagelist=o,this.grouplist=s,this.x=void 0,this.y=void 0,this.baseSize=this.options.size,this.baseFontSize=this.options.font.size,this.predefinedPosition=!1,this.selected=!1,this.hover=!1,this.labelModule=new a["default"](this.body,this.options,!1),this.setOptions(t)}return s(e,[{key:"attachEdge",value:function(e){-1===this.edges.indexOf(e)&&this.edges.push(e)}},{key:"detachEdge",value:function(e){var t=this.edges.indexOf(e);-1!=t&&this.edges.splice(t,1)}},{key:"setOptions",value:function(t){var i=this.options.shape;if(t){if(void 0!==t.id&&(this.id=t.id),void 0===this.id)throw"Node must have an id";if(void 0!==t.x&&(null===t.x?(this.x=void 0,this.predefinedPosition=!1):(this.x=parseInt(t.x),this.predefinedPosition=!0)),void 0!==t.y&&(null===t.y?(this.y=void 0,this.predefinedPosition=!1):(this.y=parseInt(t.y),this.predefinedPosition=!0)),void 0!==t.size&&(this.baseSize=t.size),void 0!==t.value&&(t.value=parseFloat(t.value)),"number"==typeof t.group||"string"==typeof t.group&&""!=t.group){var o=this.grouplist.get(t.group);z.deepExtend(this.options,o),this.options.color=z.parseColor(this.options.color)}if(e.parseOptions(this.options,t,!0,this.globalOptions),void 0!==this.options.image){if(!this.imagelist)throw"No imagelist provided";this.imageObj=this.imagelist.load(this.options.image,this.options.brokenImage,this.id)}return this.updateLabelModule(),this.updateShape(i),void 0!==t.hidden||void 0!==t.physics}}},{key:"updateLabelModule",value:function(){void 0!==this.options.label&&null!==this.options.label||(this.options.label=""),this.labelModule.setOptions(this.options,!0),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateShape",value:function(e){if(e===this.options.shape&&this.shape)this.shape.setOptions(this.options,this.imageObj);else switch(this.options.shape){case"box":this.shape=new d["default"](this.options,this.body,this.labelModule);break;case"circle":this.shape=new c["default"](this.options,this.body,this.labelModule);break;case"circularImage":this.shape=new f["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"database":this.shape=new v["default"](this.options,this.body,this.labelModule);break;case"diamond":this.shape=new g["default"](this.options,this.body,this.labelModule);break;case"dot":this.shape=new m["default"](this.options,this.body,this.labelModule);break;case"ellipse":this.shape=new w["default"](this.options,this.body,this.labelModule);break;case"icon":this.shape=new x["default"](this.options,this.body,this.labelModule);break;case"image":this.shape=new E["default"](this.options,this.body,this.labelModule,this.imageObj);break;case"square":this.shape=new D["default"](this.options,this.body,this.labelModule);break;case"star":this.shape=new C["default"](this.options,this.body,this.labelModule);break;case"text":this.shape=new P["default"](this.options,this.body,this.labelModule);break;case"triangle":this.shape=new F["default"](this.options,this.body,this.labelModule);break;case"triangleDown":this.shape=new j["default"](this.options,this.body,this.labelModule);break;default:this.shape=new w["default"](this.options,this.body,this.labelModule)}this._reset()}},{key:"select",value:function(){this.selected=!0,this._reset()}},{key:"unselect",value:function(){this.selected=!1,this._reset()}},{key:"_reset",value:function(){this.shape.width=void 0,this.shape.height=void 0
  29. "value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(24),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e){this._resizeShape()}},{key:"draw",value:function(e,t,i,o,n){this._drawShape(e,"circle",2,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this.resize(e),this.options.size}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 r(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 i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}return r(t,e),a(t,[{key:"resize",value:function(e,t){if(void 0===this.width){var i=this.labelModule.getTextSize(e,t);this.width=1.5*i.width,this.height=2*i.height,this.width<this.height&&(this.width=this.height),this.radius=.5*this.width}}},{key:"draw",value:function(e,t,i,o,n){this.resize(e,o),this.left=t-.5*this.width,this.top=i-.5*this.height;var s=this.options.borderWidth,r=this.options.borderWidthSelected||2*this.options.borderWidth,a=(o?r:s)/this.body.view.scale;e.lineWidth=Math.min(this.width,a),e.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,e.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,e.ellipse(this.left,this.top,this.width,this.height),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),a>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),this.updateBoundingBox(t,i,e,o),this.labelModule.draw(e,t,i,o)}},{key:"updateBoundingBox",value:function(e,t,i,o){this.resize(i,o),this.left=e-.5*this.width,this.top=t-.5*this.height,this.boundingBox.left=this.left,this.boundingBox.top=this.top,this.boundingBox.bottom=this.top+this.height,this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){this.resize(e);var i=.5*this.width,o=.5*this.height,n=Math.sin(t)*i,s=Math.cos(t)*o;return i*o/Math.sqrt(n*n+s*s)}}]),t}(d["default"]);t["default"]=l},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 r(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 i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),h=i(18),d=o(h),l=function(e){function t(e,i,o){return n(this,t),s(this,Object.getPrototypeOf(t).call(this,e,i,o))}re
  30. return t>h}return!1}},{key:"_rotateForLabelAlignment",value:function(e){var t=this.from.y-this.to.y,i=this.from.x-this.to.x,o=Math.atan2(t,i);(-1>o&&0>i||o>0&&0>i)&&(o+=Math.PI),e.rotate(o)}},{key:"_pointOnCircle",value:function(e,t,i,o){var n=2*o*Math.PI;return{x:e+i*Math.cos(n),y:t-i*Math.sin(n)}}},{key:"select",value:function(){this.selected=!0}},{key:"unselect",value:function(){this.selected=!1}},{key:"cleanup",value:function(){return this.edgeType.cleanup()}}],[{key:"parseOptions",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],o=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],n=["arrowStrikethrough","id","from","hidden","hoverWidth","label","labelHighlightBold","length","line","opacity","physics","scaling","selectionWidth","selfReferenceSize","to","title","value","width"];if(g.selectiveDeepExtend(n,e,t,i),g.mergeOptions(e,t,"smooth",i,o),g.mergeOptions(e,t,"shadow",i,o),void 0!==t.dashes&&null!==t.dashes?e.dashes=t.dashes:i===!0&&null===t.dashes&&(e.dashes=Object.create(o.dashes)),void 0!==t.scaling&&null!==t.scaling?(void 0!==t.scaling.min&&(e.scaling.min=t.scaling.min),void 0!==t.scaling.max&&(e.scaling.max=t.scaling.max),g.mergeOptions(e.scaling,t.scaling,"label",i,o.scaling)):i===!0&&null===t.scaling&&(e.scaling=Object.create(o.scaling)),void 0!==t.arrows&&null!==t.arrows)if("string"==typeof t.arrows){var r=t.arrows.toLowerCase();-1!=r.indexOf("to")&&(e.arrows.to.enabled=!0),-1!=r.indexOf("middle")&&(e.arrows.middle.enabled=!0),-1!=r.indexOf("from")&&(e.arrows.from.enabled=!0)}else{if("object"!==s(t.arrows))throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:"+JSON.stringify(t.arrows));g.mergeOptions(e.arrows,t.arrows,"to",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"middle",i,o.arrows),g.mergeOptions(e.arrows,t.arrows,"from",i,o.arrows)}else i===!0&&null===t.arrows&&(e.arrows=Object.create(o.arrows));if(void 0!==t.color&&null!==t.color)if(e.color=g.deepExtend({},e.color,!0),g.isString(t.color))e.color.color=t.color,e.color.highlight=t.color,e.color.hover=t.color,e.color.inherit=!1;else{var a=!1;void 0!==t.color.color&&(e.color.color=t.color.color,a=!0),void 0!==t.color.highlight&&(e.color.highlight=t.color.highlight,a=!0),void 0!==t.color.hover&&(e.color.hover=t.color.hover,a=!0),void 0!==t.color.inherit&&(e.color.inherit=t.color.inherit),void 0!==t.color.opacity&&(e.color.opacity=Math.min(1,Math.max(0,t.color.opacity))),void 0===t.color.inherit&&a===!0&&(e.color.inherit=!1)}else i===!0&&null===t.color&&(e.color=g.bridgeObject(o.color));void 0!==t.font&&null!==t.font?h["default"].parseOptions(e.font,t):i===!0&&null===t.font&&(e.font=g.bridgeObject(o.font))}}]),e}();t["default"]=b},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 r(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){var i=[],o=!0,n=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(o=(r=a.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(h){n=!0,s=h}finally{try{!o&&a["return"]&&a["return"]()}finally{if(n)throw s}}return i}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i
  31. this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];this.stabilized=!0,e===!0&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,e===!0&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var e=Date.now();this.physicsTick();var t=Date.now()-e;(t<.4*this.simulationInterval||this.runDoubleSpeed===!0)&&this.stabilized===!1&&(this.physicsTick(),this.runDoubleSpeed=!0),this.stabilized===!0&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.stabilizationIterations:arguments[0];(this.stabilizationIterations>1||this.startedStabilization===!0)&&setTimeout(function(){e.body.emitter.emit("stabilized",{iterations:t}),e.startedStabilization=!1,e.stabilizationIterations=0},0)}},{key:"physicsTick",value:function(){if(this.startedStabilization===!1&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0),this.stabilized===!1){if(this.adaptiveTimestep===!0&&this.adaptiveTimestepEnabled===!0){var e=1.2;this.adaptiveCounter%this.adaptiveInterval===0?(this.timestep=2*this.timestep,this.calculateForces(),this.moveNodes(),this.revert(),this.timestep=.5*this.timestep,this.calculateForces(),this.moveNodes(),this.calculateForces(),this.moveNodes(),this._evaluateStepQuality()===!0?this.timestep=e*this.timestep:this.timestep/e<this.options.timestep?this.timestep=this.options.timestep:(this.adaptiveCounter=-1,this.timestep=Math.max(this.options.timestep,this.timestep/e))):(this.calculateForces(),this.moveNodes()),this.adaptiveCounter+=1}else this.timestep=this.options.timestep,this.calculateForces(),this.moveNodes();this.stabilized===!0&&this.revert(),this.stabilizationIterations++}}},{key:"updatePhysicsData",value:function(){this.physicsBody.forces={},this.physicsBody.physicsNodeIndices=[],this.physicsBody.physicsEdgeIndices=[];var e=this.body.nodes,t=this.body.edges;for(var i in e)e.hasOwnProperty(i)&&e[i].options.physics===!0&&this.physicsBody.physicsNodeIndices.push(e[i].id);for(var o in t)t.hasOwnProperty(o)&&t[o].options.physics===!0&&this.physicsBody.physicsEdgeIndices.push(t[o].id);for(var n=0;n<this.physicsBody.physicsNodeIndices.length;n++){var s=this.physicsBody.physicsNodeIndices[n];this.physicsBody.forces[s]={x:0,y:0},void 0===this.physicsBody.velocities[s]&&(this.physicsBody.velocities[s]={x:0,y:0})}for(var r in this.physicsBody.velocities)void 0===e[r]&&delete this.physicsBody.velocities[r]}},{key:"revert",value:function(){var e=Object.keys(this.previousStates),t=this.body.nodes,i=this.physicsBody.velocities;this.referenceState={};for(var o=0;o<e.length;o++){var n=e[o];void 0!==t[n]?t[n].options.physics===!0&&(this.referenceState[n]={positions:{x:t[n].x,y:t[n].y}},i[n].x=this.previousStates[n].vx,i[n].y=this.previousStates[n].vy,t[n].x=this.previousStates[n].x,t[n].y=this.previousStates[n].y):delete this.previousStates[n]}}},{key:"_evaluateStepQuality",value:function(){var e=void 0,t=void 0,i=void 0,o=this.body.nodes,n=this.referenceState,s=.3;for(var r in this.referenceState)if(this.referenceState.hasOwnProperty(r)&&void 0!==o[r]&&(e=o[r].x-n[r].positions.x,t=o[r].y-n[r].positions.y,i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),i>s))return!1;return!0}},{key:"moveNodes",value:function(){for(var e=this.physicsBody.physicsNodeIndices,t=this.options.maxVelocity?this.options.maxVelocity:1e9,i=0,o=0,n=5,s=0;s<e.length;s++){var r=e[s],a=this._performStep(r,t);i=Math.max(i,a),o+=a}this.adaptiveTimestepEnabled=o/e.length<n,this.stabilized=i<this.options.minVelocity}},{key:"_performStep",value:function(e,t){var i=this.body.nodes[e],o=this.timestep,n=this.physicsBody.forces,s=this.physicsBody.velocities;if(this.previousStates[e]={x:i.x,y:i.y,vx:s[e]
  32. e=this.clusteredNodes[e].clusterId,o++;return t.push(this.body.nodes[e].id),t.reverse(),t}},{key:"_getConnectedId",value:function(e,t){return e.toId!=t?e.toId:e.fromId!=t?e.fromId:e.fromId}},{key:"_getHubSize",value:function(){for(var e=0,t=0,i=0,o=0,n=0;n<this.body.nodeIndices.length;n++){var s=this.body.nodes[this.body.nodeIndices[n]];s.edges.length>o&&(o=s.edges.length),e+=s.edges.length,t+=Math.pow(s.edges.length,2),i+=1}e/=i,t/=i;var r=t-Math.pow(e,2),a=Math.sqrt(r),h=Math.floor(e+2*a);return h>o&&(h=o),h}}]),e}();t["default"]=u},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),s=i(1),r=function(){function e(){o(this,e)}return n(e,null,[{key:"getRange",value:function(e){var t,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.shape.boundingBox.left&&(s=t.shape.boundingBox.left),r<t.shape.boundingBox.right&&(r=t.shape.boundingBox.right),o>t.shape.boundingBox.top&&(o=t.shape.boundingBox.top),n<t.shape.boundingBox.bottom&&(n=t.shape.boundingBox.bottom);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{key:"getRangeCore",value:function(e){var t,i=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],o=1e9,n=-1e9,s=1e9,r=-1e9;if(i.length>0)for(var a=0;a<i.length;a++)t=e[i[a]],s>t.x&&(s=t.x),r<t.x&&(r=t.x),o>t.y&&(o=t.y),n<t.y&&(n=t.y);return 1e9===s&&-1e9===r&&1e9===o&&-1e9===n&&(o=0,n=0,s=0,r=0),{minX:s,maxX:r,minY:o,maxY:n}}},{key:"findCenter",value:function(e){return{x:.5*(e.maxX+e.minX),y:.5*(e.maxY+e.minY)}}},{key:"cloneOptions",value:function(e,t){var i={};return void 0===t||"node"===t?(s.deepExtend(i,e.options,!0),i.x=e.x,i.y=e.y,i.amountOfConnections=e.edges.length):s.deepExtend(i,e.options,!0),i}}]),e}();t["default"]=r},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 r(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=i(15),h=o(a),d=function(e){function t(e,i,o,r,a){n(this,t);var h=s(this,Object.getPrototypeOf(t).call(this,e,i,o,r,a));return h.isCluster=!0,h.containedNodes={},h.containedEdges={},h}return r(t,e),t}(h["default"]);t["default"]=d},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}();"undefined"!=typeof window&&(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame);var s=i(1),r=function(){function e(t,i){o(this,e),this.body=t,this.canvas=i,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.pixelRatio=void 0,this.allowRedraw=!0,this.dragging=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideNodesOnDrag:!1},s.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindE
  33. * http://hammerjs.github.io/
  34. *
  35. * Copyright (c) 2015 Jorik Tangelder;
  36. * Licensed under the license */
  37. !function(n,s,r,a){function h(e,t,i){return setTimeout(f(e,i),t)}function d(e,t,i){return Array.isArray(e)?(l(e,i[t],i),!0):!1}function l(e,t,i){var o;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==a)for(o=0;o<e.length;)t.call(i,e[o],o,e),o++;else for(o in e)e.hasOwnProperty(o)&&t.call(i,e[o],o,e)}function c(e,t,i){var o="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,o,i),e.apply(this,arguments)}}function u(e,t,i){var o,n=t.prototype;o=e.prototype=Object.create(n),o.constructor=e,o._super=n,i&&ce(o,i)}function f(e,t){return function(){return e.apply(t,arguments)}}function p(e,t){return typeof e==pe?e.apply(t?t[0]||a:a,t):e}function v(e,t){return e===a?t:e}function y(e,t,i){l(_(t),function(t){e.addEventListener(t,i,!1)})}function g(e,t,i){l(_(t),function(t){e.removeEventListener(t,i,!1)})}function b(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function m(e,t){return e.indexOf(t)>-1}function _(e){return e.trim().split(/\s+/g)}function w(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var o=0;o<e.length;){if(i&&e[o][i]==t||!i&&e[o]===t)return o;o++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function x(e,t,i){for(var o=[],n=[],s=0;s<e.length;){var r=t?e[s][t]:e[s];w(n,r)<0&&o.push(e[s]),n[s]=r,s++}return i&&(o=t?o.sort(function(e,i){return e[t]>i[t]}):o.sort()),o}function O(e,t){for(var i,o,n=t[0].toUpperCase()+t.slice(1),s=0;s<ue.length;){if(i=ue[s],o=i?i+n:t,o in e)return o;s++}return a}function E(){return _e++}function M(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||n}function D(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){p(e.options.enable,[e])&&i.handler(t)},this.init()}function S(e){var t,i=e.options.inputClass;return new(t=i?i:xe?W:Oe?V:ke?G:L)(e,C)}function C(e,t,i){var o=i.pointers.length,n=i.changedPointers.length,s=t&Te&&o-n===0,r=t&(Be|Fe)&&o-n===0;i.isFirst=!!s,i.isFinal=!!r,s&&(e.session={}),i.eventType=t,T(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function T(e,t){var i=e.session,o=t.pointers,n=o.length;i.firstInput||(i.firstInput=F(t)),n>1&&!i.firstMultiple?i.firstMultiple=F(t):1===n&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,h=t.center=I(o);t.timeStamp=ge(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=R(a,h),t.distance=z(a,h),P(i,t),t.offsetDirection=N(t.deltaX,t.deltaY);var d=j(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=ye(d.x)>ye(d.y)?d.x:d.y,t.scale=r?H(r.pointers,o):1,t.rotation=r?A(r.pointers,o):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,B(i,t);var l=e.element;b(t.srcEvent.target,l)&&(l=t.srcEvent.target),t.target=l}function P(e,t){var i=t.center,o=e.offsetDelta||{},n=e.prevDelta||{},s=e.prevInput||{};t.eventType!==Te&&s.eventType!==Be||(n=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},o=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=n.x+(i.x-o.x),t.deltaY=n.y+(i.y-o.y)}function B(e,t){var i,o,n,s,r=e.lastInterval||t,h=t.timeStamp-r.timeStamp;if(t.eventType!=Fe&&(h>Ce||r.velocity===a)){var d=t.deltaX-r.deltaX,l=t.deltaY-r.deltaY,c=j(h,d,l);o=c.x,n=c.y,i=ye(c.x)>ye(c.y)?c.x:c.y,s=N(d,l),e.lastInterval=t}else i=r.velocity,o=r.velocityX,n=r.velocityY,s=r.direction;t.velocity=i,t.velocityX=o,t.velocityY=n,t.direction=s}function F(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:ve(e.pointers[i].clientX),clientY:ve(e.pointers[i].clientY)},i++;return{timeStamp:ge(),pointers:t,center:I(t),deltaX:e.deltaX,deltaY:e.deltaY}}function I(e){var t=e.length;if(1===t)return{x:ve(e[0].clientX),y:ve(e[0].clientY)};for(var i=0,o=0,n=0;t>n;)i+=e[n].clientX,o+=e[n].clientY,n++;return{x:ve(i/t),y:ve(o/t)}}function j(e,t,i){return
  38. yFixed:n.options.fixed.y};n.options.fixed.x=!0,n.options.fixed.y=!0,this.drag.selection.push(s)}}else this.selectionHandler._generateClickEvent("dragStart",e,this.drag.pointer,void 0,!0)}},{key:"onDrag",value:function(e){var t=this;if(this.drag.pinched!==!0){this.body.emitter.emit("unlockNode");var i=this.getPointer(e.center),o=this.drag.selection;if(o&&o.length&&this.options.dragNodes===!0)!function(){t.selectionHandler._generateClickEvent("dragging",e,i);var n=i.x-t.drag.pointer.x,s=i.y-t.drag.pointer.y;o.forEach(function(e){var i=e.node;e.xFixed===!1&&(i.x=t.canvas._XconvertDOMtoCanvas(t.canvas._XconvertCanvasToDOM(e.x)+n)),e.yFixed===!1&&(i.y=t.canvas._YconvertDOMtoCanvas(t.canvas._YconvertCanvasToDOM(e.y)+s))}),t.body.emitter.emit("startSimulation")}();else if(this.options.dragView===!0){if(this.selectionHandler._generateClickEvent("dragging",e,i,void 0,!0),void 0===this.drag.pointer)return void this.onDragStart(e);var n=i.x-this.drag.pointer.x,s=i.y-this.drag.pointer.y;this.body.view.translation={x:this.drag.translation.x+n,y:this.drag.translation.y+s},this.body.emitter.emit("_redraw")}}}},{key:"onDragEnd",value:function(e){this.drag.dragging=!1;var t=this.drag.selection;t&&t.length?(t.forEach(function(e){e.node.options.fixed.x=e.xFixed,e.node.options.fixed.y=e.yFixed}),this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center)),this.body.emitter.emit("startSimulation")):(this.selectionHandler._generateClickEvent("dragEnd",e,this.getPointer(e.center),void 0,!0),this.body.emitter.emit("_requestRedraw"))}},{key:"onPinch",value:function(e){var t=this.getPointer(e.center);this.drag.pinched=!0,void 0===this.pinch.scale&&(this.pinch.scale=1);var i=this.pinch.scale*e.scale;this.zoom(i,t)}},{key:"zoom",value:function(e,t){if(this.options.zoomView===!0){var i=this.body.view.scale;1e-5>e&&(e=1e-5),e>10&&(e=10);var o=void 0;void 0!==this.drag&&this.drag.dragging===!0&&(o=this.canvas.DOMtoCanvas(this.drag.pointer));var n=this.body.view.translation,s=e/i,r=(1-s)*t.x+n.x*s,a=(1-s)*t.y+n.y*s;if(this.body.view.scale=e,this.body.view.translation={x:r,y:a},void 0!=o){var h=this.canvas.canvasToDOM(o);this.drag.pointer.x=h.x,this.drag.pointer.y=h.y}this.body.emitter.emit("_requestRedraw"),e>i?this.body.emitter.emit("zoom",{direction:"+",scale:this.body.view.scale}):this.body.emitter.emit("zoom",{direction:"-",scale:this.body.view.scale})}}},{key:"onMouseWheel",value:function(e){if(this.options.zoomView===!0){var t=0;if(e.wheelDelta?t=e.wheelDelta/120:e.detail&&(t=-e.detail/3),0!==t){var i=this.body.view.scale,o=t/10;0>t&&(o/=1-o),i*=1+o;var n=this.getPointer({x:e.clientX,y:e.clientY});this.zoom(i,n)}e.preventDefault()}}},{key:"onMouseMove",value:function(e){var t=this,i=this.getPointer({x:e.clientX,y:e.clientY}),o=!1;if(void 0!==this.popup&&(this.popup.hidden===!1&&this._checkHidePopup(i),this.popup.hidden===!1&&(o=!0,this.popup.setPosition(i.x+3,i.y-5),this.popup.show())),this.options.keyboard.bindToWindow===!1&&this.options.keyboard.enabled===!0&&this.canvas.frame.focus(),o===!1&&(void 0!==this.popupTimer&&(clearInterval(this.popupTimer),this.popupTimer=void 0),this.drag.dragging||(this.popupTimer=setTimeout(function(){return t._checkShowPopup(i)},this.options.tooltipDelay))),this.options.hover===!0){var n=this.selectionHandler.getNodeAt(i);void 0===n&&(n=this.selectionHandler.getEdgeAt(i)),this.selectionHandler.hoverObject(n)}}},{key:"_checkShowPopup",value:function(e){var t=this.canvas._XconvertDOMtoCanvas(e.x),i=this.canvas._YconvertDOMtoCanvas(e.y),o={left:t,top:i,right:t,bottom:i},n=void 0===this.popupObj?void 0:this.popupObj.id,s=!1,r="node";if(void 0===this.popupObj){for(var a=this.body.nodeIndices,h=this.body.nodes,l=void 0,c=[],u=0;u<a.length;u++)l=h[a[u]],l.isOverlappingWith(o)===!0&&void 0!==l.getTitle()&&c.push(a[u]);c.length>0&&(this.popupObj=h[c[c.length-1]],s=!0)}if(void 0===this.popupObj&&s===!1){for(var f=this.body.edgeIndices,p=this.body.edges,v=void 0,y=[],g=0;g<f.length;g++)v=p[f[g]],v.isOverlappingWith(o)===!0&&v.connected===!0&&void 0!==v.getTitle()&&y.push(f[g]);y.length>0&&(this.popupObj
  39. n===!0&&("hubsize"===this.options.hierarchical.sortMethod?this._determineLevelsByHubsize():"directed"===this.options.hierarchical.sortMethod?this._determineLevelsDirected():"custom"===this.options.hierarchical.sortMethod&&this._determineLevelsCustomCallback());for(var s in this.body.nodes)this.body.nodes.hasOwnProperty(s)&&void 0===this.hierarchicalLevels[s]&&(this.hierarchicalLevels[s]=0);var r=this._getDistribution();this._generateMap(),this._placeNodesByHierarchy(r),this._condenseHierarchy(),this._shiftToCenter()}}},{key:"_condenseHierarchy",value:function(){var e=this,t=!1,i={},o=function(){for(var t=a(),i=0;i<t.length-1;i++){var o=t[i].max-t[i+1].min;n(i+1,o+e.options.hierarchical.treeSpacing)}},n=function(t,i){for(var o in e.hierarchicalTrees)if(e.hierarchicalTrees.hasOwnProperty(o)&&e.hierarchicalTrees[o]===t){var n=e.body.nodes[o],s=e._getPositionForHierarchy(n);e._setPositionForHierarchy(n,s+i,void 0,!0)}},r=function(t){var i=1e9,o=-1e9;for(var n in e.hierarchicalTrees)if(e.hierarchicalTrees.hasOwnProperty(n)&&e.hierarchicalTrees[n]===t){var s=e._getPositionForHierarchy(e.body.nodes[n]);i=Math.min(s,i),o=Math.max(s,o)}return{min:i,max:o}},a=function(){for(var t=[],i=0;i<=e.treeIndex;i++)t.push(r(i));return t},h=function _(t,i){if(i[t.id]=!0,e.hierarchicalChildrenReference[t.id]){var o=e.hierarchicalChildrenReference[t.id];if(o.length>0)for(var n=0;n<o.length;n++)_(e.body.nodes[o[n]],i)}},d=function(t){var i=arguments.length<=1||void 0===arguments[1]?1e9:arguments[1],o=1e9,n=1e9,r=1e9,a=-1e9;for(var h in t)if(t.hasOwnProperty(h)){var d=e.body.nodes[h],l=e.hierarchicalLevels[d.id],c=e._getPositionForHierarchy(d),u=e._getSpaceAroundNode(d,t),f=s(u,2),p=f[0],v=f[1];o=Math.min(p,o),n=Math.min(v,n),i>=l&&(r=Math.min(c,r),a=Math.max(c,a))}return[r,a,o,n]},l=function w(t){var i=e.hierarchicalLevels[t];if(e.hierarchicalChildrenReference[t]){var o=e.hierarchicalChildrenReference[t];if(o.length>0)for(var n=0;n<o.length;n++)i=Math.max(i,w(o[n]))}return i},c=function(e,t){var i=l(e.id),o=l(t.id);return Math.min(i,o)},u=function(t,i){var o=e.hierarchicalParentReference[t.id],n=e.hierarchicalParentReference[i.id];if(void 0===o||void 0===n)return!1;for(var s=0;s<o.length;s++)for(var r=0;r<n.length;r++)if(o[s]==n[r])return!0;return!1},f=function(t,i,o){for(var n=0;n<i.length;n++){var s=i[n],r=e.distributionOrdering[s];if(r.length>1)for(var a=0;a<r.length-1;a++)u(r[a],r[a+1])===!0&&e.hierarchicalTrees[r[a].id]===e.hierarchicalTrees[r[a+1].id]&&t(r[a],r[a+1],o)}},p=function(i,o){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],r=e._getPositionForHierarchy(i),a=e._getPositionForHierarchy(o),l=Math.abs(a-r);if(l>e.options.hierarchical.nodeSpacing){var u={};u[i.id]=!0;var f={};f[o.id]=!0,h(i,u),h(o,f);var p=c(i,o),v=d(u,p),y=s(v,4),g=(y[0],y[1]),b=(y[2],y[3],d(f,p)),m=s(b,4),_=m[0],w=(m[1],m[2]),k=(m[3],Math.abs(g-_));if(k>e.options.hierarchical.nodeSpacing){var x=g-_+e.options.hierarchical.nodeSpacing;x<-w+e.options.hierarchical.nodeSpacing&&(x=-w+e.options.hierarchical.nodeSpacing),0>x&&(e._shiftBlock(o.id,x),t=!0,n===!0&&e._centerParent(o))}}},v=function(o,n){for(var r=n.id,a=n.edges,l=e.hierarchicalLevels[n.id],c=e.options.hierarchical.levelSeparation*e.options.hierarchical.levelSeparation,u={},f=[],p=0;p<a.length;p++){var v=a[p];if(v.toId!=v.fromId){var y=v.toId==r?v.from:v.to;u[a[p].id]=y,e.hierarchicalLevels[y.id]<l&&f.push(v)}}var g=function(t,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=e._getPositionForHierarchy(u[i[n].id])-t;o+=s/Math.sqrt(s*s+c)}return o},b=function(t,i){for(var o=0,n=0;n<i.length;n++)if(void 0!==u[i[n].id]){var s=e._getPositionForHierarchy(u[i[n].id])-t;o-=c*Math.pow(s*s+c,-1.5)}return o},m=function(t,i){for(var o=e._getPositionForHierarchy(n),s={},r=0;t>r;r++){var a=g(o,i),h=b(o,i),d=40,l=Math.max(-d,Math.min(d,Math.round(a/h)));if(o-=l,void 0!==s[o])break;s[o]=r}return o},_=function(o){var r=e._getPositionForHierarchy(n);if(void 0===i[n.id]){var a={};a[n.id]=!0,h(n,a),i[n.id]=a}var l=d(i[n.id]),c=s(l,4),u=(c[0],c[1],c[2]),f=c[3],p=o-r,v=0;p>0?v=Math.min(p,f-e.options
  40. this.body.view.translation={x:this.lastTouch.translation.x+o,y:this.lastTouch.translation.y+n}}}},{key:"_finishConnect",value:function(e){var t=this.body.functions.getPointer(e.center),i=this.selectionHandler._pointerToPositionObject(t),o=void 0;void 0!==this.temporaryIds.edges[0]&&(o=this.body.edges[this.temporaryIds.edges[0]].fromId);for(var n=this.selectionHandler._getAllNodesOverlappingWith(i),s=void 0,r=n.length-1;r>=0;r--)if(-1===this.temporaryIds.nodes.indexOf(n[r])){s=this.body.nodes[n[r]];break}this._cleanupTemporaryNodesAndEdges(),void 0!==s&&(s.isCluster===!0?alert(this.options.locales[this.options.locale].createEdgeError||this.options.locales.en.createEdgeError):void 0!==this.body.nodes[o]&&void 0!==this.body.nodes[s.id]&&this._performAddEdge(o,s.id)),this.body.emitter.emit("_redraw")}},{key:"_performAddNode",value:function(e){var t=this,i={id:s.randomUUID(),x:e.pointer.canvas.x,y:e.pointer.canvas.y,label:"new"};if("function"==typeof this.options.addNode){if(2!==this.options.addNode.length)throw new Error("The function for add does not support two arguments (data,callback)");this.options.addNode(i,function(e){null!==e&&void 0!==e&&"addNode"===t.inMode&&(t.body.data.nodes.getDataSet().add(e),t.showManipulatorToolbar())})}else this.body.data.nodes.getDataSet().add(i),this.showManipulatorToolbar()}},{key:"_performAddEdge",value:function(e,t){var i=this,o={from:e,to:t};if("function"==typeof this.options.addEdge){if(2!==this.options.addEdge.length)throw new Error("The function for connect does not support two arguments (data,callback)");this.options.addEdge(o,function(e){null!==e&&void 0!==e&&"addEdge"===i.inMode&&(i.body.data.edges.getDataSet().add(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().add(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}},{key:"_performEditEdge",value:function(e,t){var i=this,o={id:this.edgeBeingEditedId,from:e,to:t};if("function"==typeof this.options.editEdge){if(2!==this.options.editEdge.length)throw new Error("The function for edit does not support two arguments (data, callback)");this.options.editEdge(o,function(e){null===e||void 0===e||"editEdge"!==i.inMode?(i.body.edges[o.id].updateEdgeType(),i.body.emitter.emit("_redraw")):(i.body.data.edges.getDataSet().update(e),i.selectionHandler.unselectAll(),i.showManipulatorToolbar())})}else this.body.data.edges.getDataSet().update(o),this.selectionHandler.unselectAll(),this.showManipulatorToolbar()}}]),e}();t["default"]=h},function(e,t,i){function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},r=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),a=i(71),h=o(a),d=i(1),l=function(){function e(t,i,o){var s=arguments.length<=3||void 0===arguments[3]?1:arguments[3];n(this,e),this.parent=t,this.changedOptions=[],this.container=i,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},d.extend(this.options,this.defaultOptions),this.configureOptions=o,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new h["default"](s),this.wrapper=void 0}return r(e,[{key:"setOptions",value:function(e){if(void 0!==e){this.popupHistory={},this._removePopup();var t=!0;"string"==typeof e?this.options.filter=e:e instanceof Array?this.options.filter=e.join():"object"===("undefined"==typeof e?"undefined":s(e))?(void 0!==e.container&&(this.options.container=e.container),void 0!==e.filter&&(this.options.filter=e.filter),void 0!
  41. group:{string:i,number:n,undefined:"undefined"},hidden:{"boolean":o},icon:{face:{string:i},code:{string:i},size:{number:n},color:{string:i},__type__:{object:r}},id:{string:i,number:n},image:{string:i,undefined:"undefined"},label:{string:i,undefined:"undefined"},labelHighlightBold:{"boolean":o},level:{number:n,undefined:"undefined"},mass:{number:n},physics:{"boolean":o},scaling:{min:{number:n},max:{number:n},label:{enabled:{"boolean":o},min:{number:n},max:{number:n},maxVisible:{number:n},drawThreshold:{number:n},__type__:{object:r,"boolean":o}},customScalingFunction:{"function":"function"},__type__:{object:r}},shadow:{enabled:{"boolean":o},color:{string:i},size:{number:n},x:{number:n},y:{number:n},__type__:{object:r,"boolean":o}},shape:{string:["ellipse","circle","database","box","text","image","circularImage","diamond","dot","star","triangle","triangleDown","square","icon"]},shapeProperties:{borderDashes:{"boolean":o,array:s},borderRadius:{number:n},interpolation:{"boolean":o},useImageSize:{"boolean":o},useBorderWithImage:{"boolean":o},__type__:{object:r}},size:{number:n},title:{string:i,undefined:"undefined"},value:{number:n,undefined:"undefined"},x:{number:n},y:{number:n},__type__:{object:r}},physics:{enabled:{"boolean":o},barnesHut:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},forceAtlas2Based:{gravitationalConstant:{number:n},centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},damping:{number:n},avoidOverlap:{number:n},__type__:{object:r}},repulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},hierarchicalRepulsion:{centralGravity:{number:n},springLength:{number:n},springConstant:{number:n},nodeDistance:{number:n},damping:{number:n},__type__:{object:r}},maxVelocity:{number:n},minVelocity:{number:n},solver:{string:["barnesHut","repulsion","hierarchicalRepulsion","forceAtlas2Based"]},stabilization:{enabled:{"boolean":o},iterations:{number:n},updateInterval:{number:n},onlyDynamicEdges:{"boolean":o},fit:{"boolean":o},__type__:{object:r,"boolean":o}},timestep:{number:n},adaptiveTimestep:{"boolean":o},__type__:{object:r,"boolean":o}},autoResize:{"boolean":o},clickToUse:{"boolean":o},locale:{string:i},locales:{__any__:{any:h},__type__:{object:r}},height:{string:i},width:{string:i},__type__:{object:r}};d.groups.__any__=d.nodes,d.manipulation.controlNodeStyle=d.nodes;var l={nodes:{borderWidth:[1,0,10,1],borderWidthSelected:[2,0,10,1],color:{border:["color","#2B7CE9"],background:["color","#97C2FC"],highlight:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]},hover:{border:["color","#2B7CE9"],background:["color","#D2E5FF"]}},fixed:{x:!1,y:!1},font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[0,0,50,1],strokeColor:["color","#ffffff"]},hidden:!1,labelHighlightBold:!0,physics:!0,scaling:{min:[10,0,200,1],max:[30,0,200,1],label:{enabled:!1,min:[14,0,200,1],max:[30,0,200,1],maxVisible:[30,0,200,1],drawThreshold:[5,0,20,1]}},shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:[10,0,20,1],x:[5,-30,30,1],y:[5,-30,30,1]},shape:["ellipse","box","circle","database","diamond","dot","square","star","text","triangle","triangleDown"],shapeProperties:{borderDashes:!1,borderRadius:[6,0,20,1],interpolation:!0,useImageSize:!1},size:[25,0,200,1]},edges:{arrows:{to:{enabled:!1,scaleFactor:[1,0,3,.05]},middle:{enabled:!1,scaleFactor:[1,0,3,.05]},from:{enabled:!1,scaleFactor:[1,0,3,.05]}},arrowStrikethrough:!0,color:{color:["color","#848484"],highlight:["color","#848484"],hover:["color","#848484"],inherit:["from","to","both",!0,!1],opacity:[1,0,1,.05]},dashes:!1,font:{color:["color","#343434"],size:[14,0,100,1],face:["arial","verdana","tahoma"],background:["color","none"],strokeWidth:[2,0,50,1],strokeColor:["color","#ffffff"],align:["horizontal","top","middle","bottom"]},hidden:!1,hoverWidth:[1.5,0,5,.1],labelHighlightBold:!0,p