From 309564e367cfdc4f9eff6a0d24ed6dfacf173a4c Mon Sep 17 00:00:00 2001 From: josdejong Date: Thu, 23 May 2013 15:15:51 +0200 Subject: [PATCH] Changed propagation of options in components to a prototype based solution --- examples/timeline/05_groups.html | 2 +- src/component/component.js | 30 ++- src/component/css/itemset.css | 2 + src/component/group.js | 27 +- src/component/groupset.js | 73 ++---- src/component/item/item.js | 14 +- src/component/item/itembox.js | 27 +- src/component/item/itempoint.js | 23 +- src/component/item/itemrange.js | 27 +- src/component/itemset.js | 30 ++- src/component/panel.js | 27 +- src/component/rootpanel.js | 20 +- src/component/timeaxis.js | 27 +- src/stack.js | 23 +- src/util.js | 12 + src/visualization/timeline.js | 44 ++-- vis.js | 406 ++++++++++++++++++------------- vis.min.js | 6 +- 18 files changed, 471 insertions(+), 349 deletions(-) diff --git a/examples/timeline/05_groups.html b/examples/timeline/05_groups.html index 66b257b2..e1e6cc65 100644 --- a/examples/timeline/05_groups.html +++ b/examples/timeline/05_groups.html @@ -36,7 +36,7 @@ group: group, content: 'item ' + i, start: start, - type: 'point' + type: 'box' }); } diff --git a/src/component/component.js b/src/component/component.js index dc21e795..25b44799 100644 --- a/src/component/component.js +++ b/src/component/component.js @@ -27,16 +27,32 @@ function Component () { * {String | Number | function} [height] */ Component.prototype.setOptions = function setOptions(options) { - if (!options) { - return; - } + if (options) { + util.extend(this.options, options); - util.extend(this.options, options); + if (this.controller) { + this.requestRepaint(); + this.requestReflow(); + } + } +}; - if (this.controller) { - this.requestRepaint(); - this.requestReflow(); +/** + * Get an option value by name + * The function will first check this.options object, and else will check + * this.defaultOptions. + * @param {String} name + * @return {*} value + */ +Component.prototype.getOption = function getOption(name) { + var value; + if (this.options) { + value = this.options[name]; + } + if (value === undefined && this.defaultOptions) { + value = this.defaultOptions[name]; } + return value; }; /** diff --git a/src/component/css/itemset.css b/src/component/css/itemset.css index 9ab5de1b..c9a8811f 100644 --- a/src/component/css/itemset.css +++ b/src/component/css/itemset.css @@ -20,6 +20,8 @@ border-top: 1px solid #bfbfbf; } +/* TODO: with orientation=='bottom', this will more or less overlap with timeline axis .graph .groupset .itemset-axis:last-child { border-top: none; } +*/ diff --git a/src/component/group.js b/src/component/group.js index f85acf62..c5fa01b3 100644 --- a/src/component/group.js +++ b/src/component/group.js @@ -13,7 +13,8 @@ function Group (parent, groupId, options) { this.groupId = groupId; this.itemsData = null; // DataSet this.items = null; // ItemSet - this.options = {}; + this.options = Object.create(parent && parent.options || null); + this.options.top = 0; this.top = 0; this.left = 0; @@ -28,13 +29,18 @@ Group.prototype = new Component(); Group.prototype.setOptions = function setOptions(options) { if (options) { util.extend(this.options, options); - - if (this.items) { - this.items.setOptions(this.options); - } } }; +/** + * Get the container element of the panel, which can be used by a child to + * add its own widgets. + * @returns {HTMLElement} container + */ +Group.prototype.getContainer = function () { + return this.parent.getContainer(); +}; + /** * Set item set for the group. The group will create a view on the itemset, * filtered by the groups id. @@ -52,8 +58,7 @@ Group.prototype.setItems = function setItems(items) { if (items || true) { var groupId = this.groupId; - this.items = new ItemSet(this.parent); - //this.items.setOptions(this.options); // TODO: copy only a specific set of options + this.items = new ItemSet(this); this.items.setRange(this.parent.range); this.view = new DataView(items, { @@ -80,5 +85,11 @@ Group.prototype.repaint = function repaint() { * @return {Boolean} resized */ Group.prototype.reflow = function reflow() { - return false; + var changed = 0, + update = util.updateProperty; + + changed += update(this, 'top', this.items ? this.items.top : 0); + changed += update(this, 'height', this.items ? this.items.height : 0); + + return (changed > 0); }; diff --git a/src/component/groupset.js b/src/component/groupset.js index b6808f25..9cadac3a 100644 --- a/src/component/groupset.js +++ b/src/component/groupset.js @@ -13,7 +13,7 @@ function GroupSet(parent, depends, options) { this.parent = parent; this.depends = depends; - this.options = {}; + this.options = Object.create(parent && parent.options || null); this.range = null; // Range or Object {start: number, end: number} this.itemsData = null; // DataSet with items @@ -37,31 +37,20 @@ function GroupSet(parent, depends, options) { } }; - if (options) { - this.setOptions(options); - } + this.setOptions(options); } GroupSet.prototype = new Panel(); /** - * Set options for the ItemSet. Existing options will be extended/overwritten. + * Set options for the GroupSet. Existing options will be extended/overwritten. * @param {Object} [options] The following options are available: * TODO: describe options */ GroupSet.prototype.setOptions = function setOptions(options) { - util.extend(this.options, options); - - // TODO: implement options - - /* TODO: only apply known options to the itemsets, must not override options.top - var me = this; - util.forEach(this.groups, function (group) { - if (group.items) { - group.items.setOptions(me.options); - } - }); - */ + if (options) { + util.extend(this.options, options); + } }; GroupSet.prototype.setRange = function (range) { @@ -75,7 +64,7 @@ GroupSet.prototype.setRange = function (range) { GroupSet.prototype.setItems = function setItems(items) { this.itemsData = items; - util.forEach(this.groups, function (group) { + this.groups.forEach(function (group) { group.setItems(items); }); }; @@ -168,8 +157,9 @@ GroupSet.prototype.repaint = function repaint() { frame = document.createElement('div'); frame.className = 'groupset'; - if (options.className) { - util.addClassName(frame, util.option.asString(options.className)); + var className = options.className; + if (className) { + util.addClassName(frame, util.option.asString(className)); } this.frame = frame; @@ -221,8 +211,7 @@ GroupSet.prototype.repaint = function repaint() { case 'add': case 'update': if (!group) { - var options = util.extend({}, me.options, {top: 0}); - group = new Group(me, id, options); + group = new Group(me, id); group.setItems(me.itemsData); // attach items data groups.push(group); @@ -254,29 +243,21 @@ GroupSet.prototype.repaint = function repaint() { // the groupset depends on each of the groups //this.depends = this.groups; // TODO: gives a circular reference through the parent - } - - // TODO: the functions for top should be re-created only when groups are changed! (must be put inside the if-block above) - // update the top position (TODO: optimize, needed only when groups are added/removed/reordered - // TODO: apply dependencies of the groupset - var prevGroup = null; - util.forEach(this.groups, function (group) { - // TODO: top function must be applied to the group instead of the groups itemset. - // the group must then apply it to its itemset - // (right now the created function top is removed when the group replaces its itemset - var prevItems = prevGroup && prevGroup.items; - if (group.items) { - if (prevItems) { - group.items.options.top = function () { - return prevItems.top + prevItems.height; + // TODO: apply dependencies of the groupset + this.groups.forEach(function (group, index) { + var prevGroup = me.groups[index - 1], + top = 0; + if (prevGroup) { + top = function () { + return prevGroup.top + prevGroup.height; } } - else { - group.items.options.top = 0; - } - } - prevGroup = group; - }); + group.setOptions({ + top: top + }); + }); + + } return (changed > 0); }; @@ -310,10 +291,8 @@ GroupSet.prototype.reflow = function reflow() { else { // height is not specified, calculate the sum of the height of all groups height = 0; - util.forEach(this.groups, function (group) { - if (group.items) { - height += group.items.height; - } + this.groups.forEach(function (group) { + height += group.height; }); } if (maxHeight != null) { diff --git a/src/component/item/item.js b/src/component/item/item.js index d19ac007..473d7621 100644 --- a/src/component/item/item.js +++ b/src/component/item/item.js @@ -1,16 +1,18 @@ /** * @constructor Item * @param {ItemSet} parent - * @param {Object} data Object containing (optional) parameters type, - * start, end, content, group, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing (optional) parameters type, + * start, end, content, group, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function Item (parent, data, options) { +function Item (parent, data, options, defaultOptions) { this.parent = parent; this.data = data; this.dom = null; - this.options = options; + this.options = options || {}; + this.defaultOptions = defaultOptions || {}; this.selected = false; this.visible = false; diff --git a/src/component/item/itembox.js b/src/component/item/itembox.js index 214ba2d2..36f2ff10 100644 --- a/src/component/item/itembox.js +++ b/src/component/item/itembox.js @@ -2,12 +2,13 @@ * @constructor ItemBox * @extends Item * @param {ItemSet} parent - * @param {Object} data Object containing parameters start - * content, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing parameters start + * content, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function ItemBox (parent, data, options) { +function ItemBox (parent, data, options, defaultOptions) { this.props = { dot: { left: 0, @@ -23,7 +24,7 @@ function ItemBox (parent, data, options) { } }; - Item.call(this, parent, data, options); + Item.call(this, parent, data, options, defaultOptions); } ItemBox.prototype = new Item (null, null); @@ -62,7 +63,7 @@ ItemBox.prototype.repaint = function repaint() { } if (dom) { - if (!this.options && !this.parent) { + if (!this.parent) { throw new Error('Cannot repaint item: no parent attached'); } var foreground = this.parent.getForeground(); @@ -172,6 +173,7 @@ ItemBox.prototype.reflow = function reflow() { dom, props, options, + margin, start, align, orientation, @@ -201,8 +203,9 @@ ItemBox.prototype.reflow = function reflow() { props = this.props; options = this.options; start = this.parent.toScreen(this.data.start); - align = options && options.align; - orientation = options && options.orientation; + align = options.align || this.defaultOptions.align; + margin = options.margin && options.margin.axis || this.defaultOptions.margin.axis; + orientation = options.orientation || this.defaultOptions.orientation; changed += update(props.dot, 'height', dom.dot.offsetHeight); changed += update(props.dot, 'width', dom.dot.offsetWidth); @@ -227,14 +230,14 @@ ItemBox.prototype.reflow = function reflow() { update(props.dot, 'left', start - props.dot.width / 2); update(props.dot, 'top', -props.dot.height / 2); if (orientation == 'top') { - top = options.margin.axis; + top = margin; update(this, 'top', top); } else { // default or 'bottom' var parentHeight = this.parent.height; - top = parentHeight - this.height - options.margin.axis; + top = parentHeight - this.height - margin; update(this, 'top', top); } @@ -283,7 +286,7 @@ ItemBox.prototype._create = function _create() { ItemBox.prototype.reposition = function reposition() { var dom = this.dom, props = this.props, - orientation = this.options.orientation; + orientation = this.options.orientation || this.defaultOptions.orientation; if (dom) { var box = dom.box, diff --git a/src/component/item/itempoint.js b/src/component/item/itempoint.js index 517ffeaf..79c29acc 100644 --- a/src/component/item/itempoint.js +++ b/src/component/item/itempoint.js @@ -2,12 +2,13 @@ * @constructor ItemPoint * @extends Item * @param {ItemSet} parent - * @param {Object} data Object containing parameters start - * content, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing parameters start + * content, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function ItemPoint (parent, data, options) { +function ItemPoint (parent, data, options, defaultOptions) { this.props = { dot: { top: 0, @@ -20,7 +21,7 @@ function ItemPoint (parent, data, options) { } }; - Item.call(this, parent, data, options); + Item.call(this, parent, data, options, defaultOptions); } ItemPoint.prototype = new Item (null, null); @@ -59,7 +60,7 @@ ItemPoint.prototype.repaint = function repaint() { } if (dom) { - if (!this.options && !this.options.parent) { + if (!this.parent) { throw new Error('Cannot repaint item: no parent attached'); } var foreground = this.parent.getForeground(); @@ -144,6 +145,7 @@ ItemPoint.prototype.reflow = function reflow() { dom, props, options, + margin, orientation, start, top, @@ -170,7 +172,8 @@ ItemPoint.prototype.reflow = function reflow() { update = util.updateProperty; props = this.props; options = this.options; - orientation = options.orientation; + orientation = options.orientation || this.defaultOptions.orientation; + margin = options.margin && options.margin.axis || this.defaultOptions.margin.axis; start = this.parent.toScreen(this.data.start); changed += update(this, 'width', dom.point.offsetWidth); @@ -180,12 +183,12 @@ ItemPoint.prototype.reflow = function reflow() { changed += update(props.content, 'height', dom.content.offsetHeight); if (orientation == 'top') { - top = options.margin.axis; + top = margin; } else { // default or 'bottom' var parentHeight = this.parent.height; - top = Math.max(parentHeight - this.height - options.margin.axis, 0); + top = Math.max(parentHeight - this.height - margin, 0); } changed += update(this, 'top', top); changed += update(this, 'left', start - props.dot.width / 2); diff --git a/src/component/item/itemrange.js b/src/component/item/itemrange.js index 1121c73d..b8ede542 100644 --- a/src/component/item/itemrange.js +++ b/src/component/item/itemrange.js @@ -2,12 +2,13 @@ * @constructor ItemRange * @extends Item * @param {ItemSet} parent - * @param {Object} data Object containing parameters start, end - * content, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing parameters start, end + * content, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function ItemRange (parent, data, options) { +function ItemRange (parent, data, options, defaultOptions) { this.props = { content: { left: 0, @@ -15,7 +16,7 @@ function ItemRange (parent, data, options) { } }; - Item.call(this, parent, data, options); + Item.call(this, parent, data, options, defaultOptions); } ItemRange.prototype = new Item (null, null); @@ -54,7 +55,7 @@ ItemRange.prototype.repaint = function repaint() { } if (dom) { - if (!this.options && !this.options.parent) { + if (!this.parent) { throw new Error('Cannot repaint item: no parent attached'); } var foreground = this.parent.getForeground(); @@ -136,6 +137,8 @@ ItemRange.prototype.reflow = function reflow() { dom, props, options, + margin, + padding, parent, start, end, @@ -176,7 +179,9 @@ ItemRange.prototype.reflow = function reflow() { update = util.updateProperty; box = dom.box; parentWidth = parent.width; - orientation = options.orientation; + orientation = options.orientation || this.defaultOptions.orientation; + margin = options.margin && options.margin.axis || this.defaultOptions.margin.axis; + padding = options.padding || this.defaultOptions.padding; changed += update(props.content, 'width', dom.content.offsetWidth); @@ -193,7 +198,7 @@ ItemRange.prototype.reflow = function reflow() { // when range exceeds left of the window, position the contents at the left of the visible area if (start < 0) { contentLeft = Math.min(-start, - (end - start - props.content.width - 2 * options.padding)); + (end - start - props.content.width - 2 * padding)); // TODO: remove the need for options.padding. it's terrible. } else { @@ -202,12 +207,12 @@ ItemRange.prototype.reflow = function reflow() { changed += update(props.content, 'left', contentLeft); if (orientation == 'top') { - top = options.margin.axis; + top = margin; changed += update(this, 'top', top); } else { // default or 'bottom' - top = parent.height - this.height - options.margin.axis; + top = parent.height - this.height - margin; changed += update(this, 'top', top); } diff --git a/src/component/itemset.js b/src/component/itemset.js index a1b52552..cde5e2a0 100644 --- a/src/component/itemset.js +++ b/src/component/itemset.js @@ -17,7 +17,8 @@ function ItemSet(parent, depends, options) { this.depends = depends; // one options object is shared by this itemset and all its items - this.options = { + this.options = Object.create(parent && parent.options || null); + this.defaultOptions = { style: 'box', align: 'center', orientation: 'bottom', @@ -57,9 +58,7 @@ function ItemSet(parent, depends, options) { this.stack = new Stack(this); this.conversion = null; - if (options) { - this.setOptions(options); - } + this.setOptions(options); } ItemSet.prototype = new Panel(); @@ -97,11 +96,11 @@ ItemSet.types = { * Must correspond with the items css. Default is 5. */ ItemSet.prototype.setOptions = function setOptions(options) { - util.extend(this.options, options); + if (options) { + util.extend(this.options, options); + } // TODO: ItemSet should also attach event listeners for rangechange and rangechanged, like timeaxis - - this.stack.setOptions(this.options); }; /** @@ -125,14 +124,17 @@ ItemSet.prototype.repaint = function repaint() { update = util.updateProperty, asSize = util.option.asSize, options = this.options, + orientation = this.getOption('orientation'), + defaultOptions = this.defaultOptions, frame = this.frame; if (!frame) { frame = document.createElement('div'); frame.className = 'itemset'; - if (options.className) { - util.addClassName(frame, util.option.asString(options.className)); + var className = options.className; + if (className) { + util.addClassName(frame, util.option.asString(className)); } // create background panel @@ -182,7 +184,7 @@ ItemSet.prototype.repaint = function repaint() { // reposition axis changed += update(this.dom.axis.style, 'left', asSize(options.left, '0px')); changed += update(this.dom.axis.style, 'width', asSize(options.width, '100%')); - if (this.options.orientation == 'bottom') { + if (orientation == 'bottom') { changed += update(this.dom.axis.style, 'top', (this.height + this.top) + 'px'); } else { // orientation == 'top' @@ -235,7 +237,7 @@ ItemSet.prototype.repaint = function repaint() { if (!item) { // create item if (constructor) { - item = new constructor(me, itemData, options); + item = new constructor(me, itemData, options, defaultOptions); changed++; } else { @@ -311,6 +313,8 @@ ItemSet.prototype.getAxis = function getAxis() { ItemSet.prototype.reflow = function reflow () { var changed = 0, options = this.options, + marginAxis = options.margin && options.margin.axis || this.defaultOptions.margin.axis, + marginItem = options.margin && options.margin.item || this.defaultOptions.margin.item, update = util.updateProperty, asNumber = util.option.asNumber, frame = this.frame; @@ -341,10 +345,10 @@ ItemSet.prototype.reflow = function reflow () { min = Math.min(min, item.top); max = Math.max(max, (item.top + item.height)); }); - height = (max - min) + options.margin.axis + options.margin.item; + height = (max - min) + marginAxis + marginItem; } else { - height = options.margin.axis + options.margin.item; + height = marginAxis + marginItem; } } if (maxHeight != null) { diff --git a/src/component/panel.js b/src/component/panel.js index dcb66eb8..a5b790cc 100644 --- a/src/component/panel.js +++ b/src/component/panel.js @@ -16,13 +16,29 @@ function Panel(parent, depends, options) { this.id = util.randomUUID(); this.parent = parent; this.depends = depends; - this.options = {}; + + this.options = Object.create(parent && parent.options || null); this.setOptions(options); } Panel.prototype = new Component(); +/** + * Set options. Will extend the current options. + * @param {Object} [options] Available parameters: + * {String | function} [className] + * {String | Number | function} [left] + * {String | Number | function} [top] + * {String | Number | function} [width] + * {String | Number | function} [height] + */ +Panel.prototype.setOptions = function (options) { + if (options) { + util.extend(this.options, options); + } +}; + /** * Get the container element of the panel, which can be used by a child to * add its own widgets. @@ -46,12 +62,13 @@ Panel.prototype.repaint = function () { frame = document.createElement('div'); frame.className = 'panel'; - if (options.className) { - if (typeof options.className == 'function') { - util.addClassName(frame, String(options.className())); + var className = options.className; + if (className) { + if (typeof className == 'function') { + util.addClassName(frame, String(className())); } else { - util.addClassName(frame, String(options.className)); + util.addClassName(frame, String(className)); } } diff --git a/src/component/rootpanel.js b/src/component/rootpanel.js index 30fc0417..6e3187b0 100644 --- a/src/component/rootpanel.js +++ b/src/component/rootpanel.js @@ -9,7 +9,9 @@ function RootPanel(container, options) { this.id = util.randomUUID(); this.container = container; - this.options = { + + this.options = Object.create(options || null); + this.defaultOptions = { autoResize: true }; @@ -28,13 +30,15 @@ RootPanel.prototype = new Panel(); * {String | Number | function} [top] * {String | Number | function} [width] * {String | Number | function} [height] - * {String | Number | function} [height] * {Boolean | function} [autoResize] */ RootPanel.prototype.setOptions = function (options) { - util.extend(this.options, options); + if (options) { + util.extend(this.options, options); + } - if (this.options.autoResize) { + var autoResize = this.getOption('autoResize'); + if (autoResize) { this._watch(); } else { @@ -56,8 +60,9 @@ RootPanel.prototype.repaint = function () { frame = document.createElement('div'); frame.className = 'graph panel'; - if (options.className) { - util.addClassName(frame, util.option.asString(options.className)); + var className = options.className; + if (className) { + util.addClassName(frame, util.option.asString(className)); } this.frame = frame; @@ -114,7 +119,8 @@ RootPanel.prototype._watch = function () { this._unwatch(); var checkSize = function () { - if (!me.options.autoResize) { + var autoResize = me.getOption('autoResize'); + if (!autoResize) { // stop watching when the option autoResize is changed to false me._unwatch(); return; diff --git a/src/component/timeaxis.js b/src/component/timeaxis.js index 635542c9..9e22d1dd 100644 --- a/src/component/timeaxis.js +++ b/src/component/timeaxis.js @@ -34,7 +34,8 @@ function TimeAxis (parent, depends, options) { lineTop: 0 }; - this.options = { + this.options = Object.create(parent && parent.options || null); + this.defaultOptions = { orientation: 'bottom', // supported: 'top', 'bottom' // TODO: implement timeaxis orientations 'left' and 'right' showMinorLabels: true, @@ -51,7 +52,9 @@ TimeAxis.prototype = new Component(); // TODO: comment options TimeAxis.prototype.setOptions = function (options) { - util.extend(this.options, options); + if (options) { + util.extend(this.options, options); + } }; /** @@ -97,6 +100,7 @@ TimeAxis.prototype.repaint = function () { update = util.updateProperty, asSize = util.option.asSize, options = this.options, + orientation = this.getOption('orientation'), props = this.props, step = this.step; @@ -106,7 +110,7 @@ TimeAxis.prototype.repaint = function () { this.frame = frame; changed += 1; } - frame.className = 'axis ' + options.orientation; + frame.className = 'axis ' + orientation; // TODO: custom className? if (!frame.parentNode) { @@ -127,7 +131,6 @@ TimeAxis.prototype.repaint = function () { var beforeChild = frame.nextSibling; parent.removeChild(frame); // take frame offline while updating (is almost twice as fast) - var orientation = options.orientation; var defaultTop = (orientation == 'bottom' && this.props.parentHeight && this.height) ? (this.props.parentHeight - this.height) + 'px' : '0px'; @@ -153,11 +156,11 @@ TimeAxis.prototype.repaint = function () { // TODO: lines must have a width, such that we can create css backgrounds - if (options.showMinorLabels) { + if (this.getOption('showMinorLabels')) { this._repaintMinorText(x, step.getLabelMinor()); } - if (isMajor && options.showMajorLabels) { + if (isMajor && this.getOption('showMajorLabels')) { if (x > 0) { if (xFirstMajorLabel == undefined) { xFirstMajorLabel = x; @@ -174,7 +177,7 @@ TimeAxis.prototype.repaint = function () { } // create a major label on the left when needed - if (options.showMajorLabels) { + if (this.getOption('showMajorLabels')) { var leftTime = this.toTime(0), leftText = step.getLabelMajor(leftTime), widthText = leftText.length * (props.majorCharWidth || 10) + 10; // upper bound estimation @@ -346,7 +349,7 @@ TimeAxis.prototype._repaintLine = function() { options = this.options; // line before all axis elements - if (options.showMinorLabels || options.showMajorLabels) { + if (this.getOption('showMinorLabels') || this.getOption('showMajorLabels')) { if (line) { // put this line at the end of all childs frame.removeChild(line); @@ -422,8 +425,8 @@ TimeAxis.prototype.reflow = function () { // calculate size of a character var props = this.props, - showMinorLabels = this.options.showMinorLabels, - showMajorLabels = this.options.showMajorLabels, + showMinorLabels = this.getOption('showMinorLabels'), + showMajorLabels = this.getOption('showMajorLabels'), measureCharMinor = this.dom.measureCharMinor, measureCharMajor = this.dom.measureCharMajor; if (measureCharMinor) { @@ -440,7 +443,7 @@ TimeAxis.prototype.reflow = function () { props.parentHeight = parentHeight; changed += 1; } - switch (this.options.orientation) { + switch (this.getOption('orientation')) { case 'bottom': props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0; props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0; @@ -480,7 +483,7 @@ TimeAxis.prototype.reflow = function () { break; default: - throw new Error('Unkown orientation "' + this.options.orientation + '"'); + throw new Error('Unkown orientation "' + this.getOption('orientation') + '"'); } var height = props.minorLabelHeight + props.majorLabelHeight; diff --git a/src/stack.js b/src/stack.js index 8b0d317a..262eb387 100644 --- a/src/stack.js +++ b/src/stack.js @@ -6,7 +6,9 @@ */ function Stack (parent, options) { this.parent = parent; - this.options = { + + this.options = Object.create(parent && parent.options || 0); + this.defaultOptions = { order: function (a, b) { //return (b.width - a.width) || (a.left - b.left); // TODO: cleanup // Order: ranges over non-ranges, ranged ordered by width, and @@ -29,6 +31,9 @@ function Stack (parent, options) { return (a.data.start - b.data.start); } } + }, + margin: { + item: 10 } }; @@ -84,8 +89,8 @@ Stack.prototype._order = function _order () { }); //if a customer stack order function exists, use it. - var order = this.options.order; - if (!(typeof this.options.order === 'function')) { + var order = this.options.order || this.defaultOptions.order; + if (!(typeof order === 'function')) { throw new Error('Option order must be a function'); } @@ -104,8 +109,16 @@ Stack.prototype._stack = function _stack () { iMax, ordered = this.ordered, options = this.options, - axisOnTop = (options.orientation == 'top'), - margin = options.margin && options.margin.item || 0; + orientation = options.orientation || this.defaultOptions.orientation, + axisOnTop = (orientation == 'top'), + margin; + + if (options.margin && options.margin.item !== undefined) { + margin = options.margin.item; + } + else { + margin = this.defaultOptions.margin.item + } // calculate new, non-overlapping positions for (i = 0, iMax = ordered.length; i < iMax; i++) { diff --git a/src/util.js b/src/util.js index e535558d..bd49a9f6 100644 --- a/src/util.js +++ b/src/util.js @@ -879,3 +879,15 @@ if (!Function.prototype.bind) { return fBound; }; } + +// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create +if (!Object.create) { + Object.create = function (o) { + if (arguments.length > 1) { + throw new Error('Object.create implementation only accepts the first parameter.'); + } + function F() {} + F.prototype = o; + return new F(); + }; +} diff --git a/src/visualization/timeline.js b/src/visualization/timeline.js index 94cf5e2d..4dead944 100644 --- a/src/visualization/timeline.js +++ b/src/visualization/timeline.js @@ -9,10 +9,15 @@ function Timeline (container, items, options) { var me = this; this.options = { orientation: 'bottom', + min: null, + max: null, zoomMin: 10, // milliseconds zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000, // milliseconds moveable: true, - zoomable: true + zoomable: true, + showMinorLabels: true, + showMajorLabels: true, + autoResize: false }; // controller @@ -22,9 +27,8 @@ function Timeline (container, items, options) { if (!container) { throw new Error('No container element provided'); } - this.main = new RootPanel(container, { - autoResize: false - }); + var mainOptions = Object.create(this.options); + this.main = new RootPanel(container, mainOptions); this.controller.add(this.main); // range @@ -48,10 +52,9 @@ function Timeline (container, items, options) { // TODO: put the listeners in setOptions, be able to dynamically change with options moveable and zoomable // time axis - this.timeaxis = new TimeAxis(this.main, [], { - orientation: this.options.orientation, - range: this.range - }); + var timeaxisOptions = Object.create(this.options); + timeaxisOptions.range = this.range; + this.timeaxis = new TimeAxis(this.main, [], timeaxisOptions); this.timeaxis.setRange(this.range); this.controller.add(this.timeaxis); @@ -62,9 +65,7 @@ function Timeline (container, items, options) { this.groupsData = null; // DataSet // set options (must take place before setting the data) - if (options) { - this.setOptions(options); - } + this.setOptions(options); // set data if (items) { @@ -77,24 +78,10 @@ function Timeline (container, items, options) { * @param {Object} options TODO: describe the available options */ Timeline.prototype.setOptions = function (options) { - util.extend(this.options, options); - - // update options the timeaxis - this.timeaxis.setOptions({ - orientation: this.options.orientation, - showMinorLabels: this.options.showMinorLabels, - showMajorLabels: this.options.showMajorLabels - }); - - // update options for the range - this.range.setOptions({ - min: this.options.min, - max: this.options.max, - zoomMin: this.options.zoomMin, - zoomMax: this.options.zoomMax - }); + if (options) { + util.extend(this.options, options); + } - // update options the content var itemsTop, itemsHeight, mainHeight, @@ -142,7 +129,6 @@ Timeline.prototype.setOptions = function (options) { }); this.content.setOptions({ - orientation: this.options.orientation, top: itemsTop, height: itemsHeight, maxHeight: maxHeight diff --git a/vis.js b/vis.js index f1360825..1a1102b9 100644 --- a/vis.js +++ b/vis.js @@ -911,6 +911,18 @@ if (!Function.prototype.bind) { }; } +// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create +if (!Object.create) { + Object.create = function (o) { + if (arguments.length > 1) { + throw new Error('Object.create implementation only accepts the first parameter.'); + } + function F() {} + F.prototype = o; + return new F(); + }; +} + /** * Event listener (singleton) */ @@ -2576,7 +2588,9 @@ DataView.prototype._trigger = DataSet.prototype._trigger; */ function Stack (parent, options) { this.parent = parent; - this.options = { + + this.options = Object.create(parent && parent.options || 0); + this.defaultOptions = { order: function (a, b) { //return (b.width - a.width) || (a.left - b.left); // TODO: cleanup // Order: ranges over non-ranges, ranged ordered by width, and @@ -2599,6 +2613,9 @@ function Stack (parent, options) { return (a.data.start - b.data.start); } } + }, + margin: { + item: 10 } }; @@ -2654,8 +2671,8 @@ Stack.prototype._order = function _order () { }); //if a customer stack order function exists, use it. - var order = this.options.order; - if (!(typeof this.options.order === 'function')) { + var order = this.options.order || this.defaultOptions.order; + if (!(typeof order === 'function')) { throw new Error('Option order must be a function'); } @@ -2674,8 +2691,16 @@ Stack.prototype._stack = function _stack () { iMax, ordered = this.ordered, options = this.options, - axisOnTop = (options.orientation == 'top'), - margin = options.margin && options.margin.item || 0; + orientation = options.orientation || this.defaultOptions.orientation, + axisOnTop = (orientation == 'top'), + margin; + + if (options.margin && options.margin.item !== undefined) { + margin = options.margin.item; + } + else { + margin = this.defaultOptions.margin.item + } // calculate new, non-overlapping positions for (i = 0, iMax = ordered.length; i < iMax; i++) { @@ -3567,16 +3592,32 @@ function Component () { * {String | Number | function} [height] */ Component.prototype.setOptions = function setOptions(options) { - if (!options) { - return; - } + if (options) { + util.extend(this.options, options); - util.extend(this.options, options); + if (this.controller) { + this.requestRepaint(); + this.requestReflow(); + } + } +}; - if (this.controller) { - this.requestRepaint(); - this.requestReflow(); +/** + * Get an option value by name + * The function will first check this.options object, and else will check + * this.defaultOptions. + * @param {String} name + * @return {*} value + */ +Component.prototype.getOption = function getOption(name) { + var value; + if (this.options) { + value = this.options[name]; + } + if (value === undefined && this.defaultOptions) { + value = this.defaultOptions[name]; } + return value; }; /** @@ -3688,13 +3729,29 @@ function Panel(parent, depends, options) { this.id = util.randomUUID(); this.parent = parent; this.depends = depends; - this.options = {}; + + this.options = Object.create(parent && parent.options || null); this.setOptions(options); } Panel.prototype = new Component(); +/** + * Set options. Will extend the current options. + * @param {Object} [options] Available parameters: + * {String | function} [className] + * {String | Number | function} [left] + * {String | Number | function} [top] + * {String | Number | function} [width] + * {String | Number | function} [height] + */ +Panel.prototype.setOptions = function (options) { + if (options) { + util.extend(this.options, options); + } +}; + /** * Get the container element of the panel, which can be used by a child to * add its own widgets. @@ -3718,12 +3775,13 @@ Panel.prototype.repaint = function () { frame = document.createElement('div'); frame.className = 'panel'; - if (options.className) { - if (typeof options.className == 'function') { - util.addClassName(frame, String(options.className())); + var className = options.className; + if (className) { + if (typeof className == 'function') { + util.addClassName(frame, String(className())); } else { - util.addClassName(frame, String(options.className)); + util.addClassName(frame, String(className)); } } @@ -3783,7 +3841,9 @@ Panel.prototype.reflow = function () { function RootPanel(container, options) { this.id = util.randomUUID(); this.container = container; - this.options = { + + this.options = Object.create(options || null); + this.defaultOptions = { autoResize: true }; @@ -3802,13 +3862,15 @@ RootPanel.prototype = new Panel(); * {String | Number | function} [top] * {String | Number | function} [width] * {String | Number | function} [height] - * {String | Number | function} [height] * {Boolean | function} [autoResize] */ RootPanel.prototype.setOptions = function (options) { - util.extend(this.options, options); + if (options) { + util.extend(this.options, options); + } - if (this.options.autoResize) { + var autoResize = this.getOption('autoResize'); + if (autoResize) { this._watch(); } else { @@ -3830,8 +3892,9 @@ RootPanel.prototype.repaint = function () { frame = document.createElement('div'); frame.className = 'graph panel'; - if (options.className) { - util.addClassName(frame, util.option.asString(options.className)); + var className = options.className; + if (className) { + util.addClassName(frame, util.option.asString(className)); } this.frame = frame; @@ -3888,7 +3951,8 @@ RootPanel.prototype._watch = function () { this._unwatch(); var checkSize = function () { - if (!me.options.autoResize) { + var autoResize = me.getOption('autoResize'); + if (!autoResize) { // stop watching when the option autoResize is changed to false me._unwatch(); return; @@ -4009,7 +4073,8 @@ function TimeAxis (parent, depends, options) { lineTop: 0 }; - this.options = { + this.options = Object.create(parent && parent.options || null); + this.defaultOptions = { orientation: 'bottom', // supported: 'top', 'bottom' // TODO: implement timeaxis orientations 'left' and 'right' showMinorLabels: true, @@ -4026,7 +4091,9 @@ TimeAxis.prototype = new Component(); // TODO: comment options TimeAxis.prototype.setOptions = function (options) { - util.extend(this.options, options); + if (options) { + util.extend(this.options, options); + } }; /** @@ -4072,6 +4139,7 @@ TimeAxis.prototype.repaint = function () { update = util.updateProperty, asSize = util.option.asSize, options = this.options, + orientation = this.getOption('orientation'), props = this.props, step = this.step; @@ -4081,7 +4149,7 @@ TimeAxis.prototype.repaint = function () { this.frame = frame; changed += 1; } - frame.className = 'axis ' + options.orientation; + frame.className = 'axis ' + orientation; // TODO: custom className? if (!frame.parentNode) { @@ -4102,7 +4170,6 @@ TimeAxis.prototype.repaint = function () { var beforeChild = frame.nextSibling; parent.removeChild(frame); // take frame offline while updating (is almost twice as fast) - var orientation = options.orientation; var defaultTop = (orientation == 'bottom' && this.props.parentHeight && this.height) ? (this.props.parentHeight - this.height) + 'px' : '0px'; @@ -4128,11 +4195,11 @@ TimeAxis.prototype.repaint = function () { // TODO: lines must have a width, such that we can create css backgrounds - if (options.showMinorLabels) { + if (this.getOption('showMinorLabels')) { this._repaintMinorText(x, step.getLabelMinor()); } - if (isMajor && options.showMajorLabels) { + if (isMajor && this.getOption('showMajorLabels')) { if (x > 0) { if (xFirstMajorLabel == undefined) { xFirstMajorLabel = x; @@ -4149,7 +4216,7 @@ TimeAxis.prototype.repaint = function () { } // create a major label on the left when needed - if (options.showMajorLabels) { + if (this.getOption('showMajorLabels')) { var leftTime = this.toTime(0), leftText = step.getLabelMajor(leftTime), widthText = leftText.length * (props.majorCharWidth || 10) + 10; // upper bound estimation @@ -4321,7 +4388,7 @@ TimeAxis.prototype._repaintLine = function() { options = this.options; // line before all axis elements - if (options.showMinorLabels || options.showMajorLabels) { + if (this.getOption('showMinorLabels') || this.getOption('showMajorLabels')) { if (line) { // put this line at the end of all childs frame.removeChild(line); @@ -4397,8 +4464,8 @@ TimeAxis.prototype.reflow = function () { // calculate size of a character var props = this.props, - showMinorLabels = this.options.showMinorLabels, - showMajorLabels = this.options.showMajorLabels, + showMinorLabels = this.getOption('showMinorLabels'), + showMajorLabels = this.getOption('showMajorLabels'), measureCharMinor = this.dom.measureCharMinor, measureCharMajor = this.dom.measureCharMajor; if (measureCharMinor) { @@ -4415,7 +4482,7 @@ TimeAxis.prototype.reflow = function () { props.parentHeight = parentHeight; changed += 1; } - switch (this.options.orientation) { + switch (this.getOption('orientation')) { case 'bottom': props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0; props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0; @@ -4455,7 +4522,7 @@ TimeAxis.prototype.reflow = function () { break; default: - throw new Error('Unkown orientation "' + this.options.orientation + '"'); + throw new Error('Unkown orientation "' + this.getOption('orientation') + '"'); } var height = props.minorLabelHeight + props.majorLabelHeight; @@ -4517,7 +4584,8 @@ function ItemSet(parent, depends, options) { this.depends = depends; // one options object is shared by this itemset and all its items - this.options = { + this.options = Object.create(parent && parent.options || null); + this.defaultOptions = { style: 'box', align: 'center', orientation: 'bottom', @@ -4557,9 +4625,7 @@ function ItemSet(parent, depends, options) { this.stack = new Stack(this); this.conversion = null; - if (options) { - this.setOptions(options); - } + this.setOptions(options); } ItemSet.prototype = new Panel(); @@ -4597,11 +4663,11 @@ ItemSet.types = { * Must correspond with the items css. Default is 5. */ ItemSet.prototype.setOptions = function setOptions(options) { - util.extend(this.options, options); + if (options) { + util.extend(this.options, options); + } // TODO: ItemSet should also attach event listeners for rangechange and rangechanged, like timeaxis - - this.stack.setOptions(this.options); }; /** @@ -4625,14 +4691,17 @@ ItemSet.prototype.repaint = function repaint() { update = util.updateProperty, asSize = util.option.asSize, options = this.options, + orientation = this.getOption('orientation'), + defaultOptions = this.defaultOptions, frame = this.frame; if (!frame) { frame = document.createElement('div'); frame.className = 'itemset'; - if (options.className) { - util.addClassName(frame, util.option.asString(options.className)); + var className = options.className; + if (className) { + util.addClassName(frame, util.option.asString(className)); } // create background panel @@ -4682,7 +4751,7 @@ ItemSet.prototype.repaint = function repaint() { // reposition axis changed += update(this.dom.axis.style, 'left', asSize(options.left, '0px')); changed += update(this.dom.axis.style, 'width', asSize(options.width, '100%')); - if (this.options.orientation == 'bottom') { + if (orientation == 'bottom') { changed += update(this.dom.axis.style, 'top', (this.height + this.top) + 'px'); } else { // orientation == 'top' @@ -4735,7 +4804,7 @@ ItemSet.prototype.repaint = function repaint() { if (!item) { // create item if (constructor) { - item = new constructor(me, itemData, options); + item = new constructor(me, itemData, options, defaultOptions); changed++; } else { @@ -4811,6 +4880,8 @@ ItemSet.prototype.getAxis = function getAxis() { ItemSet.prototype.reflow = function reflow () { var changed = 0, options = this.options, + marginAxis = options.margin && options.margin.axis || this.defaultOptions.margin.axis, + marginItem = options.margin && options.margin.item || this.defaultOptions.margin.item, update = util.updateProperty, asNumber = util.option.asNumber, frame = this.frame; @@ -4841,10 +4912,10 @@ ItemSet.prototype.reflow = function reflow () { min = Math.min(min, item.top); max = Math.max(max, (item.top + item.height)); }); - height = (max - min) + options.margin.axis + options.margin.item; + height = (max - min) + marginAxis + marginItem; } else { - height = options.margin.axis + options.margin.item; + height = marginAxis + marginItem; } } if (maxHeight != null) { @@ -5029,16 +5100,18 @@ ItemSet.prototype.toScreen = function toScreen(time) { /** * @constructor Item * @param {ItemSet} parent - * @param {Object} data Object containing (optional) parameters type, - * start, end, content, group, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing (optional) parameters type, + * start, end, content, group, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function Item (parent, data, options) { +function Item (parent, data, options, defaultOptions) { this.parent = parent; this.data = data; this.dom = null; - this.options = options; + this.options = options || {}; + this.defaultOptions = defaultOptions || {}; this.selected = false; this.visible = false; @@ -5100,12 +5173,13 @@ Item.prototype.reflow = function reflow() { * @constructor ItemBox * @extends Item * @param {ItemSet} parent - * @param {Object} data Object containing parameters start - * content, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing parameters start + * content, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function ItemBox (parent, data, options) { +function ItemBox (parent, data, options, defaultOptions) { this.props = { dot: { left: 0, @@ -5121,7 +5195,7 @@ function ItemBox (parent, data, options) { } }; - Item.call(this, parent, data, options); + Item.call(this, parent, data, options, defaultOptions); } ItemBox.prototype = new Item (null, null); @@ -5160,7 +5234,7 @@ ItemBox.prototype.repaint = function repaint() { } if (dom) { - if (!this.options && !this.parent) { + if (!this.parent) { throw new Error('Cannot repaint item: no parent attached'); } var foreground = this.parent.getForeground(); @@ -5270,6 +5344,7 @@ ItemBox.prototype.reflow = function reflow() { dom, props, options, + margin, start, align, orientation, @@ -5299,8 +5374,9 @@ ItemBox.prototype.reflow = function reflow() { props = this.props; options = this.options; start = this.parent.toScreen(this.data.start); - align = options && options.align; - orientation = options && options.orientation; + align = options.align || this.defaultOptions.align; + margin = options.margin && options.margin.axis || this.defaultOptions.margin.axis; + orientation = options.orientation || this.defaultOptions.orientation; changed += update(props.dot, 'height', dom.dot.offsetHeight); changed += update(props.dot, 'width', dom.dot.offsetWidth); @@ -5325,14 +5401,14 @@ ItemBox.prototype.reflow = function reflow() { update(props.dot, 'left', start - props.dot.width / 2); update(props.dot, 'top', -props.dot.height / 2); if (orientation == 'top') { - top = options.margin.axis; + top = margin; update(this, 'top', top); } else { // default or 'bottom' var parentHeight = this.parent.height; - top = parentHeight - this.height - options.margin.axis; + top = parentHeight - this.height - margin; update(this, 'top', top); } @@ -5381,7 +5457,7 @@ ItemBox.prototype._create = function _create() { ItemBox.prototype.reposition = function reposition() { var dom = this.dom, props = this.props, - orientation = this.options.orientation; + orientation = this.options.orientation || this.defaultOptions.orientation; if (dom) { var box = dom.box, @@ -5412,12 +5488,13 @@ ItemBox.prototype.reposition = function reposition() { * @constructor ItemPoint * @extends Item * @param {ItemSet} parent - * @param {Object} data Object containing parameters start - * content, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing parameters start + * content, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function ItemPoint (parent, data, options) { +function ItemPoint (parent, data, options, defaultOptions) { this.props = { dot: { top: 0, @@ -5430,7 +5507,7 @@ function ItemPoint (parent, data, options) { } }; - Item.call(this, parent, data, options); + Item.call(this, parent, data, options, defaultOptions); } ItemPoint.prototype = new Item (null, null); @@ -5469,7 +5546,7 @@ ItemPoint.prototype.repaint = function repaint() { } if (dom) { - if (!this.options && !this.options.parent) { + if (!this.parent) { throw new Error('Cannot repaint item: no parent attached'); } var foreground = this.parent.getForeground(); @@ -5554,6 +5631,7 @@ ItemPoint.prototype.reflow = function reflow() { dom, props, options, + margin, orientation, start, top, @@ -5580,7 +5658,8 @@ ItemPoint.prototype.reflow = function reflow() { update = util.updateProperty; props = this.props; options = this.options; - orientation = options.orientation; + orientation = options.orientation || this.defaultOptions.orientation; + margin = options.margin && options.margin.axis || this.defaultOptions.margin.axis; start = this.parent.toScreen(this.data.start); changed += update(this, 'width', dom.point.offsetWidth); @@ -5590,12 +5669,12 @@ ItemPoint.prototype.reflow = function reflow() { changed += update(props.content, 'height', dom.content.offsetHeight); if (orientation == 'top') { - top = options.margin.axis; + top = margin; } else { // default or 'bottom' var parentHeight = this.parent.height; - top = Math.max(parentHeight - this.height - options.margin.axis, 0); + top = Math.max(parentHeight - this.height - margin, 0); } changed += update(this, 'top', top); changed += update(this, 'left', start - props.dot.width / 2); @@ -5661,12 +5740,13 @@ ItemPoint.prototype.reposition = function reposition() { * @constructor ItemRange * @extends Item * @param {ItemSet} parent - * @param {Object} data Object containing parameters start, end - * content, className. - * @param {Object} [options] Options to set initial property values - * // TODO: describe available options + * @param {Object} data Object containing parameters start, end + * content, className. + * @param {Object} [options] Options to set initial property values + * @param {Object} [defaultOptions] default options + * // TODO: describe available options */ -function ItemRange (parent, data, options) { +function ItemRange (parent, data, options, defaultOptions) { this.props = { content: { left: 0, @@ -5674,7 +5754,7 @@ function ItemRange (parent, data, options) { } }; - Item.call(this, parent, data, options); + Item.call(this, parent, data, options, defaultOptions); } ItemRange.prototype = new Item (null, null); @@ -5713,7 +5793,7 @@ ItemRange.prototype.repaint = function repaint() { } if (dom) { - if (!this.options && !this.options.parent) { + if (!this.parent) { throw new Error('Cannot repaint item: no parent attached'); } var foreground = this.parent.getForeground(); @@ -5795,6 +5875,8 @@ ItemRange.prototype.reflow = function reflow() { dom, props, options, + margin, + padding, parent, start, end, @@ -5835,7 +5917,9 @@ ItemRange.prototype.reflow = function reflow() { update = util.updateProperty; box = dom.box; parentWidth = parent.width; - orientation = options.orientation; + orientation = options.orientation || this.defaultOptions.orientation; + margin = options.margin && options.margin.axis || this.defaultOptions.margin.axis; + padding = options.padding || this.defaultOptions.padding; changed += update(props.content, 'width', dom.content.offsetWidth); @@ -5852,7 +5936,7 @@ ItemRange.prototype.reflow = function reflow() { // when range exceeds left of the window, position the contents at the left of the visible area if (start < 0) { contentLeft = Math.min(-start, - (end - start - props.content.width - 2 * options.padding)); + (end - start - props.content.width - 2 * padding)); // TODO: remove the need for options.padding. it's terrible. } else { @@ -5861,12 +5945,12 @@ ItemRange.prototype.reflow = function reflow() { changed += update(props.content, 'left', contentLeft); if (orientation == 'top') { - top = options.margin.axis; + top = margin; changed += update(this, 'top', top); } else { // default or 'bottom' - top = parent.height - this.height - options.margin.axis; + top = parent.height - this.height - margin; changed += update(this, 'top', top); } @@ -5933,7 +6017,8 @@ function Group (parent, groupId, options) { this.groupId = groupId; this.itemsData = null; // DataSet this.items = null; // ItemSet - this.options = {}; + this.options = Object.create(parent && parent.options || null); + this.options.top = 0; this.top = 0; this.left = 0; @@ -5948,13 +6033,18 @@ Group.prototype = new Component(); Group.prototype.setOptions = function setOptions(options) { if (options) { util.extend(this.options, options); - - if (this.items) { - this.items.setOptions(this.options); - } } }; +/** + * Get the container element of the panel, which can be used by a child to + * add its own widgets. + * @returns {HTMLElement} container + */ +Group.prototype.getContainer = function () { + return this.parent.getContainer(); +}; + /** * Set item set for the group. The group will create a view on the itemset, * filtered by the groups id. @@ -5972,8 +6062,7 @@ Group.prototype.setItems = function setItems(items) { if (items || true) { var groupId = this.groupId; - this.items = new ItemSet(this.parent); - //this.items.setOptions(this.options); // TODO: copy only a specific set of options + this.items = new ItemSet(this); this.items.setRange(this.parent.range); this.view = new DataView(items, { @@ -6000,7 +6089,13 @@ Group.prototype.repaint = function repaint() { * @return {Boolean} resized */ Group.prototype.reflow = function reflow() { - return false; + var changed = 0, + update = util.updateProperty; + + changed += update(this, 'top', this.items ? this.items.top : 0); + changed += update(this, 'height', this.items ? this.items.height : 0); + + return (changed > 0); }; /** @@ -6018,7 +6113,7 @@ function GroupSet(parent, depends, options) { this.parent = parent; this.depends = depends; - this.options = {}; + this.options = Object.create(parent && parent.options || null); this.range = null; // Range or Object {start: number, end: number} this.itemsData = null; // DataSet with items @@ -6042,31 +6137,20 @@ function GroupSet(parent, depends, options) { } }; - if (options) { - this.setOptions(options); - } + this.setOptions(options); } GroupSet.prototype = new Panel(); /** - * Set options for the ItemSet. Existing options will be extended/overwritten. + * Set options for the GroupSet. Existing options will be extended/overwritten. * @param {Object} [options] The following options are available: * TODO: describe options */ GroupSet.prototype.setOptions = function setOptions(options) { - util.extend(this.options, options); - - // TODO: implement options - - /* TODO: only apply known options to the itemsets, must not override options.top - var me = this; - util.forEach(this.groups, function (group) { - if (group.items) { - group.items.setOptions(me.options); - } - }); - */ + if (options) { + util.extend(this.options, options); + } }; GroupSet.prototype.setRange = function (range) { @@ -6080,7 +6164,7 @@ GroupSet.prototype.setRange = function (range) { GroupSet.prototype.setItems = function setItems(items) { this.itemsData = items; - util.forEach(this.groups, function (group) { + this.groups.forEach(function (group) { group.setItems(items); }); }; @@ -6173,8 +6257,9 @@ GroupSet.prototype.repaint = function repaint() { frame = document.createElement('div'); frame.className = 'groupset'; - if (options.className) { - util.addClassName(frame, util.option.asString(options.className)); + var className = options.className; + if (className) { + util.addClassName(frame, util.option.asString(className)); } this.frame = frame; @@ -6226,8 +6311,7 @@ GroupSet.prototype.repaint = function repaint() { case 'add': case 'update': if (!group) { - var options = util.extend({}, me.options, {top: 0}); - group = new Group(me, id, options); + group = new Group(me, id); group.setItems(me.itemsData); // attach items data groups.push(group); @@ -6259,29 +6343,21 @@ GroupSet.prototype.repaint = function repaint() { // the groupset depends on each of the groups //this.depends = this.groups; // TODO: gives a circular reference through the parent - } - - // TODO: the functions for top should be re-created only when groups are changed! (must be put inside the if-block above) - // update the top position (TODO: optimize, needed only when groups are added/removed/reordered - // TODO: apply dependencies of the groupset - var prevGroup = null; - util.forEach(this.groups, function (group) { - // TODO: top function must be applied to the group instead of the groups itemset. - // the group must then apply it to its itemset - // (right now the created function top is removed when the group replaces its itemset - var prevItems = prevGroup && prevGroup.items; - if (group.items) { - if (prevItems) { - group.items.options.top = function () { - return prevItems.top + prevItems.height; + // TODO: apply dependencies of the groupset + this.groups.forEach(function (group, index) { + var prevGroup = me.groups[index - 1], + top = 0; + if (prevGroup) { + top = function () { + return prevGroup.top + prevGroup.height; } } - else { - group.items.options.top = 0; - } - } - prevGroup = group; - }); + group.setOptions({ + top: top + }); + }); + + } return (changed > 0); }; @@ -6315,10 +6391,8 @@ GroupSet.prototype.reflow = function reflow() { else { // height is not specified, calculate the sum of the height of all groups height = 0; - util.forEach(this.groups, function (group) { - if (group.items) { - height += group.items.height; - } + this.groups.forEach(function (group) { + height += group.height; }); } if (maxHeight != null) { @@ -6417,10 +6491,15 @@ function Timeline (container, items, options) { var me = this; this.options = { orientation: 'bottom', + min: null, + max: null, zoomMin: 10, // milliseconds zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000, // milliseconds moveable: true, - zoomable: true + zoomable: true, + showMinorLabels: true, + showMajorLabels: true, + autoResize: false }; // controller @@ -6430,9 +6509,8 @@ function Timeline (container, items, options) { if (!container) { throw new Error('No container element provided'); } - this.main = new RootPanel(container, { - autoResize: false - }); + var mainOptions = Object.create(this.options); + this.main = new RootPanel(container, mainOptions); this.controller.add(this.main); // range @@ -6456,10 +6534,9 @@ function Timeline (container, items, options) { // TODO: put the listeners in setOptions, be able to dynamically change with options moveable and zoomable // time axis - this.timeaxis = new TimeAxis(this.main, [], { - orientation: this.options.orientation, - range: this.range - }); + var timeaxisOptions = Object.create(this.options); + timeaxisOptions.range = this.range; + this.timeaxis = new TimeAxis(this.main, [], timeaxisOptions); this.timeaxis.setRange(this.range); this.controller.add(this.timeaxis); @@ -6470,9 +6547,7 @@ function Timeline (container, items, options) { this.groupsData = null; // DataSet // set options (must take place before setting the data) - if (options) { - this.setOptions(options); - } + this.setOptions(options); // set data if (items) { @@ -6485,24 +6560,10 @@ function Timeline (container, items, options) { * @param {Object} options TODO: describe the available options */ Timeline.prototype.setOptions = function (options) { - util.extend(this.options, options); - - // update options the timeaxis - this.timeaxis.setOptions({ - orientation: this.options.orientation, - showMinorLabels: this.options.showMinorLabels, - showMajorLabels: this.options.showMajorLabels - }); - - // update options for the range - this.range.setOptions({ - min: this.options.min, - max: this.options.max, - zoomMin: this.options.zoomMin, - zoomMax: this.options.zoomMax - }); + if (options) { + util.extend(this.options, options); + } - // update options the content var itemsTop, itemsHeight, mainHeight, @@ -6550,7 +6611,6 @@ Timeline.prototype.setOptions = function (options) { }); this.content.setOptions({ - orientation: this.options.orientation, top: itemsTop, height: itemsHeight, maxHeight: maxHeight @@ -6754,7 +6814,7 @@ if (typeof window !== 'undefined') { } // inject css -util.loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .groupset {\n position: absolute;\n padding: 0;\n margin: 0;\n}\n\n\n.graph .itemset {\n position: absolute;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.graph .background {\n}\n\n.graph .foreground {\n}\n\n.graph .itemset-axis {\n position: absolute;\n}\n\n.graph .groupset .itemset-axis {\n border-top: 1px solid #bfbfbf;\n}\n\n.graph .groupset .itemset-axis:last-child {\n border-top: none;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n"); +util.loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .groupset {\n position: absolute;\n padding: 0;\n margin: 0;\n}\n\n\n.graph .itemset {\n position: absolute;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.graph .background {\n}\n\n.graph .foreground {\n}\n\n.graph .itemset-axis {\n position: absolute;\n}\n\n.graph .groupset .itemset-axis {\n border-top: 1px solid #bfbfbf;\n}\n\n/* TODO: with orientation=='bottom', this will more or less overlap with timeline axis\n.graph .groupset .itemset-axis:last-child {\n border-top: none;\n}\n*/\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n"); },{"moment":2}],2:[function(require,module,exports){ (function(){// moment.js diff --git a/vis.min.js b/vis.min.js index f968a9db..66022bdd 100644 --- a/vis.min.js +++ b/vis.min.js @@ -22,6 +22,6 @@ * License for the specific language governing permissions and limitations under * the License. */ -(function(t){if("function"==typeof bootstrap)bootstrap("vis",t);else if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeVis=t}else"undefined"!=typeof window?window.vis=t():global.vis=t()})(function(){var t;return function(t,e,i){function n(i,r){if(!e[i]){if(!t[i]){var o="function"==typeof require&&require;if(!r&&o)return o(i,!0);if(s)return s(i,!0);throw Error("Cannot find module '"+i+"'")}var a=e[i]={exports:{}};t[i][0].call(a.exports,function(e){var s=t[i][1][e];return n(s?s:e)},a,a.exports)}return e[i].exports}for(var s="function"==typeof require&&require,r=0;i.length>r;r++)n(i[r]);return n}({1:[function(e,i,n){function s(t){if(this.id=E.randomUUID(),this.options=t||{},this.data={},this.fieldId=this.options.fieldId||"id",this.fieldTypes={},this.options.fieldTypes)for(var e in this.options.fieldTypes)if(this.options.fieldTypes.hasOwnProperty(e)){var i=this.options.fieldTypes[e];this.fieldTypes[e]="Date"==i||"ISODate"==i||"ASPDate"==i?"Date":i}this.subscribers={},this.internalIds={}}function r(t,e){this.id=E.randomUUID(),this.data=null,this.ids={},this.options=e||{},this.fieldId="id",this.subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}function o(t,e){this.parent=t,this.options={order:function(t,e){if(t instanceof y){if(e instanceof y){var i=t.data.end-t.data.start,n=e.data.end-e.data.start;return i-n||t.data.start-e.data.start}return-1}return e instanceof y?1:t.data.start-e.data.start}},this.ordered=[],this.setOptions(e)}function a(t){this.id=E.randomUUID(),this.start=0,this.end=0,this.options={min:null,max:null,zoomMin:null,zoomMax:null},this.setOptions(t),this.listeners=[]}function h(){this.subscriptions=[]}function p(){this.id=E.randomUUID(),this.components={},this.repaintTimer=void 0,this.reflowTimer=void 0}function u(){this.id=null,this.parent=null,this.depends=null,this.controller=null,this.options=null,this.frame=null,this.top=0,this.left=0,this.width=0,this.height=0}function c(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.options={},this.setOptions(i)}function d(t,e){this.id=E.randomUUID(),this.container=t,this.options={autoResize:!0},this.listeners={},this.setOptions(e)}function l(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.dom={majorLines:[],majorTexts:[],minorLines:[],minorTexts:[],redundant:{majorLines:[],majorTexts:[],minorLines:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.options={orientation:"bottom",showMinorLabels:!0,showMajorLabels:!0},this.conversion=null,this.range=null,this.setOptions(i)}function f(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.options={style:"box",align:"center",orientation:"bottom",margin:{axis:20,item:10},padding:5},this.dom={};var n=this;this.itemsData=null,this.range=null,this.listeners={add:function(t,e,i){i!=n.id&&n._onAdd(e.items)},update:function(t,e,i){i!=n.id&&n._onUpdate(e.items)},remove:function(t,e,i){i!=n.id&&n._onRemove(e.items)}},this.items={},this.queue={},this.stack=new o(this),this.conversion=null,i&&this.setOptions(i)}function m(t,e,i){this.parent=t,this.data=e,this.dom=null,this.options=i,this.selected=!1,this.visible=!1,this.top=0,this.left=0,this.width=0,this.height=0}function g(t,e,i){this.props={dot:{left:0,top:0,width:0,height:0},line:{top:0,left:0,width:0,height:0}},m.call(this,t,e,i)}function v(t,e,i){this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0}},m.call(this,t,e,i)}function y(t,e,i){this.props={content:{left:0,width:0}},m.call(this,t,e,i)}function w(t,e,i){this.id=E.randomUUID(),this.parent=t,this.groupId=e,this.itemsData=null,this.items=null,this.options={},this.top=0,this.left=0,this.width=0,this.height=0,this.setOptions(i)}function b(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.options={},this.range=null,this.itemsData=null,this.groupsData=null,this.groups=[],this.queue={};var n=this;this.listeners={add:function(t,e){n._onAdd(e.items)},update:function(t,e){n._onUpdate(e.items)},remove:function(t,e){n._onRemove(e.items)}},i&&this.setOptions(i)}function S(t,e,i){var n=this;if(this.options={orientation:"bottom",zoomMin:10,zoomMax:31536e10,moveable:!0,zoomable:!0},this.controller=new p,!t)throw Error("No container element provided");this.main=new d(t,{autoResize:!1}),this.controller.add(this.main);var s=T().hours(0).minutes(0).seconds(0).milliseconds(0);this.range=new a({start:s.clone().add("days",-3).valueOf(),end:s.clone().add("days",4).valueOf()}),this.range.subscribe(this.main,"move","horizontal"),this.range.subscribe(this.main,"zoom","horizontal"),this.range.on("rangechange",function(){var t=!0;n.controller.requestReflow(t)}),this.range.on("rangechanged",function(){var t=!0;n.controller.requestReflow(t)}),this.timeaxis=new l(this.main,[],{orientation:this.options.orientation,range:this.range}),this.timeaxis.setRange(this.range),this.controller.add(this.timeaxis),this.setGroups(null),this.itemsData=null,this.groupsData=null,i&&this.setOptions(i),e&&this.setItems(e)}var T=e("moment"),E={};E.isNumber=function(t){return t instanceof Number||"number"==typeof t},E.isString=function(t){return t instanceof String||"string"==typeof t},E.isDate=function(t){if(t instanceof Date)return!0;if(E.isString(t)){var e=M.exec(t);if(e)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},E.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},E.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},E.extend=function(t){for(var e=1,i=arguments.length;i>e;e++){var n=arguments[e];for(var s in n)n.hasOwnProperty(s)&&void 0!==n[s]&&(t[s]=n[s])}return t},E.cast=function(t,e){var i;if(void 0===t)return void 0;if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t);case"string":case"String":return t+"";case"Date":if(E.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(T.isMoment(t))return new Date(t.valueOf());if(E.isString(t))return i=M.exec(t),i?new Date(Number(i[1])):T(t).toDate();throw Error("Cannot cast object of type "+E.getType(t)+" to type Date");case"Moment":if(E.isNumber(t))return T(t);if(t instanceof Date)return T(t.valueOf());if(T.isMoment(t))return T.clone();if(E.isString(t))return i=M.exec(t),i?T(Number(i[1])):T(t);throw Error("Cannot cast object of type "+E.getType(t)+" to type Date");case"ISODate":if(t instanceof Date)return t.toISOString();if(T.isMoment(t))return t.toDate().toISOString();if(E.isNumber(t)||E.isString(t))return T(t).toDate().toISOString();throw Error("Cannot cast object of type "+E.getType(t)+" to type ISODate");case"ASPDate":if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(E.isNumber(t)||E.isString(t))return"/Date("+T(t).valueOf()+")/";throw Error("Cannot cast object of type "+E.getType(t)+" to type ASPDate");default:throw Error("Cannot cast object of type "+E.getType(t)+' to type "'+e+'"')}};var M=/^\/?Date\((\-?\d+)/i;if(E.getType=function(t){var e=typeof t;return"object"==e?null==t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":t instanceof Array?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":e},E.getAbsoluteLeft=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetLeft,s=t.offsetParent;null!=s&&s!=i&&s!=e;)n+=s.offsetLeft,n-=s.scrollLeft,s=s.offsetParent;return n},E.getAbsoluteTop=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetTop,s=t.offsetParent;null!=s&&s!=i&&s!=e;)n+=s.offsetTop,n-=s.scrollTop,s=s.offsetParent;return n},E.getPageY=function(t){if("pageY"in t)return t.pageY;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientY:t.clientY;var i=document.documentElement,n=document.body;return e+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)},E.getPageX=function(t){if("pageY"in t)return t.pageX;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientX:t.clientX;var i=document.documentElement,n=document.body;return e+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0)},E.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},E.removeClassName=function(t,e){var i=t.className.split(" "),n=i.indexOf(e);-1!=n&&(i.splice(n,1),t.className=i.join(" "))},E.forEach=function(t,e){var i,n;if(t instanceof Array)for(i=0,n=t.length;n>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},E.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},E.addEventListener=function(t,e,i,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)},E.removeEventListener=function(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)},E.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},E.stopPropagation=function(t){t||(t=window.event),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},E.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},E.option={},E.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},E.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},E.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?t+"":e||null},E.option.asSize=function(t,e){return"function"==typeof t&&(t=t()),E.isString(t)?t:E.isNumber(t)?t+"px":e||null},E.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},E.loadCss=function(t){if("undefined"!=typeof document){var e=document.createElement("style");e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(e)}},!Array.prototype.indexOf){Array.prototype.indexOf=function(t){for(var e=0;this.length>e;e++)if(this[e]==t)return e;return-1};try{console.log("Warning: Ancient browser detected. Please update your browser")}catch(D){}}Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var i=0,n=this.length;n>i;++i)t.call(e||this,this[i],i,this)}),Array.prototype.map||(Array.prototype.map=function(t,e){var i,n,s;if(null==this)throw new TypeError(" this is null or not defined");var r=Object(this),o=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(e&&(i=e),n=Array(o),s=0;o>s;){var a,h;s in r&&(a=r[s],h=t.call(i,a,s,r),n[s]=h),s++}return n}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=[],s=arguments[1],r=0;i>r;r++)if(r in e){var o=e[r];t.call(s,o,r,e)&&n.push(o)}return n}),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=i.length;return function(s){if("object"!=typeof s&&"function"!=typeof s||null===s)throw new TypeError("Object.keys called on non-object");var r=[];for(var o in s)t.call(s,o)&&r.push(o);if(e)for(var a=0;n>a;a++)t.call(s,i[a])&&r.push(i[a]);return r}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),i=this,n=function(){},s=function(){return i.apply(this instanceof n&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,s.prototype=new n,s});var _={listeners:[],indexOf:function(t){for(var e=this.listeners,i=0,n=this.listeners.length;n>i;i++){var s=e[i];if(s&&s.object==t)return i}return-1},addListener:function(t,e,i){var n=this.indexOf(t),s=this.listeners[n];s||(s={object:t,events:{}},this.listeners.push(s));var r=s.events[e];r||(r=[],s.events[e]=r),-1==r.indexOf(i)&&r.push(i)},removeListener:function(t,e,i){var n=this.indexOf(t),s=this.listeners[n];if(s){var r=s.events[e];r&&(n=r.indexOf(i),-1!=n&&r.splice(n,1),0==r.length&&delete s.events[e]);var o=0,a=s.events;for(var h in a)a.hasOwnProperty(h)&&o++;0==o&&delete this.listeners[n]}},removeAllListeners:function(){this.listeners=[]},trigger:function(t,e,i){var n=this.indexOf(t),s=this.listeners[n];if(s){var r=s.events[e];if(r)for(var o=0,a=r.length;a>o;o++)r[o](i)}}};TimeStep=function(t,e,i){this.current=new Date,this._start=new Date,this._end=new Date,this.autoScale=!0,this.scale=TimeStep.SCALE.DAY,this.step=1,this.setRange(t,e,i)},TimeStep.SCALE={MILLISECOND:1,SECOND:2,MINUTE:3,HOUR:4,DAY:5,WEEKDAY:6,MONTH:7,YEAR:8},TimeStep.prototype.setRange=function(t,e,i){t instanceof Date&&e instanceof Date&&(this._start=void 0!=t?new Date(t.valueOf()):new Date,this._end=void 0!=e?new Date(e.valueOf()):new Date,this.autoScale&&this.setMinimumStep(i))},TimeStep.prototype.first=function(){this.current=new Date(this._start.valueOf()),this.roundToMinor()},TimeStep.prototype.roundToMinor=function(){switch(this.scale){case TimeStep.SCALE.YEAR:this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step)),this.current.setMonth(0);case TimeStep.SCALE.MONTH:this.current.setDate(1);case TimeStep.SCALE.DAY:case TimeStep.SCALE.WEEKDAY:this.current.setHours(0);case TimeStep.SCALE.HOUR:this.current.setMinutes(0);case TimeStep.SCALE.MINUTE:this.current.setSeconds(0);case TimeStep.SCALE.SECOND:this.current.setMilliseconds(0)}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step);break;default:}},TimeStep.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},TimeStep.prototype.next=function(){var t=this.current.valueOf();if(6>this.current.getMonth())switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current=new Date(this.current.valueOf()+1e3*this.step);break;case TimeStep.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+60*1e3*this.step);break;case TimeStep.SCALE.HOUR:this.current=new Date(this.current.valueOf()+60*60*1e3*this.step);var e=this.current.getHours();this.current.setHours(e-e%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}else switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.getMilliseconds()0&&(this.step=e),this.autoScale=!1},TimeStep.prototype.setAutoScale=function(t){this.autoScale=t},TimeStep.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,n=864e5,s=36e5,r=6e4,o=1e3,a=1;1e3*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1e3),500*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=500),100*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=100),50*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=50),10*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=10),5*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=5),e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1),3*i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=3),i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=1),5*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=5),2*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=2),n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=1),n/2>t&&(this.scale=TimeStep.SCALE.WEEKDAY,this.step=1),4*s>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=4),s>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=1),15*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=15),10*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=10),5*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=5),r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=1),15*o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=15),10*o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=10),5*o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=5),o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=1),200*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=200),100*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=100),50*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=50),10*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=10),5*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=5),a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=1)}},TimeStep.prototype.snap=function(t){if(this.scale==TimeStep.SCALE.YEAR){var e=t.getFullYear()+Math.round(t.getMonth()/12);t.setFullYear(Math.round(e/this.step)*this.step),t.setMonth(0),t.setDate(0),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MONTH)t.getDate()>15?(t.setDate(1),t.setMonth(t.getMonth()+1)):t.setDate(1),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);else if(this.scale==TimeStep.SCALE.DAY||this.scale==TimeStep.SCALE.WEEKDAY){switch(this.step){case 5:case 2:t.setHours(24*Math.round(t.getHours()/24));break;default:t.setHours(12*Math.round(t.getHours()/12))}t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.HOUR){switch(this.step){case 4:t.setMinutes(60*Math.round(t.getMinutes()/60));break;default:t.setMinutes(30*Math.round(t.getMinutes()/30))}t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MINUTE){switch(this.step){case 15:case 10:t.setMinutes(5*Math.round(t.getMinutes()/5)),t.setSeconds(0);break;case 5:t.setSeconds(60*Math.round(t.getSeconds()/60));break;default:t.setSeconds(30*Math.round(t.getSeconds()/30))}t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.SECOND)switch(this.step){case 15:case 10:t.setSeconds(5*Math.round(t.getSeconds()/5)),t.setMilliseconds(0);break;case 5:t.setMilliseconds(1e3*Math.round(t.getMilliseconds()/1e3));break;default:t.setMilliseconds(500*Math.round(t.getMilliseconds()/500))}else if(this.scale==TimeStep.SCALE.MILLISECOND){var i=this.step>5?this.step/2:1;t.setMilliseconds(Math.round(t.getMilliseconds()/i)*i)}},TimeStep.prototype.isMajor=function(){switch(this.scale){case TimeStep.SCALE.MILLISECOND:return 0==this.current.getMilliseconds();case TimeStep.SCALE.SECOND:return 0==this.current.getSeconds();case TimeStep.SCALE.MINUTE:return 0==this.current.getHours()&&0==this.current.getMinutes();case TimeStep.SCALE.HOUR:return 0==this.current.getHours();case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return 1==this.current.getDate();case TimeStep.SCALE.MONTH:return 0==this.current.getMonth();case TimeStep.SCALE.YEAR:return!1;default:return!1}},TimeStep.prototype.getLabelMinor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return T(t).format("SSS");case TimeStep.SCALE.SECOND:return T(t).format("s");case TimeStep.SCALE.MINUTE:return T(t).format("HH:mm");case TimeStep.SCALE.HOUR:return T(t).format("HH:mm");case TimeStep.SCALE.WEEKDAY:return T(t).format("ddd D");case TimeStep.SCALE.DAY:return T(t).format("D");case TimeStep.SCALE.MONTH:return T(t).format("MMM");case TimeStep.SCALE.YEAR:return T(t).format("YYYY");default:return""}},TimeStep.prototype.getLabelMajor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return T(t).format("HH:mm:ss");case TimeStep.SCALE.SECOND:return T(t).format("D MMMM HH:mm");case TimeStep.SCALE.MINUTE:case TimeStep.SCALE.HOUR:return T(t).format("ddd D MMMM");case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return T(t).format("MMMM YYYY");case TimeStep.SCALE.MONTH:return T(t).format("YYYY");case TimeStep.SCALE.YEAR:return"";default:return""}},s.prototype.subscribe=function(t,e,i){var n=this.subscribers[t];n||(n=[],this.subscribers[t]=n),n.push({id:i?i+"":null,callback:e})},s.prototype.unsubscribe=function(t,e){var i=this.subscribers[t];i&&(this.subscribers[t]=i.filter(function(t){return t.callback!=e}))},s.prototype._trigger=function(t,e,i){if("*"==t)throw Error("Cannot trigger event *");var n=[];t in this.subscribers&&(n=n.concat(this.subscribers[t])),"*"in this.subscribers&&(n=n.concat(this.subscribers["*"]));for(var s=0;n.length>s;s++){var r=n[s];r.callback&&r.callback(t,e,i||null)}},s.prototype.add=function(t,e){var i,n=[],s=this;if(t instanceof Array)for(var r=0,o=t.length;o>r;r++)i=s._addItem(t[r]),n.push(i);else if(E.isDataTable(t))for(var a=this._getColumnNames(t),h=0,p=t.getNumberOfRows();p>h;h++){for(var u={},c=0,d=a.length;d>c;c++){var l=a[c];u[l]=t.getValue(h,c)}i=s._addItem(u),n.push(i)}else{if(!(t instanceof Object))throw Error("Unknown dataType");i=s._addItem(t),n.push(i)}n.length&&this._trigger("add",{items:n},e)},s.prototype.update=function(t,e){var i=[],n=[],s=this,r=s.fieldId,o=function(t){var e=t[r];s.data[e]?(e=s._updateItem(t),n.push(e)):(e=s._addItem(t),i.push(e))};if(t instanceof Array)for(var a=0,h=t.length;h>a;a++)o(t[a]);else if(E.isDataTable(t))for(var p=this._getColumnNames(t),u=0,c=t.getNumberOfRows();c>u;u++){for(var d={},l=0,f=p.length;f>l;l++){var m=p[l];d[m]=t.getValue(u,l)}o(d)}else{if(!(t instanceof Object))throw Error("Unknown dataType");o(t)}i.length&&this._trigger("add",{items:i},e),n.length&&this._trigger("update",{items:n},e)},s.prototype.get=function(){var t,e,i,n,s=this,r=E.getType(arguments[0]);"String"==r||"Number"==r?(t=arguments[0],i=arguments[1],n=arguments[2]):"Array"==r?(e=arguments[0],i=arguments[1],n=arguments[2]):(i=arguments[0],n=arguments[1]);var o;if(i&&i.type){if(o="DataTable"==i.type?"DataTable":"Array",n&&o!=E.getType(n))throw Error('Type of parameter "data" ('+E.getType(n)+") "+"does not correspond with specified options.type ("+i.type+")");if("DataTable"==o&&!E.isDataTable(n))throw Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else o=n?"DataTable"==E.getType(n)?"DataTable":"Array":"Array";var a,h,p,u,c=this._composeItemOptions(i);if("DataTable"==o){var d=this._getColumnNames(n);if(void 0!=t)a=s._getItem(t,c),a&&this._appendRow(n,d,a);else if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=s._getItem(e[p],c),a&&s._appendRow(n,d,a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=s._getItem(h,c),a&&s._appendRow(n,d,a))}else{if(n||(n=[]),void 0!=t)return s._getItem(t,c);if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=s._getItem(e[p],c),a&&n.push(a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=s._getItem(h,c),a&&n.push(a))}return n},s.prototype.getIds=function(t){var e,i,n=this.data,s=[];if(t&&t.filter){var r=this._composeItemOptions({filter:t&&t.filter});for(e in n)n.hasOwnProperty(e)&&(i=this._getItem(e,r),i&&s.push(i[this.fieldId]))}else for(e in n)n.hasOwnProperty(e)&&(i=n[e],s.push(i[this.fieldId]));return s},s.prototype.forEach=function(t,e){var i,n=this._composeItemOptions(e),s=this.data;for(var r in s)s.hasOwnProperty(r)&&(i=this._getItem(r,n),i&&t(i,r))},s.prototype.map=function(t,e){var i,n=this._composeItemOptions(e),s=[],r=this.data;for(var o in r)r.hasOwnProperty(o)&&(i=this._getItem(o,n),i&&s.push(t(i,o)));return s},s.prototype._composeItemOptions=function(t){var e={};return t&&(e.fieldTypes={},this.options&&this.options.fieldTypes&&E.extend(e.fieldTypes,this.options.fieldTypes),t.fieldTypes&&E.extend(e.fieldTypes,t.fieldTypes),t.fields&&(e.fields=t.fields),t.filter&&(e.filter=t.filter)),e},s.prototype.remove=function(t,e){var i,n,s=[];if(E.isNumber(t)||E.isString(t))delete this.data[t],delete this.internalIds[t],s.push(t);else if(t instanceof Array){for(i=0,n=t.length;n>i;i++)this.remove(t[i]);s=items.concat(t)}else if(t instanceof Object)for(i in this.data)this.data.hasOwnProperty(i)&&this.data[i]==t&&(delete this.data[i],delete this.internalIds[i],s.push(i));s.length&&this._trigger("remove",{items:s},e)},s.prototype.clear=function(t){var e=Object.keys(this.data);this.data={},this.internalIds={},this._trigger("remove",{items:e},t)},s.prototype.max=function(t){var e=this.data,i=null,n=null;for(var s in e)if(e.hasOwnProperty(s)){var r=e[s],o=r[t];null!=o&&(!i||o>n)&&(i=r,n=o)}return i},s.prototype.min=function(t){var e=this.data,i=null,n=null;for(var s in e)if(e.hasOwnProperty(s)){var r=e[s],o=r[t];null!=o&&(!i||n>o)&&(i=r,n=o)}return i},s.prototype.distinct=function(t){var e=this.data,i=[],n=this.options.fieldTypes[t],s=0;for(var r in e)if(e.hasOwnProperty(r)){for(var o=e[r],a=E.cast(o[t],n),h=!1,p=0;s>p;p++)if(i[p]==a){h=!0;break}h||(i[s]=a,s++)}return i},s.prototype._addItem=function(t){var e=t[this.fieldId];if(void 0!=e){if(this.data[e])throw Error("Cannot add item: item with id "+e+" already exists")}else e=E.randomUUID(),t[this.fieldId]=e,this.internalIds[e]=t;var i={};for(var n in t)if(t.hasOwnProperty(n)){var s=this.fieldTypes[n];i[n]=E.cast(t[n],s)}return this.data[e]=i,e},s.prototype._getItem=function(t,e){var i,n,s=this.data[t];if(!s)return null;var r={},o=this.fieldId,a=this.internalIds;if(e.fieldTypes){var h=e.fieldTypes;for(i in s)s.hasOwnProperty(i)&&(n=s[i],i==o&&n in a||(r[i]=E.cast(n,h[i])))}else for(i in s)s.hasOwnProperty(i)&&(n=s[i],i==o&&n in a||(r[i]=n));if(e.filter&&!e.filter(r))return null;if(e.fields){var p={},u=e.fields;for(i in r)r.hasOwnProperty(i)&&-1!=u.indexOf(i)&&(p[i]=r[i]);return p}return r},s.prototype._updateItem=function(t){var e=t[this.fieldId];if(void 0==e)throw Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var i=this.data[e];if(!i)throw Error("Cannot update item: no item with id "+e+" found");for(var n in t)if(t.hasOwnProperty(n)){var s=this.fieldTypes[n];i[n]=E.cast(t[n],s)}return e},s.prototype._getColumnNames=function(t){for(var e=[],i=0,n=t.getNumberOfColumns();n>i;i++)e[i]=t.getColumnId(i)||t.getColumnLabel(i);return e},s.prototype._appendRow=function(t,e,i){for(var n=t.addRow(),s=0,r=e.length;r>s;s++){var o=e[s];t.setValue(n,s,i[o])}},r.prototype.setData=function(t){var e,i,n;if(this.data){this.data.unsubscribe&&this.data.unsubscribe("*",this.listener),e=[];for(var s in this.ids)this.ids.hasOwnProperty(s)&&e.push(s);this.ids={},this._trigger("remove",{items:e})}if(this.data=t,this.data){for(this.fieldId=this.options.fieldId||this.data&&this.data.options&&this.data.options.fieldId||"id",e=this.data.getIds({filter:this.options&&this.options.filter}),i=0,n=e.length;n>i;i++)s=e[i],this.ids[s]=!0;this._trigger("add",{items:e}),this.data.subscribe&&this.data.subscribe("*",this.listener)}},r.prototype.get=function(){var t,e,i,n=this,s=E.getType(arguments[0]);"String"==s||"Number"==s||"Array"==s?(t=arguments[0],e=arguments[1],i=arguments[2]):(e=arguments[0],i=arguments[1]);var r=E.extend({},this.options,e);this.options.filter&&e&&e.filter&&(r.filter=function(t){return n.options.filter(t)&&e.filter(t)});var o=[];return void 0!=t&&o.push(t),o.push(r),o.push(i),this.data&&this.data.get.apply(this.data,o)},r.prototype.getIds=function(t){var e;if(this.data){var i,n=this.options.filter;i=t&&t.filter?n?function(e){return n(e)&&t.filter(e)}:t.filter:n,e=this.data.getIds({filter:i})}else e=[];return e},r.prototype._onEvent=function(t,e,i){var n,s,r,o,a=e&&e.items,h=this.data,p=[],u=[],c=[];if(a&&h){switch(t){case"add":for(n=0,s=a.length;s>n;n++)r=a[n],o=this.get(r),o&&(this.ids[r]=!0,p.push(r));break;case"update":for(n=0,s=a.length;s>n;n++)r=a[n],o=this.get(r),o?this.ids[r]?u.push(r):(this.ids[r]=!0,p.push(r)):this.ids[r]&&(delete this.ids[r],c.push(r));break;case"remove":for(n=0,s=a.length;s>n;n++)r=a[n],this.ids[r]&&(delete this.ids[r],c.push(r))}p.length&&this._trigger("add",{items:p},i),u.length&&this._trigger("update",{items:u},i),c.length&&this._trigger("remove",{items:c},i)}},r.prototype.subscribe=s.prototype.subscribe,r.prototype.unsubscribe=s.prototype.unsubscribe,r.prototype._trigger=s.prototype._trigger,o.prototype.setOptions=function(t){E.extend(this.options,t)},o.prototype.update=function(){this._order(),this._stack()},o.prototype._order=function(){var t=this.parent.items;if(!t)throw Error("Cannot stack items: parent does not contain items");var e=[],i=0;E.forEach(t,function(t){t.visible&&(e[i]=t,i++)});var n=this.options.order;if("function"!=typeof this.options.order)throw Error("Option order must be a function");e.sort(n),this.ordered=e},o.prototype._stack=function(){var t,e,i=this.ordered,n=this.options,s="top"==n.orientation,r=n.margin&&n.margin.item||0;for(t=0,e=i.length;e>t;t++){var o=i[t],a=null;do a=this.checkOverlap(i,t,0,t-1,r),null!=a&&(o.top=s?a.top+a.height+r:a.top-o.height-r);while(a)}},o.prototype.checkOverlap=function(t,e,i,n,s){for(var r=this.collision,o=t[e],a=n;a>=i;a--){var h=t[a];if(r(o,h,s)&&a!=e)return h}return null},o.prototype.collision=function(t,e,i){return t.left-ie.left&&t.top-ie.top},a.prototype.setOptions=function(t){E.extend(this.options,t),(null!=t.start||null!=t.end)&&this.setRange(t.start,t.end)},a.prototype.subscribe=function(t,e,i){var n,s=this;if("horizontal"!=i&&"vertical"!=i)throw new TypeError('Unknown direction "'+i+'". '+'Choose "horizontal" or "vertical".'); -if("move"==e)n={component:t,event:e,direction:i,callback:function(t){s._onMouseDown(t,n)},params:{}},t.on("mousedown",n.callback),s.listeners.push(n);else{if("zoom"!=e)throw new TypeError('Unknown event "'+e+'". '+'Choose "move" or "zoom".');n={component:t,event:e,direction:i,callback:function(t){s._onMouseWheel(t,n)},params:{}},t.on("mousewheel",n.callback),s.listeners.push(n)}},a.prototype.on=function(t,e){_.addListener(this,t,e)},a.prototype._trigger=function(t){_.trigger(this,t,{start:this.start,end:this.end})},a.prototype.setRange=function(t,e){var i=this._applyRange(t,e);i&&(this._trigger("rangechange"),this._trigger("rangechanged"))},a.prototype._applyRange=function(t,e){var i,n=null!=t?E.cast(t,"Number"):this.start,s=null!=e?E.cast(e,"Number"):this.end;if(isNaN(n))throw Error('Invalid start "'+t+'"');if(isNaN(s))throw Error('Invalid end "'+e+'"');if(n>s&&(s=n),null!=this.options.min){var r=this.options.min.valueOf();r>n&&(i=r-n,n+=i,s+=i)}if(null!=this.options.max){var o=this.options.max.valueOf();s>o&&(i=s-o,n-=i,s-=i)}if(null!=this.options.zoomMin){var a=this.options.zoomMin.valueOf();0>a&&(a=0),a>s-n&&(this.end-this.start>a?(i=a-(s-n),n-=i/2,s+=i/2):(n=this.start,s=this.end))}if(null!=this.options.zoomMax){var h=this.options.zoomMax.valueOf();0>h&&(h=0),s-n>h&&(h>this.end-this.start?(i=s-n-h,n+=i/2,s-=i/2):(n=this.start,s=this.end))}var p=this.start!=n||this.end!=s;return this.start=n,this.end=s,p},a.prototype.getRange=function(){return{start:this.start,end:this.end}},a.prototype.conversion=function(t){return this.start,this.end,a.conversion(this.start,this.end,t)},a.conversion=function(t,e,i){return 0!=i&&0!=e-t?{offset:t,factor:i/(e-t)}:{offset:0,factor:1}},a.prototype._onMouseDown=function(t,e){t=t||window.event;var i=e.params,n=t.which?1==t.which:1==t.button;if(n){i.mouseX=E.getPageX(t),i.mouseY=E.getPageY(t),i.previousLeft=0,i.previousOffset=0,i.moved=!1,i.start=this.start,i.end=this.end;var s=e.component.frame;s&&(s.style.cursor="move");var r=this;i.onMouseMove||(i.onMouseMove=function(t){r._onMouseMove(t,e)},E.addEventListener(document,"mousemove",i.onMouseMove)),i.onMouseUp||(i.onMouseUp=function(t){r._onMouseUp(t,e)},E.addEventListener(document,"mouseup",i.onMouseUp)),E.preventDefault(t)}},a.prototype._onMouseMove=function(t,e){t=t||window.event;var i=e.params,n=E.getPageX(t),s=E.getPageY(t);void 0==i.mouseX&&(i.mouseX=n),void 0==i.mouseY&&(i.mouseY=s);var r=n-i.mouseX,o=s-i.mouseY,a="horizontal"==e.direction?r:o;Math.abs(a)>=1&&(i.moved=!0);var h=i.end-i.start,p="horizontal"==e.direction?e.component.width:e.component.height,u=-a/p*h;this._applyRange(i.start+u,i.end+u),this._trigger("rangechange"),E.preventDefault(t)},a.prototype._onMouseUp=function(t,e){t=t||window.event;var i=e.params;e.component.frame&&(e.component.frame.style.cursor="auto"),i.onMouseMove&&(E.removeEventListener(document,"mousemove",i.onMouseMove),i.onMouseMove=null),i.onMouseUp&&(E.removeEventListener(document,"mouseup",i.onMouseUp),i.onMouseUp=null),i.moved&&this._trigger("rangechanged")},a.prototype._onMouseWheel=function(t,e){t=t||window.event;var i=0;if(t.wheelDelta?i=t.wheelDelta/120:t.detail&&(i=-t.detail/3),i){var n=this,s=function(){var s=i/5,r=null,o=e.component.frame;if(o){var a,h;if("horizontal"==e.direction){a=e.component.width,h=n.conversion(a);var p=E.getAbsoluteLeft(o),u=E.getPageX(t);r=(u-p)/h.factor+h.offset}else{a=e.component.height,h=n.conversion(a);var c=E.getAbsoluteTop(o),d=E.getPageY(t);r=(c+a-d-c)/h.factor+h.offset}}n.zoom(s,r)};s()}E.preventDefault(t)},a.prototype.zoom=function(t,e){null==e&&(e=(this.start+this.end)/2),t>=1&&(t=.9),-1>=t&&(t=-.9),0>t&&(t/=1+t);var i=this.start-e,n=this.end-e,s=this.start-i*t,r=this.end-n*t;this.setRange(s,r)},a.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,n=this.end+e*t;this.start=i,this.end=n},h.prototype.on=function(t,e,i){var n=t instanceof RegExp?t:RegExp(t.replace("*","\\w+")),s={id:E.randomUUID(),event:t,regexp:n,callback:"function"==typeof e?e:null,target:i};return this.subscriptions.push(s),s.id},h.prototype.off=function(t){for(var e=0;this.subscriptions.length>e;){var i=this.subscriptions[e],n=!0;if(t instanceof Object)for(var s in t)t.hasOwnProperty(s)&&t[s]!==i[s]&&(n=!1);else n=i.id==t;n?this.subscriptions.splice(e,1):e++}},h.prototype.emit=function(t,e,i){for(var n=0;this.subscriptions.length>n;n++){var s=this.subscriptions[n];s.regexp.test(t)&&s.callback&&s.callback(t,e,i)}},p.prototype.add=function(t){if(void 0==t.id)throw Error("Component has no field id");if(!(t instanceof u||t instanceof p))throw new TypeError("Component must be an instance of prototype Component or Controller");t.controller=this,this.components[t.id]=t},p.prototype.remove=function(t){var e;for(e in this.components)if(this.components.hasOwnProperty(e)&&(e==t||this.components[e]==t))break;e&&delete this.components[e]},p.prototype.requestReflow=function(t){if(t)this.reflow();else if(!this.reflowTimer){var e=this;this.reflowTimer=setTimeout(function(){e.reflowTimer=void 0,e.reflow()},0)}},p.prototype.requestRepaint=function(t){if(t)this.repaint();else if(!this.repaintTimer){var e=this;this.repaintTimer=setTimeout(function(){e.repaintTimer=void 0,e.repaint()},0)}},p.prototype.repaint=function(){function t(n,s){s in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.repaint()||e,i[s]=!0)}var e=!1;this.repaintTimer&&(clearTimeout(this.repaintTimer),this.repaintTimer=void 0);var i={};E.forEach(this.components,t),e&&this.reflow()},p.prototype.reflow=function(){function t(n,s){s in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.reflow()||e,i[s]=!0)}var e=!1;this.reflowTimer&&(clearTimeout(this.reflowTimer),this.reflowTimer=void 0);var i={};E.forEach(this.components,t),e&&this.repaint()},u.prototype.setOptions=function(t){t&&(E.extend(this.options,t),this.controller&&(this.requestRepaint(),this.requestReflow()))},u.prototype.getContainer=function(){return null},u.prototype.getFrame=function(){return this.frame},u.prototype.repaint=function(){return!1},u.prototype.reflow=function(){return!1},u.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1},u.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},u.prototype.requestRepaint=function(){if(!this.controller)throw Error("Cannot request a repaint: no controller configured");this.controller.requestRepaint()},u.prototype.requestReflow=function(){if(!this.controller)throw Error("Cannot request a reflow: no controller configured");this.controller.requestReflow()},c.prototype=new u,c.prototype.getContainer=function(){return this.frame},c.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,s=this.frame;if(s||(s=document.createElement("div"),s.className="panel",n.className&&("function"==typeof n.className?E.addClassName(s,n.className()+""):E.addClassName(s,n.className+"")),this.frame=s,t+=1),!s.parentNode){if(!this.parent)throw Error("Cannot repaint panel: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint panel: parent has no container element");r.appendChild(s),t+=1}return t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"width",i(n.width,"100%")),t+=e(s.style,"height",i(n.height,"100%")),t>0},c.prototype.reflow=function(){var t=0,e=E.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},d.prototype=new c,d.prototype.setOptions=function(t){E.extend(this.options,t),this.options.autoResize?this._watch():this._unwatch()},d.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,s=this.frame;if(s||(s=document.createElement("div"),s.className="graph panel",n.className&&E.addClassName(s,E.option.asString(n.className)),this.frame=s,t+=1),!s.parentNode){if(!this.container)throw Error("Cannot repaint root panel: no container attached");this.container.appendChild(s),t+=1}return t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"width",i(n.width,"100%")),t+=e(s.style,"height",i(n.height,"100%")),this._updateEventEmitters(),t>0},d.prototype.reflow=function(){var t=0,e=E.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},d.prototype._watch=function(){var t=this;this._unwatch();var e=function(){return t.options.autoResize?(t.frame&&(t.frame.clientWidth!=t.width||t.frame.clientHeight!=t.height)&&t.requestReflow(),void 0):(t._unwatch(),void 0)};E.addEventListener(window,"resize",e),this.watchTimer=setInterval(e,1e3)},d.prototype._unwatch=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0)},d.prototype.on=function(t,e){var i=this.listeners[t];i||(i=[],this.listeners[t]=i),i.push(e),this._updateEventEmitters()},d.prototype._updateEventEmitters=function(){if(this.listeners){var t=this;E.forEach(this.listeners,function(e,i){if(t.emitters||(t.emitters={}),!(i in t.emitters)){var n=t.frame;if(n){var s=function(t){e.forEach(function(e){e(t)})};t.emitters[i]=s,E.addEventListener(n,i,s)}}})}},l.prototype=new u,l.prototype.setOptions=function(t){E.extend(this.options,t)},l.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},l.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},l.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},l.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,s=this.props,r=this.step,o=this.frame;if(o||(o=document.createElement("div"),this.frame=o,t+=1),o.className="axis "+n.orientation,!o.parentNode){if(!this.parent)throw Error("Cannot repaint time axis: no parent attached");var a=this.parent.getContainer();if(!a)throw Error("Cannot repaint time axis: parent has no container element");a.appendChild(o),t+=1}var h=o.parentNode;if(h){var p=o.nextSibling;h.removeChild(o);var u=n.orientation,c="bottom"==u&&this.props.parentHeight&&this.height?this.props.parentHeight-this.height+"px":"0px";if(t+=e(o.style,"top",i(n.top,c)),t+=e(o.style,"left",i(n.left,"0px")),t+=e(o.style,"width",i(n.width,"100%")),t+=e(o.style,"height",i(n.height,this.height+"px")),this._repaintMeasureChars(),this.step){this._repaintStart(),r.first();for(var d=void 0,l=0;r.hasNext()&&1e3>l;){l++;var f=r.getCurrent(),m=this.toScreen(f),g=r.isMajor();n.showMinorLabels&&this._repaintMinorText(m,r.getLabelMinor()),g&&n.showMajorLabels?(m>0&&(void 0==d&&(d=m),this._repaintMajorText(m,r.getLabelMajor())),this._repaintMajorLine(m)):this._repaintMinorLine(m),r.next()}if(n.showMajorLabels){var v=this.toTime(0),y=r.getLabelMajor(v),w=y.length*(s.majorCharWidth||10)+10;(void 0==d||d>w)&&this._repaintMajorText(0,y)}this._repaintEnd()}this._repaintLine(),p?h.insertBefore(o,p):h.appendChild(o)}return t>0},l.prototype._repaintStart=function(){var t=this.dom,e=t.redundant;e.majorLines=t.majorLines,e.majorTexts=t.majorTexts,e.minorLines=t.minorLines,e.minorTexts=t.minorTexts,t.majorLines=[],t.majorTexts=[],t.minorLines=[],t.minorTexts=[]},l.prototype._repaintEnd=function(){E.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},l.prototype._repaintMinorText=function(t,e){var i=this.dom.redundant.minorTexts.shift();if(!i){var n=document.createTextNode("");i=document.createElement("div"),i.appendChild(n),i.className="text minor",this.frame.appendChild(i)}this.dom.minorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.left=t+"px",i.style.top=this.props.minorLabelTop+"px"},l.prototype._repaintMajorText=function(t,e){var i=this.dom.redundant.majorTexts.shift();if(!i){var n=document.createTextNode(e);i=document.createElement("div"),i.className="text major",i.appendChild(n),this.frame.appendChild(i)}this.dom.majorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.top=this.props.majorLabelTop+"px",i.style.left=t+"px"},l.prototype._repaintMinorLine=function(t){var e=this.dom.redundant.minorLines.shift();e||(e=document.createElement("div"),e.className="grid vertical minor",this.frame.appendChild(e)),this.dom.minorLines.push(e);var i=this.props;e.style.top=i.minorLineTop+"px",e.style.height=i.minorLineHeight+"px",e.style.left=t-i.minorLineWidth/2+"px"},l.prototype._repaintMajorLine=function(t){var e=this.dom.redundant.majorLines.shift();e||(e=document.createElement("DIV"),e.className="grid vertical major",this.frame.appendChild(e)),this.dom.majorLines.push(e);var i=this.props;e.style.top=i.majorLineTop+"px",e.style.left=t-i.majorLineWidth/2+"px",e.style.height=i.majorLineHeight+"px"},l.prototype._repaintLine=function(){var t=this.dom.line,e=this.frame,i=this.options;i.showMinorLabels||i.showMajorLabels?(t?(e.removeChild(t),e.appendChild(t)):(t=document.createElement("div"),t.className="grid horizontal major",e.appendChild(t),this.dom.line=t),t.style.top=this.props.lineTop+"px"):t&&axis.parentElement&&(e.removeChild(axis.line),delete this.dom.line)},l.prototype._repaintMeasureChars=function(){var t,e=this.dom;if(!e.measureCharMinor){t=document.createTextNode("0");var i=document.createElement("DIV");i.className="text minor measure",i.appendChild(t),this.frame.appendChild(i),e.measureCharMinor=i}if(!e.measureCharMajor){t=document.createTextNode("0");var n=document.createElement("DIV");n.className="text major measure",n.appendChild(t),this.frame.appendChild(n),e.measureCharMajor=n}},l.prototype.reflow=function(){var t=0,e=E.updateProperty,i=this.frame,n=this.range;if(!n)throw Error("Cannot repaint time axis: no range configured");if(i){t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft);var s=this.props,r=this.options.showMinorLabels,o=this.options.showMajorLabels,a=this.dom.measureCharMinor,h=this.dom.measureCharMajor;a&&(s.minorCharHeight=a.clientHeight,s.minorCharWidth=a.clientWidth),h&&(s.majorCharHeight=h.clientHeight,s.majorCharWidth=h.clientWidth);var p=i.parentNode?i.parentNode.offsetHeight:0;switch(p!=s.parentHeight&&(s.parentHeight=p,t+=1),this.options.orientation){case"bottom":s.minorLabelHeight=r?s.minorCharHeight:0,s.majorLabelHeight=o?s.majorCharHeight:0,s.minorLabelTop=0,s.majorLabelTop=s.minorLabelTop+s.minorLabelHeight,s.minorLineTop=-this.top,s.minorLineHeight=Math.max(this.top+s.majorLabelHeight,0),s.minorLineWidth=1,s.majorLineTop=-this.top,s.majorLineHeight=Math.max(this.top+s.minorLabelHeight+s.majorLabelHeight,0),s.majorLineWidth=1,s.lineTop=0;break;case"top":s.minorLabelHeight=r?s.minorCharHeight:0,s.majorLabelHeight=o?s.majorCharHeight:0,s.majorLabelTop=0,s.minorLabelTop=s.majorLabelTop+s.majorLabelHeight,s.minorLineTop=s.minorLabelTop,s.minorLineHeight=Math.max(p-s.majorLabelHeight-this.top),s.minorLineWidth=1,s.majorLineTop=0,s.majorLineHeight=Math.max(p-this.top),s.majorLineWidth=1,s.lineTop=s.majorLabelHeight+s.minorLabelHeight;break;default:throw Error('Unkown orientation "'+this.options.orientation+'"')}var u=s.minorLabelHeight+s.majorLabelHeight;t+=e(this,"width",i.offsetWidth),t+=e(this,"height",u),this._updateConversion();var c=E.cast(n.start,"Date"),d=E.cast(n.end,"Date"),l=this.toTime(5*(s.minorCharWidth||10))-this.toTime(0);this.step=new TimeStep(c,d,l),t+=e(s.range,"start",c.valueOf()),t+=e(s.range,"end",d.valueOf()),t+=e(s.range,"minimumStep",l.valueOf())}return t>0},l.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype=new c,f.types={box:g,range:y,point:v},f.prototype.setOptions=function(t){E.extend(this.options,t),this.stack.setOptions(this.options)},f.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},f.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,s=this.frame;if(!s){s=document.createElement("div"),s.className="itemset",n.className&&E.addClassName(s,E.option.asString(n.className));var r=document.createElement("div");r.className="background",s.appendChild(r),this.dom.background=r;var o=document.createElement("div");o.className="foreground",s.appendChild(o),this.dom.foreground=o;var a=document.createElement("div");a.className="itemset-axis",this.dom.axis=a,this.frame=s,t+=1}if(!this.parent)throw Error("Cannot repaint itemset: no parent attached");var h=this.parent.getContainer();if(!h)throw Error("Cannot repaint itemset: parent has no container element");s.parentNode||(h.appendChild(s),t+=1),this.dom.axis.parentNode||(h.appendChild(this.dom.axis),t+=1),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"width",i(n.width,"100%")),t+=e(s.style,"height",i(n.height,this.height+"px")),t+=e(this.dom.axis.style,"left",i(n.left,"0px")),t+=e(this.dom.axis.style,"width",i(n.width,"100%")),t+="bottom"==this.options.orientation?e(this.dom.axis.style,"top",this.height+this.top+"px"):e(this.dom.axis.style,"top",this.top+"px"),this._updateConversion();var p=this,u=this.queue,c=this.itemsData,d=this.items,l={fields:[c&&c.fieldId||"id","start","end","content","type"]};return Object.keys(u).forEach(function(e){var i=u[e],s=d[e];switch(i){case"add":case"update":var r=c&&c.get(e,l);if(r){var o=r.type||r.start&&r.end&&"range"||"box",a=f.types[o];if(s&&(a&&s instanceof a?(s.data=r,t++):(t+=s.hide(),s=null)),!s){if(!a)throw new TypeError('Unknown item type "'+o+'"');s=new a(p,r,n),t++}d[e]=s}delete u[e];break;case"remove":s&&(t+=s.hide()),delete d[e],delete u[e];break;default:console.log('Error: unknown action "'+i+'"')}}),E.forEach(this.items,function(e){e.visible?(t+=e.show(),e.reposition()):t+=e.hide()}),t>0},f.prototype.getForeground=function(){return this.dom.foreground},f.prototype.getBackground=function(){return this.dom.background},f.prototype.getAxis=function(){return this.dom.axis},f.prototype.reflow=function(){var t=0,e=this.options,i=E.updateProperty,n=E.option.asNumber,s=this.frame;if(s){this._updateConversion(),E.forEach(this.items,function(e){t+=e.reflow()}),this.stack.update();var r,o=n(e.maxHeight);if(null!=e.height)r=s.offsetHeight;else{var a=this.stack.ordered;if(a.length){var h=a[0].top,p=a[0].top+a[0].height;E.forEach(a,function(t){h=Math.min(h,t.top),p=Math.max(p,t.top+t.height)}),r=p-h+e.margin.axis+e.margin.item}else r=e.margin.axis+e.margin.item}null!=o&&(r=Math.min(r,o)),t+=i(this,"height",r),t+=i(this,"top",s.offsetTop),t+=i(this,"left",s.offsetLeft),t+=i(this,"width",s.offsetWidth)}else t+=1;return t>0},f.prototype.hide=function(){var t=!1;return this.frame&&this.frame.parentNode&&(this.frame.parentNode.removeChild(this.frame),t=!0),this.dom.axis&&this.dom.axis.parentNode&&(this.dom.axis.parentNode.removeChild(this.dom.axis),t=!0),t},f.prototype.setItems=function(t){var e,i=this,n=this.itemsData;if(n&&(E.forEach(this.listeners,function(t,e){n.unsubscribe(e,t)}),e=n.getIds(),this._onRemove(e)),t){if(!(t instanceof s||t instanceof r))throw new TypeError("Data must be an instance of DataSet");this.itemsData=t}else this.itemsData=null;if(this.itemsData){var o=this.id;E.forEach(this.listeners,function(t,e){i.itemsData.subscribe(e,t,o)}),e=this.itemsData.getIds(),this._onAdd(e)}},f.prototype.getItems=function(){return this.itemsData},f.prototype._onUpdate=function(t){this._toQueue("update",t)},f.prototype._onAdd=function(t){this._toQueue("add",t)},f.prototype._onRemove=function(t){this._toQueue("remove",t)},f.prototype._toQueue=function(t,e){var i=this.queue;e.forEach(function(e){i[e]=t}),this.controller&&this.requestRepaint()},f.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},f.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},m.prototype.select=function(){this.selected=!0},m.prototype.unselect=function(){this.selected=!1},m.prototype.show=function(){return!1},m.prototype.hide=function(){return!1},m.prototype.repaint=function(){return!1},m.prototype.reflow=function(){return!1},g.prototype=new m(null,null),g.prototype.select=function(){this.selected=!0},g.prototype.unselect=function(){this.selected=!1},g.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");var n=this.parent.getBackground();if(!n)throw Error("Cannot repaint time axis: parent has no background container element");var s=this.parent.getAxis();if(!n)throw Error("Cannot repaint time axis: parent has no axis container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),e.line.parentNode||(n.appendChild(e.line),t=!0),e.dot.parentNode||(s.appendChild(e.dot),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var r=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=r&&(this.className=r,e.box.className="item box"+r,e.line.className="item line"+r,e.dot.className="item dot"+r,t=!0)}return t},g.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},g.prototype.hide=function(){var t=!1,e=this.dom;return e&&(e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),e.line.parentNode&&e.line.parentNode.removeChild(e.line),e.dot.parentNode&&e.dot.parentNode.removeChild(e.dot)),t},g.prototype.reflow=function(){var t,e,i,n,s,r,o,a,h,p,u,c=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(p=this.data,u=this.parent&&this.parent.range,this.visible=p&&u?p.start>u.start&&p.start0},g.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="line",t.dot=document.createElement("DIV"),t.dot.className="dot")},g.prototype.reposition=function(){var t=this.dom,e=this.props,i=this.options.orientation;if(t){var n=t.box,s=t.line,r=t.dot;n.style.left=this.left+"px",n.style.top=this.top+"px",s.style.left=e.line.left+"px","top"==i?(s.style.top="0px",s.style.height=this.top+"px"):(s.style.top=this.top+this.height+"px",s.style.height=Math.max(this.parent.height-this.top-this.height+this.props.dot.height/2,0)+"px"),r.style.left=e.dot.left+"px",r.style.top=e.dot.top+"px"}},v.prototype=new m(null,null),v.prototype.select=function(){this.selected=!0},v.prototype.unselect=function(){this.selected=!1},v.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.point.parentNode||(i.appendChild(e.point),i.appendChild(e.point),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=n&&(this.className=n,e.point.className="item point"+n,t=!0)}return t},v.prototype.show=function(){return this.dom&&this.dom.point.parentNode?!1:this.repaint()},v.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.point.parentNode&&(e.point.parentNode.removeChild(e.point),t=!0),t},v.prototype.reflow=function(){var t,e,i,n,s,r,o,a,h,p=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(a=this.data,h=this.parent&&this.parent.range,this.visible=a&&h?a.start>h.start&&a.start0},v.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.dot.className="dot",t.point.appendChild(t.dot))},v.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.point.style.top=this.top+"px",t.point.style.left=this.left+"px",t.content.style.marginLeft=e.content.marginLeft+"px",t.dot.style.top=e.dot.top+"px")},y.prototype=new m(null,null),y.prototype.select=function(){this.selected=!0},y.prototype.unselect=function(){this.selected=!1},y.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=this.data.className?""+this.data.className:"";this.className!=n&&(this.className=n,e.box.className="item range"+n,t=!0)}return t},y.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},y.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),t},y.prototype.reflow=function(){var t,e,i,n,s,r,o,a,h,p,u,c,d,l,f=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(void 0==this.data.end)throw Error('Property "end" missing in item '+this.data.id);return o=this.data,a=this.parent&&this.parent.range,this.visible=o&&a?o.starta.start:!1,this.visible&&(t=this.dom,t?(e=this.props,i=this.options,n=this.parent,s=n.toScreen(this.data.start),r=n.toScreen(this.data.end),h=E.updateProperty,p=t.box,u=n.width,d=i.orientation,f+=h(e.content,"width",t.content.offsetWidth),f+=h(this,"height",p.offsetHeight),-u>s&&(s=-u),r>2*u&&(r=2*u),c=0>s?Math.min(-s,r-s-e.content.width-2*i.padding):0,f+=h(e.content,"left",c),"top"==d?(l=i.margin.axis,f+=h(this,"top",l)):(l=n.height-this.height-i.margin.axis,f+=h(this,"top",l)),f+=h(this,"left",s),f+=h(this,"width",Math.max(r-s,1))):f+=1),f>0},y.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content))},y.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.box.style.top=this.top+"px",t.box.style.left=this.left+"px",t.box.style.width=this.width+"px",t.content.style.left=e.content.left+"px")},w.prototype=new u,w.prototype.setOptions=function(t){t&&(E.extend(this.options,t),this.items&&this.items.setOptions(this.options))},w.prototype.setItems=function(t){this.items&&(this.items.hide(),this.items.setItems(),this.parent.controller.remove(this.items));var e=this.groupId;this.items=new f(this.parent),this.items.setRange(this.parent.range),this.view=new r(t,{filter:function(t){return t.group==e}}),this.items.setItems(this.view),this.parent.controller.add(this.items)},w.prototype.repaint=function(){return!1},w.prototype.reflow=function(){return!1},b.prototype=new c,b.prototype.setOptions=function(t){E.extend(this.options,t)},b.prototype.setRange=function(){},b.prototype.setItems=function(t){this.itemsData=t,E.forEach(this.groups,function(e){e.setItems(t)})},b.prototype.getItems=function(){return this.itemsData},b.prototype.setRange=function(t){this.range=t},b.prototype.setGroups=function(t){var e,i=this;if(this.groupsData&&(E.forEach(this.listeners,function(t,e){i.groupsData.unsubscribe(e,t)}),e=this.groupsData.getIds(),this._onRemove(e)),t?t instanceof s?this.groupsData=t:(this.groupsData=new s({fieldTypes:{start:"Date",end:"Date"}}),this.groupsData.add(t)):this.groupsData=null,this.groupsData){var n=this.id;E.forEach(this.listeners,function(t,e){i.groupsData.subscribe(e,t,n)}),e=this.groupsData.getIds(),this._onAdd(e)}},b.prototype.getGroups=function(){return this.groupsData},b.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,s=this.frame;if(s||(s=document.createElement("div"),s.className="groupset",n.className&&E.addClassName(s,E.option.asString(n.className)),this.frame=s,t+=1),!this.parent)throw Error("Cannot repaint groupset: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint groupset: parent has no container element");s.parentNode||(r.appendChild(s),t+=1),t+=e(s.style,"height",i(n.height,this.height+"px")),t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"width",i(n.width,"100%"));var o=this,a=this.queue,h=this.groups;this.groupsData;var p=Object.keys(a);p.length&&p.forEach(function(t){for(var e=a[t],i=null,n=-1,s=0;h.length>s;s++)if(h[s].id==t){i=h[s],n=s;break}switch(e){case"add":case"update":if(!i){var r=E.extend({},o.options,{top:0});i=new w(o,t,r),i.setItems(o.itemsData),h.push(i),o.controller.add(i)}delete a[t];break;case"remove":i&&(i.setItems(),h.splice(n,1),o.controller.remove(i)),delete a[t];break;default:console.log('Error: unknown action "'+e+'"')}});var u=null;return E.forEach(this.groups,function(t){var e=u&&u.items;t.items&&(t.items.options.top=e?function(){return e.top+e.height}:0),u=t}),t>0},b.prototype.getContainer=function(){return this.frame},b.prototype.reflow=function(){var t=0,e=this.options,i=E.updateProperty,n=E.option.asNumber,s=this.frame;if(s){var r,o=n(e.maxHeight);null!=e.height?r=s.offsetHeight:(r=0,E.forEach(this.groups,function(t){t.items&&(r+=t.items.height)})),null!=o&&(r=Math.min(r,o)),t+=i(this,"height",r),t+=i(this,"top",s.offsetTop),t+=i(this,"left",s.offsetLeft),t+=i(this,"width",s.offsetWidth) -}return t>0},b.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1},b.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},b.prototype._onUpdate=function(t){this._toQueue(t,"update")},b.prototype._onAdd=function(t){this._toQueue(t,"add")},b.prototype._onRemove=function(t){this._toQueue(t,"remove")},b.prototype._toQueue=function(t,e){var i=this.queue;t.forEach(function(t){i[t]=e}),this.controller&&this.requestRepaint()},S.prototype.setOptions=function(t){E.extend(this.options,t),this.timeaxis.setOptions({orientation:this.options.orientation,showMinorLabels:this.options.showMinorLabels,showMajorLabels:this.options.showMajorLabels}),this.range.setOptions({min:this.options.min,max:this.options.max,zoomMin:this.options.zoomMin,zoomMax:this.options.zoomMax});var e,i,n,s,r=this;if(e="top"==this.options.orientation?function(){return r.timeaxis.height}:function(){return r.main.height-r.timeaxis.height-r.content.height},this.options.height?(n=this.options.height,i=function(){return r.main.height-r.timeaxis.height}):(n=function(){return r.timeaxis.height+r.content.height},i=null),this.options.maxHeight){if(!E.isNumber(this.options.maxHeight))throw new TypeError("Number expected for property maxHeight");s=function(){return r.options.maxHeight-r.timeaxis.height}}this.main.setOptions({height:n}),this.content.setOptions({orientation:this.options.orientation,top:e,height:i,maxHeight:s}),this.controller.repaint()},S.prototype.setItems=function(t){var e,i=null==this.itemsData;if(t?t instanceof s&&(e=t):e=null,t instanceof s||(e=new s({fieldTypes:{start:"Date",end:"Date"}}),e.add(t)),this.itemsData=e,this.content.setItems(e),i&&(void 0==this.options.start||void 0==this.options.end)){var n=this.getItemRange(),r=n.min,o=n.max;if(null!=r&&null!=o){var a=o.valueOf()-r.valueOf();r=new Date(r.valueOf()-.05*a),o=new Date(o.valueOf()+.05*a)}void 0!=this.options.start&&(r=new Date(this.options.start.valueOf())),void 0!=this.options.end&&(o=new Date(this.options.end.valueOf())),(null!=r||null!=o)&&this.range.setRange(r,o)}},S.prototype.setGroups=function(t){this.groupsData=t;var e=this.groupsData?b:f;this.content instanceof e||(this.content&&(this.content.hide(),this.content.setItems&&this.content.setItems(),this.content.setGroups&&this.content.setGroups(),this.controller.remove(this.content)),this.content=new e(this.main,[this.timeaxis]),this.content.setRange&&this.content.setRange(this.range),this.content.setItems&&this.content.setItems(this.itemsData),this.content.setGroups&&this.content.setGroups(this.groupsData),this.controller.add(this.content),this.setOptions(this.options))},S.prototype.getItemRange=function(){var t=this.itemsData,e=null,i=null;if(t){var n=t.min("start");e=n?n.start.valueOf():null;var s=t.max("start");s&&(i=s.start.valueOf());var r=t.max("end");r&&(i=null==i?r.end.valueOf():Math.max(i,r.end.valueOf()))}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}};var C={util:E,events:_,Controller:p,DataSet:s,DataView:r,Range:a,Stack:o,TimeStep:TimeStep,EventBus:h,components:{items:{Item:m,ItemBox:g,ItemPoint:v,ItemRange:y},Component:u,Panel:c,RootPanel:d,ItemSet:f,TimeAxis:l},Timeline:S};n!==void 0&&(n=C),i!==void 0&&i.exports!==void 0&&(i.exports=C),"function"==typeof t&&t(function(){return C}),"undefined"!=typeof window&&(window.vis=C),E.loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .groupset {\n position: absolute;\n padding: 0;\n margin: 0;\n}\n\n\n.graph .itemset {\n position: absolute;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.graph .background {\n}\n\n.graph .foreground {\n}\n\n.graph .itemset-axis {\n position: absolute;\n}\n\n.graph .groupset .itemset-axis {\n border-top: 1px solid #bfbfbf;\n}\n\n.graph .groupset .itemset-axis:last-child {\n border-top: none;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n")},{moment:2}],2:[function(e,i){(function(){(function(n){function s(t,e){return function(i){return c(t.call(this,i),e)}}function r(t){return function(e){return this.lang().ordinal(t.call(this,e))}}function o(){}function a(t){p(this,t)}function h(t){var e=this._data={},i=t.years||t.year||t.y||0,n=t.months||t.month||t.M||0,s=t.weeks||t.week||t.w||0,r=t.days||t.day||t.d||0,o=t.hours||t.hour||t.h||0,a=t.minutes||t.minute||t.m||0,h=t.seconds||t.second||t.s||0,p=t.milliseconds||t.millisecond||t.ms||0;this._milliseconds=p+1e3*h+6e4*a+36e5*o,this._days=r+7*s,this._months=n+12*i,e.milliseconds=p%1e3,h+=u(p/1e3),e.seconds=h%60,a+=u(h/60),e.minutes=a%60,o+=u(a/60),e.hours=o%24,r+=u(o/24),r+=7*s,e.days=r%30,n+=u(r/30),e.months=n%12,i+=u(n/12),e.years=i}function p(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function u(t){return 0>t?Math.ceil(t):Math.floor(t)}function c(t,e){for(var i=t+"";e>i.length;)i="0"+i;return i}function d(t,e,i){var n,s=e._milliseconds,r=e._days,o=e._months;s&&t._d.setTime(+t+s*i),r&&t.date(t.date()+r*i),o&&(n=t.date(),t.date(1).month(t.month()+o*i).date(Math.min(n,t.daysInMonth())))}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function f(t,e){var i,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(i=0;n>i;i++)~~t[i]!==~~e[i]&&r++;return r+s}function m(t,e){return e.abbr=t,R[t]||(R[t]=new o),R[t].set(e),R[t]}function g(t){return t?(!R[t]&&U&&e("./lang/"+t),R[t]):I.fn._lang}function v(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function y(t){var e,i,n=t.match(F);for(e=0,i=n.length;i>e;e++)n[e]=ae[n[e]]?ae[n[e]]:v(n[e]);return function(s){var r="";for(e=0;i>e;e++)r+="function"==typeof n[e].call?n[e].call(s,t):n[e];return r}}function w(t,e){function i(e){return t.lang().longDateFormat(e)||e}for(var n=5;n--&&z.test(e);)e=e.replace(z,i);return se[e]||(se[e]=y(e)),se[e](t)}function b(t){switch(t){case"DDDD":return V;case"YYYY":return B;case"YYYYY":return Z;case"S":case"SS":case"SSS":case"DDD":return q;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return X;case"X":return J;case"Z":case"ZZ":return K;case"T":return G;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return W;default:return RegExp(t.replace("\\",""))}}function S(t,e,i){var n,s=i._a;switch(t){case"M":case"MM":s[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":n=g(i._l).monthsParse(e),null!=n?s[1]=n:i._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(s[2]=~~e);break;case"YY":s[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":s[0]=~~e;break;case"a":case"A":i._isPm="pm"===(e+"").toLowerCase();break;case"H":case"HH":case"h":case"hh":s[3]=~~e;break;case"m":case"mm":s[4]=~~e;break;case"s":case"ss":s[5]=~~e;break;case"S":case"SS":case"SSS":s[6]=~~(1e3*("0."+e));break;case"X":i._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":i._useUTC=!0,n=(e+"").match(ee),n&&n[1]&&(i._tzh=~~n[1]),n&&n[2]&&(i._tzm=~~n[2]),n&&"+"===n[0]&&(i._tzh=-i._tzh,i._tzm=-i._tzm)}null==e&&(i._isValid=!1)}function T(t){var e,i,n=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=n[e]=null==t._a[e]?2===e?1:0:t._a[e];n[3]+=t._tzh||0,n[4]+=t._tzm||0,i=new Date(0),t._useUTC?(i.setUTCFullYear(n[0],n[1],n[2]),i.setUTCHours(n[3],n[4],n[5],n[6])):(i.setFullYear(n[0],n[1],n[2]),i.setHours(n[3],n[4],n[5],n[6])),t._d=i}}function E(t){var e,i,n=t._f.match(F),s=t._i;for(t._a=[],e=0;n.length>e;e++)i=(b(n[e]).exec(s)||[])[0],i&&(s=s.slice(s.indexOf(i)+i.length)),ae[n[e]]&&S(n[e],i,t);t._isPm&&12>t._a[3]&&(t._a[3]+=12),t._isPm===!1&&12===t._a[3]&&(t._a[3]=0),T(t)}function M(t){for(var e,i,n,s,r=99;t._f.length;){if(e=p({},t),e._f=t._f.pop(),E(e),i=new a(e),i.isValid()){n=i;break}s=f(e._a,i.toArray()),r>s&&(r=s,n=i)}p(t,n)}function D(t){var e,i=t._i;if(Q.exec(i)){for(t._f="YYYY-MM-DDT",e=0;4>e;e++)if(te[e][1].exec(i)){t._f+=te[e][0];break}K.exec(i)&&(t._f+=" Z"),E(t)}else t._d=new Date(i)}function _(t){var e=t._i,i=P.exec(e);e===n?t._d=new Date:i?t._d=new Date(+i[1]):"string"==typeof e?D(t):l(e)?(t._a=e.slice(0),T(t)):t._d=e instanceof Date?new Date(+e):new Date(e)}function C(t,e,i,n,s){return s.relativeTime(e||1,!!i,t,n)}function x(t,e,i){var n=j(Math.abs(t)/1e3),s=j(n/60),r=j(s/60),o=j(r/24),a=j(o/365),h=45>n&&["s",n]||1===s&&["m"]||45>s&&["mm",s]||1===r&&["h"]||22>r&&["hh",r]||1===o&&["d"]||25>=o&&["dd",o]||45>=o&&["M"]||345>o&&["MM",j(o/30)]||1===a&&["y"]||["yy",a];return h[2]=e,h[3]=t>0,h[4]=i,C.apply({},h)}function L(t,e,i){var n=i-e,s=i-t.day();return s>n&&(s-=7),n-7>s&&(s+=7),Math.ceil(I(t).add("d",s).dayOfYear()/7)}function O(t){var e=t._i,i=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=g().preparse(e)),I.isMoment(e)?(t=p({},e),t._d=new Date(+e._d)):i?l(i)?M(t):E(t):_(t),new a(t))}function N(t,e){I.fn[t]=I.fn[t+"s"]=function(t){var i=this._isUTC?"UTC":"";return null!=t?(this._d["set"+i+e](t),this):this._d["get"+i+e]()}}function A(t){I.duration.fn[t]=function(){return this._data[t]}}function Y(t,e){I.duration.fn["as"+t]=function(){return+this/e}}for(var I,k,H="2.0.0",j=Math.round,R={},U=i!==n&&i.exports,P=/^\/?Date\((\-?\d+)/i,F=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,z=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,W=/\d\d?/,q=/\d{1,3}/,V=/\d{3}/,B=/\d{1,4}/,Z=/[+\-]?\d{1,6}/,X=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,K=/Z|[\+\-]\d\d:?\d\d/i,G=/T/i,J=/[\+\-]?\d+(\.\d{1,3})?/,Q=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,$="YYYY-MM-DDTHH:mm:ssZ",te=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ee=/([\+\-]|\d\d)/gi,ie="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),ne={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},se={},re="DDD w W M D d".split(" "),oe="M D H h m s w W".split(" "),ae={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return c(this.year()%100,2)},YYYY:function(){return c(this.year(),4)},YYYYY:function(){return c(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return c(~~(this.milliseconds()/10),2)},SSS:function(){return c(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(t/60),2)+":"+c(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(10*t/6),4)},X:function(){return this.unix()}};re.length;)k=re.pop(),ae[k+"o"]=r(ae[k]);for(;oe.length;)k=oe.pop(),ae[k+k]=s(ae[k],2);for(ae.DDDD=s(ae.DDD,3),o.prototype={set:function(t){var e,i;for(i in t)e=t[i],"function"==typeof e?this[i]=e:this["_"+i]=e},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t){var e,i,n;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(i=I([2e3,e]),n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[e]=RegExp(n.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},meridiem:function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},calendar:function(t,e){var i=this._calendar[t];return"function"==typeof i?i.apply(e):i},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(t,e,i,n){var s=this._relativeTime[i];return"function"==typeof s?s(t,e,i,n):s.replace(/%d/i,t)},pastFuture:function(t,e){var i=this._relativeTime[t>0?"future":"past"];return"function"==typeof i?i(e):i.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return L(t,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},I=function(t,e,i){return O({_i:t,_f:e,_l:i,_isUTC:!1})},I.utc=function(t,e,i){return O({_useUTC:!0,_isUTC:!0,_l:i,_i:t,_f:e})},I.unix=function(t){return I(1e3*t)},I.duration=function(t,e){var i,n=I.isDuration(t),s="number"==typeof t,r=n?t._data:s?{}:t;return s&&(e?r[e]=t:r.milliseconds=t),i=new h(r),n&&t.hasOwnProperty("_lang")&&(i._lang=t._lang),i},I.version=H,I.defaultFormat=$,I.lang=function(t,e){return t?(e?m(t,e):R[t]||g(t),I.duration.fn._lang=I.fn._lang=g(t),n):I.fn._lang._abbr},I.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),g(t)},I.isMoment=function(t){return t instanceof a},I.isDuration=function(t){return t instanceof h},I.fn=a.prototype={clone:function(){return I(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return I.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!f(this._a,(this._isUTC?I.utc(this._a):I(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(t){var e=w(this,t||I.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var i;return i="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,i,1),this},subtract:function(t,e){var i;return i="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,i,-1),this},diff:function(t,e,i){var n,s,r=this._isUTC?I(t).utc():I(t).local(),o=6e4*(this.zone()-r.zone());return e&&(e=e.replace(/s$/,"")),"year"===e||"month"===e?(n=432e5*(this.daysInMonth()+r.daysInMonth()),s=12*(this.year()-r.year())+(this.month()-r.month()),s+=(this-I(this).startOf("month")-(r-I(r).startOf("month")))/n,"year"===e&&(s/=12)):(n=this-r-o,s="second"===e?n/1e3:"minute"===e?n/6e4:"hour"===e?n/36e5:"day"===e?n/864e5:"week"===e?n/6048e5:n),i?s:u(s)},from:function(t,e){return I.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(I(),t)},calendar:function(){var t=this.diff(I().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+I(t).startOf(e)},isBefore:function(t,e){return e=e!==n?e:"millisecond",+this.clone().startOf(e)<+I(t).startOf(e)},isSame:function(t,e){return e=e!==n?e:"millisecond",+this.clone().startOf(e)===+I(t).startOf(e)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return I.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=j((I(this).startOf("day")-I(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},isoWeek:function(t){var e=L(this,1,4);return null==t?e:this.add("d",7*(t-e))},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},lang:function(t){return t===n?this._lang:(this._lang=g(t),this)}},k=0;ie.length>k;k++)N(ie[k].toLowerCase().replace(/s$/,""),ie[k]);N("year","FullYear"),I.fn.days=I.fn.day,I.fn.weeks=I.fn.week,I.fn.isoWeeks=I.fn.isoWeek,I.duration.fn=h.prototype={weeks:function(){return u(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+2592e6*this._months},humanize:function(t){var e=+this,i=x(e,!t,this.lang());return t&&(i=this.lang().pastFuture(e,i)),this.lang().postformat(i)},lang:I.fn.lang};for(k in ne)ne.hasOwnProperty(k)&&(Y(k,ne[k]),A(k.toLowerCase()));Y("Weeks",6048e5),I.lang("en",{ordinal:function(t){var e=t%10,i=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),U&&(i.exports=I),"undefined"==typeof ender&&(this.moment=I),"function"==typeof t&&t.amd&&t("moment",[],function(){return I})}).call(this)})()},{}]},{},[1])(1)}); \ No newline at end of file +(function(t){if("function"==typeof bootstrap)bootstrap("vis",t);else if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeVis=t}else"undefined"!=typeof window?window.vis=t():global.vis=t()})(function(){var t;return function(t,e,i){function n(i,s){if(!e[i]){if(!t[i]){var o="function"==typeof require&&require;if(!s&&o)return o(i,!0);if(r)return r(i,!0);throw Error("Cannot find module '"+i+"'")}var a=e[i]={exports:{}};t[i][0].call(a.exports,function(e){var r=t[i][1][e];return n(r?r:e)},a,a.exports)}return e[i].exports}for(var r="function"==typeof require&&require,s=0;i.length>s;s++)n(i[s]);return n}({1:[function(e,i,n){function r(t){if(this.id=E.randomUUID(),this.options=t||{},this.data={},this.fieldId=this.options.fieldId||"id",this.fieldTypes={},this.options.fieldTypes)for(var e in this.options.fieldTypes)if(this.options.fieldTypes.hasOwnProperty(e)){var i=this.options.fieldTypes[e];this.fieldTypes[e]="Date"==i||"ISODate"==i||"ASPDate"==i?"Date":i}this.subscribers={},this.internalIds={}}function s(t,e){this.id=E.randomUUID(),this.data=null,this.ids={},this.options=e||{},this.fieldId="id",this.subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}function o(t,e){this.parent=t,this.options=Object.create(t&&t.options||0),this.defaultOptions={order:function(t,e){if(t instanceof y){if(e instanceof y){var i=t.data.end-t.data.start,n=e.data.end-e.data.start;return i-n||t.data.start-e.data.start}return-1}return e instanceof y?1:t.data.start-e.data.start},margin:{item:10}},this.ordered=[],this.setOptions(e)}function a(t){this.id=E.randomUUID(),this.start=0,this.end=0,this.options={min:null,max:null,zoomMin:null,zoomMax:null},this.setOptions(t),this.listeners=[]}function h(){this.subscriptions=[]}function p(){this.id=E.randomUUID(),this.components={},this.repaintTimer=void 0,this.reflowTimer=void 0}function u(){this.id=null,this.parent=null,this.depends=null,this.controller=null,this.options=null,this.frame=null,this.top=0,this.left=0,this.width=0,this.height=0}function c(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.options=Object.create(t&&t.options||null),this.setOptions(i)}function d(t,e){this.id=E.randomUUID(),this.container=t,this.options=Object.create(e||null),this.defaultOptions={autoResize:!0},this.listeners={},this.setOptions(e)}function l(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.dom={majorLines:[],majorTexts:[],minorLines:[],minorTexts:[],redundant:{majorLines:[],majorTexts:[],minorLines:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.options=Object.create(t&&t.options||null),this.defaultOptions={orientation:"bottom",showMinorLabels:!0,showMajorLabels:!0},this.conversion=null,this.range=null,this.setOptions(i)}function f(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.options=Object.create(t&&t.options||null),this.defaultOptions={style:"box",align:"center",orientation:"bottom",margin:{axis:20,item:10},padding:5},this.dom={};var n=this;this.itemsData=null,this.range=null,this.listeners={add:function(t,e,i){i!=n.id&&n._onAdd(e.items)},update:function(t,e,i){i!=n.id&&n._onUpdate(e.items)},remove:function(t,e,i){i!=n.id&&n._onRemove(e.items)}},this.items={},this.queue={},this.stack=new o(this),this.conversion=null,this.setOptions(i)}function m(t,e,i,n){this.parent=t,this.data=e,this.dom=null,this.options=i||{},this.defaultOptions=n||{},this.selected=!1,this.visible=!1,this.top=0,this.left=0,this.width=0,this.height=0}function g(t,e,i,n){this.props={dot:{left:0,top:0,width:0,height:0},line:{top:0,left:0,width:0,height:0}},m.call(this,t,e,i,n)}function v(t,e,i,n){this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0}},m.call(this,t,e,i,n)}function y(t,e,i,n){this.props={content:{left:0,width:0}},m.call(this,t,e,i,n)}function w(t,e,i){this.id=E.randomUUID(),this.parent=t,this.groupId=e,this.itemsData=null,this.items=null,this.options=Object.create(t&&t.options||null),this.options.top=0,this.top=0,this.left=0,this.width=0,this.height=0,this.setOptions(i)}function b(t,e,i){this.id=E.randomUUID(),this.parent=t,this.depends=e,this.options=Object.create(t&&t.options||null),this.range=null,this.itemsData=null,this.groupsData=null,this.groups=[],this.queue={};var n=this;this.listeners={add:function(t,e){n._onAdd(e.items)},update:function(t,e){n._onUpdate(e.items)},remove:function(t,e){n._onRemove(e.items)}},this.setOptions(i)}function S(t,e,i){var n=this;if(this.options={orientation:"bottom",min:null,max:null,zoomMin:10,zoomMax:31536e10,moveable:!0,zoomable:!0,showMinorLabels:!0,showMajorLabels:!0,autoResize:!1},this.controller=new p,!t)throw Error("No container element provided");var r=Object.create(this.options);this.main=new d(t,r),this.controller.add(this.main);var s=T().hours(0).minutes(0).seconds(0).milliseconds(0);this.range=new a({start:s.clone().add("days",-3).valueOf(),end:s.clone().add("days",4).valueOf()}),this.range.subscribe(this.main,"move","horizontal"),this.range.subscribe(this.main,"zoom","horizontal"),this.range.on("rangechange",function(){var t=!0;n.controller.requestReflow(t)}),this.range.on("rangechanged",function(){var t=!0;n.controller.requestReflow(t)});var o=Object.create(this.options);o.range=this.range,this.timeaxis=new l(this.main,[],o),this.timeaxis.setRange(this.range),this.controller.add(this.timeaxis),this.setGroups(null),this.itemsData=null,this.groupsData=null,this.setOptions(i),e&&this.setItems(e)}var T=e("moment"),E={};E.isNumber=function(t){return t instanceof Number||"number"==typeof t},E.isString=function(t){return t instanceof String||"string"==typeof t},E.isDate=function(t){if(t instanceof Date)return!0;if(E.isString(t)){var e=M.exec(t);if(e)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},E.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},E.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},E.extend=function(t){for(var e=1,i=arguments.length;i>e;e++){var n=arguments[e];for(var r in n)n.hasOwnProperty(r)&&void 0!==n[r]&&(t[r]=n[r])}return t},E.cast=function(t,e){var i;if(void 0===t)return void 0;if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t);case"string":case"String":return t+"";case"Date":if(E.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(T.isMoment(t))return new Date(t.valueOf());if(E.isString(t))return i=M.exec(t),i?new Date(Number(i[1])):T(t).toDate();throw Error("Cannot cast object of type "+E.getType(t)+" to type Date");case"Moment":if(E.isNumber(t))return T(t);if(t instanceof Date)return T(t.valueOf());if(T.isMoment(t))return T.clone();if(E.isString(t))return i=M.exec(t),i?T(Number(i[1])):T(t);throw Error("Cannot cast object of type "+E.getType(t)+" to type Date");case"ISODate":if(t instanceof Date)return t.toISOString();if(T.isMoment(t))return t.toDate().toISOString();if(E.isNumber(t)||E.isString(t))return T(t).toDate().toISOString();throw Error("Cannot cast object of type "+E.getType(t)+" to type ISODate");case"ASPDate":if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(E.isNumber(t)||E.isString(t))return"/Date("+T(t).valueOf()+")/";throw Error("Cannot cast object of type "+E.getType(t)+" to type ASPDate");default:throw Error("Cannot cast object of type "+E.getType(t)+' to type "'+e+'"')}};var M=/^\/?Date\((\-?\d+)/i;if(E.getType=function(t){var e=typeof t;return"object"==e?null==t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":t instanceof Array?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":e},E.getAbsoluteLeft=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetLeft,r=t.offsetParent;null!=r&&r!=i&&r!=e;)n+=r.offsetLeft,n-=r.scrollLeft,r=r.offsetParent;return n},E.getAbsoluteTop=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetTop,r=t.offsetParent;null!=r&&r!=i&&r!=e;)n+=r.offsetTop,n-=r.scrollTop,r=r.offsetParent;return n},E.getPageY=function(t){if("pageY"in t)return t.pageY;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientY:t.clientY;var i=document.documentElement,n=document.body;return e+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)},E.getPageX=function(t){if("pageY"in t)return t.pageX;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientX:t.clientX;var i=document.documentElement,n=document.body;return e+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0)},E.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},E.removeClassName=function(t,e){var i=t.className.split(" "),n=i.indexOf(e);-1!=n&&(i.splice(n,1),t.className=i.join(" "))},E.forEach=function(t,e){var i,n;if(t instanceof Array)for(i=0,n=t.length;n>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},E.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},E.addEventListener=function(t,e,i,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)},E.removeEventListener=function(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)},E.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},E.stopPropagation=function(t){t||(t=window.event),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},E.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},E.option={},E.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},E.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},E.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?t+"":e||null},E.option.asSize=function(t,e){return"function"==typeof t&&(t=t()),E.isString(t)?t:E.isNumber(t)?t+"px":e||null},E.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},E.loadCss=function(t){if("undefined"!=typeof document){var e=document.createElement("style");e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(e)}},!Array.prototype.indexOf){Array.prototype.indexOf=function(t){for(var e=0;this.length>e;e++)if(this[e]==t)return e;return-1};try{console.log("Warning: Ancient browser detected. Please update your browser")}catch(D){}}Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var i=0,n=this.length;n>i;++i)t.call(e||this,this[i],i,this)}),Array.prototype.map||(Array.prototype.map=function(t,e){var i,n,r;if(null==this)throw new TypeError(" this is null or not defined");var s=Object(this),o=s.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(e&&(i=e),n=Array(o),r=0;o>r;){var a,h;r in s&&(a=s[r],h=t.call(i,a,r,s),n[r]=h),r++}return n}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=[],r=arguments[1],s=0;i>s;s++)if(s in e){var o=e[s];t.call(r,o,s,e)&&n.push(o)}return n}),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=i.length;return function(r){if("object"!=typeof r&&"function"!=typeof r||null===r)throw new TypeError("Object.keys called on non-object");var s=[];for(var o in r)t.call(r,o)&&s.push(o);if(e)for(var a=0;n>a;a++)t.call(r,i[a])&&s.push(i[a]);return s}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),i=this,n=function(){},r=function(){return i.apply(this instanceof n&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,r.prototype=new n,r}),Object.create||(Object.create=function(t){function e(){}if(arguments.length>1)throw Error("Object.create implementation only accepts the first parameter.");return e.prototype=t,new e});var _={listeners:[],indexOf:function(t){for(var e=this.listeners,i=0,n=this.listeners.length;n>i;i++){var r=e[i];if(r&&r.object==t)return i}return-1},addListener:function(t,e,i){var n=this.indexOf(t),r=this.listeners[n];r||(r={object:t,events:{}},this.listeners.push(r));var s=r.events[e];s||(s=[],r.events[e]=s),-1==s.indexOf(i)&&s.push(i)},removeListener:function(t,e,i){var n=this.indexOf(t),r=this.listeners[n];if(r){var s=r.events[e];s&&(n=s.indexOf(i),-1!=n&&s.splice(n,1),0==s.length&&delete r.events[e]);var o=0,a=r.events;for(var h in a)a.hasOwnProperty(h)&&o++;0==o&&delete this.listeners[n]}},removeAllListeners:function(){this.listeners=[]},trigger:function(t,e,i){var n=this.indexOf(t),r=this.listeners[n];if(r){var s=r.events[e];if(s)for(var o=0,a=s.length;a>o;o++)s[o](i)}}};TimeStep=function(t,e,i){this.current=new Date,this._start=new Date,this._end=new Date,this.autoScale=!0,this.scale=TimeStep.SCALE.DAY,this.step=1,this.setRange(t,e,i)},TimeStep.SCALE={MILLISECOND:1,SECOND:2,MINUTE:3,HOUR:4,DAY:5,WEEKDAY:6,MONTH:7,YEAR:8},TimeStep.prototype.setRange=function(t,e,i){t instanceof Date&&e instanceof Date&&(this._start=void 0!=t?new Date(t.valueOf()):new Date,this._end=void 0!=e?new Date(e.valueOf()):new Date,this.autoScale&&this.setMinimumStep(i))},TimeStep.prototype.first=function(){this.current=new Date(this._start.valueOf()),this.roundToMinor()},TimeStep.prototype.roundToMinor=function(){switch(this.scale){case TimeStep.SCALE.YEAR:this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step)),this.current.setMonth(0);case TimeStep.SCALE.MONTH:this.current.setDate(1);case TimeStep.SCALE.DAY:case TimeStep.SCALE.WEEKDAY:this.current.setHours(0);case TimeStep.SCALE.HOUR:this.current.setMinutes(0);case TimeStep.SCALE.MINUTE:this.current.setSeconds(0);case TimeStep.SCALE.SECOND:this.current.setMilliseconds(0)}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step);break;default:}},TimeStep.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},TimeStep.prototype.next=function(){var t=this.current.valueOf();if(6>this.current.getMonth())switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current=new Date(this.current.valueOf()+1e3*this.step);break;case TimeStep.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+60*1e3*this.step);break;case TimeStep.SCALE.HOUR:this.current=new Date(this.current.valueOf()+60*60*1e3*this.step);var e=this.current.getHours();this.current.setHours(e-e%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}else switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.getMilliseconds()0&&(this.step=e),this.autoScale=!1},TimeStep.prototype.setAutoScale=function(t){this.autoScale=t},TimeStep.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,n=864e5,r=36e5,s=6e4,o=1e3,a=1;1e3*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1e3),500*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=500),100*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=100),50*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=50),10*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=10),5*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=5),e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1),3*i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=3),i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=1),5*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=5),2*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=2),n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=1),n/2>t&&(this.scale=TimeStep.SCALE.WEEKDAY,this.step=1),4*r>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=4),r>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=1),15*s>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=15),10*s>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=10),5*s>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=5),s>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=1),15*o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=15),10*o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=10),5*o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=5),o>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=1),200*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=200),100*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=100),50*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=50),10*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=10),5*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=5),a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=1)}},TimeStep.prototype.snap=function(t){if(this.scale==TimeStep.SCALE.YEAR){var e=t.getFullYear()+Math.round(t.getMonth()/12);t.setFullYear(Math.round(e/this.step)*this.step),t.setMonth(0),t.setDate(0),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MONTH)t.getDate()>15?(t.setDate(1),t.setMonth(t.getMonth()+1)):t.setDate(1),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);else if(this.scale==TimeStep.SCALE.DAY||this.scale==TimeStep.SCALE.WEEKDAY){switch(this.step){case 5:case 2:t.setHours(24*Math.round(t.getHours()/24));break;default:t.setHours(12*Math.round(t.getHours()/12))}t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.HOUR){switch(this.step){case 4:t.setMinutes(60*Math.round(t.getMinutes()/60));break;default:t.setMinutes(30*Math.round(t.getMinutes()/30))}t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MINUTE){switch(this.step){case 15:case 10:t.setMinutes(5*Math.round(t.getMinutes()/5)),t.setSeconds(0);break;case 5:t.setSeconds(60*Math.round(t.getSeconds()/60));break;default:t.setSeconds(30*Math.round(t.getSeconds()/30))}t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.SECOND)switch(this.step){case 15:case 10:t.setSeconds(5*Math.round(t.getSeconds()/5)),t.setMilliseconds(0);break;case 5:t.setMilliseconds(1e3*Math.round(t.getMilliseconds()/1e3));break;default:t.setMilliseconds(500*Math.round(t.getMilliseconds()/500))}else if(this.scale==TimeStep.SCALE.MILLISECOND){var i=this.step>5?this.step/2:1;t.setMilliseconds(Math.round(t.getMilliseconds()/i)*i)}},TimeStep.prototype.isMajor=function(){switch(this.scale){case TimeStep.SCALE.MILLISECOND:return 0==this.current.getMilliseconds();case TimeStep.SCALE.SECOND:return 0==this.current.getSeconds();case TimeStep.SCALE.MINUTE:return 0==this.current.getHours()&&0==this.current.getMinutes();case TimeStep.SCALE.HOUR:return 0==this.current.getHours();case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return 1==this.current.getDate();case TimeStep.SCALE.MONTH:return 0==this.current.getMonth();case TimeStep.SCALE.YEAR:return!1;default:return!1}},TimeStep.prototype.getLabelMinor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return T(t).format("SSS");case TimeStep.SCALE.SECOND:return T(t).format("s");case TimeStep.SCALE.MINUTE:return T(t).format("HH:mm");case TimeStep.SCALE.HOUR:return T(t).format("HH:mm");case TimeStep.SCALE.WEEKDAY:return T(t).format("ddd D");case TimeStep.SCALE.DAY:return T(t).format("D");case TimeStep.SCALE.MONTH:return T(t).format("MMM");case TimeStep.SCALE.YEAR:return T(t).format("YYYY");default:return""}},TimeStep.prototype.getLabelMajor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return T(t).format("HH:mm:ss");case TimeStep.SCALE.SECOND:return T(t).format("D MMMM HH:mm");case TimeStep.SCALE.MINUTE:case TimeStep.SCALE.HOUR:return T(t).format("ddd D MMMM");case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return T(t).format("MMMM YYYY");case TimeStep.SCALE.MONTH:return T(t).format("YYYY");case TimeStep.SCALE.YEAR:return"";default:return""}},r.prototype.subscribe=function(t,e,i){var n=this.subscribers[t];n||(n=[],this.subscribers[t]=n),n.push({id:i?i+"":null,callback:e})},r.prototype.unsubscribe=function(t,e){var i=this.subscribers[t];i&&(this.subscribers[t]=i.filter(function(t){return t.callback!=e}))},r.prototype._trigger=function(t,e,i){if("*"==t)throw Error("Cannot trigger event *");var n=[];t in this.subscribers&&(n=n.concat(this.subscribers[t])),"*"in this.subscribers&&(n=n.concat(this.subscribers["*"]));for(var r=0;n.length>r;r++){var s=n[r];s.callback&&s.callback(t,e,i||null)}},r.prototype.add=function(t,e){var i,n=[],r=this;if(t instanceof Array)for(var s=0,o=t.length;o>s;s++)i=r._addItem(t[s]),n.push(i);else if(E.isDataTable(t))for(var a=this._getColumnNames(t),h=0,p=t.getNumberOfRows();p>h;h++){for(var u={},c=0,d=a.length;d>c;c++){var l=a[c];u[l]=t.getValue(h,c)}i=r._addItem(u),n.push(i)}else{if(!(t instanceof Object))throw Error("Unknown dataType");i=r._addItem(t),n.push(i)}n.length&&this._trigger("add",{items:n},e)},r.prototype.update=function(t,e){var i=[],n=[],r=this,s=r.fieldId,o=function(t){var e=t[s];r.data[e]?(e=r._updateItem(t),n.push(e)):(e=r._addItem(t),i.push(e))};if(t instanceof Array)for(var a=0,h=t.length;h>a;a++)o(t[a]);else if(E.isDataTable(t))for(var p=this._getColumnNames(t),u=0,c=t.getNumberOfRows();c>u;u++){for(var d={},l=0,f=p.length;f>l;l++){var m=p[l];d[m]=t.getValue(u,l)}o(d)}else{if(!(t instanceof Object))throw Error("Unknown dataType");o(t)}i.length&&this._trigger("add",{items:i},e),n.length&&this._trigger("update",{items:n},e)},r.prototype.get=function(){var t,e,i,n,r=this,s=E.getType(arguments[0]);"String"==s||"Number"==s?(t=arguments[0],i=arguments[1],n=arguments[2]):"Array"==s?(e=arguments[0],i=arguments[1],n=arguments[2]):(i=arguments[0],n=arguments[1]);var o;if(i&&i.type){if(o="DataTable"==i.type?"DataTable":"Array",n&&o!=E.getType(n))throw Error('Type of parameter "data" ('+E.getType(n)+") "+"does not correspond with specified options.type ("+i.type+")");if("DataTable"==o&&!E.isDataTable(n))throw Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else o=n?"DataTable"==E.getType(n)?"DataTable":"Array":"Array";var a,h,p,u,c=this._composeItemOptions(i);if("DataTable"==o){var d=this._getColumnNames(n);if(void 0!=t)a=r._getItem(t,c),a&&this._appendRow(n,d,a);else if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=r._getItem(e[p],c),a&&r._appendRow(n,d,a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=r._getItem(h,c),a&&r._appendRow(n,d,a))}else{if(n||(n=[]),void 0!=t)return r._getItem(t,c);if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=r._getItem(e[p],c),a&&n.push(a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=r._getItem(h,c),a&&n.push(a))}return n},r.prototype.getIds=function(t){var e,i,n=this.data,r=[];if(t&&t.filter){var s=this._composeItemOptions({filter:t&&t.filter});for(e in n)n.hasOwnProperty(e)&&(i=this._getItem(e,s),i&&r.push(i[this.fieldId]))}else for(e in n)n.hasOwnProperty(e)&&(i=n[e],r.push(i[this.fieldId]));return r},r.prototype.forEach=function(t,e){var i,n=this._composeItemOptions(e),r=this.data;for(var s in r)r.hasOwnProperty(s)&&(i=this._getItem(s,n),i&&t(i,s))},r.prototype.map=function(t,e){var i,n=this._composeItemOptions(e),r=[],s=this.data;for(var o in s)s.hasOwnProperty(o)&&(i=this._getItem(o,n),i&&r.push(t(i,o)));return r},r.prototype._composeItemOptions=function(t){var e={};return t&&(e.fieldTypes={},this.options&&this.options.fieldTypes&&E.extend(e.fieldTypes,this.options.fieldTypes),t.fieldTypes&&E.extend(e.fieldTypes,t.fieldTypes),t.fields&&(e.fields=t.fields),t.filter&&(e.filter=t.filter)),e},r.prototype.remove=function(t,e){var i,n,r=[];if(E.isNumber(t)||E.isString(t))delete this.data[t],delete this.internalIds[t],r.push(t);else if(t instanceof Array){for(i=0,n=t.length;n>i;i++)this.remove(t[i]);r=items.concat(t)}else if(t instanceof Object)for(i in this.data)this.data.hasOwnProperty(i)&&this.data[i]==t&&(delete this.data[i],delete this.internalIds[i],r.push(i));r.length&&this._trigger("remove",{items:r},e)},r.prototype.clear=function(t){var e=Object.keys(this.data);this.data={},this.internalIds={},this._trigger("remove",{items:e},t)},r.prototype.max=function(t){var e=this.data,i=null,n=null;for(var r in e)if(e.hasOwnProperty(r)){var s=e[r],o=s[t];null!=o&&(!i||o>n)&&(i=s,n=o)}return i},r.prototype.min=function(t){var e=this.data,i=null,n=null;for(var r in e)if(e.hasOwnProperty(r)){var s=e[r],o=s[t];null!=o&&(!i||n>o)&&(i=s,n=o)}return i},r.prototype.distinct=function(t){var e=this.data,i=[],n=this.options.fieldTypes[t],r=0;for(var s in e)if(e.hasOwnProperty(s)){for(var o=e[s],a=E.cast(o[t],n),h=!1,p=0;r>p;p++)if(i[p]==a){h=!0;break}h||(i[r]=a,r++)}return i},r.prototype._addItem=function(t){var e=t[this.fieldId];if(void 0!=e){if(this.data[e])throw Error("Cannot add item: item with id "+e+" already exists")}else e=E.randomUUID(),t[this.fieldId]=e,this.internalIds[e]=t;var i={};for(var n in t)if(t.hasOwnProperty(n)){var r=this.fieldTypes[n];i[n]=E.cast(t[n],r)}return this.data[e]=i,e},r.prototype._getItem=function(t,e){var i,n,r=this.data[t];if(!r)return null;var s={},o=this.fieldId,a=this.internalIds;if(e.fieldTypes){var h=e.fieldTypes;for(i in r)r.hasOwnProperty(i)&&(n=r[i],i==o&&n in a||(s[i]=E.cast(n,h[i])))}else for(i in r)r.hasOwnProperty(i)&&(n=r[i],i==o&&n in a||(s[i]=n));if(e.filter&&!e.filter(s))return null;if(e.fields){var p={},u=e.fields;for(i in s)s.hasOwnProperty(i)&&-1!=u.indexOf(i)&&(p[i]=s[i]);return p}return s},r.prototype._updateItem=function(t){var e=t[this.fieldId];if(void 0==e)throw Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var i=this.data[e];if(!i)throw Error("Cannot update item: no item with id "+e+" found");for(var n in t)if(t.hasOwnProperty(n)){var r=this.fieldTypes[n];i[n]=E.cast(t[n],r)}return e},r.prototype._getColumnNames=function(t){for(var e=[],i=0,n=t.getNumberOfColumns();n>i;i++)e[i]=t.getColumnId(i)||t.getColumnLabel(i);return e},r.prototype._appendRow=function(t,e,i){for(var n=t.addRow(),r=0,s=e.length;s>r;r++){var o=e[r];t.setValue(n,r,i[o])}},s.prototype.setData=function(t){var e,i,n;if(this.data){this.data.unsubscribe&&this.data.unsubscribe("*",this.listener),e=[];for(var r in this.ids)this.ids.hasOwnProperty(r)&&e.push(r);this.ids={},this._trigger("remove",{items:e})}if(this.data=t,this.data){for(this.fieldId=this.options.fieldId||this.data&&this.data.options&&this.data.options.fieldId||"id",e=this.data.getIds({filter:this.options&&this.options.filter}),i=0,n=e.length;n>i;i++)r=e[i],this.ids[r]=!0;this._trigger("add",{items:e}),this.data.subscribe&&this.data.subscribe("*",this.listener)}},s.prototype.get=function(){var t,e,i,n=this,r=E.getType(arguments[0]);"String"==r||"Number"==r||"Array"==r?(t=arguments[0],e=arguments[1],i=arguments[2]):(e=arguments[0],i=arguments[1]);var s=E.extend({},this.options,e);this.options.filter&&e&&e.filter&&(s.filter=function(t){return n.options.filter(t)&&e.filter(t)});var o=[];return void 0!=t&&o.push(t),o.push(s),o.push(i),this.data&&this.data.get.apply(this.data,o)},s.prototype.getIds=function(t){var e;if(this.data){var i,n=this.options.filter;i=t&&t.filter?n?function(e){return n(e)&&t.filter(e)}:t.filter:n,e=this.data.getIds({filter:i})}else e=[];return e},s.prototype._onEvent=function(t,e,i){var n,r,s,o,a=e&&e.items,h=this.data,p=[],u=[],c=[];if(a&&h){switch(t){case"add":for(n=0,r=a.length;r>n;n++)s=a[n],o=this.get(s),o&&(this.ids[s]=!0,p.push(s));break;case"update":for(n=0,r=a.length;r>n;n++)s=a[n],o=this.get(s),o?this.ids[s]?u.push(s):(this.ids[s]=!0,p.push(s)):this.ids[s]&&(delete this.ids[s],c.push(s));break;case"remove":for(n=0,r=a.length;r>n;n++)s=a[n],this.ids[s]&&(delete this.ids[s],c.push(s))}p.length&&this._trigger("add",{items:p},i),u.length&&this._trigger("update",{items:u},i),c.length&&this._trigger("remove",{items:c},i)}},s.prototype.subscribe=r.prototype.subscribe,s.prototype.unsubscribe=r.prototype.unsubscribe,s.prototype._trigger=r.prototype._trigger,o.prototype.setOptions=function(t){E.extend(this.options,t)},o.prototype.update=function(){this._order(),this._stack()},o.prototype._order=function(){var t=this.parent.items;if(!t)throw Error("Cannot stack items: parent does not contain items");var e=[],i=0;E.forEach(t,function(t){t.visible&&(e[i]=t,i++)});var n=this.options.order||this.defaultOptions.order;if("function"!=typeof n)throw Error("Option order must be a function");e.sort(n),this.ordered=e},o.prototype._stack=function(){var t,e,i,n=this.ordered,r=this.options,s=r.orientation||this.defaultOptions.orientation,o="top"==s; +for(i=r.margin&&void 0!==r.margin.item?r.margin.item:this.defaultOptions.margin.item,t=0,e=n.length;e>t;t++){var a=n[t],h=null;do h=this.checkOverlap(n,t,0,t-1,i),null!=h&&(a.top=o?h.top+h.height+i:h.top-a.height-i);while(h)}},o.prototype.checkOverlap=function(t,e,i,n,r){for(var s=this.collision,o=t[e],a=n;a>=i;a--){var h=t[a];if(s(o,h,r)&&a!=e)return h}return null},o.prototype.collision=function(t,e,i){return t.left-ie.left&&t.top-ie.top},a.prototype.setOptions=function(t){E.extend(this.options,t),(null!=t.start||null!=t.end)&&this.setRange(t.start,t.end)},a.prototype.subscribe=function(t,e,i){var n,r=this;if("horizontal"!=i&&"vertical"!=i)throw new TypeError('Unknown direction "'+i+'". '+'Choose "horizontal" or "vertical".');if("move"==e)n={component:t,event:e,direction:i,callback:function(t){r._onMouseDown(t,n)},params:{}},t.on("mousedown",n.callback),r.listeners.push(n);else{if("zoom"!=e)throw new TypeError('Unknown event "'+e+'". '+'Choose "move" or "zoom".');n={component:t,event:e,direction:i,callback:function(t){r._onMouseWheel(t,n)},params:{}},t.on("mousewheel",n.callback),r.listeners.push(n)}},a.prototype.on=function(t,e){_.addListener(this,t,e)},a.prototype._trigger=function(t){_.trigger(this,t,{start:this.start,end:this.end})},a.prototype.setRange=function(t,e){var i=this._applyRange(t,e);i&&(this._trigger("rangechange"),this._trigger("rangechanged"))},a.prototype._applyRange=function(t,e){var i,n=null!=t?E.cast(t,"Number"):this.start,r=null!=e?E.cast(e,"Number"):this.end;if(isNaN(n))throw Error('Invalid start "'+t+'"');if(isNaN(r))throw Error('Invalid end "'+e+'"');if(n>r&&(r=n),null!=this.options.min){var s=this.options.min.valueOf();s>n&&(i=s-n,n+=i,r+=i)}if(null!=this.options.max){var o=this.options.max.valueOf();r>o&&(i=r-o,n-=i,r-=i)}if(null!=this.options.zoomMin){var a=this.options.zoomMin.valueOf();0>a&&(a=0),a>r-n&&(this.end-this.start>a?(i=a-(r-n),n-=i/2,r+=i/2):(n=this.start,r=this.end))}if(null!=this.options.zoomMax){var h=this.options.zoomMax.valueOf();0>h&&(h=0),r-n>h&&(h>this.end-this.start?(i=r-n-h,n+=i/2,r-=i/2):(n=this.start,r=this.end))}var p=this.start!=n||this.end!=r;return this.start=n,this.end=r,p},a.prototype.getRange=function(){return{start:this.start,end:this.end}},a.prototype.conversion=function(t){return this.start,this.end,a.conversion(this.start,this.end,t)},a.conversion=function(t,e,i){return 0!=i&&0!=e-t?{offset:t,factor:i/(e-t)}:{offset:0,factor:1}},a.prototype._onMouseDown=function(t,e){t=t||window.event;var i=e.params,n=t.which?1==t.which:1==t.button;if(n){i.mouseX=E.getPageX(t),i.mouseY=E.getPageY(t),i.previousLeft=0,i.previousOffset=0,i.moved=!1,i.start=this.start,i.end=this.end;var r=e.component.frame;r&&(r.style.cursor="move");var s=this;i.onMouseMove||(i.onMouseMove=function(t){s._onMouseMove(t,e)},E.addEventListener(document,"mousemove",i.onMouseMove)),i.onMouseUp||(i.onMouseUp=function(t){s._onMouseUp(t,e)},E.addEventListener(document,"mouseup",i.onMouseUp)),E.preventDefault(t)}},a.prototype._onMouseMove=function(t,e){t=t||window.event;var i=e.params,n=E.getPageX(t),r=E.getPageY(t);void 0==i.mouseX&&(i.mouseX=n),void 0==i.mouseY&&(i.mouseY=r);var s=n-i.mouseX,o=r-i.mouseY,a="horizontal"==e.direction?s:o;Math.abs(a)>=1&&(i.moved=!0);var h=i.end-i.start,p="horizontal"==e.direction?e.component.width:e.component.height,u=-a/p*h;this._applyRange(i.start+u,i.end+u),this._trigger("rangechange"),E.preventDefault(t)},a.prototype._onMouseUp=function(t,e){t=t||window.event;var i=e.params;e.component.frame&&(e.component.frame.style.cursor="auto"),i.onMouseMove&&(E.removeEventListener(document,"mousemove",i.onMouseMove),i.onMouseMove=null),i.onMouseUp&&(E.removeEventListener(document,"mouseup",i.onMouseUp),i.onMouseUp=null),i.moved&&this._trigger("rangechanged")},a.prototype._onMouseWheel=function(t,e){t=t||window.event;var i=0;if(t.wheelDelta?i=t.wheelDelta/120:t.detail&&(i=-t.detail/3),i){var n=this,r=function(){var r=i/5,s=null,o=e.component.frame;if(o){var a,h;if("horizontal"==e.direction){a=e.component.width,h=n.conversion(a);var p=E.getAbsoluteLeft(o),u=E.getPageX(t);s=(u-p)/h.factor+h.offset}else{a=e.component.height,h=n.conversion(a);var c=E.getAbsoluteTop(o),d=E.getPageY(t);s=(c+a-d-c)/h.factor+h.offset}}n.zoom(r,s)};r()}E.preventDefault(t)},a.prototype.zoom=function(t,e){null==e&&(e=(this.start+this.end)/2),t>=1&&(t=.9),-1>=t&&(t=-.9),0>t&&(t/=1+t);var i=this.start-e,n=this.end-e,r=this.start-i*t,s=this.end-n*t;this.setRange(r,s)},a.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,n=this.end+e*t;this.start=i,this.end=n},h.prototype.on=function(t,e,i){var n=t instanceof RegExp?t:RegExp(t.replace("*","\\w+")),r={id:E.randomUUID(),event:t,regexp:n,callback:"function"==typeof e?e:null,target:i};return this.subscriptions.push(r),r.id},h.prototype.off=function(t){for(var e=0;this.subscriptions.length>e;){var i=this.subscriptions[e],n=!0;if(t instanceof Object)for(var r in t)t.hasOwnProperty(r)&&t[r]!==i[r]&&(n=!1);else n=i.id==t;n?this.subscriptions.splice(e,1):e++}},h.prototype.emit=function(t,e,i){for(var n=0;this.subscriptions.length>n;n++){var r=this.subscriptions[n];r.regexp.test(t)&&r.callback&&r.callback(t,e,i)}},p.prototype.add=function(t){if(void 0==t.id)throw Error("Component has no field id");if(!(t instanceof u||t instanceof p))throw new TypeError("Component must be an instance of prototype Component or Controller");t.controller=this,this.components[t.id]=t},p.prototype.remove=function(t){var e;for(e in this.components)if(this.components.hasOwnProperty(e)&&(e==t||this.components[e]==t))break;e&&delete this.components[e]},p.prototype.requestReflow=function(t){if(t)this.reflow();else if(!this.reflowTimer){var e=this;this.reflowTimer=setTimeout(function(){e.reflowTimer=void 0,e.reflow()},0)}},p.prototype.requestRepaint=function(t){if(t)this.repaint();else if(!this.repaintTimer){var e=this;this.repaintTimer=setTimeout(function(){e.repaintTimer=void 0,e.repaint()},0)}},p.prototype.repaint=function(){function t(n,r){r in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.repaint()||e,i[r]=!0)}var e=!1;this.repaintTimer&&(clearTimeout(this.repaintTimer),this.repaintTimer=void 0);var i={};E.forEach(this.components,t),e&&this.reflow()},p.prototype.reflow=function(){function t(n,r){r in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.reflow()||e,i[r]=!0)}var e=!1;this.reflowTimer&&(clearTimeout(this.reflowTimer),this.reflowTimer=void 0);var i={};E.forEach(this.components,t),e&&this.repaint()},u.prototype.setOptions=function(t){t&&(E.extend(this.options,t),this.controller&&(this.requestRepaint(),this.requestReflow()))},u.prototype.getOption=function(t){var e;return this.options&&(e=this.options[t]),void 0===e&&this.defaultOptions&&(e=this.defaultOptions[t]),e},u.prototype.getContainer=function(){return null},u.prototype.getFrame=function(){return this.frame},u.prototype.repaint=function(){return!1},u.prototype.reflow=function(){return!1},u.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1},u.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},u.prototype.requestRepaint=function(){if(!this.controller)throw Error("Cannot request a repaint: no controller configured");this.controller.requestRepaint()},u.prototype.requestReflow=function(){if(!this.controller)throw Error("Cannot request a reflow: no controller configured");this.controller.requestReflow()},c.prototype=new u,c.prototype.setOptions=function(t){t&&E.extend(this.options,t)},c.prototype.getContainer=function(){return this.frame},c.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,r=this.frame;if(!r){r=document.createElement("div"),r.className="panel";var s=n.className;s&&("function"==typeof s?E.addClassName(r,s()+""):E.addClassName(r,s+"")),this.frame=r,t+=1}if(!r.parentNode){if(!this.parent)throw Error("Cannot repaint panel: no parent attached");var o=this.parent.getContainer();if(!o)throw Error("Cannot repaint panel: parent has no container element");o.appendChild(r),t+=1}return t+=e(r.style,"top",i(n.top,"0px")),t+=e(r.style,"left",i(n.left,"0px")),t+=e(r.style,"width",i(n.width,"100%")),t+=e(r.style,"height",i(n.height,"100%")),t>0},c.prototype.reflow=function(){var t=0,e=E.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},d.prototype=new c,d.prototype.setOptions=function(t){t&&E.extend(this.options,t);var e=this.getOption("autoResize");e?this._watch():this._unwatch()},d.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,r=this.frame;if(!r){r=document.createElement("div"),r.className="graph panel";var s=n.className;s&&E.addClassName(r,E.option.asString(s)),this.frame=r,t+=1}if(!r.parentNode){if(!this.container)throw Error("Cannot repaint root panel: no container attached");this.container.appendChild(r),t+=1}return t+=e(r.style,"top",i(n.top,"0px")),t+=e(r.style,"left",i(n.left,"0px")),t+=e(r.style,"width",i(n.width,"100%")),t+=e(r.style,"height",i(n.height,"100%")),this._updateEventEmitters(),t>0},d.prototype.reflow=function(){var t=0,e=E.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},d.prototype._watch=function(){var t=this;this._unwatch();var e=function(){var e=t.getOption("autoResize");return e?(t.frame&&(t.frame.clientWidth!=t.width||t.frame.clientHeight!=t.height)&&t.requestReflow(),void 0):(t._unwatch(),void 0)};E.addEventListener(window,"resize",e),this.watchTimer=setInterval(e,1e3)},d.prototype._unwatch=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0)},d.prototype.on=function(t,e){var i=this.listeners[t];i||(i=[],this.listeners[t]=i),i.push(e),this._updateEventEmitters()},d.prototype._updateEventEmitters=function(){if(this.listeners){var t=this;E.forEach(this.listeners,function(e,i){if(t.emitters||(t.emitters={}),!(i in t.emitters)){var n=t.frame;if(n){var r=function(t){e.forEach(function(e){e(t)})};t.emitters[i]=r,E.addEventListener(n,i,r)}}})}},l.prototype=new u,l.prototype.setOptions=function(t){t&&E.extend(this.options,t)},l.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},l.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},l.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},l.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,r=this.getOption("orientation"),s=this.props,o=this.step,a=this.frame;if(a||(a=document.createElement("div"),this.frame=a,t+=1),a.className="axis "+r,!a.parentNode){if(!this.parent)throw Error("Cannot repaint time axis: no parent attached");var h=this.parent.getContainer();if(!h)throw Error("Cannot repaint time axis: parent has no container element");h.appendChild(a),t+=1}var p=a.parentNode;if(p){var u=a.nextSibling;p.removeChild(a);var c="bottom"==r&&this.props.parentHeight&&this.height?this.props.parentHeight-this.height+"px":"0px";if(t+=e(a.style,"top",i(n.top,c)),t+=e(a.style,"left",i(n.left,"0px")),t+=e(a.style,"width",i(n.width,"100%")),t+=e(a.style,"height",i(n.height,this.height+"px")),this._repaintMeasureChars(),this.step){this._repaintStart(),o.first();for(var d=void 0,l=0;o.hasNext()&&1e3>l;){l++;var f=o.getCurrent(),m=this.toScreen(f),g=o.isMajor();this.getOption("showMinorLabels")&&this._repaintMinorText(m,o.getLabelMinor()),g&&this.getOption("showMajorLabels")?(m>0&&(void 0==d&&(d=m),this._repaintMajorText(m,o.getLabelMajor())),this._repaintMajorLine(m)):this._repaintMinorLine(m),o.next()}if(this.getOption("showMajorLabels")){var v=this.toTime(0),y=o.getLabelMajor(v),w=y.length*(s.majorCharWidth||10)+10;(void 0==d||d>w)&&this._repaintMajorText(0,y)}this._repaintEnd()}this._repaintLine(),u?p.insertBefore(a,u):p.appendChild(a)}return t>0},l.prototype._repaintStart=function(){var t=this.dom,e=t.redundant;e.majorLines=t.majorLines,e.majorTexts=t.majorTexts,e.minorLines=t.minorLines,e.minorTexts=t.minorTexts,t.majorLines=[],t.majorTexts=[],t.minorLines=[],t.minorTexts=[]},l.prototype._repaintEnd=function(){E.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},l.prototype._repaintMinorText=function(t,e){var i=this.dom.redundant.minorTexts.shift();if(!i){var n=document.createTextNode("");i=document.createElement("div"),i.appendChild(n),i.className="text minor",this.frame.appendChild(i)}this.dom.minorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.left=t+"px",i.style.top=this.props.minorLabelTop+"px"},l.prototype._repaintMajorText=function(t,e){var i=this.dom.redundant.majorTexts.shift();if(!i){var n=document.createTextNode(e);i=document.createElement("div"),i.className="text major",i.appendChild(n),this.frame.appendChild(i)}this.dom.majorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.top=this.props.majorLabelTop+"px",i.style.left=t+"px"},l.prototype._repaintMinorLine=function(t){var e=this.dom.redundant.minorLines.shift();e||(e=document.createElement("div"),e.className="grid vertical minor",this.frame.appendChild(e)),this.dom.minorLines.push(e);var i=this.props;e.style.top=i.minorLineTop+"px",e.style.height=i.minorLineHeight+"px",e.style.left=t-i.minorLineWidth/2+"px"},l.prototype._repaintMajorLine=function(t){var e=this.dom.redundant.majorLines.shift();e||(e=document.createElement("DIV"),e.className="grid vertical major",this.frame.appendChild(e)),this.dom.majorLines.push(e);var i=this.props;e.style.top=i.majorLineTop+"px",e.style.left=t-i.majorLineWidth/2+"px",e.style.height=i.majorLineHeight+"px"},l.prototype._repaintLine=function(){var t=this.dom.line,e=this.frame;this.options,this.getOption("showMinorLabels")||this.getOption("showMajorLabels")?(t?(e.removeChild(t),e.appendChild(t)):(t=document.createElement("div"),t.className="grid horizontal major",e.appendChild(t),this.dom.line=t),t.style.top=this.props.lineTop+"px"):t&&axis.parentElement&&(e.removeChild(axis.line),delete this.dom.line)},l.prototype._repaintMeasureChars=function(){var t,e=this.dom;if(!e.measureCharMinor){t=document.createTextNode("0");var i=document.createElement("DIV");i.className="text minor measure",i.appendChild(t),this.frame.appendChild(i),e.measureCharMinor=i}if(!e.measureCharMajor){t=document.createTextNode("0");var n=document.createElement("DIV");n.className="text major measure",n.appendChild(t),this.frame.appendChild(n),e.measureCharMajor=n}},l.prototype.reflow=function(){var t=0,e=E.updateProperty,i=this.frame,n=this.range;if(!n)throw Error("Cannot repaint time axis: no range configured");if(i){t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft);var r=this.props,s=this.getOption("showMinorLabels"),o=this.getOption("showMajorLabels"),a=this.dom.measureCharMinor,h=this.dom.measureCharMajor;a&&(r.minorCharHeight=a.clientHeight,r.minorCharWidth=a.clientWidth),h&&(r.majorCharHeight=h.clientHeight,r.majorCharWidth=h.clientWidth);var p=i.parentNode?i.parentNode.offsetHeight:0;switch(p!=r.parentHeight&&(r.parentHeight=p,t+=1),this.getOption("orientation")){case"bottom":r.minorLabelHeight=s?r.minorCharHeight:0,r.majorLabelHeight=o?r.majorCharHeight:0,r.minorLabelTop=0,r.majorLabelTop=r.minorLabelTop+r.minorLabelHeight,r.minorLineTop=-this.top,r.minorLineHeight=Math.max(this.top+r.majorLabelHeight,0),r.minorLineWidth=1,r.majorLineTop=-this.top,r.majorLineHeight=Math.max(this.top+r.minorLabelHeight+r.majorLabelHeight,0),r.majorLineWidth=1,r.lineTop=0;break;case"top":r.minorLabelHeight=s?r.minorCharHeight:0,r.majorLabelHeight=o?r.majorCharHeight:0,r.majorLabelTop=0,r.minorLabelTop=r.majorLabelTop+r.majorLabelHeight,r.minorLineTop=r.minorLabelTop,r.minorLineHeight=Math.max(p-r.majorLabelHeight-this.top),r.minorLineWidth=1,r.majorLineTop=0,r.majorLineHeight=Math.max(p-this.top),r.majorLineWidth=1,r.lineTop=r.majorLabelHeight+r.minorLabelHeight;break;default:throw Error('Unkown orientation "'+this.getOption("orientation")+'"')}var u=r.minorLabelHeight+r.majorLabelHeight;t+=e(this,"width",i.offsetWidth),t+=e(this,"height",u),this._updateConversion();var c=E.cast(n.start,"Date"),d=E.cast(n.end,"Date"),l=this.toTime(5*(r.minorCharWidth||10))-this.toTime(0);this.step=new TimeStep(c,d,l),t+=e(r.range,"start",c.valueOf()),t+=e(r.range,"end",d.valueOf()),t+=e(r.range,"minimumStep",l.valueOf())}return t>0},l.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype=new c,f.types={box:g,range:y,point:v},f.prototype.setOptions=function(t){t&&E.extend(this.options,t)},f.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},f.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,r=this.getOption("orientation"),s=this.defaultOptions,o=this.frame;if(!o){o=document.createElement("div"),o.className="itemset";var a=n.className;a&&E.addClassName(o,E.option.asString(a));var h=document.createElement("div");h.className="background",o.appendChild(h),this.dom.background=h;var p=document.createElement("div");p.className="foreground",o.appendChild(p),this.dom.foreground=p;var u=document.createElement("div");u.className="itemset-axis",this.dom.axis=u,this.frame=o,t+=1}if(!this.parent)throw Error("Cannot repaint itemset: no parent attached");var c=this.parent.getContainer();if(!c)throw Error("Cannot repaint itemset: parent has no container element");o.parentNode||(c.appendChild(o),t+=1),this.dom.axis.parentNode||(c.appendChild(this.dom.axis),t+=1),t+=e(o.style,"left",i(n.left,"0px")),t+=e(o.style,"top",i(n.top,"0px")),t+=e(o.style,"width",i(n.width,"100%")),t+=e(o.style,"height",i(n.height,this.height+"px")),t+=e(this.dom.axis.style,"left",i(n.left,"0px")),t+=e(this.dom.axis.style,"width",i(n.width,"100%")),t+="bottom"==r?e(this.dom.axis.style,"top",this.height+this.top+"px"):e(this.dom.axis.style,"top",this.top+"px"),this._updateConversion();var d=this,l=this.queue,m=this.itemsData,g=this.items,v={fields:[m&&m.fieldId||"id","start","end","content","type"]};return Object.keys(l).forEach(function(e){var i=l[e],r=g[e];switch(i){case"add":case"update":var o=m&&m.get(e,v);if(o){var a=o.type||o.start&&o.end&&"range"||"box",h=f.types[a];if(r&&(h&&r instanceof h?(r.data=o,t++):(t+=r.hide(),r=null)),!r){if(!h)throw new TypeError('Unknown item type "'+a+'"');r=new h(d,o,n,s),t++}g[e]=r}delete l[e];break;case"remove":r&&(t+=r.hide()),delete g[e],delete l[e];break;default:console.log('Error: unknown action "'+i+'"')}}),E.forEach(this.items,function(e){e.visible?(t+=e.show(),e.reposition()):t+=e.hide()}),t>0},f.prototype.getForeground=function(){return this.dom.foreground},f.prototype.getBackground=function(){return this.dom.background},f.prototype.getAxis=function(){return this.dom.axis},f.prototype.reflow=function(){var t=0,e=this.options,i=e.margin&&e.margin.axis||this.defaultOptions.margin.axis,n=e.margin&&e.margin.item||this.defaultOptions.margin.item,r=E.updateProperty,s=E.option.asNumber,o=this.frame;if(o){this._updateConversion(),E.forEach(this.items,function(e){t+=e.reflow()}),this.stack.update();var a,h=s(e.maxHeight);if(null!=e.height)a=o.offsetHeight;else{var p=this.stack.ordered;if(p.length){var u=p[0].top,c=p[0].top+p[0].height;E.forEach(p,function(t){u=Math.min(u,t.top),c=Math.max(c,t.top+t.height)}),a=c-u+i+n}else a=i+n}null!=h&&(a=Math.min(a,h)),t+=r(this,"height",a),t+=r(this,"top",o.offsetTop),t+=r(this,"left",o.offsetLeft),t+=r(this,"width",o.offsetWidth)}else t+=1;return t>0},f.prototype.hide=function(){var t=!1;return this.frame&&this.frame.parentNode&&(this.frame.parentNode.removeChild(this.frame),t=!0),this.dom.axis&&this.dom.axis.parentNode&&(this.dom.axis.parentNode.removeChild(this.dom.axis),t=!0),t},f.prototype.setItems=function(t){var e,i=this,n=this.itemsData;if(n&&(E.forEach(this.listeners,function(t,e){n.unsubscribe(e,t)}),e=n.getIds(),this._onRemove(e)),t){if(!(t instanceof r||t instanceof s))throw new TypeError("Data must be an instance of DataSet");this.itemsData=t}else this.itemsData=null;if(this.itemsData){var o=this.id;E.forEach(this.listeners,function(t,e){i.itemsData.subscribe(e,t,o)}),e=this.itemsData.getIds(),this._onAdd(e)}},f.prototype.getItems=function(){return this.itemsData},f.prototype._onUpdate=function(t){this._toQueue("update",t)},f.prototype._onAdd=function(t){this._toQueue("add",t)},f.prototype._onRemove=function(t){this._toQueue("remove",t)},f.prototype._toQueue=function(t,e){var i=this.queue;e.forEach(function(e){i[e]=t}),this.controller&&this.requestRepaint()},f.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},f.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},m.prototype.select=function(){this.selected=!0},m.prototype.unselect=function(){this.selected=!1},m.prototype.show=function(){return!1},m.prototype.hide=function(){return!1},m.prototype.repaint=function(){return!1},m.prototype.reflow=function(){return!1},g.prototype=new m(null,null),g.prototype.select=function(){this.selected=!0},g.prototype.unselect=function(){this.selected=!1},g.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");var n=this.parent.getBackground();if(!n)throw Error("Cannot repaint time axis: parent has no background container element");var r=this.parent.getAxis();if(!n)throw Error("Cannot repaint time axis: parent has no axis container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),e.line.parentNode||(n.appendChild(e.line),t=!0),e.dot.parentNode||(r.appendChild(e.dot),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var s=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=s&&(this.className=s,e.box.className="item box"+s,e.line.className="item line"+s,e.dot.className="item dot"+s,t=!0)}return t},g.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},g.prototype.hide=function(){var t=!1,e=this.dom;return e&&(e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),e.line.parentNode&&e.line.parentNode.removeChild(e.line),e.dot.parentNode&&e.dot.parentNode.removeChild(e.dot)),t},g.prototype.reflow=function(){var t,e,i,n,r,s,o,a,h,p,u,c,d=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(u=this.data,c=this.parent&&this.parent.range,this.visible=u&&c?u.start>c.start&&u.start0},g.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="line",t.dot=document.createElement("DIV"),t.dot.className="dot")},g.prototype.reposition=function(){var t=this.dom,e=this.props,i=this.options.orientation||this.defaultOptions.orientation;if(t){var n=t.box,r=t.line,s=t.dot;n.style.left=this.left+"px",n.style.top=this.top+"px",r.style.left=e.line.left+"px","top"==i?(r.style.top="0px",r.style.height=this.top+"px"):(r.style.top=this.top+this.height+"px",r.style.height=Math.max(this.parent.height-this.top-this.height+this.props.dot.height/2,0)+"px"),s.style.left=e.dot.left+"px",s.style.top=e.dot.top+"px"}},v.prototype=new m(null,null),v.prototype.select=function(){this.selected=!0},v.prototype.unselect=function(){this.selected=!1},v.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.point.parentNode||(i.appendChild(e.point),i.appendChild(e.point),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=n&&(this.className=n,e.point.className="item point"+n,t=!0)}return t},v.prototype.show=function(){return this.dom&&this.dom.point.parentNode?!1:this.repaint()},v.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.point.parentNode&&(e.point.parentNode.removeChild(e.point),t=!0),t},v.prototype.reflow=function(){var t,e,i,n,r,s,o,a,h,p,u=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(h=this.data,p=this.parent&&this.parent.range,this.visible=h&&p?h.start>p.start&&h.start0},v.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.dot.className="dot",t.point.appendChild(t.dot))},v.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.point.style.top=this.top+"px",t.point.style.left=this.left+"px",t.content.style.marginLeft=e.content.marginLeft+"px",t.dot.style.top=e.dot.top+"px")},y.prototype=new m(null,null),y.prototype.select=function(){this.selected=!0},y.prototype.unselect=function(){this.selected=!1},y.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=this.data.className?""+this.data.className:"";this.className!=n&&(this.className=n,e.box.className="item range"+n,t=!0)}return t},y.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},y.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),t},y.prototype.reflow=function(){var t,e,i,n,r,s,o,a,h,p,u,c,d,l,f,m,g=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(void 0==this.data.end)throw Error('Property "end" missing in item '+this.data.id);return h=this.data,p=this.parent&&this.parent.range,this.visible=h&&p?h.startp.start:!1,this.visible&&(t=this.dom,t?(e=this.props,i=this.options,s=this.parent,o=s.toScreen(this.data.start),a=s.toScreen(this.data.end),u=E.updateProperty,c=t.box,d=s.width,f=i.orientation||this.defaultOptions.orientation,n=i.margin&&i.margin.axis||this.defaultOptions.margin.axis,r=i.padding||this.defaultOptions.padding,g+=u(e.content,"width",t.content.offsetWidth),g+=u(this,"height",c.offsetHeight),-d>o&&(o=-d),a>2*d&&(a=2*d),l=0>o?Math.min(-o,a-o-e.content.width-2*r):0,g+=u(e.content,"left",l),"top"==f?(m=n,g+=u(this,"top",m)):(m=s.height-this.height-n,g+=u(this,"top",m)),g+=u(this,"left",o),g+=u(this,"width",Math.max(a-o,1))):g+=1),g>0},y.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content))},y.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.box.style.top=this.top+"px",t.box.style.left=this.left+"px",t.box.style.width=this.width+"px",t.content.style.left=e.content.left+"px")},w.prototype=new u,w.prototype.setOptions=function(t){t&&E.extend(this.options,t)},w.prototype.getContainer=function(){return this.parent.getContainer()},w.prototype.setItems=function(t){this.items&&(this.items.hide(),this.items.setItems(),this.parent.controller.remove(this.items));var e=this.groupId;this.items=new f(this),this.items.setRange(this.parent.range),this.view=new s(t,{filter:function(t){return t.group==e}}),this.items.setItems(this.view),this.parent.controller.add(this.items)},w.prototype.repaint=function(){return!1},w.prototype.reflow=function(){var t=0,e=E.updateProperty;return t+=e(this,"top",this.items?this.items.top:0),t+=e(this,"height",this.items?this.items.height:0),t>0},b.prototype=new c,b.prototype.setOptions=function(t){t&&E.extend(this.options,t)},b.prototype.setRange=function(){},b.prototype.setItems=function(t){this.itemsData=t,this.groups.forEach(function(e){e.setItems(t)})},b.prototype.getItems=function(){return this.itemsData},b.prototype.setRange=function(t){this.range=t},b.prototype.setGroups=function(t){var e,i=this;if(this.groupsData&&(E.forEach(this.listeners,function(t,e){i.groupsData.unsubscribe(e,t)}),e=this.groupsData.getIds(),this._onRemove(e)),t?t instanceof r?this.groupsData=t:(this.groupsData=new r({fieldTypes:{start:"Date",end:"Date"}}),this.groupsData.add(t)):this.groupsData=null,this.groupsData){var n=this.id;E.forEach(this.listeners,function(t,e){i.groupsData.subscribe(e,t,n)}),e=this.groupsData.getIds(),this._onAdd(e)}},b.prototype.getGroups=function(){return this.groupsData},b.prototype.repaint=function(){var t=0,e=E.updateProperty,i=E.option.asSize,n=this.options,r=this.frame; +if(!r){r=document.createElement("div"),r.className="groupset";var s=n.className;s&&E.addClassName(r,E.option.asString(s)),this.frame=r,t+=1}if(!this.parent)throw Error("Cannot repaint groupset: no parent attached");var o=this.parent.getContainer();if(!o)throw Error("Cannot repaint groupset: parent has no container element");r.parentNode||(o.appendChild(r),t+=1),t+=e(r.style,"height",i(n.height,this.height+"px")),t+=e(r.style,"top",i(n.top,"0px")),t+=e(r.style,"left",i(n.left,"0px")),t+=e(r.style,"width",i(n.width,"100%"));var a=this,h=this.queue,p=this.groups;this.groupsData;var u=Object.keys(h);return u.length&&(u.forEach(function(t){for(var e=h[t],i=null,n=-1,r=0;p.length>r;r++)if(p[r].id==t){i=p[r],n=r;break}switch(e){case"add":case"update":i||(i=new w(a,t),i.setItems(a.itemsData),p.push(i),a.controller.add(i)),delete h[t];break;case"remove":i&&(i.setItems(),p.splice(n,1),a.controller.remove(i)),delete h[t];break;default:console.log('Error: unknown action "'+e+'"')}}),this.groups.forEach(function(t,e){var i=a.groups[e-1],n=0;i&&(n=function(){return i.top+i.height}),t.setOptions({top:n})})),t>0},b.prototype.getContainer=function(){return this.frame},b.prototype.reflow=function(){var t=0,e=this.options,i=E.updateProperty,n=E.option.asNumber,r=this.frame;if(r){var s,o=n(e.maxHeight);null!=e.height?s=r.offsetHeight:(s=0,this.groups.forEach(function(t){s+=t.height})),null!=o&&(s=Math.min(s,o)),t+=i(this,"height",s),t+=i(this,"top",r.offsetTop),t+=i(this,"left",r.offsetLeft),t+=i(this,"width",r.offsetWidth)}return t>0},b.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1},b.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},b.prototype._onUpdate=function(t){this._toQueue(t,"update")},b.prototype._onAdd=function(t){this._toQueue(t,"add")},b.prototype._onRemove=function(t){this._toQueue(t,"remove")},b.prototype._toQueue=function(t,e){var i=this.queue;t.forEach(function(t){i[t]=e}),this.controller&&this.requestRepaint()},S.prototype.setOptions=function(t){t&&E.extend(this.options,t);var e,i,n,r,s=this;if(e="top"==this.options.orientation?function(){return s.timeaxis.height}:function(){return s.main.height-s.timeaxis.height-s.content.height},this.options.height?(n=this.options.height,i=function(){return s.main.height-s.timeaxis.height}):(n=function(){return s.timeaxis.height+s.content.height},i=null),this.options.maxHeight){if(!E.isNumber(this.options.maxHeight))throw new TypeError("Number expected for property maxHeight");r=function(){return s.options.maxHeight-s.timeaxis.height}}this.main.setOptions({height:n}),this.content.setOptions({top:e,height:i,maxHeight:r}),this.controller.repaint()},S.prototype.setItems=function(t){var e,i=null==this.itemsData;if(t?t instanceof r&&(e=t):e=null,t instanceof r||(e=new r({fieldTypes:{start:"Date",end:"Date"}}),e.add(t)),this.itemsData=e,this.content.setItems(e),i&&(void 0==this.options.start||void 0==this.options.end)){var n=this.getItemRange(),s=n.min,o=n.max;if(null!=s&&null!=o){var a=o.valueOf()-s.valueOf();s=new Date(s.valueOf()-.05*a),o=new Date(o.valueOf()+.05*a)}void 0!=this.options.start&&(s=new Date(this.options.start.valueOf())),void 0!=this.options.end&&(o=new Date(this.options.end.valueOf())),(null!=s||null!=o)&&this.range.setRange(s,o)}},S.prototype.setGroups=function(t){this.groupsData=t;var e=this.groupsData?b:f;this.content instanceof e||(this.content&&(this.content.hide(),this.content.setItems&&this.content.setItems(),this.content.setGroups&&this.content.setGroups(),this.controller.remove(this.content)),this.content=new e(this.main,[this.timeaxis]),this.content.setRange&&this.content.setRange(this.range),this.content.setItems&&this.content.setItems(this.itemsData),this.content.setGroups&&this.content.setGroups(this.groupsData),this.controller.add(this.content),this.setOptions(this.options))},S.prototype.getItemRange=function(){var t=this.itemsData,e=null,i=null;if(t){var n=t.min("start");e=n?n.start.valueOf():null;var r=t.max("start");r&&(i=r.start.valueOf());var s=t.max("end");s&&(i=null==i?s.end.valueOf():Math.max(i,s.end.valueOf()))}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}};var C={util:E,events:_,Controller:p,DataSet:r,DataView:s,Range:a,Stack:o,TimeStep:TimeStep,EventBus:h,components:{items:{Item:m,ItemBox:g,ItemPoint:v,ItemRange:y},Component:u,Panel:c,RootPanel:d,ItemSet:f,TimeAxis:l},Timeline:S};n!==void 0&&(n=C),i!==void 0&&i.exports!==void 0&&(i.exports=C),"function"==typeof t&&t(function(){return C}),"undefined"!=typeof window&&(window.vis=C),E.loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .groupset {\n position: absolute;\n padding: 0;\n margin: 0;\n}\n\n\n.graph .itemset {\n position: absolute;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.graph .background {\n}\n\n.graph .foreground {\n}\n\n.graph .itemset-axis {\n position: absolute;\n}\n\n.graph .groupset .itemset-axis {\n border-top: 1px solid #bfbfbf;\n}\n\n/* TODO: with orientation=='bottom', this will more or less overlap with timeline axis\n.graph .groupset .itemset-axis:last-child {\n border-top: none;\n}\n*/\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n")},{moment:2}],2:[function(e,i){(function(){(function(n){function r(t,e){return function(i){return c(t.call(this,i),e)}}function s(t){return function(e){return this.lang().ordinal(t.call(this,e))}}function o(){}function a(t){p(this,t)}function h(t){var e=this._data={},i=t.years||t.year||t.y||0,n=t.months||t.month||t.M||0,r=t.weeks||t.week||t.w||0,s=t.days||t.day||t.d||0,o=t.hours||t.hour||t.h||0,a=t.minutes||t.minute||t.m||0,h=t.seconds||t.second||t.s||0,p=t.milliseconds||t.millisecond||t.ms||0;this._milliseconds=p+1e3*h+6e4*a+36e5*o,this._days=s+7*r,this._months=n+12*i,e.milliseconds=p%1e3,h+=u(p/1e3),e.seconds=h%60,a+=u(h/60),e.minutes=a%60,o+=u(a/60),e.hours=o%24,s+=u(o/24),s+=7*r,e.days=s%30,n+=u(s/30),e.months=n%12,i+=u(n/12),e.years=i}function p(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function u(t){return 0>t?Math.ceil(t):Math.floor(t)}function c(t,e){for(var i=t+"";e>i.length;)i="0"+i;return i}function d(t,e,i){var n,r=e._milliseconds,s=e._days,o=e._months;r&&t._d.setTime(+t+r*i),s&&t.date(t.date()+s*i),o&&(n=t.date(),t.date(1).month(t.month()+o*i).date(Math.min(n,t.daysInMonth())))}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function f(t,e){var i,n=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),s=0;for(i=0;n>i;i++)~~t[i]!==~~e[i]&&s++;return s+r}function m(t,e){return e.abbr=t,R[t]||(R[t]=new o),R[t].set(e),R[t]}function g(t){return t?(!R[t]&&U&&e("./lang/"+t),R[t]):I.fn._lang}function v(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function y(t){var e,i,n=t.match(F);for(e=0,i=n.length;i>e;e++)n[e]=ae[n[e]]?ae[n[e]]:v(n[e]);return function(r){var s="";for(e=0;i>e;e++)s+="function"==typeof n[e].call?n[e].call(r,t):n[e];return s}}function w(t,e){function i(e){return t.lang().longDateFormat(e)||e}for(var n=5;n--&&z.test(e);)e=e.replace(z,i);return re[e]||(re[e]=y(e)),re[e](t)}function b(t){switch(t){case"DDDD":return V;case"YYYY":return B;case"YYYYY":return Z;case"S":case"SS":case"SSS":case"DDD":return q;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return X;case"X":return J;case"Z":case"ZZ":return K;case"T":return G;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return W;default:return RegExp(t.replace("\\",""))}}function S(t,e,i){var n,r=i._a;switch(t){case"M":case"MM":r[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":n=g(i._l).monthsParse(e),null!=n?r[1]=n:i._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(r[2]=~~e);break;case"YY":r[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":r[0]=~~e;break;case"a":case"A":i._isPm="pm"===(e+"").toLowerCase();break;case"H":case"HH":case"h":case"hh":r[3]=~~e;break;case"m":case"mm":r[4]=~~e;break;case"s":case"ss":r[5]=~~e;break;case"S":case"SS":case"SSS":r[6]=~~(1e3*("0."+e));break;case"X":i._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":i._useUTC=!0,n=(e+"").match(ee),n&&n[1]&&(i._tzh=~~n[1]),n&&n[2]&&(i._tzm=~~n[2]),n&&"+"===n[0]&&(i._tzh=-i._tzh,i._tzm=-i._tzm)}null==e&&(i._isValid=!1)}function T(t){var e,i,n=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=n[e]=null==t._a[e]?2===e?1:0:t._a[e];n[3]+=t._tzh||0,n[4]+=t._tzm||0,i=new Date(0),t._useUTC?(i.setUTCFullYear(n[0],n[1],n[2]),i.setUTCHours(n[3],n[4],n[5],n[6])):(i.setFullYear(n[0],n[1],n[2]),i.setHours(n[3],n[4],n[5],n[6])),t._d=i}}function E(t){var e,i,n=t._f.match(F),r=t._i;for(t._a=[],e=0;n.length>e;e++)i=(b(n[e]).exec(r)||[])[0],i&&(r=r.slice(r.indexOf(i)+i.length)),ae[n[e]]&&S(n[e],i,t);t._isPm&&12>t._a[3]&&(t._a[3]+=12),t._isPm===!1&&12===t._a[3]&&(t._a[3]=0),T(t)}function M(t){for(var e,i,n,r,s=99;t._f.length;){if(e=p({},t),e._f=t._f.pop(),E(e),i=new a(e),i.isValid()){n=i;break}r=f(e._a,i.toArray()),s>r&&(s=r,n=i)}p(t,n)}function D(t){var e,i=t._i;if(Q.exec(i)){for(t._f="YYYY-MM-DDT",e=0;4>e;e++)if(te[e][1].exec(i)){t._f+=te[e][0];break}K.exec(i)&&(t._f+=" Z"),E(t)}else t._d=new Date(i)}function _(t){var e=t._i,i=P.exec(e);e===n?t._d=new Date:i?t._d=new Date(+i[1]):"string"==typeof e?D(t):l(e)?(t._a=e.slice(0),T(t)):t._d=e instanceof Date?new Date(+e):new Date(e)}function C(t,e,i,n,r){return r.relativeTime(e||1,!!i,t,n)}function x(t,e,i){var n=j(Math.abs(t)/1e3),r=j(n/60),s=j(r/60),o=j(s/24),a=j(o/365),h=45>n&&["s",n]||1===r&&["m"]||45>r&&["mm",r]||1===s&&["h"]||22>s&&["hh",s]||1===o&&["d"]||25>=o&&["dd",o]||45>=o&&["M"]||345>o&&["MM",j(o/30)]||1===a&&["y"]||["yy",a];return h[2]=e,h[3]=t>0,h[4]=i,C.apply({},h)}function L(t,e,i){var n=i-e,r=i-t.day();return r>n&&(r-=7),n-7>r&&(r+=7),Math.ceil(I(t).add("d",r).dayOfYear()/7)}function O(t){var e=t._i,i=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=g().preparse(e)),I.isMoment(e)?(t=p({},e),t._d=new Date(+e._d)):i?l(i)?M(t):E(t):_(t),new a(t))}function A(t,e){I.fn[t]=I.fn[t+"s"]=function(t){var i=this._isUTC?"UTC":"";return null!=t?(this._d["set"+i+e](t),this):this._d["get"+i+e]()}}function N(t){I.duration.fn[t]=function(){return this._data[t]}}function Y(t,e){I.duration.fn["as"+t]=function(){return+this/e}}for(var I,k,H="2.0.0",j=Math.round,R={},U=i!==n&&i.exports,P=/^\/?Date\((\-?\d+)/i,F=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,z=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,W=/\d\d?/,q=/\d{1,3}/,V=/\d{3}/,B=/\d{1,4}/,Z=/[+\-]?\d{1,6}/,X=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,K=/Z|[\+\-]\d\d:?\d\d/i,G=/T/i,J=/[\+\-]?\d+(\.\d{1,3})?/,Q=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,$="YYYY-MM-DDTHH:mm:ssZ",te=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ee=/([\+\-]|\d\d)/gi,ie="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),ne={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},re={},se="DDD w W M D d".split(" "),oe="M D H h m s w W".split(" "),ae={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return c(this.year()%100,2)},YYYY:function(){return c(this.year(),4)},YYYYY:function(){return c(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return c(~~(this.milliseconds()/10),2)},SSS:function(){return c(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(t/60),2)+":"+c(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(10*t/6),4)},X:function(){return this.unix()}};se.length;)k=se.pop(),ae[k+"o"]=s(ae[k]);for(;oe.length;)k=oe.pop(),ae[k+k]=r(ae[k],2);for(ae.DDDD=r(ae.DDD,3),o.prototype={set:function(t){var e,i;for(i in t)e=t[i],"function"==typeof e?this[i]=e:this["_"+i]=e},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t){var e,i,n;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(i=I([2e3,e]),n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[e]=RegExp(n.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},meridiem:function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},calendar:function(t,e){var i=this._calendar[t];return"function"==typeof i?i.apply(e):i},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(t,e,i,n){var r=this._relativeTime[i];return"function"==typeof r?r(t,e,i,n):r.replace(/%d/i,t)},pastFuture:function(t,e){var i=this._relativeTime[t>0?"future":"past"];return"function"==typeof i?i(e):i.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return L(t,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},I=function(t,e,i){return O({_i:t,_f:e,_l:i,_isUTC:!1})},I.utc=function(t,e,i){return O({_useUTC:!0,_isUTC:!0,_l:i,_i:t,_f:e})},I.unix=function(t){return I(1e3*t)},I.duration=function(t,e){var i,n=I.isDuration(t),r="number"==typeof t,s=n?t._data:r?{}:t;return r&&(e?s[e]=t:s.milliseconds=t),i=new h(s),n&&t.hasOwnProperty("_lang")&&(i._lang=t._lang),i},I.version=H,I.defaultFormat=$,I.lang=function(t,e){return t?(e?m(t,e):R[t]||g(t),I.duration.fn._lang=I.fn._lang=g(t),n):I.fn._lang._abbr},I.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),g(t)},I.isMoment=function(t){return t instanceof a},I.isDuration=function(t){return t instanceof h},I.fn=a.prototype={clone:function(){return I(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return I.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!f(this._a,(this._isUTC?I.utc(this._a):I(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(t){var e=w(this,t||I.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var i;return i="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,i,1),this},subtract:function(t,e){var i;return i="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,i,-1),this},diff:function(t,e,i){var n,r,s=this._isUTC?I(t).utc():I(t).local(),o=6e4*(this.zone()-s.zone());return e&&(e=e.replace(/s$/,"")),"year"===e||"month"===e?(n=432e5*(this.daysInMonth()+s.daysInMonth()),r=12*(this.year()-s.year())+(this.month()-s.month()),r+=(this-I(this).startOf("month")-(s-I(s).startOf("month")))/n,"year"===e&&(r/=12)):(n=this-s-o,r="second"===e?n/1e3:"minute"===e?n/6e4:"hour"===e?n/36e5:"day"===e?n/864e5:"week"===e?n/6048e5:n),i?r:u(r)},from:function(t,e){return I.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(I(),t)},calendar:function(){var t=this.diff(I().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+I(t).startOf(e)},isBefore:function(t,e){return e=e!==n?e:"millisecond",+this.clone().startOf(e)<+I(t).startOf(e)},isSame:function(t,e){return e=e!==n?e:"millisecond",+this.clone().startOf(e)===+I(t).startOf(e)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return I.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=j((I(this).startOf("day")-I(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},isoWeek:function(t){var e=L(this,1,4);return null==t?e:this.add("d",7*(t-e))},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},lang:function(t){return t===n?this._lang:(this._lang=g(t),this)}},k=0;ie.length>k;k++)A(ie[k].toLowerCase().replace(/s$/,""),ie[k]);A("year","FullYear"),I.fn.days=I.fn.day,I.fn.weeks=I.fn.week,I.fn.isoWeeks=I.fn.isoWeek,I.duration.fn=h.prototype={weeks:function(){return u(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+2592e6*this._months},humanize:function(t){var e=+this,i=x(e,!t,this.lang());return t&&(i=this.lang().pastFuture(e,i)),this.lang().postformat(i)},lang:I.fn.lang};for(k in ne)ne.hasOwnProperty(k)&&(Y(k,ne[k]),N(k.toLowerCase()));Y("Weeks",6048e5),I.lang("en",{ordinal:function(t){var e=t%10,i=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),U&&(i.exports=I),"undefined"==typeof ender&&(this.moment=I),"function"==typeof t&&t.amd&&t("moment",[],function(){return I})}).call(this)})()},{}]},{},[1])(1)}); \ No newline at end of file