Closed julianstanley closed 4 years ago
Hi,
Fix on github (removing some controls on allowed split columns...) :
# using DF and dot notation
nodes <- data.frame(id = 1:3)
edges <- data.frame(from = c(1, 1, 2),
to = c(1,1, 3),
selfReference.angle = c(2*pi, pi, NA))
visNetwork(nodes, edges)
And using a list, it's ok to with this structure :
# using a list
nodes <- list(list(id = 1), list(id = 2), list(id = 3))
edges <- list(list(from = 1, to = 1, selfReference = list(angle = pi)),
list(from = 1, to = 1, selfReference = list(angle = 2 *pi)),
list(from = 2, to = 3))
visNetwork(nodes, edges)
This now works brilliantly:
visNetwork(nodes = data.frame(label = "Node 1", id = 1),
edges = data.frame(id = c("Edge1", "Edge2"),
label = c("Edge 1", "Edge 2"),
to = c(1, 1),
from = c(1,1),
selfReference.angle = c(2*pi, pi),
selfReference.size = c(30, 30)))
Thank you!!!
Recently, I've needed nodes to have two self-referencing edges.
Ideally, they would look like this:
In vis.js, I do this by setting the edge.selfReference.angle parameter, e.g.:
See full jsbin example here.
As stated here the dot notation should work for this, right? But it doesn't seem to work in my hands, on visNetwork 2.1.0.
Example:
Should output the same as above, but instead outputs:
I noticed while experimenting that the selfReference.angle parameter doesn't work with some vis-network versions, but it does work with 7.5.2.