Widgets in DT cells

185 views
Skip to first unread message

Alexander Vorobiev

unread,
Jan 21, 2016, 9:30:11 PM1/21/16
to Shiny - Web Framework for R
Hi,

Is it possible to embed other widgets into the cells of DT data table? In particular, I want to display a sparkline chart for each row of the table so I need to be able to create a column of charts. 

https://github.com/htmlwidgets/sparkline package is one choice but it produces widgets, not, say, data urls with images which I can add to the data frame.

Thanks,
Alex

Thomas Siegmund

unread,
Jan 26, 2016, 7:18:33 AM1/26/16
to Shiny - Web Framework for R
Hi Alex,

don't know about DT, but D3TableFilter may be an alternative. It supports sparklines out of the box.

Best

Thomas

Disclaimer: I'm the author of D3TableFilter.

Alexander Vorobiev

unread,
Feb 8, 2016, 12:44:28 PM2/8/16
to Shiny - Web Framework for R
Hi Thomas,

Thanks for your reply. In my case the tables can have hundreds of rows so they would better be scrollable and/or support paging. I am not sure D3TableFilter provides this functionality. 

In the meantime I found an example I was looking for: http://leonawicz.github.io/HtmlWidgetExamples/ex_dt_sparkline.html

Thanks,
Alex

Thomas Siegmund

unread,
Feb 14, 2016, 12:15:16 PM2/14/16
to Shiny - Web Framework for R
Hi Alex,

 D3TableFilter supports paging (client side only, not server side like DT). More important though, performance for a few hundred rows should be no problem. There is a test app called "performance" in the package. Up to 1000 x 10 the performance is IMHO fine with D3 driven cell coloring, without it's OK up to 5000 rows. Have not tested the sparklines with large tables.

Best

Thomas

Alexander Vorobiev

unread,
Feb 15, 2016, 2:25:30 PM2/15/16
to Shiny - Web Framework for R
Thanks Thomas! 

I'll definitely give it a try.

Alex
Reply all
Reply to author
Forward
0 new messages