library(shiny)
library(reactflow)
ui <- fillPage(
h1("Below should be a graph!"),
reactflowOutput("my_graph", height = "100%")
)
nodes <- list(
list(id = "start", data = list(label = "Start Node")),
list(id = "mid", data = list(label = "Mid Node")),
list(id = "end", data = list(label = "End Node"))
)
edges <- list(
list(source = "start", target = "mid", id = "start-mid"),
list(source = "mid", target = "end", id = "mid-end")
)
server <- function(input, output, session) {
output$my_graph <- renderReactflow({
reactflow(
nodes = nodes,
edges = edges
)
})
}
shinyApp(ui, server)
Note the above doesnt show anything due to height = "100%"