All Projects → tannerjt → classybrew

tannerjt / classybrew

Licence: MIT license
Classybrew is a utility for generating statistical class breaks in your data and applying colorbrewer theory to you color palette.

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to classybrew

GeoUtils
Class-based handling of georeferenced raster and vector data
Stars: ✭ 32 (-5.88%)
Mutual labels:  gis
GSFLOW-GRASS
Generates inputs for and runs the coupled groundwater-surface water model "GSFLOW"
Stars: ✭ 24 (-29.41%)
Mutual labels:  gis
gds course
Geographic Data Science, the course
Stars: ✭ 60 (+76.47%)
Mutual labels:  gis
eemont
A python package that extends Google Earth Engine.
Stars: ✭ 290 (+752.94%)
Mutual labels:  gis
AdvantEDGE
AdvantEDGE, Mobile Edge Emulation Platform
Stars: ✭ 36 (+5.88%)
Mutual labels:  gis
geosapi
R interface to GeoServer REST API
Stars: ✭ 26 (-23.53%)
Mutual labels:  gis
geokey
Platform for participatory mapping
Stars: ✭ 53 (+55.88%)
Mutual labels:  gis
custom-mapbox-layer
A custom layer based on Mapbox
Stars: ✭ 66 (+94.12%)
Mutual labels:  gis
gis-cheatsheets
GIS Cheatsheet
Stars: ✭ 31 (-8.82%)
Mutual labels:  gis
val3dity
Validation of 3D primitives according to the international standard ISO19107
Stars: ✭ 65 (+91.18%)
Mutual labels:  gis
geologic-symbols-qgis
Geologic symbols library and development for QGIS
Stars: ✭ 63 (+85.29%)
Mutual labels:  gis
climbing-data
Open license climbing data
Stars: ✭ 42 (+23.53%)
Mutual labels:  gis
shapefile-rs
Rust library to read & write shapefiles
Stars: ✭ 38 (+11.76%)
Mutual labels:  gis
Learning-R
R Tutorials
Stars: ✭ 26 (-23.53%)
Mutual labels:  gis
invest
InVEST: models that map and value the goods and services from nature that sustain and fulfill human life.
Stars: ✭ 71 (+108.82%)
Mutual labels:  gis
CesiumJs3DTileServer
cesiumgis.com/
Stars: ✭ 25 (-26.47%)
Mutual labels:  gis
cntms
Tile Map Server reverse proxy with coordinates regularization
Stars: ✭ 19 (-44.12%)
Mutual labels:  gis
mago3d-CMS
mago3D Project
Stars: ✭ 61 (+79.41%)
Mutual labels:  gis
wms-tiles-downloader
CLI for downloading map tiles from WMS server with given bbox and zoom.
Stars: ✭ 47 (+38.24%)
Mutual labels:  gis
Atlas
An extensible 3D GIS application for visualization, analysis and research.
Stars: ✭ 113 (+232.35%)
Mutual labels:  gis

classybrew

classybrew lets you choose from several statistical algorithms (Jenks Natural Breaks, Quantile, Equal Interval) to generate class breaks based on your data. classybrew has colorbrewer color palettes built in to quickly generate choropleth maps, graphics, tables, etc. with ease.

View classybrew in action!

Created By: tannergeo

Using classybrew

Basics - Setup

var brew = new classyBrew();
brew.setSeries([30.01, 14.9, 22.71, 24.96, 7.17, ...]);
brew.setNumClasses(5);
brew.setColorCode("BuGn");

Basics - Classify

brew.classify('jenks'); // returns [7.17,14.9,19.3,22.71,26.9,31.26]

Basics - Retrieval

var breaks = brew.getBreaks(); // returns [7.17,14.9,19.3,22.71,26.9,31.26]
var colors = brew.getColors(); // returns [rgb(237,248,251),rgb(178,226,226),rgb(102,194,164),rgb(44,162,95),rgb(0,109,44)]
brew.getColorInRange(7.5); // returns rgb(237,248,251)

All classybrew Methods

//constructor
var brew = new classyBrew();

//_____setters______//
//__________________//

// classification
brew.setSeries(Array); // define array of data to classify
brew.setNumClasses(Number); // number of classes or breaks
//@Methods: equal_interval, quantile, jenks
brew.classify(Method:optional, Classes:optional); // returns classified data. Defaults to natural breaks methods

// color theory
brew.setColorCode(ColorCodeString); // color ramp code... see below

//_____getters______//
//__________________//

// classification
brew.getSeries(); // returns Array of original data
brew.getNumClasses(); // returns set number of classes
brew.getBreaks(); // will call classify but for performance returns pointer if classify has already been called
brew.getClassificationMethods(); // returns available classification methods to pass to classify()

//color theory
brew.getColorCodes(); // returns array of all available color codes
brew.getColorCodesByType(); // returns object of color codes by type (diverging, sequential, qualitative)
brew.getColorCode(); // returns set color code
brew.getColors(); // returns array of colors specific to your data
brew.getColorInRange(Num); // returns appropriate color for given number

Color Theory

The colors generated using classybrew are based on Cynthia Brewer's sequential color ramps. Below are the possible codes you can use when generating your color ramp with your data. BuGn -> Blue to Green

var brew = new classyBrew();
brew.getColorCodes();  // returns
/*
["OrRd", "PuBu", "BuPu", "Oranges", 
"BuGn", "YlOrBr", "YlGn", "Reds", 
"RdPu", "Greens", "YlGnBu", "Purples", 
"GnBu", "Greys", "YlOrRd", "PuRd", "Blues", 
"PuBuGn", "Spectral", "RdYlGn", "RdBu", 
"PiYG", "PRGn", "RdYlBu", "BrBG", 
"RdGy", "PuOr", "Set2", "Accent", 
"Set1", "Set3", "Dark2", "Paired", 
"Pastel2", "Pastel1"];
*/

You can also view the simple test file (./test/index.html) to better understand how to use the library and visualize the color palettes.

This tool was built with inspiration from two outstanding open source repositories.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].