artic-network / rampart

Read Assignment, Mapping, and Phylogenetic Analysis in Real Time
GNU General Public License v3.0
79 stars 33 forks source link

Dynamically pick colour range for different samples #33

Closed rambaut closed 5 years ago

rambaut commented 5 years ago

Currently, at line 77 in processServerData.js, state.sampleColours = createSampleColours(25); creates an array of 25 colours on a spectrum. This allows for the 24 native barcodes + 1 extra (i.e., 'none'). This needs to be dynamic for the number of samples.

If the number samples is greater than this then there is an array out of bounds exception thrown in some of the components that use it. These should probably 'wrap' around to avoid the exception.

rambaut commented 5 years ago

Also with 25 colour spectrum, the adjacent ones are very similar. Should probably spread more when using fewer samples. Also allowing some customization would be good - i.e., colour 'groups' for related samples, greys for controls etc.

jameshadfield commented 5 years ago

Implemented in 5cd9929779a0c7202786befe7614617475d04868