Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Multiple edges between cluster and connected nodes #3245

Closed
gubr123 opened this issue Jul 9, 2017 · 3 comments
Closed

Multiple edges between cluster and connected nodes #3245

gubr123 opened this issue Jul 9, 2017 · 3 comments

Comments

@gubr123
Copy link

gubr123 commented Jul 9, 2017

As @wimrijnders said:

The cluster edge maintains a direct relation with the one single edge it is replacing. This does not work here because multiple edges need to be replaced with the cluster edge.

Simply, the issue is that when two nodes are connected with more than one edge, the edges remain when clustering, instead of creating a 'cluster edge'.

Here is an example of the issue:

image

Thats I want it to look - (but I want to leave physics enabled):

image

If I set the physics to false, so all the edges are lapping and it seems like there is one edge between the cluster and the node.

@wimrijnders
Copy link
Contributor

Discussion moved from #3187. First post edited with more info from said issue.
Here is the demo.


Additional from @gubr123 previous discussion:

The problem I'm ecountering with clustering is that the nodes are clustered but the edges aren't. So It causes something like this:

image

I've seen that disabling physics might help, but I don't want to affect the whole network. Is there any option to replace all the edges in one edge?

@wimrijnders
Copy link
Contributor

wimrijnders commented Jul 9, 2017

Analysis: In the code, there was only one hidden edge assigned per clustered edge. The solution is therefore to allow a clustered edges to replace multiple regular edges.

This does have some consequences, though. Notably, Network.getBaseEdge() is now deficient. I will need to deprecate this and make a new API method (getBaseEdges(), obviously) to replace this. Doable, of course.

Work on this is in progress Done.

@almende almende deleted a comment from gubr123 Jul 18, 2017
wimrijnders added a commit to wimrijnders/vis that referenced this issue Jul 18, 2017
Fix for almende#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.
yotamberk pushed a commit that referenced this issue Jul 21, 2017
* 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
@nanialves
Copy link

I want to cluster multiple edges but not with clustered node(s). Is there a solution yet?

I asked here if anyone can help. Thanks.

primozs pushed a commit to primozs/vis that referenced this issue Jan 3, 2019
* First interim commit

* Fixes during testing

* Allow multiple edges to be hidden by a clustered edge.

Fix for almende#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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants