Browse Source

Merge branch 'develop'

codeClimate v4.12.0
jos 8 years ago
parent
commit
9a5d1a036e
50 changed files with 1629 additions and 1085 deletions
  1. +22
    -0
      HISTORY.md
  2. +1
    -1
      LICENSE-MIT
  3. +1
    -1
      NOTICE
  4. +1
    -1
      bower.json
  5. +13
    -5
      dist/vis.css
  6. +1278
    -819
      dist/vis.js
  7. +1
    -1
      dist/vis.map
  8. +1
    -1
      dist/vis.min.css
  9. +22
    -22
      dist/vis.min.js
  10. +7
    -0
      docs/network/edges.html
  11. +4
    -4
      docs/network/index.html
  12. +7
    -0
      docs/network/nodes.html
  13. +1
    -1
      examples/network/nodeStyles/shadows.html
  14. +4
    -4
      examples/network/other/clustering.html
  15. +1
    -1
      lib/DataSet.js
  16. +1
    -1
      lib/header.js
  17. +2
    -2
      lib/network/Network.js
  18. +4
    -8
      lib/network/NetworkUtil.js
  19. +8
    -5
      lib/network/css/network-colorpicker.css
  20. +18
    -5
      lib/network/modules/Canvas.js
  21. +0
    -22
      lib/network/modules/CanvasRenderer.js
  22. +48
    -32
      lib/network/modules/Clustering.js
  23. +3
    -2
      lib/network/modules/EdgesHandler.js
  24. +0
    -4
      lib/network/modules/KamadaKawai.js
  25. +5
    -5
      lib/network/modules/LayoutEngine.js
  26. +8
    -3
      lib/network/modules/ManipulationSystem.js
  27. +4
    -3
      lib/network/modules/NodesHandler.js
  28. +5
    -5
      lib/network/modules/PhysicsEngine.js
  29. +2
    -2
      lib/network/modules/SelectionHandler.js
  30. +3
    -3
      lib/network/modules/View.js
  31. +2
    -2
      lib/network/modules/components/Edge.js
  32. +6
    -4
      lib/network/modules/components/Node.js
  33. +1
    -1
      lib/network/modules/components/edges/BezierEdgeDynamic.js
  34. +1
    -1
      lib/network/modules/components/edges/util/EdgeBase.js
  35. +10
    -9
      lib/network/modules/components/nodes/shapes/Box.js
  36. +1
    -5
      lib/network/modules/components/nodes/shapes/Circle.js
  37. +3
    -3
      lib/network/modules/components/nodes/shapes/CircularImage.js
  38. +1
    -6
      lib/network/modules/components/nodes/shapes/Database.js
  39. +1
    -6
      lib/network/modules/components/nodes/shapes/Image.js
  40. +2
    -2
      lib/network/modules/components/nodes/util/NodeBase.js
  41. +1
    -1
      lib/network/modules/components/physics/BarnesHutSolver.js
  42. +2
    -0
      lib/network/options.js
  43. +31
    -10
      lib/shared/ColorPicker.js
  44. +17
    -9
      lib/shared/Configurator.js
  45. +2
    -2
      lib/timeline/Timeline.js
  46. +0
    -2
      lib/timeline/component/ItemSet.js
  47. +5
    -0
      lib/timeline/component/css/item.css
  48. +0
    -1
      lib/util.js
  49. +3
    -3
      package.json
  50. +65
    -55
      test/networkTest.html

+ 22
- 0
HISTORY.md View File

@ -2,6 +2,28 @@
http://visjs.org
## 2016-01-08, version 4.12.0
### Timeline
- Fixed #1527: error when creating/updating a Timeline without data.
- Fixed #1127: `doubleClick` event not being fired.
- Fixed #1554: wrong cursor on readonly range items.
### Network
- Fixed #1531, #1335: border distances for arrow positioning
- Fixed findNode method. It now does not return internal objects anymore.
- Fixed #1529, clustering and declustering now respects the original settings of the edges for physics and hidden.
- Fixed #1406, control nodes are now drawn immediately without a second redraw.
- Fixed #1404, made the array returned by findNode match the docs.
- Added #1138, enable the user to define the color of the shadows for nodes and edges.
- Fixed #1528, #1278, avoided ID's being cast to string for methods that return ID's as well as storePositions casting to string.
- Fixed upscaling when the window size increases.
- Accepted pull request #1544, thanks @felixhayashi!
- Fixed documented bug in #1544.
## 2015-12-18, version 4.11.0
### Network

+ 1
- 1
LICENSE-MIT View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2014-2015 Almende B.V.
Copyright (c) 2014-2016 Almende B.V.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
NOTICE View File

@ -1,5 +1,5 @@
Vis.js
Copyright 2010-2015 Almende B.V.
Copyright 2010-2016 Almende B.V.
Vis.js is dual licensed under both

+ 1
- 1
bower.json View File

