I\'ve made a force directed graph with d3.js plugin, and I wanna color the nodes and the labels with the different color according to group which they belong.
I\'ve
I think you need to change the style attribute of the circle, not the g element.
g
node.append("circle").style("fill", function(d) { return color(d.group); })
Edit: The group property in the data must also be changed integers, or cast later.