Description Usage Arguments Examples
Edit R Data with 'react-json'
1 2 3 4 5 6 7 | reactjson(listdata = list(), name = "root", theme = "rjv-default",
iconStyle = c("circle", "triangle", "square"), indentWidth = 4,
collapsed = FALSE, collapseStringsAfterLength = FALSE,
groupArraysAfterLength = 100, enableClipboard = TRUE,
displayObjectSize = TRUE, displayDataTypes = TRUE, onEdit = TRUE,
onAdd = TRUE, onDelete = TRUE, onSelect = TRUE, sortKeys = FALSE,
width = NULL, height = NULL, elementId = NULL)
|
listdata |
|
name |
|
theme |
|
iconStyle |
|
indentWidth |
|
collapsed |
|
collapseStringsAfterLength |
|
groupArraysAfterLength |
|
enableClipboard |
|
displayObjectSize |
|
displayDataTypes |
|
onEdit, onAdd, onDelete, onSelect |
|
sortKeys |
|
width |
integer in pixels defining the width of the |
height |
integer in pixels defining the height of the |
elementId |
character to specify valid |
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 61 62 | ## Not run:
library(listviewer)
# use reactR for React dependencies
# devtools::install_github("timelyportfolio/reactR")
library(reactR)
reactjson()
reactjson(head(mtcars,4))
reactjson(I(jsonlite::toJSON(head(mtcars,5))))
library(shiny)
shinyApp(
ui = reactjson(
list(x=1,msg="react+r+shiny",opts=list(use_react=FALSE)),
elementId = "json1"
),
server = function(input, output, session){
observeEvent(
input$json1_change,
str(input$json1_change)
)
}
)
# gadget to use as editor
library(miniUI)
ui <- miniUI::miniPage(
miniUI::miniContentPanel(
reactjson(
list(x=1,msg="react+r+shiny",opts=list(use_react=FALSE)),
elementId = "rjeditor"
)
),
miniUI::gadgetTitleBar(
"Edit",
right = miniUI::miniTitleBarButton("done", "Done", primary = TRUE)
)
)
server <- function(input, output, session) {
shiny::observeEvent(input$done, {
shiny::stopApp(
input$rjeditor_change
)
})
shiny::observeEvent(input$cancel, { shiny::stopApp (NULL) })
}
runGadget(
ui,
server,
viewer = shiny::paneViewer()
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.