File size: 2,128 Bytes
84968bb fc2df7d 84968bb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
library(shiny)
library(shinyAce)
library(shinyjs)
library(shinythemes)
# ui.R
#Design 1:
shinyUI(
tagList(
tags$head(
tags$link(rel = "stylesheet", type = "text/css", href = "styles.css"),
tags$script(src = "script.js")
),
tags$div(
fluidPage(
useShinyjs(),
div(id = "sidebar",
sidebarPanel(
h2("Opciones"),
actionButton("theme_button", "Elige un tema"),
selectInput('theme_code', 'Tema editor', choices = themes, selected = 'ambiance'),
downloadButton('save_code', 'Guardar codigo', icon = icon('save')),
downloadButton('save_knit', 'Guardar knitr', icon = icon('save')),
tags$a(href = "https://github.com/pablovanegas/runr", target = "_blank", class = "btn btn-default shiny-bound-input", "Ver Código Fuente"),
tags$a(href = "https://github.com/pablovanegas/runr", target = "_blank", class = "btn btn-default shiny-bound-input", "YALM generator")
)
),#
mainPanel(
actionButton("toggleSidebar", "Opciones"),
h1("Simple R"),
tags$div(
class = "row",
tags$div(
class = "col-md-12", # Cuadrado 1
h2("Tu codigo: "),
verbatimTextOutput("log"),
aceEditor("rmd", mode = "markdown", value = init,
hotkeys = list(
open_chunk = 'Ctrl-Alt-I',
save_code = "Ctrl-S",
help_key = "F1"
),
autoComplete = "live"),
actionButton("eval", "Run", icon = icon('play')),
actionButton('clear', 'Clear', icon = icon('eraser')),
actionButton("open_chunk", "Insert Chunk", icon = icon('plus'))
)
),
tags$div(
class = "row",
tags$div(
class = "col-md-12", # Cuadrado 2
h1("Resultado: "),
htmlOutput("knitDoc")
)
)
)
)
)
)
) |