|
|
- /**
- * vis.js
- * https://github.com/almende/vis
- *
- * A dynamic, browser-based visualization library.
- *
- * @version 4.16.1
- * @date 2016-04-18
- *
- * @license
- * Copyright (C) 2011-2016 Almende B.V, http://almende.com
- *
- * Vis.js is dual licensed under both
- *
- * * The Apache 2.0 License
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * and
- *
- * * The MIT License
- * http://opensource.org/licenses/MIT
- *
- * Vis.js may be distributed under either license.
- */
- "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
- s.ms=n.milliseconds,s.M=n.months),o=new He(s),We(e)&&r(e,"_locale")&&(o._locale=e._locale),o}function st(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function rt(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function at(e,t){var i;return e.isValid()&&t.isValid()?(t=Ve(t,e),e.isBefore(t)?i=rt(e,t):(i=rt(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function ht(e){return 0>e?-1*Math.round(-1*e):Math.round(e)}function dt(e,t){return function(i,o){var n,s;return null===o||isNaN(+o)||(k(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),s=i,i=o,o=s),i="string"==typeof i?+i:i,n=nt(i,o),lt(this,n,e),this}}function lt(e,i,o,n){var s=i._milliseconds,r=ht(i._days),a=ht(i._months);e.isValid()&&(n=null==n?!0:n,s&&e._d.setTime(e._d.valueOf()+s*o),r&&H(e,"Date",L(e,"Date")+r*o),a&&ae(e,L(e,"Month")+a*o),n&&t.updateOffset(e,r||a))}function ct(e,t){var i=e||ze(),o=Ve(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,ze(i)))}function ut(){return new v(this)}function ft(e,t){var i=y(e)?e:ze(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf()):!1}function pt(e,t){var i=y(e)?e:ze(e);return this.isValid()&&i.isValid()?(t=z(f(t)?"millisecond":t),"millisecond"===t?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf()):!1}function vt(e,t,i,o){return o=o||"()",("("===o[0]?this.isAfter(e,i):!this.isBefore(e,i))&&(")"===o[1]?this.isBefore(t,i):!this.isAfter(t,i))}function yt(e,t){var i,o=y(e)?e:ze(e);return this.isValid()&&o.isValid()?(t=z(t||"millisecond"),"millisecond"===t?this.valueOf()===o.valueOf():(i=o.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf())):!1}function gt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function bt(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function mt(e,t,i){var o,n,s,r;return this.isValid()?(o=Ve(e,this),o.isValid()?(n=6e4*(o.utcOffset()-this.utcOffset()),t=z(t),"year"===t||"month"===t||"quarter"===t?(r=_t(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 _t(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)||0}function wt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function kt(){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 xt(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=G(this,e);return this.localeData().postformat(i)}function Ot(e,t){return this.isValid()&&(y(e)&&e.isValid()||ze(e).isValid())?nt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Et(e){return this.from(ze(),e)}function Mt(e,t){return this.isValid()&&(y(e)&&e.isValid()||ze(e).isValid())?nt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Dt(e){return this.to(ze(),e)}function St(e){var t;return void 0===e?this._locale._abbr:(t=I(e),null!=t&&(this._locale=t),this)}function Ct(){return this._locale}function Tt(e){switch(e=z(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":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"===
- a.setAttributeNS(null,"class",o.className+" vis-point"),r){var h=t.getSVGElement("text",n,s);r.xOffset&&(e+=r.xOffset),r.yOffset&&(i+=r.yOffset),r.content&&(h.textContent=r.content),r.className&&h.setAttributeNS(null,"class",r.className+" vis-label"),h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i)}return a},t.drawBar=function(e,i,o,n,s,r,a,h){if(0!=n){0>n&&(n*=-1,i-=n);var d=t.getSVGElement("rect",r,a);d.setAttributeNS(null,"x",e-.5*o),d.setAttributeNS(null,"y",i),d.setAttributeNS(null,"width",o),d.setAttributeNS(null,"height",n),d.setAttributeNS(null,"class",s),h&&d.setAttributeNS(null,"style",h)}}},function(e,t,i){function o(e,t){if(e&&!Array.isArray(e)&&(t=e,e=null),this._options=t||{},this._data={},this.length=0,this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i=Object.keys(this._options.type),o=0,n=i.length;n>o;o++){var s=i[o],r=this._options.type[s];"Date"==r||"ISODate"==r||"ASPDate"==r?this._type[s]="Date":this._type[s]=r}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},e&&this.add(e),this.setOptions(t)}var n="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},s=i(1),r=i(9);o.prototype.setOptions=function(e){e&&void 0!==e.queue&&(e.queue===!1?this._queue&&(this._queue.destroy(),delete this._queue):(this._queue||(this._queue=r.extend(this,{replace:["add","update","remove"]})),"object"===n(e.queue)&&this._queue.setOptions(e.queue)))},o.prototype.on=function(e,t){var i=this._subscribers[e];i||(i=[],this._subscribers[e]=i),i.push({callback:t})},o.prototype.subscribe=function(){throw new Error("DataSet.subscribe is deprecated. Use DataSet.on instead.")},o.prototype.off=function(e,t){var i=this._subscribers[e];i&&(this._subscribers[e]=i.filter(function(e){return e.callback!=t}))},o.prototype.unsubscribe=function(){throw new Error("DataSet.unsubscribe is deprecated. Use DataSet.off instead.")},o.prototype._trigger=function(e,t,i){if("*"==e)throw new Error("Cannot trigger event *");var o=[];e in this._subscribers&&(o=o.concat(this._subscribers[e])),"*"in this._subscribers&&(o=o.concat(this._subscribers["*"]));for(var n=0,s=o.length;s>n;n++){var r=o[n];r.callback&&r.callback(e,t,i||null)}},o.prototype.add=function(e,t){var i,o=[],n=this;if(Array.isArray(e))for(var s=0,r=e.length;r>s;s++)i=n._addItem(e[s]),o.push(i);else{if(!(e instanceof Object))throw new Error("Unknown dataType");i=n._addItem(e),o.push(i)}return o.length&&this._trigger("add",{items:o},t),o},o.prototype.update=function(e,t){var i=[],o=[],n=[],r=[],a=this,h=a._fieldId,d=function(e){var t=e[h];if(a._data[t]){var d=s.extend({},a._data[t]);t=a._updateItem(e),o.push(t),r.push(e),n.push(d)}else t=a._addItem(e),i.push(t)};if(Array.isArray(e))for(var l=0,c=e.length;c>l;l++)e[l]instanceof Object?d(e[l]):console.warn("Ignoring input item, which is not an object at index "+l);else{if(!(e instanceof Object))throw new Error("Unknown dataType");d(e)}if(i.length&&this._trigger("add",{items:i},t),o.length){var u={items:o,oldData:n,data:r};this._trigger("update",u,t)}return i.concat(o)},o.prototype.get=function(e){var t,i,o,n=this,r=s.getType(arguments[0]);"String"==r||"Number"==r?(t=arguments[0],o=arguments[1]):"Array"==r?(i=arguments[0],o=arguments[1]):o=arguments[0];var a;if(o&&o.returnType){var h=["Array","Object"];a=-1==h.indexOf(o.returnType)?"Array":o.returnType}else a="Array";var d,l,c,u,f,p=o&&o.type||this._options.type,v=o&&o.filter,y=[];if(void 0!=t)d=n._getItem(t,p),d&&v&&!v(d)&&(d=null);else if(void 0!=i)for(u=0,f=i.length;f>u;u++)d=n._getItem(i[u],p),v&&!v(d)||y.push(d);else for(l=Object.keys(this._data),u=0,f=l.length;f>u;u++)c=l[u],d=n._getItem(c,p),v&&!v(d)||y.push(d);if(o&&o.order&&void 0==t&&this._sort(y,o.order),o&&o.fields){var g=o.fields;if(void 0!=t)d=this._filterFields(d,g);else for(u=0,f=y.length;f>u;u++)y[u]=this._filterFields(y[u],g)}if("Object"==a){var b,m={};for(u=0,f=y.length;f>u;u++)b=y[u],m[b.id]=b;return
- title:void 0,value:void 0,x:void 0,y:void 0},l.extend(this.options,this.defaultOptions),this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("refreshNodes",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){l.forEach(e.nodesListeners,function(t,i){e.body.data.nodes&&e.body.data.nodes.off(i,t)}),delete e.body.functions.createNode,delete e.nodesListeners.add,delete e.nodesListeners.update,delete e.nodesListeners.remove,delete e.nodesListeners})}},{key:"setOptions",value:function(e){if(void 0!==e){if(a["default"].parseOptions(this.options,e),void 0!==e.shape)for(var t in this.body.nodes)this.body.nodes.hasOwnProperty(t)&&this.body.nodes[t].updateShape();if(void 0!==e.font){d["default"].parseOptions(this.options.font,e);for(var i in this.body.nodes)this.body.nodes.hasOwnProperty(i)&&(this.body.nodes[i].updateLabelModule(),this.body.nodes[i]._reset())}if(void 0!==e.size)for(var o in this.body.nodes)this.body.nodes.hasOwnProperty(o)&&this.body.nodes[o]._reset();void 0===e.hidden&&void 0===e.physics||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(e){var t=this,i=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],o=this.body.data.nodes;if(e instanceof c||e instanceof u)this.body.data.nodes=e;else if(Array.isArray(e))this.body.data.nodes=new c,this.body.data.nodes.add(e);else{if(e)throw new TypeError("Array or DataSet expected");this.body.data.nodes=new c}o&&l.forEach(this.nodesListeners,function(e,t){o.off(t,e)}),this.body.nodes={},this.body.data.nodes&&!function(){var e=t;l.forEach(t.nodesListeners,function(t,i){e.body.data.nodes.on(i,t)});var i=t.body.data.nodes.getIds();t.add(i,!0)}(),i===!1&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(e){for(var t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=void 0,o=[],n=0;n<e.length;n++){i=e[n];var s=this.body.data.nodes.get(i),r=this.create(s);o.push(r),this.body.nodes[i]=r}this.layoutEngine.positionInitially(o),t===!1&&this.body.emitter.emit("_dataChanged")}},{key:"update",value:function(e,t){for(var i=this.body.nodes,o=!1,n=0;n<e.length;n++){var s=e[n],r=i[s],a=t[n];void 0!==r?o=r.setOptions(a):(o=!0,r=this.create(a),i[s]=r)}o===!0?this.body.emitter.emit("_dataChanged"):this.body.emitter.emit("_dataUpdated")}},{key:"remove",value:function(e){for(var t=this.body.nodes,i=0;i<e.length;i++){var o=e[i];delete t[o]}this.body.emitter.emit("_dataChanged")}},{key:"create",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?a["default"]:arguments[1];return new t(e,this.body,this.images,this.groups,this.options)}},{key:"refresh",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],t=this.body.nodes;for(var i in t){var o=void 0;t.hasOwnProperty(i)&&(o=t[i]);var n=this.body.data.nodes._data[i];void 0!==o&&void 0!==n&&(e===!0&&o.setOptions({x:null,y:null}),o.setOptions({fixed:!1}),o.setOptions(n))}}},{key:"getPositions",value:function(e){var t={};if(void 0!==e){if(Array.isArray(e)===!0){for(var i=0;i<e.length;i++)if(void 0!==this.body.nodes[e[i]]){var o=this.body.nodes[e[i]];t[e[i]]={x:Math.round(o.x),y:Math.round(o.y)}}}else if(void 0!==this.body.nodes[e]){var n=this.body.nodes[e];t[e]={x:Math.round(n.x),y:Math.round(n.y)}}}else for(var s=0;s<this.body.nodeIndices.length;s++){var r=this.body.nodes[this.body.nodeIndices[s]];t[this.body.nodeIndices[s]]={x:Math.round(r.x),y:Math.round(r.y)}}return t}},{key:"storePositions",value:function(){var e=[],t=this.body.data.nodes.getDataSet();for(var i in t._data)if(t._data.hasOwnProperty(i)){var o=this.body.nodes[i];t._data[i].x==Math.round(o.x)&&t._data[i].y==Math.round(o.y)||e.push({id:o.id,x:Math.round(o.x),y:Math.round(o.y)})}t.update(e)}},{key:"getBoundingBox",value:function(e){return void 0!==this.body.nodes[e]?this.body.nodes[e].shape.boundingBox:void 0}},{key:"getConnectedNodes",value:function(e){var t=[];if(void 0!==this.body.nodes[e])for(var i=this.body.nodes[e],o={},n=0;n<i.edges.length;n++){var s=i.edges
- this.boundingBox.right=this.left+this.width}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),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(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,"diamond",4,t,i,o,n)}},{key:"distanceToBorder",value:function(e,t){return this._distanceToBorder(e,t)}}]),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:"_resizeShape",value:function(){if(void 0===this.width){var e=2*this.options.size;this.width=e,this.height=e,this.radius=.5*this.width}}},{key:"_drawShape",value:function(e,t,i,o,n,s,r){this._resizeShape(),this.left=o-this.width/2,this.top=n-this.height/2;var a=this.options.borderWidth,h=this.options.borderWidthSelected||2*this.options.borderWidth,d=(s?h:a)/this.body.view.scale;if(e.lineWidth=Math.min(this.width,d),e.strokeStyle=s?this.options.color.highlight.border:r?this.options.color.hover.border:this.options.color.border,e.fillStyle=s?this.options.color.highlight.background:r?this.options.color.hover.background:this.options.color.background,e[t](o,n,this.options.size),this.enableShadow(e),e.fill(),this.disableShadow(e),e.save(),d>0&&(this.enableBorderDashes(e),e.stroke(),this.disableBorderDashes(e)),e.restore(),void 0!==this.options.label){var l=n+.5*this.height+3;this.labelModule.draw(e,o,l,s,"hanging")}this.updateBoundingBox(o,n)}},{key:"updateBoundingBox",value:function(e,t){this.boundingBox.top=t-this.options.size,this.boundingBox.left=e-this.options.size,this.boundingBox.right=e+this.options.size,this.boundingBox.bottom=t+this.options.size,void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+3))}}
- void 0!==t.value&&(t.value=parseFloat(t.value)),this.updateLabelModule();var i=this.updateEdgeType();return this._setInteractionWidths(),this.connect(),void 0===t.hidden&&void 0===t.physics||(i=!0),i}}},{key:"updateLabelModule",value:function(){this.labelModule.setOptions(this.options,!0),void 0!==this.labelModule.baseSize&&(this.baseFontSize=this.labelModule.baseSize)}},{key:"updateEdgeType",value:function(){var e=!1,t=!0,i=this.options.smooth;return void 0!==this.edgeType&&(this.edgeType instanceof u["default"]&&i.enabled===!0&&"dynamic"===i.type&&(t=!1),this.edgeType instanceof l["default"]&&i.enabled===!0&&"cubicBezier"===i.type&&(t=!1),this.edgeType instanceof p["default"]&&i.enabled===!0&&"dynamic"!==i.type&&"cubicBezier"!==i.type&&(t=!1),this.edgeType instanceof y["default"]&&i.enabled===!1&&(t=!1),t===!0&&(e=this.cleanup())),t===!0?this.options.smooth.enabled===!0?"dynamic"===this.options.smooth.type?(e=!0,this.edgeType=new u["default"](this.options,this.body,this.labelModule)):"cubicBezier"===this.options.smooth.type?this.edgeType=new l["default"](this.options,this.body,this.labelModule):this.edgeType=new p["default"](this.options,this.body,this.labelModule):this.edgeType=new y["default"](this.options,this.body,this.labelModule):this.edgeType.setOptions(this.options),e}},{key:"connect",value:function(){this.disconnect(),this.from=this.body.nodes[this.fromId]||void 0,this.to=this.body.nodes[this.toId]||void 0,this.connected=void 0!==this.from&&void 0!==this.to,this.connected===!0?(this.from.attachEdge(this),this.to.attachEdge(this)):(this.from&&this.from.detachEdge(this),this.to&&this.to.detachEdge(this)),this.edgeType.connect()}},{key:"disconnect",value:function(){this.from&&(this.from.detachEdge(this),this.from=void 0),this.to&&(this.to.detachEdge(this),this.to=void 0),this.connected=!1}},{key:"getTitle",value:function(){return this.title}},{key:"isSelected",value:function(){return this.selected}},{key:"getValue",value:function(){return this.options.value}},{key:"setValueRange",value:function(e,t,i){if(void 0!==this.options.value){var o=this.options.scaling.customScalingFunction(e,t,i,this.options.value),n=this.options.scaling.max-this.options.scaling.min;if(this.options.scaling.label.enabled===!0){var s=this.options.scaling.label.max-this.options.scaling.label.min;this.options.font.size=this.options.scaling.label.min+o*s}this.options.width=this.options.scaling.min+o*n}else this.options.width=this.baseWidth,this.options.font.size=this.baseFontSize;this._setInteractionWidths(),this.updateLabelModule()}},{key:"_setInteractionWidths",value:function(){"function"==typeof this.options.hoverWidth?this.edgeType.hoverWidth=this.options.hoverWidth(this.options.width):this.edgeType.hoverWidth=this.options.hoverWidth+this.options.width,"function"==typeof this.options.selectionWidth?this.edgeType.selectionWidth=this.options.selectionWidth(this.options.width):this.edgeType.selectionWidth=this.options.selectionWidth+this.options.width}},{key:"draw",value:function(e){var t=this.edgeType.getViaNode(),i={};this.edgeType.fromPoint=this.edgeType.from,this.edgeType.toPoint=this.edgeType.to,this.options.arrows.from.enabled===!0&&(i.from=this.edgeType.getArrowData(e,"from",t,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.fromPoint=i.from.core)),this.options.arrows.to.enabled===!0&&(i.to=this.edgeType.getArrowData(e,"to",t,this.selected,this.hover),this.options.arrowStrikethrough===!1&&(this.edgeType.toPoint=i.to.core)),this.options.arrows.middle.enabled===!0&&(i.middle=this.edgeType.getArrowData(e,"middle",t,this.selected,this.hover)),this.edgeType.drawLine(e,this.selected,this.hover,t),this.drawArrows(e,i),this.drawLabel(e,t)}},{key:"drawArrows",value:function(e,t){this.options.arrows.from.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.from),this.options.arrows.middle.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.middle),this.options.arrows.to.enabled===!0&&this.edgeType.drawArrowHead(e,this.selected,this.hover,t.to)}},{key:"drawLabel",value:function(e
- o=this.to);var n=Math.atan2(i.y-o.y,i.x-o.x),s=i.x-o.x,r=i.y-o.y,a=Math.sqrt(s*s+r*r),h=e.distanceToBorder(t,n),d=(a-h)/a,l={};return l.x=(1-d)*o.x+d*i.x,l.y=(1-d)*o.y+d*i.y,l}},{key:"_getDistanceToEdge",value:function(e,t,i,o,n,s){return this._getDistanceToLine(e,t,i,o,n,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")}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(45),a=o(r),h=i(46),d=o(h),l=i(47),c=o(l),u=i(48),f=o(u),p=i(49),v=o(p),y=i(50),g=o(y),b=i(51),m=o(b),_=i(52),w=o(_),k=i(1),x=function(){function e(t){n(this,e),this.body=t,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0},k.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return s(e,[{key:"bindEventListeners",value:function(){var e=this;this.body.emitter.on("initPhysics",function(){e.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){e.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){e.stopSimulation(),e.ready=!1}),this.body.emitter.on("disablePhysics",function(){e.physicsEnabled=!1,e.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){e.setOptions(e.options),e.ready===!0&&e.startSimulation()}),this.body.emitter.on("startSimulation",function(){e.ready===!0&&e.startSimulation()}),this.body.emitter.on("stopSimulation",function(){e.stopSimulation()}),this.body.emitter.on("destroy",function(){e.stopSimulation(!1),e.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){e.updatePhysicsData()})}},{key:"setOptions",value:function(e){void 0!==e&&(e===!1?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):(this.physicsEnabled=!0,k.selectiveNotDeepExtend(["stabilization"],this.options,e),k.mergeOptions(this.options,e,"stabilization"),void 0===e.enabled&&(this.options.enabled=!0),this.options.enabled===!1&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var e;"forceAtlas2Based"===this.options.solver?(e=this.options.forceAtlas2Based,this.nodesSolver=new m["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new w["default"](this.body,this.physicsBody,e)):"repulsion"===this.options.solver?(e=this.options.repulsion,this.nodesSolver=new d["default"](this.body,this.physicsBody,e),this.edgesSolver=new f["default"](this.body,this.physicsBody,e),this.gravitySolver=new g["default"](this.body,this.physicsBody,e)):"hierarchicalRepulsion"===this.options.solver?(e=this.options.hierarchicalRepulsion,this.nodesSolver=new c["de
- m.clusteringEdgeReplacingId=g.id,this.body.edges[m.id]=m,m.connect(),this._backupEdgeOptions(g),g.setOptions({physics:!1,hidden:!0})}}},{key:"_checkOptions",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return void 0===e.clusterEdgeProperties&&(e.clusterEdgeProperties={}),void 0===e.clusterNodeProperties&&(e.clusterNodeProperties={}),e}},{key:"_cluster",value:function(e,t,i){var o=arguments.length<=3||void 0===arguments[3]?!0:arguments[3];if(!(Object.keys(e).length<2)){for(var n in e)if(e.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var s=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var r=[];for(var a in e)if(e.hasOwnProperty(a)){var d=h["default"].cloneOptions(e[a]);r.push(d)}var u=[];for(var f in t)if(t.hasOwnProperty(f)&&"clusterEdge:"!==f.substr(0,12)){var p=h["default"].cloneOptions(t[f],"edge");u.push(p)}if(s=i.processProperties(s,r,u),!s)throw new Error("The processProperties function does not return properties!")}void 0===s.id&&(s.id="cluster:"+c.randomUUID());var v=s.id;void 0===s.label&&(s.label="cluster");var y=void 0;void 0===s.x&&(y=this._getClusterPosition(e),s.x=y.x),void 0===s.y&&(void 0===y&&(y=this._getClusterPosition(e)),s.y=y.y),s.id=v;var g=this.body.functions.createNode(s,l["default"]);g.isCluster=!0,g.containedNodes=e,g.containedEdges=t,g.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[s.id]=g,this._createClusterEdges(e,t,s,i.clusterEdgeProperties);for(var b in t)if(t.hasOwnProperty(b)&&void 0!==this.body.edges[b]){var m=this.body.edges[b];this._backupEdgeOptions(m),m.setOptions({physics:!1,hidden:!0})}for(var _ in e)e.hasOwnProperty(_)&&(this.clusteredNodes[_]={clusterId:s.id,node:this.body.nodes[_]},this.body.nodes[_].setOptions({hidden:!0,physics:!1}));s.id=void 0,o===!0&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(e){void 0===this.clusteredEdges[e.id]&&(this.clusteredEdges[e.id]={physics:e.options.physics,hidden:e.options.hidden})}},{key:"_restoreEdge",value:function(e){var t=this.clusteredEdges[e.id];void 0!==t&&(e.setOptions({physics:t.physics,hidden:t.hidden}),delete this.clusteredEdges[e.id])}},{key:"isCluster",value:function(e){return void 0!==this.body.nodes[e]?this.body.nodes[e].isCluster===!0:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(e){for(var t=Object.keys(e),i=e[t[0]].x,o=e[t[0]].x,n=e[t[0]].y,s=e[t[0]].y,r=void 0,a=1;a<t.length;a++)r=e[t[a]],i=r.x<i?r.x:i,o=r.x>o?r.x:o,n=r.y<n?r.y:n,s=r.y>s?r.y:s;return{x:.5*(i+o),y:.5*(n+s)}}},{key:"openCluster",value:function(e,t){var i=arguments.length<=2||void 0===arguments[2]?!0:arguments[2];if(void 0===e)throw new Error("No clusterNodeId supplied to openCluster.");if(void 0===this.body.nodes[e])throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(void 0===this.body.nodes[e].containedNodes)return void console.log("The node:"+e+" is not a cluster.");var o=this.body.nodes[e],n=o.containedNodes,s=o.containedEdges;if(void 0!==t&&void 0!==t.releaseFunction&&"function"==typeof t.releaseFunction){var r={},a={x:o.x,y:o.y};for(var d in n)if(n.hasOwnProperty(d)){var l=this.body.nodes[d];r[d]={x:l.x,y:l.y}}var u=t.releaseFunction(a,r);for(var f in n)if(n.hasOwnProperty(f)){var p=this.body.nodes[f];void 0!==u[f]&&(p.x=void 0===u[f].x?o.x:u[f].x,p.y=void 0===u[f].y?o.y:u[f].y)}}else for(var v in n)if(n.hasOwnProperty(v)){var y=this.body.nodes[v];y=n[v],y.options.fixed.x===!1&&(y.x=o.x),y.options.fixed.y===!1&&(y.y=o.y)}for(var g in n)if(n.hasOwnProperty(g)){var b=this.body.nodes[g];b.vx=o.vx,b.vy=o.vy,b.setOptions({hidden:!1,physics:!0}),delete this.clusteredNodes[g]}for(var m=[],_=0;_<o.edges.length;_++)m.push(o.edges[_]);for(var w=0;w<m.length;w++){var k=m[w],x=this._getConnectedId(k,e);if(void 0!==this.clusteredNodes[x]){var O=this.body.nodes[this.clusteredNodes[x].clusterId],E=this.body.edges[k.clusteringEdgeReplacingId];if(void 0!==E){O.containedEdges[E.id]=E,delete s[E.id];var M=E.fromId,D=E.toId;E.toId==x?D=this.clusteredNodes[x].clusterId:M=this.clust
- * http://hammerjs.github.io/
- *
- * Copyright (c) 2015 Jorik Tangelder;
- * Licensed under the license */
- !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:H)(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?L(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
- 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
- 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
- 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!
- string:i}},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],labelHighlig
|