'R networkD3 - how to control layout of nodes in forceNetwork

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



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source