timelyportfolio / RBioFabric

An R implementation of the BioFabric network visualization tool
7 stars 1 forks source link

Display the edge name after hovering over an edge in network created with bioFabric. #4

Open makis23 opened 5 years ago

makis23 commented 5 years ago

Below I have a shiny app which displayes a network using the bioFabric package. As you will see when you hover over a node (squares) you get its name and the name of the node that is connected to it. Can the same be achieved for the edges (lines)? After hovering over an edge you should take the relative edge name.

  # Define UI for app that draws a biofabric ----
    ui <- fluidPage(

      # App title ----
      titlePanel("Hello Biofabric!"),

      p("sample shinyApp to check if it deploys to shinyapps.io"),
      p("source at: "),
      a(href="https://github.com/jas1/RBioFabricShinyExample","github:RBioFabricShinyExample"),

      fluidRow(
        column(width = 12, 
               # Output: biofabric ----
               bioFabric_htmlwidgetOutput("output_biofabric_net",
                                          width = "100%", 
                                          height = "500px") )
      )
    )

    # server side
    server <- function(input, output,session) {

      # defining biofabric output
      output$output_biofabric_net <- renderBioFabric_htmlwidget({
        graph_data <- karate
        bioFabric_htmlwidget( bioFabric(graph_data),height = 500 )
      })
    }

    # Create Shiny app ----
    shinyApp(ui = ui, server = server)