-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Can't include hidden nodes to cluster in joinCondition #3164
Comments
This is, in fact, the intended purpose of I don't fully understand your scenario, but I think the intention is to use clustered nodes to create new clusters, is this correct? In that case, I feel that your workaround is the correct way to do this. If your think otherwise, please let me know. |
Thanks for the response. In this case joinCondition does not consider hidden nodes. My guess was looping over this.body.nodes (in vis cluster function) will solve this. Or is there any better way to achieve this? |
@dheerajbapat Thanks for the great demo! Update: The problems in the demo stem from the fact that clustering uses field |
Notes during analysis There's more going on here than I presumed. I'll keep a list here and expand it as needed.
Order is important: A hidden node does not get clustered. So after clustering, the red square gets reshown on 'Toggle Red Nodes'. And now I look at the title of this issue and see that this is exactly what it's about. Hm. This escalated badly; I'm seriously thinking to add hide/unhide functionality to |
Thanks for understanding and taking it on priority 😄 |
Interim note: I feel like I'm making a mess of fixing this. The states I've been trying to consolidate the code to a state in which it works as expected. I've just come to the realization that it would be much better to just accept that OK, so it's back to the drawing board for me. |
Fix for almende#3164 - `network.clustering.cluster()` now handles all nodes, not just the visible ones - Changing ivisibility of nodes now explicitly takes clustering into account, see `Network._updateVisibleIndices()` - `network.clustering` does not change `hidden` status any more. The important part of this PR is the realization that 'hidden' and 'clustered' are two distinct things and should be handled separately. In particular, clustering should **not** change the `hidden` state in any way.
Fix for #3164 - `network.clustering.cluster()` now handles all nodes, not just the visible ones - Changing ivisibility of nodes now explicitly takes clustering into account, see `Network._updateVisibleIndices()` - `network.clustering` does not change `hidden` status any more. The important part of this PR is the realization that 'hidden' and 'clustered' are two distinct things and should be handled separately. In particular, clustering should **not** change the `hidden` state in any way.
Thanks! I could not check your demo, because it is giving below exception in console. Then I saved your vis.js and it is working great! |
Still have the problem with latest vis 4.21.0 |
Fix for almende#3164 - `network.clustering.cluster()` now handles all nodes, not just the visible ones - Changing ivisibility of nodes now explicitly takes clustering into account, see `Network._updateVisibleIndices()` - `network.clustering` does not change `hidden` status any more. The important part of this PR is the realization that 'hidden' and 'clustered' are two distinct things and should be handled separately. In particular, clustering should **not** change the `hidden` state in any way.
As joinCondition loops over this.body.nodeIndices I am not able to include hidden nodes while forming a cluster.
I think looping over this.body.nodes will solve this.
Scenario: If I have filter on color of nodes (say red nodes are hidden) & I cluster by shape of node.
Then I change filter to show red nodes. Those node will appear out of cluster.
Because those were not included in cluster as it was hidden while forming cluster.
Workaround: process clustering again while changing filters & process filters again while opening cluster.
The text was updated successfully, but these errors were encountered: