hodcroftlab / covariants

Real-time updates and information about key SARS-CoV-2 variants, plus the scripts that generate this information.
https://covariants.org/
GNU Affero General Public License v3.0
316 stars 113 forks source link

On hover window is very confusing #367

Open RonBarkan opened 1 year ago

RonBarkan commented 1 year ago

When hovering over the variant graph with the mouse pointer, a window opens up. Unfortunately, the data presented is very confusing:

  1. It shows variants with zero frequency
  2. The order of variants is different than in the graph, making it difficult to know which section in the graph is which line in the window. It wastes time and makes it less useful to read the data
  3. Perhaps make it extra clear which of the variants the mouse pointer is over, e.g. by making it bold or something

With a more user-friendly presentation, reading the data will become much easier to read and analyze, instead of struggling to understand what the window presents.

emmahodcroft commented 1 year ago

Hi Ron, Thanks for this issue report. On the Per Variant page, by default the hover box is ordered by frequency, and so should match the order of the lines: image Though you can change this at the top, using some of the options there: image

In the Per Country graphs, the hover legend is sorted by frequency, with the most frequent variants shown at the top: image It would be nice to offer more options for this on this page, but this functionality on the Per Variant page was provided by a contributor. We'd welcome PRs that might extend this similar functionality to the Per Country page!

The showing zero-frequency in the legends is something we've tried to tackle in the past (#287 ). Unfortunately there's some mis-coordination between the plotting and the legend functionality - if we don't include zero values then the lines don't plot, but including them means they show up in the legends. There is some effort to revamp this part of the plotting entirely, which may tackle this, but again, this is something we've not had much time to resolve.

I'm sorry the legends aren't always as clear as they could be, we do try and improve things when we can, but unfortunately are a very small team running the website just when we can, so it can be difficult to push such improvements forward!

RonBarkan commented 1 year ago

This bug is only about the Per Country (or per State) graphs, which is your last attachment above.

You can see there that the plot has a light pink at the top, but the light pink is maybe the 5th row on the hover window. Because there are many colors, they become similar, sometimes too similar, so it becomes quite a task.