@ -1,6 +1,6 @@
{
"name": "vis",
"version": "4.11.0",
"version": "4.12.0",
"main": ["dist/vis.min.js", "dist/vis.min.css"],
"description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/",

+ 13
- 5
dist/vis.css View File

@ -584,6 +584,11 @@ input.vis-configuration.vis-config-range:focus::-ms-fill-upper {
cursor: e-resize;
}
.vis-range.vis-item.vis-readonly .vis-drag-left,
.vis-range.vis-item.vis-readonly .vis-drag-right {
cursor: auto;
}
.vis-time-axis {
position: relative;
overflow: hidden;
@ -1121,14 +1126,17 @@ div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends {
div.vis-color-picker {
position:absolute;
top: 0px;
left: 30px;
margin-top:-140px;
margin-left:30px;
width:293px;
height:425px;
width:310px;
height:444px;
z-index: 1;
padding: 10px;
border-radius:15px;
background-color:#ffffff;
display:none;
display: none;
box-shadow: rgba(0,0,0,0.5) 0px 0px 10px 0px;
}
@ -1138,8 +1146,8 @@ div.vis-color-picker div.vis-arrow {
left:5px;
}
div.vis-color-picker div.vis-arrow:after,
div.vis-color-picker div.vis-arrow:before {
div.vis-color-picker div.vis-arrow::after,
div.vis-color-picker div.vis-arrow::before {
right: 100%;
top: 50%;
border: solid transparent;

+ 1278
- 819
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.min.css
File diff suppressed because it is too large
View File


+ 22
- 22
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 7
- 0
docs/network/edges.html View File

@ -166,6 +166,7 @@ var options = {
selfReferenceSize:20,
shadow:{
enabled: false,
color: 'rgba(0,0,0,0.5)',
size:10,
x:5,
y:5
@ -581,6 +582,12 @@ var options: {
in this object are defined.
</td>
</tr>
<tr parent="shadow" class="hidden">
<td class="indent">shadow.color</td>
<td>String</td>
<td><code>'rgba(0,0,0,0.5)'</code></td>
<td>The color size of the shadow as a string. Supported formats are 'rgb(255,255,255)', 'rgba(255,255,255,1)' and '#FFFFFF'.</td>
</tr>
<tr parent="shadow" class="hidden">
<td class="indent">shadow.size</td>
<td>Number</td>

+ 4
- 4
docs/network/index.html View File

@ -1319,19 +1319,19 @@ var options = {
</tr>
<tr><td id="event_hoverNode">hoverNode</td>
<td><code>{node: nodeId}</code></td>
<td>Fired interaction:{hover:true} and the mouse hovers over a node.</td>
<td>Fired if the option <code>interaction:{hover:true}</code> is enabled and the mouse hovers over a node.</td>
</tr>
<tr><td id="event_blurNode">blurNode</td>
<td><code>{node: nodeId}</code></td>
<td>Fired interaction:{hover:true} and the mouse moved away from a node it was hovering over before.</td>
<td>Fired if the option <code>interaction:{hover:true}</code> is enabled and the mouse moved away from a node it was hovering over before.</td>
</tr>
<tr><td id="event_hoverEdge">hoverEdge</td>
<td><code>{edge: edgeId}</code></td>
<td>Fired interaction:{hover:true} and the mouse hovers over an edge.</td>
<td>Fired if the option <code>interaction:{hover:true}</code> is enabled and the mouse hovers over an edge.</td>
</tr>
<tr><td id="event_blurEdge">blurEdge</td>
<td><code>{edge: edgeId}</code></td>
<td>Fired interaction:{hover:true} and the mouse moved away from an edge it was hovering over before.</td>
<td>Fired if the option <code>interaction:{hover:true}</code> is enabled and the mouse moved away from an edge it was hovering over before.</td>
</tr>
<tr><td id="event_zoom">zoom</td>
<td><code>{direction:'+'/'-', scale: Number}</code></td>

+ 7
- 0
docs/network/nodes.html View File

@ -171,6 +171,7 @@ var options = {
},
shadow:{
enabled: false,
color: 'rgba(0,0,0,0.5)',
size:10,
x:5,
y:5
@ -585,6 +586,12 @@ mySize = minSize + diff * scale;
in this object are defined.
</td>
</tr>
<tr parent="shadow" class="hidden">
<td class="indent">shadow.color</td>
<td>String</td>
<td><code>'rgba(0,0,0,0.5)'</code></td>
<td>The color size of the shadow as a string. Supported formats are 'rgb(255,255,255)', 'rgba(255,255,255,1)' and '#FFFFFF'.</td>
</tr>
<tr parent="shadow" class="hidden">
<td class="indent">shadow.size</td>
<td>Number</td>

+ 1
- 1
examples/network/nodeStyles/shadows.html View File

@ -87,7 +87,7 @@
{from: 25, to: 24},
{from: 26, to: 25},
{from: 25, to: 7},
{from: 28, to: 27},
{from: 28, to: 27, shadow:{color:'rgb(0,255,0)'}},
{from: 29, to: 28},
{from: 28, to: 0}
]

+ 4
- 4
examples/network/other/clustering.html View File

@ -80,7 +80,7 @@ Click any of the buttons below to cluster the network. On every push the network
network.openCluster(params.nodes[0]);
}
}
})
});
function clusterByCid() {
network.setData(data);
@ -89,7 +89,7 @@ Click any of the buttons below to cluster the network. On every push the network
return childOptions.cid == 1;
},
clusterNodeProperties: {id:'cidCluster', borderWidth:3, shape:'database'}
}
};
network.cluster(clusterOptionsByData);
}
function clusterByColor() {
@ -111,7 +111,7 @@ Click any of the buttons below to cluster the network. On every push the network
return clusterOptions;
},
clusterNodeProperties: {id: 'cluster:' + color, borderWidth: 3, shape: 'database', color:color, label:'color:' + color}
}
};
network.cluster(clusterOptionsByData);
}
}
@ -131,7 +131,7 @@ Click any of the buttons below to cluster the network. On every push the network
return clusterOptions;
},
clusterNodeProperties: {borderWidth:3, shape:'box', font:{size:30}}
}
};
network.clusterByHubsize(undefined, clusterOptionsByData);
}

+ 1
- 1
lib/DataSet.js View File

@ -264,7 +264,7 @@ DataSet.prototype.update = function (data, senderId) {
if (data[i] instanceof Object){
addOrUpdate(data[i]);
} else {
console.warn("Ignoring input item, which is not an object at index"+i);
console.warn('Ignoring input item, which is not an object at index ' + i);
}
}
}

+ 1
- 1
lib/header.js View File

@ -8,7 +8,7 @@
* @date @@date
*
* @license
* Copyright (C) 2011-2015 Almende B.V, http://almende.com
* Copyright (C) 2011-2016 Almende B.V, http://almende.com
*
* Vis.js is dual licensed under both
*

+ 2
- 2
lib/network/Network.js View File

