Skip to content

A shiny module of Ace editor for real-time debug

Notifications You must be signed in to change notification settings

Yang-Tang/shinyAceMod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shinyAceMod

A shiny module of Ace editor for real-time debug

Introduction

When debugging a shiny app, it would be very useful to check the value of an input or reactive object while the app is runing. By loading this shinyAce-based shiny module, it's easy to perform this task in read-time. This shiny modlule provide an Ace editor interface that can evaluate user input code in shiny environment and displace output in a verbatimTextOutput().

Pre-request

This shiny module requires following packages. Please make sure they are installed.

# need dev version of shinyAce
devtools::install_github('trestletech/shinyAce')
install.package('pryr')
install.package('formatR')

Usage

  1. Source the module file
source('shinyAceMod.R')
  1. Invoke module in server function. Make sure to set an appropriate evaluation environment.
server <- function(input, output, session) {

  callModule(shinyAceMod, id = 'YOU_MODULE_ID', eval_env = pryr::where('input'))

  # other codes

}
  1. Add Ace editor ui
ui <- fluidPage(

  shinyAceModUI('YOU_MODULE_ID')

)
  1. Run app and input code you want to run in the Ace editor. Press Ctrl/CMD-Shift-Enter to evaluate all input or press Ctrl/CMD-Enter to evaluate current line or selected code.

alt text

About

A shiny module of Ace editor for real-time debug

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages