Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlapping legend entries #1547

Closed
jameshadfield opened this issue Sep 18, 2022 · 2 comments
Closed

Overlapping legend entries #1547

jameshadfield opened this issue Sep 18, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@jameshadfield
Copy link
Member

If the user successively changes the “Color By” parameter the legend entries can overlap. This is not resolvable in-app (as far as I can tell), but has no other side-effects.

image

First reported in https://discussion.nextstrain.org/t/captions-overlap-due-to-color-by-parameter/1241

@joverlee521
Copy link
Contributor

I noticed the "rate" legend shows duplicate entires in the reported build.

Screen Shot 2022-09-19 at 12 23 58 PM

So I downloaded and viewed the build locally and get console warnings of duplicate keys:

Screen Shot 2022-09-19 at 12 32 34 PM

I think the overlap somehow a result of the non-unique keys, but I'm not entirely sure how?

@jameshadfield
Copy link
Member Author

Oh that could be it for sure -- react not reconciling the DOM properly due to duplicate keys.

@victorlin victorlin moved this from New to Backlog in Nextstrain planning (archived) Sep 20, 2022
jameshadfield added a commit that referenced this issue Oct 20, 2022
Fixes the bug described in #1547 caused by identical legend entries
which therefore had the same react key and thus DOM reconciliation
failed. The cause of the bug was identified by @joverlee521 in
#1547 (comment)

The legend entries (array) do not change for a given coloring, and thus
I believe it's safe to use the index in the key. It's certainly better
than duplicating keys. There is a deeper problem which is why we have
identical entries in the legend, which I'll attempt to solve in the
subsequent commit but since we allow dataset-defined legend entries it's
a good idea to handle the case of duplicated values.

Closes #1547
Repository owner moved this from Backlog to Done in Nextstrain planning (archived) Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

2 participants