From 2235b8ef706f42a52b55022d569a608f230aabc3 Mon Sep 17 00:00:00 2001
From: Pierre  LECHAT <pierre.lechat@pasteur.fr>
Date: Mon, 2 Jan 2017 16:31:34 +0100
Subject: [PATCH] add possibility to open multiple nodes

---
 inst/htmlwidgets/lib/.DS_Store                | Bin 6148 -> 6148 bytes
 .../lib/treeWeightD3-0.9/treeWeight.js        |  19 ++++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/inst/htmlwidgets/lib/.DS_Store b/inst/htmlwidgets/lib/.DS_Store
index 70221a5a51b6c73ca90688054bbb5f939a4fc80d..cc5ee5fae8b2cc4a0313a737442233777c3e2b59 100644
GIT binary patch
delta 72
zcmZoMXfc=|&e%4wP;8=}q9`K+0|O%ig8&0VI72E!CPO+y21Cijhw2+w#IsNQAiJ5J
bLx6*^ZR5l5%#-;=bXh^l4{Wv-Im`?Iof#8!

delta 98
zcmZoMXfc=|&e%S&P;8=}q9_vs0|O%ig8&1A9)l@^9)nR@N^$bUgX)tFL|7y_7*ZIF
t8FU$pktLJz^K&+K$Fpx{=MdmvY~OhBJM(0I5nV=x&5k06nI|@|001v27tH_w

diff --git a/inst/htmlwidgets/lib/treeWeightD3-0.9/treeWeight.js b/inst/htmlwidgets/lib/treeWeightD3-0.9/treeWeight.js
index d447048..d68621f 100644
--- a/inst/htmlwidgets/lib/treeWeightD3-0.9/treeWeight.js
+++ b/inst/htmlwidgets/lib/treeWeightD3-0.9/treeWeight.js
@@ -169,9 +169,18 @@ function main(datas,conditions,levels,nodeFind,width,height) {
 
     // Initialize the display to show a node
     if (nodeFind !=null){
-        console.log("nodeFind "+nodeFind);
-        //[root].forEach(collapse);
-        find (root, nodeFind);
+
+        
+        console.log(typeof (nodeFind));
+        if (typeof(nodeFind) != "object" ){
+            find (root, nodeFind);
+        }
+        else{
+            for (var i = 0; i < nodeFind.length; i++) {
+                console.log("nodeFind !!!"+nodeFind[i]);
+                find (root, nodeFind[i]);
+            }
+        }
     }
     // Initialize the display to show a few nodes.
     else{
@@ -619,7 +628,9 @@ function main(datas,conditions,levels,nodeFind,width,height) {
                 //if(d.parent != root){
                     d = d.parent;
                     if (d!= root){
-                        click(d);//if found open its parent
+                        //click(d);//if found open its parent
+                        toggleNodes(d);
+
                     }
                 //}   
             }
-- 
GitLab