praekelt/sapphire — pull request #41 by justinvdm (2014-07-16 14:45:00+00:00)
Title: Colour hashing: attempt 2

The main reason to not just use a d3 colour scale directly is that we will end up with the same colours on all our charts. This is *okay* for our current widgets, but this means single metric widgets like histograms will always be the same colour.

What we were doing was hashing the metric keys, which often caused collisions (since the hash results get modded by the not-so-large size of the colour scale).

The plan is to hash the widget's title, and use this as an offset for the metric colours.