-
Notifications
You must be signed in to change notification settings - Fork 1
/
sandbox.R
69 lines (40 loc) · 1.12 KB
/
sandbox.R
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
63
64
65
66
67
68
69
Server <- shinyServer(function(input, output, session) {
# vis function
Net <- function() { visNetwork(
nodes = data.frame(id = 1:3),
edges = data.frame(from = c(1,2), to = c(1,3))
)}
# output
output$network_proxy <- renderVisNetwork({ Net() })
# # observe
# observer <- observe({
# input$getAll
# visNetworkProxy("network_proxy") %>%
# visGetEdges()
# visNetworkProxy("network_proxy") %>%
# visGetNodes()
# print(input$network_proxy_edges)
# print(input$network_proxy_nodes)
# })
# # output
# output$edges_data_from_shiny <- renderPrint({
# input$network_proxy_edges
# })
# output$nodes_data_from_shiny <- renderPrint({
# input$network_proxy_nodes
# })
# # cleanup
# session$onSessionEnded(function() {
# observer$suspend()
# })
})
UI <- shinyUI(fluidPage(
actionButton("getAll", "fetch"),
visNetworkOutput("network_proxy", height = "400px"),
verbatimTextOutput("edges_data_from_shiny"),
verbatimTextOutput("nodes_data_from_shiny")
))
Test <- function(){ shinyApp(
UI, Server
)}
#'test' %>% str_c('https://api.are.na/v2/channels/', ., '/thumb') %>% fromJSON