All examples By author By category About

mpmckenna8

d3 topo color by neighbor CA Assembly Districts

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