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

Threshold labels at extremes not labelled correctly when using custom formatter #77

Closed
robatwilliams opened this issue Jan 17, 2018 · 3 comments

Comments

@robatwilliams
Copy link

Without formatter:

Less than -0.1
More than 0.1

With percentage formatter labelFormat(d3.format('+.1%')):

+NaN% to -12.0%
More than +15.0% to +NaN%

This is due to the replacements made in helpers.js relying on the formatter returning exactly NaN. This would also cause an issue if the default labelDelimiter is changed from "to".

Workaround: copy and adapt the helper.

@susielu
Copy link
Owner

susielu commented Mar 14, 2018

This has been fixed in v2.25.5 https://github.com/susielu/d3-legend/releases/tag/v2.25.5 let me know if you have any issues with it.

@susielu susielu closed this as completed Mar 14, 2018
@robatwilliams
Copy link
Author

I see that the commit c1bcef8 fixes #78 (more than X vs. X or more), but not this one #77 (NaN% not being replaced).

@susielu
Copy link
Owner

susielu commented Mar 31, 2018

Ahhh understood. This version should fix this bug as well. d3-svg-legend@2.25.6

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

No branches or pull requests

2 participants