phylotree.js icon indicating copy to clipboard operation
phylotree.js copied to clipboard

custom information to display in branches

Open johaGL opened this issue 4 years ago • 8 comments

hello, we are working in evolutionary models and we have been exploring your fascinating library. Is it possible to add information to branches, and display it ? we would like to add different parameter values to each branch, as illustrated here (in two of the branches) of this publication figure: pub_tetrapod; (link to publicaton: https://www.nature.com/articles/nature12027), but we need to do this for all branches. We have some experience in manipulating svg objects and d3.js Thank you in advance.

johaGL avatar Nov 10 '20 22:11 johaGL

Dear @johaGL,

You are interested in adding text boxes, right? How big is your tree? (the issue would be dealing with overlaps for larger trees).

Best, Sergei

spond avatar Nov 10 '20 22:11 spond

Thank you very much for your reply @spond . The tree can be big as ~100-150 leaves (bigger trees we think will be impractical for this kind of display we think), however we would like the textboxes to be hidden at each branch and only to display on click (on the branch).

johaGL avatar Nov 11 '20 09:11 johaGL

Dear @johaGL,

Ah, OK. Which version of phylotree are you using? I'll mock up an example for you.

Best, Sergei

spond avatar Nov 11 '20 14:11 spond

I apologize for my late reply, indeed we are trying to use phylotree version 1.0.0-alpha.22 and import it in our .js file via npm but we encounter some difficulties as we have all inside an existing Flask application, so for now we have only done very simple tests including the http tags directly into the html template. Please give us some time to confirm you the definitive phylotree version, we deeply appreciate your responsiveness. Thank you again, Joha.

johaGL avatar Nov 13 '20 13:11 johaGL

Dear @johaGL,

Take a look at https://github.com/veg/phylotree.js/tree/master/examples/attribute-displays You should be able to test it using yarn develop (as described in README)

Best, Sergei

spond avatar Nov 13 '20 19:11 spond

Dear @spond , we are really grateful, and happy, your example is exactly what we need : exampleGreatbySpond We will follow README instructions to import the library in our app and inspire from your code in this excellent example. Thank you !

johaGL avatar Nov 16 '20 10:11 johaGL

(I think this issue can be closed :) )

johaGL avatar Nov 16 '20 10:11 johaGL

(sorry, I dont know who must close the issue, I prefer let you do it)

johaGL avatar Nov 16 '20 10:11 johaGL