Browse Source

updated builds, history

v3_develop
Alex de Mulder 9 years ago
parent
commit
104079f305
4 changed files with 203 additions and 159 deletions
  1. +3
    -0
      HISTORY.md
  2. +184
    -143
      dist/vis.js
  3. +1
    -1
      dist/vis.map
  4. +15
    -15
      dist/vis.min.js

+ 3
- 0
HISTORY.md View File

@ -13,11 +13,14 @@ http://visjs.org
### Graph2D ### Graph2D
- Added alignZeros option to dataAxis with default value true. - Added alignZeros option to dataAxis with default value true.
- Fixed bug with points drawn on bargraphs
- Fixed docs
### Network ### Network
- dragEnd event now does not give the selected nodes if only the viewport has been dragged #453 - dragEnd event now does not give the selected nodes if only the viewport has been dragged #453
- merged high DPI fix by @crubier, thanks!
## 2014-11-14, version 3.7.0 ## 2014-11-14, version 3.7.0

+ 184
- 143
dist/vis.js View File

@ -4,8 +4,8 @@
* *
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 3.7.0
* @date 2014-11-21
* @version 3.7.1-SNAPSHOT
* @date 2014-11-25
* *
* @license * @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com * Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -7475,7 +7475,7 @@ return /******/ (function(modules) { // webpackBootstrap
* @param {Date} [end] The end date * @param {Date} [end] The end date
* @param {Number} [minimumStep] Optional. Minimum step size in milliseconds * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
*/ */
function DataStep(start, end, minimumStep, containerHeight, customRange) {
function DataStep(start, end, minimumStep, containerHeight, customRange, alignZeros) {
// variables // variables
this.current = 0; this.current = 0;
@ -7491,6 +7491,8 @@ return /******/ (function(modules) { // webpackBootstrap
this.majorSteps = [1, 2, 5, 10]; this.majorSteps = [1, 2, 5, 10];
this.minorSteps = [0.25, 0.5, 1, 2]; this.minorSteps = [0.25, 0.5, 1, 2];
this.alignZeros = alignZeros;
this.setRange(start, end, minimumStep, containerHeight, customRange); this.setRange(start, end, minimumStep, containerHeight, customRange);
} }
@ -7515,9 +7517,10 @@ return /******/ (function(modules) { // webpackBootstrap
this._end += 1; this._end += 1;
} }
if (this.autoScale) {
if (this.autoScale == true) {
this.setMinimumStep(minimumStep, containerHeight); this.setMinimumStep(minimumStep, containerHeight);
} }
this.setFirst(customRange); this.setFirst(customRange);
}; };
@ -7570,16 +7573,23 @@ return /******/ (function(modules) { // webpackBootstrap
if (customRange === undefined) { if (customRange === undefined) {
customRange = {}; customRange = {};
} }
var niceStart = customRange.min === undefined ? this._start - (this.scale * 2 * this.minorSteps[this.stepIndex]) : customRange.min; var niceStart = customRange.min === undefined ? this._start - (this.scale * 2 * this.minorSteps[this.stepIndex]) : customRange.min;
var niceEnd = customRange.max === undefined ? this._end + (this.scale * this.minorSteps[this.stepIndex]) : customRange.max; var niceEnd = customRange.max === undefined ? this._end + (this.scale * this.minorSteps[this.stepIndex]) : customRange.max;
this.marginEnd = customRange.max === undefined ? this.roundToMinor(niceEnd) : customRange.max; this.marginEnd = customRange.max === undefined ? this.roundToMinor(niceEnd) : customRange.max;
this.marginStart = customRange.min === undefined ? this.roundToMinor(niceStart) : customRange.min; this.marginStart = customRange.min === undefined ? this.roundToMinor(niceStart) : customRange.min;
// if we need to align the zero's we need to make sure that there is a zero to use.
if (this.alignZeros == true && (this.marginEnd - this.marginStart) % this.step != 0) {
this.marginEnd += this.marginEnd % this.step;
}
this.deadSpace = this.roundToMinor(niceEnd) - niceEnd + this.roundToMinor(niceStart) - niceStart; this.deadSpace = this.roundToMinor(niceEnd) - niceEnd + this.roundToMinor(niceStart) - niceStart;
this.marginRange = this.marginEnd - this.marginStart; this.marginRange = this.marginEnd - this.marginStart;
this.current = this.marginEnd;
this.current = this.marginEnd;
}; };
DataStep.prototype.roundToMinor = function(value) { DataStep.prototype.roundToMinor = function(value) {
@ -8004,8 +8014,8 @@ return /******/ (function(modules) { // webpackBootstrap
var changed = (this.start != newStart || this.end != newEnd); var changed = (this.start != newStart || this.end != newEnd);
// if the new range does NOT overlap with the old range, emit checkRangedItems to avoid not showing ranged items (ranged meaning has end time, not neccesarily of type Range) // if the new range does NOT overlap with the old range, emit checkRangedItems to avoid not showing ranged items (ranged meaning has end time, not neccesarily of type Range)
if (!((newStart >= this.start && newStart <= this.start) || (newEnd >= this.start && newEnd <= this.end)) &&
!((this.start >= newStart && this.start <= newEnd) || (this.end >= newStart && this.end <= newEnd) )) {
if (!((newStart >= this.start && newStart <= this.end) || (newEnd >= this.start && newEnd <= this.end)) &&
!((this.start >= newStart && this.start <= newEnd) || (this.end >= newStart && this.end <= newEnd) )) {
this.body.emitter.emit('checkRangedItems'); this.body.emitter.emit('checkRangedItems');
} }
@ -9519,6 +9529,7 @@ return /******/ (function(modules) { // webpackBootstrap
iconWidth: 20, iconWidth: 20,
width: '40px', width: '40px',
visible: true, visible: true,
alignZeros: true,
customRange: { customRange: {
left: {min:undefined, max:undefined}, left: {min:undefined, max:undefined},
right: {min:undefined, max:undefined} right: {min:undefined, max:undefined}
@ -9556,6 +9567,8 @@ return /******/ (function(modules) { // webpackBootstrap
this.stepPixels = 25; this.stepPixels = 25;
this.stepPixelsForced = 25; this.stepPixelsForced = 25;
this.zeroCrossing = -1;
this.lineOffset = 0; this.lineOffset = 0;
this.master = true; this.master = true;
this.svgElements = {}; this.svgElements = {};
@ -9617,7 +9630,8 @@ return /******/ (function(modules) { // webpackBootstrap
'visible', 'visible',
'customRange', 'customRange',
'title', 'title',
'format'
'format',
'alignZeros'
]; ];
util.selectiveExtend(fields, this.options, options); util.selectiveExtend(fields, this.options, options);
@ -9729,6 +9743,11 @@ return /******/ (function(modules) { // webpackBootstrap
* @param end * @param end
*/ */
DataAxis.prototype.setRange = function (start, end) { DataAxis.prototype.setRange = function (start, end) {
if (this.master == false && this.options.alignZeros == true && this.zeroCrossing != -1) {
if (start > 0) {
start = 0;
}
}
this.range.start = start; this.range.start = start;
this.range.end = end; this.range.end = end;
}; };
@ -9826,16 +9845,26 @@ return /******/ (function(modules) { // webpackBootstrap
// calculate range and step (step such that we have space for 7 characters per label) // calculate range and step (step such that we have space for 7 characters per label)
var minimumStep = this.master ? this.props.majorCharHeight || 10 : this.stepPixelsForced; var minimumStep = this.master ? this.props.majorCharHeight || 10 : this.stepPixelsForced;
var step = new DataStep(this.range.start, this.range.end, minimumStep, this.dom.frame.offsetHeight, this.options.customRange[this.options.orientation]);
var step = new DataStep(
this.range.start,
this.range.end,
minimumStep,
this.dom.frame.offsetHeight,
this.options.customRange[this.options.orientation],
this.master == false && this.options.alignZeros // doess the step have to align zeros? only if not master and the options is on
);
this.step = step; this.step = step;
// get the distance in pixels for a step // get the distance in pixels for a step
// dead space is space that is "left over" after a step // dead space is space that is "left over" after a step
var stepPixels = (this.dom.frame.offsetHeight - (step.deadSpace * (this.dom.frame.offsetHeight / step.marginRange))) / (((step.marginRange - step.deadSpace) / step.step)); var stepPixels = (this.dom.frame.offsetHeight - (step.deadSpace * (this.dom.frame.offsetHeight / step.marginRange))) / (((step.marginRange - step.deadSpace) / step.step));
this.stepPixels = stepPixels; this.stepPixels = stepPixels;
var amountOfSteps = this.height / stepPixels; var amountOfSteps = this.height / stepPixels;
var stepDifference = 0; var stepDifference = 0;
// the slave axis needs to use the same horizontal lines as the master axis.
if (this.master == false) { if (this.master == false) {
stepPixels = this.stepPixelsForced; stepPixels = this.stepPixelsForced;
stepDifference = Math.round((this.dom.frame.offsetHeight / stepPixels) - amountOfSteps); stepDifference = Math.round((this.dom.frame.offsetHeight / stepPixels) - amountOfSteps);
@ -9843,6 +9872,16 @@ return /******/ (function(modules) { // webpackBootstrap
step.previous(); step.previous();
} }
amountOfSteps = this.height / stepPixels; amountOfSteps = this.height / stepPixels;
if (this.zeroCrossing != -1 && this.options.alignZeros == true) {
var zeroStepDifference = (step.marginEnd / step.step) - this.zeroCrossing;
if (zeroStepDifference > 0) {
for (var i = 0; i < zeroStepDifference; i++) {step.next();}
}
else if (zeroStepDifference < 0) {
for (var i = 0; i < -zeroStepDifference; i++) {step.previous();}
}
}
} }
else { else {
amountOfSteps += 0.25; amountOfSteps += 0.25;
@ -9884,6 +9923,10 @@ return /******/ (function(modules) { // webpackBootstrap
this._redrawLine(y, orientation, 'grid horizontal minor', this.options.minorLinesOffset, this.props.minorLineWidth); this._redrawLine(y, orientation, 'grid horizontal minor', this.options.minorLinesOffset, this.props.minorLineWidth);
} }
if (this.master == true && step.current == 0) {
this.zeroCrossing = max;
}
max++; max++;
} }
@ -10036,7 +10079,7 @@ return /******/ (function(modules) { // webpackBootstrap
// determine the char width and height on the minor axis // determine the char width and height on the minor axis
if (!('minorCharHeight' in this.props)) { if (!('minorCharHeight' in this.props)) {
var textMinor = document.createTextNode('0'); var textMinor = document.createTextNode('0');
var measureCharMinor = document.createElement('DIV');
var measureCharMinor = document.createElement('div');
measureCharMinor.className = 'yAxis minor measure'; measureCharMinor.className = 'yAxis minor measure';
measureCharMinor.appendChild(textMinor); measureCharMinor.appendChild(textMinor);
this.dom.frame.appendChild(measureCharMinor); this.dom.frame.appendChild(measureCharMinor);
@ -10049,7 +10092,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (!('majorCharHeight' in this.props)) { if (!('majorCharHeight' in this.props)) {
var textMajor = document.createTextNode('0'); var textMajor = document.createTextNode('0');
var measureCharMajor = document.createElement('DIV');
var measureCharMajor = document.createElement('div');
measureCharMajor.className = 'yAxis major measure'; measureCharMajor.className = 'yAxis major measure';
measureCharMajor.appendChild(textMajor); measureCharMajor.appendChild(textMajor);
this.dom.frame.appendChild(measureCharMajor); this.dom.frame.appendChild(measureCharMajor);
@ -10062,7 +10105,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (!('titleCharHeight' in this.props)) { if (!('titleCharHeight' in this.props)) {
var textTitle = document.createTextNode('0'); var textTitle = document.createTextNode('0');
var measureCharTitle = document.createElement('DIV');
var measureCharTitle = document.createElement('div');
measureCharTitle.className = 'yAxis title measure'; measureCharTitle.className = 'yAxis title measure';
measureCharTitle.appendChild(textTitle); measureCharTitle.appendChild(textTitle);
this.dom.frame.appendChild(measureCharTitle); this.dom.frame.appendChild(measureCharTitle);
@ -12254,7 +12297,7 @@ return /******/ (function(modules) { // webpackBootstrap
// except when old selection is empty and new selection is still empty // except when old selection is empty and new selection is still empty
if (newSelection.length > 0 || oldSelection.length > 0) { if (newSelection.length > 0 || oldSelection.length > 0) {
this.body.emitter.emit('select', { this.body.emitter.emit('select', {
items: this.getSelection()
items: newSelection
}); });
} }
}; };
@ -12279,7 +12322,7 @@ return /******/ (function(modules) { // webpackBootstrap
var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset var itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset
this.options.onUpdate(itemData, function (itemData) { this.options.onUpdate(itemData, function (itemData) {
if (itemData) { if (itemData) {
me.itemsData.update(itemData);
me.itemsData.getDataSet().update(itemData);
} }
}); });
} }
@ -12309,7 +12352,7 @@ return /******/ (function(modules) { // webpackBootstrap
// execute async handler to customize (or cancel) adding an item // execute async handler to customize (or cancel) adding an item
this.options.onAdd(newItem, function (item) { this.options.onAdd(newItem, function (item) {
if (item) { if (item) {
me.itemsData.add(item);
me.itemsData.getDataSet().add(item);
// TODO: need to trigger a redraw? // TODO: need to trigger a redraw?
} }
}); });
@ -12330,15 +12373,42 @@ return /******/ (function(modules) { // webpackBootstrap
if (item) { if (item) {
// multi select items // multi select items
selection = this.getSelection(); // current selection selection = this.getSelection(); // current selection
var index = selection.indexOf(item.id);
if (index == -1) {
// item is not yet selected -> select it
var shiftKey = event.gesture.touches[0] && event.gesture.touches[0].shiftKey || false;
if (shiftKey) {
// select all items between the old selection and the tapped item
// determine the selection range
selection.push(item.id); selection.push(item.id);
var range = ItemSet._getItemRange(this.itemsData.get(selection, this.itemOptions));
// select all items within the selection range
selection = [];
for (var id in this.items) {
if (this.items.hasOwnProperty(id)) {
var _item = this.items[id];
var start = _item.data.start;
var end = (_item.data.end !== undefined) ? _item.data.end : start;
if (start >= range.min && end <= range.max) {
selection.push(_item.id); // do not use id but item.id, id itself is stringified
}
}
}
} }
else { else {
// item is already selected -> deselect it
selection.splice(index, 1);
// add/remove this item from the current selection
var index = selection.indexOf(item.id);
if (index == -1) {
// item is not yet selected -> select it
selection.push(item.id);
}
else {
// item is already selected -> deselect it
selection.splice(index, 1);
}
} }
this.setSelection(selection); this.setSelection(selection);
this.body.emitter.emit('select', { this.body.emitter.emit('select', {
@ -12347,6 +12417,39 @@ return /******/ (function(modules) { // webpackBootstrap
} }
}; };
/**
* Calculate the time range of a list of items
* @param {Array.<Object>} itemsData
* @return {{min: Date, max: Date}} Returns the range of the provided items
* @private
*/
ItemSet._getItemRange = function(itemsData) {
var max = null;
var min = null;
itemsData.forEach(function (data) {
if (min == null || data.start < min) {
min = data.start;
}
if (data.end != undefined) {
if (max == null || data.end > max) {
max = data.end;
}
}
else {
if (max == null || data.start > max) {
max = data.start;
}
}
});
return {
min: min,
max: max
}
};
/** /**
* Find an item from an event target: * Find an item from an event target:
* searches for the attribute 'timeline-item' in the event target's element tree * searches for the attribute 'timeline-item' in the event target's element tree
@ -12673,6 +12776,7 @@ return /******/ (function(modules) { // webpackBootstrap
icons: false, icons: false,
width: '40px', width: '40px',
visible: true, visible: true,
alignZeros: true,
customRange: { customRange: {
left: {min:undefined, max:undefined}, left: {min:undefined, max:undefined},
right: {min:undefined, max:undefined} right: {min:undefined, max:undefined}
@ -13474,6 +13578,7 @@ return /******/ (function(modules) { // webpackBootstrap
changeCalled = this.yAxisLeft.redraw() || changeCalled; changeCalled = this.yAxisLeft.redraw() || changeCalled;
this.yAxisRight.stepPixelsForced = this.yAxisLeft.stepPixels; this.yAxisRight.stepPixelsForced = this.yAxisLeft.stepPixels;
this.yAxisRight.zeroCrossing = this.yAxisLeft.zeroCrossing;
changeCalled = this.yAxisRight.redraw() || changeCalled; changeCalled = this.yAxisRight.redraw() || changeCalled;
} }
else { else {
@ -15385,7 +15490,6 @@ return /******/ (function(modules) { // webpackBootstrap
type: "continuous", type: "continuous",
roundness: 0.5 roundness: 0.5
}, },
dynamicSmoothCurves: true,
maxVelocity: 30, maxVelocity: 30,
minVelocity: 0.1, // px/s minVelocity: 0.1, // px/s
stabilize: true, // stabilize before displaying the network stabilize: true, // stabilize before displaying the network
@ -15469,6 +15573,7 @@ return /******/ (function(modules) { // webpackBootstrap
this.startedStabilization = false; this.startedStabilization = false;
this.stabilized = false; this.stabilized = false;
this.stabilizationIterations = null; this.stabilizationIterations = null;
this.draggingNodes = false;
// containers for nodes and edges // containers for nodes and edges
this.calculationNodes = {}; this.calculationNodes = {};
@ -15767,9 +15872,10 @@ return /******/ (function(modules) { // webpackBootstrap
if (options) { if (options) {
var prop; var prop;
var fields = ['nodes','edges','smoothCurves','hierarchicalLayout','clustering','navigation','keyboard','dataManipulation',
'onAdd','onEdit','onEditEdge','onConnect','onDelete','clickToUse'
var fields = ['nodes','edges','smoothCurves','hierarchicalLayout','clustering','navigation',
'keyboard','dataManipulation','onAdd','onEdit','onEditEdge','onConnect','onDelete','clickToUse'
]; ];
// extend all but the values in fields
util.selectiveNotDeepExtend(fields,this.constants, options); util.selectiveNotDeepExtend(fields,this.constants, options);
util.selectiveNotDeepExtend(['color'],this.constants.nodes, options.nodes); util.selectiveNotDeepExtend(['color'],this.constants.nodes, options.nodes);
util.selectiveNotDeepExtend(['color','length'],this.constants.edges, options.edges); util.selectiveNotDeepExtend(['color','length'],this.constants.edges, options.edges);
@ -16081,8 +16187,10 @@ return /******/ (function(modules) { // webpackBootstrap
drag.selection = []; drag.selection = [];
drag.translation = this._getTranslation(); drag.translation = this._getTranslation();
drag.nodeId = null; drag.nodeId = null;
this.draggingNodes = false;
if (node != null && this.constants.dragNodes == true) { if (node != null && this.constants.dragNodes == true) {
this.draggingNodes = true;
drag.nodeId = node.id; drag.nodeId = node.id;
// select the clicked node if not yet selected // select the clicked node if not yet selected
if (!node.isSelected()) { if (!node.isSelected()) {
@ -16209,7 +16317,13 @@ return /******/ (function(modules) { // webpackBootstrap
else { else {
this._redraw(); this._redraw();
} }
this.emit("dragEnd",{nodeIds:this.getSelection().nodes});
if (this.draggingNodes == false) {
this.emit("dragEnd",{nodeIds:[]});
}
else {
this.emit("dragEnd",{nodeIds:this.getSelection().nodes});
}
} }
/** /**
* handle tap/click event: select/unselect a node * handle tap/click event: select/unselect a node
@ -21215,9 +21329,6 @@ return /******/ (function(modules) { // webpackBootstrap
var DataSet = __webpack_require__(3); var DataSet = __webpack_require__(3);
var DataView = __webpack_require__(4); var DataView = __webpack_require__(4);
var Range = __webpack_require__(17); var Range = __webpack_require__(17);
var TimeAxis = __webpack_require__(30);
var CurrentTime = __webpack_require__(21);
var CustomTime = __webpack_require__(22);
var ItemSet = __webpack_require__(27); var ItemSet = __webpack_require__(27);
var Activator = __webpack_require__(55); var Activator = __webpack_require__(55);
var DateUtil = __webpack_require__(15); var DateUtil = __webpack_require__(15);
@ -21367,6 +21478,8 @@ return /******/ (function(modules) { // webpackBootstrap
}; };
this.touch = {}; // store state information needed for touch events this.touch = {}; // store state information needed for touch events
this.redrawCount = 0;
// attach the root panel to the provided container // attach the root panel to the provided container
if (!container) throw new Error('No container provided'); if (!container) throw new Error('No container provided');
container.appendChild(this.dom.root); container.appendChild(this.dom.root);
@ -21804,7 +21917,15 @@ return /******/ (function(modules) { // webpackBootstrap
}); });
if (resized) { if (resized) {
// keep repainting until all sizes are settled // keep repainting until all sizes are settled
this.redraw();
var MAX_REDRAWS = 2; // maximum number of consecutive redraws
if (this.redrawCount < MAX_REDRAWS) {
this.redrawCount++;
this.redraw();
}
else {
console.log('WARNING: infinite loop in redraw?')
}
this.redrawCount = 0;
} }
this.emit("finishedRedraw"); this.emit("finishedRedraw");
@ -22731,7 +22852,7 @@ return /******/ (function(modules) { // webpackBootstrap
DOMutil.drawBar(combinedData[i].x + drawData.offset, combinedData[i].y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].y, group.className + ' bar', framework.svgElements, framework.svg); DOMutil.drawBar(combinedData[i].x + drawData.offset, combinedData[i].y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].y, group.className + ' bar', framework.svgElements, framework.svg);
// draw points // draw points
if (group.options.drawPoints.enabled == true) { if (group.options.drawPoints.enabled == true) {
Points.draw(dataset, group, framework, drawData.offset);
Points.draw(combinedData, group, framework, drawData.offset);
} }
} }
}; };
@ -23619,7 +23740,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) { /***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, module) {//! moment.js var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global, module) {//! moment.js
//! version : 2.8.4
//! version : 2.8.3
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT //! license : MIT
//! momentjs.com //! momentjs.com
@ -23630,7 +23751,7 @@ return /******/ (function(modules) { // webpackBootstrap
************************************/ ************************************/
var moment, var moment,
VERSION = '2.8.4',
VERSION = '2.8.3',
// the global-scope this is NOT the global object in Node.js // the global-scope this is NOT the global object in Node.js
globalScope = typeof global !== 'undefined' ? global : this, globalScope = typeof global !== 'undefined' ? global : this,
oldGlobalMoment, oldGlobalMoment,
@ -23653,7 +23774,7 @@ return /******/ (function(modules) { // webpackBootstrap
momentProperties = [], momentProperties = [],
// check for nodeJS // check for nodeJS
hasModule = (typeof module !== 'undefined' && module && module.exports),
hasModule = (typeof module !== 'undefined' && module.exports),
// ASP.NET json date format regex // ASP.NET json date format regex
aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
@ -23664,8 +23785,8 @@ return /******/ (function(modules) { // webpackBootstrap
isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,
// format tokens // format tokens
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,4}|x|X|zz?|ZZ?|.)/g,
localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
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,4}|X|zz?|ZZ?|.)/g,
localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,
// parsing token regexes // parsing token regexes
parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99 parseTokenOneOrTwoDigits = /\d\d?/, // 0 - 99
@ -23676,8 +23797,8 @@ return /******/ (function(modules) { // webpackBootstrap
parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic. parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, // any word (or two) characters or numbers including two/three word month in arabic.
parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
parseTokenT = /T/i, // T (ISO separator) parseTokenT = /T/i, // T (ISO separator)
parseTokenOffsetMs = /[\+\-]?\d+/, // 1234567890123
parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
parseTokenOrdinal = /\d{1,2}/,
//strict parsing regexes //strict parsing regexes
parseTokenOneDigit = /\d/, // 0 - 9 parseTokenOneDigit = /\d/, // 0 - 9
@ -23892,9 +24013,6 @@ return /******/ (function(modules) { // webpackBootstrap
zz : function () { zz : function () {
return this.zoneName(); return this.zoneName();
}, },
x : function () {
return this.valueOf();
},
X : function () { X : function () {
return this.unix(); return this.unix();
}, },
@ -24321,10 +24439,7 @@ return /******/ (function(modules) { // webpackBootstrap
overflow = overflow =
m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH :
m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE :
m._a[HOUR] < 0 || m._a[HOUR] > 24 ||
(m._a[HOUR] === 24 && (m._a[MINUTE] !== 0 ||
m._a[SECOND] !== 0 ||
m._a[MILLISECOND] !== 0)) ? HOUR :
m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR :
m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE :
m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND :
m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND :
@ -24351,8 +24466,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (m._strict) { if (m._strict) {
m._isValid = m._isValid && m._isValid = m._isValid &&
m._pf.charsLeftOver === 0 && m._pf.charsLeftOver === 0 &&
m._pf.unusedTokens.length === 0 &&
m._pf.bigHour === undefined;
m._pf.unusedTokens.length === 0;
} }
} }
return m._isValid; return m._isValid;
@ -24404,18 +24518,8 @@ return /******/ (function(modules) { // webpackBootstrap
// Return a moment from input, that is local/utc/zone equivalent to model. // Return a moment from input, that is local/utc/zone equivalent to model.
function makeAs(input, model) { function makeAs(input, model) {
var res, diff;
if (model._isUTC) {
res = model.clone();
diff = (moment.isMoment(input) || isDate(input) ?
+input : +moment(input)) - (+res);
// Use low-level api, because this fn is low-level api.
res._d.setTime(+res._d + diff);
moment.updateOffset(res, false);
return res;
} else {
return moment(input).local();
}
return model._isUTC ? moment(input).zone(model._offset || 0) :
moment(input).local();
} }
/************************************ /************************************
@ -24435,9 +24539,6 @@ return /******/ (function(modules) { // webpackBootstrap
this['_' + i] = prop; this['_' + i] = prop;
} }
} }
// Lenient ordinal parsing accepts just a number in addition to
// number + (possibly) stuff coming from _ordinalParseLenient.
this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + /\d{1,2}/.source);
}, },
_months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), _months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
@ -24450,32 +24551,22 @@ return /******/ (function(modules) { // webpackBootstrap
return this._monthsShort[m.month()]; return this._monthsShort[m.month()];
}, },
monthsParse : function (monthName, format, strict) {
monthsParse : function (monthName) {
var i, mom, regex; var i, mom, regex;
if (!this._monthsParse) { if (!this._monthsParse) {
this._monthsParse = []; this._monthsParse = [];
this._longMonthsParse = [];
this._shortMonthsParse = [];
} }
for (i = 0; i < 12; i++) { for (i = 0; i < 12; i++) {
// make the regex if we don't have it already // make the regex if we don't have it already
mom = moment.utc([2000, i]);
if (strict && !this._longMonthsParse[i]) {
this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
}
if (!strict && !this._monthsParse[i]) {
if (!this._monthsParse[i]) {
mom = moment.utc([2000, i]);
regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
} }
// test the regex // test the regex
if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
return i;
} else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
return i;
} else if (!strict && this._monthsParse[i].test(monthName)) {
if (this._monthsParse[i].test(monthName)) {
return i; return i;
} }
} }
@ -24518,7 +24609,6 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
_longDateFormat : { _longDateFormat : {
LTS : 'h:mm:ss A',
LT : 'h:mm A', LT : 'h:mm A',
L : 'MM/DD/YYYY', L : 'MM/DD/YYYY',
LL : 'MMMM D, YYYY', LL : 'MMMM D, YYYY',
@ -24559,9 +24649,9 @@ return /******/ (function(modules) { // webpackBootstrap
lastWeek : '[Last] dddd [at] LT', lastWeek : '[Last] dddd [at] LT',
sameElse : 'L' sameElse : 'L'
}, },
calendar : function (key, mom, now) {
calendar : function (key, mom) {
var output = this._calendar[key]; var output = this._calendar[key];
return typeof output === 'function' ? output.apply(mom, [now]) : output;
return typeof output === 'function' ? output.apply(mom) : output;
}, },
_relativeTime : { _relativeTime : {
@ -24596,7 +24686,6 @@ return /******/ (function(modules) { // webpackBootstrap
return this._ordinal.replace('%d', number); return this._ordinal.replace('%d', number);
}, },
_ordinal : '%d', _ordinal : '%d',
_ordinalParse : /\d{1,2}/,
preparse : function (string) { preparse : function (string) {
return string; return string;
@ -24738,8 +24827,6 @@ return /******/ (function(modules) { // webpackBootstrap
case 'a': case 'a':
case 'A': case 'A':
return config._locale._meridiemParse; return config._locale._meridiemParse;
case 'x':
return parseTokenOffsetMs;
case 'X': case 'X':
return parseTokenTimestampMs; return parseTokenTimestampMs;
case 'Z': case 'Z':
@ -24774,7 +24861,7 @@ return /******/ (function(modules) { // webpackBootstrap
case 'E': case 'E':
return parseTokenOneOrTwoDigits; return parseTokenOneOrTwoDigits;
case 'Do': case 'Do':
return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;
return parseTokenOrdinal;
default : default :
a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i')); a = new RegExp(regexpEscape(unescapeFormat(token.replace('\\', '')), 'i'));
return a; return a;
@ -24811,7 +24898,7 @@ return /******/ (function(modules) { // webpackBootstrap
break; break;
case 'MMM' : // fall through to MMMM case 'MMM' : // fall through to MMMM
case 'MMMM' : case 'MMMM' :
a = config._locale.monthsParse(input, token, config._strict);
a = config._locale.monthsParse(input);
// if we didn't find a month name, mark the date as invalid. // if we didn't find a month name, mark the date as invalid.
if (a != null) { if (a != null) {
datePartArray[MONTH] = a; datePartArray[MONTH] = a;
@ -24828,8 +24915,7 @@ return /******/ (function(modules) { // webpackBootstrap
break; break;
case 'Do' : case 'Do' :
if (input != null) { if (input != null) {
datePartArray[DATE] = toInt(parseInt(
input.match(/\d{1,2}/)[0], 10));
datePartArray[DATE] = toInt(parseInt(input, 10));
} }
break; break;
// DAY OF YEAR // DAY OF YEAR
@ -24854,13 +24940,11 @@ return /******/ (function(modules) { // webpackBootstrap
case 'A' : case 'A' :
config._isPm = config._locale.isPM(input); config._isPm = config._locale.isPM(input);
break; break;
// HOUR
// 24 HOUR
case 'H' : // fall through to hh
case 'HH' : // fall through to hh
case 'h' : // fall through to hh case 'h' : // fall through to hh
case 'hh' : case 'hh' :
config._pf.bigHour = true;
/* falls through */
case 'H' : // fall through to HH
case 'HH' :
datePartArray[HOUR] = toInt(input); datePartArray[HOUR] = toInt(input);
break; break;
// MINUTE // MINUTE
@ -24880,10 +24964,6 @@ return /******/ (function(modules) { // webpackBootstrap
case 'SSSS' : case 'SSSS' :
datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000); datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000);
break; break;
// UNIX OFFSET (MILLISECONDS)
case 'x':
config._d = new Date(toInt(input));
break;
// UNIX TIMESTAMP WITH MS // UNIX TIMESTAMP WITH MS
case 'X': case 'X':
config._d = new Date(parseFloat(input) * 1000); config._d = new Date(parseFloat(input) * 1000);
@ -25020,25 +25100,12 @@ return /******/ (function(modules) { // webpackBootstrap
config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
} }
// Check for 24:00:00.000
if (config._a[HOUR] === 24 &&
config._a[MINUTE] === 0 &&
config._a[SECOND] === 0 &&
config._a[MILLISECOND] === 0) {
config._nextDay = true;
config._a[HOUR] = 0;
}
config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input); config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
// Apply timezone offset from input. The actual zone can be changed // Apply timezone offset from input. The actual zone can be changed
// with parseZone. // with parseZone.
if (config._tzm != null) { if (config._tzm != null) {
config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm); config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm);
} }
if (config._nextDay) {
config._a[HOUR] = 24;
}
} }
function dateFromObject(config) { function dateFromObject(config) {
@ -25052,7 +25119,7 @@ return /******/ (function(modules) { // webpackBootstrap
config._a = [ config._a = [
normalizedInput.year, normalizedInput.year,
normalizedInput.month, normalizedInput.month,
normalizedInput.day || normalizedInput.date,
normalizedInput.day,
normalizedInput.hour, normalizedInput.hour,
normalizedInput.minute, normalizedInput.minute,
normalizedInput.second, normalizedInput.second,
@ -25125,10 +25192,6 @@ return /******/ (function(modules) { // webpackBootstrap
config._pf.unusedInput.push(string); config._pf.unusedInput.push(string);
} }
// clear _12h flag if hour is <= 12
if (config._pf.bigHour === true && config._a[HOUR] <= 12) {
config._pf.bigHour = undefined;
}
// handle am pm // handle am pm
if (config._isPm && config._a[HOUR] < 12) { if (config._isPm && config._a[HOUR] < 12) {
config._a[HOUR] += 12; config._a[HOUR] += 12;
@ -25137,6 +25200,7 @@ return /******/ (function(modules) { // webpackBootstrap
if (config._isPm === false && config._a[HOUR] === 12) { if (config._isPm === false && config._a[HOUR] === 12) {
config._a[HOUR] = 0; config._a[HOUR] = 0;
} }
dateFromConfig(config); dateFromConfig(config);
checkOverflow(config); checkOverflow(config);
} }
@ -25396,8 +25460,7 @@ return /******/ (function(modules) { // webpackBootstrap
function makeMoment(config) { function makeMoment(config) {
var input = config._i, var input = config._i,
format = config._f,
res;
format = config._f;
config._locale = config._locale || moment.localeData(config._l); config._locale = config._locale || moment.localeData(config._l);
@ -25421,14 +25484,7 @@ return /******/ (function(modules) { // webpackBootstrap
makeDateFromInput(config); makeDateFromInput(config);
} }
res = new Moment(config);
if (res._nextDay) {
// Adding is smart enough around DST
res.add(1, 'd');
res._nextDay = undefined;
}
return res;
return new Moment(config);
} }
moment = function (input, format, locale, strict) { moment = function (input, format, locale, strict) {
@ -25460,7 +25516,7 @@ return /******/ (function(modules) { // webpackBootstrap
'release. Please refer to ' + 'release. Please refer to ' +
'https://github.com/moment/moment/issues/1407 for more info.', 'https://github.com/moment/moment/issues/1407 for more info.',
function (config) { function (config) {
config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
config._d = new Date(config._i);
} }
); );
@ -25772,12 +25828,7 @@ return /******/ (function(modules) { // webpackBootstrap
toISOString : function () { toISOString : function () {
var m = moment(this).utc(); var m = moment(this).utc();
if (0 < m.year() && m.year() <= 9999) { if (0 < m.year() && m.year() <= 9999) {
if ('function' === typeof Date.prototype.toISOString) {
// native implementation is ~50x faster, use it when we can
return this.toDate().toISOString();
} else {
return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
}
return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
} else { } else {
return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
} }
@ -25896,7 +25947,7 @@ return /******/ (function(modules) { // webpackBootstrap
diff < 1 ? 'sameDay' : diff < 1 ? 'sameDay' :
diff < 2 ? 'nextDay' : diff < 2 ? 'nextDay' :
diff < 7 ? 'nextWeek' : 'sameElse'; diff < 7 ? 'nextWeek' : 'sameElse';
return this.format(this.localeData().calendar(format, this, moment(now)));
return this.format(this.localeData().calendar(format, this));
}, },
isLeapYear : function () { isLeapYear : function () {
@ -25965,45 +26016,36 @@ return /******/ (function(modules) { // webpackBootstrap
endOf: function (units) { endOf: function (units) {
units = normalizeUnits(units); units = normalizeUnits(units);
if (units === undefined || units === 'millisecond') {
return this;
}
return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
}, },
isAfter: function (input, units) { isAfter: function (input, units) {
var inputMs;
units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
if (units === 'millisecond') { if (units === 'millisecond') {
input = moment.isMoment(input) ? input : moment(input); input = moment.isMoment(input) ? input : moment(input);
return +this > +input; return +this > +input;
} else { } else {
inputMs = moment.isMoment(input) ? +input : +moment(input);
return inputMs < +this.clone().startOf(units);
return +this.clone().startOf(units) > +moment(input).startOf(units);
} }
}, },
isBefore: function (input, units) { isBefore: function (input, units) {
var inputMs;
units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond');
if (units === 'millisecond') { if (units === 'millisecond') {
input = moment.isMoment(input) ? input : moment(input); input = moment.isMoment(input) ? input : moment(input);
return +this < +input; return +this < +input;
} else { } else {
inputMs = moment.isMoment(input) ? +input : +moment(input);
return +this.clone().endOf(units) < inputMs;
return +this.clone().startOf(units) < +moment(input).startOf(units);
} }
}, },
isSame: function (input, units) { isSame: function (input, units) {
var inputMs;
units = normalizeUnits(units || 'millisecond'); units = normalizeUnits(units || 'millisecond');
if (units === 'millisecond') { if (units === 'millisecond') {
input = moment.isMoment(input) ? input : moment(input); input = moment.isMoment(input) ? input : moment(input);
return +this === +input; return +this === +input;
} else { } else {
inputMs = +moment(input);
return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));
return +this.clone().startOf(units) === +makeAs(input, this).startOf(units);
} }
}, },
@ -26180,7 +26222,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, },
lang : deprecate( lang : deprecate(
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
'moment().lang() is deprecated. Use moment().localeData() instead.',
function (key) { function (key) {
if (key === undefined) { if (key === undefined) {
return this.localeData(); return this.localeData();
@ -26401,7 +26443,7 @@ return /******/ (function(modules) { // webpackBootstrap
return units === 'month' ? months : months / 12; return units === 'month' ? months : months / 12;
} else { } else {
// handle milliseconds separately because of floating point math errors (issue #1867) // handle milliseconds separately because of floating point math errors (issue #1867)
days = this._days + Math.round(yearsToDays(this._months / 12));
days = this._days + yearsToDays(this._months / 12);
switch (units) { switch (units) {
case 'week': return days / 7 + this._milliseconds / 6048e5; case 'week': return days / 7 + this._milliseconds / 6048e5;
case 'day': return days + this._milliseconds / 864e5; case 'day': return days + this._milliseconds / 864e5;
@ -26503,7 +26545,6 @@ return /******/ (function(modules) { // webpackBootstrap
// Set default locale, other locale will inherit from English. // Set default locale, other locale will inherit from English.
moment.locale('en', { moment.locale('en', {
ordinalParse: /\d{1,2}(th|st|nd|rd)/,
ordinal : function (number) { ordinal : function (number) {
var b = number % 10, var b = number % 10,
output = (toInt(number % 100 / 10) === 1) ? 'th' : output = (toInt(number % 100 / 10) === 1) ? 'th' :

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


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


Loading…
Cancel
Save