Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Conversation

@marcortw
Copy link
Contributor

This PR implements a week scale and should address and fix #1405 #1715 and #3002 .
Known limitiations:

  • Only works properly wehn locales are enabled
  • Documentation is a bit sparse
  • Introduces minor workarounds to overcome the limitiations of TimeStep.js
  • Intentionally not integrated in the auto zoom scale

gitter-badger and others added 30 commits January 29, 2017 19:04
* 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.
…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([
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Member

@yotamberk yotamberk left a 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?

@marcortw
Copy link
Contributor Author

@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)?

@yotamberk
Copy link
Member

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?

@marcortw
Copy link
Contributor Author

marcortw commented May 1, 2017

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 {scale: 'month', step: 1} is set, the minor labels will always show the month and the major labels show the year. But as you can see in marcortw/vis@782dee4, I intentionally didn't implement the week number display in the auto-scale.

@yotamberk
Copy link
Member

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 .

Copy link
Member

@yotamberk yotamberk left a 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!!

@yotamberk yotamberk merged commit 0a64249 into visjs:develop May 2, 2017
@krazziekay
Copy link

please provide the details on how to display this week view. Thank you

@yotamberk
Copy link
Member

checkout the example he supplied

@krazziekay
Copy link

When will this be merged in the master branch? How do i get this updated timeline with the week view??

@yotamberk
Copy link
Member

@krazziekay pull the develop branch in the meantime. A release is planned sometime the next two weeks

@marcortw
Copy link
Contributor Author

marcortw commented May 2, 2017

cool 👍

@krazziekay
Copy link

krazziekay commented May 3, 2017

Thank you!! Waiting for this to be released in the master branch...

@danny-larsen
Copy link
Contributor

Can this show the major labels grouped by weeks?

@marcortw
Copy link
Contributor Author

It shows the week number as a minor label and the month and year as a major label (per default).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.