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.

35 lines
1.0 KiB

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/util.js"></script>
  7. <script src="../src/events.js"></script>
  8. <script src="../src/component/panel.js"></script>
  9. <script src="../src/timestep.js"></script>
  10. </head>
  11. <body>
  12. <script>
  13. var diffs = [
  14. 1000,
  15. 1000 * 60,
  16. 1000 * 60 * 60,
  17. 1000 * 60 * 60 * 24,
  18. 1000 * 60 * 60 * 24 * 30,
  19. 1000 * 60 * 60 * 24 * 30 * 100,
  20. 1000 * 60 * 60 * 24 * 30 * 10000
  21. ];
  22. diffs.forEach(function (diff) {
  23. var step = new TimeStep(new Date(), new Date((new Date()).valueOf() + diff), diff / 40);
  24. console.log(diff, step._start.toLocaleString(), step._end.toLocaleString(), step.scale, step.step);
  25. step.first();
  26. while (step.hasNext()) {
  27. console.log(step.getLabelMajor(), ' --- ', step.getLabelMinor());
  28. step.next();
  29. }
  30. });
  31. </script>
  32. </body>
  33. </html>