Skip to content

Instantly share code, notes, and snippets.

@zverok
Created November 25, 2014 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zverok/3f458782c8f63ceaddda to your computer and use it in GitHub Desktop.
Save zverok/3f458782c8f63ceaddda to your computer and use it in GitHub Desktop.
build_color_map: function(labels){
var colors = _colors.slice(0),
colors_c = _colors.slice(0);
angular.forEach(labels, function(label){
if(label.is_competitor){
_color_map_c[label.label] = colors_c.shift();
} else {
_color_map[label.label] = colors.shift();
}
});
},
colorize_label: function(label) {
//find via mapped scale
if(label.is_competitor){
var color = _color_map_c[label.label];
} else {
var color = _color_map[label.label];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment