score:0

I think this is what you're looking for.

.style('fill', function(d) { 
     /* match item (d) with some condition */
})

On value change as well, you can just restyle/refill the polygons:

svg.selectAll('polygon').style('fill', function(d) { 
    /* match item (d) with value selected */
});

Related Query