diff --git a/HISTORY.md b/HISTORY.md index 4a299bec..6272ccf0 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,9 @@ http://visjs.org - Fixed #1527: error when creating/updating a Timeline without data. - Fixed #1127: `doubleClick` event not being fired. +### Network + +- Fixed #1531 , #1335: border distances for arrow positioning ## 2015-12-18, version 4.11.0 diff --git a/dist/vis.js b/dist/vis.js index 6605f030..fc1c0b3a 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -5,7 +5,7 @@ * A dynamic, browser-based visualization library. * * @version 4.11.1-SNAPSHOT - * @date 2015-12-18 + * @date 2016-01-04 * * @license * Copyright (C) 2011-2015 Almende B.V, http://almende.com @@ -105,45 +105,45 @@ return /******/ (function(modules) { // webpackBootstrap // Timeline exports.Timeline = __webpack_require__(19); - exports.Graph2d = __webpack_require__(49); + exports.Graph2d = __webpack_require__(48); exports.timeline = { - Core: __webpack_require__(28), - DataStep: __webpack_require__(52), - DateUtil: __webpack_require__(27), - Range: __webpack_require__(24), - stack: __webpack_require__(32), - TimeStep: __webpack_require__(30), + Core: __webpack_require__(27), + DataStep: __webpack_require__(51), + DateUtil: __webpack_require__(26), + Range: __webpack_require__(23), + stack: __webpack_require__(31), + TimeStep: __webpack_require__(29), components: { items: { - Item: __webpack_require__(34), - BackgroundItem: __webpack_require__(38), - BoxItem: __webpack_require__(36), - PointItem: __webpack_require__(37), - RangeItem: __webpack_require__(33) + Item: __webpack_require__(33), + BackgroundItem: __webpack_require__(37), + BoxItem: __webpack_require__(35), + PointItem: __webpack_require__(36), + RangeItem: __webpack_require__(32) }, - BackgroundGroup: __webpack_require__(35), - Component: __webpack_require__(26), - CurrentTime: __webpack_require__(44), - CustomTime: __webpack_require__(42), - DataAxis: __webpack_require__(51), - GraphGroup: __webpack_require__(53), - Group: __webpack_require__(31), - ItemSet: __webpack_require__(29), - Legend: __webpack_require__(57), - LineGraph: __webpack_require__(50), - TimeAxis: __webpack_require__(39) + BackgroundGroup: __webpack_require__(34), + Component: __webpack_require__(25), + CurrentTime: __webpack_require__(43), + CustomTime: __webpack_require__(41), + DataAxis: __webpack_require__(50), + GraphGroup: __webpack_require__(52), + Group: __webpack_require__(30), + ItemSet: __webpack_require__(28), + Legend: __webpack_require__(56), + LineGraph: __webpack_require__(49), + TimeAxis: __webpack_require__(38) } }; // Network - exports.Network = __webpack_require__(59); + exports.Network = __webpack_require__(58); exports.network = { - Images: __webpack_require__(117), - dotparser: __webpack_require__(115), - gephiParser: __webpack_require__(116), - allOptions: __webpack_require__(111) + Images: __webpack_require__(116), + dotparser: __webpack_require__(114), + gephiParser: __webpack_require__(115), + allOptions: __webpack_require__(110) }; exports.network.convertDot = function (input) { return exports.network.dotparser.DOTToGraph(input); @@ -155,7 +155,7 @@ return /******/ (function(modules) { // webpackBootstrap // bundled external libraries exports.moment = __webpack_require__(2); exports.Hammer = __webpack_require__(20); - exports.keycharm = __webpack_require__(41); + exports.keycharm = __webpack_require__(40); /***/ }, /* 1 */ @@ -1578,12 +1578,12 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {//! moment.js - //! version : 2.10.6 + //! version : 2.11.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com - (function (global, factory) { + ;(function (global, factory) { true ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() @@ -1700,39 +1700,45 @@ return /******/ (function(modules) { // webpackBootstrap return m; } + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; - if (typeof from._isAMomentObject !== 'undefined') { + if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } - if (typeof from._i !== 'undefined') { + if (!isUndefined(from._i)) { to._i = from._i; } - if (typeof from._f !== 'undefined') { + if (!isUndefined(from._f)) { to._f = from._f; } - if (typeof from._l !== 'undefined') { + if (!isUndefined(from._l)) { to._l = from._l; } - if (typeof from._strict !== 'undefined') { + if (!isUndefined(from._strict)) { to._strict = from._strict; } - if (typeof from._tzm !== 'undefined') { + if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } - if (typeof from._isUTC !== 'undefined') { + if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } - if (typeof from._offset !== 'undefined') { + if (!isUndefined(from._offset)) { to._offset = from._offset; } - if (typeof from._pf !== 'undefined') { + if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } - if (typeof from._locale !== 'undefined') { + if (!isUndefined(from._locale)) { to._locale = from._locale; } @@ -1740,7 +1746,7 @@ return /******/ (function(modules) { // webpackBootstrap for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; - if (typeof val !== 'undefined') { + if (!isUndefined(val)) { to[prop] = val; } } @@ -1787,6 +1793,7 @@ return /******/ (function(modules) { // webpackBootstrap return value; } + // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), @@ -1804,6 +1811,7 @@ return /******/ (function(modules) { // webpackBootstrap function Locale() { } + // internal storage for locale config files var locales = {}; var globalLocale; @@ -1841,7 +1849,7 @@ return /******/ (function(modules) { // webpackBootstrap function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node - if (!locales[name] && typeof module !== 'undefined' && + if (!locales[name] && !isUndefined(module) && module && module.exports) { try { oldLocale = globalLocale._abbr; @@ -1860,7 +1868,7 @@ return /******/ (function(modules) { // webpackBootstrap function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { - if (typeof values === 'undefined') { + if (isUndefined(values)) { data = locale_locales__getLocale(key); } else { @@ -1945,6 +1953,10 @@ return /******/ (function(modules) { // webpackBootstrap return normalizedInput; } + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { @@ -1958,11 +1970,14 @@ return /******/ (function(modules) { // webpackBootstrap } function get_set__get (mom, unit) { - return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; } function get_set__set (mom, unit, value) { - return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } } // MOMENTS @@ -1975,7 +1990,7 @@ return /******/ (function(modules) { // webpackBootstrap } } else { units = normalizeUnits(units); - if (typeof this[units] === 'function') { + if (isFunction(this[units])) { return this[units](value); } } @@ -1990,7 +2005,7 @@ return /******/ (function(modules) { // webpackBootstrap Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } - var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; @@ -2086,6 +2101,8 @@ return /******/ (function(modules) { // webpackBootstrap var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 @@ -2094,20 +2111,16 @@ return /******/ (function(modules) { // webpackBootstrap var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. - var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + // includes scottish gaelic two word and hyphenated months + var matchWord = /[0-9]*(a[mn]\s?)?['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\-]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; - var regexes = {}; - - function isFunction (sth) { - // https://github.com/moment/moment/issues/2325 - return typeof sth === 'function' && - Object.prototype.toString.call(sth) === '[object Function]'; - } + var regexes = {}; function addRegexToken (token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict) { @@ -2167,6 +2180,8 @@ return /******/ (function(modules) { // webpackBootstrap var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); @@ -2213,14 +2228,17 @@ return /******/ (function(modules) { // webpackBootstrap // LOCALES + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); - function localeMonths (m) { - return this._months[m.month()]; + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } - var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); - function localeMonthsShort (m) { - return this._monthsShort[m.month()]; + var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sept_Oct_Nov_Dec'.split('_'); + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; } function localeMonthsParse (monthName, format, strict) { @@ -2259,6 +2277,11 @@ return /******/ (function(modules) { // webpackBootstrap function setMonth (mom, value) { var dayOfMonth; + if (!mom.isValid()) { + // No op + return mom; + } + // TODO: Move this out of here! if (typeof value === 'string') { value = mom.localeData().monthsParse(value); @@ -2304,6 +2327,12 @@ return /******/ (function(modules) { // webpackBootstrap if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } getParsingFlags(m).overflow = overflow; } @@ -2312,7 +2341,7 @@ return /******/ (function(modules) { // webpackBootstrap } function warn(msg) { - if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && !isUndefined(console) && console.warn) { console.warn('Deprecation warning: ' + msg); } } @@ -2322,7 +2351,7 @@ return /******/ (function(modules) { // webpackBootstrap return extend(function () { if (firstTime) { - warn(msg + '\n' + (new Error()).stack); + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); firstTime = false; } return fn.apply(this, arguments); @@ -2340,22 +2369,39 @@ return /******/ (function(modules) { // webpackBootstrap utils_hooks__hooks.suppressDeprecationWarnings = false; - var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; var isoDates = [ - ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], - ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], - ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], - ['GGGG-[W]WW', /\d{4}-W\d{2}/], - ['YYYY-DDD', /\d{4}-\d{3}/] + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] ]; // iso time formats and regexes var isoTimes = [ - ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], - ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], - ['HH:mm', /(T| )\d\d:\d\d/], - ['HH', /(T| )\d\d/] + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; @@ -2364,26 +2410,49 @@ return /******/ (function(modules) { // webpackBootstrap function configFromISO(config) { var i, l, string = config._i, - match = from_string__isoRegex.exec(string); + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; if (match) { getParsingFlags(config).iso = true; + for (i = 0, l = isoDates.length; i < l; i++) { - if (isoDates[i][1].exec(string)) { - config._f = isoDates[i][0]; + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; break; } } - for (i = 0, l = isoTimes.length; i < l; i++) { - if (isoTimes[i][1].exec(string)) { - // match[6] should be 'T' or space - config._f += (match[6] || ' ') + isoTimes[i][0]; - break; + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; } } - if (string.match(matchOffset)) { - config._f += 'Z'; + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; @@ -2421,8 +2490,8 @@ return /******/ (function(modules) { // webpackBootstrap //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); - //the date constructor doesn't accept years < 1970 - if (y < 1970) { + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { date.setFullYear(y); } return date; @@ -2430,12 +2499,16 @@ return /******/ (function(modules) { // webpackBootstrap function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); - if (y < 1970) { + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } return date; } + // FORMATTING + addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); @@ -2488,124 +2561,66 @@ return /******/ (function(modules) { // webpackBootstrap return isLeapYear(this.year()); } - addFormatToken('w', ['ww', 2], 'wo', 'week'); - addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); - - // ALIASES + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; - addUnitAlias('week', 'w'); - addUnitAlias('isoWeek', 'W'); - - // PARSING - - addRegexToken('w', match1to2); - addRegexToken('ww', match1to2, match2); - addRegexToken('W', match1to2); - addRegexToken('WW', match1to2, match2); - - addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { - week[token.substr(0, 1)] = toInt(input); - }); - - // HELPERS - - // firstDayOfWeek 0 = sun, 6 = sat - // the day of the week that starts the week - // (usually sunday or monday) - // firstDayOfWeekOfYear 0 = sun, 6 = sat - // the first week is the week that contains the first - // of this day of the week - // (eg. ISO weeks use thursday (4)) - function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { - var end = firstDayOfWeekOfYear - firstDayOfWeek, - daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), - adjustedMoment; - - - if (daysToDayOfWeek > end) { - daysToDayOfWeek -= 7; - } + return -fwdlw + fwd - 1; + } - if (daysToDayOfWeek < end - 7) { - daysToDayOfWeek += 7; + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; } - adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); return { - week: Math.ceil(adjustedMoment.dayOfYear() / 7), - year: adjustedMoment.year() + year: resYear, + dayOfYear: resDayOfYear }; } - // LOCALES - - function localeWeek (mom) { - return weekOfYear(mom, this._week.dow, this._week.doy).week; - } - - var defaultLocaleWeek = { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - }; - - function localeFirstDayOfWeek () { - return this._week.dow; - } - - function localeFirstDayOfYear () { - return this._week.doy; - } - - // MOMENTS - - function getSetWeek (input) { - var week = this.localeData().week(this); - return input == null ? week : this.add((input - week) * 7, 'd'); - } + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; - function getSetISOWeek (input) { - var week = weekOfYear(this, 1, 4).week; - return input == null ? week : this.add((input - week) * 7, 'd'); - } - - addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); - - // ALIASES - - addUnitAlias('dayOfYear', 'DDD'); - - // PARSING - - addRegexToken('DDD', match1to3); - addRegexToken('DDDD', match3); - addParseToken(['DDD', 'DDDD'], function (input, array, config) { - config._dayOfYear = toInt(input); - }); - - // HELPERS - - //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday - function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { - var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; - if (d < firstDayOfWeek) { - d += 7; + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; } - weekday = weekday != null ? 1 * weekday : firstDayOfWeek; - - dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; - return { - year: dayOfYear > 0 ? year : year - 1, - dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear + week: resWeek, + year: resYear }; } - // MOMENTS - - function getSetDayOfYear (input) { - var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; - return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // Pick the first defined of two or three arguments. @@ -2620,11 +2635,12 @@ return /******/ (function(modules) { // webpackBootstrap } function currentDateArray(config) { - var now = new Date(); + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); if (config._useUTC) { - return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; } - return [now.getFullYear(), now.getMonth(), now.getDate()]; + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. @@ -2694,7 +2710,7 @@ return /******/ (function(modules) { // webpackBootstrap } function dayOfYearFromWeekInfo(config) { - var w, weekYear, week, weekday, dow, doy, temp; + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; w = config._w; if (w.GG != null || w.W != null || w.E != null) { @@ -2708,6 +2724,9 @@ return /******/ (function(modules) { // webpackBootstrap weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; @@ -2718,23 +2737,32 @@ return /******/ (function(modules) { // webpackBootstrap if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; - if (weekday < dow) { - ++week; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } } else { // default to begining of week weekday = dow; } } - temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); - - config._a[YEAR] = temp.year; - config._dayOfYear = temp.dayOfYear; + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } } + // constant that refers to the ISO standard utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string @@ -2827,6 +2855,7 @@ return /******/ (function(modules) { // webpackBootstrap } } + // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, @@ -2877,7 +2906,9 @@ return /******/ (function(modules) { // webpackBootstrap } var i = normalizeObjectUnits(config._i); - config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); configFromArray(config); } @@ -2919,13 +2950,17 @@ return /******/ (function(modules) { // webpackBootstrap configFromInput(config); } + if (!valid__isValid(config)) { + config._d = null; + } + return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { - config._d = new Date(); + config._d = new Date(utils_hooks__hooks.now()); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { @@ -2972,7 +3007,11 @@ return /******/ (function(modules) { // webpackBootstrap 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other < this ? this : other; + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -2980,7 +3019,11 @@ return /******/ (function(modules) { // webpackBootstrap 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); - return other > this ? this : other; + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } } ); @@ -3019,6 +3062,10 @@ return /******/ (function(modules) { // webpackBootstrap return pickBy('isAfter', args); } + var now = Date.now || function () { + return +(new Date()); + }; + function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, @@ -3058,6 +3105,8 @@ return /******/ (function(modules) { // webpackBootstrap return obj instanceof Duration; } + // FORMATTING + function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); @@ -3075,11 +3124,11 @@ return /******/ (function(modules) { // webpackBootstrap // PARSING - addRegexToken('Z', matchOffset); - addRegexToken('ZZ', matchOffset); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; - config._tzm = offsetFromString(input); + config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS @@ -3089,8 +3138,8 @@ return /******/ (function(modules) { // webpackBootstrap // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; - function offsetFromString(string) { - var matches = ((string || '').match(matchOffset) || []); + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); @@ -3140,11 +3189,13 @@ return /******/ (function(modules) { // webpackBootstrap function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } if (input != null) { if (typeof input === 'string') { - input = offsetFromString(input); - } - if (Math.abs(input) < 16) { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { @@ -3204,12 +3255,15 @@ return /******/ (function(modules) { // webpackBootstrap if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { - this.utcOffset(offsetFromString(this._i)); + this.utcOffset(offsetFromString(matchOffset, this._i)); } return this; } function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; @@ -3223,7 +3277,7 @@ return /******/ (function(modules) { // webpackBootstrap } function isDaylightSavingTimeShifted () { - if (typeof this._isDSTShifted !== 'undefined') { + if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } @@ -3244,22 +3298,23 @@ return /******/ (function(modules) { // webpackBootstrap } function isLocal () { - return !this._isUTC; + return this.isValid() ? !this._isUTC : false; } function isUtcOffset () { - return this._isUTC; + return this.isValid() ? this._isUTC : false; } function isUtc () { - return this._isUTC && this._offset === 0; + return this.isValid() ? this._isUTC && this._offset === 0 : false; } - var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; + // ASP.NET json date format regex + var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere - var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; + var isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; function create__createDuration (input, key) { var duration = input, @@ -3292,7 +3347,7 @@ return /******/ (function(modules) { // webpackBootstrap s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; - } else if (!!(match = create__isoRegex.exec(input))) { + } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), @@ -3349,6 +3404,10 @@ return /******/ (function(modules) { // webpackBootstrap function momentsDifference(base, other) { var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); @@ -3361,6 +3420,7 @@ return /******/ (function(modules) { // webpackBootstrap return res; } + // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; @@ -3381,6 +3441,12 @@ return /******/ (function(modules) { // webpackBootstrap var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; + + if (!mom.isValid()) { + // No op + return; + } + updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { @@ -3412,7 +3478,10 @@ return /******/ (function(modules) { // webpackBootstrap diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; - return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { @@ -3420,26 +3489,28 @@ return /******/ (function(modules) { // webpackBootstrap } function isAfter (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this > +input; + return +this > +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return inputMs < +this.clone().startOf(units); + return +localInput < +this.clone().startOf(units); } } function isBefore (input, units) { - var inputMs; - units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this < +input; + return +this < +localInput; } else { - inputMs = isMoment(input) ? +input : +local__createLocal(input); - return +this.clone().endOf(units) < inputMs; + return +this.clone().endOf(units) < +localInput; } } @@ -3448,22 +3519,45 @@ return /******/ (function(modules) { // webpackBootstrap } function isSame (input, units) { - var inputMs; + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { - input = isMoment(input) ? input : local__createLocal(input); - return +this === +input; + return +this === +localInput; } else { - inputMs = +local__createLocal(input); + inputMs = +localInput; return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + function diff (input, units, asFloat) { - var that = cloneWithOffset(input, this), - zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, + var that, + zoneDelta, delta, output; + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { @@ -3514,7 +3608,7 @@ return /******/ (function(modules) { // webpackBootstrap function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { - if ('function' === typeof Date.prototype.toISOString) { + if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { @@ -3531,10 +3625,13 @@ return /******/ (function(modules) { // webpackBootstrap } function from (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { @@ -3542,16 +3639,22 @@ return /******/ (function(modules) { // webpackBootstrap } function to (time, withoutSuffix) { - if (!this.isValid()) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { return this.localeData().invalidDate(); } - return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. function locale (key) { var newLocaleData; @@ -3662,6 +3765,11 @@ return /******/ (function(modules) { // webpackBootstrap }; } + function toJSON () { + // JSON.stringify(new Date(NaN)) === 'null' + return this.isValid() ? this.toISOString() : 'null'; + } + function moment_valid__isValid () { return valid__isValid(this); } @@ -3674,6 +3782,18 @@ return /******/ (function(modules) { // webpackBootstrap return getParsingFlags(this).overflow; } + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); @@ -3715,22 +3835,20 @@ return /******/ (function(modules) { // webpackBootstrap week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); - // HELPERS - - function weeksInYear(year, dow, doy) { - return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; - } - // MOMENTS function getSetWeekYear (input) { - var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); } function getSetISOWeekYear (input) { - var year = weekOfYear(this, 1, 4).year; - return input == null ? year : this.add((input - year), 'y'); + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); } function getISOWeeksInYear () { @@ -3742,7 +3860,33 @@ return /******/ (function(modules) { // webpackBootstrap return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } - addFormatToken('Q', 0, 0, 'quarter'); + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + // console.log("got", weekYear, week, weekday, "set", date.toISOString()); + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); // ALIASES @@ -3761,6 +3905,62 @@ return /******/ (function(modules) { // webpackBootstrap return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES @@ -3784,6 +3984,8 @@ return /******/ (function(modules) { // webpackBootstrap var getSetDayOfMonth = makeGetSet('Date', true); + // FORMATTING + addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { @@ -3816,8 +4018,8 @@ return /******/ (function(modules) { // webpackBootstrap addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); - addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { - var weekday = config._locale.weekdaysParse(input); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; @@ -3852,8 +4054,9 @@ return /******/ (function(modules) { // webpackBootstrap // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); - function localeWeekdays (m) { - return this._weekdays[m.day()]; + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); @@ -3866,20 +4069,37 @@ return /******/ (function(modules) { // webpackBootstrap return this._weekdaysMin[m.day()]; } - function localeWeekdaysParse (weekdayName) { + function localeWeekdaysParse (weekdayName, format, strict) { var i, mom, regex; - this._weekdaysParse = this._weekdaysParse || []; + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } for (i = 0; i < 7; i++) { // make the regex if we don't have it already + + mom = local__createLocal([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } if (!this._weekdaysParse[i]) { - mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex - if (this._weekdaysParse[i].test(weekdayName)) { + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } @@ -3888,6 +4108,9 @@ return /******/ (function(modules) { // webpackBootstrap // MOMENTS function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); @@ -3898,20 +4121,73 @@ return /******/ (function(modules) { // webpackBootstrap } function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } - addFormatToken('H', ['HH', 2], 0, 'hour'); - addFormatToken('h', ['hh', 2], 0, function () { + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { return this.hours() % 12 || 12; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); }); function meridiem (token, lowercase) { @@ -3940,6 +4216,11 @@ return /******/ (function(modules) { // webpackBootstrap addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); @@ -3949,6 +4230,32 @@ return /******/ (function(modules) { // webpackBootstrap array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); // LOCALES @@ -3976,6 +4283,8 @@ return /******/ (function(modules) { // webpackBootstrap // this rule. var getSetHour = makeGetSet('Hours', true); + // FORMATTING + addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES @@ -3992,6 +4301,8 @@ return /******/ (function(modules) { // webpackBootstrap var getSetMinute = makeGetSet('Minutes', false); + // FORMATTING + addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES @@ -4008,6 +4319,8 @@ return /******/ (function(modules) { // webpackBootstrap var getSetSecond = makeGetSet('Seconds', false); + // FORMATTING + addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); @@ -4063,6 +4376,8 @@ return /******/ (function(modules) { // webpackBootstrap var getSetMillisecond = makeGetSet('Milliseconds', false); + // FORMATTING + addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); @@ -4078,40 +4393,43 @@ return /******/ (function(modules) { // webpackBootstrap var momentPrototype__proto = Moment.prototype; - momentPrototype__proto.add = add_subtract__add; - momentPrototype__proto.calendar = moment_calendar__calendar; - momentPrototype__proto.clone = clone; - momentPrototype__proto.diff = diff; - momentPrototype__proto.endOf = endOf; - momentPrototype__proto.format = format; - momentPrototype__proto.from = from; - momentPrototype__proto.fromNow = fromNow; - momentPrototype__proto.to = to; - momentPrototype__proto.toNow = toNow; - momentPrototype__proto.get = getSet; - momentPrototype__proto.invalidAt = invalidAt; - momentPrototype__proto.isAfter = isAfter; - momentPrototype__proto.isBefore = isBefore; - momentPrototype__proto.isBetween = isBetween; - momentPrototype__proto.isSame = isSame; - momentPrototype__proto.isValid = moment_valid__isValid; - momentPrototype__proto.lang = lang; - momentPrototype__proto.locale = locale; - momentPrototype__proto.localeData = localeData; - momentPrototype__proto.max = prototypeMax; - momentPrototype__proto.min = prototypeMin; - momentPrototype__proto.parsingFlags = parsingFlags; - momentPrototype__proto.set = getSet; - momentPrototype__proto.startOf = startOf; - momentPrototype__proto.subtract = add_subtract__subtract; - momentPrototype__proto.toArray = toArray; - momentPrototype__proto.toObject = toObject; - momentPrototype__proto.toDate = toDate; - momentPrototype__proto.toISOString = moment_format__toISOString; - momentPrototype__proto.toJSON = moment_format__toISOString; - momentPrototype__proto.toString = toString; - momentPrototype__proto.unix = unix; - momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; // Year momentPrototype__proto.year = getSetYear; @@ -4197,7 +4515,7 @@ return /******/ (function(modules) { // webpackBootstrap function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; - return typeof output === 'function' ? output.call(mom, now) : output; + return isFunction(output) ? output.call(mom, now) : output; } var defaultLongDateFormat = { @@ -4259,21 +4577,21 @@ return /******/ (function(modules) { // webpackBootstrap function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; - return (typeof output === 'function') ? + return (isFunction(output)) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; - return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); + return isFunction(format) ? format(output) : format.replace(/%s/i, output); } function locale_set__set (config) { var prop, i; for (i in config) { prop = config[i]; - if (typeof prop === 'function') { + if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; @@ -4376,6 +4694,9 @@ return /******/ (function(modules) { // webpackBootstrap } locale_locales__getSetGlobalLocale('en', { + monthsParse : [/^jan/i, /^feb/i, /^mar/i, /^apr/i, /^may/i, /^jun/i, /^jul/i, /^aug/i, /^sep/i, /^oct/i, /^nov/i, /^dec/i], + longMonthsParse : [/^january$/i, /^february$/i, /^march$/i, /^april$/i, /^may$/i, /^june$/i, /^july$/i, /^august$/i, /^september$/i, /^october$/i, /^november$/i, /^december$/i], + shortMonthsParse : [/^jan$/i, /^feb$/i, /^mar$/i, /^apr$/i, /^may$/i, /^jun$/i, /^jul$/i, /^aug/i, /^sept?$/i, /^oct$/i, /^nov$/i, /^dec$/i], ordinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal : function (number) { var b = number % 10, @@ -4595,15 +4916,15 @@ return /******/ (function(modules) { // webpackBootstrap var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || - minutes === 1 && ['m'] || + minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || - hours === 1 && ['h'] || + hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || - days === 1 && ['d'] || + days <= 1 && ['d'] || days < thresholds.d && ['dd', days] || - months === 1 && ['M'] || + months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || - years === 1 && ['y'] || ['yy', years]; + years <= 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; @@ -4724,6 +5045,8 @@ return /******/ (function(modules) { // webpackBootstrap // Side effect imports + // FORMATTING + addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); @@ -4741,13 +5064,14 @@ return /******/ (function(modules) { // webpackBootstrap // Side effect imports - utils_hooks__hooks.version = '2.10.6'; + utils_hooks__hooks.version = '2.11.0'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; @@ -4766,6 +5090,7 @@ return /******/ (function(modules) { // webpackBootstrap utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; var _moment = utils_hooks__hooks; @@ -5500,7 +5825,7 @@ return /******/ (function(modules) { // webpackBootstrap if (data[i] instanceof Object) { addOrUpdate(data[i]); } else { - console.warn("Ignoring input item, which is not an object at index" + i); + console.warn('Ignoring input item, which is not an object at index ' + i); } } } else if (data instanceof Object) { @@ -10121,18 +10446,18 @@ return /******/ (function(modules) { // webpackBootstrap var util = __webpack_require__(1); var DataSet = __webpack_require__(8); var DataView = __webpack_require__(10); - var Range = __webpack_require__(24); - var Core = __webpack_require__(28); - var TimeAxis = __webpack_require__(39); - var CurrentTime = __webpack_require__(44); - var CustomTime = __webpack_require__(42); - var ItemSet = __webpack_require__(29); + var Range = __webpack_require__(23); + var Core = __webpack_require__(27); + var TimeAxis = __webpack_require__(38); + var CurrentTime = __webpack_require__(43); + var CustomTime = __webpack_require__(41); + var ItemSet = __webpack_require__(28); - var Configurator = __webpack_require__(45); - var Validator = __webpack_require__(47)['default']; - var printStyle = __webpack_require__(47).printStyle; - var allOptions = __webpack_require__(48).allOptions; - var configureOptions = __webpack_require__(48).configureOptions; + var Configurator = __webpack_require__(44); + var Validator = __webpack_require__(46)['default']; + var printStyle = __webpack_require__(46).printStyle; + var allOptions = __webpack_require__(47).allOptions; + var configureOptions = __webpack_require__(47).configureOptions; /** * Create a timeline visualization @@ -10492,8 +10817,8 @@ return /******/ (function(modules) { // webpackBootstrap // get a rough approximation for the range based on the items start and end dates var range = this.getDataRange(); - var min = range.min.valueOf(); - var max = range.max.valueOf(); + var min = range.min !== null ? range.min.valueOf() : null; + var max = range.max !== null ? range.max.valueOf() : null; var minItem = null; var maxItem = null; @@ -10891,15 +11216,15 @@ return /******/ (function(modules) { // webpackBootstrap /* 22 */ /***/ function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.4 - 2014-09-28 + var __WEBPACK_AMD_DEFINE_RESULT__;/*! Hammer.JS - v2.0.6 - 2015-12-23 * http://hammerjs.github.io/ * - * Copyright (c) 2014 Jorik Tangelder; - * Licensed under the MIT license */ + * Copyright (c) 2015 Jorik Tangelder; + * Licensed under the license */ (function(window, document, exportName, undefined) { 'use strict'; - var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o']; + var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o']; var TEST_ELEMENT = document.createElement('div'); var TYPE_FUNCTION = 'function'; @@ -10964,15 +11289,69 @@ return /******/ (function(modules) { // webpackBootstrap } } + /** + * wrap a method with a deprecation warning and stack trace + * @param {Function} method + * @param {String} name + * @param {String} message + * @returns {Function} A new function wrapping the supplied method. + */ + function deprecate(method, name, message) { + var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n'; + return function() { + var e = new Error('get-stack-trace'); + var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '') + .replace(/^\s+at\s+/gm, '') + .replace(/^Object.\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace'; + + var log = window.console && (window.console.warn || window.console.log); + if (log) { + log.call(window.console, deprecationMessage, stack); + } + return method.apply(this, arguments); + }; + } + + /** + * extend object. + * means that properties in dest will be overwritten by the ones in src. + * @param {Object} target + * @param {...Object} objects_to_assign + * @returns {Object} target + */ + var assign; + if (typeof Object.assign !== 'function') { + assign = function assign(target) { + if (target === undefined || target === null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + var output = Object(target); + for (var index = 1; index < arguments.length; index++) { + var source = arguments[index]; + if (source !== undefined && source !== null) { + for (var nextKey in source) { + if (source.hasOwnProperty(nextKey)) { + output[nextKey] = source[nextKey]; + } + } + } + } + return output; + }; + } else { + assign = Object.assign; + } + /** * extend object. * means that properties in dest will be overwritten by the ones in src. * @param {Object} dest * @param {Object} src - * @param {Boolean} [merge] + * @param {Boolean=false} [merge] * @returns {Object} dest */ - function extend(dest, src, merge) { + var extend = deprecate(function extend(dest, src, merge) { var keys = Object.keys(src); var i = 0; while (i < keys.length) { @@ -10982,7 +11361,7 @@ return /******/ (function(modules) { // webpackBootstrap i++; } return dest; - } + }, 'extend', 'Use `assign`.'); /** * merge the values from src in the dest. @@ -10991,9 +11370,9 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Object} src * @returns {Object} dest */ - function merge(dest, src) { + var merge = deprecate(function merge(dest, src) { return extend(dest, src, true); - } + }, 'merge', 'Use `assign`.'); /** * simple class inheritance @@ -11010,7 +11389,7 @@ return /******/ (function(modules) { // webpackBootstrap childP._super = baseP; if (properties) { - extend(childP, properties); + assign(childP, properties); } } @@ -11213,8 +11592,8 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {DocumentView|Window} */ function getWindowForElement(element) { - var doc = element.ownerDocument; - return (doc.defaultView || doc.parentWindow); + var doc = element.ownerDocument || element; + return (doc.defaultView || doc.parentWindow || window); } var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i; @@ -11393,9 +11772,17 @@ return /******/ (function(modules) { // webpackBootstrap computeDeltaXY(session, input); input.offsetDirection = getDirection(input.deltaX, input.deltaY); + var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY); + input.overallVelocityX = overallVelocity.x; + input.overallVelocityY = overallVelocity.y; + input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y; + input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1; input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0; + input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length > + session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers); + computeIntervalInputData(session, input); // find the correct target @@ -11439,8 +11826,8 @@ return /******/ (function(modules) { // webpackBootstrap velocity, velocityX, velocityY, direction; if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) { - var deltaX = last.deltaX - input.deltaX; - var deltaY = last.deltaY - input.deltaY; + var deltaX = input.deltaX - last.deltaX; + var deltaY = input.deltaY - last.deltaY; var v = getVelocity(deltaTime, deltaX, deltaY); velocityX = v.x; @@ -11545,9 +11932,9 @@ return /******/ (function(modules) { // webpackBootstrap } if (abs(x) >= abs(y)) { - return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; + return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; } - return y > 0 ? DIRECTION_UP : DIRECTION_DOWN; + return y < 0 ? DIRECTION_UP : DIRECTION_DOWN; } /** @@ -11590,7 +11977,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Number} rotation */ function getRotation(start, end) { - return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY); + return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY); } /** @@ -11683,7 +12070,7 @@ return /******/ (function(modules) { // webpackBootstrap var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive - if (window.MSPointerEvent) { + if (window.MSPointerEvent && !window.PointerEvent) { POINTER_ELEMENT_EVENTS = 'MSPointerDown'; POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel'; } @@ -12007,7 +12394,7 @@ return /******/ (function(modules) { // webpackBootstrap value = this.compute(); } - if (NATIVE_TOUCH_ACTION) { + if (NATIVE_TOUCH_ACTION && this.manager.element.style) { this.manager.element.style[PREFIXED_TOUCH_ACTION] = value; } this.actions = value.toLowerCase().trim(); @@ -12058,6 +12445,23 @@ return /******/ (function(modules) { // webpackBootstrap var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); + if (hasNone) { + //do not prevent defaults if this is a tap gesture + + var isTapPointer = input.pointers.length === 1; + var isTapMovement = input.distance < 2; + var isTapTouchTime = input.deltaTime < 250; + + if (isTapPointer && isTapMovement && isTapTouchTime) { + return; + } + } + + if (hasPanX && hasPanY) { + // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent + return; + } + if (hasNone || (hasPanY && direction & DIRECTION_HORIZONTAL) || (hasPanX && direction & DIRECTION_VERTICAL)) { @@ -12089,9 +12493,12 @@ return /******/ (function(modules) { // webpackBootstrap var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); - // pan-x and pan-y can be combined + // if both pan-x and pan-y are set (different recognizers + // for different directions, e.g. horizontal pan but vertical swipe?) + // we need none (as otherwise with pan-x pan-y combined none of these + // recognizers will work, since the browser would handle all panning if (hasPanX && hasPanY) { - return TOUCH_ACTION_PAN_X + ' ' + TOUCH_ACTION_PAN_Y; + return TOUCH_ACTION_NONE; } // pan-x OR pan-y @@ -12149,10 +12556,11 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Object} options */ function Recognizer(options) { + this.options = assign({}, this.defaults, options || {}); + this.id = uniqueId(); this.manager = null; - this.options = merge(options || {}, this.defaults); // default is enable true this.options.enable = ifUndefined(this.options.enable, true); @@ -12176,7 +12584,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Recognizer} */ set: function(options) { - extend(this.options, options); + assign(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state this.manager && this.manager.touchAction.update(); @@ -12280,20 +12688,24 @@ return /******/ (function(modules) { // webpackBootstrap var self = this; var state = this.state; - function emit(withState) { - self.manager.emit(self.options.event + (withState ? stateStr(state) : ''), input); + function emit(event) { + self.manager.emit(event, input); } // 'panstart' and 'panmove' if (state < STATE_ENDED) { - emit(true); + emit(self.options.event + stateStr(state)); } - emit(); // simple 'eventName' events + emit(self.options.event); // simple 'eventName' events + + if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...) + emit(input.additionalEvent); + } // panend and pancancel if (state >= STATE_ENDED) { - emit(true); + emit(self.options.event + stateStr(state)); } }, @@ -12333,7 +12745,7 @@ return /******/ (function(modules) { // webpackBootstrap recognize: function(inputData) { // make a new copy of the inputData // so we can change the inputData without messing up the other recognizers - var inputDataClone = extend({}, inputData); + var inputDataClone = assign({}, inputData); // is is enabled and allow recognizing? if (!boolOrFn(this.options.enable, [this, inputDataClone])) { @@ -12558,14 +12970,15 @@ return /******/ (function(modules) { // webpackBootstrap }, emit: function(input) { + this.pX = input.deltaX; this.pY = input.deltaY; var direction = directionStr(input.direction); + if (direction) { - this.manager.emit(this.options.event + direction, input); + input.additionalEvent = this.options.event + direction; } - this._super.emit.call(this, input); } }); @@ -12601,11 +13014,11 @@ return /******/ (function(modules) { // webpackBootstrap }, emit: function(input) { - this._super.emit.call(this, input); if (input.scale !== 1) { var inOut = input.scale < 1 ? 'in' : 'out'; - this.manager.emit(this.options.event + inOut, input); + input.additionalEvent = this.options.event + inOut; } + this._super.emit.call(this, input); } }); @@ -12630,8 +13043,8 @@ return /******/ (function(modules) { // webpackBootstrap defaults: { event: 'press', pointers: 1, - time: 500, // minimal time of the pointer to be pressed - threshold: 5 // a minimal movement is ok, but keep it low + time: 251, // minimal time of the pointer to be pressed + threshold: 9 // a minimal movement is ok, but keep it low }, getTouchAction: function() { @@ -12729,7 +13142,7 @@ return /******/ (function(modules) { // webpackBootstrap defaults: { event: 'swipe', threshold: 10, - velocity: 0.65, + velocity: 0.3, direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL, pointers: 1 }, @@ -12743,21 +13156,22 @@ return /******/ (function(modules) { // webpackBootstrap var velocity; if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) { - velocity = input.velocity; + velocity = input.overallVelocity; } else if (direction & DIRECTION_HORIZONTAL) { - velocity = input.velocityX; + velocity = input.overallVelocityX; } else if (direction & DIRECTION_VERTICAL) { - velocity = input.velocityY; + velocity = input.overallVelocityY; } return this._super.attrTest.call(this, input) && - direction & input.direction && + direction & input.offsetDirection && input.distance > this.options.threshold && + input.maxPointers == this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END; }, emit: function(input) { - var direction = directionStr(input.direction); + var direction = directionStr(input.offsetDirection); if (direction) { this.manager.emit(this.options.event + direction, input); } @@ -12800,7 +13214,7 @@ return /******/ (function(modules) { // webpackBootstrap taps: 1, interval: 300, // max time between the multi-tap taps time: 250, // max time of the pointer to be down (like finger on the screen) - threshold: 2, // a minimal movement is ok, but keep it low + threshold: 9, // a minimal movement is ok, but keep it low posThreshold: 10 // a multi-tap can be a bit off the initial position }, @@ -12874,7 +13288,7 @@ return /******/ (function(modules) { // webpackBootstrap }, emit: function() { - if (this.state == STATE_RECOGNIZED ) { + if (this.state == STATE_RECOGNIZED) { this._input.tapCount = this.count; this.manager.emit(this.options.event, this._input); } @@ -12882,7 +13296,7 @@ return /******/ (function(modules) { // webpackBootstrap }); /** - * Simple way to create an manager with a default set of recognizers. + * Simple way to create a manager with a default set of recognizers. * @param {HTMLElement} element * @param {Object} [options] * @constructor @@ -12896,7 +13310,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * @const {string} */ - Hammer.VERSION = '2.0.4'; + Hammer.VERSION = '2.0.6'; /** * default settings @@ -12948,12 +13362,12 @@ return /******/ (function(modules) { // webpackBootstrap */ preset: [ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...] - [RotateRecognizer, { enable: false }], - [PinchRecognizer, { enable: false }, ['rotate']], - [SwipeRecognizer,{ direction: DIRECTION_HORIZONTAL }], - [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ['swipe']], + [RotateRecognizer, {enable: false}], + [PinchRecognizer, {enable: false}, ['rotate']], + [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}], + [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']], [TapRecognizer], - [TapRecognizer, { event: 'doubletap', taps: 2 }, ['tap']], + [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']], [PressRecognizer] ], @@ -13020,9 +13434,8 @@ return /******/ (function(modules) { // webpackBootstrap * @constructor */ function Manager(element, options) { - options = options || {}; + this.options = assign({}, Hammer.defaults, options || {}); - this.options = merge(options, Hammer.defaults); this.options.inputTarget = this.options.inputTarget || element; this.handlers = {}; @@ -13035,7 +13448,7 @@ return /******/ (function(modules) { // webpackBootstrap toggleCssProps(this, true); - each(options.recognizers, function(item) { + each(this.options.recognizers, function(item) { var recognizer = this.add(new (item[0])(item[1])); item[2] && recognizer.recognizeWith(item[2]); item[3] && recognizer.requireFailure(item[3]); @@ -13049,7 +13462,7 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Manager} */ set: function(options) { - extend(this.options, options); + assign(this.options, options); // Options that need a little more setup if (options.touchAction) { @@ -13183,11 +13596,19 @@ return /******/ (function(modules) { // webpackBootstrap return this; } - var recognizers = this.recognizers; recognizer = this.get(recognizer); - recognizers.splice(inArray(recognizers, recognizer), 1); - this.touchAction.update(); + // let's make sure this recognizer exists + if (recognizer) { + var recognizers = this.recognizers; + var index = inArray(recognizers, recognizer); + + if (index !== -1) { + recognizers.splice(index, 1); + this.touchAction.update(); + } + } + return this; }, @@ -13218,7 +13639,7 @@ return /******/ (function(modules) { // webpackBootstrap if (!handler) { delete handlers[event]; } else { - handlers[event].splice(inArray(handlers[event], handler), 1); + handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1); } }); return this; @@ -13274,6 +13695,9 @@ return /******/ (function(modules) { // webpackBootstrap */ function toggleCssProps(manager, add) { var element = manager.element; + if (!element.style) { + return; + } each(manager.options.cssProps, function(value, name) { element.style[prefixed(element.style, name)] = add ? value : ''; }); @@ -13291,7 +13715,7 @@ return /******/ (function(modules) { // webpackBootstrap data.target.dispatchEvent(gestureEvent); } - extend(Hammer, { + assign(Hammer, { INPUT_START: INPUT_START, INPUT_MOVE: INPUT_MOVE, INPUT_END: INPUT_END, @@ -13338,12 +13762,18 @@ return /******/ (function(modules) { // webpackBootstrap each: each, merge: merge, extend: extend, + assign: assign, inherit: inherit, bindFn: bindFn, prefixed: prefixed }); - if ("function" == TYPE_FUNCTION && __webpack_require__(23)) { + // this prevents errors when Hammer is loaded in the presence of an AMD + // style loader but by script tag, not by the loader. + var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line + freeGlobal.Hammer = Hammer; + + if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { return Hammer; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); @@ -13358,23 +13788,15 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 23 */ -/***/ function(module, exports) { - - /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__; - - /* WEBPACK VAR INJECTION */}.call(exports, {})) - -/***/ }, -/* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); - var hammerUtil = __webpack_require__(25); + var hammerUtil = __webpack_require__(24); var moment = __webpack_require__(2); - var Component = __webpack_require__(26); - var DateUtil = __webpack_require__(27); + var Component = __webpack_require__(25); + var DateUtil = __webpack_require__(26); /** * @constructor Range @@ -14073,7 +14495,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Range; /***/ }, -/* 25 */ +/* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -14145,7 +14567,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.offRelease = exports.offTouch; /***/ }, -/* 26 */ +/* 25 */ /***/ function(module, exports) { /** @@ -14205,7 +14627,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Component; /***/ }, -/* 27 */ +/* 26 */ /***/ function(module, exports) { @@ -14677,23 +15099,23 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 28 */ +/* 27 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var Emitter = __webpack_require__(12); var Hammer = __webpack_require__(20); - var hammerUtil = __webpack_require__(25); + var hammerUtil = __webpack_require__(24); var util = __webpack_require__(1); var DataSet = __webpack_require__(8); var DataView = __webpack_require__(10); - var Range = __webpack_require__(24); - var ItemSet = __webpack_require__(29); - var TimeAxis = __webpack_require__(39); - var Activator = __webpack_require__(40); - var DateUtil = __webpack_require__(27); - var CustomTime = __webpack_require__(42); + var Range = __webpack_require__(23); + var ItemSet = __webpack_require__(28); + var TimeAxis = __webpack_require__(38); + var Activator = __webpack_require__(39); + var DateUtil = __webpack_require__(26); + var CustomTime = __webpack_require__(41); /** * Create a timeline visualization @@ -15693,7 +16115,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Core; /***/ }, -/* 29 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -15702,14 +16124,14 @@ return /******/ (function(modules) { // webpackBootstrap var util = __webpack_require__(1); var DataSet = __webpack_require__(8); var DataView = __webpack_require__(10); - var TimeStep = __webpack_require__(30); - var Component = __webpack_require__(26); - var Group = __webpack_require__(31); - var BackgroundGroup = __webpack_require__(35); - var BoxItem = __webpack_require__(36); - var PointItem = __webpack_require__(37); - var RangeItem = __webpack_require__(33); - var BackgroundItem = __webpack_require__(38); + var TimeStep = __webpack_require__(29); + var Component = __webpack_require__(25); + var Group = __webpack_require__(30); + var BackgroundGroup = __webpack_require__(34); + var BoxItem = __webpack_require__(35); + var PointItem = __webpack_require__(36); + var RangeItem = __webpack_require__(32); + var BackgroundItem = __webpack_require__(37); var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items var BACKGROUND = '__background__'; // reserved group id for background items without group @@ -17352,8 +17774,6 @@ return /******/ (function(modules) { // webpackBootstrap var snap = this.options.snap || null; var item = this.itemFromTarget(event); - event.stopPropagation(); - if (item) { // update item @@ -17602,13 +18022,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = ItemSet; /***/ }, -/* 30 */ +/* 29 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var moment = __webpack_require__(2); - var DateUtil = __webpack_require__(27); + var DateUtil = __webpack_require__(26); var util = __webpack_require__(1); /** @@ -18312,14 +18732,14 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = TimeStep; /***/ }, -/* 31 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); - var stack = __webpack_require__(32); - var RangeItem = __webpack_require__(33); + var stack = __webpack_require__(31); + var RangeItem = __webpack_require__(32); /** * @constructor Group @@ -18937,7 +19357,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Group; /***/ }, -/* 32 */ +/* 31 */ /***/ function(module, exports) { // Utility functions for ordering and stacking of items @@ -19061,13 +19481,13 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 33 */ +/* 32 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var Hammer = __webpack_require__(20); - var Item = __webpack_require__(34); + var Item = __webpack_require__(33); /** * @constructor RangeItem @@ -19357,7 +19777,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = RangeItem; /***/ }, -/* 34 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -19658,13 +20078,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Item; /***/ }, -/* 35 */ +/* 34 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); - var Group = __webpack_require__(31); + var Group = __webpack_require__(30); /** * @constructor BackgroundGroup @@ -19722,12 +20142,12 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BackgroundGroup; /***/ }, -/* 36 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Item = __webpack_require__(34); + var Item = __webpack_require__(33); var util = __webpack_require__(1); /** @@ -19962,12 +20382,12 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BoxItem; /***/ }, -/* 37 */ +/* 36 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var Item = __webpack_require__(34); + var Item = __webpack_require__(33); /** * @constructor PointItem @@ -20168,15 +20588,15 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = PointItem; /***/ }, -/* 38 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var Hammer = __webpack_require__(20); - var Item = __webpack_require__(34); - var BackgroundGroup = __webpack_require__(35); - var RangeItem = __webpack_require__(33); + var Item = __webpack_require__(33); + var BackgroundGroup = __webpack_require__(34); + var RangeItem = __webpack_require__(32); /** * @constructor BackgroundItem @@ -20389,15 +20809,15 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = BackgroundItem; /***/ }, -/* 39 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); - var Component = __webpack_require__(26); - var TimeStep = __webpack_require__(30); - var DateUtil = __webpack_require__(27); + var Component = __webpack_require__(25); + var TimeStep = __webpack_require__(29); + var DateUtil = __webpack_require__(26); var moment = __webpack_require__(2); /** @@ -20866,12 +21286,12 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = TimeAxis; /***/ }, -/* 40 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; - var keycharm = __webpack_require__(41); + var keycharm = __webpack_require__(40); var Emitter = __webpack_require__(12); var Hammer = __webpack_require__(20); var util = __webpack_require__(1); @@ -21025,7 +21445,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Activator; /***/ }, -/* 41 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;"use strict"; @@ -21224,16 +21644,16 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 42 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var Hammer = __webpack_require__(20); var util = __webpack_require__(1); - var Component = __webpack_require__(26); + var Component = __webpack_require__(25); var moment = __webpack_require__(2); - var locales = __webpack_require__(43); + var locales = __webpack_require__(42); /** * A custom time bar @@ -21475,7 +21895,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CustomTime; /***/ }, -/* 43 */ +/* 42 */ /***/ function(module, exports) { // English @@ -21497,15 +21917,15 @@ return /******/ (function(modules) { // webpackBootstrap exports['nl_BE'] = exports['nl']; /***/ }, -/* 44 */ +/* 43 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); - var Component = __webpack_require__(26); + var Component = __webpack_require__(25); var moment = __webpack_require__(2); - var locales = __webpack_require__(43); + var locales = __webpack_require__(42); /** * A current time bar @@ -21674,7 +22094,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = CurrentTime; /***/ }, -/* 45 */ +/* 44 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -21689,7 +22109,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _ColorPicker = __webpack_require__(46); + var _ColorPicker = __webpack_require__(45); var _ColorPicker2 = _interopRequireDefault(_ColorPicker); @@ -22470,7 +22890,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 46 */ +/* 45 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -22484,7 +22904,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var Hammer = __webpack_require__(20); - var hammerUtil = __webpack_require__(25); + var hammerUtil = __webpack_require__(24); var util = __webpack_require__(1); var ColorPicker = (function () { @@ -23054,7 +23474,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 47 */ +/* 46 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -23370,7 +23790,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.printStyle = printStyle; /***/ }, -/* 48 */ +/* 47 */ /***/ function(module, exports) { /** @@ -23611,7 +24031,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.configureOptions = configureOptions; /***/ }, -/* 49 */ +/* 48 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -23622,18 +24042,18 @@ return /******/ (function(modules) { // webpackBootstrap var util = __webpack_require__(1); var DataSet = __webpack_require__(8); var DataView = __webpack_require__(10); - var Range = __webpack_require__(24); - var Core = __webpack_require__(28); - var TimeAxis = __webpack_require__(39); - var CurrentTime = __webpack_require__(44); - var CustomTime = __webpack_require__(42); - var LineGraph = __webpack_require__(50); + var Range = __webpack_require__(23); + var Core = __webpack_require__(27); + var TimeAxis = __webpack_require__(38); + var CurrentTime = __webpack_require__(43); + var CustomTime = __webpack_require__(41); + var LineGraph = __webpack_require__(49); - var Configurator = __webpack_require__(45); - var Validator = __webpack_require__(47)['default']; - var printStyle = __webpack_require__(47).printStyle; - var allOptions = __webpack_require__(58).allOptions; - var configureOptions = __webpack_require__(58).configureOptions; + var Configurator = __webpack_require__(44); + var Validator = __webpack_require__(46)['default']; + var printStyle = __webpack_require__(46).printStyle; + var allOptions = __webpack_require__(57).allOptions; + var configureOptions = __webpack_require__(57).configureOptions; /** * Create a timeline visualization @@ -23950,7 +24370,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Graph2d; /***/ }, -/* 50 */ +/* 49 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -23959,13 +24379,13 @@ return /******/ (function(modules) { // webpackBootstrap var DOMutil = __webpack_require__(7); var DataSet = __webpack_require__(8); var DataView = __webpack_require__(10); - var Component = __webpack_require__(26); - var DataAxis = __webpack_require__(51); - var GraphGroup = __webpack_require__(53); - var Legend = __webpack_require__(57); - var Bars = __webpack_require__(54); - var Lines = __webpack_require__(56); - var Points = __webpack_require__(55); + var Component = __webpack_require__(25); + var DataAxis = __webpack_require__(50); + var GraphGroup = __webpack_require__(52); + var Legend = __webpack_require__(56); + var Bars = __webpack_require__(53); + var Lines = __webpack_require__(55); + var Points = __webpack_require__(54); var UNGROUPED = '__ungrouped__'; // reserved group id for ungrouped items @@ -25008,15 +25428,15 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = LineGraph; /***/ }, -/* 51 */ +/* 50 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); var DOMutil = __webpack_require__(7); - var Component = __webpack_require__(26); - var DataStep = __webpack_require__(52); + var Component = __webpack_require__(25); + var DataStep = __webpack_require__(51); /** * A horizontal time axis @@ -25613,7 +26033,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DataAxis; /***/ }, -/* 52 */ +/* 51 */ /***/ function(module, exports) { /** @@ -25840,16 +26260,16 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = DataStep; /***/ }, -/* 53 */ +/* 52 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); var DOMutil = __webpack_require__(7); - var Bars = __webpack_require__(54); - var Lines = __webpack_require__(56); - var Points = __webpack_require__(55); + var Bars = __webpack_require__(53); + var Lines = __webpack_require__(55); + var Points = __webpack_require__(54); /** * /** @@ -26001,13 +26421,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = GraphGroup; /***/ }, -/* 54 */ +/* 53 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var DOMutil = __webpack_require__(7); - var Points = __webpack_require__(55); + var Points = __webpack_require__(54); function Bargraph(groupId, options) {} @@ -26273,7 +26693,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Bargraph; /***/ }, -/* 55 */ +/* 54 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -26350,7 +26770,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Points; /***/ }, -/* 56 */ +/* 55 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -26639,14 +27059,14 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Line; /***/ }, -/* 57 */ +/* 56 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var util = __webpack_require__(1); var DOMutil = __webpack_require__(7); - var Component = __webpack_require__(26); + var Component = __webpack_require__(25); /** * Legend for Graph2d @@ -26857,7 +27277,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Legend; /***/ }, -/* 58 */ +/* 57 */ /***/ function(module, exports) { /** @@ -27141,7 +27561,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.configureOptions = configureOptions; /***/ }, -/* 59 */ +/* 58 */ /***/ function(module, exports, __webpack_require__) { // Load custom shapes into CanvasRenderingContext2D @@ -27149,65 +27569,65 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var _modulesGroups = __webpack_require__(60); + var _modulesGroups = __webpack_require__(59); var _modulesGroups2 = _interopRequireDefault(_modulesGroups); - var _modulesNodesHandler = __webpack_require__(61); + var _modulesNodesHandler = __webpack_require__(60); var _modulesNodesHandler2 = _interopRequireDefault(_modulesNodesHandler); - var _modulesEdgesHandler = __webpack_require__(81); + var _modulesEdgesHandler = __webpack_require__(80); var _modulesEdgesHandler2 = _interopRequireDefault(_modulesEdgesHandler); - var _modulesPhysicsEngine = __webpack_require__(90); + var _modulesPhysicsEngine = __webpack_require__(89); var _modulesPhysicsEngine2 = _interopRequireDefault(_modulesPhysicsEngine); - var _modulesClustering = __webpack_require__(99); + var _modulesClustering = __webpack_require__(98); var _modulesClustering2 = _interopRequireDefault(_modulesClustering); - var _modulesCanvasRenderer = __webpack_require__(102); + var _modulesCanvasRenderer = __webpack_require__(101); var _modulesCanvasRenderer2 = _interopRequireDefault(_modulesCanvasRenderer); - var _modulesCanvas = __webpack_require__(103); + var _modulesCanvas = __webpack_require__(102); var _modulesCanvas2 = _interopRequireDefault(_modulesCanvas); - var _modulesView = __webpack_require__(104); + var _modulesView = __webpack_require__(103); var _modulesView2 = _interopRequireDefault(_modulesView); - var _modulesInteractionHandler = __webpack_require__(105); + var _modulesInteractionHandler = __webpack_require__(104); var _modulesInteractionHandler2 = _interopRequireDefault(_modulesInteractionHandler); - var _modulesSelectionHandler = __webpack_require__(108); + var _modulesSelectionHandler = __webpack_require__(107); var _modulesSelectionHandler2 = _interopRequireDefault(_modulesSelectionHandler); - var _modulesLayoutEngine = __webpack_require__(109); + var _modulesLayoutEngine = __webpack_require__(108); var _modulesLayoutEngine2 = _interopRequireDefault(_modulesLayoutEngine); - var _modulesManipulationSystem = __webpack_require__(110); + var _modulesManipulationSystem = __webpack_require__(109); var _modulesManipulationSystem2 = _interopRequireDefault(_modulesManipulationSystem); - var _sharedConfigurator = __webpack_require__(45); + var _sharedConfigurator = __webpack_require__(44); var _sharedConfigurator2 = _interopRequireDefault(_sharedConfigurator); - var _sharedValidator = __webpack_require__(47); + var _sharedValidator = __webpack_require__(46); var _sharedValidator2 = _interopRequireDefault(_sharedValidator); - var _optionsJs = __webpack_require__(111); + var _optionsJs = __webpack_require__(110); - var _modulesKamadaKawaiJs = __webpack_require__(112); + var _modulesKamadaKawaiJs = __webpack_require__(111); var _modulesKamadaKawaiJs2 = _interopRequireDefault(_modulesKamadaKawaiJs); @@ -27222,18 +27642,18 @@ return /******/ (function(modules) { // webpackBootstrap * {Array} edges * @param {Object} options Options */ - __webpack_require__(114); + __webpack_require__(113); var Emitter = __webpack_require__(12); var Hammer = __webpack_require__(20); var util = __webpack_require__(1); var DataSet = __webpack_require__(8); var DataView = __webpack_require__(10); - var dotparser = __webpack_require__(115); - var gephiParser = __webpack_require__(116); - var Images = __webpack_require__(117); - var Activator = __webpack_require__(40); - var locales = __webpack_require__(118); + var dotparser = __webpack_require__(114); + var gephiParser = __webpack_require__(115); + var Images = __webpack_require__(116); + var Activator = __webpack_require__(39); + var locales = __webpack_require__(117); function Network(container, data, options) { var _this = this; @@ -27775,7 +28195,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = Network; /***/ }, -/* 60 */ +/* 59 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -27917,7 +28337,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 61 */ +/* 60 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -27932,11 +28352,11 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _componentsNode = __webpack_require__(62); + var _componentsNode = __webpack_require__(61); var _componentsNode2 = _interopRequireDefault(_componentsNode); - var _componentsSharedLabel = __webpack_require__(63); + var _componentsSharedLabel = __webpack_require__(62); var _componentsSharedLabel2 = _interopRequireDefault(_componentsSharedLabel); @@ -28427,7 +28847,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 62 */ +/* 61 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -28442,67 +28862,67 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _sharedLabel = __webpack_require__(63); + var _sharedLabel = __webpack_require__(62); var _sharedLabel2 = _interopRequireDefault(_sharedLabel); - var _nodesShapesBox = __webpack_require__(64); + var _nodesShapesBox = __webpack_require__(63); var _nodesShapesBox2 = _interopRequireDefault(_nodesShapesBox); - var _nodesShapesCircle = __webpack_require__(66); + var _nodesShapesCircle = __webpack_require__(65); var _nodesShapesCircle2 = _interopRequireDefault(_nodesShapesCircle); - var _nodesShapesCircularImage = __webpack_require__(68); + var _nodesShapesCircularImage = __webpack_require__(67); var _nodesShapesCircularImage2 = _interopRequireDefault(_nodesShapesCircularImage); - var _nodesShapesDatabase = __webpack_require__(69); + var _nodesShapesDatabase = __webpack_require__(68); var _nodesShapesDatabase2 = _interopRequireDefault(_nodesShapesDatabase); - var _nodesShapesDiamond = __webpack_require__(70); + var _nodesShapesDiamond = __webpack_require__(69); var _nodesShapesDiamond2 = _interopRequireDefault(_nodesShapesDiamond); - var _nodesShapesDot = __webpack_require__(72); + var _nodesShapesDot = __webpack_require__(71); var _nodesShapesDot2 = _interopRequireDefault(_nodesShapesDot); - var _nodesShapesEllipse = __webpack_require__(73); + var _nodesShapesEllipse = __webpack_require__(72); var _nodesShapesEllipse2 = _interopRequireDefault(_nodesShapesEllipse); - var _nodesShapesIcon = __webpack_require__(74); + var _nodesShapesIcon = __webpack_require__(73); var _nodesShapesIcon2 = _interopRequireDefault(_nodesShapesIcon); - var _nodesShapesImage = __webpack_require__(75); + var _nodesShapesImage = __webpack_require__(74); var _nodesShapesImage2 = _interopRequireDefault(_nodesShapesImage); - var _nodesShapesSquare = __webpack_require__(76); + var _nodesShapesSquare = __webpack_require__(75); var _nodesShapesSquare2 = _interopRequireDefault(_nodesShapesSquare); - var _nodesShapesStar = __webpack_require__(77); + var _nodesShapesStar = __webpack_require__(76); var _nodesShapesStar2 = _interopRequireDefault(_nodesShapesStar); - var _nodesShapesText = __webpack_require__(78); + var _nodesShapesText = __webpack_require__(77); var _nodesShapesText2 = _interopRequireDefault(_nodesShapesText); - var _nodesShapesTriangle = __webpack_require__(79); + var _nodesShapesTriangle = __webpack_require__(78); var _nodesShapesTriangle2 = _interopRequireDefault(_nodesShapesTriangle); - var _nodesShapesTriangleDown = __webpack_require__(80); + var _nodesShapesTriangleDown = __webpack_require__(79); var _nodesShapesTriangleDown2 = _interopRequireDefault(_nodesShapesTriangleDown); - var _sharedValidator = __webpack_require__(47); + var _sharedValidator = __webpack_require__(46); var _sharedValidator2 = _interopRequireDefault(_sharedValidator); @@ -28953,7 +29373,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 63 */ +/* 62 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -29274,7 +29694,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 64 */ +/* 63 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -29293,7 +29713,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilNodeBase = __webpack_require__(65); + var _utilNodeBase = __webpack_require__(64); var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase); @@ -29363,20 +29783,19 @@ return /******/ (function(modules) { // webpackBootstrap this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; - this.boundingBox.left = this.left; - this.boundingBox.top = this.top; - this.boundingBox.bottom = this.top + this.height; - this.boundingBox.right = this.left + this.width; + var borderRadius = this.options.shapeProperties.borderRadius; // only effective for box + this.boundingBox.left = this.left - borderRadius; + this.boundingBox.top = this.top - borderRadius; + this.boundingBox.bottom = this.top + this.height + borderRadius; + this.boundingBox.right = this.left + this.width + borderRadius; } }, { key: 'distanceToBorder', value: function distanceToBorder(ctx, angle) { this.resize(ctx); - var a = this.width / 2; - var b = this.height / 2; - var w = Math.sin(angle) * a; - var h = Math.cos(angle) * b; - return a * b / Math.sqrt(w * w + h * h); + var borderWidth = this.options.borderWidth; + + return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth; } }]); @@ -29387,7 +29806,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 65 */ +/* 64 */ /***/ function(module, exports) { 'use strict'; @@ -29423,7 +29842,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: '_distanceToBorder', value: function _distanceToBorder(ctx, angle) { - var borderWidth = 1; + var borderWidth = this.options.borderWidth; this.resize(ctx); return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth; } @@ -29484,7 +29903,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 66 */ +/* 65 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -29503,7 +29922,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilCircleImageBase = __webpack_require__(67); + var _utilCircleImageBase = __webpack_require__(66); var _utilCircleImageBase2 = _interopRequireDefault(_utilCircleImageBase); @@ -29559,11 +29978,7 @@ return /******/ (function(modules) { // webpackBootstrap key: 'distanceToBorder', value: function distanceToBorder(ctx, angle) { this.resize(ctx); - var a = this.width / 2; - var b = this.height / 2; - var w = Math.sin(angle) * a; - var h = Math.cos(angle) * b; - return a * b / Math.sqrt(w * w + h * h); + return this.width * 0.5; } }]); @@ -29574,7 +29989,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 67 */ +/* 66 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -29593,7 +30008,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilNodeBase = __webpack_require__(65); + var _utilNodeBase = __webpack_require__(64); var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase); @@ -29745,7 +30160,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 68 */ +/* 67 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -29764,7 +30179,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilCircleImageBase = __webpack_require__(67); + var _utilCircleImageBase = __webpack_require__(66); var _utilCircleImageBase2 = _interopRequireDefault(_utilCircleImageBase); @@ -29809,10 +30224,10 @@ return /******/ (function(modules) { // webpackBootstrap var size = Math.min(0.5 * this.height, 0.5 * this.width); - // draw the backgroun circle. IMPORTANT: the stroke in this method is used by the clip method below. + // draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below. this._drawRawCircle(ctx, x, y, selected, hover, size); - // now we draw in the cicle, we save so we can revert the clip operation after drawing. + // now we draw in the circle, we save so we can revert the clip operation after drawing. ctx.save(); // clip is used to use the stroke in drawRawCircle as an area that we can draw in. ctx.clip(); @@ -29840,7 +30255,7 @@ return /******/ (function(modules) { // webpackBootstrap key: 'distanceToBorder', value: function distanceToBorder(ctx, angle) { this.resize(ctx); - return this._distanceToBorder(ctx, angle); + return this.width * 0.5; } }]); @@ -29851,7 +30266,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 69 */ +/* 68 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -29870,7 +30285,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilNodeBase = __webpack_require__(65); + var _utilNodeBase = __webpack_require__(64); var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase); @@ -29964,7 +30379,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 70 */ +/* 69 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -29983,7 +30398,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilShapeBase = __webpack_require__(71); + var _utilShapeBase = __webpack_require__(70); var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase); @@ -30020,7 +30435,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 71 */ +/* 70 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30039,7 +30454,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilNodeBase = __webpack_require__(65); + var _utilNodeBase = __webpack_require__(64); var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase); @@ -30126,7 +30541,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 72 */ +/* 71 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30145,7 +30560,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilShapeBase = __webpack_require__(71); + var _utilShapeBase = __webpack_require__(70); var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase); @@ -30183,7 +30598,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 73 */ +/* 72 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30202,7 +30617,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilNodeBase = __webpack_require__(65); + var _utilNodeBase = __webpack_require__(64); var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase); @@ -30299,7 +30714,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 74 */ +/* 73 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30318,7 +30733,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilNodeBase = __webpack_require__(65); + var _utilNodeBase = __webpack_require__(64); var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase); @@ -30414,7 +30829,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 75 */ +/* 74 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30433,7 +30848,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilCircleImageBase = __webpack_require__(67); + var _utilCircleImageBase = __webpack_require__(66); var _utilCircleImageBase2 = _interopRequireDefault(_utilCircleImageBase); @@ -30518,12 +30933,7 @@ return /******/ (function(modules) { // webpackBootstrap }, { key: 'distanceToBorder', value: function distanceToBorder(ctx, angle) { - this.resize(ctx); - var a = this.width / 2; - var b = this.height / 2; - var w = Math.sin(angle) * a; - var h = Math.cos(angle) * b; - return a * b / Math.sqrt(w * w + h * h); + return this._distanceToBorder(ctx, angle); } }]); @@ -30534,7 +30944,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 76 */ +/* 75 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30553,7 +30963,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilShapeBase = __webpack_require__(71); + var _utilShapeBase = __webpack_require__(70); var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase); @@ -30590,7 +31000,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 77 */ +/* 76 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30609,7 +31019,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilShapeBase = __webpack_require__(71); + var _utilShapeBase = __webpack_require__(70); var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase); @@ -30646,7 +31056,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 78 */ +/* 77 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30665,7 +31075,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilNodeBase = __webpack_require__(65); + var _utilNodeBase = __webpack_require__(64); var _utilNodeBase2 = _interopRequireDefault(_utilNodeBase); @@ -30732,7 +31142,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 79 */ +/* 78 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30751,7 +31161,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilShapeBase = __webpack_require__(71); + var _utilShapeBase = __webpack_require__(70); var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase); @@ -30788,7 +31198,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 80 */ +/* 79 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30807,7 +31217,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilShapeBase = __webpack_require__(71); + var _utilShapeBase = __webpack_require__(70); var _utilShapeBase2 = _interopRequireDefault(_utilShapeBase); @@ -30844,7 +31254,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 81 */ +/* 80 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -30859,11 +31269,11 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _componentsEdge = __webpack_require__(82); + var _componentsEdge = __webpack_require__(81); var _componentsEdge2 = _interopRequireDefault(_componentsEdge); - var _componentsSharedLabel = __webpack_require__(63); + var _componentsSharedLabel = __webpack_require__(62); var _componentsSharedLabel2 = _interopRequireDefault(_componentsSharedLabel); @@ -31281,7 +31691,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 82 */ +/* 81 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -31296,23 +31706,23 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _sharedLabel = __webpack_require__(63); + var _sharedLabel = __webpack_require__(62); var _sharedLabel2 = _interopRequireDefault(_sharedLabel); - var _edgesCubicBezierEdge = __webpack_require__(83); + var _edgesCubicBezierEdge = __webpack_require__(82); var _edgesCubicBezierEdge2 = _interopRequireDefault(_edgesCubicBezierEdge); - var _edgesBezierEdgeDynamic = __webpack_require__(87); + var _edgesBezierEdgeDynamic = __webpack_require__(86); var _edgesBezierEdgeDynamic2 = _interopRequireDefault(_edgesBezierEdgeDynamic); - var _edgesBezierEdgeStatic = __webpack_require__(88); + var _edgesBezierEdgeStatic = __webpack_require__(87); var _edgesBezierEdgeStatic2 = _interopRequireDefault(_edgesBezierEdgeStatic); - var _edgesStraightEdge = __webpack_require__(89); + var _edgesStraightEdge = __webpack_require__(88); var _edgesStraightEdge2 = _interopRequireDefault(_edgesStraightEdge); @@ -31857,7 +32267,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 83 */ +/* 82 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -31878,7 +32288,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilCubicBezierEdgeBase = __webpack_require__(84); + var _utilCubicBezierEdgeBase = __webpack_require__(83); var _utilCubicBezierEdgeBase2 = _interopRequireDefault(_utilCubicBezierEdgeBase); @@ -32010,7 +32420,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 84 */ +/* 83 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32029,7 +32439,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _BezierEdgeBase2 = __webpack_require__(85); + var _BezierEdgeBase2 = __webpack_require__(84); var _BezierEdgeBase3 = _interopRequireDefault(_BezierEdgeBase2); @@ -32096,7 +32506,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 85 */ +/* 84 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32115,7 +32525,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _EdgeBase2 = __webpack_require__(86); + var _EdgeBase2 = __webpack_require__(85); var _EdgeBase3 = _interopRequireDefault(_EdgeBase2); @@ -32239,7 +32649,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 86 */ +/* 85 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -32828,7 +33238,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 87 */ +/* 86 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -32847,7 +33257,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilBezierEdgeBase = __webpack_require__(85); + var _utilBezierEdgeBase = __webpack_require__(84); var _utilBezierEdgeBase2 = _interopRequireDefault(_utilBezierEdgeBase); @@ -33016,7 +33426,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 88 */ +/* 87 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33035,7 +33445,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilBezierEdgeBase = __webpack_require__(85); + var _utilBezierEdgeBase = __webpack_require__(84); var _utilBezierEdgeBase2 = _interopRequireDefault(_utilBezierEdgeBase); @@ -33275,7 +33685,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 89 */ +/* 88 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33294,7 +33704,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _utilEdgeBase = __webpack_require__(86); + var _utilEdgeBase = __webpack_require__(85); var _utilEdgeBase2 = _interopRequireDefault(_utilEdgeBase); @@ -33380,7 +33790,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 90 */ +/* 89 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -33395,35 +33805,35 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _componentsPhysicsBarnesHutSolver = __webpack_require__(91); + var _componentsPhysicsBarnesHutSolver = __webpack_require__(90); var _componentsPhysicsBarnesHutSolver2 = _interopRequireDefault(_componentsPhysicsBarnesHutSolver); - var _componentsPhysicsRepulsionSolver = __webpack_require__(92); + var _componentsPhysicsRepulsionSolver = __webpack_require__(91); var _componentsPhysicsRepulsionSolver2 = _interopRequireDefault(_componentsPhysicsRepulsionSolver); - var _componentsPhysicsHierarchicalRepulsionSolver = __webpack_require__(93); + var _componentsPhysicsHierarchicalRepulsionSolver = __webpack_require__(92); var _componentsPhysicsHierarchicalRepulsionSolver2 = _interopRequireDefault(_componentsPhysicsHierarchicalRepulsionSolver); - var _componentsPhysicsSpringSolver = __webpack_require__(94); + var _componentsPhysicsSpringSolver = __webpack_require__(93); var _componentsPhysicsSpringSolver2 = _interopRequireDefault(_componentsPhysicsSpringSolver); - var _componentsPhysicsHierarchicalSpringSolver = __webpack_require__(95); + var _componentsPhysicsHierarchicalSpringSolver = __webpack_require__(94); var _componentsPhysicsHierarchicalSpringSolver2 = _interopRequireDefault(_componentsPhysicsHierarchicalSpringSolver); - var _componentsPhysicsCentralGravitySolver = __webpack_require__(96); + var _componentsPhysicsCentralGravitySolver = __webpack_require__(95); var _componentsPhysicsCentralGravitySolver2 = _interopRequireDefault(_componentsPhysicsCentralGravitySolver); - var _componentsPhysicsFA2BasedRepulsionSolver = __webpack_require__(97); + var _componentsPhysicsFA2BasedRepulsionSolver = __webpack_require__(96); var _componentsPhysicsFA2BasedRepulsionSolver2 = _interopRequireDefault(_componentsPhysicsFA2BasedRepulsionSolver); - var _componentsPhysicsFA2BasedCentralGravitySolver = __webpack_require__(98); + var _componentsPhysicsFA2BasedCentralGravitySolver = __webpack_require__(97); var _componentsPhysicsFA2BasedCentralGravitySolver2 = _interopRequireDefault(_componentsPhysicsFA2BasedCentralGravitySolver); @@ -34183,7 +34593,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 91 */ +/* 90 */ /***/ function(module, exports) { "use strict"; @@ -34225,7 +34635,7 @@ return /******/ (function(modules) { // webpackBootstrap } /** - * This function calculates the forces the nodes apply on eachother based on a gravitational model. + * This function calculates the forces the nodes apply on each other based on a gravitational model. * The Barnes Hut method is used to speed up this N-body simulation. * * @private @@ -34685,7 +35095,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 92 */ +/* 91 */ /***/ function(module, exports) { "use strict"; @@ -34780,7 +35190,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 93 */ +/* 92 */ /***/ function(module, exports) { "use strict"; @@ -34871,7 +35281,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 94 */ +/* 93 */ /***/ function(module, exports) { "use strict"; @@ -34981,7 +35391,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 95 */ +/* 94 */ /***/ function(module, exports) { "use strict"; @@ -35110,7 +35520,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 96 */ +/* 95 */ /***/ function(module, exports) { "use strict"; @@ -35179,7 +35589,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 97 */ +/* 96 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -35198,7 +35608,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _BarnesHutSolver2 = __webpack_require__(91); + var _BarnesHutSolver2 = __webpack_require__(90); var _BarnesHutSolver3 = _interopRequireDefault(_BarnesHutSolver2); @@ -35253,7 +35663,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 98 */ +/* 97 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -35272,7 +35682,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _CentralGravitySolver2 = __webpack_require__(96); + var _CentralGravitySolver2 = __webpack_require__(95); var _CentralGravitySolver3 = _interopRequireDefault(_CentralGravitySolver2); @@ -35309,7 +35719,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 99 */ +/* 98 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -35324,11 +35734,11 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _NetworkUtil = __webpack_require__(100); + var _NetworkUtil = __webpack_require__(99); var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); - var _componentsNodesCluster = __webpack_require__(101); + var _componentsNodesCluster = __webpack_require__(100); var _componentsNodesCluster2 = _interopRequireDefault(_componentsNodesCluster); @@ -36143,7 +36553,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 100 */ +/* 99 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -36282,7 +36692,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 101 */ +/* 100 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -36299,7 +36709,7 @@ return /******/ (function(modules) { // webpackBootstrap function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - var _Node2 = __webpack_require__(62); + var _Node2 = __webpack_require__(61); var _Node3 = _interopRequireDefault(_Node2); @@ -36327,7 +36737,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 102 */ +/* 101 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -36718,7 +37128,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 103 */ +/* 102 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -36732,7 +37142,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var Hammer = __webpack_require__(20); - var hammerUtil = __webpack_require__(25); + var hammerUtil = __webpack_require__(24); var util = __webpack_require__(1); @@ -37153,7 +37563,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 104 */ +/* 103 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -37168,7 +37578,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _NetworkUtil = __webpack_require__(100); + var _NetworkUtil = __webpack_require__(99); var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); @@ -37498,7 +37908,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 105 */ +/* 104 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -37513,11 +37923,11 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _componentsNavigationHandler = __webpack_require__(106); + var _componentsNavigationHandler = __webpack_require__(105); var _componentsNavigationHandler2 = _interopRequireDefault(_componentsNavigationHandler); - var _componentsPopup = __webpack_require__(107); + var _componentsPopup = __webpack_require__(106); var _componentsPopup2 = _interopRequireDefault(_componentsPopup); @@ -38268,7 +38678,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 106 */ +/* 105 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -38283,8 +38693,8 @@ return /******/ (function(modules) { // webpackBootstrap var util = __webpack_require__(1); var Hammer = __webpack_require__(20); - var hammerUtil = __webpack_require__(25); - var keycharm = __webpack_require__(41); + var hammerUtil = __webpack_require__(24); + var keycharm = __webpack_require__(40); var NavigationHandler = (function () { function NavigationHandler(body, canvas) { @@ -38594,7 +39004,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 107 */ +/* 106 */ /***/ function(module, exports) { /** @@ -38720,7 +39130,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 108 */ +/* 107 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -38733,8 +39143,8 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var Node = __webpack_require__(62); - var Edge = __webpack_require__(82); + var Node = __webpack_require__(61); + var Edge = __webpack_require__(81); var util = __webpack_require__(1); var SelectionHandler = (function () { @@ -39476,7 +39886,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 109 */ +/* 108 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -39491,7 +39901,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _NetworkUtil = __webpack_require__(100); + var _NetworkUtil = __webpack_require__(99); var _NetworkUtil2 = _interopRequireDefault(_NetworkUtil); @@ -40347,7 +40757,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 110 */ +/* 109 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -40362,7 +40772,7 @@ return /******/ (function(modules) { // webpackBootstrap var util = __webpack_require__(1); var Hammer = __webpack_require__(20); - var hammerUtil = __webpack_require__(25); + var hammerUtil = __webpack_require__(24); /** * clears the toolbar div element of children @@ -41556,7 +41966,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 111 */ +/* 110 */ /***/ function(module, exports) { /** @@ -42057,7 +42467,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.configureOptions = configureOptions; /***/ }, -/* 112 */ +/* 111 */ /***/ function(module, exports, __webpack_require__) { /** @@ -42079,7 +42489,7 @@ return /******/ (function(modules) { // webpackBootstrap function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var _componentsAlgorithmsFloydWarshallJs = __webpack_require__(113); + var _componentsAlgorithmsFloydWarshallJs = __webpack_require__(112); var _componentsAlgorithmsFloydWarshallJs2 = _interopRequireDefault(_componentsAlgorithmsFloydWarshallJs); @@ -42346,7 +42756,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 113 */ +/* 112 */ /***/ function(module, exports) { /** @@ -42417,7 +42827,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 114 */ +/* 113 */ /***/ function(module, exports) { /** @@ -42704,7 +43114,7 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }, -/* 115 */ +/* 114 */ /***/ function(module, exports) { /** @@ -43602,7 +44012,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.DOTToGraph = DOTToGraph; /***/ }, -/* 116 */ +/* 115 */ /***/ function(module, exports) { 'use strict'; @@ -43680,7 +44090,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.parseGephi = parseGephi; /***/ }, -/* 117 */ +/* 116 */ /***/ function(module, exports) { /** @@ -43806,7 +44216,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 118 */ +/* 117 */ /***/ function(module, exports) { // English diff --git a/lib/network/modules/components/nodes/shapes/Box.js b/lib/network/modules/components/nodes/shapes/Box.js index 85abddcc..f03b02a8 100644 --- a/lib/network/modules/components/nodes/shapes/Box.js +++ b/lib/network/modules/components/nodes/shapes/Box.js @@ -60,19 +60,20 @@ class Box extends NodeBase { this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; - this.boundingBox.left = this.left; - this.boundingBox.top = this.top; - this.boundingBox.bottom = this.top + this.height; - this.boundingBox.right = this.left + this.width; + let borderRadius = this.options.shapeProperties.borderRadius; // only effective for box + this.boundingBox.left = this.left - borderRadius; + this.boundingBox.top = this.top - borderRadius; + this.boundingBox.bottom = this.top + this.height + borderRadius; + this.boundingBox.right = this.left + this.width + borderRadius; } distanceToBorder(ctx, angle) { this.resize(ctx); - let a = this.width / 2; - let b = this.height / 2; - let w = (Math.sin(angle) * a); - let h = (Math.cos(angle) * b); - return a * b / Math.sqrt(w * w + h * h); + let borderWidth = this.options.borderWidth; + + return Math.min( + Math.abs((this.width) / 2 / Math.cos(angle)), + Math.abs((this.height) / 2 / Math.sin(angle))) + borderWidth; } } diff --git a/lib/network/modules/components/nodes/shapes/Circle.js b/lib/network/modules/components/nodes/shapes/Circle.js index 3bfb828f..221e92df 100644 --- a/lib/network/modules/components/nodes/shapes/Circle.js +++ b/lib/network/modules/components/nodes/shapes/Circle.js @@ -45,11 +45,7 @@ class Circle extends CircleImageBase { distanceToBorder(ctx, angle) { this.resize(ctx); - var a = this.width / 2; - var b = this.height / 2; - var w = (Math.sin(angle) * a); - var h = (Math.cos(angle) * b); - return a * b / Math.sqrt(w * w + h * h); + return this.width * 0.5; } } diff --git a/lib/network/modules/components/nodes/shapes/CircularImage.js b/lib/network/modules/components/nodes/shapes/CircularImage.js index 494b9ac8..7d04b3f5 100644 --- a/lib/network/modules/components/nodes/shapes/CircularImage.js +++ b/lib/network/modules/components/nodes/shapes/CircularImage.js @@ -38,10 +38,10 @@ class CircularImage extends CircleImageBase { let size = Math.min(0.5*this.height, 0.5*this.width); - // draw the backgroun circle. IMPORTANT: the stroke in this method is used by the clip method below. + // draw the background circle. IMPORTANT: the stroke in this method is used by the clip method below. this._drawRawCircle(ctx, x, y, selected, hover, size); - // now we draw in the cicle, we save so we can revert the clip operation after drawing. + // now we draw in the circle, we save so we can revert the clip operation after drawing. ctx.save(); // clip is used to use the stroke in drawRawCircle as an area that we can draw in. ctx.clip(); @@ -68,7 +68,7 @@ class CircularImage extends CircleImageBase { distanceToBorder(ctx, angle) { this.resize(ctx); - return this._distanceToBorder(ctx,angle); + return this.width * 0.5; } } diff --git a/lib/network/modules/components/nodes/shapes/Image.js b/lib/network/modules/components/nodes/shapes/Image.js index 55419221..4d812c0f 100644 --- a/lib/network/modules/components/nodes/shapes/Image.js +++ b/lib/network/modules/components/nodes/shapes/Image.js @@ -77,12 +77,7 @@ class Image extends CircleImageBase { } distanceToBorder(ctx, angle) { - this.resize(ctx); - var a = this.width / 2; - var b = this.height / 2; - var w = (Math.sin(angle) * a); - var h = (Math.cos(angle) * b); - return a * b / Math.sqrt(w * w + h * h); + return this._distanceToBorder(ctx,angle); } } diff --git a/lib/network/modules/components/nodes/util/NodeBase.js b/lib/network/modules/components/nodes/util/NodeBase.js index a497a989..05868bc0 100644 --- a/lib/network/modules/components/nodes/util/NodeBase.js +++ b/lib/network/modules/components/nodes/util/NodeBase.js @@ -16,7 +16,7 @@ class NodeBase { } _distanceToBorder(ctx,angle) { - var borderWidth = 1; + var borderWidth = this.options.borderWidth; this.resize(ctx); return Math.min( Math.abs(this.width / 2 / Math.cos(angle)), diff --git a/lib/network/modules/components/physics/BarnesHutSolver.js b/lib/network/modules/components/physics/BarnesHutSolver.js index 340addc0..2c514e20 100644 --- a/lib/network/modules/components/physics/BarnesHutSolver.js +++ b/lib/network/modules/components/physics/BarnesHutSolver.js @@ -24,7 +24,7 @@ class BarnesHutSolver { /** - * This function calculates the forces the nodes apply on eachother based on a gravitational model. + * This function calculates the forces the nodes apply on each other based on a gravitational model. * The Barnes Hut method is used to speed up this N-body simulation. * * @private