From 683544c51f88233b8fd63cc839584d5d79103c00 Mon Sep 17 00:00:00 2001 From: wimrijnders Date: Thu, 12 Oct 2017 10:29:00 +0200 Subject: [PATCH 1/3] Network: Relax clustering condition for adding already clustered nodes to cluster (#3554) Previous condition was too strict: if *any* node for the cluster was already clustered, the clustering would abort. Current fix scans for already clustered nodes and proceeds with what is left. --- lib/network/modules/Clustering.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/network/modules/Clustering.js b/lib/network/modules/Clustering.js index 9a0b0144..6d9a1a59 100644 --- a/lib/network/modules/Clustering.js +++ b/lib/network/modules/Clustering.js @@ -524,21 +524,26 @@ class ClusterEngine { * @private */ _cluster(childNodesObj, childEdgesObj, options, refreshData = true) { - // kill condition: no nodes don't bother - if (Object.keys(childNodesObj).length == 0) {return;} - - // allow clusters of 1 if options allow - if (Object.keys(childNodesObj).length == 1 && options.clusterNodeProperties.allowSingleNodeCluster != true) {return;} - - // check if this cluster call is not trying to cluster anything that is in another cluster. + // Remove nodes which are already clustered + var tmpNodesToRemove = [] for (let nodeId in childNodesObj) { if (childNodesObj.hasOwnProperty(nodeId)) { if (this.clusteredNodes[nodeId] !== undefined) { - return; + tmpNodesToRemove.push(nodeId); } } } + for (var n = 0; n < tmpNodesToRemove.length; ++n) { + delete childNodesObj[tmpNodesToRemove[n]]; + } + + // kill condition: no nodes don't bother + if (Object.keys(childNodesObj).length == 0) {return;} + + // allow clusters of 1 if options allow + if (Object.keys(childNodesObj).length == 1 && options.clusterNodeProperties.allowSingleNodeCluster != true) {return;} + let clusterNodeProperties = util.deepExtend({},options.clusterNodeProperties); // construct the clusterNodeProperties From d828ad04a9909ebbb9c944f86c6fefa24d0664f0 Mon Sep 17 00:00:00 2001 From: Yotam Berkowitz Date: Thu, 12 Oct 2017 14:02:53 +0300 Subject: [PATCH 2/3] v4.21.0 --- HISTORY.md | 91 ++++++++++++++++++++++++++++++ misc/RELEASE_CHECKLIST_TEMPLATE.md | 1 + package.json | 2 +- 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index e8d2daea..62d12bfb 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,97 @@ http://visjs.org +## 2017-10-12, version 4.21.0 + +### General +- Added #3394: Adds unit tests for add, setOptions and on/off DataSet +- FIX #3406: Eliminate possibility of 'window is undefined' during travis test +- Added #3402: added @macleodbroad-wf to the support team +- FIX #3392: Addresses TODOs in Queue unit test by adding unit tests for setOptions and destroy +- Added #3354: Adds missing jsdoc and adds lint rule require-jsdoc to build process +- Added #3331 - Enable linting for Travis +- Added #3312, #3311, #3310, #3309, #3308, #3304 - Add lint +- Added #3230 - Enable 'eslint' +- Added #3262 - Upgrade packages and tools for Travis unit testing +- Added #3287: Update module versions to latest stable +- Added #3295: Update the webpack example + +### Network +- FIX #3554: Relax clustering condition for adding already clustered nodes to cluster +- FIX #3517: Retain constraint values in label font handling +- REFA #3507: Cleanup and refactoring PhysicsEngine +- FIX #3500: re-adds edges if they are now connected and add does not add invalid edges +- FIX #3486: Add extra check on null value during label handling +- FEAT #824: Network detect clicks on labels +- FIX #3474: Adjust documentation for arrows.middle.scaleFactor +- FIX #3483: Prevent image loading for hidden cluster nodes +- FIX #3408, #2677: Fix handling of multi-fonts +- FIX #3425: IE performance improvements +- FIX #3356 and #3297: IE11 svg image fixes +- FIX #3474: Make negative scaleFactor reverse middle arrow correctly +- FIX #3464: Fix handling of space before huge word in label text +- FIX #3467: Adjust for-in loops so they can deal with added properties in Array and Object prototypes +- REFA #3442: Strapping down of Extend-routines in util.js +- FEAT #3412: Add endpoint 'bar' to Network +- FIX #3403: Fixes sorting on Layout, refactoring +- FIX #3421: Added default sizes for nodes without labels +- FEAT #3418: Added new Hexagon shape in the Network +- FEAT #3368: Cluster node handling due to dynamic data change +- FIX #3395: Allow for multiline titles +- FIX #3367: Network Clustering fixes on usage joinCondition for clusterOutliers() +- FIX #3350: Fix setting of edge color options via Network.setOptions() +- FEAT #3348: Add edge styles support for DOT lib +- FIX #2839: Re-words documentation to reflect symmetrical input/output of get() when passed multiple ids +- FIX #3316: Updates network documentation to account for edge +- FIX #1218, #1291, #1315: Dynamically adjust clustering when data changes +- FIX #2311: Block recalculation of level in LayoutEngine._determineLevelsDirected() +- FIX #3280: Cleanup mergeOptions() and fix missing ref on globalOptions in mergeOptions() +- FEAT #3131: Added dragStart event for adding edges +- FIX #3171 and #3185: Fix infinite loop on drawing of large labels +- FIX #3220: Update hierarchy when node level changes +- FIX #3245: Multiple base edges in clustered edge +- FEAT #1222: Add pointer data to hover events +- REFA #3106: Refactoring and unit testing of Validator module +- REFA #3227: Refactor LayoutEngine for further work +- FIX #3164: make 'hidden' and 'clustered' play nice together +- FIX #2579: Allow DOM elements for node titles +- FIX #2856: Fix manipulation examples for Network + +### Graph2D +- FIX #1852: Correct documentation for graph2d’s moveTo function + +### Graph3D +- FIX #3467: Adjust for-in loops so they can deal with added properties in Array and Object prototypes +- FEAT #3099: Add option definitions and validation to Graph3d +- REFA #3159: move Filter into DataGroup +- FEAT #3255: Add unit tests for Graph3D issue +- FIX #3251: Graph3d put guards before unsubscription in DataGroup +- FIX #3255: Fix missing reference to Graph3D instance in DataGroup + +### Timeline +- FEAT #3529: On timeline loaded +- FEAT #3505: Drag object in to item +- FEAT #3050: Allow disabling of RangeItem limitSize +- FIX #3475: Item Redraw Performance - Bug Fix +- FIX #3504: Fixing a bug with the timing of the final setting of the vertical scroll position +- FIX #3509: Added describe sections to PointItem unit tests +- FIX #2851: Vertical focus +- FEAT #620: Subgroup stacking +- FIX #3475: Improve Item redraw and initial draw performance +- FIX #3409: Group redraw performance +- FEAT #3428: Adds locale for Chinese (cn) +- FIX #3405: fix orientation option +- FIX #3360: Add performance tips to timeline docs +- FIX #3378: Add item with ctrlKey/metaKey when dagging on a selected item +- FIX #3126: Nested groups order logic +- FIX #3246: Fix issue when showMajorLabels == false is used with a weekly scale and weekly scale minor label fix +- FIX #3342: Bug fix for null parent +- FIX #2123: Disable the default handling of the pinch event when handling it +- FIX #3169: add parenthesis around ternary +- FIX #3249: Only draw non-visible items once when they are loaded, instead of continuously every frame +- FEAT #3162: Bidirectional scrolling in timeline - make horizontalScroll and verticalScroll work together + + ## 2017-07-01, version 4.20.1 ### General diff --git a/misc/RELEASE_CHECKLIST_TEMPLATE.md b/misc/RELEASE_CHECKLIST_TEMPLATE.md index 694b05a3..a30db6b5 100644 --- a/misc/RELEASE_CHECKLIST_TEMPLATE.md +++ b/misc/RELEASE_CHECKLIST_TEMPLATE.md @@ -28,6 +28,7 @@ - Keep the order of the commits. Older commits are lower newers are higher. - Bug-Fixes start with `FIX #issue:` - New Features start with `FEAT #issue:` + - Refactors start with `REFA #PR:` ## Commit - [ ] Commit the new version: `git commit -am "Release vX.Y.Z"` diff --git a/package.json b/package.json index fe9f583f..c98274f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vis", - "version": "4.20.1-SNAPSHOT", + "version": "4.21.0", "description": "A dynamic, browser-based visualization library.", "homepage": "http://visjs.org/", "license": "(Apache-2.0 OR MIT)", From be98231e3ddd3622771b681aa5bc04c83dedfa36 Mon Sep 17 00:00:00 2001 From: Yotam Berkowitz Date: Thu, 12 Oct 2017 15:10:53 +0300 Subject: [PATCH 3/3] Fix review comments --- HISTORY.md | 4 ++-- misc/RELEASE_CHECKLIST_TEMPLATE.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 62d12bfb..34986035 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,6 +8,7 @@ http://visjs.org - Added #3394: Adds unit tests for add, setOptions and on/off DataSet - FIX #3406: Eliminate possibility of 'window is undefined' during travis test - Added #3402: added @macleodbroad-wf to the support team +- REFA #3442: Strapping down of Extend-routines in util.js - FIX #3392: Addresses TODOs in Queue unit test by adding unit tests for setOptions and destroy - Added #3354: Adds missing jsdoc and adds lint rule require-jsdoc to build process - Added #3331 - Enable linting for Travis @@ -31,8 +32,7 @@ http://visjs.org - FIX #3356 and #3297: IE11 svg image fixes - FIX #3474: Make negative scaleFactor reverse middle arrow correctly - FIX #3464: Fix handling of space before huge word in label text -- FIX #3467: Adjust for-in loops so they can deal with added properties in Array and Object prototypes -- REFA #3442: Strapping down of Extend-routines in util.js +- FIX #3467: Adjust for-in loops so they can deal with added properties in Array and Object prototype - FEAT #3412: Add endpoint 'bar' to Network - FIX #3403: Fixes sorting on Layout, refactoring - FIX #3421: Added default sizes for nodes without labels diff --git a/misc/RELEASE_CHECKLIST_TEMPLATE.md b/misc/RELEASE_CHECKLIST_TEMPLATE.md index a30db6b5..8369c1b6 100644 --- a/misc/RELEASE_CHECKLIST_TEMPLATE.md +++ b/misc/RELEASE_CHECKLIST_TEMPLATE.md @@ -29,6 +29,8 @@ - Bug-Fixes start with `FIX #issue:` - New Features start with `FEAT #issue:` - Refactors start with `REFA #PR:` + - Additional work start with `Added #PR:` + ## Commit - [ ] Commit the new version: `git commit -am "Release vX.Y.Z"`