Browse Source

made getItemRange respect visible graphgroups

v3_develop
Alex de Mulder 10 years ago
parent
commit
d11653503d
4 changed files with 4178 additions and 4182 deletions
  1. +4157
    -4159
      dist/vis.js
  2. +1
    -1
      dist/vis.map
  3. +7
    -7
      dist/vis.min.js
  4. +13
    -15
      lib/timeline/Graph2d.js

+ 4157
- 4159
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


+ 13
- 15
lib/timeline/Graph2d.js View File

@ -257,22 +257,20 @@ Graph2d.prototype.isGroupVisible = function(groupId) {
* When no maximum is found, max==null
*/
Graph2d.prototype.getItemRange = function() {
var min = null;
var max = null;
// calculate min from start filed
var dataset = this.itemsData.getDataSet(),
min = null,
max = null;
if (dataset) {
// calculate the minimum value of the field 'start'
var minItem = dataset.min('x');
min = minItem ? util.convert(minItem.x, 'Date').valueOf() : null;
// Note: we convert first to Date and then to number because else
// a conversion from ISODate to Number will fail
// calculate maximum value of fields 'start' and 'end'
var maxStartItem = dataset.max('x');
if (maxStartItem) {
max = util.convert(maxStartItem.x, 'Date').valueOf();
for (var groupId in this.linegraph.groups) {
if (this.linegraph.groups.hasOwnProperty(groupId)) {
if (this.linegraph.groups[groupId].visible == true) {
for (var i = 0; i < this.linegraph.groups[groupId].itemsData.length; i++) {
var item = this.linegraph.groups[groupId].itemsData[i];
var value = util.convert(item.x, 'Date').valueOf();
min = min == null ? value : min > value ? value : min;
max = max == null ? value : max < value ? value : max;
}
}
}
}

Loading…
Cancel
Save