almende / chap-links-library

a web based visualization library for displaying graphs, networks, and timelines
http://almende.github.com/chap-links-library
Apache License 2.0
599 stars 167 forks source link

Timeline "isSelected" and "unselectItem" don't work with clusters #367

Open CASandmann opened 7 years ago

CASandmann commented 7 years ago

These methods along with setSelection([]) behave incorrectly when the user has clicked a cluster. These methods check for (this.selection && this.selection.index !== undefined) but if the most recent click was on a cluster, selection looks like {cluster: 0} which doesn't pass that condition.

This leads isSelected(clusterIndex) to return false and setSelection([]) and unselectItem([]) to be a no-op and the next time the user calls getSelection() it will return the cluster again. The current workaround is to set timeline.selection.index to a value, but that definitely isn't intuitive.