Skip to content

Instantly share code, notes, and snippets.

@zverok
Created November 25, 2014 11:21
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/4b42441bbbbc9a319ed7 to your computer and use it in GitHub Desktop.
Save zverok/4b42441bbbbc9a319ed7 to your computer and use it in GitHub Desktop.
// до всего - присваиваем темам последовательные индексы
// нумерация раздельная для своих и конкурентов
labels.
filter(function(l){return l.is_competitor;}).
forEach(function(l, i){l.number = i});
labels.
filter(function(l){return !l.is_competitor;}).
forEach(function(l, i){l.number = i});
// выбираем цвет в colorize_label
var color = _colors[label.number];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment