Browse Source

Fixed range where the `end` of the first is equal to the `start` of the second sometimes being stacked instead of put besides each other when `item.margin=0`.

v3_develop
jos 10 years ago
parent
commit
9c45aaaaff
5 changed files with 22 additions and 15 deletions
  1. +2
    -0
      HISTORY.md
  2. +9
    -5
      dist/vis.js
  3. +1
    -1
      dist/vis.map
  4. +5
    -5
      dist/vis.min.js
  5. +5
    -4
      lib/timeline/Stack.js

+ 2
- 0
HISTORY.md View File

@ -7,6 +7,8 @@ http://visjs.org
### Timeline
- Fixed items in groups sometimes being displayed but not positioned correctly.
- Fixed range where the `end` of the first is equal to the `start` of the second
sometimes being stacked instead of put besides each other when `item.margin=0`.
## 2014-07-07, version 3.0.0

+ 9
- 5
dist/vis.js View File

@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library.
*
* @version 3.0.1-SNAPSHOT
* @date 2014-07-08
* @date 2014-07-09
*
* @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -8254,6 +8254,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {
// Utility functions for ordering and stacking of items
var EPSILON = 0.001; // used when checking collisions, to prevent round-off errors
/**
* Order items by their start data
@ -8357,10 +8358,10 @@ return /******/ (function(modules) { // webpackBootstrap
* @return {boolean} true if a and b collide, else false
*/
exports.collision = function(a, b, margin) {
return ((a.left - margin) < (b.left + b.width) &&
(a.left + a.width + margin) > b.left &&
(a.top - margin) < (b.top + b.height) &&
(a.top + a.height + margin) > b.top);
return ((a.left - margin + EPSILON) < (b.left + b.width) &&
(a.left + a.width + margin - EPSILON) > b.left &&
(a.top - margin + EPSILON) < (b.top + b.height) &&
(a.top + a.height + margin - EPSILON) > b.top);
};
@ -16493,6 +16494,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {
var util = __webpack_require__(1);
var Node = __webpack_require__(30);
/**
* @class Edge
@ -23876,6 +23878,8 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {
var util = __webpack_require__(1);
var Node = __webpack_require__(30);
var Edge = __webpack_require__(27);
/**
* clears the toolbar div element of children

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


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


+ 5
- 4
lib/timeline/Stack.js View File

@ -1,4 +1,5 @@
// Utility functions for ordering and stacking of items
var EPSILON = 0.001; // used when checking collisions, to prevent round-off errors
/**
* Order items by their start data
@ -102,8 +103,8 @@ exports.nostack = function(items, margin) {
* @return {boolean} true if a and b collide, else false
*/
exports.collision = function(a, b, margin) {
return ((a.left - margin) < (b.left + b.width) &&
(a.left + a.width + margin) > b.left &&
(a.top - margin) < (b.top + b.height) &&
(a.top + a.height + margin) > b.top);
return ((a.left - margin + EPSILON) < (b.left + b.width) &&
(a.left + a.width + margin - EPSILON) > b.left &&
(a.top - margin + EPSILON) < (b.top + b.height) &&
(a.top + a.height + margin - EPSILON) > b.top);
};

Loading…
Cancel
Save