geostats - Javascript classification library samples

Github page - download (from github)

Sample 8 - a choropleth representation (using openlayers) with JSON input

Sample 9 - dynamic HTML legend with user input, feature count, callback function and display mode option

Call to legend method with default options

Call to legend method with options : customized text, callback function and 'distinct' mode. Decimal precision has been set to 2.

Call to legend method with options : 'discontinuous' mode, and descending order.

Sample 10 - Handle unique values

Sample 11 - a choropleth representation (using openlayers) with JSON input and Chroma.js

			
				// getting the color ramp from chroma by passing min, max values and number of classes
				var color_x = chroma.scale('RdYlGn').domain([serie7.min(),serie7.max()], 5).colors();
				
				// setting colors into geostats
				serie7.setColors(color_x);
				
				// rendering the html legend with geostats
				jQuery('#legend5').html(serie7.getHtmlLegend(null, null, 1));
				
				// displaying map with openlayers
				initChromaSample(color_x, class_x);