-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Implementation of a week scale feature #3009
Conversation
* removed NOTICE file * updated license date range to include 2017 * chore(docs): updated support team members
… iFrames. (visjs#2631) * Replaces instanceof Object checks with typeof to prevent cross tab issues. * Adds missing space.
…op` branch (visjs#2623) Related to: visjs#2618 Related to: visjs#2620
…ing or a function (visjs#2611) * change setCustomTimeTitle title parameter, Now could be an string or a function * Fixed indent and spacing
* Added showX(YZ)Axis to Graph3d * Added show_Axis options to docs and playground example * Resolved merge conflict * Added show_Axis options to docs and playground example
* Fix redraw order * Fix error when option is not defined * Allow template labels * Add .travis.yml file * Add experiment travis code * Fix react example * Add animation to onUpdateTooltip
…in timeline (visjs#2703) * Fix redraw order * Fix error when option is not defined * Allow template labels * Add .travis.yml file * Add experiment travis code * Fix react example * Make items z-index default to 1
| groups.add([{id: 1, content: "ISO Weeks"}, {id: 2, content: "US Weeks"}]); | ||
|
|
||
| // Create a DataSet (allows two way data-binding) | ||
| var items = new vis.DataSet([ |
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.
It would be more elegant if you used a for loop to create this data
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.
In general, I agree, but I thought about this again and think it's maybe not a good idea. First reason: We would already be relying on moment's lib code to determine week numbers to create the items - but I think to prove that things are working properly, we should not rely on something which could fail itself, thus manually writing out the week start and end seems to be fine to me. Second: I specifically wanted to display the week calculation over turn of the year, thus the for loop should always return the same result. But thanks to your comment it came to my mind to extend the examples until the first of May so that we also cover the special case when a (ISO) week start aligns with a month's start.
Nevertheless, if you still strongly vote for a loop, I will implement it.
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.
I strongly vote for a loop.
I think momentjs is reliable enough
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.
I've noticed that in your example, weeks the cross moths are written twice. It looks kind of funny. I think it needs to be fixed.
Except for that, really good job!
What about allowing a max week step but allowing to zoom in to see specific days and times?
|
@yotamberk thanks for the review and the feedback! I'm working on a fix to remove the duplicate week number indication. Could you please explain a bit more in detail what you mean with the 'max week step'? Do your refer to my removal of the week scale from the auto-scale (as discussed in marcortw/vis@782dee4)? |
… of month align; Fixing display bug so that week numbers are not repeated in minorLabels
|
What I mean is that when you have the week scale, I would expect to also be allowed to zoom in and to be able to see specific days and hours. Don;t you think? |
|
I think this can only be achieved with the use of a non-fixed/auto scale. Whenever a fixed scale is chosen, the labels in the axis will stay as defined. For example, if |
|
Ok, i'll check this again and merge it once everything looks fine to me. I think future work should be done with allowing a "max step" and "min step" so one can (e.g.) start with a weeks axis, and be allowed to zoom in to seconds . |
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.
Really awesome work! Thanks again for this PR!!
|
please provide the details on how to display this week view. Thank you |
|
checkout the example he supplied |
|
When will this be merged in the master branch? How do i get this updated timeline with the week view?? |
|
@krazziekay pull the |
|
cool 👍 |
|
Thank you!! Waiting for this to be released in the master branch... |
|
Can this show the major labels grouped by weeks? |
|
It shows the week number as a minor label and the month and year as a major label (per default). |
This PR implements a week scale and should address and fix #1405 #1715 and #3002 .
Known limitiations: