Closed jameshadfield closed 11 months ago
Another observation (that I don't know where to thread really)... if I take the resulting file 2023-10-24_results.json
and drag-n-drop to https://nextstrain.github.io/forecasts-viz/ the resulting display is the generic color ramp rather than the hex values encoded in the JSON.
I've updated this PR to generate colour ranges from the provided clade colour (see commentary in the code of that function - I don't think the colours are better than using cmaps, but they are certainly much easier to maintain!) and also shifted the clade definitions into the config.
Another observation (that I don't know where to thread really)... if I take the resulting file 2023-10-24_results.json and drag-n-drop to https://nextstrain.github.io/forecasts-viz/ the resulting display is the generic color ramp rather than the hex values encoded in the JSON.
Oh! How annoying. ~The viz app must not be up-to-date. I'll update it.~ I've updated the viz app and it's now working.
I'm going to merge this now - any colour fixes (etc) can be easily applied by subsequent PRs if needed.
Thanks so much for the changes here James (and sorry that I forget to follow up). I really appreciate this. It should make things much more maintainable going forward.
Over time setting the clade colours & display names separately to the lineage colour definitions resulted in the two falling out of sync. This work unifies the approach so that the same script (using a unified configuration) modifies each JSON respectively.
Including the colour and display name data within the clades JSON is a big improvement as it allows simple retrospective analysis of old datasets.
Tested locally with no observed changes to the resulting colours.