Skip to content

Commit

Permalink
Closes elastic#5360. Removed code that attempted to produce unique co…
Browse files Browse the repository at this point in the history
…lors for every value in the color mapping object. Duplicating colors is ok. We simply want to map a generated color to a key without concern for whether it has already been used for another key.
  • Loading branch information
stormpython committed Dec 17, 2015
1 parent e6257c7 commit f733599
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/ui/public/vislib/components/color/mapped_colors.js
Expand Up @@ -38,11 +38,8 @@ define((require) => (Private, config) => {
if (this.get(key) == null) keysToMap.push(key);
});

// 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);
_.merge(this.mapping, _.zipObject(keysToMap, newColors));
const colorPalette = createColorPalette(keysToMap.length);
_.merge(this.mapping, _.zipObject(keysToMap, colorPalette));
}
}

Expand Down

0 comments on commit f733599

Please sign in to comment.