vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB

11 years ago
11 years ago
11 years ago
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title></title>
  5. <script src="../lib/moment.min.js"></script>
  6. <script src="../src/module.js"></script>
  7. <script src="../src/util.js"></script>
  8. <script src="../src/events.js"></script>
  9. <script src="../src/component/panel.js"></script>
  10. <script src="../src/timestep.js"></script>
  11. </head>
  12. <body>
  13. <script>
  14. var diffs = [
  15. 1000,
  16. 1000 * 60,
  17. 1000 * 60 * 60,
  18. 1000 * 60 * 60 * 24,
  19. 1000 * 60 * 60 * 24 * 30,
  20. 1000 * 60 * 60 * 24 * 30 * 100,
  21. 1000 * 60 * 60 * 24 * 30 * 10000
  22. ];
  23. diffs.forEach(function (diff) {
  24. var step = new vis.TimeStep(new Date(), new Date((new Date()).valueOf() + diff), diff / 40);
  25. console.log(diff, step._start.toLocaleString(), step._end.toLocaleString(), step.scale, step.step);
  26. step.first();
  27. while (step.hasNext()) {
  28. console.log(step.getLabelMajor(), ' --- ', step.getLabelMinor());
  29. step.next();
  30. }
  31. });
  32. </script>
  33. </body>
  34. </html>