score:1

Accepted answer

There are many ways to skin this cat but one common way is to filter the data for the selection:

var pickCirlces = circleGroup.selectAll("circle")
    .filter(function(d) {return d.color === "purple"})
    .transition().duration(1200)
    .style("fill", "yellow")

Here is the FIDDLE.

You can read more about this technique here.


Related Query

More Query from same tag