yonicd / d3Tree

htmlwidget that binds d3js collapsible trees to R and Shiny to make an interactive search tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow add other values to node

sinacek opened this issue · comments

Hi,
I tried new feature from #7 for use last clicked node. That gave me an idea, that I would like to know, which node it is by their id. I can set new attribute in R list structure and it is propagate to JS nodes, but for active node is returned just value and name.
I suggest return all node properties (activeNode=d;) because we don't know which other attributes we will use next time. What do you think about that?

Not sure what the application of that would be. Can you give an example?

I would like print detail about the node in separate table. For this purpose I need to know id of that node.

activeReturn is an argument to access any string or numeric attribute in the d, which shiny will observe.

notice that the id index starts from the bottom of each level.

d3tree(list(root = df2tree(rootname = 'Titanic',
struct = as.data.frame(Titanic),
toolTip = letters[1:5]),layout = 'collapse'),
activeReturn = c('name','value','depth','id') #<----
)

ok, thanks