yonicd / jsTree

R htmlwidget for inspecting heirachal structures with the ‘jQuery’ ‘jsTree’ Plugin.
https://yonicd.github.io/jsTree/
Other
30 stars 7 forks source link

let user define sep for file path. #8

Closed kohleth closed 6 years ago

kohleth commented 6 years ago

Thanks for the jsTree package. It is great. I am using it to explore a hierarchical data structure, which are not file paths. Imagine in the shiny app you have to navigate through country / state / city. And one of these names happen to have the forward slash /, which jsTree interprets to be the next level of the hierarchy.

This PR let user define what the separator should be by supplying a sep argument.

kohleth commented 6 years ago

this allows the tree to generate properly. e.g. jsTree(c("A$1","A$2","B$1","B$x/z"),sep="\\$"). However, the selected node/branch from input$tree_update$.current_tree is still parsed as A/1,... B/x/z. But that requires changes in the .js file I believe?

yonicd commented 6 years ago

This looks ok after you make a few cosmetic changes. to have sep propigate to the js you will need to add ,sep=sep here.

and then here replace '/' with x.sep.