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

when opts.scales.x.distr: 2, u.scales.x.min/max are indices #212

Closed
leeoniya opened this issue May 10, 2020 · 1 comment
Closed

when opts.scales.x.distr: 2, u.scales.x.min/max are indices #212

leeoniya opened this issue May 10, 2020 · 1 comment
Labels
docs Improvements or additions to documentation

Comments

@leeoniya
Copy link
Owner

leeoniya commented May 10, 2020

when opts.scales.x.distr: 2...

after calling .setScale('x', {min, max}), u.scales.x.min/max will actually be indices into data[0] rather than the indicated values. this is due to how the internals work to provide uniform spacing. e.g. it's not possilble to zoom in between data values when distr: 2. this will surely be re-visited anyhow as part of implementing log scales (#29).

this is surprising / non-uniform behavior, but is more of a papercut rather than a serious bug. the work-around is simply knowing that the actual scale's min has to be pulled by index from u.data[0][u.scales.x.min].

this is low priority because distr: 2 is already a niche case, and the cases when scales need to be read back after setting is even more niche. and in those cases, it's easily handled by the solution above.

@leeoniya leeoniya added the bug Something isn't working label May 10, 2020
@leeoniya leeoniya changed the title when scales.x.distr: 2, u.scales.x.min/max are indices when opts.scales.x.distr: 2, u.scales.x.min/max are indices May 10, 2020
@leeoniya
Copy link
Owner Author

leeoniya commented Nov 5, 2020

closing this as "by design", see #311 (comment)

@leeoniya leeoniya closed this as completed Nov 5, 2020
@leeoniya leeoniya added docs Improvements or additions to documentation and removed bug Something isn't working labels Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant