Skip to content

reactflow only works with renderReactflow and not when included in UI #8

@DavZim

Description

@DavZim
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%"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions