code: function(clusterCriteria, subClusterCriteria, numClusters, isReversed){
  		var sorted = this.colors.slice(0),
  			clusters = [],
  			d = 1,
  			i = 0,
  			num = sorted.length,
  			slice;
  
  		sorted.sort( clusterCriteria.compare ).reverse();
  		for(var j=0;j<num;j++){
  			var c = sorted[j];
  			if(c.getComponentValue(clusterCriteria) < d){
  				slice = sorted.slice(i, j);
  				slice.sort( subClusterCriteria.compare );
  				clusters.push.apply(clusters,slice);
  				d -= 1.0 / numClusters;
  				i = j;
  			}
  		}
  		slice = [];
  		Array.prototype.push.apply(slice,sorted.slice(i,sorted.length));
  		slice.sort( subClusterCriteria.compare );
  		clusters.push.apply(clusters,slice);
  		if(isReversed){
  			clusters.reverse();
  		}
  		this.colors = clusters;
  		return this;
  	}
docs: Sorts the list based on two criteria to create clusters/segments within
  the list.
  @param clusterCriteria main sort criteria
  @param subClusterCriteria secondary sort criteria
  @param numClusters number of clusters
  @param isReversed true, if reversed sort
  @return itself