timelyportfolio / buildingwidgets

repo for a htmlwidget a week documented at https://buildingwidgets.com
https://timelyportfolio.github.io/buildingwidgets/
MIT License
62 stars 12 forks source link

jquery-treetable in shiny #65

Open UweBlock opened 8 years ago

UweBlock commented 8 years ago

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

timelyportfolio commented 8 years ago

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?

UweBlock commented 8 years ago

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.

timelyportfolio commented 8 years ago

@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 commented 8 years ago

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

UweBlock commented 8 years ago

@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 commented 8 years ago

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.

timelyportfolio commented 8 years ago

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.

UweBlock commented 8 years ago

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.

omarbenites commented 5 years ago

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.