I am trying to make network diagram in which the nodes are grouped by a property, and in which they are bundled by group with both location (force layout) and using a convex hull. Like this but without the click to collapse/expand. That model/code is a bit too complicated for a beginner to dissect and learn from.
My question can be simply put: is there example code of the network+grouped capability that includes the possibility of nodes in multiple groups?
Sometimes there will be only one node in a group, and the basic convex hull doesn't work for less than three. The above example has a fix for that (that I don't understand), and so does this one that creates invisible nodes and may be easier.
The groups can be nested at multiple layers. This tutorial provides all the info necessary to use d3.nest()
to get data in a hierarchy. But it may not be a hierarchy, it could be that a node is in multiple groups and needs to be in the correct hulls and location. Some nodes will not be in any group, but would still be connected in the network.
I know that the forces in force layouts are additive, so it shouldn't be a problem to have both the groups and the links effecting the node locations in a simple way, but I haven't seen a simple example of this. My approach is to add network connections to the multi-foci example and see if I can get that to work.
As bonuses, the nodes shouldn't overlap and for the hierarchical elements the base layer nodes should be put around a circle so that the nodes that are in multiple groups are in between those groups like this. I mentioned these now because the desire for these features may effect the best solution to the above desiderata.
I will be working on this building up from this JSFiddle; I will continue to update and refine this question as I make progress on the code myself. I would appreciate any pointers to code that's closer than the collapsible one to what I want, caveats for the limitations/problems of D3 (like needing a work-around for convex hulls of 1-2 nodes), and code that provides one of these capabilities in an understandable and modular way toward the final goal. Really, any help is appreciated.