This post describes how to build a circular packing with groups in d3.js. Three groups are represented: they are highlighted with different colors and are attracted toward different position. See more circular packing example in the dedicated section. This example works with d3.js v4
and v6
forceX()
is applied to each group: that's why they are obviously located in different part of the svg
area.