@ -247,7 +247,7 @@ Network.prototype._updateVisibleIndices = function () {
for (let nodeId in nodes) {
if (nodes.hasOwnProperty(nodeId)) {
if (nodes[nodeId].options.hidden === false) {
this.body.nodeIndices.push(nodeId);
this.body.nodeIndices.push(nodes[nodeId].id);
}
}
}
@ -255,7 +255,7 @@ Network.prototype._updateVisibleIndices = function () {
for (let edgeId in edges) {
if (edges.hasOwnProperty(edgeId)) {
if (edges[edgeId].options.hidden === false) {
this.body.edgeIndices.push(edgeId);
this.body.edgeIndices.push(edges[edgeId].id);
}
}
}

+ 4
- 8
lib/network/NetworkUtil.js View File

@ -4,9 +4,8 @@ class NetworkUtil {
/**
* Find the center position of the network considering the bounding boxes
* @private
*/
static _getRange(allNodes, specificNodes = []) {
static getRange(allNodes, specificNodes = []) {
var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node;
if (specificNodes.length > 0) {
for (var i = 0; i < specificNodes.length; i++) {
@ -34,9 +33,8 @@ class NetworkUtil {
/**
* Find the center position of the network
* @private
*/
static _getRangeCore(allNodes, specificNodes = []) {
static getRangeCore(allNodes, specificNodes = []) {
var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node;
if (specificNodes.length > 0) {
for (var i = 0; i < specificNodes.length; i++) {
@ -66,9 +64,8 @@ class NetworkUtil {
/**
* @param {object} range = {minX: minX, maxX: maxX, minY: minY, maxY: maxY};
* @returns {{x: number, y: number}}
* @private
*/
static _findCenter(range) {
static findCenter(range) {
return {x: (0.5 * (range.maxX + range.minX)),
y: (0.5 * (range.maxY + range.minY))};
}
@ -79,9 +76,8 @@ class NetworkUtil {
* @param item
* @param type
* @returns {{}}
* @private
*/
static _cloneOptions(item, type) {
static cloneOptions(item, type) {
let clonedOptions = {};
if (type === undefined || type === 'node') {
util.deepExtend(clonedOptions, item.options, true);

+ 8
- 5
lib/network/css/network-colorpicker.css View File

@ -1,14 +1,17 @@
div.vis-color-picker {
position:absolute;
top: 0px;
left: 30px;
margin-top:-140px;
margin-left:30px;
width:293px;
height:425px;
width:310px;
height:444px;
z-index: 1;
padding: 10px;
border-radius:15px;
background-color:#ffffff;
display:none;
display: none;
box-shadow: rgba(0,0,0,0.5) 0px 0px 10px 0px;
}
@ -18,8 +21,8 @@ div.vis-color-picker div.vis-arrow {
left:5px;
}
div.vis-color-picker div.vis-arrow:after,
div.vis-color-picker div.vis-arrow:before {
div.vis-color-picker div.vis-arrow::after,
div.vis-color-picker div.vis-arrow::before {
right: 100%;
top: 50%;
border: solid transparent;

+ 18
- 5
lib/network/modules/Canvas.js View File

@ -105,8 +105,21 @@ class Canvas {
this.pixelRatio !== 0 &&
this.cameraState.previousWidth > 0) {
this.body.view.scale = this.cameraState.scale * Math.min((this.frame.canvas.width / this.pixelRatio) / this.cameraState.previousWidth,(this.frame.canvas.height / this.pixelRatio) / this.cameraState.previousHeight);
let widthRatio = (this.frame.canvas.width / this.pixelRatio) / this.cameraState.previousWidth;
let heightRatio = (this.frame.canvas.height / this.pixelRatio) / this.cameraState.previousHeight;
let newScale = this.cameraState.scale;
if (widthRatio != 1 && heightRatio != 1) {
newScale = this.cameraState.scale * 0.5 * (widthRatio + heightRatio);
}
else if (widthRatio != 1) {
newScale = this.cameraState.scale * widthRatio;
}
else if (heightRatio != 1) {
newScale = this.cameraState.scale * heightRatio;
}
this.body.view.scale = newScale;
// this comes from the view module.
var currentViewCenter = this.DOMtoCanvas({
x: 0.5 * this.frame.canvas.clientWidth,
@ -241,9 +254,9 @@ class Canvas {
let oldWidth = this.frame.canvas.width;
let oldHeight = this.frame.canvas.height;
// update the pixelratio
// update the pixel ratio
let ctx = this.frame.canvas.getContext("2d");
let previousRation = this.pixelRatio; // we cache this because the camera state storage needs the old value
let previousRatio = this.pixelRatio; // we cache this because the camera state storage needs the old value
this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio ||
ctx.mozBackingStorePixelRatio ||
ctx.msBackingStorePixelRatio ||
@ -251,7 +264,7 @@ class Canvas {
ctx.backingStorePixelRatio || 1);
if (width != this.options.width || height != this.options.height || this.frame.style.width != width || this.frame.style.height != height) {
this._getCameraState(previousRation);
this._getCameraState(previousRatio);
this.frame.style.width = width;
this.frame.style.height = height;
@ -273,7 +286,7 @@ class Canvas {
// store the camera if there is a change in size.
if (this.frame.canvas.width != Math.round(this.frame.canvas.clientWidth * this.pixelRatio) || this.frame.canvas.height != Math.round(this.frame.canvas.clientHeight * this.pixelRatio)) {
this._getCameraState(previousRation);
this._getCameraState(previousRatio);
}
if (this.frame.canvas.width != Math.round(this.frame.canvas.clientWidth * this.pixelRatio)) {

+ 0
- 22
lib/network/modules/CanvasRenderer.js View File

@ -184,10 +184,6 @@ class CanvasRenderer {
this._drawNodes(ctx, hidden);
}
if (this.controlNodesActive === true) {
this._drawControlNodes(ctx);
}
ctx.beginPath();
this.body.emitter.emit("afterDrawing", ctx);
ctx.closePath();
@ -259,7 +255,6 @@ class CanvasRenderer {
});
let viewableArea = {top:topLeft.y,left:topLeft.x,bottom:bottomRight.y,right:bottomRight.x};
// draw unselected nodes;
for (let i = 0; i < nodeIndices.length; i++) {
node = nodes[nodeIndices[i]];
@ -307,23 +302,6 @@ class CanvasRenderer {
}
}
/**
* Redraw all edges
* The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
* @param {CanvasRenderingContext2D} ctx
* @private
*/
_drawControlNodes(ctx) {
let edges = this.body.edges;
let edgeIndices = this.body.edgeIndices;
let edge;
for (let i = 0; i < edgeIndices.length; i++) {
edge = edges[edgeIndices[i]];
edge._drawControlNodes(ctx);
}
}
/**
* Determine if the browser requires a setTimeout or a requestAnimationFrame. This was required because
* some implementations (safari and IE9) did not support requestAnimationFrame

+ 48
- 32
lib/network/modules/Clustering.js View File

@ -6,12 +6,13 @@ class ClusterEngine {
constructor(body) {
this.body = body;
this.clusteredNodes = {};
this.clusteredEdges = {};
this.options = {};
this.defaultOptions = {};
util.extend(this.options, this.defaultOptions);
this.body.emitter.on('_resetData', () => {this.clusteredNodes = {};})
this.body.emitter.on('_resetData', () => {this.clusteredNodes = {}; this.clusteredEdges = {};})
}
setOptions(options) {
@ -68,14 +69,14 @@ class ClusterEngine {
for (let i = 0; i < this.body.nodeIndices.length; i++) {
let nodeId = this.body.nodeIndices[i];
let node = this.body.nodes[nodeId];
let clonedOptions = NetworkUtil._cloneOptions(node);
let clonedOptions = NetworkUtil.cloneOptions(node);
if (options.joinCondition(clonedOptions) === true) {
childNodesObj[nodeId] = this.body.nodes[nodeId];
// collect the nodes that will be in the cluster
for (let i = 0; i < node.edges.length; i++) {
let edge = node.edges[i];
if (edge.hiddenByCluster !== true) {
if (this.clusteredEdges[edge.id] === undefined) {
childEdgesObj[edge.id] = edge;
}
}
@ -110,7 +111,7 @@ class ClusterEngine {
edges = [];
for (let j = 0; j < node.edges.length; j++) {
edge = node.edges[j];
if (edge.hiddenByCluster !== true) {
if (this.clusteredEdges[edge.id] === undefined) {
if (edge.toId !== edge.fromId) {
relevantEdgeCount++;
}
@ -132,7 +133,7 @@ class ClusterEngine {
usedNodes[nodeId] = true;
}
else {
let clonedOptions = NetworkUtil._cloneOptions(this.body.nodes[nodeId]);
let clonedOptions = NetworkUtil.cloneOptions(this.body.nodes[nodeId]);
if (options.joinCondition(clonedOptions) === true) {
childEdgesObj[edge.id] = edge;
childNodesObj[nodeId] = this.body.nodes[nodeId];
@ -208,16 +209,16 @@ class ClusterEngine {
let childNodesObj = {};
let childEdgesObj = {};
let parentNodeId = node.id;
let parentClonedOptions = NetworkUtil._cloneOptions(node);
let parentClonedOptions = NetworkUtil.cloneOptions(node);
childNodesObj[parentNodeId] = node;
// collect the nodes that will be in the cluster
for (let i = 0; i < node.edges.length; i++) {
let edge = node.edges[i];
if (edge.hiddenByCluster !== true) {
if (this.clusteredEdges[edge.id] === undefined) {
let childNodeId = this._getConnectedId(edge, parentNodeId);
// if the child node is not in a cluster (may not be needed now with the edge.hiddenByCluster check)
// if the child node is not in a cluster
if (this.clusteredNodes[childNodeId] === undefined) {
if (childNodeId !== parentNodeId) {
if (options.joinCondition === undefined) {
@ -226,7 +227,7 @@ class ClusterEngine {
}
else {
// clone the options and insert some additional parameters that could be interesting.
let childClonedOptions = NetworkUtil._cloneOptions(this.body.nodes[childNodeId]);
let childClonedOptions = NetworkUtil.cloneOptions(this.body.nodes[childNodeId]);
if (options.joinCondition(parentClonedOptions, childClonedOptions) === true) {
childEdgesObj[edge.id] = edge;
childNodesObj[childNodeId] = this.body.nodes[childNodeId];
@ -250,8 +251,9 @@ class ClusterEngine {
* It looks for edges that are connected to the nodes from the "outside' of the cluster.
*
* @param childNodesObj
* @param newEdges
* @param options
* @param childEdgesObj
* @param clusterNodeProperties
* @param clusterEdgeProperties
* @private
*/
_createClusterEdges (childNodesObj, childEdgesObj, clusterNodeProperties, clusterEdgeProperties) {
@ -269,7 +271,7 @@ class ClusterEngine {
for (let j = 0; j < childNode.edges.length; j++) {
edge = childNode.edges[j];
// we only handle edges that are visible to the system, not the disabled ones from the clustering process.
if (edge.hiddenByCluster !== true) {
if (this.clusteredEdges[edge.id] === undefined) {
// self-referencing edges will be added to the "hidden" list
if (edge.toId == edge.fromId) {
childEdgesObj[edge.id] = edge;
@ -301,7 +303,7 @@ class ClusterEngine {
for (let j = 0; j < createEdges.length; j++) {
let edge = createEdges[j].edge;
// copy the options of the edge we will replace
let clonedOptions = NetworkUtil._cloneOptions(edge, 'edge');
let clonedOptions = NetworkUtil.cloneOptions(edge, 'edge');
// make sure the properties of clusterEdges are superimposed on it
util.deepExtend(clonedOptions, clusterEdgeProperties);
@ -320,8 +322,8 @@ class ClusterEngine {
newEdge.connect();
// hide the replaced edge
this._backupEdgeOptions(edge);
edge.setOptions({physics:false, hidden:true});
edge.hiddenByCluster = true;
}
}
@ -349,7 +351,7 @@ class ClusterEngine {
* @private
*/
_cluster(childNodesObj, childEdgesObj, options, refreshData = true) {
// kill condition: no children so can't cluster or only one node in the cluster, dont bother
// kill condition: no children so can't cluster or only one node in the cluster, don't bother
if (Object.keys(childNodesObj).length < 2) {return;}
// check if this cluster call is not trying to cluster anything that is in another cluster.
@ -369,18 +371,18 @@ class ClusterEngine {
let childNodesOptions = [];
for (let nodeId in childNodesObj) {
if (childNodesObj.hasOwnProperty(nodeId)) {
let clonedOptions = NetworkUtil._cloneOptions(childNodesObj[nodeId]);
let clonedOptions = NetworkUtil.cloneOptions(childNodesObj[nodeId]);
childNodesOptions.push(clonedOptions);
}
}
// get clusterproperties based on childNodes
// get cluster properties based on childNodes
let childEdgesOptions = [];
for (let edgeId in childEdgesObj) {
if (childEdgesObj.hasOwnProperty(edgeId)) {
// these cluster edges will be removed on creation of the cluster.
if (edgeId.substr(0, 12) !== "clusterEdge:") {
let clonedOptions = NetworkUtil._cloneOptions(childEdgesObj[edgeId], 'edge');
let clonedOptions = NetworkUtil.cloneOptions(childEdgesObj[edgeId], 'edge');
childEdgesOptions.push(clonedOptions);
}
}
@ -401,7 +403,7 @@ class ClusterEngine {
}
// give the clusterNode a postion if it does not have one.
// give the clusterNode a position if it does not have one.
let pos = undefined;
if (clusterNodeProperties.x === undefined) {
pos = this._getClusterPosition(childNodesObj);
@ -434,8 +436,10 @@ class ClusterEngine {
if (childEdgesObj.hasOwnProperty(edgeId)) {
if (this.body.edges[edgeId] !== undefined) {
let edge = this.body.edges[edgeId];
// cache the options before changing
this._backupEdgeOptions(edge);
// disable physics and hide the edge
edge.setOptions({physics:false, hidden:true});
edge.hiddenByCluster = true;
}
}
}
@ -457,6 +461,20 @@ class ClusterEngine {
}
}
_backupEdgeOptions(edge) {
if (this.clusteredEdges[edge.id] === undefined) {
this.clusteredEdges[edge.id] = {physics: edge.options.physics, hidden: edge.options.hidden};
}
}
_restoreEdge(edge) {
let originalOptions = this.clusteredEdges[edge.id];
if (originalOptions !== undefined) {
edge.setOptions({physics: originalOptions.physics, hidden: originalOptions.hidden});
delete this.clusteredEdges[edge.id];
}
}
/**
* Check if a node is a cluster.
@ -561,7 +579,7 @@ class ClusterEngine {
containedNode.vx = clusterNode.vx;
containedNode.vy = clusterNode.vy;
// we use these methods to avoid reinstantiating the shape, which happens with setOptions.
// we use these methods to avoid re-instantiating the shape, which happens with setOptions.
containedNode.setOptions({hidden:false, physics:true});
delete this.clusteredNodes[nodeId];
@ -602,7 +620,7 @@ class ClusterEngine {
}
// clone the options and apply the cluster options to them
let clonedOptions = NetworkUtil._cloneOptions(transferEdge, 'edge');
let clonedOptions = NetworkUtil.cloneOptions(transferEdge, 'edge');
util.deepExtend(clonedOptions, otherCluster.clusterEdgeProperties);
// apply the edge specific options to it.
@ -619,8 +637,7 @@ class ClusterEngine {
else {
let replacedEdge = this.body.edges[edge.clusteringEdgeReplacingId];
if (replacedEdge !== undefined) {
replacedEdge.setOptions({physics: true, hidden: false});
replacedEdge.hiddenByCluster = false;
this._restoreEdge(replacedEdge);
}
}
edge.cleanup();
@ -632,10 +649,7 @@ class ClusterEngine {
// handle the releasing of the edges
for (let edgeId in containedEdges) {
if (containedEdges.hasOwnProperty(edgeId)) {
let edge = containedEdges[edgeId];
edge.setOptions({physics: true, hidden: false});
edge.hiddenByCluster = undefined;
delete edge.hiddenByCluster;
this._restoreEdge(containedEdges[edgeId]);
}
}
@ -648,12 +662,12 @@ class ClusterEngine {
}
getNodesInCluster(clusterId) {
let nodesArray = []
let nodesArray = [];
if (this.isCluster(clusterId) === true) {
let containedNodes = this.body.nodes[clusterId].containedNodes;
for (let nodeId in containedNodes) {
if (containedNodes.hasOwnProperty(nodeId)) {
nodesArray.push(nodeId)
nodesArray.push(this.body.nodes[nodeId].id)
}
}
}
@ -672,11 +686,13 @@ class ClusterEngine {
let counter = 0;
while (this.clusteredNodes[nodeId] !== undefined && counter < max) {
stack.push(this.clusteredNodes[nodeId].node);
stack.push(this.body.nodes[nodeId].id);
nodeId = this.clusteredNodes[nodeId].clusterId;
counter++;
}
stack.push(this.body.nodes[nodeId]);
stack.push(this.body.nodes[nodeId].id);
stack.reverse();
return stack;
}

+ 3
- 2
lib/network/modules/EdgesHandler.js View File

@ -74,6 +74,7 @@ class EdgesHandler {
selfReferenceSize:20,
shadow:{
enabled: false,
color: 'rgba(0,0,0,0.5)',
size:10,
x:5,
y:5
@ -106,7 +107,7 @@ class EdgesHandler {
let edge = this.body.edges[edgeId];
let edgeData = this.body.data.edges._data[edgeId];
// only forcilby remove the smooth curve if the data has been set of the edge has the smooth curves defined.
// only forcibly remove the smooth curve if the data has been set of the edge has the smooth curves defined.
// this is because a change in the global would not affect these curves.
if (edgeData !== undefined) {
let edgeOptions = edgeData.smooth;
@ -153,7 +154,7 @@ class EdgesHandler {
// use the parser from the Edge class to fill in all shorthand notations
Edge.parseOptions(this.options, options);
// hanlde multiple input cases for color
// handle multiple input cases for color
if (options.color !== undefined) {
this.markAllEdgesAsDirty();
}

+ 0
- 4
lib/network/modules/KamadaKawai.js View File

@ -1,7 +1,3 @@
/**
* Created by Alex on 8/7/2015.
*/
// distance finding algorithm
import FloydWarshall from "./components/algorithms/FloydWarshall.js"

+ 5
- 5
lib/network/modules/LayoutEngine.js View File

@ -249,8 +249,8 @@ class LayoutEngine {
* @private
*/
_shiftToCenter() {
let range = NetworkUtil._getRangeCore(this.body.nodes, this.body.nodeIndices);
let center = NetworkUtil._findCenter(range);
let range = NetworkUtil.getRangeCore(this.body.nodes, this.body.nodeIndices);
let center = NetworkUtil.findCenter(range);
for (let i = 0; i < this.body.nodeIndices.length; i++) {
this.body.nodes[this.body.nodeIndices[i]].x -= center.x;
this.body.nodes[this.body.nodeIndices[i]].y -= center.y;
@ -501,9 +501,9 @@ class LayoutEngine {
if (levelA === undefined) {this.hierarchicalLevels[nodeA.id] = minLevel;}
let diff = customCallback(
NetworkUtil._cloneOptions(nodeA,'node'),
NetworkUtil._cloneOptions(nodeB,'node'),
NetworkUtil._cloneOptions(edge,'edge')
NetworkUtil.cloneOptions(nodeA,'node'),
NetworkUtil.cloneOptions(nodeB,'node'),
NetworkUtil.cloneOptions(edge,'edge')
);
this.hierarchicalLevels[nodeB.id] = this.hierarchicalLevels[nodeA.id] + diff;

+ 8
- 3
lib/network/modules/ManipulationSystem.js View File

@ -110,6 +110,7 @@ class ManipulationSystem {
}
}
enableEditMode() {
this.editMode = true;
@ -143,7 +144,7 @@ class ManipulationSystem {
// restore the state of any bound functions or events, remove control nodes, restore physics
this._clean();
// reset global letiables
// reset global variables
this.manipulationDOM = {};
// if the gui is enabled, draw all elements.
@ -330,7 +331,7 @@ class ManipulationSystem {
* create the toolbar to edit edges
*/
editEdgeMode() {
// when using the gui, enable edit mode if it wasnt already.
// when using the gui, enable edit mode if it wasn't already.
if (this.editMode !== true) {
this.enableEditMode();
}
@ -547,7 +548,11 @@ class ManipulationSystem {
controlNodeStyle.x = x;
controlNodeStyle.y = y;
return this.body.functions.createNode(controlNodeStyle);
// we have to define the bounding box in order for the nodes to be drawn immediately
let node = this.body.functions.createNode(controlNodeStyle);
node.shape.boundingBox = {left: x, right:x, top:y, bottom:y};
return node;
}

+ 4
- 3
lib/network/modules/NodesHandler.js View File

@ -87,6 +87,7 @@ class NodesHandler {
},
shadow: {
enabled: false,
color: 'rgba(0,0,0,0.5)',
size: 10,
x: 5,
y: 5
@ -356,7 +357,7 @@ class NodesHandler {
if (dataset._data.hasOwnProperty(nodeId)) {
let node = this.body.nodes[nodeId];
if (dataset._data[nodeId].x != Math.round(node.x) || dataset._data[nodeId].y != Math.round(node.y)) {
dataArray.push({ id: nodeId, x: Math.round(node.x), y: Math.round(node.y) });
dataArray.push({ id: node.id, x: Math.round(node.x), y: Math.round(node.y) });
}
}
}
@ -387,13 +388,13 @@ class NodesHandler {
let nodeObj = {}; // used to quickly check if node already exists
for (let i = 0; i < node.edges.length; i++) {
let edge = node.edges[i];
if (edge.toId == nodeId) { // these are double equals since ids can be numeric or string
if (edge.toId == node.id) { // these are double equals since ids can be numeric or string
if (nodeObj[edge.fromId] === undefined) {
nodeList.push(edge.fromId);
nodeObj[edge.fromId] = true;
}
}
else if (edge.fromId == nodeId) { // these are double equals since ids can be numeric or string
else if (edge.fromId == node.id) { // these are double equals since ids can be numeric or string
if (nodeObj[edge.toId] === undefined) {
nodeList.push(edge.toId);
nodeObj[edge.toId] = true;

+ 5
- 5
lib/network/modules/PhysicsEngine.js View File

@ -137,7 +137,7 @@ class PhysicsEngine {
else {
this.physicsEnabled = true;
util.selectiveNotDeepExtend(['stabilization'], this.options, options);
util.mergeOptions(this.options, options, 'stabilization')
util.mergeOptions(this.options, options, 'stabilization');
if (options.enabled === undefined) {
this.options.enabled = true;
@ -254,7 +254,7 @@ class PhysicsEngine {
/**
* The viewFunction inserts this step into each renderloop. It calls the physics tick and handles the cleanup at stabilized.
* The viewFunction inserts this step into each render loop. It calls the physics tick and handles the cleanup at stabilized.
*
*/
simulationStep() {
@ -386,7 +386,7 @@ class PhysicsEngine {
for (let nodeId in nodes) {
if (nodes.hasOwnProperty(nodeId)) {
if (nodes[nodeId].options.physics === true) {
this.physicsBody.physicsNodeIndices.push(nodeId);
this.physicsBody.physicsNodeIndices.push(nodes[nodeId].id);
}
}
}
@ -395,7 +395,7 @@ class PhysicsEngine {
for (let edgeId in edges) {
if (edges.hasOwnProperty(edgeId)) {
if (edges[edgeId].options.physics === true) {
this.physicsBody.physicsEdgeIndices.push(edgeId);
this.physicsBody.physicsEdgeIndices.push(edges[edgeId].id);
}
}
}
@ -473,7 +473,7 @@ class PhysicsEngine {
}
/**
* move the nodes one timestap and check if they are stabilized
* move the nodes one timestep and check if they are stabilized
* @returns {boolean}
*/
moveNodes() {

+ 2
- 2
lib/network/modules/SelectionHandler.js View File

@ -572,7 +572,7 @@ class SelectionHandler {
if (this.options.selectable === true) {
for (let nodeId in this.selectionObj.nodes) {
if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
idArray.push(nodeId);
idArray.push(this.selectionObj.nodes[nodeId].id);
}
}
}
@ -590,7 +590,7 @@ class SelectionHandler {
if (this.options.selectable === true) {
for (let edgeId in this.selectionObj.edges) {
if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
idArray.push(edgeId);
idArray.push(this.selectionObj.edges[edgeId].id);
}
}
}

+ 3
- 3
lib/network/modules/View.js View File

@ -60,7 +60,7 @@ class View {
return;
}
range = NetworkUtil._getRange(this.body.nodes, options.nodes);
range = NetworkUtil.getRange(this.body.nodes, options.nodes);
let numberOfNodes = this.body.nodeIndices.length;
zoomLevel = 12.662 / (numberOfNodes + 7.4147) + 0.0964822; // this is obtained from fitting a dataset from 5 points with scale levels that looked good.
@ -71,7 +71,7 @@ class View {
}
else {
this.body.emitter.emit("_resizeNodes");
range = NetworkUtil._getRange(this.body.nodes, options.nodes);
range = NetworkUtil.getRange(this.body.nodes, options.nodes);
let xDistance = Math.abs(range.maxX - range.minX) * 1.1;
let yDistance = Math.abs(range.maxY - range.minY) * 1.1;
@ -89,7 +89,7 @@ class View {
zoomLevel = 1.0;
}
let center = NetworkUtil._findCenter(range);
let center = NetworkUtil.findCenter(range);
let animationOptions = {position: center, scale: zoomLevel, animation: options.animation};
this.moveTo(animationOptions);
}

+ 2
- 2
lib/network/modules/components/Edge.js View File

@ -137,7 +137,7 @@ class Edge {
parentOptions.scaling = Object.create(globalOptions.scaling); // this sets the pointer of the option back to the global option.
}
// hanlde multiple input cases for arrows
// handle multiple input cases for arrows
if (newOptions.arrows !== undefined && newOptions.arrows !== null) {
if (typeof newOptions.arrows === 'string') {
let arrows = newOptions.arrows.toLowerCase();
@ -158,7 +158,7 @@ class Edge {
parentOptions.arrows = Object.create(globalOptions.arrows); // this sets the pointer of the option back to the global option.
}
// hanlde multiple input cases for color
// handle multiple input cases for color
if (newOptions.color !== undefined && newOptions.color !== null) {
// make a copy of the parent object in case this is referring to the global one (due to object create once, then update)
parentOptions.color = util.deepExtend({}, parentOptions.color, true);

+ 6
- 4
lib/network/modules/components/Node.js View File

@ -162,6 +162,8 @@ class Node {
* Static so it can also be used by the handler.
* @param parentOptions
* @param newOptions
* @param allowDeletion
* @param globalOptions
*/
static parseOptions(parentOptions, newOptions, allowDeletion = false, globalOptions = {}) {
var fields = [
@ -432,10 +434,10 @@ class Node {
*/
isBoundingBoxOverlappingWith(obj) {
return (
this.shape.boundingBox.left < obj.right &&
this.shape.boundingBox.right > obj.left &&
this.shape.boundingBox.top < obj.bottom &&
this.shape.boundingBox.bottom > obj.top
this.shape.boundingBox.left < obj.right &&
this.shape.boundingBox.right > obj.left &&
this.shape.boundingBox.top < obj.bottom &&
this.shape.boundingBox.bottom > obj.top
);
}
}

+ 1
- 1
lib/network/modules/components/edges/BezierEdgeDynamic.js View File

@ -39,7 +39,7 @@ class BezierEdgeDynamic extends BezierEdgeBase {
this.via.setOptions({physics:false})
}
else {
// fix weird behaviour where a selfreferencing node has physics enabled
// fix weird behaviour where a self referencing node has physics enabled
if (this.from.id === this.to.id) {
this.via.setOptions({physics: false})
}

+ 1
- 1
lib/network/modules/components/edges/util/EdgeBase.js View File

@ -504,7 +504,7 @@ class EdgeBase {
enableShadow(ctx) {
if (this.options.shadow.enabled === true) {
ctx.shadowColor = 'rgba(0,0,0,0.5)';
ctx.shadowColor = this.options.shadow.color;
ctx.shadowBlur = this.options.shadow.size;
ctx.shadowOffsetX = this.options.shadow.x;
ctx.shadowOffsetY = this.options.shadow.y;

+ 10
- 9
lib/network/modules/components/nodes/shapes/Box.js View File

@ -60,19 +60,20 @@ class Box extends NodeBase {
this.left = x - this.width * 0.5;
this.top = y - this.height * 0.5;
this.boundingBox.left = this.left;
this.boundingBox.top = this.top;
this.boundingBox.bottom = this.top + this.height;
this.boundingBox.right = this.left + this.width;
let borderRadius = this.options.shapeProperties.borderRadius; // only effective for box
this.boundingBox.left = this.left - borderRadius;
this.boundingBox.top = this.top - borderRadius;
this.boundingBox.bottom = this.top + this.height + borderRadius;
this.boundingBox.right = this.left + this.width + borderRadius;
}
distanceToBorder(ctx, angle) {
this.resize(ctx);
let a = this.width / 2;
let b = this.height / 2;
let w = (Math.sin(angle) * a);
let h = (Math.cos(angle) * b);
return a * b / Math.sqrt(w * w + h * h);
let borderWidth = this.options.borderWidth;
return Math.min(
Math.abs((this.width) / 2 / Math.cos(angle)),
Math.abs((this.height) / 2 / Math.sin(angle))) + borderWidth;
}
}

+ 1
- 5
lib/network/modules/components/nodes/shapes/Circle.js View File

@ -45,11 +45,7 @@ class Circle extends CircleImageBase {
distanceToBorder(ctx, angle) {
this.resize(ctx);
var a = this.width / 2;
var b = this.height / 2;
var w = (Math.sin(angle) * a);
var h = (Math.cos(angle) * b);
return a * b / Math.sqrt(w * w + h * h);
return this.width * 0.5;
}
}

+ 3
- 3
lib/network/modules/components/nodes/shapes/CircularImage.js View File

@ -38,10 +38,10 @@ class CircularImage extends CircleImageBase {
let size = Math.min(0.5*this.height, 0.5*this.width);
// draw the backgroun circle. IMPORTANT: the stroke in this method is used by the clip method below.
// draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below.
this._drawRawCircle(ctx, x, y, selected, hover, size);
// now we draw in the cicle, we save so we can revert the clip operation after drawing.
// now we draw in the circle, we save so we can revert the clip operation after drawing.
ctx.save();
// clip is used to use the stroke in drawRawCircle as an area that we can draw in.
ctx.clip();
@ -68,7 +68,7 @@ class CircularImage extends CircleImageBase {
distanceToBorder(ctx, angle) {
this.resize(ctx);
return this._distanceToBorder(ctx,angle);
return this.width * 0.5;
}
}

+ 1
- 6
lib/network/modules/components/nodes/shapes/Database.js View File

@ -67,12 +67,7 @@ class Database extends NodeBase {
}
distanceToBorder(ctx, angle) {
this.resize(ctx);
var a = this.width / 2;
var b = this.height / 2;
var w = (Math.sin(angle) * a);
var h = (Math.cos(angle) * b);
return a * b / Math.sqrt(w * w + h * h);
return this._distanceToBorder(ctx,angle);
}
}

+ 1
- 6
lib/network/modules/components/nodes/shapes/Image.js View File

@ -77,12 +77,7 @@ class Image extends CircleImageBase {
}
distanceToBorder(ctx, angle) {
this.resize(ctx);
var a = this.width / 2;
var b = this.height / 2;
var w = (Math.sin(angle) * a);
var h = (Math.cos(angle) * b);
return a * b / Math.sqrt(w * w + h * h);
return this._distanceToBorder(ctx,angle);
}
}

+ 2
- 2
lib/network/modules/components/nodes/util/NodeBase.js View File

@ -16,7 +16,7 @@ class NodeBase {
}
_distanceToBorder(ctx,angle) {
var borderWidth = 1;
var borderWidth = this.options.borderWidth;
this.resize(ctx);
return Math.min(
Math.abs(this.width / 2 / Math.cos(angle)),
@ -25,7 +25,7 @@ class NodeBase {
enableShadow(ctx) {
if (this.options.shadow.enabled === true) {
ctx.shadowColor = 'rgba(0,0,0,0.5)';
ctx.shadowColor = this.options.shadow.color;
ctx.shadowBlur = this.options.shadow.size;
ctx.shadowOffsetX = this.options.shadow.x;
ctx.shadowOffsetY = this.options.shadow.y;

+ 1
- 1
lib/network/modules/components/physics/BarnesHutSolver.js View File

@ -24,7 +24,7 @@ class BarnesHutSolver {
/**
* This function calculates the forces the nodes apply on eachother based on a gravitational model.
* This function calculates the forces the nodes apply on each other based on a gravitational model.
* The Barnes Hut method is used to speed up this N-body simulation.
*
* @private

+ 2
- 0
lib/network/options.js View File

@ -72,6 +72,7 @@ let allOptions = {
selfReferenceSize: { number },
shadow: {
enabled: { boolean },
color: { string },
size: { number },
x: { number },
y: { number },
@ -204,6 +205,7 @@ let allOptions = {
},
shadow: {
enabled: { boolean },
color: { string },
size: { number },
x: { number },
y: { number },

+ 31
- 10
lib/shared/ColorPicker.js View File

@ -16,6 +16,7 @@ class ColorPicker {
// bound by
this.updateCallback = () => {};
this.closeCallback = () => {};
// create all DOM elements
this._create();
@ -42,12 +43,25 @@ class ColorPicker {
* the callback is executed on apply and save. Bind it to the application
* @param callback
*/
setCallback(callback) {
setUpdateCallback(callback) {
if (typeof callback === 'function') {
this.updateCallback = callback;
}
else {
throw new Error("Function attempted to set as colorPicker callback is not a function.");
throw new Error("Function attempted to set as colorPicker update callback is not a function.");
}
}
/**
* the callback is executed on apply and save. Bind it to the application
* @param callback
*/
setCloseCallback(callback) {
if (typeof callback === 'function') {
this.closeCallback = callback;
}
else {
throw new Error("Function attempted to set as colorPicker closing callback is not a function.");
}
}
@ -119,19 +133,20 @@ class ColorPicker {
/**
* this shows the color picker at a location. The hue circle is constructed once and stored.
* @param x
* @param y
* this shows the color picker.
* The hue circle is constructed once and stored.
*/
show(x,y) {
show() {
if (this.closeCallback !== undefined) {
this.closeCallback();
this.closeCallback = undefined;
}
this.applied = false;
this.frame.style.display = 'block';
this.frame.style.top = y + 'px';
this.frame.style.left = x + 'px';
this._generateHueCircle();
}
// ------------------------------------------ PRIVATE ----------------------------- //
/**
@ -151,6 +166,12 @@ class ColorPicker {
}
this.frame.style.display = 'none';
// call the closing callback, restoring the onclick method.
if (this.closeCallback !== undefined) {
this.closeCallback();
this.closeCallback = undefined;
}
}
@ -244,7 +265,7 @@ class ColorPicker {
/**
* update the colorpicker. A black circle overlays the hue circle to mimic the brightness decreasing.
* update the color picker. A black circle overlays the hue circle to mimic the brightness decreasing.
* @param rgba
* @private
*/

+ 17
- 9
lib/shared/Configurator.js View File

@ -140,7 +140,7 @@ class Configurator {
// a header for the category
this._makeHeader(option);
// get the suboptions
// get the sub options
this._handleObject(this.configureOptions[option], [option]);
}
counter++;
@ -163,7 +163,7 @@ class Configurator {
}
this._push();
this.colorPicker.insertTo(this.container);
//~ this.colorPicker.insertTo(this.container);
}
@ -530,17 +530,25 @@ class Configurator {
* @private
*/
_showColorPicker(value, div, path) {
let rect = div.getBoundingClientRect();
let bodyRect = document.body.getBoundingClientRect();
let pickerX = rect.left + rect.width + 5;
let pickerY = rect.top - bodyRect.top + rect.height +2;
this.colorPicker.show(pickerX,pickerY);
// clear the callback from this div
div.onclick = function() {};
this.colorPicker.insertTo(div);
this.colorPicker.show();
this.colorPicker.setColor(value);
this.colorPicker.setCallback((color) => {
this.colorPicker.setUpdateCallback((color) => {
let colorString = 'rgba(' + color.r + ',' + color.g + ',' + color.b + ',' + color.a + ')';
div.style.backgroundColor = colorString;
this._update(colorString,path);
})
});
// on close of the colorpicker, restore the callback.
this.colorPicker.setCloseCallback(() => {
div.onclick = () => {
this._showColorPicker(value,div,path);
};
});
}

+ 2
- 2
lib/timeline/Timeline.js View File

@ -379,8 +379,8 @@ Timeline.prototype.fit = function (options) {
Timeline.prototype.getItemRange = function () {
// get a rough approximation for the range based on the items start and end dates
var range = this.getDataRange();
var min = range.min.valueOf();
var max = range.max.valueOf();
var min = range.min !== null ? range.min.valueOf() : null;
var max = range.max !== null ? range.max.valueOf() : null;
var minItem = null;
var maxItem = null;

+ 0
- 2
lib/timeline/component/ItemSet.js View File

@ -1691,8 +1691,6 @@ ItemSet.prototype._onAddItem = function (event) {
var snap = this.options.snap || null;
var item = this.itemFromTarget(event);
event.stopPropagation();
if (item) {
// update item

+ 5
- 0
lib/timeline/component/css/item.css View File

@ -123,3 +123,8 @@
cursor: e-resize;
}
.vis-range.vis-item.vis-readonly .vis-drag-left,
.vis-range.vis-item.vis-readonly .vis-drag-right {
cursor: auto;
}

+ 0
- 1
lib/util.js View File

@ -1278,7 +1278,6 @@ exports.insertSort = function (a,compare) {
* @param [object] mergeTarget | this is either this.options or the options used for the groups.
* @param [object] options | options
* @param [String] option | this is the option key in the options argument
* @private
*/
exports.mergeOptions = function (mergeTarget, options, option, allowDeletion = false, globalOptions = {}) {
if (options[option] === null) {

+ 3
- 3
package.json View File

@ -1,6 +1,6 @@
{
"name": "vis",
"version": "4.11.0",
"version": "4.12.0",
"description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/",
"license": "(Apache-2.0 OR MIT)",
@ -31,10 +31,10 @@
"dependencies": {},
"devDependencies": {
"emitter-component": "^1.1.1",
"hammerjs": "^2.0.4",
"hammerjs": "^2.0.6",
"keycharm": "^0.2.0",
"moment": "^2.10.2",
"propagating-hammerjs": "^1.4.3",
"propagating-hammerjs": "^1.4.4",
"uuid": "^2.0.1",
"babel": "^5.1.11",
"babel-loader": "^5.0.0",

+ 65
- 55
test/networkTest.html
File diff suppressed because it is too large
View File


Loading…
Cancel
Save