1

How can I upload 10 million points with 100,000 categories and have CartoDB randomly assign a color to each cateogry?

Currently, it only seems to color the first 10. And from what I've seen on other questions the only way to color more is to edit the CSS files. I don't think this is too feasible for what I'm trying to do. Is there anything built in for this use case?

The reason I have so many categories is because these points cover all of north america and are clustered together based on their category. So for example the items can be households (one points per household) and the category would be the neighborhood the household is in. I actually don't care about having unique colors, so long as two nearby clusters don't share the same color.

I decided to just add a new random category value to determine the coloring and add my own CSS for the ~50 unique colors I chose.

3
  • 4
    ...what are you trying to do??? Commented Apr 7, 2016 at 18:50
  • 4
    I'm not familiar with CartoDB, but presumably you could add three short integer columns, R, G and B and use a random function to generate values for each between 0 and 255 and color by those values. If you mean you want 100K individual colors, good luck with that.I doubt many people could distinguish that many colors, especially for points.
    – recurvata
    Commented Apr 7, 2016 at 19:02
  • 1
    I might point out that the human eye is not capable of distinguishing between so many colors
    – wmebane
    Commented Apr 7, 2016 at 20:15

1 Answer 1

2

recurvata is right with their comment. You'll struggle with so many categories to get unique colours. I'd question why you need to do this.

You should really try to group your categories into broader groups... if you have 100k categories, the categories don't really have much information.

If you edit your question to clarify why you have so many categories, it might help? There are ways to cluster and classify categories down to something that people can understand.

Even those with perfect colour vision can't distinguish more than a few thousand colours . See also Macadam Ellipse for why certain colours appear identical. And colour-blind people see even fewer colours.

Also, the human visual system is more sensitive to greens - we can tell two shades of green apart much more easily than two shades of red.

I find that with over 10 randomly chosen colours, there will be at least two which are very difficult to tell apart :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.