1.0.4 • Published 10 years ago
five-color-map v1.0.4
five-color-map
Color a GeoJSON FeatureCollection so that bordering areas never have the same fill. Five colors are all you'll need.
example

install
install with npm:
$ npm install --save five-color-mapcommand line
install with npm:
$ npm install -g five-color-mapthen
$ fivecolormap data.geojson > colored-data.geojsonusage
var fiveColorMap = require('five-color-map');
var coloredGeoJSON = fiveColorMap(geojson);Each feature in coloredGeoJSON.features now has a property fill with one of five values:

caveat
At least one of your features must have less than 5 neighbors with adjacent sides. This won't work with a map of hexagons.