Skip to content

Commit b229cad

Browse files
committed
improve documentation readme
1 parent faf5d2b commit b229cad

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

readme.md

+12-22
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
##classybrew
22

3-
**classybrew** uses the Jenks Natural Breaks Algorithm to generate classes based on intrinsic breaks in your data. **classybrew** will also generate a range of **sequential** color codes based on the number of breaks in your data and a user defined palette. The minified JavaScript file is only 18kb in size, and will integrate perfectly with your next **mapping** project.
4-
5-
[View Blog Post](http://tannerjt.github.io/geotanner/javascript/color-theory/2014/10/29/classybrew-jenks-heart-colorbrewer.html)
6-
7-
This tool was built with help from two outstanding open source repositories.
8-
9-
+ [axismaps/colorbrewer](https://github.com/axismaps/colorbrewer) - Cynthia Brewers Color Theory
10-
+ [simogeo/geostats](https://github.com/simogeo/geostats)
11-
12-
For more information about Jenk's Natural Breaks and a helpful python port of the algorithm, visit [Daniel J Lewis's Blog](http://danieljlewis.org/2010/06/07/jenks-natural-breaks-algorithm-in-python/).
3+
**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](https://github.com/axismaps/colorbrewer) color palettes built in to quickly generate choropleth maps, graphics, tables, etc. with ease.
134

145
###Using classybrew
156

@@ -24,10 +15,8 @@ brew.setColorCode("BuGn");
2415

2516
**Basics - Classify**
2617

27-
You can use classify or getBreaks
28-
2918
```javascript
30-
brew.classify(); // returns [7.17,14.9,19.3,22.71,26.9,31.26]
19+
brew.classify('jenks'); // returns [7.17,14.9,19.3,22.71,26.9,31.26]
3120
```
3221

3322
**Basics - Retrieval**
@@ -60,11 +49,12 @@ brew.setColorCode(ColorCodeString); // color ramp code... see below
6049
// classification
6150
brew.getSeries(); // returns Array of original data
6251
brew.getNumClasses(); // returns set number of classes
63-
brew.classify(); // build array of natural breaks
64-
brew.getBreaks(); // same as classify
52+
brew.classify(Method:optional, Classes:optional); // returns classified data. Defaults to natural breaks methods
53+
brew.getBreaks(); // will call classify but for performance returns pointer if classify has already been called
6554

6655
//color theory
6756
brew.getColorCodes(); // returns array of all available color codes
57+
brew.getColorCodesByType; // returns object of color codes by type (diverging, sequential, qualitative)
6858
brew.getColorCode(); // returns set color code
6959
brew.getColors(); // returns array of colors specific to your data
7060
brew.getColorInRange(Num); // returns appropriate color for given number
@@ -78,13 +68,13 @@ The colors generated using classybrew are based on [Cynthia Brewer's](http://col
7868
var brew = new classyBrew();
7969
brew.getColorCodes(); // returns
8070
/*
81-
["BuGn","BuPu","GnBu",
82-
"OrRd","PuBu","PuBuGn",
83-
"PuRd","RdPu","YlGn",
84-
"YlGnBu","YlOrBr","YlOrRd",
85-
"Oranges", "Reds", "Greens",
86-
"Purples", "Greys", "Blues"];
71+
["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"];
8772
*/
8873
```
8974

90-
You can also view the simple test file to better understand how to use the library.
75+
You can also view the simple test file (./test/index.html) to better understand how to use the library and visualize the color palettes.
76+
77+
This tool was built with inspiration from two outstanding open source repositories.
78+
79+
+ [axismaps/colorbrewer](https://github.com/axismaps/colorbrewer) - Cynthia Brewers Color Theory
80+
+ [simogeo/geostats](https://github.com/simogeo/geostats)

todo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
1. Add support for geojson - WAIT
44
2. Add tests - Visual test (test/index.html) complete. Add tap tests.
5-
3. Update documentation
5+
3. Update documentation - use jsdoc http://usejsdoc.org/
66
4. Provide better examples
77
5. Setup Travis-CI
88
6. Add grunt tasks (linting)

0 commit comments

Comments
 (0)