From fc7b5f080812792af94b79cb47d3cecfc559566e Mon Sep 17 00:00:00 2001 From: wimrijnders Date: Fri, 21 Jul 2017 18:49:49 +0200 Subject: [PATCH] Multiple base edges in clustered edge (#3268) * First interim commit * Fixes during testing * Allow multiple edges to be hidden by a clustered edge. Fix for #3245. This fix adjusts the clustering edges so that theyi can refer to multiple edges instead of just one. This API method is now insufficient, since multiple base edges can be returned. - Added replacing method `clustering.getBaseEdges()` - Adjusted example `changingClusteredEdgeNodes` for the new method. This is the *only* place where `getBaseEdge()` was used - Adjusted documentation for new method and deprecation old method. Method `getbaseEdge()` should now be considered `deprecated`, and in due time should be removed. * Edits of method name in example * Edits of method name in example * adjusted deprecation method getBaseEdge() in docs * Adjusted deprecation method for getBaseEdge() in docs --- docs/network/index.html | 15 +- .../other/changingClusteredEdgesNodes.html | 6 +- lib/network/modules/Clustering.js | 208 +++++++++++++----- 3 files changed, 167 insertions(+), 62 deletions(-) diff --git a/docs/network/index.html b/docs/network/index.html index 9bdf520a..7a438717 100644 --- a/docs/network/index.html +++ b/docs/network/index.html @@ -645,7 +645,20 @@ var locales = { Returns: Value When a clusteredEdgeId is available, this method will return the original baseEdgeId provided in data.edges
- ie. After clustering the 'SelectEdge' event is fired but provides only the clustered edge. This method can then be used to return the baseEdgeId. + ie. After clustering the 'SelectEdge' event is fired but provides only the clustered edge. This method can then be used to return the baseEdgeId.

+ This method is deprecated. Please use getBaseEdges() instead. + + + + + getBaseEdges(String clusteredEdgeId) + + + + Returns: Array + For the given clusteredEdgeId, this method will return all the original base edge id's provided in data.edges. + For a non-clustered (i.e. 'base') edge, clusteredEdgeId is returned.

+ Only the base edge id's are returned. All clustered edges id's under clusteredEdgeId are skipped, but scanned recursively to return their base id's.
diff --git a/examples/network/other/changingClusteredEdgesNodes.html b/examples/network/other/changingClusteredEdgesNodes.html index 0f079720..4bb324d9 100644 --- a/examples/network/other/changingClusteredEdgesNodes.html +++ b/examples/network/other/changingClusteredEdgesNodes.html @@ -27,9 +27,9 @@

-Demonstrating getBaseEdge, getClusteredEdges updateEdge and updateClusteredNode.