Add and clear data in Shiny.

g_clear_p(proxy)

g_data_p(proxy, data, from, to, value, ...)

Arguments

proxy

A proxy as returned by giorProxy.

data

A data.frame.

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.: inColor or outColor

Examples

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) }