debrief / pepys-import

Support library for Pepys maritime data analysis environment
https://pepys-import.readthedocs.io/
Apache License 2.0
5 stars 5 forks source link

Do we want fixed (ie. repeatable) colours for fields in the highlighter? #151

Closed robintw closed 3 years ago

robintw commented 4 years ago

At the moment the highlighter chooses random colours to highlight the different fields in the output HTML file.

There are two problems with this:

  1. Sometimes the random colours aren't that different from each other - so it's hard to tell which field is which

  2. The randomness is different each time, so the first time an analyst highlights a file the heading might come out as red, and the second time it might be blue. This could be confusing.

We could fix the second problem simply by setting the random seed at the beginning of the highlighting, so it always comes out with the same colours in the same order. To fix the first problem we'd need to alter the colour selection code to one that tries specifically to find colours a long way from each other (I'm sure there are examples online - I've come across them before)

IanMayo commented 4 years ago
  1. If we're outputting at the end of the extraction, we could calculate the number of colours we need, and work our way through the color spectrum, giving colors with greatest contrast
  2. If we want repeatable colors, we could do a hash on the importer/field combination, and generate a color based on that hash. Then each time that importer/field was used in any file, we'd have the same color.

Hmm, maybe we should let things mature a little then come back to this.

robintw commented 4 years ago

Note from some research: these links may be useful when coming back to this:

IanMayo commented 3 years ago

Closing this. The users don't currently make much use of the highlighting report, though they may do as increased volumes of narrative/text data are handled. Re-open if necessary.