AdeelK93 / collapsibleTree

Create Interactive Collapsible Tree Diagrams in R using D3.js
https://adeelk93.github.io/collapsibleTree/
158 stars 41 forks source link

[feature requested] display tree with one line ! #32

Closed philibe closed 6 years ago

philibe commented 6 years ago

Sometimes I have tree with only one root without children. I would like display the unique node without the errors "This is not a Tree".

My workaround is to build a 2nd node with parent id, the id of root, and its id "nothing", when there is only one root line in the tree.

philibe commented 6 years ago

It is about collapsibleTreeNetwork (in Shiny).

AdeelK93 commented 6 years ago

Hmm I never considered a 1 node tree, I can look into adding a special case for that. Good catch

AdeelK93 commented 6 years ago

Fixed in the github version, let me know if that works for you. Will push to CRAN in the next few weeks.

philibe commented 6 years ago

Tested quickly in my app : it works :) Thanks :)