rstudio / rstudio/flexdashboard

crosstalk::filter_slider() must go first, otherwise flexdashboard breaks?

Open
#131 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
848
Forks
298
PR merge metrics
No merged PRs in 30d

Description

The following crosstalk seems to break a flexdashboard:

---
output: 
  flexdashboard::flex_dashboard
---

```{r setup, include=FALSE}
library(flexdashboard)
library(crosstalk)
library(summarywidget)
set.seed(1)
df <- data.frame(
  x = seq(Sys.Date()-364, Sys.Date(), length.out = 99), 
  y = 1:99,
  group = gl(3,33)
) 
sd <- SharedData$new(df)
```

```{r}
filter_checkbox("chkb", "Checkbox", sd, ~group, inline = TRUE)
filter_slider("sldr", "Slider", sd, ~x)
summarywidget(sd, "sum", "y")
```

2017-06-05_013348

This works as expected - note that I only switched filter_checkbox and filter_slider:

---
output: 
  flexdashboard::flex_dashboard
---
```{r setup, include=FALSE}
library(flexdashboard)
library(crosstalk)
library(summarywidget)
set.seed(1)
df <- data.frame(
  x = seq(Sys.Date()-364, Sys.Date(), length.out = 99), 
  y = 1:99,
  group = gl(3,33)
)
sd <- SharedData$new(df)
```

```{r}
filter_slider("sldr", "Slider", sd, ~x)
filter_checkbox("chkb", "Checkbox", sd, ~group, inline = TRUE)
summarywidget(sd, "sum", "y")
```

2017-06-05_013113

My sessionInfo():

R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                    LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] htmltools_0.3.6          crosstalk_1.0.0          summarywidget_0.0.0.9000 forcats_0.2.0            rCharts_0.4.5            email_1.0               
 [7] stringi_1.1.2            magrittr_1.5             fastmatch_1.1-0          data.table_1.10.4        bit64_0.9-5              bit_1.1-12              
[13] lubridate_1.6.0          plotly_4.7.0.9000        flexdashboard_0.5        DT_0.2                   quantmod_0.4-8           TTR_0.23-1              
[19] xts_0.9-7                zoo_1.7-14               bindrcpp_0.1             dplyr_0.6.0              purrr_0.2.2.2            readr_1.0.0             
[25] tidyr_0.6.3              tibble_1.3.3             ggplot2_2.2.1.9000       tidyverse_1.0.0         

loaded via a namespace (and not attached):
 [1] lattice_0.20-34     colorspace_1.3-2    viridisLite_0.2.0   yaml_2.1.14         rlang_0.1.1         glue_1.0.0.9000     bindr_0.1           plyr_1.8.4         
 [9] stringr_1.1.0       munsell_0.4.3       gtable_0.2.0        htmlwidgets_0.8     evaluate_0.10       labeling_0.3        knitr_1.15.1        httpuv_1.3.3       
[17] Rcpp_0.12.11        xtable_1.8-2        backports_1.0.4     scales_0.4.1.9000   jsonlite_1.4        mime_0.5            digest_0.6.12       shiny_1.0.3        
[25] RJSONIO_1.3-0       grid_3.3.2          rprojroot_1.1       tools_3.3.2         lazyeval_0.2.0.9000 whisker_0.3-2       pkgconfig_2.0.1     rsconnect_0.7      
[33] assertthat_0.2.0    rmarkdown_1.3       httr_1.2.1          R6_2.2.1  

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the provided flexdashboard example with filter_checkbox(), filter_slider(), SharedData$new(), and summarywidget(), comparing the two filter orders. Start at the filter and dashboard rendering entry points, then verify that both orders produce the same working dashboard without breaking the layout or interactions.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.