-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Timeline: Control the scale(s) and step(s) of both major and minor gridlines, independently #3323
Comments
Hey @ShawnMercado, I have a PR up right now that I believe addresses the week/month major label issue: |
@ponml oh cool. that will be very helpful when available. |
@ShawnMercado I absolutely agree with you - I too would love to have more control over the minorLines and majorLines as well as the labels. I originally wrote the week style PR (#3009) and wasn't fully satisfied either - it was just a mere start to at least have a basic week feature. However, I think it would mean a major refactoring of TimeStep.js and how it is called. Quite a lot of work, and I don't have the time for that currently. Any volunteers? |
Hey, |
you had a lot of good ideas here,
it would be very helpful if they get done. |
That would be great! I think TimeStep.js is the place to get started. It might be difficult though to implement it without breaking changes from what I remember from when I worked on it. Maybe it's good to discuss this with somebody who's more familiar with the code base and who could also review and merge the PR. Maybe @yotamberk ? |
I've been using this library for a few weeks now, and while it works well for most use cases, not having direct control over when gridlines is drawn can limit the usefulness or force the user to compromise.
I'm pretty sure what I'm asking for is not a feature right now, but if I'm wrong about that please let me know.
First, I think at the very least the
showMajorLabels
option, when false, should prevent drawing major gridlines. Currently, for instance, if you set your timeline to the week scale, there will still be lines drawn at the month boundaries even when hiding the major labels. Months do not follow naturally from weeks, and there are plenty of use cases where all you may care about is weeks, and all the month lines do is add clutter.(This is a problem I'm trying to find a workaround for right now, so if anyone has any suggestions, please let me know).
But even better would be if I could control exactly when a major gridline is drawn in the first place.
Currently, you can set a fixed scale by adding an option like this:
options = { timeAxis: { scale: 'day', step: 1, }
It would be far more useful if I could set this both for the minor lines and the major lines. So a really obvious example would be like (and this is just an example, i don't know how it would actually be implemented):
options = { timeAxis: { minorLines: { scale: 'day', step: 1 }, majorLines: { scale: 'week', step: 1, }, } }
Another example might be single days for minor lines and then 30 days for major lines (I have a client who specifically plans work in this manner, actually).
But there's another thing, with the current implementation, you can only set one scale/step and then you lose a lot of what makes the library useful. It would be super, duper nice if we could define an array of scale combinations somehow, and that zooming the timeline would simply cycle through these predefined scales. I know that might be asking a lot but currently the zoom functionality is just not that useful if you have to go away from the default scaling.
The text was updated successfully, but these errors were encountered: