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
Check axis spec :major / :minor instead of :visible when drawing grid. #67
Conversation
The only potential issue I can see here is that when an axis has its Other than that - thanks! :) 👍 |
It makes sense to check for both The question is, if |
To my mind, if |
In that case this check should be enough, and these ones could be removed. So as long as |
You're right you could leave these out in principle, but would like to keep them for performance reasons / realtime use cases (animated charts), i.e. to avoid the extraneous work & function calls. I understand these won't make much of difference, but every little helps and adds up... |
Because of the way the library works now, it's better to leave it as is.
One of our projects needs charts with fixed grid lines, so I removed the rounding, and it generates grid lines that start at the same position as the axis. That's where the need for Some middleground I guess would be to change the checks in
Another thing that we came across was when the rounding is removed, sometimes there are charts that have the last grid line out of range by 1e-13, so it is filtered out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to use norm-range
instead of range
here https://github.com/thi-ng/geom/blob/feature/no-org/src/thi/ng/geom/viz/core.cljc#L347
Hey @dimovich - why did you close this PR? i'm sorry I'm been neglecting merging this, since I wanted to do more experiments/tests with these changes before... |
Apologies if that's the case! I was under the impression that due to how the library works now (grid line ticks being rounded) there is no need to add additional checks. All the issues appear when one removes this rounding. |
Currently when the viz-spec has :visible set to false, the grid is not drawn even though minor-x or minor-y is set to true.