Skip to content

Commit

Permalink
0.1.1 with shiny fix
Browse files Browse the repository at this point in the history
  • Loading branch information
m-l-1 committed Jun 20, 2020
1 parent 8b980cb commit 2cc381b
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidymodules
Title: A robust framework for developing shiny modules
Version: 0.1.0.9012
Version: 0.1.1
Authors@R: c(
person('Mustapha', 'Larbaoui', email = '[email protected]', role = c('cre', 'aut')),
person('Douglas', 'Robinson', email = '[email protected]', role = c('ctb')),
Expand All @@ -13,7 +13,7 @@ Description: tidymodules offers a robust framework for developing shiny modules
License: Apache License (>= 2.0)
Encoding: UTF-8
LazyData: true
Imports:
Imports:
stringi,
digest,
R6,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ export(session_type)
export(showExamples)
import(R6)
import(dplyr)
import(shiny)
import(snippr)
importFrom(cli,cat_boxx)
importFrom(cli,cat_bullet)
Expand Down
3 changes: 3 additions & 0 deletions R/ModStore.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#'
#' @details
#' Manage applications, sessions and modules.
#'
#' @import shiny
#'
#' @export
ModStore <- R6::R6Class(
"ModStore",
Expand Down
5 changes: 3 additions & 2 deletions R/TidyModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' It provides methods for defining input and output communication ports, managing module namespace and many other useful features.
#'
#' @import R6
#' @import shiny
#'
#' @export
TidyModule <- R6::R6Class(
Expand Down Expand Up @@ -112,7 +113,7 @@ TidyModule <- R6::R6Class(
paste0(self$parent_ns,"-",self$id))

#### Capture ShinySession #######
private$shiny_session <- getDefaultReactiveDomain()
private$shiny_session <- shiny::getDefaultReactiveDomain()

self$created <- Sys.time()

Expand Down Expand Up @@ -443,7 +444,7 @@ TidyModule <- R6::R6Class(
input <- parent.frame()$output
session <- parent.frame()$session
if(is.null(session))
session <- getDefaultReactiveDomain()
session <- shiny::getDefaultReactiveDomain()

disable_cache <- getCacheOption()

Expand Down
2 changes: 1 addition & 1 deletion R/UtilityModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ UtilityModule <- R6::R6Class(
private$shared$store <- ModStore$new()

#### Set Shiny Session Here #######
private$shiny_session <- getDefaultReactiveDomain()
private$shiny_session <- shiny::getDefaultReactiveDomain()
}
)
)
17 changes: 17 additions & 0 deletions R/utility.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#' @param id Name or Id of the module
#' @param group Group name
#'
#' @import shiny
#'
#' @export
#'
#' @examples
Expand Down Expand Up @@ -57,6 +59,8 @@ getMod <- function(id = 1, group = NULL){
#' @param id Name or Id of the module
#' @param group Group name
#'
#' @import shiny
#'
#' @export
mod <- function(id = 1, group = NULL){
getMod(id,group)
Expand All @@ -72,6 +76,8 @@ mod <- function(id = 1, group = NULL){
#' @param t Port type, in or out
#' @param p Port Id or name
#'
#' @import shiny
#'
#' @export
port <- function(id = 1, p = 1, t = "in", g = NULL){
m <- getMod(id,g)
Expand All @@ -93,6 +99,8 @@ port <- function(id = 1, p = 1, t = "in", g = NULL){
#' @param g Module group name
#' @param p Port Id or name
#'
#' @import shiny
#'
#' @export
iport <- function(id = 1, p = 1, g = NULL){
port(id,p,"in",g)
Expand All @@ -106,6 +114,8 @@ iport <- function(id = 1, p = 1, g = NULL){
#' @param g Module group name
#' @param p Port Id or name
#'
#' @import shiny
#'
#' @export
oport <- function(id = 1, p = 1, g = NULL){
port(id,p,"out",g)
Expand All @@ -119,6 +129,7 @@ oport <- function(id = 1, p = 1, g = NULL){
#' #' @param verbose Display module description as well
#'
#' @importFrom cli cat_bullet cat_boxx
#' @import shiny
#'
#' @export
listModules <- function(verbose = FALSE, global = FALSE){
Expand Down Expand Up @@ -152,6 +163,8 @@ listModules <- function(verbose = FALSE, global = FALSE){
#' We are working on supporting callModules within module server function for invoking nested modules.
#'
#'
#' @import shiny
#'
#' @export
callModules <- function(){
currentSession <- UtilityModule$new()$getSession()
Expand Down Expand Up @@ -201,6 +214,8 @@ callModules <- function(){
#'
#' @param x expression
#'
#' @import shiny
#'
#' @export
defineEdges <- function(x){
observe({
Expand Down Expand Up @@ -286,6 +301,8 @@ NULL
#'
#' @return A session ID
#'
#' @import shiny
#'
#' @export
getSessionId <- function(session = getDefaultReactiveDomain()){
if(is.null(session)){
Expand Down
2 changes: 2 additions & 0 deletions R/verbs.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ map_ports <- function(leftModule = NULL, leftPort = 1,
#' })
#' }
#'
#' @import shiny
#'
#' @export
combine_ports <- function(...){
Expand Down Expand Up @@ -94,6 +95,7 @@ combine_ports <- function(...){
#' })
#' }
#'
#' @import shiny
#'
#' @export
race_ports <- function(...){
Expand Down
1 change: 0 additions & 1 deletion man/combine_ports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/race_ports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2cc381b

Please sign in to comment.