-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hover over edges not working #1
Comments
Does it work by adding the follow to the graph? sg_settings(enableEdgeHovering = TRUE) Its one of the many settings, somewhat hidden I must admit. |
Hi John, I tried adding that line to my |
Goodness. Apologies for the late "fix" @kyleweise . I found the problem, for edge hover to work one must:
This works: library(shiny)
library(sigmajs)
nodes <- sg_make_nodes(100)
edges <- sg_make_edges(nodes)
edges$size <- runif(1, 5, nrow(edges)) # add size
ui <- fluidPage(
sigmajsOutput("sg"),
p("Hover over a node or edge"),
verbatimTextOutput("hoverNode"),
verbatimTextOutput("hoverEdge")
)
server <- function(input, output){
output$sg <- renderSigmajs({
sigmajs() %>%
sg_nodes(nodes, id, size, color) %>%
sg_edges(edges, id, source, target, size) %>% # pass size
sg_settings(enableEdgeHovering = TRUE)
})
# capture node hover
output$hoverNode <- renderPrint({
paste0("This is node number: ", input$sg_over_node[["id"]])
})
# capture edge hover
output$hoverEdge <- renderPrint({
paste0("This is edge number: ", input$sg_over_edge[["id"]])
})
}
shinyApp(ui, server) # run Let me know if this works, feel free to close if it's OK. Thanks for reporting that, I will add this to the documentation. |
Hello, very interested in this package and it is very well documented so kudos for that! However, I'm running into a problem when I try to capture hovering over edge events. Following this as a guide, here is my code:
As I move my mouse around, it captures the node hovering events just fine, but displays nothing when hovering over an edge. Is this a bug or am I doing something incorrectly?
Thanks!
-Kyle
The text was updated successfully, but these errors were encountered: