mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Now with a 2nd argument
This commit is contained in:
parent
77c31076c2
commit
b8e54c865b
1 changed files with 2 additions and 5 deletions
|
@ -41,11 +41,8 @@ define((require) => (Private, config) => {
|
|||
// Generate a color palette big enough that all new keys can have unique color values
|
||||
const allColors = _(this.mapping).values().union(configColors).value();
|
||||
const colorPalette = createColorPalette(allColors.length + keysToMap.length);
|
||||
const newColors = _.difference(colorPalette, allColors);
|
||||
|
||||
while (newColors.length < keysToMap.length) {
|
||||
newColors.push(_.sample(allColors));
|
||||
}
|
||||
let newColors = _.difference(colorPalette, allColors);
|
||||
newColors = newColors.concat(_.sample(allColors, keysToMap.length - newColors.length));
|
||||
|
||||
_.merge(this.mapping, _.zipObject(keysToMap, newColors));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue