Created
November 25, 2014 11:16
-
-
Save zverok/3f458782c8f63ceaddda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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