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

LegendThreshold not including last value #605

Closed
camille-s opened this issue Jan 17, 2020 · 1 comment · Fixed by #612
Closed

LegendThreshold not including last value #605

camille-s opened this issue Jan 17, 2020 · 1 comment · Fixed by #612
Labels
Milestone

Comments

@camille-s
Copy link

camille-s commented Jan 17, 2020

This seems possibly related to an old issue (#157) or the recent TypeScript rewrite, but I'm finding that with LegendThreshold, the last box isn't rendered. I have a scale with 5 breaks and thus (AFAIU) 6 colors. I built a base example with 2 workaround attempts here. As a rundown:

  • First version, just passing the 5-break, 6-color scale to LegendThreshold gives a legend with "Less than..." on the first box but no corresponding "More than..." on the last one. I checked that the scale is valid though by calling the scale function on a high value (see console log)
  • Second version, explicitly adding 1.0 to the end of the scale domain. This works, but hardcoding an upper limit means there's no "more than..." which would be more appropriate for this type of scale
  • Third version, based on the component's source code (at least the gist of it, I don't know TypeScript) was to add null to the end of the domain, but now the last box says "0.62More than" instead of "More than 0.62"

I should also mention that as another workaround, setting labelUpper=' or higher' works fine to get "0.62 or higher". Just wanted to bring up the fact that the default "More than 0.62" was broken.

Let me know if I'm misunderstanding something, or if I can help on it. Thanks in advance!

@williaster
Copy link
Collaborator

hey @camille-s 👋 thanks for checking out vx and raising this issue with great details + code sandbox.

I think this is due to a slight change in behavior from the TS re-write, I'll work on a fix and track here 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants