|
|
@ -5,7 +5,7 @@ |
|
|
|
* A dynamic, browser-based visualization library. |
|
|
|
* |
|
|
|
* @version 4.15.2-SNAPSHOT |
|
|
|
* @date 2016-03-15 |
|
|
|
* @date 2016-04-05 |
|
|
|
* |
|
|
|
* @license |
|
|
|
* Copyright (C) 2011-2016 Almende B.V, http://almende.com
|
|
|
@ -11006,8 +11006,18 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
*/ |
|
|
|
Timeline.prototype.fit = function (options) { |
|
|
|
var animation = options && options.animation !== undefined ? options.animation : true; |
|
|
|
var range = this.getItemRange(); |
|
|
|
this.range.setRange(range.min, range.max, animation); |
|
|
|
var range; |
|
|
|
|
|
|
|
var dataset = this.itemsData && this.itemsData.getDataSet(); |
|
|
|
if (dataset.length === 1 && dataset.get()[0].end === undefined) { |
|
|
|
// a single item -> don't fit, just show a range around the item from -4 to +3 days
|
|
|
|
range = this.getDataRange(); |
|
|
|
this.moveTo(range.min.valueOf(), { animation: animation }); |
|
|
|
} else { |
|
|
|
// exactly fit the items (plus a small margin)
|
|
|
|
range = this.getItemRange(); |
|
|
|
this.range.setRange(range.min, range.max, animation); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
@ -15824,9 +15834,9 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
// http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#JavaScript
|
|
|
|
/* |
|
|
|
Copyright (c) 2011 Andrei Mackenzie |
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
|
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
|
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
|
|
*/ |
|
|
|
|
|
|
|
}, { |
|
|
@ -29325,9 +29335,7 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
value: function create(properties) { |
|
|
|
var constructorClass = arguments.length <= 1 || arguments[1] === undefined ? _Node2.default : arguments[1]; |
|
|
|
|
|
|
|
var idField = this.body.data.nodes._fieldId; |
|
|
|
var id = properties[idField]; |
|
|
|
return new constructorClass(id, properties, this.body, this.images, this.groups, this.options); |
|
|
|
return new constructorClass(properties, this.body, this.images, this.groups, this.options); |
|
|
|
} |
|
|
|
}, { |
|
|
|
key: 'refresh', |
|
|
@ -29588,9 +29596,9 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
/** |
|
|
|
* @class Node |
|
|
|
* A node. A node can be connected to other nodes via one or multiple edges. |
|
|
|
* @param {string} id Id for the node |
|
|
|
* @param {object} options An object containing options for the node. All |
|
|
|
* options are optional |
|
|
|
* options are optional, except for the id. |
|
|
|
* {number} id Id of the node. Required |
|
|
|
* {string} label Text label for the node |
|
|
|
* {number} x Horizontal position of the node |
|
|
|
* {number} y Vertical position of the node |
|
|
@ -29612,7 +29620,7 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
*/ |
|
|
|
|
|
|
|
var Node = function () { |
|
|
|
function Node(id, options, body, imagelist, grouplist, globalOptions) { |
|
|
|
function Node(options, body, imagelist, grouplist, globalOptions) { |
|
|
|
_classCallCheck(this, Node); |
|
|
|
|
|
|
|
this.options = util.bridgeObject(globalOptions); |
|
|
@ -29621,11 +29629,8 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
|
|
|
|
this.edges = []; // all edges connected to this node
|
|
|
|
|
|
|
|
if (id === undefined) { |
|
|
|
throw "Node must have an id"; |
|
|
|
} |
|
|
|
|
|
|
|
this.id = id; |
|
|
|
// set defaults for the options
|
|
|
|
this.id = undefined; |
|
|
|
this.imagelist = imagelist; |
|
|
|
this.grouplist = grouplist; |
|
|
|
|
|
|
@ -29683,6 +29688,14 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
if (!options) { |
|
|
|
return; |
|
|
|
} |
|
|
|
// basic options
|
|
|
|
if (options.id !== undefined) { |
|
|
|
this.id = options.id; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.id === undefined) { |
|
|
|
throw "Node must have an id"; |
|
|
|
} |
|
|
|
|
|
|
|
// set these options locally
|
|
|
|
// clear x and y positions
|
|
|
@ -32357,9 +32370,7 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
}, { |
|
|
|
key: 'create', |
|
|
|
value: function create(properties) { |
|
|
|
var idField = this.body.data.edges._fieldId; |
|
|
|
var id = properties[idField]; |
|
|
|
return new _Edge2.default(id, properties, this.body, this.options); |
|
|
|
return new _Edge2.default(properties, this.body, this.options); |
|
|
|
} |
|
|
|
}, { |
|
|
|
key: 'markAllEdgesAsDirty', |
|
|
@ -32462,7 +32473,6 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
* @class Edge |
|
|
|
* |
|
|
|
* A edge connects two nodes |
|
|
|
* @param {string} [id] Id for the edge. optional |
|
|
|
* @param {Object} properties Object with options. Must contain |
|
|
|
* At least options from and to. |
|
|
|
* Available options: from (number), |
|
|
@ -32476,7 +32486,7 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
*/ |
|
|
|
|
|
|
|
var Edge = function () { |
|
|
|
function Edge(id, options, body, globalOptions) { |
|
|
|
function Edge(options, body, globalOptions) { |
|
|
|
_classCallCheck(this, Edge); |
|
|
|
|
|
|
|
if (body === undefined) { |
|
|
@ -32487,7 +32497,7 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
this.body = body; |
|
|
|
|
|
|
|
// initialize variables
|
|
|
|
this.id = id; |
|
|
|
this.id = undefined; |
|
|
|
this.fromId = undefined; |
|
|
|
this.toId = undefined; |
|
|
|
this.selected = false; |
|
|
@ -32527,6 +32537,9 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
|
|
|
|
Edge.parseOptions(this.options, options, true, this.globalOptions); |
|
|
|
|
|
|
|
if (options.id !== undefined) { |
|
|
|
this.id = options.id; |
|
|
|
} |
|
|
|
if (options.from !== undefined) { |
|
|
|
this.fromId = options.from; |
|
|
|
} |
|
|
@ -32606,14 +32619,14 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
if (this.options.smooth.enabled === true) { |
|
|
|
if (this.options.smooth.type === 'dynamic') { |
|
|
|
dataChanged = true; |
|
|
|
this.edgeType = new _BezierEdgeDynamic2.default(this.id, this.options, this.body, this.labelModule); |
|
|
|
this.edgeType = new _BezierEdgeDynamic2.default(this.options, this.body, this.labelModule); |
|
|
|
} else if (this.options.smooth.type === 'cubicBezier') { |
|
|
|
this.edgeType = new _CubicBezierEdge2.default(this.id, this.options, this.body, this.labelModule); |
|
|
|
this.edgeType = new _CubicBezierEdge2.default(this.options, this.body, this.labelModule); |
|
|
|
} else { |
|
|
|
this.edgeType = new _BezierEdgeStatic2.default(this.id, this.options, this.body, this.labelModule); |
|
|
|
this.edgeType = new _BezierEdgeStatic2.default(this.options, this.body, this.labelModule); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.edgeType = new _StraightEdge2.default(this.id, this.options, this.body, this.labelModule); |
|
|
|
this.edgeType = new _StraightEdge2.default(this.options, this.body, this.labelModule); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// if nothing changes, we just set the options.
|
|
|
@ -33061,10 +33074,10 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
var CubicBezierEdge = function (_CubicBezierEdgeBase) { |
|
|
|
_inherits(CubicBezierEdge, _CubicBezierEdgeBase); |
|
|
|
|
|
|
|
function CubicBezierEdge(id, options, body, labelModule) { |
|
|
|
function CubicBezierEdge(options, body, labelModule) { |
|
|
|
_classCallCheck(this, CubicBezierEdge); |
|
|
|
|
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(CubicBezierEdge).call(this, id, options, body, labelModule)); |
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(CubicBezierEdge).call(this, options, body, labelModule)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -33209,10 +33222,10 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
var CubicBezierEdgeBase = function (_BezierEdgeBase) { |
|
|
|
_inherits(CubicBezierEdgeBase, _BezierEdgeBase); |
|
|
|
|
|
|
|
function CubicBezierEdgeBase(id, options, body, labelModule) { |
|
|
|
function CubicBezierEdgeBase(options, body, labelModule) { |
|
|
|
_classCallCheck(this, CubicBezierEdgeBase); |
|
|
|
|
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(CubicBezierEdgeBase).call(this, id, options, body, labelModule)); |
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(CubicBezierEdgeBase).call(this, options, body, labelModule)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -33295,10 +33308,10 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
var BezierEdgeBase = function (_EdgeBase) { |
|
|
|
_inherits(BezierEdgeBase, _EdgeBase); |
|
|
|
|
|
|
|
function BezierEdgeBase(id, options, body, labelModule) { |
|
|
|
function BezierEdgeBase(options, body, labelModule) { |
|
|
|
_classCallCheck(this, BezierEdgeBase); |
|
|
|
|
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeBase).call(this, id, options, body, labelModule)); |
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeBase).call(this, options, body, labelModule)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -33431,10 +33444,9 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
var util = __webpack_require__(1); |
|
|
|
|
|
|
|
var EdgeBase = function () { |
|
|
|
function EdgeBase(id, options, body, labelModule) { |
|
|
|
function EdgeBase(options, body, labelModule) { |
|
|
|
_classCallCheck(this, EdgeBase); |
|
|
|
|
|
|
|
this.id = id; |
|
|
|
this.body = body; |
|
|
|
this.labelModule = labelModule; |
|
|
|
this.options = {}; |
|
|
@ -33464,6 +33476,7 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
this.options = options; |
|
|
|
this.from = this.body.nodes[this.options.from]; |
|
|
|
this.to = this.body.nodes[this.options.to]; |
|
|
|
this.id = this.options.id; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -34037,12 +34050,12 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
var BezierEdgeDynamic = function (_BezierEdgeBase) { |
|
|
|
_inherits(BezierEdgeDynamic, _BezierEdgeBase); |
|
|
|
|
|
|
|
function BezierEdgeDynamic(id, options, body, labelModule) { |
|
|
|
function BezierEdgeDynamic(options, body, labelModule) { |
|
|
|
_classCallCheck(this, BezierEdgeDynamic); |
|
|
|
|
|
|
|
// --> this calls the setOptions below
|
|
|
|
|
|
|
|
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeDynamic).call(this, id, options, body, labelModule)); |
|
|
|
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeDynamic).call(this, options, body, labelModule)); |
|
|
|
//this.via = undefined; // Here for completeness but not allowed to defined before super() is invoked.
|
|
|
|
|
|
|
|
|
|
|
@ -34064,6 +34077,7 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
|
|
|
|
// set the options and the to and from nodes
|
|
|
|
this.options = options; |
|
|
|
this.id = this.options.id; |
|
|
|
this.from = this.body.nodes[this.options.from]; |
|
|
|
this.to = this.body.nodes[this.options.to]; |
|
|
|
|
|
|
@ -34124,14 +34138,12 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
value: function setupSupportNode() { |
|
|
|
if (this.via === undefined) { |
|
|
|
var nodeId = "edgeId:" + this.id; |
|
|
|
var properties = { |
|
|
|
var node = this.body.functions.createNode({ |
|
|
|
id: nodeId, |
|
|
|
shape: 'circle', |
|
|
|
physics: true, |
|
|
|
hidden: true |
|
|
|
}; |
|
|
|
var idField = this.body.data.nodes._fieldId; |
|
|
|
properties[idField] = nodeId; |
|
|
|
var node = this.body.functions.createNode(properties); |
|
|
|
}); |
|
|
|
this.body.nodes[nodeId] = node; |
|
|
|
this.via = node; |
|
|
|
this.via.parentEdgeId = this.id; |
|
|
@ -34243,10 +34255,10 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
var BezierEdgeStatic = function (_BezierEdgeBase) { |
|
|
|
_inherits(BezierEdgeStatic, _BezierEdgeBase); |
|
|
|
|
|
|
|
function BezierEdgeStatic(id, options, body, labelModule) { |
|
|
|
function BezierEdgeStatic(options, body, labelModule) { |
|
|
|
_classCallCheck(this, BezierEdgeStatic); |
|
|
|
|
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeStatic).call(this, id, options, body, labelModule)); |
|
|
|
return _possibleConstructorReturn(this, Object.getPrototypeOf(BezierEdgeStatic).call(this, options, body, labelModule)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -42913,9 +42925,8 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
key: '_getNewTargetNode', |
|
|
|
value: function _getNewTargetNode(x, y) { |
|
|
|
var controlNodeStyle = util.deepExtend({}, this.options.controlNodeStyle); |
|
|
|
var idField = this.body.data.nodes._fieldId; |
|
|
|
|
|
|
|
controlNodeStyle[idField] = 'targetNode' + util.randomUUID(); |
|
|
|
controlNodeStyle.id = 'targetNode' + util.randomUUID(); |
|
|
|
controlNodeStyle.hidden = false; |
|
|
|
controlNodeStyle.physics = false; |
|
|
|
controlNodeStyle.x = x; |
|
|
@ -43481,12 +43492,11 @@ return /******/ (function(modules) { // webpackBootstrap |
|
|
|
var _this5 = this; |
|
|
|
|
|
|
|
var defaultData = { |
|
|
|
id: util.randomUUID(), |
|
|
|
x: clickData.pointer.canvas.x, |
|
|
|
y: clickData.pointer.canvas.y, |
|
|
|
label: 'new' |
|
|
|
}; |
|
|
|
var idField = this.body.data.nodes._fieldId; |
|
|
|
defaultData[idField] = util.randomUUID(); |
|
|
|
|
|
|
|
if (typeof this.options.addNode === 'function') { |
|
|
|
if (this.options.addNode.length === 2) { |
|
|
|