0

Does anyone know of a way to control the layout of the nodes in the forceNetwork function of the networkD3 package? I would like to the smaller nodes that are unique to each large node cluster laid out in the form of the semi-circle so that the edges do not overlap. Basically, I would like to make the edges overlap as little as possible in the forceNetwork. My code to create the network is below.

library(networkD3)
forceNetwork(
    Links = edges,
    Nodes = nodes,
    fontFamily = "Arial",
    Nodesize = "size",
    Source = "source_id",
    Target = "target_id",
    NodeID = "type_2",
    Group = "type_3",
    zoom = TRUE,
    opacity = 1,
    charge = -600,
    linkColour = color_string_link,
    linkWidth = 2.5,
    opacityNoHover = 0
)

This code produces this network. But I would like the outer nodes to be in the shape of a semi-circle so that the edges do not overlap. I would also like to group the edges together by color in the layout as well. Any help is appreciated :)

enter image description here

AyeTown
  • 717
  • 4
  • 16
  • There are many ways to control the graph, however, it's difficult to determine what will work here, because your question isn't reproducible. I wish I'd seen this question sooner to when you asked. If you're still looking for an answer, can you add the data you used to your question? Like the output from `dput(head(dataObject)))`. Check it out: [making R reproducible questions](https://stackoverflow.com/q/5963269). – Kat May 08 '22 at 05:35

0 Answers0