Browse Source

Merge remote-tracking branch 'origin/develop' into develop

Conflicts:
	dist/vis.js
v3_develop
Alex de Mulder 10 years ago
parent
commit
b7a99e8d80
7 changed files with 26364 additions and 26320 deletions
  1. +5
    -1
      HISTORY.md
  2. +26320
    -26300
      dist/vis.js
  3. +1
    -1
      dist/vis.map
  4. +8
    -8
      dist/vis.min.js
  5. +20
    -6
      lib/timeline/Core.js
  6. +7
    -2
      lib/timeline/Timeline.js
  7. +3
    -2
      lib/timeline/component/item/BackgroundItem.js

+ 5
- 1
HISTORY.md View File

@ -9,10 +9,14 @@ http://visjs.org
- Implemented selection of a range of items using Shift+Click. - Implemented selection of a range of items using Shift+Click.
- Fixed content in range items may overflow range after zoom. - Fixed content in range items may overflow range after zoom.
- Fixed onAdd/onUpdate callbacks when using a DataView (thanks @motzel). - Fixed onAdd/onUpdate callbacks when using a DataView (thanks @motzel).
- Fixed configuring either `start` or `end`.
- Fixed Timeline and Graph2d getting stuck in an infinite loop in some
circumstances.
- Fixed background items being selectable and editable when a height is set.
### Graph2D ### Graph2D
- Added alignZeros option to dataAxis with default value true.
- Added `alignZeros` option to dataAxis with default value true.
- Fixed bug with points drawn on bargraphs - Fixed bug with points drawn on bargraphs
- Fixed docs - Fixed docs

+ 26320
- 26300
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


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


+ 20
- 6
lib/timeline/Core.js View File

@ -352,6 +352,23 @@ Core.prototype.clear = function(what) {
* for the animation. Default duration is 500 ms. * for the animation. Default duration is 500 ms.
*/ */
Core.prototype.fit = function(options) { Core.prototype.fit = function(options) {
var range = this._getDataRange();
// skip range set if there is no start and end date
if (range.start === null && range.end === null) {
return;
}
var animate = (options && options.animate !== undefined) ? options.animate : true;
this.range.setRange(range.start, range.end, animate);
};
/**
* Calculate the data range of the items and applies a 5% window around it.
* @returns {{start: Date | null, end: Date | null}}
* @protected
*/
Core.prototype._getDataRange = function() {
// apply the data range as range // apply the data range as range
var dataRange = this.getItemRange(); var dataRange = this.getItemRange();
@ -368,13 +385,10 @@ Core.prototype.fit = function(options) {
end = new Date(end.valueOf() + interval * 0.05); end = new Date(end.valueOf() + interval * 0.05);
} }
// skip range set if there is no start and end date
if (start === null && end === null) {
return;
return {
start: start,
end: end
} }
var animate = (options && options.animate !== undefined) ? options.animate : true;
this.range.setRange(start, end, animate);
}; };
/** /**

+ 7
- 2
lib/timeline/Timeline.js View File

@ -14,6 +14,7 @@ var ItemSet = require('./component/ItemSet');
* Create a timeline visualization * Create a timeline visualization
* @param {HTMLElement} container * @param {HTMLElement} container
* @param {vis.DataSet | Array | google.visualization.DataTable} [items] * @param {vis.DataSet | Array | google.visualization.DataTable} [items]
* @param {vis.DataSet | Array | google.visualization.DataTable} [groups]
* @param {Object} [options] See Timeline.setOptions for the available options. * @param {Object} [options] See Timeline.setOptions for the available options.
* @constructor * @constructor
* @extends Core * @extends Core
@ -148,8 +149,12 @@ Timeline.prototype.setItems = function(items) {
if (initialLoad) { if (initialLoad) {
if (this.options.start != undefined || this.options.end != undefined) { if (this.options.start != undefined || this.options.end != undefined) {
var start = this.options.start != undefined ? this.options.start : null;
var end = this.options.end != undefined ? this.options.end : null;
if (this.options.start == undefined || this.options.end == undefined) {
var dataRange = this._getDataRange();
}
var start = this.options.start != undefined ? this.options.start : dataRange.start;
var end = this.options.end != undefined ? this.options.end : dataRange.end;
this.setWindow(start, end, {animate: false}); this.setWindow(start, end, {animate: false});
} }

+ 3
- 2
lib/timeline/component/item/BackgroundItem.js View File

@ -71,8 +71,9 @@ BackgroundItem.prototype.redraw = function() {
dom.content.className = 'content'; dom.content.className = 'content';
dom.box.appendChild(dom.content); dom.box.appendChild(dom.content);
// attach this item as attribute
dom.box['timeline-item'] = this;
// Note: we do NOT attach this item as attribute to the DOM,
// such that background items cannot be selected
//dom.box['timeline-item'] = this;
this.dirty = true; this.dirty = true;
} }

Loading…
Cancel
Save