@@ -532,13 +532,18 @@ function resetOneNode(node, options, network){
532532}
533533
534534// Global function to reset all node
535- function resetAllNodes ( nodes , update , options , network ) {
536- var nodesToReset = nodes . get ( {
537- filter : function ( item ) {
538- return item . isHardToRead === true ;
539- } ,
540- returnType :'Array'
541- } ) ;
535+ function resetAllNodes ( nodes , update , options , network , all ) {
536+
537+ if ( all === false ) {
538+ var nodesToReset = nodes . get ( {
539+ filter : function ( item ) {
540+ return item . isHardToRead === true ;
541+ } ,
542+ returnType :'Array'
543+ } ) ;
544+ } else {
545+ var nodesToReset = nodes . get ( { returnType :'Array' } ) ;
546+ }
542547
543548 var have_cluster_nodes = false ;
544549 var nodes_in_clusters ;
@@ -1897,7 +1902,7 @@ if (HTMLWidgets.shinyMode){
18971902
18981903 //reset nodes
18991904 resetAllEdges ( el . edges , el . highlightColor , el . byselectionColor , el . chart ) ;
1900- resetAllNodes ( el . nodes , true , el . options , el . chart ) ;
1905+ resetAllNodes ( el . nodes , true , el . options , el . chart , false ) ;
19011906
19021907 if ( main_el . selectActive === true ) {
19031908 main_el . selectActive = false ;
@@ -1982,7 +1987,7 @@ if (HTMLWidgets.shinyMode){
19821987 // reset some parameters / date before
19831988 if ( main_el . selectActive === true | main_el . highlightActive === true ) {
19841989 //reset nodes
1985- resetAllNodes ( el . nodes , true , el . options , el . chart ) ;
1990+ resetAllNodes ( el . nodes , true , el . options , el . chart , false ) ;
19861991
19871992 if ( main_el . selectActive === true ) {
19881993 main_el . selectActive = false ;
@@ -3295,7 +3300,7 @@ HTMLWidgets.widget({
32953300 }
32963301 else if ( el_id . selectActive === true ) {
32973302 //reset nodes
3298- resetAllNodes ( nodes , update , options , instance . network )
3303+ resetAllNodes ( nodes , update , options , instance . network , false )
32993304 el_id . selectActive = false
33003305 }
33013306 }
@@ -3709,7 +3714,7 @@ HTMLWidgets.widget({
37093714 resetList ( "nodeSelect" , el . id , 'selected' ) ;
37103715 }
37113716 //reset nodes
3712- resetAllNodes ( nodes , update , options , instance . network )
3717+ resetAllNodes ( nodes , update , options , instance . network , false )
37133718 el_id . highlightActive = false ;
37143719 is_clicked = false ;
37153720
@@ -4042,13 +4047,15 @@ HTMLWidgets.widget({
40424047 if ( x . clusteringGroup || x . clusteringColor || x . clusteringOutliers || x . clusteringHubsize || x . clusteringConnection ) {
40434048 // if we click on a node, we want to open it up!
40444049 instance . network . on ( "doubleClick" , function ( params ) {
4045-
40464050 if ( params . nodes . length === 1 ) {
40474051 if ( instance . network . isCluster ( params . nodes [ 0 ] ) === true ) {
40484052 is_clicked = false ;
40494053 instance . network . openCluster ( params . nodes [ 0 ] , { releaseFunction : function ( clusterPosition , containedNodesPositions ) {
40504054 return containedNodesPositions ;
40514055 } } ) ;
4056+ // must be better...
4057+ resetAllEdges ( edges , el_id . highlightColor , el_id . byselectionColor , instance . network ) ;
4058+ resetAllNodes ( nodes , true , options , instance . network , true ) ;
40524059 } else {
40534060 if ( x . clusteringGroup ) {
40544061 var array_group = nodes . get ( {
0 commit comments