Browse Source

fixed catch for undefined in options when using stacking in graph2d

v3_develop
Alex de Mulder 9 years ago
parent
commit
65664e178b
5 changed files with 197 additions and 88 deletions
  1. +178
    -69
      dist/vis.js
  2. +1
    -1
      dist/vis.map
  3. +13
    -14
      dist/vis.min.js
  4. +1
    -0
      lib/timeline/Core.js
  5. +4
    -4
      lib/timeline/component/LineGraph.js

+ 178
- 69
dist/vis.js View File

@ -1454,7 +1454,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, module) {//! moment.js var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, module) {//! moment.js
//! version : 2.8.4
//! version : 2.9.0
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT //! license : MIT
//! momentjs.com //! momentjs.com
@ -1465,9 +1465,9 @@ return /******/ (function(modules) { // webpackBootstrap
************************************/ ************************************/
var moment, var moment,
VERSION = '2.8.4',
VERSION = '2.9.0',
// the global-scope this is NOT the global object in Node.js // the global-scope this is NOT the global object in Node.js
globalScope = typeof global !== 'undefined' ? global : this,
globalScope = (typeof global !== 'undefined' && (typeof window === 'undefined' || window === global.window)) ? global : this,
oldGlobalMoment, oldGlobalMoment,
round = Math.round, round = Math.round,
hasOwnProperty = Object.prototype.hasOwnProperty, hasOwnProperty = Object.prototype.hasOwnProperty,
@ -1544,7 +1544,7 @@ return /******/ (function(modules) { // webpackBootstrap
['HH', /(T| )\d\d/] ['HH', /(T| )\d\d/]
], ],
// timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-15', '30']
// timezone chunker '+10:00' > ['10', '00'] or '-1530' > ['-', '15', '30']
parseTimezoneChunker = /([\+\-]|\d\d)/gi, parseTimezoneChunker = /([\+\-]|\d\d)/gi,
// getter and setter names // getter and setter names
@ -1704,7 +1704,7 @@ return /******/ (function(modules) { // webpackBootstrap
return leftZeroFill(this.milliseconds(), 3); return leftZeroFill(this.milliseconds(), 3);
}, },
Z : function () { Z : function () {
var a = -this.zone(),
var a = this.utcOffset(),
b = '+'; b = '+';
if (a < 0) { if (a < 0) {
a = -a; a = -a;
@ -1713,7 +1713,7 @@ return /******/ (function(modules) { // webpackBootstrap
return b + leftZeroFill(toInt(a / 60), 2) + ':' + leftZeroFill(toInt(a) % 60, 2); return b + leftZeroFill(toInt(a / 60), 2) + ':' + leftZeroFill(toInt(a) % 60, 2);
}, },
ZZ : function () { ZZ : function () {
var a = -this.zone(),
var a = this.utcOffset(),
b = '+'; b = '+';
if (a < 0) { if (a < 0) {
a = -a; a = -a;
@ -1740,7 +1740,9 @@ return /******/ (function(modules) { // webpackBootstrap
deprecations = {}, deprecations = {},
lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'];
lists = ['months', 'monthsShort', 'weekdays', 'weekdaysShort', 'weekdaysMin'],
updateInProgress = false;
// Pick the first defined of two or three arguments. dfl comes from // Pick the first defined of two or three arguments. dfl comes from
// default. // default.
@ -1809,6 +1811,26 @@ return /******/ (function(modules) { // webpackBootstrap
}; };
} }
function monthDiff(a, b) {
// difference in months
var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
// b is in (anchor - 1 month, anchor + 1 month)
anchor = a.clone().add(wholeMonthDiff, 'months'),
anchor2, adjust;
if (b - anchor < 0) {
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor - anchor2);
} else {
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
// linear across the month
adjust = (b - anchor) / (anchor2 - anchor);
}
return -(wholeMonthDiff + adjust);
}
while (ordinalizeTokens.length) { while (ordinalizeTokens.length) {
i = ordinalizeTokens.pop(); i = ordinalizeTokens.pop();
formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i); formatTokenFunctions[i + 'o'] = ordinalizeToken(formatTokenFunctions[i], i);
@ -1820,6 +1842,31 @@ return /******/ (function(modules) { // webpackBootstrap
formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3); formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
function meridiemFixWrap(locale, hour, meridiem) {
var isPm;
if (meridiem == null) {
// nothing to do
return hour;
}
if (locale.meridiemHour != null) {
return locale.meridiemHour(hour, meridiem);
} else if (locale.isPM != null) {
// Fallback
isPm = locale.isPM(meridiem);
if (isPm && hour < 12) {
hour += 12;
}
if (!isPm && hour === 12) {
hour = 0;
}
return hour;
} else {
// thie is not supposed to happen
return hour;
}
}
/************************************ /************************************
Constructors Constructors
************************************/ ************************************/
@ -1834,6 +1881,13 @@ return /******/ (function(modules) { // webpackBootstrap
} }
copyConfig(this, config); copyConfig(this, config);
this._d = new Date(+config._d); this._d = new Date(+config._d);
// Prevent infinite loop in case updateOffset creates new moment
// objects.
if (updateInProgress === false) {
updateInProgress = true;
moment.updateOffset(this);
updateInProgress = false;
}
} }
// Duration Constructor // Duration Constructor
@ -2237,7 +2291,8 @@ return /******/ (function(modules) { // webpackBootstrap
return locales[name]; return locales[name];
} }
// Return a moment from input, that is local/utc/zone equivalent to model.
// Return a moment from input, that is local/utc/utcOffset equivalent to
// model.
function makeAs(input, model) { function makeAs(input, model) {
var res, diff; var res, diff;
if (model._isUTC) { if (model._isUTC) {
@ -2386,6 +2441,7 @@ return /******/ (function(modules) { // webpackBootstrap
} }
}, },
_calendar : { _calendar : {
sameDay : '[Today at] LT', sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT', nextDay : '[Tomorrow at] LT',
@ -2450,6 +2506,14 @@ return /******/ (function(modules) { // webpackBootstrap
doy : 6 // The week that contains Jan 1st is the first week of the year. doy : 6 // The week that contains Jan 1st is the first week of the year.
}, },
firstDayOfWeek : function () {
return this._week.dow;
},
firstDayOfYear : function () {
return this._week.doy;
},
_invalidDate: 'Invalid date', _invalidDate: 'Invalid date',
invalidDate: function () { invalidDate: function () {
return this._invalidDate; return this._invalidDate;
@ -2616,14 +2680,14 @@ return /******/ (function(modules) { // webpackBootstrap
} }
} }
function timezoneMinutesFromString(string) {
function utcOffsetFromString(string) {
string = string || ''; string = string || '';
var possibleTzMatches = (string.match(parseTokenTimezone) || []), var possibleTzMatches = (string.match(parseTokenTimezone) || []),
tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [],
parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0], parts = (tzChunk + '').match(parseTimezoneChunker) || ['-', 0, 0],
minutes = +(parts[1] * 60) + toInt(parts[2]); minutes = +(parts[1] * 60) + toInt(parts[2]);
return parts[0] === '+' ? -minutes : minutes;
return parts[0] === '+' ? minutes : -minutes;
} }
// function to convert string input to date // function to convert string input to date
@ -2687,7 +2751,8 @@ return /******/ (function(modules) { // webpackBootstrap
// AM / PM // AM / PM
case 'a' : // fall through to A case 'a' : // fall through to A
case 'A' : case 'A' :
config._isPm = config._locale.isPM(input);
config._meridiem = input;
// config._isPm = config._locale.isPM(input);
break; break;
// HOUR // HOUR
case 'h' : // fall through to hh case 'h' : // fall through to hh
@ -2727,7 +2792,7 @@ return /******/ (function(modules) { // webpackBootstrap
case 'Z' : // fall through to ZZ case 'Z' : // fall through to ZZ
case 'ZZ' : case 'ZZ' :
config._useUTC = true; config._useUTC = true;
config._tzm = timezoneMinutesFromString(input);
config._tzm = utcOffsetFromString(input);
break; break;
// WEEKDAY - human // WEEKDAY - human
case 'dd': case 'dd':
@ -2865,10 +2930,10 @@ return /******/ (function(modules) { // webpackBootstrap
} }
config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
// Apply timezone offset from input. The actual zone can be changed
// Apply timezone offset from input. The actual utcOffset can be changed
// with parseZone. // with parseZone.
if (config._tzm != null) { if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm);
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
} }
if (config._nextDay) { if (config._nextDay) {
@ -2964,14 +3029,9 @@ return /******/ (function(modules) { // webpackBootstrap
if (config._pf.bigHour === true && config._a[HOUR] <= 12) { if (config._pf.bigHour === true && config._a[HOUR] <= 12) {
config._pf.bigHour = undefined; config._pf.bigHour = undefined;
} }
// handle am pm
if (config._isPm && config._a[HOUR] < 12) {
config._a[HOUR] += 12;
}
// if is 12 am, change hours to 0
if (config._isPm === false && config._a[HOUR] === 12) {
config._a[HOUR] = 0;
}
// handle meridiem
config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],
config._meridiem);
dateFromConfig(config); dateFromConfig(config);
checkOverflow(config); checkOverflow(config);
} }
@ -3413,6 +3473,8 @@ return /******/ (function(modules) { // webpackBootstrap
s: parseIso(match[7]), s: parseIso(match[7]),
w: parseIso(match[8]) w: parseIso(match[8])
}; };
} else if (duration == null) {// checks for null or undefined
duration = {};
} else if (typeof duration === 'object' && } else if (typeof duration === 'object' &&
('from' in duration || 'to' in duration)) { ('from' in duration || 'to' in duration)) {
diffRes = momentsDifference(moment(duration.from), moment(duration.to)); diffRes = momentsDifference(moment(duration.from), moment(duration.to));
@ -3577,6 +3639,8 @@ return /******/ (function(modules) { // webpackBootstrap
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
}; };
moment.isDate = isDate;
/************************************ /************************************
Moment Prototype Moment Prototype
************************************/ ************************************/
@ -3589,7 +3653,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
valueOf : function () { valueOf : function () {
return +this._d + ((this._offset || 0) * 60000);
return +this._d - ((this._offset || 0) * 60000);
}, },
unix : function () { unix : function () {
@ -3652,16 +3716,16 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
utc : function (keepLocalTime) { utc : function (keepLocalTime) {
return this.zone(0, keepLocalTime);
return this.utcOffset(0, keepLocalTime);
}, },
local : function (keepLocalTime) { local : function (keepLocalTime) {
if (this._isUTC) { if (this._isUTC) {
this.zone(0, keepLocalTime);
this.utcOffset(0, keepLocalTime);
this._isUTC = false; this._isUTC = false;
if (keepLocalTime) { if (keepLocalTime) {
this.add(this._dateTzOffset(), 'm');
this.subtract(this._dateUtcOffset(), 'm');
} }
} }
return this; return this;
@ -3678,29 +3742,20 @@ return /******/ (function(modules) { // webpackBootstrap
diff : function (input, units, asFloat) { diff : function (input, units, asFloat) {
var that = makeAs(input, this), var that = makeAs(input, this),
zoneDiff = (this.zone() - that.zone()) * 6e4,
diff, output, daysAdjust;
zoneDiff = (that.utcOffset() - this.utcOffset()) * 6e4,
anchor, diff, output, daysAdjust;
units = normalizeUnits(units); units = normalizeUnits(units);
if (units === 'year' || units === 'month') {
// average number of days in the months in the given dates
diff = (this.daysInMonth() + that.daysInMonth()) * 432e5; // 24 * 60 * 60 * 1000 / 2
// difference in months
output = ((this.year() - that.year()) * 12) + (this.month() - that.month());
// adjust by taking difference in days, average number of days
// and dst in the given months.
daysAdjust = (this - moment(this).startOf('month')) -
(that - moment(that).startOf('month'));
// same as above but with zones, to negate all dst
daysAdjust -= ((this.zone() - moment(this).startOf('month').zone()) -
(that.zone() - moment(that).startOf('month').zone())) * 6e4;
output += daysAdjust / diff;
if (units === 'year') {
if (units === 'year' || units === 'month' || units === 'quarter') {
output = monthDiff(this, that);
if (units === 'quarter') {
output = output / 3;
} else if (units === 'year') {
output = output / 12; output = output / 12;
} }
} else { } else {
diff = (this - that);
diff = this - that;
output = units === 'second' ? diff / 1e3 : // 1000 output = units === 'second' ? diff / 1e3 : // 1000
units === 'minute' ? diff / 6e4 : // 1000 * 60 units === 'minute' ? diff / 6e4 : // 1000 * 60
units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60 units === 'hour' ? diff / 36e5 : // 1000 * 60 * 60
@ -3721,7 +3776,8 @@ return /******/ (function(modules) { // webpackBootstrap
calendar : function (time) { calendar : function (time) {
// We want to compare the start of today, vs this. // We want to compare the start of today, vs this.
// Getting start-of-today depends on whether we're zone'd or not.
// Getting start-of-today depends on whether we're locat/utc/offset
// or not.
var now = time || moment(), var now = time || moment(),
sod = makeAs(now, this).startOf('day'), sod = makeAs(now, this).startOf('day'),
diff = this.diff(sod, 'days', true), diff = this.diff(sod, 'days', true),
@ -3739,8 +3795,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
isDST : function () { isDST : function () {
return (this.zone() < this.clone().month(0).zone() ||
this.zone() < this.clone().month(5).zone());
return (this.utcOffset() > this.clone().month(0).utcOffset() ||
this.utcOffset() > this.clone().month(5).utcOffset());
}, },
day : function (input) { day : function (input) {
@ -3830,6 +3886,10 @@ return /******/ (function(modules) { // webpackBootstrap
} }
}, },
isBetween: function (from, to, units) {
return this.isAfter(from, units) && this.isBefore(to, units);
},
isSame: function (input, units) { isSame: function (input, units) {
var inputMs; var inputMs;
units = normalizeUnits(units || 'millisecond'); units = normalizeUnits(units || 'millisecond');
@ -3858,9 +3918,27 @@ return /******/ (function(modules) { // webpackBootstrap
} }
), ),
zone : deprecate(
'moment().zone is deprecated, use moment().utcOffset instead. ' +
'https://github.com/moment/moment/issues/1779',
function (input, keepLocalTime) {
if (input != null) {
if (typeof input !== 'string') {
input = -input;
}
this.utcOffset(input, keepLocalTime);
return this;
} else {
return -this.utcOffset();
}
}
),
// keepLocalTime = true means only change the timezone, without // keepLocalTime = true means only change the timezone, without
// affecting the local hour. So 5:31:26 +0300 --[zone(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist int zone
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
// +0200, so we adjust the time as needed, to be valid. // +0200, so we adjust the time as needed, to be valid.
// //
// Keeping the time actually adds/subtracts (one hour) // Keeping the time actually adds/subtracts (one hour)
@ -3868,38 +3946,51 @@ return /******/ (function(modules) { // webpackBootstrap
// a second time. In case it wants us to change the offset again // a second time. In case it wants us to change the offset again
// _changeInProgress == true case, then we have to adjust, because // _changeInProgress == true case, then we have to adjust, because
// there is no such time in the given timezone. // there is no such time in the given timezone.
zone : function (input, keepLocalTime) {
utcOffset : function (input, keepLocalTime) {
var offset = this._offset || 0, var offset = this._offset || 0,
localAdjust; localAdjust;
if (input != null) { if (input != null) {
if (typeof input === 'string') { if (typeof input === 'string') {
input = timezoneMinutesFromString(input);
input = utcOffsetFromString(input);
} }
if (Math.abs(input) < 16) { if (Math.abs(input) < 16) {
input = input * 60; input = input * 60;
} }
if (!this._isUTC && keepLocalTime) { if (!this._isUTC && keepLocalTime) {
localAdjust = this._dateTzOffset();
localAdjust = this._dateUtcOffset();
} }
this._offset = input; this._offset = input;
this._isUTC = true; this._isUTC = true;
if (localAdjust != null) { if (localAdjust != null) {
this.subtract(localAdjust, 'm');
this.add(localAdjust, 'm');
} }
if (offset !== input) { if (offset !== input) {
if (!keepLocalTime || this._changeInProgress) { if (!keepLocalTime || this._changeInProgress) {
addOrSubtractDurationFromMoment(this, addOrSubtractDurationFromMoment(this,
moment.duration(offset - input, 'm'), 1, false);
moment.duration(input - offset, 'm'), 1, false);
} else if (!this._changeInProgress) { } else if (!this._changeInProgress) {
this._changeInProgress = true; this._changeInProgress = true;
moment.updateOffset(this, true); moment.updateOffset(this, true);
this._changeInProgress = null; this._changeInProgress = null;
} }
} }
return this;
} else { } else {
return this._isUTC ? offset : this._dateTzOffset();
return this._isUTC ? offset : this._dateUtcOffset();
} }
return this;
},
isLocal : function () {
return !this._isUTC;
},
isUtcOffset : function () {
return this._isUTC;
},
isUtc : function () {
return this._isUTC && this._offset === 0;
}, },
zoneAbbr : function () { zoneAbbr : function () {
@ -3912,9 +4003,9 @@ return /******/ (function(modules) { // webpackBootstrap
parseZone : function () { parseZone : function () {
if (this._tzm) { if (this._tzm) {
this.zone(this._tzm);
this.utcOffset(this._tzm);
} else if (typeof this._i === 'string') { } else if (typeof this._i === 'string') {
this.zone(this._i);
this.utcOffset(utcOffsetFromString(this._i));
} }
return this; return this;
}, },
@ -3924,10 +4015,10 @@ return /******/ (function(modules) { // webpackBootstrap
input = 0; input = 0;
} }
else { else {
input = moment(input).zone();
input = moment(input).utcOffset();
} }
return (this.zone() - input) % 60 === 0;
return (this.utcOffset() - input) % 60 === 0;
}, },
daysInMonth : function () { daysInMonth : function () {
@ -3990,9 +4081,17 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
set : function (units, value) { set : function (units, value) {
units = normalizeUnits(units);
if (typeof this[units] === 'function') {
this[units](value);
var unit;
if (typeof units === 'object') {
for (unit in units) {
this.set(unit, units[unit]);
}
}
else {
units = normalizeUnits(units);
if (typeof this[units] === 'function') {
this[units](value);
}
} }
return this; return this;
}, },
@ -4029,11 +4128,12 @@ return /******/ (function(modules) { // webpackBootstrap
return this._locale; return this._locale;
}, },
_dateTzOffset : function () {
_dateUtcOffset : function () {
// On Firefox.24 Date#getTimezoneOffset returns a floating point. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
// https://github.com/moment/moment/pull/1871 // https://github.com/moment/moment/pull/1871
return Math.round(this._d.getTimezoneOffset() / 15) * 15;
return -Math.round(this._d.getTimezoneOffset() / 15) * 15;
} }
}); });
function rawMonthSetter(mom, value) { function rawMonthSetter(mom, value) {
@ -4102,6 +4202,9 @@ return /******/ (function(modules) { // webpackBootstrap
// add aliased format methods // add aliased format methods
moment.fn.toJSON = moment.fn.toISOString; moment.fn.toJSON = moment.fn.toISOString;
// alias isUtc for dev-friendliness
moment.fn.isUTC = moment.fn.isUtc;
/************************************ /************************************
Duration Prototype Duration Prototype
************************************/ ************************************/
@ -4289,6 +4392,10 @@ return /******/ (function(modules) { // webpackBootstrap
localeData : function () { localeData : function () {
return this._locale; return this._locale;
},
toJSON : function () {
return this.toISOString();
} }
}); });
@ -13906,6 +14013,7 @@ return /******/ (function(modules) { // webpackBootstrap
} }
else { else {
console.log('WARNING: infinite loop in redraw?') console.log('WARNING: infinite loop in redraw?')
throw new Error("bla")
} }
this.redrawCount = 0; this.redrawCount = 0;
} }
@ -19008,7 +19116,8 @@ return /******/ (function(modules) { // webpackBootstrap
}; };
TimeStep.prototype.getClassName = function() { TimeStep.prototype.getClassName = function() {
var date = moment(this.current).locale('en');
var m = moment(this.current);
var date = m.locale ? m.locale('en') : m.lang('en'); // old versions of moment have .lang() function
var step = this.step; var step = this.step;
function even(value) { function even(value) {
@ -20563,12 +20672,12 @@ return /******/ (function(modules) { // webpackBootstrap
// this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop. // this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop.
for (var i = 0; i < groupIds.length; i++) { for (var i = 0; i < groupIds.length; i++) {
var group = this.groups[groupIds[i]]; var group = this.groups[groupIds[i]];
if (group && group.options.yAxisOrientation == 'left') {
if (group && group.options.yAxisOrientation != 'right') {
yAxisLeftUsed = true; yAxisLeftUsed = true;
minLeft = 0; minLeft = 0;
maxLeft = 0; maxLeft = 0;
} }
else {
else if (group && group.options.yAxisOrientation) {
yAxisRightUsed = true; yAxisRightUsed = true;
minRight = 0; minRight = 0;
maxRight = 0; maxRight = 0;
@ -20582,7 +20691,7 @@ return /******/ (function(modules) { // webpackBootstrap
minVal = groupRanges[groupIds[i]].min; minVal = groupRanges[groupIds[i]].min;
maxVal = groupRanges[groupIds[i]].max; maxVal = groupRanges[groupIds[i]].max;
if (groupRanges[groupIds[i]].yAxisOrientation == 'left') {
if (groupRanges[groupIds[i]].yAxisOrientation != 'right') {
yAxisLeftUsed = true; yAxisLeftUsed = true;
minLeft = minLeft > minVal ? minVal : minLeft; minLeft = minLeft > minVal ? minVal : minLeft;
maxLeft = maxLeft < maxVal ? maxVal : maxLeft; maxLeft = maxLeft < maxVal ? maxVal : maxLeft;
@ -20605,6 +20714,7 @@ return /******/ (function(modules) { // webpackBootstrap
} }
resized = this._toggleAxisVisiblity(yAxisLeftUsed , this.yAxisLeft) || resized; resized = this._toggleAxisVisiblity(yAxisLeftUsed , this.yAxisLeft) || resized;
resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized; resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized;
if (yAxisRightUsed == true && yAxisLeftUsed == true) { if (yAxisRightUsed == true && yAxisLeftUsed == true) {
this.yAxisLeft.drawIcons = true; this.yAxisLeft.drawIcons = true;
this.yAxisRight.drawIcons = true; this.yAxisRight.drawIcons = true;
@ -20614,7 +20724,6 @@ return /******/ (function(modules) { // webpackBootstrap
this.yAxisRight.drawIcons = false; this.yAxisRight.drawIcons = false;
} }
this.yAxisRight.master = !yAxisLeftUsed; this.yAxisRight.master = !yAxisLeftUsed;
if (this.yAxisRight.master == false) { if (this.yAxisRight.master == false) {
if (yAxisRightUsed == true) {this.yAxisLeft.lineOffset = this.yAxisRight.width;} if (yAxisRightUsed == true) {this.yAxisLeft.lineOffset = this.yAxisRight.width;}
else {this.yAxisLeft.lineOffset = 0;} else {this.yAxisLeft.lineOffset = 0;}

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


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


+ 1
- 0
lib/timeline/Core.js View File

@ -615,6 +615,7 @@ Core.prototype.redraw = function() {
} }
else { else {
console.log('WARNING: infinite loop in redraw?') console.log('WARNING: infinite loop in redraw?')
throw new Error("bla")
} }
this.redrawCount = 0; this.redrawCount = 0;
} }

+ 4
- 4
lib/timeline/component/LineGraph.js View File

@ -833,12 +833,12 @@ LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
// this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop. // this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop.
for (var i = 0; i < groupIds.length; i++) { for (var i = 0; i < groupIds.length; i++) {
var group = this.groups[groupIds[i]]; var group = this.groups[groupIds[i]];
if (group && group.options.yAxisOrientation == 'left') {
if (group && group.options.yAxisOrientation != 'right') {
yAxisLeftUsed = true; yAxisLeftUsed = true;
minLeft = 0; minLeft = 0;
maxLeft = 0; maxLeft = 0;
} }
else {
else if (group && group.options.yAxisOrientation) {
yAxisRightUsed = true; yAxisRightUsed = true;
minRight = 0; minRight = 0;
maxRight = 0; maxRight = 0;
@ -852,7 +852,7 @@ LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
minVal = groupRanges[groupIds[i]].min; minVal = groupRanges[groupIds[i]].min;
maxVal = groupRanges[groupIds[i]].max; maxVal = groupRanges[groupIds[i]].max;
if (groupRanges[groupIds[i]].yAxisOrientation == 'left') {
if (groupRanges[groupIds[i]].yAxisOrientation != 'right') {
yAxisLeftUsed = true; yAxisLeftUsed = true;
minLeft = minLeft > minVal ? minVal : minLeft; minLeft = minLeft > minVal ? minVal : minLeft;
maxLeft = maxLeft < maxVal ? maxVal : maxLeft; maxLeft = maxLeft < maxVal ? maxVal : maxLeft;
@ -875,6 +875,7 @@ LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
} }
resized = this._toggleAxisVisiblity(yAxisLeftUsed , this.yAxisLeft) || resized; resized = this._toggleAxisVisiblity(yAxisLeftUsed , this.yAxisLeft) || resized;
resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized; resized = this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized;
if (yAxisRightUsed == true && yAxisLeftUsed == true) { if (yAxisRightUsed == true && yAxisLeftUsed == true) {
this.yAxisLeft.drawIcons = true; this.yAxisLeft.drawIcons = true;
this.yAxisRight.drawIcons = true; this.yAxisRight.drawIcons = true;
@ -884,7 +885,6 @@ LineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {
this.yAxisRight.drawIcons = false; this.yAxisRight.drawIcons = false;
} }
this.yAxisRight.master = !yAxisLeftUsed; this.yAxisRight.master = !yAxisLeftUsed;
if (this.yAxisRight.master == false) { if (this.yAxisRight.master == false) {
if (yAxisRightUsed == true) {this.yAxisLeft.lineOffset = this.yAxisRight.width;} if (yAxisRightUsed == true) {this.yAxisLeft.lineOffset = this.yAxisRight.width;}
else {this.yAxisLeft.lineOffset = 0;} else {this.yAxisLeft.lineOffset = 0;}

Loading…
Cancel
Save