Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Imports:
haven,
rhandsontable,
DT,
shinyBS,
prettydoc,
VIM (>= 4.7.0),
httr,
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ import(methods)
import(rhandsontable)
import(robustbase)
import(shiny)
import(shinyBS)
import(tools)
import(xtable)
importFrom(DT,datatable)
Expand Down
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 5.7.10
- fix inconsistency in `rankSwap()` Output [Issue #361]
- remove shinyBS dependency in `sdcApp`

# 5.7.9
- Improvements for `recordSwap()`:
Expand Down
1 change: 0 additions & 1 deletion R/0classes.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#' @import xtable
#' @import data.table
#' @import ggplot2
#' @import shinyBS
#' @import shiny
#' @import rhandsontable
#' @importFrom DT datatable
Expand Down
35 changes: 34 additions & 1 deletion inst/shiny/sdcApp/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ library(grid)
library(sdcMicro)
library(rhandsontable)
library(haven)
library(shinyBS)
library(data.table)

if (!getShinyOption("sdcAppInvoked", FALSE)) {### Beginning required code for deployment
Expand Down Expand Up @@ -233,6 +232,40 @@ summaryfn <- function(x) {
vv
}

# to get rid of the shinyBS dependency
tipify <- function(el, title, placement = "bottom", trigger = "hover", options = NULL) {
# generate a unique ID for the wrapper element and wrap element in span-tag
wrapper_id <- paste0("tip-", round(runif(1, 1e9, 9e9)), "-", as.integer(Sys.time()))
wrapped_el <- tags$span(id = wrapper_id, el)

# define the JS options, forcing html: true allows to render inline-html code
js_options <- list(
html = TRUE
)
if (!is.null(options)) {
js_options <- c(js_options, options)
}

# add req. attributes
wrapped_el <- htmltools::tagAppendAttributes(
wrapped_el,
"data-toggle" = "tooltip",
"data-placement" = placement,
"data-trigger" = trigger
)

# the attribute should be treated as html-content
wrapped_el$attribs$title <- htmltools::HTML(title)

# the js-script to initialize the tooltip using the generated id
init_script <- tags$script(HTML(paste0(
"$(document).ready(function() { $('#", wrapper_id, "').tooltip(",
jsonlite::toJSON(js_options, auto_unbox = TRUE),
");});"
)))
return(tagList(wrapped_el, init_script))
}

# global, reactive data-structure
data(testdata, envir = .GlobalEnv)
data(testdata2, envir = .GlobalEnv)
Expand Down