-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
Thank you for this great package!
I recently came across this bug: When the name of the variable from the argument selectedBy within the visOptions function contains a dot (.), the selected group is no longer displayed, instead the whole network is just greyed out, no single node is highlighted.
Below is a simple reprex:
library(visNetwork)
nodes <- jsonlite::fromJSON("https://raw.githubusercontent.com/datastorm-open/datastorm-open.github.io/master/visNetwork/data/nodes_miserables.json")
edges <- jsonlite::fromJSON("https://raw.githubusercontent.com/datastorm-open/datastorm-open.github.io/master/visNetwork/data/edges_miserables.json")
nodes$group_copy <- nodes$group
nodes$group.copy <- nodes$group
# 1. With underscore 'group_copy' - Works as intended
visNetwork(nodes, edges, height = "700px", width = "100%") %>%
visInteraction(navigationButtons = TRUE, keyboard = TRUE) %>%
visOptions(highlightNearest = TRUE, nodesIdSelection = TRUE, selectedBy = "group_copy") %>%
visPhysics(stabilization = TRUE) %>%
visLayout(randomSeed = 123)
# 2. With dot 'group.copy' - Doesn't work
visNetwork(nodes, edges, height = "700px", width = "100%") %>%
visInteraction(navigationButtons = TRUE, keyboard = TRUE) %>%
visOptions(highlightNearest = TRUE, nodesIdSelection = TRUE, selectedBy = "group.copy") %>%
visPhysics(stabilization = TRUE) %>%
visLayout(randomSeed = 123)
# 3. With dot 'group.copy' and list parameter - Still doesn't work
visNetwork(nodes, edges, height = "700px", width = "100%") %>%
visInteraction(navigationButtons = TRUE, keyboard = TRUE) %>%
visOptions(highlightNearest = TRUE, nodesIdSelection = TRUE, selectedBy = list(variable = "group.copy")) %>%
visPhysics(stabilization = TRUE) %>%
visLayout(randomSeed = 123)
Metadata
Metadata
Assignees
Labels
No labels