Skip to content

Latest commit

 

History

History
65 lines (39 loc) · 2.01 KB

README.md

File metadata and controls

65 lines (39 loc) · 2.01 KB

geocolor - was geocolor.io

geocolor classifies data contained in geojson properties, and assigns color values based on the simplestyle-spec. This means that when your geojson is rendered in github, gists, mapbox, or other simplestyle-spec compliant renderers, you will get nice styles that help to visualize your data.

Geocolors SC Counties

Install

npm install geocolor

Colors

The color gradient is defined by simply passing an array of colors with as many stops as you want.

Classification

Curently supported classifications:

  • equal intervals
  • quantiles
  • jenks

Example

Geocolors Continental US Pins Example

var geocolor = require('geocolor')

var cities = {
  // [point data](https://github.com/morganherlocker/geocolor/blob/master/test/in/cities.geojson)
}

var z = 'Population',
    classification = 'jenks', // 'quantile' and 'interval' also supported
    numberOfBreaks = 5,
    colors = ['green', 'yellow', 'red']

geo = geocolor(cities, z, classification, numberOfBreaks, colors)

// properties now contains style info with encoded colors
console.log(geo) 

Dev

Running tests:

npm test

More Examples

Geocolors Rivers Example

Geocolors Choloropleth South Carolina County Poverty

Geocolors Map Pin Gradient 1

Geocolors Map Pin Gradient 2