score:0

You can use the index that is passed as second argument to access the right element from the collection:

let selection = d3.selectAll(".region");
selection.each((d, i) => {
    d3.select(selection[0][i]).style("fill", this.compute_color(...));
})

score:0

You can try this

d3.selectAll(".region").each((data, index, nodes) => {
    d3.select(nodes[index]).style("fill", this.compute_color(...));
});

Related Query

More Query from same tag