Browse Source

Fixed #501: round-off errors of zero on the y-axis

v3_develop
jos 9 years ago
parent
commit
afea04d431
5 changed files with 2104 additions and 1781 deletions
  1. +7
    -0
      HISTORY.md
  2. +2085
    -1772
      dist/vis.js
  3. +1
    -1
      dist/vis.map
  4. +7
    -7
      dist/vis.min.js
  5. +4
    -1
      lib/timeline/DataStep.js

+ 7
- 0
HISTORY.md View File

@ -2,6 +2,13 @@
http://visjs.org
## not yet released, version 3.7.3
### Graph2d
- Fixed round-off errors of zero on the y-axis.
## 2014-12-09, version 3.7.2
### Timeline

+ 2085
- 1772
dist/vis.js
File diff suppressed because it is too large
View File


+ 1
- 1
dist/vis.map
File diff suppressed because it is too large
View File


+ 7
- 7
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 4
- 1
lib/timeline/DataStep.js View File

@ -189,7 +189,10 @@ DataStep.prototype.previous = function() {
* @return {String} current The current date
*/
DataStep.prototype.getCurrent = function(decimals) {
var toPrecision = '' + Number(this.current).toPrecision(5);
// prevent round-off errors when close to zero
var current = (Math.abs(this.current) < this.step / 2) ? 0 : this.current;
var toPrecision = '' + Number(current).toPrecision(5);
// If decimals is specified, then limit or extend the string as required
if(decimals !== undefined && !isNaN(Number(decimals))) {
// If string includes exponent, then we need to add it to the end

Loading…
Cancel
Save