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

Network: make option 'hidden' and clustering play nice together #3274

Merged
merged 3 commits into from
Jul 20, 2017

Conversation

wimrijnders
Copy link
Contributor

Fix for #3164

  • network.clustering.cluster() now handles all nodes, not just the visible ones
  • Changing visibility of nodes now explicitly takes clustering into account, see Network._updateVisibleIndices()
  • Edges connected to hidden nodes now also get hidden automatically
  • network.clustering does not change hidden status any more of nodes and edges.

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.


To see the difference this PR makes, compare the original demo to the demo with fixes. In particular, the combination of 'hidden' with 'clustered' is important; try at least the following combinations.

Test 1:

  1. Refresh page
  2. Click 'Toggle Red Nodes'
  3. Click 'Toggle Cluster Square'
  4. Click 'Toggle Red Nodes'

Test 2:

  1. Refresh page
  2. Click 'Toggle Cluster Square'
  3. Click 'Toggle Red Nodes'
  4. Click 'Toggle Cluster Square'

Try any other combination you can think of as well.

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.
@yotamberk yotamberk merged commit af4e1fa into almende:develop Jul 20, 2017
@wimrijnders wimrijnders deleted the issue3164 branch July 21, 2017 05:44
primozs pushed a commit to primozs/vis that referenced this pull request Jan 3, 2019
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants