Comments (4)
We could do the following:
- Change
dataTableOutput
andrenderDataTable
to emit a deprecation message (perhaps one which mentions CVE) - Remove the .js file from the Shiny package, and instead point to a CDN
- Eventually (in a couple of years) have these functions call out to the
DT
versions? Or maybe remove them?
from shiny.
Three more thoughts:
- Write a blog post for current
shiny::dataTableOutput()
users with a clear roadmap for updating to usingDT
. We can link to this post from the deprecation message. - Provide a user-settable option that switches
shiny::dataTableOutput()
and related to useDT
-provided functions and avoids the deprecation warning. - Eventually we can remove the option and use DT by default or throw an error if not installed.
from shiny.
From @jcheng5 in #3627 (comment)
@wch Incredibly,
shiny::renderDataTable
andDT::renderDataTable
are not compatible. Although I think the vast majority of cases can be automatically converted from the former to the latter without much trouble.
It would be helpful for someone to recall or investigate which features are incompatible.
from shiny.
In shiny::renderDataTable
, the object you return is a data frame. You pass DataTables JS options via the options
argument to renderDataTable
.
In DT::renderDT
, I think you can also return a data frame but if you want to specify options you need to return a DT::datatable()
and you pass that function your options. It makes sense, because DT is an htmlwidget and this is how htmlwidgets work; while shiny::renderDataTable
predates htmlwidgets.
(OOOHHHH... I just realized (after writing all of the below) that DT::renderDT
takes ...
that is "ignored when expr
returns a table widget, and passed as additional arguments to datatable()
when expr
returns a data object". Perfect.)
The other arguments from shiny::renderDataTable
:
searchDelay - The delay for searching, in milliseconds (to avoid too frequent search requests).
Probably just ignore with a warning.
callback - A JavaScript function to be applied to the DataTable object. This is useful for DataTables plug-ins, which often require the DataTable instance to be available.
A little adapting needs to happen, the shiny version looks like shiny::renderDataFrame(..., callback = "function(table) { alert(table); })"
while the equivalent in DT is DT::datatable(..., callback = JS("alert(table)"))
.
escape - Whether to escape HTML entities in the table:
TRUE
means to escape the whole table, andFALSE
means not to escape it. Alternatively, you can specify numeric column indices or column names to indicate which columns to escape, e.g.1:5
(the first 5 columns),c(1, 3, 4)
, orc(-1, -3)
(all columns except the first and third), orc('Species', 'Sepal.Length')
.
DT::datatable()
has the same argument with the same semantics. It adds the sentence "since the row names take the first column to display, you should add the numeric column indices by one when using rownames
"--I'm not sure what this means but I have a feeling it doesn't apply since there's a rownames
argument on DT::datatable
but not shiny::renderDataTable
.
env / quoted
These exist on DT::renderDT
and have the same semantics.
outputArgs - A list of arguments to be passed through to the implicit call to
dataTableOutput()
whenrenderDataTable()
is used in an interactive R Markdown document.
I'd be slightly surprised if this didn't work in DT already.
(Update: it doesn't work. It'd be an easy thing to add to DT if we felt like it.)
(Update 2: the shiny::dataTableOutput
doesn't take any additional args, so we can be sure nobody is using this today.)
(Update 3: Why not... rstudio/DT#1128)
from shiny.
Related Issues (20)
- Validate path as shiny app HOT 11
- `req()`/`isTruthy()` can give suprising results for matrices (with `NA`s)
- ExtendedTasks: how to kill a task? HOT 2
- std::bad_function_call HOT 6
- Disconnected from server: The application unexpectedly exited. HOT 2
- Shiny server disconnected from the server: The application unexpectedly exited HOT 2
- shiny application breaks with release 1.8.1 HOT 2
- Shared input/output IDs shouldn't break apps even in `devmode`
- Concurrent `ExtendedTask`s HOT 3
- documentation tweak for `onStart` argument in `shinyApp` help page HOT 1
- plot brush issue after update to 1.9.0 HOT 9
- Persistent `.recalculating` class if removeUI and output hiding operations are performed HOT 4
- Inconsistent behavior of busy indicators for different outputs: `tableOutput()`, `reactableOutput()`, `textOutput()`
- Version 1.9.1: ggvis plots are greyed out HOT 1
- Writing `testServer()` tests for modules using `ExtendedTask` HOT 3
- Updating choices using updateSelect(ize)Input causes selection to be cleared HOT 3
- Allow creating disabled `downloadButton()`/`downloadLink()`
- Feature Request: Documentation and Examples for Shared Extended Tasks Across Users HOT 2
- How to enable debug logs in shiny server. HOT 2
- Quarto documents HOT 1
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 shiny.