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

log.ticks and precise floats #234

Closed
nejc0mins opened this issue Dec 28, 2020 · 1 comment · Fixed by #253
Closed

log.ticks and precise floats #234

nejc0mins opened this issue Dec 28, 2020 · 1 comment · Fixed by #253

Comments

@nejc0mins
Copy link

Similar to #81, except on a log scale.

const testLog = scaleLog().domain([0.15, 0.68]);
console.log(testLog.ticks());

This will output: [0.2, 0.30000000000000004, 0.4, 0.5, 0.6000000000000001]

I am using the latest version (3.2.3)

@mbostock
Copy link
Member

I suspect this is only possible if the base is 10 (not in general), so it’ll probably require some special-case logic. I’m not planning on implementing this, but feel free to take a crack at it.

mbostock added a commit that referenced this issue Sep 18, 2021
mbostock added a commit that referenced this issue Sep 19, 2021
mbostock added a commit that referenced this issue Sep 19, 2021
* fix #234; exact log ticks

* let/const

(see also #212)

Co-authored-by: Philippe Rivière <fil@rezo.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants