Comments (9)
I'm not sure I completely understand your question, but please read Section 2 here if you have not: http://rstudio.github.io/DT/server.html Basically you can rewrite this function https://github.com/rstudio/DT/blob/78c9a30cc30e/R/shiny.R#L137-L226 in whatever language or using any R packages you want. For example, the data
argument can be a database connection, and you can perform sorting in the database instead of using sort()
in R.
from dt.
Got it, this is exactly what I need. Rewrite function datatableJSON with tbl_src input from dplyr package.
from dt.
Please let me know if you make any progress on it, since I'm interested in alternative implementations (hopefully faster). My current implementation is pretty mundane.
from dt.
Hi, I've spent half of the day trying to make DT work for all dplyr::tbl inputs (including database tables) and hit an obstacle. Your filterRow
function calculates min and max to send it to slider filter. However, for database table you don't want to calculate ranges for all columns in advance, as for large table it might be slow. I've looked at the code and I have to be able to turn off your nice filters and maybe use the old version (as in shiny package).
from dt.
Did you time the calculation of ranges? I guess if this step is slow enough, the table will not be very responsive, either, when you sort or search the table.
from dt.
I've tested sorting on 3.5 million rows table. It takes about 5-7 sec to response. Tried to get range in SQL, about 2 sec per column. I have around 30 columns in my table, might be too long.
from dt.
In that case, I guess sorting and searching will also be very slow.
I will think about turning off the sliders and select inputs in column filters, and just use plain text inputs instead. Users will have to type in the text inputs.
from dt.
I have a large datatable (~1M rows) in a Shiny app with filters for the user that update a plot based on those filters just like this example: https://yihui.shinyapps.io/DT-info/
The problem is that the application hangs during filtering, I think because the entire table is on the client-side, so I moved to using server-side processing like this example (http://rstudio.github.io/DT/server.html). It's much faster, but then I can't retrieve the filtered row indices using input$tbl_rows_current because the client side only knows about the records that have been served and not the indices relative to the entire table. Simple example: https://gist.github.com/mortimes3/a0619adbe80fcf5cbacb
In short, I've tried blending the server-side processing example with the Shiny datatables information example and I've got good filtering performance, but can't access the row indices I've filtered.
Is it possible to have something like input$tbl_rows_current available when server-side processing is enabled? Or is something easily possible with drawCallback?
from dt.
@ReportMort Thanks for the report. I'm aware of this problem, and I have a vague solution in my mind (using the first column, i.e. row names, instead of row indices). I'll see if I can solve the problem next week.
from dt.
Related Issues (20)
- Selection of multiple levels HOT 2
- [Accessibility] Trigger custom row select from Javascript callback HOT 11
- R shiny DT table with pagination and drop down list inside table and being able to save the entire updated table as csv file HOT 5
- DT 0.31 breaks previous 'ignore colnames' behavior during `replaceData()` HOT 1
- RowGroup extension with rownames = TRUE HOT 6
- updateSearch does not update numeric slider values
- datatable column filters clash with shiny::selectizeInput when invoked first HOT 4
- DateTime date picker CSS is broken in SearchBuilder
- Disabling editable table by row (and not just by column)
- autoFill extension returns `NaN` instead of incrementing HOT 5
- Docs do not state whether shift+click works for multi-row selection
- #828 breaks maintaining selected columns upon re-render HOT 3
- signif() + datatable() bug HOT 3
- `renderDT()` evaluates `...` in `expr`'s `env`
- Unable to test `renderDT()` in a `MockShinySession`
- First option entry ignored for default search values per column HOT 3
- "locked" proxy structure not accommodating new data HOT 4
- Extract search functionality
- upgrade to datatables v2 HOT 2
- R Shiny application designed to navigate through multiple sections within a single page
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dt.