ukgovdatascience / govdown

GOV.UK Design System theme for R Markdown
https://ukgovdatascience.github.io/govdown/
Other
46 stars 5 forks source link

Crosstalk interaction issue #57

Closed mattkerlogue closed 4 years ago

mattkerlogue commented 4 years ago

The crosstalk package provides some tools to provide client-side data filtering in RMarkdown. However it injects Bootstrap css styling into the page causing issues with the core govdown css style (font sizes, spacing etc).

I discovered via some painful Google searching this fix which strips the Bootstrap identifiers and means that crosstalk doesn't inject the Bootstrap css.

fs_nobootstrap <- crosstalk::filter_select(id = "myselector", 
    label = "select something", sharedData = df, 
    group = ~selection_column)

attr(fs_nobootstrap, "html_dependencies") <- Filter(
  function(dep) {dep$name != "bootstrap"},
  attr(fs_nobootstrap, "html_dependencies")
)

As govdown is intended to help people present analysis and some people may well use it with crosstalk then perhaps this fix is something that can be included in the documentation (e.g. interactions with other packages).

apreshill commented 3 years ago

Hi folks- sorry to comment on a closed issue, but wanted to let you know that we have worked to remove the Bootstrap dependency of crosstalk (better late than never 😄 ):

https://github.com/rstudio/crosstalk/blob/master/NEWS.md#crosstalk-1119000

remotes::install_github("rstudio/crosstalk")