add.Rd
Add and clear data in Shiny.
g_clear_p(proxy) g_data_p(proxy, data, from, to, value, ...)
proxy | A proxy as returned by |
---|---|
data | A |
from | Source and target of edges. |
to | Source and target of edges. |
value | Numerical value of edges. |
... | Any other columns to select from the data, i.e.: |
if(interactive()){ library(shiny) data("country_data") ui <- fluidPage( actionButton("add", "add"), actionButton("clear", "clear"), giorOutput("gior") ) server <- function(input, output, session){ output$gior <- renderGior({ data %>% gior() %>% g_data(from, to, value) }) observeEvent(input$clear, { giorProxy("gior") %>% g_clear_p() }) observeEvent(input$add, { giorProxy("gior") %>% g_data_p(country_data, from, to, value) }) } shinyApp(ui, server) }