Dependencies problem when saving datatable objects

Open
#1,160 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, r
Domain
tooling, web-dev

Research direction

Start by reproducing the issue with datatable(), formatStyle(), datatable_obj$dependencies, and save() using the iris example. Compare the saved object after opening it on another device; done means its DT dependencies no longer require updating device-specific absolute paths.

Written by the indexing model from the issue text.

Description

If I run the following simple code:

library(DT)
library(htmlwidgets)
data <- iris
datatable_obj = datatable(data, options = list(pageLength = 5)) %>%
formatStyle(
'Species',
target = 'row',
backgroundColor = styleEqual(
unique(data$Species),
c('lightblue', 'lightgreen', 'lightpink')
)
)
datatable_obj$dependencies
save(object = datatable_obj,file = "datatable.RData")

Then I pass and open the RDS object from another device, it seems that absolute path dependencies of the library DT of the first device are saved in datatable_obj (datatable_obj$dependencies), which not correspond to the absolute path of the DT library of the second device.

We suggest to using parametric and relative path to solve this, in this manner users do not have to update the path every time such objects are opened from different devices.

Dominant language
JavaScript
Stars
621
Forks
177
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rstudio/DT

All issues in rstudio/DT

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.