A lot of digits in shiny DT
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, r
- Domain
- data-visualization, frontend
Research direction
Start by running the supplied Shiny example and inspect the datatable(), renderDT(), and replaceData() paths involved in updating the table. Compare the displayed values with the rounded dataframe values, including rows with different rounding steps; the issue is done when the table preserves the intended row-specific precision.
Written by the indexing model from the issue text.
Description
After upgrading to R version 4.3.1 and DT 0.28, in shiny DT tables sometimes have a lot of digits, but in the dataframe the number is rounded - round(x / 0.01) * 0.01
It is not suitable to set a common number of digits for all row. Each row has a unique rounding step 0.1, 0.01, 0.001...
ui <- fluidPage(
actionButton(inputId = "update", label = "Update"),
DTOutput("tbl")
)
server <- function(input, output) {
dt_tbl <- eventReactive(
eventExpr = input$update,
ignoreNULL = FALSE,
valueExpr = data.table(price = round(runif(n = 10, min = 0.8, max = 0.85) / 0.01) * 0.01))
output$tbl <- renderDT(isolate(expr = {
datatable(dt_tbl(),
class = "cell-border stripe", extensions = "FixedHeader", selection = "none", rownames = FALSE,
options = list(dom = "t", fixedHeader = TRUE, paging = FALSE, ordering = FALSE,
columnDefs = list(list(className = "dt-center", targets = "_all"))))
}))
observe(dataTableProxy("tbl") %>% replaceData(dt_tbl(), rownames = FALSE))
}
shinyApp(ui, server)
By filing an issue to this repo, I promise that
- I have fully read the issue guide at https://yihui.org/issue/.
- I have provided the necessary information about my issue.
- I have learned the Github Markdown syntax, and formatted my issue correctly.
- Dominant language
- JavaScript
- Stars
- 621
- Forks
- 177
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/DT
-
Unecessary "Datatables warning" alert when creating a DT with new data and same number of columnsOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Excel like filteringOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
check:passed feeds:add
Difficulty 1/5 Under an hour Newbie friendliness 66/100
-
Wallet functions throws TypeError when the wallet has no account IDPossibly taken @Medhansh-741 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
hiero-ledger/hiero-sdk-js#4781 · 1 comment ·
Maintainers usually reply within 1 day
-
bug package:workers-shared
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cloudflare/workers-sdk#16924 · 1 comment ·
Maintainers usually reply within 1 day
-
dashboard
Difficulty 2/5 Half a day Newbie friendliness 78/100
damodharg6/payledger#9 ·
-
parse: child keys like `007`, `1e3`, `0x1f`, `-1` make the parent an empty array and hide the valueOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100