Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Addtional linebreaks are found in code. #113

Open
kartikeyakirar opened this issue Nov 29, 2023 · 0 comments
Open

[Bug]: Addtional linebreaks are found in code. #113

kartikeyakirar opened this issue Nov 29, 2023 · 0 comments
Assignees
Labels
bug Something isn't working core

Comments

@kartikeyakirar
Copy link
Contributor

kartikeyakirar commented Nov 29, 2023

What happened?

Tested on refactor branch.

In application, across any module, clicking on Show Code displays the code with excessive line breaks. This issue specifically occurs for the code passed in within function to create teal_data .
image

Initial investigation:
No additional line breaks are found when teal_data is initially created. For example:

data <- cdisc_data() |>
  within({
    library(nestcolor)
    ADSL <- rADSL
    ADRS <- rADRS
    ADTR <- rADTR
    ADSL$SEX <- factor(ADSL$SEX, levels = unique(ADSL$SEX))
  })

datanames(data) <- c("ADSL", "ADTR", "ADRS")
join_keys(data) <- default_cdisc_join_keys[datanames(data)]

The get_code function returns the following result:

> get_code(data)
[1] "library(nestcolor)\nADSL <- rADSL\nADRS <- rADRS\nADTR <- rADTR\nADSL$SEX <- factor(ADSL$SEX, levels = unique(ADSL$SEX))"

However, additional line breaks are observed when application data is passed to modules. click Show code button result.

app <- init(
  data = data,
  modules = modules(
    tm_g_waterfall(
      label = "Waterfall",
      dataname_tr = "ADTR",
      dataname_rs = "ADRS",
      bar_paramcd = choices_selected(c("SLDINV"), "SLDINV"),
      bar_var = choices_selected(c("PCHG", "AVAL"), "PCHG"),
      bar_color_var = choices_selected(c("ARMCD", "SEX"), "ARMCD"),
      bar_color_opt = NULL,
      sort_var = choices_selected(c("ARMCD", "SEX"), NULL),
      add_label_var_sl = choices_selected(c("SEX", "EOSDY"), NULL),
      add_label_paramcd_rs = choices_selected(c("BESRSPI", "OBJRSPI"), NULL),
      anno_txt_var_sl = choices_selected(c("SEX", "ARMCD", "BMK1", "BMK2"), NULL),
      anno_txt_paramcd_rs = choices_selected(c("BESRSPI", "OBJRSPI"), NULL),
      facet_var = choices_selected(c("SEX", "ARMCD", "STRATA1", "STRATA2"), NULL),
      href_line = "-30, 20"
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

4 participants