The map displays groups of ZCTAs and what I would like to achieve is being able to mouse over the different color rectangles, and have any ZCTA that is not that color fade.
I have achieved the effect I want for Group 4 using the gray square which is hardcoded for Group 4. However, when I try to generalize this to the rectangles the code stops working.
So I managed to get the legend working, in that if you mouse over the rectangles on the right hand side (corresponding to the trial_legend āgā that is created in the chart definition), then the fade effect works:
However, if you try the same with the rectangles on the left which are created outside the chart definition, then the fade effect does not work.