Open Georgva opened 3 years ago
Hello, I am also looking for this functionality. Did anyone find the answer? In summary, I want to get the node name/id/descendants/ancestors when the mouse is clicked on the node. I could not find if mouse click events are available. Appreciate your help. Regards, Sanjana
I figured this out. For anyone else like me trying to gather the information on nodes as user mouse clicks on node, here is the code that worked for me.
element.on('click', function() { console.log(data.data.name) console.log(tree.getNodeByName(data.data.name)) });
Call this code as a part of the 'node-styler' function. The 'node-styler' function is defined in the tree.render . You can also replace 'click' with 'mouseover' etc.
Hi All, first of all thanks for providing this cool library!
I want to create phylogenetic trees based on the mutational profiles of single cells for the recreation of their genealogical order. But the biological stuff is actually not important ;)
I was able to adapt the code to my needs, which is basically the same as in http://phylotree.hyphy.org/, but additionally, I want to give an overview of the different mutations that were gained in every single cell (all cells are displayed as leaves).
To do this, I would like to add an on-click event for the nodes. For example, a list of mutations should show up for the specific node after clicking on it.
Is phylotree.js capable of this? Or are there only click features 'incident branch', 'path to root', 'reroot on this node' and 'hide this node'?
Please consider in your answer that I am a newbie in html and javascript.
My current code looks like this: