buildingwidgets icon indicating copy to clipboard operation
buildingwidgets copied to clipboard

jquery-treetable in shiny

Open UweBlock opened this issue 9 years ago • 9 comments

I would love to see jquery-treetable in shiny. https://github.com/ludo/jquery-treetable http://ludo.cubicphuse.nl/jquery-treetable/

UweBlock avatar Oct 11 '15 23:10 UweBlock

Very interesting. @UweBlock, do you have a dataset/usecase in mind? That will help me think through implementation. I also found https://github.com/mar10/fancytree, https://github.com/maxazan/jquery-treegrid, and https://github.com/culmat/jsTreeTable. Have you looked at those?

timelyportfolio avatar Oct 14 '15 02:10 timelyportfolio

Glad, you find this interesting, @timelyportfolio. Thank you for hinting to the other implemenations which I weren't aware of. Difficult to chose one. My ultimate goal is to have a combination of one of the tree table implementations with sparklines (https://github.com/gwatts/jquery.sparkline) for displaying KPIs of a hierarchical structure (think: areas, countries, regions, cities) where the user can expand/collapse nodes/rows (kind of drill down) in Shiny. I have found an example of sparklines and data.table (http://leonawicz.github.io/HtmlWidgetExamples/ex_dt_sparkline.html) which easily can be converted into a ShinyApp but datatable doesn't support hierarchical structures/expand/collapse.

UweBlock avatar Oct 14 '15 08:10 UweBlock

@UweBlock, thanks so much for the additional information. I think any of the mentioned libraries would work, but I am concerned that we will lose lots of very nice datatables functionality, such as pagination, etc. How many rows would you expect in a your situation?

timelyportfolio avatar Oct 15 '15 01:10 timelyportfolio

Slick Grid https://github.com/mleibman/SlickGrid is one other option, but would require a much heavier implementation.

timelyportfolio avatar Oct 15 '15 02:10 timelyportfolio

@timelyportfolio, thanks for your reply which lets me think how users will work with a treetable vs a datatable. With a treetable, pagination might become less important as the user can expand/collapse those nodes he wants to inspect in detail. Well, at least if there aren't too many rows in a subnode.

An interesting issue is sorting as this could break the hierarchical structure. My expectation is that only the rows/subnodes on the lowest visible level are sorted while the other rows/nodes remain at the places where they belong according to the hierarchical structure.

Eg, in a hierarchie country/region/city, if I have one region expanded to inspect the KPIs of the individual cities and I sort by one of the columns, then only rows on city level should be re-arranged while the order of countries and regions should not be changed to maintain the hierarchy. On the other hand, if all nodes are collapsed to country level then I would expect that sorting will re-arrange the countries. Now, if I drill down by expanding one country to see regions I expect to see the regions to be sorted in the same way as the countries.

For my use case, I expect a few hundred rows of aggregated data with 5 to 10 subnode levels. However, if detail data needs to be included this would add around 100'000 rows.

UweBlock avatar Oct 15 '15 07:10 UweBlock

Thank you for pointing out Slick Grid https://github.com/mleibman/SlickGrid. Indeed, it seems to be very complete but also not to be maintained actively. Last changes 2 yrs ago with 270 open issues.

Probably, active maintenance could be an important criterion for selecting the underlying implementation.

UweBlock avatar Oct 15 '15 08:10 UweBlock

I did find this forked and updated SlickGrid https://github.com/ddomingues/X-SlickGrid. I especially liked interactive grouping and aggregates http://ddomingues.com/X-SlickGrid/liveDemo/examples/example-grouping.html.

timelyportfolio avatar Oct 15 '15 14:10 timelyportfolio

X-SlickGrid is pretty slick, indeed. There is also an example with sparklines http://ddomingues.com/X-SlickGrid/liveDemo/examples/example10-async-post-render.html! So, this seems to offer the functionality I am looking for.

UweBlock avatar Oct 15 '15 22:10 UweBlock

Very interesting. @UweBlock, do you have a dataset/usecase in mind? That will help me think through implementation. I also found https://github.com/mar10/fancytree, https://github.com/maxazan/jquery-treegrid, and https://github.com/culmat/jsTreeTable. Have you looked at those?

Hi @timelyportfolio. One question, Did you implemented fancytree or another of these widgets in R-shiny?. I'd love to see them in action ( specially fancytree). Regards.

omarbenites avatar Nov 13 '18 21:11 omarbenites