-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make runcode work with shinyAce editor #93
Comments
I will try add it when I have time before the next release, but I'll also R-Shiny Consultant On 4 November 2016 at 23:48, Steven Pav [email protected] wrote:
|
I am not sure how library(shinyAce)
aceEditor("debug_ace_in", mode='r', value="lb <- rnorm(16);head(lb)",
vimKeyBinding=TRUE,
theme="github", fontSize=16, height="500px",
hotkeys=list(runKey="F8|F9|F2|Ctrl-R")),
verbatimTextOutput('debug_ace_stdin'),
verbatimTextOutput('debug_ace_stdout') And in library(shinyAce)
vals <- reactiveValues(ace_stdout = "")
observe({
input$runKey
isolate(vals$ace_stdin <- eval(input$debug_ace_in))
isolate(vals$ace_stdout <- eval(parse(text=vals$ace_stdin)))
})
output$debug_ace_stdin <- renderText({
retv <- paste0(vals$ace_stdin)
retv
})
output$debug_ace_stdout <- renderText({
retv <- paste0(vals$ace_stdout)
retv
}) Again, there is probably a better implementation in My defaults for the ace editor here allow one to use F9 as a 'run' key, like I do in Conque in vim, which is a whole other story. |
I believe the only thing that needs to be done is add a case to the if statement inside runcodeUI. Currently there's an if statement that checks if to add a textInput or a textAreaInput, and it'll be a one liner to support shinyAce I think https://github.com/daattali/shinyjs/blob/master/R/runcode.R#L60-L69 (I'm putting this out there so anyone else can also take a look) |
The
shinyAce
package provides the Ace editor within shiny pages. This feels like a more comfortable environment for writing R code for execution. (I do this for debugging shiny apps.)The text was updated successfully, but these errors were encountered: