block by mpmckenna8 055dac2afb730a855898

d3 topo color by neighbor CA Assembly Districts

Full Screen

So if you have a bunch of polygons and they’re topojson and you want to show em using d3 there’s a handy dandy neighbors method which when combined with a color scale generator makes coloring polygons a breeze.

You still need to be careful though, I’m using 8 or maybe 9 colors, I still haven’t really figured out how it’s working. But at least I got it to work. Now read the docs and see if I can wrap my head around the colors and scales stuff.

https://github.com/mbostock/d3/wiki

index.html