-
Notifications
You must be signed in to change notification settings - Fork 985
Add MinimumMajorIntervalCount and MaximumMajorIntervalCount Axis Properties (#24) #1712
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
Conversation
|
Sounds interesting! I'm a bit busy these days, but I'll try to take a closer look tomorrow. |
|
I think I like this change! Some other thoughts:
|
|
I like the symmetry in the names at the moment, but prefixing I can't repro the small-axis issue: can you provide the exact code you were using? I agree what you describe would be better and is what I see when I set the min and leave the max free: It would be nice to add this as a non-breaking change now and change the defaults later, but I in terms of wanting to get 2.1 out the door, I think you are right and we should hold off adding more complexity. |
For me it happens every time when I
Let me know if you can reproduce it this way, if not I'll try and come up with some code that reproduces it. |
|
Ah, yeah, I remember this now (can repro also). I thought I'd addressed, but I can't think how, so I guess I didn't. It's caused by the range changing slightly when panning: if the range is 100, then when it considers an interval of 50 it projects the number of ticks as being 100/50=2, and it is happy with that. But when you pan, the range can end up slightly either side of 100, and if it goes below 100, it rejects an interval of 50 (because for a range of <100, it is possible there could be only 1 tick depending on the offset). This is an unsolvable problem in the sense that there will always be a range where it could go either way. We could ask |
|
I'm tempted to say we should merge this. The range issue is still there, but even the new behaviour is arguably better than the old behaviour (a single tick is completely useless), and we may have a better idea about how to handle edge cases if we see it working in reality. |
|
Agree this can be merged. Even though this one particular point could be improved in the future, this is definitely an improvement to the current behavior. I'll not merge right away, I don't really have an overview over other open PRs this might interfere with. I'll try and catch up with the PRs in the coming days, but feel free to merge yourself! |


Addresses #24.
Checklist
Changes proposed in this pull request:
MinimumMajorIntervalCountandMaximumMajorIntervalCounttoAxiswith defaults2anddouble.MaxValueminIntervalCountandmaxIntervalCountparameters to the 2CalculateActualIntervalmethod overloads, and implement appropriate logic in all implementionsmaxIntervalCountas an upper-bound on what is otherwise computed as therange/intervalSizeminIntervalCountis a lower bound on the projected interval count: has precedence overmaxIntervalCounton edge cases (so in theMin = Maxexample, the thing takes the smallest interval that satisfies the minimum.Concerns
0unless we can convinced ourselves the alternative is good:2gives people a better experience by default: I'd rather my plots were untidy than uninterpretableOther
0anddouble.MaxValues: the behaviour will be unchanged.@oxyplot/admins