diff --git a/HISTORY.md b/HISTORY.md
index 93077a0d..564ff235 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -6,6 +6,8 @@ http://visjs.org
### Timeline
+- Added options `margin.item.horizontal` and `margin.item.vertical`, which
+ allows to specify different margins horizontally/vertically.
- Removed check for number of arguments in callbacks `onAdd`, `onUpdate`,
`onRemove`, and `onMove`.
- Fixed items in groups sometimes being displayed but not positioned correctly.
@@ -19,6 +21,7 @@ http://visjs.org
- Option for inherited edge colors from connected nodes.
- Option to disable the drawing of nodes or edges on drag.
+
## 2014-07-07, version 3.0.0
### Timeline
diff --git a/dist/vis.js b/dist/vis.js
index 40366c50..5d762273 100644
--- a/dist/vis.js
+++ b/dist/vis.js
@@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library.
*
* @version 3.0.1-SNAPSHOT
- * @date 2014-07-11
+ * @date 2014-07-15
*
* @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
@@ -88,16 +88,16 @@ return /******/ (function(modules) { // webpackBootstrap
exports.DataView = __webpack_require__(4);
// Graph3d
- exports.Graph3d = __webpack_require__(11);
+ exports.Graph3d = __webpack_require__(5);
// Timeline
- exports.Timeline = __webpack_require__(5);
+ exports.Timeline = __webpack_require__(6);
exports.Graph2d = __webpack_require__(7);
exports.timeline= {
- DataStep: __webpack_require__(6),
- Range: __webpack_require__(8),
- stack: __webpack_require__(9),
- TimeStep: __webpack_require__(10),
+ DataStep: __webpack_require__(8),
+ Range: __webpack_require__(9),
+ stack: __webpack_require__(10),
+ TimeStep: __webpack_require__(11),
components: {
items: {
@@ -2835,6007 +2835,6005 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {
var Emitter = __webpack_require__(41);
- var Hammer = __webpack_require__(50);
- var util = __webpack_require__(1);
var DataSet = __webpack_require__(3);
var DataView = __webpack_require__(4);
- var Range = __webpack_require__(8);
- var TimeAxis = __webpack_require__(21);
- var CurrentTime = __webpack_require__(13);
- var CustomTime = __webpack_require__(14);
- var ItemSet = __webpack_require__(18);
+ var Point3d = __webpack_require__(33);
+ var Point2d = __webpack_require__(34);
+ var Filter = __webpack_require__(35);
+ var StepNumber = __webpack_require__(36);
/**
- * Create a timeline visualization
- * @param {HTMLElement} container
- * @param {vis.DataSet | Array | google.visualization.DataTable} [items]
- * @param {Object} [options] See Timeline.setOptions for the available options.
- * @constructor
+ * @constructor Graph3d
+ * Graph3d displays data in 3d.
+ *
+ * Graph3d is developed in javascript as a Google Visualization Chart.
+ *
+ * @param {Element} container The DOM element in which the Graph3d will
+ * be created. Normally a div element.
+ * @param {DataSet | DataView | Array} [data]
+ * @param {Object} [options]
*/
- function Timeline (container, items, options) {
- if (!(this instanceof Timeline)) {
+ function Graph3d(container, data, options) {
+ if (!(this instanceof Graph3d)) {
throw new SyntaxError('Constructor must be called with the new operator');
}
- var me = this;
- this.defaultOptions = {
- start: null,
- end: null,
-
- autoResize: true,
-
- orientation: 'bottom',
- width: null,
- height: null,
- maxHeight: null,
- minHeight: null
- };
- this.options = util.deepExtend({}, this.defaultOptions);
+ // create variables and set default values
+ this.containerElement = container;
+ this.width = '400px';
+ this.height = '400px';
+ this.margin = 10; // px
+ this.defaultXCenter = '55%';
+ this.defaultYCenter = '50%';
- // Create the DOM, props, and emitter
- this._create(container);
+ this.xLabel = 'x';
+ this.yLabel = 'y';
+ this.zLabel = 'z';
+ this.filterLabel = 'time';
+ this.legendLabel = 'value';
- // all components listed here will be repainted automatically
- this.components = [];
+ this.style = Graph3d.STYLE.DOT;
+ this.showPerspective = true;
+ this.showGrid = true;
+ this.keepAspectRatio = true;
+ this.showShadow = false;
+ this.showGrayBottom = false; // TODO: this does not work correctly
+ this.showTooltip = false;
+ this.verticalRatio = 0.5; // 0.1 to 1.0, where 1.0 results in a 'cube'
- this.body = {
- dom: this.dom,
- domProps: this.props,
- emitter: {
- on: this.on.bind(this),
- off: this.off.bind(this),
- emit: this.emit.bind(this)
- },
- util: {
- snap: null, // will be specified after TimeAxis is created
- toScreen: me._toScreen.bind(me),
- toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
- toTime: me._toTime.bind(me),
- toGlobalTime : me._toGlobalTime.bind(me)
- }
- };
+ this.animationInterval = 1000; // milliseconds
+ this.animationPreload = false;
- // range
- this.range = new Range(this.body);
- this.components.push(this.range);
- this.body.range = this.range;
+ this.camera = new Graph3d.Camera();
+ this.eye = new Point3d(0, 0, -1); // TODO: set eye.z about 3/4 of the width of the window?
- // time axis
- this.timeAxis = new TimeAxis(this.body);
- this.components.push(this.timeAxis);
- this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);
+ this.dataTable = null; // The original data table
+ this.dataPoints = null; // The table with point objects
- // current time bar
- this.currentTime = new CurrentTime(this.body);
- this.components.push(this.currentTime);
+ // the column indexes
+ this.colX = undefined;
+ this.colY = undefined;
+ this.colZ = undefined;
+ this.colValue = undefined;
+ this.colFilter = undefined;
- // custom time bar
- // Note: time bar will be attached in this.setOptions when selected
- this.customTime = new CustomTime(this.body);
- this.components.push(this.customTime);
+ this.xMin = 0;
+ this.xStep = undefined; // auto by default
+ this.xMax = 1;
+ this.yMin = 0;
+ this.yStep = undefined; // auto by default
+ this.yMax = 1;
+ this.zMin = 0;
+ this.zStep = undefined; // auto by default
+ this.zMax = 1;
+ this.valueMin = 0;
+ this.valueMax = 1;
+ this.xBarWidth = 1;
+ this.yBarWidth = 1;
+ // TODO: customize axis range
- // item set
- this.itemSet = new ItemSet(this.body);
- this.components.push(this.itemSet);
+ // constants
+ this.colorAxis = '#4D4D4D';
+ this.colorGrid = '#D3D3D3';
+ this.colorDot = '#7DC1FF';
+ this.colorDotBorder = '#3267D2';
- this.itemsData = null; // DataSet
- this.groupsData = null; // DataSet
+ // create a frame and canvas
+ this.create();
- // apply options
- if (options) {
- this.setOptions(options);
- }
+ // apply options (also when undefined)
+ this.setOptions(options);
- // create itemset
- if (items) {
- this.setItems(items);
- }
- else {
- this.redraw();
+ // apply data
+ if (data) {
+ this.setData(data);
}
}
- // turn Timeline into an event emitter
- Emitter(Timeline.prototype);
+ // Extend Graph3d with an Emitter mixin
+ Emitter(Graph3d.prototype);
/**
- * Create the main DOM for the Timeline: a root panel containing left, right,
- * top, bottom, content, and background panel.
- * @param {Element} container The container element where the Timeline will
- * be attached.
- * @private
+ * @class Camera
+ * The camera is mounted on a (virtual) camera arm. The camera arm can rotate
+ * The camera is always looking in the direction of the origin of the arm.
+ * This way, the camera always rotates around one fixed point, the location
+ * of the camera arm.
+ *
+ * Documentation:
+ * http://en.wikipedia.org/wiki/3D_projection
*/
- Timeline.prototype._create = function (container) {
- this.dom = {};
+ Graph3d.Camera = function () {
+ this.armLocation = new Point3d();
+ this.armRotation = {};
+ this.armRotation.horizontal = 0;
+ this.armRotation.vertical = 0;
+ this.armLength = 1.7;
- this.dom.root = document.createElement('div');
- this.dom.background = document.createElement('div');
- this.dom.backgroundVertical = document.createElement('div');
- this.dom.backgroundHorizontal = document.createElement('div');
- this.dom.centerContainer = document.createElement('div');
- this.dom.leftContainer = document.createElement('div');
- this.dom.rightContainer = document.createElement('div');
- this.dom.center = document.createElement('div');
- this.dom.left = document.createElement('div');
- this.dom.right = document.createElement('div');
- this.dom.top = document.createElement('div');
- this.dom.bottom = document.createElement('div');
- this.dom.shadowTop = document.createElement('div');
- this.dom.shadowBottom = document.createElement('div');
- this.dom.shadowTopLeft = document.createElement('div');
- this.dom.shadowBottomLeft = document.createElement('div');
- this.dom.shadowTopRight = document.createElement('div');
- this.dom.shadowBottomRight = document.createElement('div');
+ this.cameraLocation = new Point3d();
+ this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0);
- this.dom.background.className = 'vispanel background';
- this.dom.backgroundVertical.className = 'vispanel background vertical';
- this.dom.backgroundHorizontal.className = 'vispanel background horizontal';
- this.dom.centerContainer.className = 'vispanel center';
- this.dom.leftContainer.className = 'vispanel left';
- this.dom.rightContainer.className = 'vispanel right';
- this.dom.top.className = 'vispanel top';
- this.dom.bottom.className = 'vispanel bottom';
- this.dom.left.className = 'content';
- this.dom.center.className = 'content';
- this.dom.right.className = 'content';
- this.dom.shadowTop.className = 'shadow top';
- this.dom.shadowBottom.className = 'shadow bottom';
- this.dom.shadowTopLeft.className = 'shadow top';
- this.dom.shadowBottomLeft.className = 'shadow bottom';
- this.dom.shadowTopRight.className = 'shadow top';
- this.dom.shadowBottomRight.className = 'shadow bottom';
+ this.calculateCameraOrientation();
+ };
- this.dom.root.appendChild(this.dom.background);
- this.dom.root.appendChild(this.dom.backgroundVertical);
- this.dom.root.appendChild(this.dom.backgroundHorizontal);
- this.dom.root.appendChild(this.dom.centerContainer);
- this.dom.root.appendChild(this.dom.leftContainer);
- this.dom.root.appendChild(this.dom.rightContainer);
- this.dom.root.appendChild(this.dom.top);
- this.dom.root.appendChild(this.dom.bottom);
+ /**
+ * Set the location (origin) of the arm
+ * @param {Number} x Normalized value of x
+ * @param {Number} y Normalized value of y
+ * @param {Number} z Normalized value of z
+ */
+ Graph3d.Camera.prototype.setArmLocation = function(x, y, z) {
+ this.armLocation.x = x;
+ this.armLocation.y = y;
+ this.armLocation.z = z;
- this.dom.centerContainer.appendChild(this.dom.center);
- this.dom.leftContainer.appendChild(this.dom.left);
- this.dom.rightContainer.appendChild(this.dom.right);
+ this.calculateCameraOrientation();
+ };
- this.dom.centerContainer.appendChild(this.dom.shadowTop);
- this.dom.centerContainer.appendChild(this.dom.shadowBottom);
- this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);
- this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);
- this.dom.rightContainer.appendChild(this.dom.shadowTopRight);
- this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);
+ /**
+ * Set the rotation of the camera arm
+ * @param {Number} horizontal The horizontal rotation, between 0 and 2*PI.
+ * Optional, can be left undefined.
+ * @param {Number} vertical The vertical rotation, between 0 and 0.5*PI
+ * if vertical=0.5*PI, the graph is shown from the
+ * top. Optional, can be left undefined.
+ */
+ Graph3d.Camera.prototype.setArmRotation = function(horizontal, vertical) {
+ if (horizontal !== undefined) {
+ this.armRotation.horizontal = horizontal;
+ }
- this.on('rangechange', this.redraw.bind(this));
- this.on('change', this.redraw.bind(this));
- this.on('touch', this._onTouch.bind(this));
- this.on('pinch', this._onPinch.bind(this));
- this.on('dragstart', this._onDragStart.bind(this));
- this.on('drag', this._onDrag.bind(this));
-
- // create event listeners for all interesting events, these events will be
- // emitted via emitter
- this.hammer = Hammer(this.dom.root, {
- prevent_default: true
- });
- this.listeners = {};
-
- var me = this;
- var events = [
- 'touch', 'pinch',
- 'tap', 'doubletap', 'hold',
- 'dragstart', 'drag', 'dragend',
- 'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox
- ];
- events.forEach(function (event) {
- var listener = function () {
- var args = [event].concat(Array.prototype.slice.call(arguments, 0));
- me.emit.apply(me, args);
- };
- me.hammer.on(event, listener);
- me.listeners[event] = listener;
- });
-
- // size properties of each of the panels
- this.props = {
- root: {},
- background: {},
- centerContainer: {},
- leftContainer: {},
- rightContainer: {},
- center: {},
- left: {},
- right: {},
- top: {},
- bottom: {},
- border: {},
- scrollTop: 0,
- scrollTopMin: 0
- };
- this.touch = {}; // store state information needed for touch events
+ if (vertical !== undefined) {
+ this.armRotation.vertical = vertical;
+ if (this.armRotation.vertical < 0) this.armRotation.vertical = 0;
+ if (this.armRotation.vertical > 0.5*Math.PI) this.armRotation.vertical = 0.5*Math.PI;
+ }
- // attach the root panel to the provided container
- if (!container) throw new Error('No container provided');
- container.appendChild(this.dom.root);
+ if (horizontal !== undefined || vertical !== undefined) {
+ this.calculateCameraOrientation();
+ }
};
/**
- * Destroy the Timeline, clean up all DOM elements and event listeners.
+ * Retrieve the current arm rotation
+ * @return {object} An object with parameters horizontal and vertical
*/
- Timeline.prototype.destroy = function () {
- // unbind datasets
- this.clear();
-
- // remove all event listeners
- this.off();
-
- // stop checking for changed size
- this._stopAutoResize();
-
- // remove from DOM
- if (this.dom.root.parentNode) {
- this.dom.root.parentNode.removeChild(this.dom.root);
- }
- this.dom = null;
-
- // cleanup hammer touch events
- for (var event in this.listeners) {
- if (this.listeners.hasOwnProperty(event)) {
- delete this.listeners[event];
- }
- }
- this.listeners = null;
- this.hammer = null;
-
- // give all components the opportunity to cleanup
- this.components.forEach(function (component) {
- component.destroy();
- });
+ Graph3d.Camera.prototype.getArmRotation = function() {
+ var rot = {};
+ rot.horizontal = this.armRotation.horizontal;
+ rot.vertical = this.armRotation.vertical;
- this.body = null;
+ return rot;
};
/**
- * Set options. Options will be passed to all components loaded in the Timeline.
- * @param {Object} [options]
- * {String} orientation
- * Vertical orientation for the Timeline,
- * can be 'bottom' (default) or 'top'.
- * {String | Number} width
- * Width for the timeline, a number in pixels or
- * a css string like '1000px' or '75%'. '100%' by default.
- * {String | Number} height
- * Fixed height for the Timeline, a number in pixels or
- * a css string like '400px' or '75%'. If undefined,
- * The Timeline will automatically size such that
- * its contents fit.
- * {String | Number} minHeight
- * Minimum height for the Timeline, a number in pixels or
- * a css string like '400px' or '75%'.
- * {String | Number} maxHeight
- * Maximum height for the Timeline, a number in pixels or
- * a css string like '400px' or '75%'.
- * {Number | Date | String} start
- * Start date for the visible window
- * {Number | Date | String} end
- * End date for the visible window
+ * Set the (normalized) length of the camera arm.
+ * @param {Number} length A length between 0.71 and 5.0
*/
- Timeline.prototype.setOptions = function (options) {
- if (options) {
- // copy the known options
- var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'orientation'];
- util.selectiveExtend(fields, this.options, options);
+ Graph3d.Camera.prototype.setArmLength = function(length) {
+ if (length === undefined)
+ return;
- // enable/disable autoResize
- this._initAutoResize();
- }
+ this.armLength = length;
- // propagate options to all components
- this.components.forEach(function (component) {
- component.setOptions(options);
- });
+ // Radius must be larger than the corner of the graph,
+ // which has a distance of sqrt(0.5^2+0.5^2) = 0.71 from the center of the
+ // graph
+ if (this.armLength < 0.71) this.armLength = 0.71;
+ if (this.armLength > 5.0) this.armLength = 5.0;
- // TODO: remove deprecation error one day (deprecated since version 0.8.0)
- if (options && options.order) {
- throw new Error('Option order is deprecated. There is no replacement for this feature.');
- }
+ this.calculateCameraOrientation();
+ };
- // redraw everything
- this.redraw();
+ /**
+ * Retrieve the arm length
+ * @return {Number} length
+ */
+ Graph3d.Camera.prototype.getArmLength = function() {
+ return this.armLength;
};
/**
- * Set a custom time bar
- * @param {Date} time
+ * Retrieve the camera location
+ * @return {Point3d} cameraLocation
*/
- Timeline.prototype.setCustomTime = function (time) {
- if (!this.customTime) {
- throw new Error('Cannot get custom time: Custom time bar is not enabled');
- }
+ Graph3d.Camera.prototype.getCameraLocation = function() {
+ return this.cameraLocation;
+ };
- this.customTime.setCustomTime(time);
+ /**
+ * Retrieve the camera rotation
+ * @return {Point3d} cameraRotation
+ */
+ Graph3d.Camera.prototype.getCameraRotation = function() {
+ return this.cameraRotation;
};
/**
- * Retrieve the current custom time.
- * @return {Date} customTime
+ * Calculate the location and rotation of the camera based on the
+ * position and orientation of the camera arm
*/
- Timeline.prototype.getCustomTime = function() {
- if (!this.customTime) {
- throw new Error('Cannot get custom time: Custom time bar is not enabled');
- }
+ Graph3d.Camera.prototype.calculateCameraOrientation = function() {
+ // calculate location of the camera
+ this.cameraLocation.x = this.armLocation.x - this.armLength * Math.sin(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
+ this.cameraLocation.y = this.armLocation.y - this.armLength * Math.cos(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
+ this.cameraLocation.z = this.armLocation.z + this.armLength * Math.sin(this.armRotation.vertical);
- return this.customTime.getCustomTime();
+ // calculate rotation of the camera
+ this.cameraRotation.x = Math.PI/2 - this.armRotation.vertical;
+ this.cameraRotation.y = 0;
+ this.cameraRotation.z = -this.armRotation.horizontal;
};
/**
- * Set items
- * @param {vis.DataSet | Array | google.visualization.DataTable | null} items
+ * Calculate the scaling values, dependent on the range in x, y, and z direction
*/
- Timeline.prototype.setItems = function(items) {
- var initialLoad = (this.itemsData == null);
+ Graph3d.prototype._setScale = function() {
+ this.scale = new Point3d(1 / (this.xMax - this.xMin),
+ 1 / (this.yMax - this.yMin),
+ 1 / (this.zMax - this.zMin));
- // convert to type DataSet when needed
- var newDataSet;
- if (!items) {
- newDataSet = null;
- }
- else if (items instanceof DataSet || items instanceof DataView) {
- newDataSet = items;
- }
- else {
- // turn an array into a dataset
- newDataSet = new DataSet(items, {
- type: {
- start: 'Date',
- end: 'Date'
- }
- });
+ // keep aspect ration between x and y scale if desired
+ if (this.keepAspectRatio) {
+ if (this.scale.x < this.scale.y) {
+ //noinspection JSSuspiciousNameCombination
+ this.scale.y = this.scale.x;
+ }
+ else {
+ //noinspection JSSuspiciousNameCombination
+ this.scale.x = this.scale.y;
+ }
}
- // set items
- this.itemsData = newDataSet;
- this.itemSet && this.itemSet.setItems(newDataSet);
-
- if (initialLoad && ('start' in this.options || 'end' in this.options)) {
- this.fit();
+ // scale the vertical axis
+ this.scale.z *= this.verticalRatio;
+ // TODO: can this be automated? verticalRatio?
- var start = ('start' in this.options) ? util.convert(this.options.start, 'Date') : null;
- var end = ('end' in this.options) ? util.convert(this.options.end, 'Date') : null;
+ // determine scale for (optional) value
+ this.scale.value = 1 / (this.valueMax - this.valueMin);
- this.setWindow(start, end);
- }
+ // position the camera arm
+ var xCenter = (this.xMax + this.xMin) / 2 * this.scale.x;
+ var yCenter = (this.yMax + this.yMin) / 2 * this.scale.y;
+ var zCenter = (this.zMax + this.zMin) / 2 * this.scale.z;
+ this.camera.setArmLocation(xCenter, yCenter, zCenter);
};
+
/**
- * Set groups
- * @param {vis.DataSet | Array | google.visualization.DataTable} groups
+ * Convert a 3D location to a 2D location on screen
+ * http://en.wikipedia.org/wiki/3D_projection
+ * @param {Point3d} point3d A 3D point with parameters x, y, z
+ * @return {Point2d} point2d A 2D point with parameters x, y
*/
- Timeline.prototype.setGroups = function(groups) {
- // convert to type DataSet when needed
- var newDataSet;
- if (!groups) {
- newDataSet = null;
- }
- else if (groups instanceof DataSet || groups instanceof DataView) {
- newDataSet = groups;
- }
- else {
- // turn an array into a dataset
- newDataSet = new DataSet(groups);
- }
-
- this.groupsData = newDataSet;
- this.itemSet.setGroups(newDataSet);
+ Graph3d.prototype._convert3Dto2D = function(point3d) {
+ var translation = this._convertPointToTranslation(point3d);
+ return this._convertTranslationToScreen(translation);
};
/**
- * Clear the Timeline. By Default, items, groups and options are cleared.
- * Example usage:
- *
- * timeline.clear(); // clear items, groups, and options
- * timeline.clear({options: true}); // clear options only
- *
- * @param {Object} [what] Optionally specify what to clear. By default:
- * {items: true, groups: true, options: true}
+ * Convert a 3D location its translation seen from the camera
+ * http://en.wikipedia.org/wiki/3D_projection
+ * @param {Point3d} point3d A 3D point with parameters x, y, z
+ * @return {Point3d} translation A 3D point with parameters x, y, z This is
+ * the translation of the point, seen from the
+ * camera
*/
- Timeline.prototype.clear = function(what) {
- // clear items
- if (!what || what.items) {
- this.setItems(null);
- }
+ Graph3d.prototype._convertPointToTranslation = function(point3d) {
+ var ax = point3d.x * this.scale.x,
+ ay = point3d.y * this.scale.y,
+ az = point3d.z * this.scale.z,
- // clear groups
- if (!what || what.groups) {
- this.setGroups(null);
- }
+ cx = this.camera.getCameraLocation().x,
+ cy = this.camera.getCameraLocation().y,
+ cz = this.camera.getCameraLocation().z,
- // clear options of timeline and of each of the components
- if (!what || what.options) {
- this.components.forEach(function (component) {
- component.setOptions(component.defaultOptions);
- });
+ // calculate angles
+ sinTx = Math.sin(this.camera.getCameraRotation().x),
+ cosTx = Math.cos(this.camera.getCameraRotation().x),
+ sinTy = Math.sin(this.camera.getCameraRotation().y),
+ cosTy = Math.cos(this.camera.getCameraRotation().y),
+ sinTz = Math.sin(this.camera.getCameraRotation().z),
+ cosTz = Math.cos(this.camera.getCameraRotation().z),
- this.setOptions(this.defaultOptions); // this will also do a redraw
- }
+ // calculate translation
+ dx = cosTy * (sinTz * (ay - cy) + cosTz * (ax - cx)) - sinTy * (az - cz),
+ dy = sinTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) + cosTx * (cosTz * (ay - cy) - sinTz * (ax-cx)),
+ dz = cosTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) - sinTx * (cosTz * (ay - cy) - sinTz * (ax-cx));
+
+ return new Point3d(dx, dy, dz);
};
/**
- * Set Timeline window such that it fits all items
+ * Convert a translation point to a point on the screen
+ * @param {Point3d} translation A 3D point with parameters x, y, z This is
+ * the translation of the point, seen from the
+ * camera
+ * @return {Point2d} point2d A 2D point with parameters x, y
*/
- Timeline.prototype.fit = function() {
- // apply the data range as range
- var dataRange = this.getItemRange();
+ Graph3d.prototype._convertTranslationToScreen = function(translation) {
+ var ex = this.eye.x,
+ ey = this.eye.y,
+ ez = this.eye.z,
+ dx = translation.x,
+ dy = translation.y,
+ dz = translation.z;
- // add 5% space on both sides
- var start = dataRange.min;
- var end = dataRange.max;
- if (start != null && end != null) {
- var interval = (end.valueOf() - start.valueOf());
- if (interval <= 0) {
- // prevent an empty interval
- interval = 24 * 60 * 60 * 1000; // 1 day
- }
- start = new Date(start.valueOf() - interval * 0.05);
- end = new Date(end.valueOf() + interval * 0.05);
+ // calculate position on screen from translation
+ var bx;
+ var by;
+ if (this.showPerspective) {
+ bx = (dx - ex) * (ez / dz);
+ by = (dy - ey) * (ez / dz);
}
-
- // skip range set if there is no start and end date
- if (start === null && end === null) {
- return;
+ else {
+ bx = dx * -(ez / this.camera.getArmLength());
+ by = dy * -(ez / this.camera.getArmLength());
}
- this.range.setRange(start, end);
+ // shift and scale the point to the center of the screen
+ // use the width of the graph to scale both horizontally and vertically.
+ return new Point2d(
+ this.xcenter + bx * this.frame.canvas.clientWidth,
+ this.ycenter - by * this.frame.canvas.clientWidth);
};
/**
- * Get the data range of the item set.
- * @returns {{min: Date, max: Date}} range A range with a start and end Date.
- * When no minimum is found, min==null
- * When no maximum is found, max==null
+ * Set the background styling for the graph
+ * @param {string | {fill: string, stroke: string, strokeWidth: string}} backgroundColor
*/
- Timeline.prototype.getItemRange = function() {
- // calculate min from start filed
- var dataset = this.itemsData.getDataSet(),
- min = null,
- max = null;
-
- if (dataset) {
- // calculate the minimum value of the field 'start'
- var minItem = dataset.min('start');
- min = minItem ? util.convert(minItem.start, 'Date').valueOf() : null;
- // Note: we convert first to Date and then to number because else
- // a conversion from ISODate to Number will fail
+ Graph3d.prototype._setBackgroundColor = function(backgroundColor) {
+ var fill = 'white';
+ var stroke = 'gray';
+ var strokeWidth = 1;
- // calculate maximum value of fields 'start' and 'end'
- var maxStartItem = dataset.max('start');
- if (maxStartItem) {
- max = util.convert(maxStartItem.start, 'Date').valueOf();
- }
- var maxEndItem = dataset.max('end');
- if (maxEndItem) {
- if (max == null) {
- max = util.convert(maxEndItem.end, 'Date').valueOf();
- }
- else {
- max = Math.max(max, util.convert(maxEndItem.end, 'Date').valueOf());
- }
- }
+ if (typeof(backgroundColor) === 'string') {
+ fill = backgroundColor;
+ stroke = 'none';
+ strokeWidth = 0;
+ }
+ else if (typeof(backgroundColor) === 'object') {
+ if (backgroundColor.fill !== undefined) fill = backgroundColor.fill;
+ if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke;
+ if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth;
+ }
+ else if (backgroundColor === undefined) {
+ // use use defaults
+ }
+ else {
+ throw 'Unsupported type of backgroundColor';
}
- return {
- min: (min != null) ? new Date(min) : null,
- max: (max != null) ? new Date(max) : null
- };
+ this.frame.style.backgroundColor = fill;
+ this.frame.style.borderColor = stroke;
+ this.frame.style.borderWidth = strokeWidth + 'px';
+ this.frame.style.borderStyle = 'solid';
};
- /**
- * Set selected items by their id. Replaces the current selection
- * Unknown id's are silently ignored.
- * @param {Array} [ids] An array with zero or more id's of the items to be
- * selected. If ids is an empty array, all items will be
- * unselected.
- */
- Timeline.prototype.setSelection = function(ids) {
- this.itemSet && this.itemSet.setSelection(ids);
- };
- /**
- * Get the selected items by their id
- * @return {Array} ids The ids of the selected items
- */
- Timeline.prototype.getSelection = function() {
- return this.itemSet && this.itemSet.getSelection() || [];
+ /// enumerate the available styles
+ Graph3d.STYLE = {
+ BAR: 0,
+ BARCOLOR: 1,
+ BARSIZE: 2,
+ DOT : 3,
+ DOTLINE : 4,
+ DOTCOLOR: 5,
+ DOTSIZE: 6,
+ GRID : 7,
+ LINE: 8,
+ SURFACE : 9
};
/**
- * Set the visible window. Both parameters are optional, you can change only
- * start or only end. Syntax:
- *
- * TimeLine.setWindow(start, end)
- * TimeLine.setWindow(range)
- *
- * Where start and end can be a Date, number, or string, and range is an
- * object with properties start and end.
- *
- * @param {Date | Number | String | Object} [start] Start date of visible window
- * @param {Date | Number | String} [end] End date of visible window
+ * Retrieve the style index from given styleName
+ * @param {string} styleName Style name such as 'dot', 'grid', 'dot-line'
+ * @return {Number} styleNumber Enumeration value representing the style, or -1
+ * when not found
*/
- Timeline.prototype.setWindow = function(start, end) {
- if (arguments.length == 1) {
- var range = arguments[0];
- this.range.setRange(range.start, range.end);
- }
- else {
- this.range.setRange(start, end);
+ Graph3d.prototype._getStyleNumber = function(styleName) {
+ switch (styleName) {
+ case 'dot': return Graph3d.STYLE.DOT;
+ case 'dot-line': return Graph3d.STYLE.DOTLINE;
+ case 'dot-color': return Graph3d.STYLE.DOTCOLOR;
+ case 'dot-size': return Graph3d.STYLE.DOTSIZE;
+ case 'line': return Graph3d.STYLE.LINE;
+ case 'grid': return Graph3d.STYLE.GRID;
+ case 'surface': return Graph3d.STYLE.SURFACE;
+ case 'bar': return Graph3d.STYLE.BAR;
+ case 'bar-color': return Graph3d.STYLE.BARCOLOR;
+ case 'bar-size': return Graph3d.STYLE.BARSIZE;
}
- };
- /**
- * Get the visible window
- * @return {{start: Date, end: Date}} Visible range
- */
- Timeline.prototype.getWindow = function() {
- var range = this.range.getRange();
- return {
- start: new Date(range.start),
- end: new Date(range.end)
- };
+ return -1;
};
/**
- * Force a redraw of the Timeline. Can be useful to manually redraw when
- * option autoResize=false
+ * Determine the indexes of the data columns, based on the given style and data
+ * @param {DataSet} data
+ * @param {Number} style
*/
- Timeline.prototype.redraw = function() {
- var resized = false,
- options = this.options,
- props = this.props,
- dom = this.dom;
-
- if (!dom) return; // when destroyed
-
- // update class names
- dom.root.className = 'vis timeline root ' + options.orientation;
-
- // update root width and height options
- dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');
- dom.root.style.minHeight = util.option.asSize(options.minHeight, '');
- dom.root.style.width = util.option.asSize(options.width, '');
-
- // calculate border widths
- props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;
- props.border.right = props.border.left;
- props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2;
- props.border.bottom = props.border.top;
- var borderRootHeight= dom.root.offsetHeight - dom.root.clientHeight;
- var borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth;
-
- // calculate the heights. If any of the side panels is empty, we set the height to
- // minus the border width, such that the border will be invisible
- props.center.height = dom.center.offsetHeight;
- props.left.height = dom.left.offsetHeight;
- props.right.height = dom.right.offsetHeight;
- props.top.height = dom.top.clientHeight || -props.border.top;
- props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;
-
- // TODO: compensate borders when any of the panels is empty.
-
- // apply auto height
- // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)
- var contentHeight = Math.max(props.left.height, props.center.height, props.right.height);
- var autoHeight = props.top.height + contentHeight + props.bottom.height +
- borderRootHeight + props.border.top + props.border.bottom;
- dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px');
-
- // calculate heights of the content panels
- props.root.height = dom.root.offsetHeight;
- props.background.height = props.root.height - borderRootHeight;
- var containerHeight = props.root.height - props.top.height - props.bottom.height -
- borderRootHeight;
- props.centerContainer.height = containerHeight;
- props.leftContainer.height = containerHeight;
- props.rightContainer.height = props.leftContainer.height;
-
- // calculate the widths of the panels
- props.root.width = dom.root.offsetWidth;
- props.background.width = props.root.width - borderRootWidth;
- props.left.width = dom.leftContainer.clientWidth || -props.border.left;
- props.leftContainer.width = props.left.width;
- props.right.width = dom.rightContainer.clientWidth || -props.border.right;
- props.rightContainer.width = props.right.width;
- var centerWidth = props.root.width - props.left.width - props.right.width - borderRootWidth;
- props.center.width = centerWidth;
- props.centerContainer.width = centerWidth;
- props.top.width = centerWidth;
- props.bottom.width = centerWidth;
+ Graph3d.prototype._determineColumnIndexes = function(data, style) {
+ if (this.style === Graph3d.STYLE.DOT ||
+ this.style === Graph3d.STYLE.DOTLINE ||
+ this.style === Graph3d.STYLE.LINE ||
+ this.style === Graph3d.STYLE.GRID ||
+ this.style === Graph3d.STYLE.SURFACE ||
+ this.style === Graph3d.STYLE.BAR) {
+ // 3 columns expected, and optionally a 4th with filter values
+ this.colX = 0;
+ this.colY = 1;
+ this.colZ = 2;
+ this.colValue = undefined;
- // resize the panels
- dom.background.style.height = props.background.height + 'px';
- dom.backgroundVertical.style.height = props.background.height + 'px';
- dom.backgroundHorizontal.style.height = props.centerContainer.height + 'px';
- dom.centerContainer.style.height = props.centerContainer.height + 'px';
- dom.leftContainer.style.height = props.leftContainer.height + 'px';
- dom.rightContainer.style.height = props.rightContainer.height + 'px';
+ if (data.getNumberOfColumns() > 3) {
+ this.colFilter = 3;
+ }
+ }
+ else if (this.style === Graph3d.STYLE.DOTCOLOR ||
+ this.style === Graph3d.STYLE.DOTSIZE ||
+ this.style === Graph3d.STYLE.BARCOLOR ||
+ this.style === Graph3d.STYLE.BARSIZE) {
+ // 4 columns expected, and optionally a 5th with filter values
+ this.colX = 0;
+ this.colY = 1;
+ this.colZ = 2;
+ this.colValue = 3;
- dom.background.style.width = props.background.width + 'px';
- dom.backgroundVertical.style.width = props.centerContainer.width + 'px';
- dom.backgroundHorizontal.style.width = props.background.width + 'px';
- dom.centerContainer.style.width = props.center.width + 'px';
- dom.top.style.width = props.top.width + 'px';
- dom.bottom.style.width = props.bottom.width + 'px';
+ if (data.getNumberOfColumns() > 4) {
+ this.colFilter = 4;
+ }
+ }
+ else {
+ throw 'Unknown style "' + this.style + '"';
+ }
+ };
- // reposition the panels
- dom.background.style.left = '0';
- dom.background.style.top = '0';
- dom.backgroundVertical.style.left = props.left.width + 'px';
- dom.backgroundVertical.style.top = '0';
- dom.backgroundHorizontal.style.left = '0';
- dom.backgroundHorizontal.style.top = props.top.height + 'px';
- dom.centerContainer.style.left = props.left.width + 'px';
- dom.centerContainer.style.top = props.top.height + 'px';
- dom.leftContainer.style.left = '0';
- dom.leftContainer.style.top = props.top.height + 'px';
- dom.rightContainer.style.left = (props.left.width + props.center.width) + 'px';
- dom.rightContainer.style.top = props.top.height + 'px';
- dom.top.style.left = props.left.width + 'px';
- dom.top.style.top = '0';
- dom.bottom.style.left = props.left.width + 'px';
- dom.bottom.style.top = (props.top.height + props.centerContainer.height) + 'px';
+ Graph3d.prototype.getNumberOfRows = function(data) {
+ return data.length;
+ }
- // update the scrollTop, feasible range for the offset can be changed
- // when the height of the Timeline or of the contents of the center changed
- this._updateScrollTop();
- // reposition the scrollable contents
- var offset = this.props.scrollTop;
- if (options.orientation == 'bottom') {
- offset += Math.max(this.props.centerContainer.height - this.props.center.height -
- this.props.border.top - this.props.border.bottom, 0);
+ Graph3d.prototype.getNumberOfColumns = function(data) {
+ var counter = 0;
+ for (var column in data[0]) {
+ if (data[0].hasOwnProperty(column)) {
+ counter++;
+ }
}
- dom.center.style.left = '0';
- dom.center.style.top = offset + 'px';
- dom.left.style.left = '0';
- dom.left.style.top = offset + 'px';
- dom.right.style.left = '0';
- dom.right.style.top = offset + 'px';
+ return counter;
+ }
- // show shadows when vertical scrolling is available
- var visibilityTop = this.props.scrollTop == 0 ? 'hidden' : '';
- var visibilityBottom = this.props.scrollTop == this.props.scrollTopMin ? 'hidden' : '';
- dom.shadowTop.style.visibility = visibilityTop;
- dom.shadowBottom.style.visibility = visibilityBottom;
- dom.shadowTopLeft.style.visibility = visibilityTop;
- dom.shadowBottomLeft.style.visibility = visibilityBottom;
- dom.shadowTopRight.style.visibility = visibilityTop;
- dom.shadowBottomRight.style.visibility = visibilityBottom;
- // redraw all components
- this.components.forEach(function (component) {
- resized = component.redraw() || resized;
- });
- if (resized) {
- // keep repainting until all sizes are settled
- this.redraw();
+ Graph3d.prototype.getDistinctValues = function(data, column) {
+ var distinctValues = [];
+ for (var i = 0; i < data.length; i++) {
+ if (distinctValues.indexOf(data[i][column]) == -1) {
+ distinctValues.push(data[i][column]);
+ }
}
- };
-
- // TODO: deprecated since version 1.1.0, remove some day
- Timeline.prototype.repaint = function () {
- throw new Error('Function repaint is deprecated. Use redraw instead.');
- };
-
- /**
- * Convert a position on screen (pixels) to a datetime
- * @param {int} x Position on the screen in pixels
- * @return {Date} time The datetime the corresponds with given position x
- * @private
- */
- // TODO: move this function to Range
- Timeline.prototype._toTime = function(x) {
- var conversion = this.range.conversion(this.props.center.width);
- return new Date(x / conversion.scale + conversion.offset);
- };
+ return distinctValues;
+ }
- /**
- * Convert a position on the global screen (pixels) to a datetime
- * @param {int} x Position on the screen in pixels
- * @return {Date} time The datetime the corresponds with given position x
- * @private
- */
- // TODO: move this function to Range
- Timeline.prototype._toGlobalTime = function(x) {
- var conversion = this.range.conversion(this.props.root.width);
- return new Date(x / conversion.scale + conversion.offset);
+ Graph3d.prototype.getColumnRange = function(data,column) {
+ var minMax = {min:data[0][column],max:data[0][column]};
+ for (var i = 0; i < data.length; i++) {
+ if (minMax.min > data[i][column]) { minMax.min = data[i][column]; }
+ if (minMax.max < data[i][column]) { minMax.max = data[i][column]; }
+ }
+ return minMax;
};
/**
- * Convert a datetime (Date object) into a position on the screen
- * @param {Date} time A date
- * @return {int} x The position on the screen in pixels which corresponds
- * with the given date.
- * @private
+ * Initialize the data from the data table. Calculate minimum and maximum values
+ * and column index values
+ * @param {Array | DataSet | DataView} rawData The data containing the items for the Graph.
+ * @param {Number} style Style Number
*/
- // TODO: move this function to Range
- Timeline.prototype._toScreen = function(time) {
- var conversion = this.range.conversion(this.props.center.width);
- return (time.valueOf() - conversion.offset) * conversion.scale;
- };
+ Graph3d.prototype._dataInitialize = function (rawData, style) {
+ var me = this;
+ // unsubscribe from the dataTable
+ if (this.dataSet) {
+ this.dataSet.off('*', this._onChange);
+ }
- /**
- * Convert a datetime (Date object) into a position on the root
- * This is used to get the pixel density estimate for the screen, not the center panel
- * @param {Date} time A date
- * @return {int} x The position on root in pixels which corresponds
- * with the given date.
- * @private
- */
- // TODO: move this function to Range
- Timeline.prototype._toGlobalScreen = function(time) {
- var conversion = this.range.conversion(this.props.root.width);
- return (time.valueOf() - conversion.offset) * conversion.scale;
- };
+ if (rawData === undefined)
+ return;
+ if (Array.isArray(rawData)) {
+ rawData = new DataSet(rawData);
+ }
- /**
- * Initialize watching when option autoResize is true
- * @private
- */
- Timeline.prototype._initAutoResize = function () {
- if (this.options.autoResize == true) {
- this._startAutoResize();
+ var data;
+ if (rawData instanceof DataSet || rawData instanceof DataView) {
+ data = rawData.get();
}
else {
- this._stopAutoResize();
+ throw new Error('Array, DataSet, or DataView expected');
}
- };
- /**
- * Watch for changes in the size of the container. On resize, the Panel will
- * automatically redraw itself.
- * @private
- */
- Timeline.prototype._startAutoResize = function () {
- var me = this;
+ if (data.length == 0)
+ return;
- this._stopAutoResize();
+ this.dataSet = rawData;
+ this.dataTable = data;
- this._onResize = function() {
- if (me.options.autoResize != true) {
- // stop watching when the option autoResize is changed to false
- me._stopAutoResize();
- return;
+ // subscribe to changes in the dataset
+ this._onChange = function () {
+ me.setData(me.dataSet);
+ };
+ this.dataSet.on('*', this._onChange);
+
+ // _determineColumnIndexes
+ // getNumberOfRows (points)
+ // getNumberOfColumns (x,y,z,v,t,t1,t2...)
+ // getDistinctValues (unique values?)
+ // getColumnRange
+
+ // determine the location of x,y,z,value,filter columns
+ this.colX = 'x';
+ this.colY = 'y';
+ this.colZ = 'z';
+ this.colValue = 'style';
+ this.colFilter = 'filter';
+
+
+
+ // check if a filter column is provided
+ if (data[0].hasOwnProperty('filter')) {
+ if (this.dataFilter === undefined) {
+ this.dataFilter = new Filter(rawData, this.colFilter, this);
+ this.dataFilter.setOnLoadCallback(function() {me.redraw();});
}
+ }
- if (me.dom.root) {
- // check whether the frame is resized
- if ((me.dom.root.clientWidth != me.props.lastWidth) ||
- (me.dom.root.clientHeight != me.props.lastHeight)) {
- me.props.lastWidth = me.dom.root.clientWidth;
- me.props.lastHeight = me.dom.root.clientHeight;
- me.emit('change');
- }
+ var withBars = this.style == Graph3d.STYLE.BAR ||
+ this.style == Graph3d.STYLE.BARCOLOR ||
+ this.style == Graph3d.STYLE.BARSIZE;
+
+ // determine barWidth from data
+ if (withBars) {
+ if (this.defaultXBarWidth !== undefined) {
+ this.xBarWidth = this.defaultXBarWidth;
+ }
+ else {
+ var dataX = this.getDistinctValues(data,this.colX);
+ this.xBarWidth = (dataX[1] - dataX[0]) || 1;
}
- };
- // add event listener to window resize
- util.addEventListener(window, 'resize', this._onResize);
+ if (this.defaultYBarWidth !== undefined) {
+ this.yBarWidth = this.defaultYBarWidth;
+ }
+ else {
+ var dataY = this.getDistinctValues(data,this.colY);
+ this.yBarWidth = (dataY[1] - dataY[0]) || 1;
+ }
+ }
- this.watchTimer = setInterval(this._onResize, 1000);
- };
+ // calculate minimums and maximums
+ var xRange = this.getColumnRange(data,this.colX);
+ if (withBars) {
+ xRange.min -= this.xBarWidth / 2;
+ xRange.max += this.xBarWidth / 2;
+ }
+ this.xMin = (this.defaultXMin !== undefined) ? this.defaultXMin : xRange.min;
+ this.xMax = (this.defaultXMax !== undefined) ? this.defaultXMax : xRange.max;
+ if (this.xMax <= this.xMin) this.xMax = this.xMin + 1;
+ this.xStep = (this.defaultXStep !== undefined) ? this.defaultXStep : (this.xMax-this.xMin)/5;
- /**
- * Stop watching for a resize of the frame.
- * @private
- */
- Timeline.prototype._stopAutoResize = function () {
- if (this.watchTimer) {
- clearInterval(this.watchTimer);
- this.watchTimer = undefined;
+ var yRange = this.getColumnRange(data,this.colY);
+ if (withBars) {
+ yRange.min -= this.yBarWidth / 2;
+ yRange.max += this.yBarWidth / 2;
}
+ this.yMin = (this.defaultYMin !== undefined) ? this.defaultYMin : yRange.min;
+ this.yMax = (this.defaultYMax !== undefined) ? this.defaultYMax : yRange.max;
+ if (this.yMax <= this.yMin) this.yMax = this.yMin + 1;
+ this.yStep = (this.defaultYStep !== undefined) ? this.defaultYStep : (this.yMax-this.yMin)/5;
- // remove event listener on window.resize
- util.removeEventListener(window, 'resize', this._onResize);
- this._onResize = null;
- };
+ var zRange = this.getColumnRange(data,this.colZ);
+ this.zMin = (this.defaultZMin !== undefined) ? this.defaultZMin : zRange.min;
+ this.zMax = (this.defaultZMax !== undefined) ? this.defaultZMax : zRange.max;
+ if (this.zMax <= this.zMin) this.zMax = this.zMin + 1;
+ this.zStep = (this.defaultZStep !== undefined) ? this.defaultZStep : (this.zMax-this.zMin)/5;
- /**
- * Start moving the timeline vertically
- * @param {Event} event
- * @private
- */
- Timeline.prototype._onTouch = function (event) {
- this.touch.allowDragging = true;
- };
+ if (this.colValue !== undefined) {
+ var valueRange = this.getColumnRange(data,this.colValue);
+ this.valueMin = (this.defaultValueMin !== undefined) ? this.defaultValueMin : valueRange.min;
+ this.valueMax = (this.defaultValueMax !== undefined) ? this.defaultValueMax : valueRange.max;
+ if (this.valueMax <= this.valueMin) this.valueMax = this.valueMin + 1;
+ }
- /**
- * Start moving the timeline vertically
- * @param {Event} event
- * @private
- */
- Timeline.prototype._onPinch = function (event) {
- this.touch.allowDragging = false;
+ // set the scale dependent on the ranges.
+ this._setScale();
};
- /**
- * Start moving the timeline vertically
- * @param {Event} event
- * @private
- */
- Timeline.prototype._onDragStart = function (event) {
- this.touch.initialScrollTop = this.props.scrollTop;
- };
+
/**
- * Move the timeline vertically
- * @param {Event} event
- * @private
+ * Filter the data based on the current filter
+ * @param {Array} data
+ * @return {Array} dataPoints Array with point objects which can be drawn on screen
*/
- Timeline.prototype._onDrag = function (event) {
- // refuse to drag when we where pinching to prevent the timeline make a jump
- // when releasing the fingers in opposite order from the touch screen
- if (!this.touch.allowDragging) return;
+ Graph3d.prototype._getDataPoints = function (data) {
+ // TODO: store the created matrix dataPoints in the filters instead of reloading each time
+ var x, y, i, z, obj, point;
- var delta = event.gesture.deltaY;
+ var dataPoints = [];
- var oldScrollTop = this._getScrollTop();
- var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);
+ if (this.style === Graph3d.STYLE.GRID ||
+ this.style === Graph3d.STYLE.SURFACE) {
+ // copy all values from the google data table to a matrix
+ // the provided values are supposed to form a grid of (x,y) positions
- if (newScrollTop != oldScrollTop) {
- this.redraw(); // TODO: this causes two redraws when dragging, the other is triggered by rangechange already
- }
- };
+ // create two lists with all present x and y values
+ var dataX = [];
+ var dataY = [];
+ for (i = 0; i < this.getNumberOfRows(data); i++) {
+ x = data[i][this.colX] || 0;
+ y = data[i][this.colY] || 0;
- /**
- * Apply a scrollTop
- * @param {Number} scrollTop
- * @returns {Number} scrollTop Returns the applied scrollTop
- * @private
- */
- Timeline.prototype._setScrollTop = function (scrollTop) {
- this.props.scrollTop = scrollTop;
- this._updateScrollTop();
- return this.props.scrollTop;
- };
+ if (dataX.indexOf(x) === -1) {
+ dataX.push(x);
+ }
+ if (dataY.indexOf(y) === -1) {
+ dataY.push(y);
+ }
+ }
- /**
- * Update the current scrollTop when the height of the containers has been changed
- * @returns {Number} scrollTop Returns the applied scrollTop
- * @private
- */
- Timeline.prototype._updateScrollTop = function () {
- // recalculate the scrollTopMin
- var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
- if (scrollTopMin != this.props.scrollTopMin) {
- // in case of bottom orientation, change the scrollTop such that the contents
- // do not move relative to the time axis at the bottom
- if (this.options.orientation == 'bottom') {
- this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin);
+ function sortNumber(a, b) {
+ return a - b;
}
- this.props.scrollTopMin = scrollTopMin;
- }
+ dataX.sort(sortNumber);
+ dataY.sort(sortNumber);
- // limit the scrollTop to the feasible scroll range
- if (this.props.scrollTop > 0) this.props.scrollTop = 0;
- if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;
+ // create a grid, a 2d matrix, with all values.
+ var dataMatrix = []; // temporary data matrix
+ for (i = 0; i < data.length; i++) {
+ x = data[i][this.colX] || 0;
+ y = data[i][this.colY] || 0;
+ z = data[i][this.colZ] || 0;
- return this.props.scrollTop;
- };
+ var xIndex = dataX.indexOf(x); // TODO: implement Array().indexOf() for Internet Explorer
+ var yIndex = dataY.indexOf(y);
- /**
- * Get the current scrollTop
- * @returns {number} scrollTop
- * @private
- */
- Timeline.prototype._getScrollTop = function () {
- return this.props.scrollTop;
- };
+ if (dataMatrix[xIndex] === undefined) {
+ dataMatrix[xIndex] = [];
+ }
- module.exports = Timeline;
+ var point3d = new Point3d();
+ point3d.x = x;
+ point3d.y = y;
+ point3d.z = z;
+ obj = {};
+ obj.point = point3d;
+ obj.trans = undefined;
+ obj.screen = undefined;
+ obj.bottom = new Point3d(x, y, this.zMin);
-/***/ },
-/* 6 */
-/***/ function(module, exports, __webpack_require__) {
+ dataMatrix[xIndex][yIndex] = obj;
- /**
- * @constructor DataStep
- * The class DataStep is an iterator for data for the lineGraph. You provide a start data point and an
- * end data point. The class itself determines the best scale (step size) based on the
- * provided start Date, end Date, and minimumStep.
- *
- * If minimumStep is provided, the step size is chosen as close as possible
- * to the minimumStep but larger than minimumStep. If minimumStep is not
- * provided, the scale is set to 1 DAY.
- * The minimumStep should correspond with the onscreen size of about 6 characters
- *
- * Alternatively, you can set a scale by hand.
- * After creation, you can initialize the class by executing first(). Then you
- * can iterate from the start date to the end date via next(). You can check if
- * the end date is reached with the function hasNext(). After each step, you can
- * retrieve the current date via getCurrent().
- * The DataStep has scales ranging from milliseconds, seconds, minutes, hours,
- * days, to years.
- *
- * Version: 1.2
- *
- * @param {Date} [start] The start date, for example new Date(2010, 9, 21)
- * or new Date(2010, 9, 21, 23, 45, 00)
- * @param {Date} [end] The end date
- * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
- */
- function DataStep(start, end, minimumStep, containerHeight, forcedStepSize) {
- // variables
- this.current = 0;
-
- this.autoScale = true;
- this.stepIndex = 0;
- this.step = 1;
- this.scale = 1;
-
- this.marginStart;
- this.marginEnd;
-
- this.majorSteps = [1, 2, 5, 10];
- this.minorSteps = [0.25, 0.5, 1, 2];
-
- this.setRange(start, end, minimumStep, containerHeight, forcedStepSize);
- }
+ dataPoints.push(obj);
+ }
+ // fill in the pointers to the neighbors.
+ for (x = 0; x < dataMatrix.length; x++) {
+ for (y = 0; y < dataMatrix[x].length; y++) {
+ if (dataMatrix[x][y]) {
+ dataMatrix[x][y].pointRight = (x < dataMatrix.length-1) ? dataMatrix[x+1][y] : undefined;
+ dataMatrix[x][y].pointTop = (y < dataMatrix[x].length-1) ? dataMatrix[x][y+1] : undefined;
+ dataMatrix[x][y].pointCross =
+ (x < dataMatrix.length-1 && y < dataMatrix[x].length-1) ?
+ dataMatrix[x+1][y+1] :
+ undefined;
+ }
+ }
+ }
+ }
+ else { // 'dot', 'dot-line', etc.
+ // copy all values from the google data table to a list with Point3d objects
+ for (i = 0; i < data.length; i++) {
+ point = new Point3d();
+ point.x = data[i][this.colX] || 0;
+ point.y = data[i][this.colY] || 0;
+ point.z = data[i][this.colZ] || 0;
+ if (this.colValue !== undefined) {
+ point.value = data[i][this.colValue] || 0;
+ }
- /**
- * Set a new range
- * If minimumStep is provided, the step size is chosen as close as possible
- * to the minimumStep but larger than minimumStep. If minimumStep is not
- * provided, the scale is set to 1 DAY.
- * The minimumStep should correspond with the onscreen size of about 6 characters
- * @param {Number} [start] The start date and time.
- * @param {Number} [end] The end date and time.
- * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
- */
- DataStep.prototype.setRange = function(start, end, minimumStep, containerHeight, forcedStepSize) {
- this._start = start;
- this._end = end;
+ obj = {};
+ obj.point = point;
+ obj.bottom = new Point3d(point.x, point.y, this.zMin);
+ obj.trans = undefined;
+ obj.screen = undefined;
- if (this.autoScale) {
- this.setMinimumStep(minimumStep, containerHeight, forcedStepSize);
+ dataPoints.push(obj);
+ }
}
- this.setFirst();
+
+ return dataPoints;
};
/**
- * Automatically determine the scale that bests fits the provided minimum step
- * @param {Number} [minimumStep] The minimum step size in milliseconds
+ * Create the main frame for the Graph3d.
+ * This function is executed once when a Graph3d object is created. The frame
+ * contains a canvas, and this canvas contains all objects like the axis and
+ * nodes.
*/
- DataStep.prototype.setMinimumStep = function(minimumStep, containerHeight) {
- // round to floor
- var size = this._end - this._start;
- var safeSize = size * 1.1;
- var minimumStepValue = minimumStep * (safeSize / containerHeight);
- var orderOfMagnitude = Math.round(Math.log(safeSize)/Math.LN10);
-
- var minorStepIdx = -1;
- var magnitudefactor = Math.pow(10,orderOfMagnitude);
-
- var start = 0;
- if (orderOfMagnitude < 0) {
- start = orderOfMagnitude;
- }
-
- var solutionFound = false;
- for (var i = start; Math.abs(i) <= Math.abs(orderOfMagnitude); i++) {
- magnitudefactor = Math.pow(10,i);
- for (var j = 0; j < this.minorSteps.length; j++) {
- var stepSize = magnitudefactor * this.minorSteps[j];
- if (stepSize >= minimumStepValue) {
- solutionFound = true;
- minorStepIdx = j;
- break;
- }
- }
- if (solutionFound == true) {
- break;
- }
+ Graph3d.prototype.create = function () {
+ // remove all elements from the container element.
+ while (this.containerElement.hasChildNodes()) {
+ this.containerElement.removeChild(this.containerElement.firstChild);
}
- this.stepIndex = minorStepIdx;
- this.scale = magnitudefactor;
- this.step = magnitudefactor * this.minorSteps[minorStepIdx];
- };
+ this.frame = document.createElement('div');
+ this.frame.style.position = 'relative';
+ this.frame.style.overflow = 'hidden';
- /**
- * Set the range iterator to the start date.
- */
- DataStep.prototype.first = function() {
- this.setFirst();
- };
+ // create the graph canvas (HTML canvas element)
+ this.frame.canvas = document.createElement( 'canvas' );
+ this.frame.canvas.style.position = 'relative';
+ this.frame.appendChild(this.frame.canvas);
+ //if (!this.frame.canvas.getContext) {
+ {
+ var noCanvas = document.createElement( 'DIV' );
+ noCanvas.style.color = 'red';
+ noCanvas.style.fontWeight = 'bold' ;
+ noCanvas.style.padding = '10px';
+ noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
+ this.frame.canvas.appendChild(noCanvas);
+ }
- /**
- * Round the current date to the first minor date value
- * This must be executed once when the current date is set to start Date
- */
- DataStep.prototype.setFirst = function() {
- var niceStart = this._start - (this.scale * this.minorSteps[this.stepIndex]);
- var niceEnd = this._end + (this.scale * this.minorSteps[this.stepIndex]);
+ this.frame.filter = document.createElement( 'div' );
+ this.frame.filter.style.position = 'absolute';
+ this.frame.filter.style.bottom = '0px';
+ this.frame.filter.style.left = '0px';
+ this.frame.filter.style.width = '100%';
+ this.frame.appendChild(this.frame.filter);
- this.marginEnd = this.roundToMinor(niceEnd);
- this.marginStart = this.roundToMinor(niceStart);
- this.marginRange = this.marginEnd - this.marginStart;
+ // add event listeners to handle moving and zooming the contents
+ var me = this;
+ var onmousedown = function (event) {me._onMouseDown(event);};
+ var ontouchstart = function (event) {me._onTouchStart(event);};
+ var onmousewheel = function (event) {me._onWheel(event);};
+ var ontooltip = function (event) {me._onTooltip(event);};
+ // TODO: these events are never cleaned up... can give a 'memory leakage'
- this.current = this.marginEnd;
+ G3DaddEventListener(this.frame.canvas, 'keydown', onkeydown);
+ G3DaddEventListener(this.frame.canvas, 'mousedown', onmousedown);
+ G3DaddEventListener(this.frame.canvas, 'touchstart', ontouchstart);
+ G3DaddEventListener(this.frame.canvas, 'mousewheel', onmousewheel);
+ G3DaddEventListener(this.frame.canvas, 'mousemove', ontooltip);
+ // add the new graph to the container element
+ this.containerElement.appendChild(this.frame);
};
- DataStep.prototype.roundToMinor = function(value) {
- var rounded = value - (value % (this.scale * this.minorSteps[this.stepIndex]));
- if (value % (this.scale * this.minorSteps[this.stepIndex]) > 0.5 * (this.scale * this.minorSteps[this.stepIndex])) {
- return rounded + (this.scale * this.minorSteps[this.stepIndex]);
- }
- else {
- return rounded;
- }
- }
-
/**
- * Check if the there is a next step
- * @return {boolean} true if the current date has not passed the end date
+ * Set a new size for the graph
+ * @param {string} width Width in pixels or percentage (for example '800px'
+ * or '50%')
+ * @param {string} height Height in pixels or percentage (for example '400px'
+ * or '30%')
*/
- DataStep.prototype.hasNext = function () {
- return (this.current >= this.marginStart);
+ Graph3d.prototype.setSize = function(width, height) {
+ this.frame.style.width = width;
+ this.frame.style.height = height;
+
+ this._resizeCanvas();
};
/**
- * Do the next step
+ * Resize the canvas to the current size of the frame
*/
- DataStep.prototype.next = function() {
- var prev = this.current;
- this.current -= this.step;
+ Graph3d.prototype._resizeCanvas = function() {
+ this.frame.canvas.style.width = '100%';
+ this.frame.canvas.style.height = '100%';
- // safety mechanism: if current time is still unchanged, move to the end
- if (this.current == prev) {
- this.current = this._end;
- }
+ this.frame.canvas.width = this.frame.canvas.clientWidth;
+ this.frame.canvas.height = this.frame.canvas.clientHeight;
+
+ // adjust with for margin
+ this.frame.filter.style.width = (this.frame.canvas.clientWidth - 2 * 10) + 'px';
};
/**
- * Do the next step
+ * Start animation
*/
- DataStep.prototype.previous = function() {
- this.current += this.step;
- this.marginEnd += this.step;
- this.marginRange = this.marginEnd - this.marginStart;
- };
+ Graph3d.prototype.animationStart = function() {
+ if (!this.frame.filter || !this.frame.filter.slider)
+ throw 'No animation available';
+ this.frame.filter.slider.play();
+ };
/**
- * Get the current datetime
- * @return {String} current The current date
+ * Stop animation
*/
- DataStep.prototype.getCurrent = function() {
- var toPrecision = '' + Number(this.current).toPrecision(5);
- for (var i = toPrecision.length-1; i > 0; i--) {
- if (toPrecision[i] == "0") {
- toPrecision = toPrecision.slice(0,i);
- }
- else if (toPrecision[i] == "." || toPrecision[i] == ",") {
- toPrecision = toPrecision.slice(0,i);
- break;
- }
- else{
- break;
- }
- }
+ Graph3d.prototype.animationStop = function() {
+ if (!this.frame.filter || !this.frame.filter.slider) return;
- return toPrecision;
+ this.frame.filter.slider.stop();
};
-
/**
- * Snap a date to a rounded value.
- * The snap intervals are dependent on the current scale and step.
- * @param {Date} date the date to be snapped.
- * @return {Date} snappedDate
+ * Resize the center position based on the current values in this.defaultXCenter
+ * and this.defaultYCenter (which are strings with a percentage or a value
+ * in pixels). The center positions are the variables this.xCenter
+ * and this.yCenter
*/
- DataStep.prototype.snap = function(date) {
+ Graph3d.prototype._resizeCenter = function() {
+ // calculate the horizontal center position
+ if (this.defaultXCenter.charAt(this.defaultXCenter.length-1) === '%') {
+ this.xcenter =
+ parseFloat(this.defaultXCenter) / 100 *
+ this.frame.canvas.clientWidth;
+ }
+ else {
+ this.xcenter = parseFloat(this.defaultXCenter); // supposed to be in px
+ }
+ // calculate the vertical center position
+ if (this.defaultYCenter.charAt(this.defaultYCenter.length-1) === '%') {
+ this.ycenter =
+ parseFloat(this.defaultYCenter) / 100 *
+ (this.frame.canvas.clientHeight - this.frame.filter.clientHeight);
+ }
+ else {
+ this.ycenter = parseFloat(this.defaultYCenter); // supposed to be in px
+ }
};
/**
- * Check if the current value is a major value (for example when the step
- * is DAY, a major value is each first day of the MONTH)
- * @return {boolean} true if current date is major, else false.
+ * Set the rotation and distance of the camera
+ * @param {Object} pos An object with the camera position. The object
+ * contains three parameters:
+ * - horizontal {Number}
+ * The horizontal rotation, between 0 and 2*PI.
+ * Optional, can be left undefined.
+ * - vertical {Number}
+ * The vertical rotation, between 0 and 0.5*PI
+ * if vertical=0.5*PI, the graph is shown from the
+ * top. Optional, can be left undefined.
+ * - distance {Number}
+ * The (normalized) distance of the camera to the
+ * center of the graph, a value between 0.71 and 5.0.
+ * Optional, can be left undefined.
*/
- DataStep.prototype.isMajor = function() {
- return (this.current % (this.scale * this.majorSteps[this.stepIndex]) == 0);
+ Graph3d.prototype.setCameraPosition = function(pos) {
+ if (pos === undefined) {
+ return;
+ }
+
+ if (pos.horizontal !== undefined && pos.vertical !== undefined) {
+ this.camera.setArmRotation(pos.horizontal, pos.vertical);
+ }
+
+ if (pos.distance !== undefined) {
+ this.camera.setArmLength(pos.distance);
+ }
+
+ this.redraw();
};
- module.exports = DataStep;
+ /**
+ * Retrieve the current camera rotation
+ * @return {object} An object with parameters horizontal, vertical, and
+ * distance
+ */
+ Graph3d.prototype.getCameraPosition = function() {
+ var pos = this.camera.getArmRotation();
+ pos.distance = this.camera.getArmLength();
+ return pos;
+ };
+
+ /**
+ * Load data into the 3D Graph
+ */
+ Graph3d.prototype._readData = function(data) {
+ // read the data
+ this._dataInitialize(data, this.style);
-/***/ },
-/* 7 */
-/***/ function(module, exports, __webpack_require__) {
- var Emitter = __webpack_require__(41);
- var Hammer = __webpack_require__(50);
- var util = __webpack_require__(1);
- var DataSet = __webpack_require__(3);
- var DataView = __webpack_require__(4);
- var Range = __webpack_require__(8);
- var TimeAxis = __webpack_require__(21);
- var CurrentTime = __webpack_require__(13);
- var CustomTime = __webpack_require__(14);
- var LineGraph = __webpack_require__(20);
+ if (this.dataFilter) {
+ // apply filtering
+ this.dataPoints = this.dataFilter._getDataPoints();
+ }
+ else {
+ // no filtering. load all data
+ this.dataPoints = this._getDataPoints(this.dataTable);
+ }
+
+ // draw the filter
+ this._redrawFilter();
+ };
/**
- * Create a timeline visualization
- * @param {HTMLElement} container
- * @param {vis.DataSet | Array | google.visualization.DataTable} [items]
- * @param {Object} [options] See Graph2d.setOptions for the available options.
- * @constructor
+ * Replace the dataset of the Graph3d
+ * @param {Array | DataSet | DataView} data
*/
- function Graph2d (container, items, options, groups) {
- var me = this;
- this.defaultOptions = {
- start: null,
- end: null,
+ Graph3d.prototype.setData = function (data) {
+ this._readData(data);
+ this.redraw();
- autoResize: true,
+ // start animation when option is true
+ if (this.animationAutoStart && this.dataFilter) {
+ this.animationStart();
+ }
+ };
- orientation: 'bottom',
- width: null,
- height: null,
- maxHeight: null,
- minHeight: null
- };
- this.options = util.deepExtend({}, this.defaultOptions);
+ /**
+ * Update the options. Options will be merged with current options
+ * @param {Object} options
+ */
+ Graph3d.prototype.setOptions = function (options) {
+ var cameraPosition = undefined;
- // Create the DOM, props, and emitter
- this._create(container);
+ this.animationStop();
- // all components listed here will be repainted automatically
- this.components = [];
+ if (options !== undefined) {
+ // retrieve parameter values
+ if (options.width !== undefined) this.width = options.width;
+ if (options.height !== undefined) this.height = options.height;
- this.body = {
- dom: this.dom,
- domProps: this.props,
- emitter: {
- on: this.on.bind(this),
- off: this.off.bind(this),
- emit: this.emit.bind(this)
- },
- util: {
- snap: null, // will be specified after TimeAxis is created
- toScreen: me._toScreen.bind(me),
- toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
- toTime: me._toTime.bind(me),
- toGlobalTime : me._toGlobalTime.bind(me)
- }
- };
+ if (options.xCenter !== undefined) this.defaultXCenter = options.xCenter;
+ if (options.yCenter !== undefined) this.defaultYCenter = options.yCenter;
- // range
- this.range = new Range(this.body);
- this.components.push(this.range);
- this.body.range = this.range;
+ if (options.filterLabel !== undefined) this.filterLabel = options.filterLabel;
+ if (options.legendLabel !== undefined) this.legendLabel = options.legendLabel;
+ if (options.xLabel !== undefined) this.xLabel = options.xLabel;
+ if (options.yLabel !== undefined) this.yLabel = options.yLabel;
+ if (options.zLabel !== undefined) this.zLabel = options.zLabel;
- // time axis
- this.timeAxis = new TimeAxis(this.body);
- this.components.push(this.timeAxis);
- this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);
+ if (options.style !== undefined) {
+ var styleNumber = this._getStyleNumber(options.style);
+ if (styleNumber !== -1) {
+ this.style = styleNumber;
+ }
+ }
+ if (options.showGrid !== undefined) this.showGrid = options.showGrid;
+ if (options.showPerspective !== undefined) this.showPerspective = options.showPerspective;
+ if (options.showShadow !== undefined) this.showShadow = options.showShadow;
+ if (options.tooltip !== undefined) this.showTooltip = options.tooltip;
+ if (options.showAnimationControls !== undefined) this.showAnimationControls = options.showAnimationControls;
+ if (options.keepAspectRatio !== undefined) this.keepAspectRatio = options.keepAspectRatio;
+ if (options.verticalRatio !== undefined) this.verticalRatio = options.verticalRatio;
- // current time bar
- this.currentTime = new CurrentTime(this.body);
- this.components.push(this.currentTime);
+ if (options.animationInterval !== undefined) this.animationInterval = options.animationInterval;
+ if (options.animationPreload !== undefined) this.animationPreload = options.animationPreload;
+ if (options.animationAutoStart !== undefined)this.animationAutoStart = options.animationAutoStart;
- // custom time bar
- // Note: time bar will be attached in this.setOptions when selected
- this.customTime = new CustomTime(this.body);
- this.components.push(this.customTime);
+ if (options.xBarWidth !== undefined) this.defaultXBarWidth = options.xBarWidth;
+ if (options.yBarWidth !== undefined) this.defaultYBarWidth = options.yBarWidth;
- // item set
- this.linegraph = new LineGraph(this.body);
- this.components.push(this.linegraph);
+ if (options.xMin !== undefined) this.defaultXMin = options.xMin;
+ if (options.xStep !== undefined) this.defaultXStep = options.xStep;
+ if (options.xMax !== undefined) this.defaultXMax = options.xMax;
+ if (options.yMin !== undefined) this.defaultYMin = options.yMin;
+ if (options.yStep !== undefined) this.defaultYStep = options.yStep;
+ if (options.yMax !== undefined) this.defaultYMax = options.yMax;
+ if (options.zMin !== undefined) this.defaultZMin = options.zMin;
+ if (options.zStep !== undefined) this.defaultZStep = options.zStep;
+ if (options.zMax !== undefined) this.defaultZMax = options.zMax;
+ if (options.valueMin !== undefined) this.defaultValueMin = options.valueMin;
+ if (options.valueMax !== undefined) this.defaultValueMax = options.valueMax;
- this.itemsData = null; // DataSet
- this.groupsData = null; // DataSet
+ if (options.cameraPosition !== undefined) cameraPosition = options.cameraPosition;
- // apply options
- if (options) {
- this.setOptions(options);
+ if (cameraPosition !== undefined) {
+ this.camera.setArmRotation(cameraPosition.horizontal, cameraPosition.vertical);
+ this.camera.setArmLength(cameraPosition.distance);
+ }
+ else {
+ this.camera.setArmRotation(1.0, 0.5);
+ this.camera.setArmLength(1.7);
+ }
}
- // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!
- if (groups) {
- this.setGroups(groups);
- }
+ this._setBackgroundColor(options && options.backgroundColor);
- // create itemset
- if (items) {
- this.setItems(items);
- }
- else {
- this.redraw();
+ this.setSize(this.width, this.height);
+
+ // re-load the data
+ if (this.dataTable) {
+ this.setData(this.dataTable);
}
- }
- // turn Graph2d into an event emitter
- Emitter(Graph2d.prototype);
+ // start animation when option is true
+ if (this.animationAutoStart && this.dataFilter) {
+ this.animationStart();
+ }
+ };
/**
- * Create the main DOM for the Graph2d: a root panel containing left, right,
- * top, bottom, content, and background panel.
- * @param {Element} container The container element where the Graph2d will
- * be attached.
- * @private
+ * Redraw the Graph.
*/
- Graph2d.prototype._create = function (container) {
- this.dom = {};
-
- this.dom.root = document.createElement('div');
- this.dom.background = document.createElement('div');
- this.dom.backgroundVertical = document.createElement('div');
- this.dom.backgroundHorizontalContainer = document.createElement('div');
- this.dom.centerContainer = document.createElement('div');
- this.dom.leftContainer = document.createElement('div');
- this.dom.rightContainer = document.createElement('div');
- this.dom.backgroundHorizontal = document.createElement('div');
- this.dom.center = document.createElement('div');
- this.dom.left = document.createElement('div');
- this.dom.right = document.createElement('div');
- this.dom.top = document.createElement('div');
- this.dom.bottom = document.createElement('div');
- this.dom.shadowTop = document.createElement('div');
- this.dom.shadowBottom = document.createElement('div');
- this.dom.shadowTopLeft = document.createElement('div');
- this.dom.shadowBottomLeft = document.createElement('div');
- this.dom.shadowTopRight = document.createElement('div');
- this.dom.shadowBottomRight = document.createElement('div');
-
- this.dom.background.className = 'vispanel background';
- this.dom.backgroundVertical.className = 'vispanel background vertical';
- this.dom.backgroundHorizontalContainer.className = 'vispanel background horizontal';
- this.dom.backgroundHorizontal.className = 'vispanel background horizontal';
- this.dom.centerContainer.className = 'vispanel center';
- this.dom.leftContainer.className = 'vispanel left';
- this.dom.rightContainer.className = 'vispanel right';
- this.dom.top.className = 'vispanel top';
- this.dom.bottom.className = 'vispanel bottom';
- this.dom.left.className = 'content';
- this.dom.center.className = 'content';
- this.dom.right.className = 'content';
- this.dom.shadowTop.className = 'shadow top';
- this.dom.shadowBottom.className = 'shadow bottom';
- this.dom.shadowTopLeft.className = 'shadow top';
- this.dom.shadowBottomLeft.className = 'shadow bottom';
- this.dom.shadowTopRight.className = 'shadow top';
- this.dom.shadowBottomRight.className = 'shadow bottom';
-
- this.dom.root.appendChild(this.dom.background);
- this.dom.root.appendChild(this.dom.backgroundVertical);
- this.dom.root.appendChild(this.dom.backgroundHorizontalContainer);
- this.dom.root.appendChild(this.dom.centerContainer);
- this.dom.root.appendChild(this.dom.leftContainer);
- this.dom.root.appendChild(this.dom.rightContainer);
- this.dom.root.appendChild(this.dom.top);
- this.dom.root.appendChild(this.dom.bottom);
-
- this.dom.backgroundHorizontalContainer.appendChild(this.dom.backgroundHorizontal);
- this.dom.centerContainer.appendChild(this.dom.center);
- this.dom.leftContainer.appendChild(this.dom.left);
- this.dom.rightContainer.appendChild(this.dom.right);
-
- this.dom.centerContainer.appendChild(this.dom.shadowTop);
- this.dom.centerContainer.appendChild(this.dom.shadowBottom);
- this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);
- this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);
- this.dom.rightContainer.appendChild(this.dom.shadowTopRight);
- this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);
+ Graph3d.prototype.redraw = function() {
+ if (this.dataPoints === undefined) {
+ throw 'Error: graph data not initialized';
+ }
- this.on('rangechange', this.redraw.bind(this));
- this.on('change', this.redraw.bind(this));
- this.on('touch', this._onTouch.bind(this));
- this.on('pinch', this._onPinch.bind(this));
- this.on('dragstart', this._onDragStart.bind(this));
- this.on('drag', this._onDrag.bind(this));
+ this._resizeCanvas();
+ this._resizeCenter();
+ this._redrawSlider();
+ this._redrawClear();
+ this._redrawAxis();
- // create event listeners for all interesting events, these events will be
- // emitted via emitter
- this.hammer = Hammer(this.dom.root, {
- prevent_default: true
- });
- this.listeners = {};
+ if (this.style === Graph3d.STYLE.GRID ||
+ this.style === Graph3d.STYLE.SURFACE) {
+ this._redrawDataGrid();
+ }
+ else if (this.style === Graph3d.STYLE.LINE) {
+ this._redrawDataLine();
+ }
+ else if (this.style === Graph3d.STYLE.BAR ||
+ this.style === Graph3d.STYLE.BARCOLOR ||
+ this.style === Graph3d.STYLE.BARSIZE) {
+ this._redrawDataBar();
+ }
+ else {
+ // style is DOT, DOTLINE, DOTCOLOR, DOTSIZE
+ this._redrawDataDot();
+ }
- var me = this;
- var events = [
- 'touch', 'pinch',
- 'tap', 'doubletap', 'hold',
- 'dragstart', 'drag', 'dragend',
- 'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox
- ];
- events.forEach(function (event) {
- var listener = function () {
- var args = [event].concat(Array.prototype.slice.call(arguments, 0));
- me.emit.apply(me, args);
- };
- me.hammer.on(event, listener);
- me.listeners[event] = listener;
- });
+ this._redrawInfo();
+ this._redrawLegend();
+ };
- // size properties of each of the panels
- this.props = {
- root: {},
- background: {},
- centerContainer: {},
- leftContainer: {},
- rightContainer: {},
- center: {},
- left: {},
- right: {},
- top: {},
- bottom: {},
- border: {},
- scrollTop: 0,
- scrollTopMin: 0
- };
- this.touch = {}; // store state information needed for touch events
+ /**
+ * Clear the canvas before redrawing
+ */
+ Graph3d.prototype._redrawClear = function() {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
- // attach the root panel to the provided container
- if (!container) throw new Error('No container provided');
- container.appendChild(this.dom.root);
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
};
+
/**
- * Destroy the Graph2d, clean up all DOM elements and event listeners.
+ * Redraw the legend showing the colors
*/
- Graph2d.prototype.destroy = function () {
- // unbind datasets
- this.clear();
-
- // remove all event listeners
- this.off();
+ Graph3d.prototype._redrawLegend = function() {
+ var y;
- // stop checking for changed size
- this._stopAutoResize();
+ if (this.style === Graph3d.STYLE.DOTCOLOR ||
+ this.style === Graph3d.STYLE.DOTSIZE) {
- // remove from DOM
- if (this.dom.root.parentNode) {
- this.dom.root.parentNode.removeChild(this.dom.root);
- }
- this.dom = null;
+ var dotSize = this.frame.clientWidth * 0.02;
- // cleanup hammer touch events
- for (var event in this.listeners) {
- if (this.listeners.hasOwnProperty(event)) {
- delete this.listeners[event];
+ var widthMin, widthMax;
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ widthMin = dotSize / 2; // px
+ widthMax = dotSize / 2 + dotSize * 2; // Todo: put this in one function
+ }
+ else {
+ widthMin = 20; // px
+ widthMax = 20; // px
}
- }
- this.listeners = null;
- this.hammer = null;
- // give all components the opportunity to cleanup
- this.components.forEach(function (component) {
- component.destroy();
- });
+ var height = Math.max(this.frame.clientHeight * 0.25, 100);
+ var top = this.margin;
+ var right = this.frame.clientWidth - this.margin;
+ var left = right - widthMax;
+ var bottom = top + height;
+ }
- this.body = null;
- };
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ ctx.lineWidth = 1;
+ ctx.font = '14px arial'; // TODO: put in options
- /**
- * Set options. Options will be passed to all components loaded in the Graph2d.
- * @param {Object} [options]
- * {String} orientation
- * Vertical orientation for the Graph2d,
- * can be 'bottom' (default) or 'top'.
- * {String | Number} width
- * Width for the timeline, a number in pixels or
- * a css string like '1000px' or '75%'. '100%' by default.
- * {String | Number} height
- * Fixed height for the Graph2d, a number in pixels or
- * a css string like '400px' or '75%'. If undefined,
- * The Graph2d will automatically size such that
- * its contents fit.
- * {String | Number} minHeight
- * Minimum height for the Graph2d, a number in pixels or
- * a css string like '400px' or '75%'.
- * {String | Number} maxHeight
- * Maximum height for the Graph2d, a number in pixels or
- * a css string like '400px' or '75%'.
- * {Number | Date | String} start
- * Start date for the visible window
- * {Number | Date | String} end
- * End date for the visible window
- */
- Graph2d.prototype.setOptions = function (options) {
- if (options) {
- // copy the known options
- var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'orientation'];
- util.selectiveExtend(fields, this.options, options);
+ if (this.style === Graph3d.STYLE.DOTCOLOR) {
+ // draw the color bar
+ var ymin = 0;
+ var ymax = height; // Todo: make height customizable
+ for (y = ymin; y < ymax; y++) {
+ var f = (y - ymin) / (ymax - ymin);
- // enable/disable autoResize
- this._initAutoResize();
- }
+ //var width = (dotSize / 2 + (1-f) * dotSize * 2); // Todo: put this in one function
+ var hue = f * 240;
+ var color = this._hsv2rgb(hue, 1, 1);
- // propagate options to all components
- this.components.forEach(function (component) {
- component.setOptions(options);
- });
+ ctx.strokeStyle = color;
+ ctx.beginPath();
+ ctx.moveTo(left, top + y);
+ ctx.lineTo(right, top + y);
+ ctx.stroke();
+ }
- // TODO: remove deprecation error one day (deprecated since version 0.8.0)
- if (options && options.order) {
- throw new Error('Option order is deprecated. There is no replacement for this feature.');
+ ctx.strokeStyle = this.colorAxis;
+ ctx.strokeRect(left, top, widthMax, height);
}
- // redraw everything
- this.redraw();
- };
-
- /**
- * Set a custom time bar
- * @param {Date} time
- */
- Graph2d.prototype.setCustomTime = function (time) {
- if (!this.customTime) {
- throw new Error('Cannot get custom time: Custom time bar is not enabled');
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ // draw border around color bar
+ ctx.strokeStyle = this.colorAxis;
+ ctx.fillStyle = this.colorDot;
+ ctx.beginPath();
+ ctx.moveTo(left, top);
+ ctx.lineTo(right, top);
+ ctx.lineTo(right - widthMax + widthMin, bottom);
+ ctx.lineTo(left, bottom);
+ ctx.closePath();
+ ctx.fill();
+ ctx.stroke();
}
- this.customTime.setCustomTime(time);
- };
+ if (this.style === Graph3d.STYLE.DOTCOLOR ||
+ this.style === Graph3d.STYLE.DOTSIZE) {
+ // print values along the color bar
+ var gridLineLen = 5; // px
+ var step = new StepNumber(this.valueMin, this.valueMax, (this.valueMax-this.valueMin)/5, true);
+ step.start();
+ if (step.getCurrent() < this.valueMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ y = bottom - (step.getCurrent() - this.valueMin) / (this.valueMax - this.valueMin) * height;
- /**
- * Retrieve the current custom time.
- * @return {Date} customTime
- */
- Graph2d.prototype.getCustomTime = function() {
- if (!this.customTime) {
- throw new Error('Cannot get custom time: Custom time bar is not enabled');
- }
+ ctx.beginPath();
+ ctx.moveTo(left - gridLineLen, y);
+ ctx.lineTo(left, y);
+ ctx.stroke();
- return this.customTime.getCustomTime();
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.colorAxis;
+ ctx.fillText(step.getCurrent(), left - 2 * gridLineLen, y);
+
+ step.next();
+ }
+
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'top';
+ var label = this.legendLabel;
+ ctx.fillText(label, right, bottom + this.margin);
+ }
};
/**
- * Set items
- * @param {vis.DataSet | Array | google.visualization.DataTable | null} items
+ * Redraw the filter
*/
- Graph2d.prototype.setItems = function(items) {
- var initialLoad = (this.itemsData == null);
+ Graph3d.prototype._redrawFilter = function() {
+ this.frame.filter.innerHTML = '';
- // convert to type DataSet when needed
- var newDataSet;
- if (!items) {
- newDataSet = null;
- }
- else if (items instanceof DataSet || items instanceof DataView) {
- newDataSet = items;
- }
- else {
- // turn an array into a dataset
- newDataSet = new DataSet(items, {
- type: {
- start: 'Date',
- end: 'Date'
- }
- });
- }
+ if (this.dataFilter) {
+ var options = {
+ 'visible': this.showAnimationControls
+ };
+ var slider = new Slider(this.frame.filter, options);
+ this.frame.filter.slider = slider;
- // set items
- this.itemsData = newDataSet;
- this.linegraph && this.linegraph.setItems(newDataSet);
+ // TODO: css here is not nice here...
+ this.frame.filter.style.padding = '10px';
+ //this.frame.filter.style.backgroundColor = '#EFEFEF';
- if (initialLoad && ('start' in this.options || 'end' in this.options)) {
- this.fit();
+ slider.setValues(this.dataFilter.values);
+ slider.setPlayInterval(this.animationInterval);
- var start = ('start' in this.options) ? util.convert(this.options.start, 'Date') : null;
- var end = ('end' in this.options) ? util.convert(this.options.end, 'Date') : null;
+ // create an event handler
+ var me = this;
+ var onchange = function () {
+ var index = slider.getIndex();
- this.setWindow(start, end);
- }
- };
+ me.dataFilter.selectValue(index);
+ me.dataPoints = me.dataFilter._getDataPoints();
- /**
- * Set groups
- * @param {vis.DataSet | Array | google.visualization.DataTable} groups
- */
- Graph2d.prototype.setGroups = function(groups) {
- // convert to type DataSet when needed
- var newDataSet;
- if (!groups) {
- newDataSet = null;
- }
- else if (groups instanceof DataSet || groups instanceof DataView) {
- newDataSet = groups;
+ me.redraw();
+ };
+ slider.setOnChangeCallback(onchange);
}
else {
- // turn an array into a dataset
- newDataSet = new DataSet(groups);
+ this.frame.filter.slider = undefined;
}
-
- this.groupsData = newDataSet;
- this.linegraph.setGroups(newDataSet);
};
/**
- * Clear the Graph2d. By Default, items, groups and options are cleared.
- * Example usage:
- *
- * timeline.clear(); // clear items, groups, and options
- * timeline.clear({options: true}); // clear options only
- *
- * @param {Object} [what] Optionally specify what to clear. By default:
- * {items: true, groups: true, options: true}
+ * Redraw the slider
*/
- Graph2d.prototype.clear = function(what) {
- // clear items
- if (!what || what.items) {
- this.setItems(null);
- }
-
- // clear groups
- if (!what || what.groups) {
- this.setGroups(null);
- }
-
- // clear options of timeline and of each of the components
- if (!what || what.options) {
- this.components.forEach(function (component) {
- component.setOptions(component.defaultOptions);
- });
-
- this.setOptions(this.defaultOptions); // this will also do a redraw
+ Graph3d.prototype._redrawSlider = function() {
+ if ( this.frame.filter.slider !== undefined) {
+ this.frame.filter.slider.redraw();
}
};
+
/**
- * Set Graph2d window such that it fits all items
+ * Redraw common information
*/
- Graph2d.prototype.fit = function() {
- // apply the data range as range
- var dataRange = this.getItemRange();
+ Graph3d.prototype._redrawInfo = function() {
+ if (this.dataFilter) {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
- // add 5% space on both sides
- var start = dataRange.min;
- var end = dataRange.max;
- if (start != null && end != null) {
- var interval = (end.valueOf() - start.valueOf());
- if (interval <= 0) {
- // prevent an empty interval
- interval = 24 * 60 * 60 * 1000; // 1 day
- }
- start = new Date(start.valueOf() - interval * 0.05);
- end = new Date(end.valueOf() + interval * 0.05);
- }
+ ctx.font = '14px arial'; // TODO: put in options
+ ctx.lineStyle = 'gray';
+ ctx.fillStyle = 'gray';
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'top';
- // skip range set if there is no start and end date
- if (start === null && end === null) {
- return;
+ var x = this.margin;
+ var y = this.margin;
+ ctx.fillText(this.dataFilter.getLabel() + ': ' + this.dataFilter.getSelectedValue(), x, y);
}
-
- this.range.setRange(start, end);
};
+
/**
- * Get the data range of the item set.
- * @returns {{min: Date, max: Date}} range A range with a start and end Date.
- * When no minimum is found, min==null
- * When no maximum is found, max==null
+ * Redraw the axis
*/
- Graph2d.prototype.getItemRange = function() {
- // calculate min from start filed
- var itemsData = this.itemsData,
- min = null,
- max = null;
+ Graph3d.prototype._redrawAxis = function() {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ from, to, step, prettyStep,
+ text, xText, yText, zText,
+ offset, xOffset, yOffset,
+ xMin2d, xMax2d;
- if (itemsData) {
- // calculate the minimum value of the field 'start'
- var minItem = itemsData.min('start');
- min = minItem ? util.convert(minItem.start, 'Date').valueOf() : null;
- // Note: we convert first to Date and then to number because else
- // a conversion from ISODate to Number will fail
+ // TODO: get the actual rendered style of the containerElement
+ //ctx.font = this.containerElement.style.font;
+ ctx.font = 24 / this.camera.getArmLength() + 'px arial';
- // calculate maximum value of fields 'start' and 'end'
- var maxStartItem = itemsData.max('start');
- if (maxStartItem) {
- max = util.convert(maxStartItem.start, 'Date').valueOf();
- }
- var maxEndItem = itemsData.max('end');
- if (maxEndItem) {
- if (max == null) {
- max = util.convert(maxEndItem.end, 'Date').valueOf();
- }
- else {
- max = Math.max(max, util.convert(maxEndItem.end, 'Date').valueOf());
- }
- }
+ // calculate the length for the short grid lines
+ var gridLenX = 0.025 / this.scale.x;
+ var gridLenY = 0.025 / this.scale.y;
+ var textMargin = 5 / this.camera.getArmLength(); // px
+ var armAngle = this.camera.getArmRotation().horizontal;
+
+ // draw x-grid lines
+ ctx.lineWidth = 1;
+ prettyStep = (this.defaultXStep === undefined);
+ step = new StepNumber(this.xMin, this.xMax, this.xStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.xMin) {
+ step.next();
}
+ while (!step.end()) {
+ var x = step.getCurrent();
- return {
- min: (min != null) ? new Date(min) : null,
- max: (max != null) ? new Date(max) : null
- };
- };
-
- /**
- * Set the visible window. Both parameters are optional, you can change only
- * start or only end. Syntax:
- *
- * TimeLine.setWindow(start, end)
- * TimeLine.setWindow(range)
- *
- * Where start and end can be a Date, number, or string, and range is an
- * object with properties start and end.
- *
- * @param {Date | Number | String | Object} [start] Start date of visible window
- * @param {Date | Number | String} [end] End date of visible window
- */
- Graph2d.prototype.setWindow = function(start, end) {
- if (arguments.length == 1) {
- var range = arguments[0];
- this.range.setRange(range.start, range.end);
- }
- else {
- this.range.setRange(start, end);
- }
- };
-
- /**
- * Get the visible window
- * @return {{start: Date, end: Date}} Visible range
- */
- Graph2d.prototype.getWindow = function() {
- var range = this.range.getRange();
- return {
- start: new Date(range.start),
- end: new Date(range.end)
- };
- };
-
- /**
- * Force a redraw of the Graph2d. Can be useful to manually redraw when
- * option autoResize=false
- */
- Graph2d.prototype.redraw = function() {
- var resized = false,
- options = this.options,
- props = this.props,
- dom = this.dom;
-
- if (!dom) return; // when destroyed
+ if (this.showGrid) {
+ from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
+ ctx.strokeStyle = this.colorGrid;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
+ else {
+ from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMin+gridLenX, this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
- // update class names
- dom.root.className = 'vis timeline root ' + options.orientation;
+ from = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
+ to = this._convert3Dto2D(new Point3d(x, this.yMax-gridLenX, this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
- // update root width and height options
- dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');
- dom.root.style.minHeight = util.option.asSize(options.minHeight, '');
- dom.root.style.width = util.option.asSize(options.width, '');
+ yText = (Math.cos(armAngle) > 0) ? this.yMin : this.yMax;
+ text = this._convert3Dto2D(new Point3d(x, yText, this.zMin));
+ if (Math.cos(armAngle * 2) > 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ text.y += textMargin;
+ }
+ else if (Math.sin(armAngle * 2) < 0){
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ }
+ else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.colorAxis;
+ ctx.fillText(' ' + step.getCurrent() + ' ', text.x, text.y);
- // calculate border widths
- props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;
- props.border.right = props.border.left;
- props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2;
- props.border.bottom = props.border.top;
- var borderRootHeight= dom.root.offsetHeight - dom.root.clientHeight;
- var borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth;
+ step.next();
+ }
- // calculate the heights. If any of the side panels is empty, we set the height to
- // minus the border width, such that the border will be invisible
- props.center.height = dom.center.offsetHeight;
- props.left.height = dom.left.offsetHeight;
- props.right.height = dom.right.offsetHeight;
- props.top.height = dom.top.clientHeight || -props.border.top;
- props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;
+ // draw y-grid lines
+ ctx.lineWidth = 1;
+ prettyStep = (this.defaultYStep === undefined);
+ step = new StepNumber(this.yMin, this.yMax, this.yStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.yMin) {
+ step.next();
+ }
+ while (!step.end()) {
+ if (this.showGrid) {
+ from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.colorGrid;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
+ else {
+ from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMin+gridLenY, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
- // TODO: compensate borders when any of the panels is empty.
+ from = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax-gridLenY, step.getCurrent(), this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ }
- // apply auto height
- // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)
- var contentHeight = Math.max(props.left.height, props.center.height, props.right.height);
- var autoHeight = props.top.height + contentHeight + props.bottom.height +
- borderRootHeight + props.border.top + props.border.bottom;
- dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px');
+ xText = (Math.sin(armAngle ) > 0) ? this.xMin : this.xMax;
+ text = this._convert3Dto2D(new Point3d(xText, step.getCurrent(), this.zMin));
+ if (Math.cos(armAngle * 2) < 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ text.y += textMargin;
+ }
+ else if (Math.sin(armAngle * 2) > 0){
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ }
+ else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.colorAxis;
+ ctx.fillText(' ' + step.getCurrent() + ' ', text.x, text.y);
- // calculate heights of the content panels
- props.root.height = dom.root.offsetHeight;
- props.background.height = props.root.height - borderRootHeight;
- var containerHeight = props.root.height - props.top.height - props.bottom.height -
- borderRootHeight;
- props.centerContainer.height = containerHeight;
- props.leftContainer.height = containerHeight;
- props.rightContainer.height = props.leftContainer.height;
+ step.next();
+ }
- // calculate the widths of the panels
- props.root.width = dom.root.offsetWidth;
- props.background.width = props.root.width - borderRootWidth;
- props.left.width = dom.leftContainer.clientWidth || -props.border.left;
- props.leftContainer.width = props.left.width;
- props.right.width = dom.rightContainer.clientWidth || -props.border.right;
- props.rightContainer.width = props.right.width;
- var centerWidth = props.root.width - props.left.width - props.right.width - borderRootWidth;
- props.center.width = centerWidth;
- props.centerContainer.width = centerWidth;
- props.top.width = centerWidth;
- props.bottom.width = centerWidth;
+ // draw z-grid lines and axis
+ ctx.lineWidth = 1;
+ prettyStep = (this.defaultZStep === undefined);
+ step = new StepNumber(this.zMin, this.zMax, this.zStep, prettyStep);
+ step.start();
+ if (step.getCurrent() < this.zMin) {
+ step.next();
+ }
+ xText = (Math.cos(armAngle ) > 0) ? this.xMin : this.xMax;
+ yText = (Math.sin(armAngle ) < 0) ? this.yMin : this.yMax;
+ while (!step.end()) {
+ // TODO: make z-grid lines really 3d?
+ from = this._convert3Dto2D(new Point3d(xText, yText, step.getCurrent()));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(from.x - textMargin, from.y);
+ ctx.stroke();
- // resize the panels
- dom.background.style.height = props.background.height + 'px';
- dom.backgroundVertical.style.height = props.background.height + 'px';
- dom.backgroundHorizontalContainer.style.height = props.centerContainer.height + 'px';
- dom.centerContainer.style.height = props.centerContainer.height + 'px';
- dom.leftContainer.style.height = props.leftContainer.height + 'px';
- dom.rightContainer.style.height = props.rightContainer.height + 'px';
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.colorAxis;
+ ctx.fillText(step.getCurrent() + ' ', from.x - 5, from.y);
- dom.background.style.width = props.background.width + 'px';
- dom.backgroundVertical.style.width = props.centerContainer.width + 'px';
- dom.backgroundHorizontalContainer.style.width = props.background.width + 'px';
- dom.backgroundHorizontal.style.width = props.background.width + 'px';
- dom.centerContainer.style.width = props.center.width + 'px';
- dom.top.style.width = props.top.width + 'px';
- dom.bottom.style.width = props.bottom.width + 'px';
+ step.next();
+ }
+ ctx.lineWidth = 1;
+ from = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ to = this._convert3Dto2D(new Point3d(xText, yText, this.zMax));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
- // reposition the panels
- dom.background.style.left = '0';
- dom.background.style.top = '0';
- dom.backgroundVertical.style.left = props.left.width + 'px';
- dom.backgroundVertical.style.top = '0';
- dom.backgroundHorizontalContainer.style.left = '0';
- dom.backgroundHorizontalContainer.style.top = props.top.height + 'px';
- dom.centerContainer.style.left = props.left.width + 'px';
- dom.centerContainer.style.top = props.top.height + 'px';
- dom.leftContainer.style.left = '0';
- dom.leftContainer.style.top = props.top.height + 'px';
- dom.rightContainer.style.left = (props.left.width + props.center.width) + 'px';
- dom.rightContainer.style.top = props.top.height + 'px';
- dom.top.style.left = props.left.width + 'px';
- dom.top.style.top = '0';
- dom.bottom.style.left = props.left.width + 'px';
- dom.bottom.style.top = (props.top.height + props.centerContainer.height) + 'px';
+ // draw x-axis
+ ctx.lineWidth = 1;
+ // line at yMin
+ xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
+ xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(xMin2d.x, xMin2d.y);
+ ctx.lineTo(xMax2d.x, xMax2d.y);
+ ctx.stroke();
+ // line at ymax
+ xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
+ xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(xMin2d.x, xMin2d.y);
+ ctx.lineTo(xMax2d.x, xMax2d.y);
+ ctx.stroke();
- // update the scrollTop, feasible range for the offset can be changed
- // when the height of the Graph2d or of the contents of the center changed
- this._updateScrollTop();
+ // draw y-axis
+ ctx.lineWidth = 1;
+ // line at xMin
+ from = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
+ // line at xMax
+ from = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
+ to = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
+ ctx.strokeStyle = this.colorAxis;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(to.x, to.y);
+ ctx.stroke();
- // reposition the scrollable contents
- var offset = this.props.scrollTop;
- if (options.orientation == 'bottom') {
- offset += Math.max(this.props.centerContainer.height - this.props.center.height -
- this.props.border.top - this.props.border.bottom, 0);
+ // draw x-label
+ var xLabel = this.xLabel;
+ if (xLabel.length > 0) {
+ yOffset = 0.1 / this.scale.y;
+ xText = (this.xMin + this.xMax) / 2;
+ yText = (Math.cos(armAngle) > 0) ? this.yMin - yOffset: this.yMax + yOffset;
+ text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ if (Math.cos(armAngle * 2) > 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ }
+ else if (Math.sin(armAngle * 2) < 0){
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ }
+ else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.colorAxis;
+ ctx.fillText(xLabel, text.x, text.y);
}
- dom.center.style.left = '0';
- dom.center.style.top = offset + 'px';
- dom.backgroundHorizontal.style.left = '0';
- dom.backgroundHorizontal.style.top = offset + 'px';
- dom.left.style.left = '0';
- dom.left.style.top = offset + 'px';
- dom.right.style.left = '0';
- dom.right.style.top = offset + 'px';
- // show shadows when vertical scrolling is available
- var visibilityTop = this.props.scrollTop == 0 ? 'hidden' : '';
- var visibilityBottom = this.props.scrollTop == this.props.scrollTopMin ? 'hidden' : '';
- dom.shadowTop.style.visibility = visibilityTop;
- dom.shadowBottom.style.visibility = visibilityBottom;
- dom.shadowTopLeft.style.visibility = visibilityTop;
- dom.shadowBottomLeft.style.visibility = visibilityBottom;
- dom.shadowTopRight.style.visibility = visibilityTop;
- dom.shadowBottomRight.style.visibility = visibilityBottom;
+ // draw y-label
+ var yLabel = this.yLabel;
+ if (yLabel.length > 0) {
+ xOffset = 0.1 / this.scale.x;
+ xText = (Math.sin(armAngle ) > 0) ? this.xMin - xOffset : this.xMax + xOffset;
+ yText = (this.yMin + this.yMax) / 2;
+ text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
+ if (Math.cos(armAngle * 2) < 0) {
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ }
+ else if (Math.sin(armAngle * 2) > 0){
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ }
+ else {
+ ctx.textAlign = 'left';
+ ctx.textBaseline = 'middle';
+ }
+ ctx.fillStyle = this.colorAxis;
+ ctx.fillText(yLabel, text.x, text.y);
+ }
- // redraw all components
- this.components.forEach(function (component) {
- resized = component.redraw() || resized;
- });
- if (resized) {
- // keep redrawing until all sizes are settled
- this.redraw();
+ // draw z-label
+ var zLabel = this.zLabel;
+ if (zLabel.length > 0) {
+ offset = 30; // pixels. // TODO: relate to the max width of the values on the z axis?
+ xText = (Math.cos(armAngle ) > 0) ? this.xMin : this.xMax;
+ yText = (Math.sin(armAngle ) < 0) ? this.yMin : this.yMax;
+ zText = (this.zMin + this.zMax) / 2;
+ text = this._convert3Dto2D(new Point3d(xText, yText, zText));
+ ctx.textAlign = 'right';
+ ctx.textBaseline = 'middle';
+ ctx.fillStyle = this.colorAxis;
+ ctx.fillText(zLabel, text.x - offset, text.y);
}
};
/**
- * Convert a position on screen (pixels) to a datetime
- * @param {int} x Position on the screen in pixels
- * @return {Date} time The datetime the corresponds with given position x
- * @private
+ * Calculate the color based on the given value.
+ * @param {Number} H Hue, a value be between 0 and 360
+ * @param {Number} S Saturation, a value between 0 and 1
+ * @param {Number} V Value, a value between 0 and 1
*/
- // TODO: move this function to Range
- Graph2d.prototype._toTime = function(x) {
- var conversion = this.range.conversion(this.props.center.width);
- return new Date(x / conversion.scale + conversion.offset);
- };
+ Graph3d.prototype._hsv2rgb = function(H, S, V) {
+ var R, G, B, C, Hi, X;
- /**
- * Convert a datetime (Date object) into a position on the root
- * This is used to get the pixel density estimate for the screen, not the center panel
- * @param {Date} time A date
- * @return {int} x The position on root in pixels which corresponds
- * with the given date.
- * @private
- */
- // TODO: move this function to Range
- Graph2d.prototype._toGlobalTime = function(x) {
- var conversion = this.range.conversion(this.props.root.width);
- return new Date(x / conversion.scale + conversion.offset);
- };
+ C = V * S;
+ Hi = Math.floor(H/60); // hi = 0,1,2,3,4,5
+ X = C * (1 - Math.abs(((H/60) % 2) - 1));
- /**
- * Convert a datetime (Date object) into a position on the screen
- * @param {Date} time A date
- * @return {int} x The position on the screen in pixels which corresponds
- * with the given date.
- * @private
- */
- // TODO: move this function to Range
- Graph2d.prototype._toScreen = function(time) {
- var conversion = this.range.conversion(this.props.center.width);
- return (time.valueOf() - conversion.offset) * conversion.scale;
- };
+ switch (Hi) {
+ case 0: R = C; G = X; B = 0; break;
+ case 1: R = X; G = C; B = 0; break;
+ case 2: R = 0; G = C; B = X; break;
+ case 3: R = 0; G = X; B = C; break;
+ case 4: R = X; G = 0; B = C; break;
+ case 5: R = C; G = 0; B = X; break;
+ default: R = 0; G = 0; B = 0; break;
+ }
- /**
- * Convert a datetime (Date object) into a position on the root
- * This is used to get the pixel density estimate for the screen, not the center panel
- * @param {Date} time A date
- * @return {int} x The position on root in pixels which corresponds
- * with the given date.
- * @private
- */
- // TODO: move this function to Range
- Graph2d.prototype._toGlobalScreen = function(time) {
- var conversion = this.range.conversion(this.props.root.width);
- return (time.valueOf() - conversion.offset) * conversion.scale;
+ return 'RGB(' + parseInt(R*255) + ',' + parseInt(G*255) + ',' + parseInt(B*255) + ')';
};
- /**
- * Initialize watching when option autoResize is true
- * @private
- */
- Graph2d.prototype._initAutoResize = function () {
- if (this.options.autoResize == true) {
- this._startAutoResize();
- }
- else {
- this._stopAutoResize();
- }
- };
/**
- * Watch for changes in the size of the container. On resize, the Panel will
- * automatically redraw itself.
- * @private
+ * Draw all datapoints as a grid
+ * This function can be used when the style is 'grid'
*/
- Graph2d.prototype._startAutoResize = function () {
- var me = this;
+ Graph3d.prototype._redrawDataGrid = function() {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ point, right, top, cross,
+ i,
+ topSideVisible, fillStyle, strokeStyle, lineWidth,
+ h, s, v, zAvg;
- this._stopAutoResize();
- this._onResize = function() {
- if (me.options.autoResize != true) {
- // stop watching when the option autoResize is changed to false
- me._stopAutoResize();
- return;
- }
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0)
+ return; // TODO: throw exception?
- if (me.dom.root) {
- // check whether the frame is resized
- if ((me.dom.root.clientWidth != me.props.lastWidth) ||
- (me.dom.root.clientHeight != me.props.lastHeight)) {
- me.props.lastWidth = me.dom.root.clientWidth;
- me.props.lastHeight = me.dom.root.clientHeight;
+ // calculate the translations and screen position of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
- me.emit('change');
- }
- }
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
+
+ // calculate the translation of the point at the bottom (needed for sorting)
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
+
+ // sort the points on depth of their (x,y) position (not on z)
+ var sortDepth = function (a, b) {
+ return b.dist - a.dist;
};
+ this.dataPoints.sort(sortDepth);
- // add event listener to window resize
- util.addEventListener(window, 'resize', this._onResize);
+ if (this.style === Graph3d.STYLE.SURFACE) {
+ for (i = 0; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ right = this.dataPoints[i].pointRight;
+ top = this.dataPoints[i].pointTop;
+ cross = this.dataPoints[i].pointCross;
- this.watchTimer = setInterval(this._onResize, 1000);
- };
+ if (point !== undefined && right !== undefined && top !== undefined && cross !== undefined) {
- /**
- * Stop watching for a resize of the frame.
- * @private
- */
- Graph2d.prototype._stopAutoResize = function () {
- if (this.watchTimer) {
- clearInterval(this.watchTimer);
- this.watchTimer = undefined;
+ if (this.showGrayBottom || this.showShadow) {
+ // calculate the cross product of the two vectors from center
+ // to left and right, in order to know whether we are looking at the
+ // bottom or at the top side. We can also use the cross product
+ // for calculating light intensity
+ var aDiff = Point3d.subtract(cross.trans, point.trans);
+ var bDiff = Point3d.subtract(top.trans, right.trans);
+ var crossproduct = Point3d.crossProduct(aDiff, bDiff);
+ var len = crossproduct.length();
+ // FIXME: there is a bug with determining the surface side (shadow or colored)
+
+ topSideVisible = (crossproduct.z > 0);
+ }
+ else {
+ topSideVisible = true;
+ }
+
+ if (topSideVisible) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + right.point.z + top.point.z + cross.point.z) / 4;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ s = 1; // saturation
+
+ if (this.showShadow) {
+ v = Math.min(1 + (crossproduct.x / len) / 2, 1); // value. TODO: scale
+ fillStyle = this._hsv2rgb(h, s, v);
+ strokeStyle = fillStyle;
+ }
+ else {
+ v = 1;
+ fillStyle = this._hsv2rgb(h, s, v);
+ strokeStyle = this.colorAxis;
+ }
+ }
+ else {
+ fillStyle = 'gray';
+ strokeStyle = this.colorAxis;
+ }
+ lineWidth = 0.5;
+
+ ctx.lineWidth = lineWidth;
+ ctx.fillStyle = fillStyle;
+ ctx.strokeStyle = strokeStyle;
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(right.screen.x, right.screen.y);
+ ctx.lineTo(cross.screen.x, cross.screen.y);
+ ctx.lineTo(top.screen.x, top.screen.y);
+ ctx.closePath();
+ ctx.fill();
+ ctx.stroke();
+ }
+ }
}
+ else { // grid style
+ for (i = 0; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ right = this.dataPoints[i].pointRight;
+ top = this.dataPoints[i].pointTop;
- // remove event listener on window.resize
- util.removeEventListener(window, 'resize', this._onResize);
- this._onResize = null;
- };
+ if (point !== undefined) {
+ if (this.showPerspective) {
+ lineWidth = 2 / -point.trans.z;
+ }
+ else {
+ lineWidth = 2 * -(this.eye.z / this.camera.getArmLength());
+ }
+ }
- /**
- * Start moving the timeline vertically
- * @param {Event} event
- * @private
- */
- Graph2d.prototype._onTouch = function (event) {
- this.touch.allowDragging = true;
- };
+ if (point !== undefined && right !== undefined) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + right.point.z) / 2;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
- /**
- * Start moving the timeline vertically
- * @param {Event} event
- * @private
- */
- Graph2d.prototype._onPinch = function (event) {
- this.touch.allowDragging = false;
+ ctx.lineWidth = lineWidth;
+ ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(right.screen.x, right.screen.y);
+ ctx.stroke();
+ }
+
+ if (point !== undefined && top !== undefined) {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ zAvg = (point.point.z + top.point.z) / 2;
+ h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+
+ ctx.lineWidth = lineWidth;
+ ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
+ ctx.lineTo(top.screen.x, top.screen.y);
+ ctx.stroke();
+ }
+ }
+ }
};
- /**
- * Start moving the timeline vertically
- * @param {Event} event
- * @private
- */
- Graph2d.prototype._onDragStart = function (event) {
- this.touch.initialScrollTop = this.props.scrollTop;
- };
/**
- * Move the timeline vertically
- * @param {Event} event
- * @private
+ * Draw all datapoints as dots.
+ * This function can be used when the style is 'dot' or 'dot-line'
*/
- Graph2d.prototype._onDrag = function (event) {
- // refuse to drag when we where pinching to prevent the timeline make a jump
- // when releasing the fingers in opposite order from the touch screen
- if (!this.touch.allowDragging) return;
+ Graph3d.prototype._redrawDataDot = function() {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ var i;
- var delta = event.gesture.deltaY;
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0)
+ return; // TODO: throw exception?
- var oldScrollTop = this._getScrollTop();
- var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
- if (newScrollTop != oldScrollTop) {
- this.redraw(); // TODO: this causes two redraws when dragging, the other is triggered by rangechange already
+ // calculate the distance from the point at the bottom to the camera
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
}
- };
- /**
- * Apply a scrollTop
- * @param {Number} scrollTop
- * @returns {Number} scrollTop Returns the applied scrollTop
- * @private
- */
- Graph2d.prototype._setScrollTop = function (scrollTop) {
- this.props.scrollTop = scrollTop;
- this._updateScrollTop();
- return this.props.scrollTop;
- };
+ // order the translated points by depth
+ var sortDepth = function (a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
- /**
- * Update the current scrollTop when the height of the containers has been changed
- * @returns {Number} scrollTop Returns the applied scrollTop
- * @private
- */
- Graph2d.prototype._updateScrollTop = function () {
- // recalculate the scrollTopMin
- var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
- if (scrollTopMin != this.props.scrollTopMin) {
- // in case of bottom orientation, change the scrollTop such that the contents
- // do not move relative to the time axis at the bottom
- if (this.options.orientation == 'bottom') {
- this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin);
+ // draw the datapoints as colored circles
+ var dotSize = this.frame.clientWidth * 0.02; // px
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var point = this.dataPoints[i];
+
+ if (this.style === Graph3d.STYLE.DOTLINE) {
+ // draw a vertical line from the bottom to the graph value
+ //var from = this._convert3Dto2D(new Point3d(point.point.x, point.point.y, this.zMin));
+ var from = this._convert3Dto2D(point.bottom);
+ ctx.lineWidth = 1;
+ ctx.strokeStyle = this.colorGrid;
+ ctx.beginPath();
+ ctx.moveTo(from.x, from.y);
+ ctx.lineTo(point.screen.x, point.screen.y);
+ ctx.stroke();
}
- this.props.scrollTopMin = scrollTopMin;
- }
- // limit the scrollTop to the feasible scroll range
- if (this.props.scrollTop > 0) this.props.scrollTop = 0;
- if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;
+ // calculate radius for the circle
+ var size;
+ if (this.style === Graph3d.STYLE.DOTSIZE) {
+ size = dotSize/2 + 2*dotSize * (point.point.value - this.valueMin) / (this.valueMax - this.valueMin);
+ }
+ else {
+ size = dotSize;
+ }
- return this.props.scrollTop;
+ var radius;
+ if (this.showPerspective) {
+ radius = size / -point.trans.z;
+ }
+ else {
+ radius = size * -(this.eye.z / this.camera.getArmLength());
+ }
+ if (radius < 0) {
+ radius = 0;
+ }
+
+ var hue, color, borderColor;
+ if (this.style === Graph3d.STYLE.DOTCOLOR ) {
+ // calculate the color based on the value
+ hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
+ else if (this.style === Graph3d.STYLE.DOTSIZE) {
+ color = this.colorDot;
+ borderColor = this.colorDotBorder;
+ }
+ else {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
+
+ // draw the circle
+ ctx.lineWidth = 1.0;
+ ctx.strokeStyle = borderColor;
+ ctx.fillStyle = color;
+ ctx.beginPath();
+ ctx.arc(point.screen.x, point.screen.y, radius, 0, Math.PI*2, true);
+ ctx.fill();
+ ctx.stroke();
+ }
};
/**
- * Get the current scrollTop
- * @returns {number} scrollTop
- * @private
+ * Draw all datapoints as bars.
+ * This function can be used when the style is 'bar', 'bar-color', or 'bar-size'
*/
- Graph2d.prototype._getScrollTop = function () {
- return this.props.scrollTop;
- };
-
- module.exports = Graph2d;
+ Graph3d.prototype._redrawDataBar = function() {
+ var canvas = this.frame.canvas;
+ var ctx = canvas.getContext('2d');
+ var i, j, surface, corners;
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0)
+ return; // TODO: throw exception?
-/***/ },
-/* 8 */
-/***/ function(module, exports, __webpack_require__) {
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
- var util = __webpack_require__(1);
- var moment = __webpack_require__(39);
- var Component = __webpack_require__(12);
+ // calculate the distance from the point at the bottom to the camera
+ var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
+ this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ }
- /**
- * @constructor Range
- * A Range controls a numeric range with a start and end value.
- * The Range adjusts the range based on mouse events or programmatic changes,
- * and triggers events when the range is changing or has been changed.
- * @param {{dom: Object, domProps: Object, emitter: Emitter}} body
- * @param {Object} [options] See description at Range.setOptions
- */
- function Range(body, options) {
- var now = moment().hours(0).minutes(0).seconds(0).milliseconds(0);
- this.start = now.clone().add('days', -3).valueOf(); // Number
- this.end = now.clone().add('days', 4).valueOf(); // Number
+ // order the translated points by depth
+ var sortDepth = function (a, b) {
+ return b.dist - a.dist;
+ };
+ this.dataPoints.sort(sortDepth);
- this.body = body;
+ // draw the datapoints as bars
+ var xWidth = this.xBarWidth / 2;
+ var yWidth = this.yBarWidth / 2;
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var point = this.dataPoints[i];
- // default options
- this.defaultOptions = {
- start: null,
- end: null,
- direction: 'horizontal', // 'horizontal' or 'vertical'
- moveable: true,
- zoomable: true,
- min: null,
- max: null,
- zoomMin: 10, // milliseconds
- zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000 // milliseconds
- };
- this.options = util.extend({}, this.defaultOptions);
+ // determine color
+ var hue, color, borderColor;
+ if (this.style === Graph3d.STYLE.BARCOLOR ) {
+ // calculate the color based on the value
+ hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
+ else if (this.style === Graph3d.STYLE.BARSIZE) {
+ color = this.colorDot;
+ borderColor = this.colorDotBorder;
+ }
+ else {
+ // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
+ hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ color = this._hsv2rgb(hue, 1, 1);
+ borderColor = this._hsv2rgb(hue, 1, 0.8);
+ }
- this.props = {
- touch: {}
- };
+ // calculate size for the bar
+ if (this.style === Graph3d.STYLE.BARSIZE) {
+ xWidth = (this.xBarWidth / 2) * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
+ yWidth = (this.yBarWidth / 2) * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
+ }
- // drag listeners for dragging
- this.body.emitter.on('dragstart', this._onDragStart.bind(this));
- this.body.emitter.on('drag', this._onDrag.bind(this));
- this.body.emitter.on('dragend', this._onDragEnd.bind(this));
+ // calculate all corner points
+ var me = this;
+ var point3d = point.point;
+ var top = [
+ {point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, point3d.z)},
+ {point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, point3d.z)},
+ {point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, point3d.z)},
+ {point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, point3d.z)}
+ ];
+ var bottom = [
+ {point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, this.zMin)},
+ {point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, this.zMin)},
+ {point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, this.zMin)},
+ {point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, this.zMin)}
+ ];
- // ignore dragging when holding
- this.body.emitter.on('hold', this._onHold.bind(this));
+ // calculate screen location of the points
+ top.forEach(function (obj) {
+ obj.screen = me._convert3Dto2D(obj.point);
+ });
+ bottom.forEach(function (obj) {
+ obj.screen = me._convert3Dto2D(obj.point);
+ });
- // mouse wheel for zooming
- this.body.emitter.on('mousewheel', this._onMouseWheel.bind(this));
- this.body.emitter.on('DOMMouseScroll', this._onMouseWheel.bind(this)); // For FF
+ // create five sides, calculate both corner points and center points
+ var surfaces = [
+ {corners: top, center: Point3d.avg(bottom[0].point, bottom[2].point)},
+ {corners: [top[0], top[1], bottom[1], bottom[0]], center: Point3d.avg(bottom[1].point, bottom[0].point)},
+ {corners: [top[1], top[2], bottom[2], bottom[1]], center: Point3d.avg(bottom[2].point, bottom[1].point)},
+ {corners: [top[2], top[3], bottom[3], bottom[2]], center: Point3d.avg(bottom[3].point, bottom[2].point)},
+ {corners: [top[3], top[0], bottom[0], bottom[3]], center: Point3d.avg(bottom[0].point, bottom[3].point)}
+ ];
+ point.surfaces = surfaces;
- // pinch to zoom
- this.body.emitter.on('touch', this._onTouch.bind(this));
- this.body.emitter.on('pinch', this._onPinch.bind(this));
+ // calculate the distance of each of the surface centers to the camera
+ for (j = 0; j < surfaces.length; j++) {
+ surface = surfaces[j];
+ var transCenter = this._convertPointToTranslation(surface.center);
+ surface.dist = this.showPerspective ? transCenter.length() : -transCenter.z;
+ // TODO: this dept calculation doesn't work 100% of the cases due to perspective,
+ // but the current solution is fast/simple and works in 99.9% of all cases
+ // the issue is visible in example 14, with graph.setCameraPosition({horizontal: 2.97, vertical: 0.5, distance: 0.9})
+ }
- this.setOptions(options);
- }
+ // order the surfaces by their (translated) depth
+ surfaces.sort(function (a, b) {
+ var diff = b.dist - a.dist;
+ if (diff) return diff;
- Range.prototype = new Component();
+ // if equal depth, sort the top surface last
+ if (a.corners === top) return 1;
+ if (b.corners === top) return -1;
- /**
- * Set options for the range controller
- * @param {Object} options Available options:
- * {Number | Date | String} start Start date for the range
- * {Number | Date | String} end End date for the range
- * {Number} min Minimum value for start
- * {Number} max Maximum value for end
- * {Number} zoomMin Set a minimum value for
- * (end - start).
- * {Number} zoomMax Set a maximum value for
- * (end - start).
- * {Boolean} moveable Enable moving of the range
- * by dragging. True by default
- * {Boolean} zoomable Enable zooming of the range
- * by pinching/scrolling. True by default
- */
- Range.prototype.setOptions = function (options) {
- if (options) {
- // copy the options that we know
- var fields = ['direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable'];
- util.selectiveExtend(fields, this.options, options);
+ // both are equal
+ return 0;
+ });
- if ('start' in options || 'end' in options) {
- // apply a new range. both start and end are optional
- this.setRange(options.start, options.end);
+ // draw the ordered surfaces
+ ctx.lineWidth = 1;
+ ctx.strokeStyle = borderColor;
+ ctx.fillStyle = color;
+ // NOTE: we start at j=2 instead of j=0 as we don't need to draw the two surfaces at the backside
+ for (j = 2; j < surfaces.length; j++) {
+ surface = surfaces[j];
+ corners = surface.corners;
+ ctx.beginPath();
+ ctx.moveTo(corners[3].screen.x, corners[3].screen.y);
+ ctx.lineTo(corners[0].screen.x, corners[0].screen.y);
+ ctx.lineTo(corners[1].screen.x, corners[1].screen.y);
+ ctx.lineTo(corners[2].screen.x, corners[2].screen.y);
+ ctx.lineTo(corners[3].screen.x, corners[3].screen.y);
+ ctx.fill();
+ ctx.stroke();
}
}
};
- /**
- * Test whether direction has a valid value
- * @param {String} direction 'horizontal' or 'vertical'
- */
- function validateDirection (direction) {
- if (direction != 'horizontal' && direction != 'vertical') {
- throw new TypeError('Unknown direction "' + direction + '". ' +
- 'Choose "horizontal" or "vertical".');
- }
- }
/**
- * Set a new start and end range
- * @param {Number} [start]
- * @param {Number} [end]
+ * Draw a line through all datapoints.
+ * This function can be used when the style is 'line'
*/
- Range.prototype.setRange = function(start, end) {
- var changed = this._applyRange(start, end);
- if (changed) {
- var params = {
- start: new Date(this.start),
- end: new Date(this.end)
- };
- this.body.emitter.emit('rangechange', params);
- this.body.emitter.emit('rangechanged', params);
- }
- };
+ Graph3d.prototype._redrawDataLine = function() {
+ var canvas = this.frame.canvas,
+ ctx = canvas.getContext('2d'),
+ point, i;
- /**
- * Set a new start and end range. This method is the same as setRange, but
- * does not trigger a range change and range changed event, and it returns
- * true when the range is changed
- * @param {Number} [start]
- * @param {Number} [end]
- * @return {Boolean} changed
- * @private
- */
- Range.prototype._applyRange = function(start, end) {
- var newStart = (start != null) ? util.convert(start, 'Date').valueOf() : this.start,
- newEnd = (end != null) ? util.convert(end, 'Date').valueOf() : this.end,
- max = (this.options.max != null) ? util.convert(this.options.max, 'Date').valueOf() : null,
- min = (this.options.min != null) ? util.convert(this.options.min, 'Date').valueOf() : null,
- diff;
+ if (this.dataPoints === undefined || this.dataPoints.length <= 0)
+ return; // TODO: throw exception?
- // check for valid number
- if (isNaN(newStart) || newStart === null) {
- throw new Error('Invalid start "' + start + '"');
- }
- if (isNaN(newEnd) || newEnd === null) {
- throw new Error('Invalid end "' + end + '"');
- }
+ // calculate the translations of all points
+ for (i = 0; i < this.dataPoints.length; i++) {
+ var trans = this._convertPointToTranslation(this.dataPoints[i].point);
+ var screen = this._convertTranslationToScreen(trans);
- // prevent start < end
- if (newEnd < newStart) {
- newEnd = newStart;
+ this.dataPoints[i].trans = trans;
+ this.dataPoints[i].screen = screen;
}
- // prevent start < min
- if (min !== null) {
- if (newStart < min) {
- diff = (min - newStart);
- newStart += diff;
- newEnd += diff;
+ // start the line
+ if (this.dataPoints.length > 0) {
+ point = this.dataPoints[0];
- // prevent end > max
- if (max != null) {
- if (newEnd > max) {
- newEnd = max;
- }
- }
- }
+ ctx.lineWidth = 1; // TODO: make customizable
+ ctx.strokeStyle = 'blue'; // TODO: make customizable
+ ctx.beginPath();
+ ctx.moveTo(point.screen.x, point.screen.y);
}
- // prevent end > max
- if (max !== null) {
- if (newEnd > max) {
- diff = (newEnd - max);
- newStart -= diff;
- newEnd -= diff;
-
- // prevent start < min
- if (min != null) {
- if (newStart < min) {
- newStart = min;
- }
- }
- }
+ // draw the datapoints as colored circles
+ for (i = 1; i < this.dataPoints.length; i++) {
+ point = this.dataPoints[i];
+ ctx.lineTo(point.screen.x, point.screen.y);
}
- // prevent (end-start) < zoomMin
- if (this.options.zoomMin !== null) {
- var zoomMin = parseFloat(this.options.zoomMin);
- if (zoomMin < 0) {
- zoomMin = 0;
- }
- if ((newEnd - newStart) < zoomMin) {
- if ((this.end - this.start) === zoomMin) {
- // ignore this action, we are already zoomed to the minimum
- newStart = this.start;
- newEnd = this.end;
- }
- else {
- // zoom to the minimum
- diff = (zoomMin - (newEnd - newStart));
- newStart -= diff / 2;
- newEnd += diff / 2;
- }
- }
+ // finish the line
+ if (this.dataPoints.length > 0) {
+ ctx.stroke();
}
+ };
- // prevent (end-start) > zoomMax
- if (this.options.zoomMax !== null) {
- var zoomMax = parseFloat(this.options.zoomMax);
- if (zoomMax < 0) {
- zoomMax = 0;
- }
- if ((newEnd - newStart) > zoomMax) {
- if ((this.end - this.start) === zoomMax) {
- // ignore this action, we are already zoomed to the maximum
- newStart = this.start;
- newEnd = this.end;
- }
- else {
- // zoom to the maximum
- diff = ((newEnd - newStart) - zoomMax);
- newStart += diff / 2;
- newEnd -= diff / 2;
- }
- }
+ /**
+ * Start a moving operation inside the provided parent element
+ * @param {Event} event The event that occurred (required for
+ * retrieving the mouse position)
+ */
+ Graph3d.prototype._onMouseDown = function(event) {
+ event = event || window.event;
+
+ // check if mouse is still down (may be up when focus is lost for example
+ // in an iframe)
+ if (this.leftButtonDown) {
+ this._onMouseUp(event);
}
- var changed = (this.start != newStart || this.end != newEnd);
+ // only react on left mouse button down
+ this.leftButtonDown = event.which ? (event.which === 1) : (event.button === 1);
+ if (!this.leftButtonDown && !this.touchDown) return;
- this.start = newStart;
- this.end = newEnd;
+ // get mouse position (different code for IE and all other browsers)
+ this.startMouseX = getMouseX(event);
+ this.startMouseY = getMouseY(event);
- return changed;
+ this.startStart = new Date(this.start);
+ this.startEnd = new Date(this.end);
+ this.startArmRotation = this.camera.getArmRotation();
+
+ this.frame.style.cursor = 'move';
+
+ // add event listeners to handle moving the contents
+ // we store the function onmousemove and onmouseup in the graph, so we can
+ // remove the eventlisteners lateron in the function mouseUp()
+ var me = this;
+ this.onmousemove = function (event) {me._onMouseMove(event);};
+ this.onmouseup = function (event) {me._onMouseUp(event);};
+ G3DaddEventListener(document, 'mousemove', me.onmousemove);
+ G3DaddEventListener(document, 'mouseup', me.onmouseup);
+ G3DpreventDefault(event);
};
- /**
- * Retrieve the current range.
- * @return {Object} An object with start and end properties
- */
- Range.prototype.getRange = function() {
- return {
- start: this.start,
- end: this.end
- };
- };
/**
- * Calculate the conversion offset and scale for current range, based on
- * the provided width
- * @param {Number} width
- * @returns {{offset: number, scale: number}} conversion
+ * Perform moving operating.
+ * This function activated from within the funcion Graph.mouseDown().
+ * @param {Event} event Well, eehh, the event
*/
- Range.prototype.conversion = function (width) {
- return Range.conversion(this.start, this.end, width);
- };
+ Graph3d.prototype._onMouseMove = function (event) {
+ event = event || window.event;
- /**
- * Static method to calculate the conversion offset and scale for a range,
- * based on the provided start, end, and width
- * @param {Number} start
- * @param {Number} end
- * @param {Number} width
- * @returns {{offset: number, scale: number}} conversion
- */
- Range.conversion = function (start, end, width) {
- if (width != 0 && (end - start != 0)) {
- return {
- offset: start,
- scale: width / (end - start)
- }
+ // calculate change in mouse position
+ var diffX = parseFloat(getMouseX(event)) - this.startMouseX;
+ var diffY = parseFloat(getMouseY(event)) - this.startMouseY;
+
+ var horizontalNew = this.startArmRotation.horizontal + diffX / 200;
+ var verticalNew = this.startArmRotation.vertical + diffY / 200;
+
+ var snapAngle = 4; // degrees
+ var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI);
+
+ // snap horizontally to nice angles at 0pi, 0.5pi, 1pi, 1.5pi, etc...
+ // the -0.001 is to take care that the vertical axis is always drawn at the left front corner
+ if (Math.abs(Math.sin(horizontalNew)) < snapValue) {
+ horizontalNew = Math.round((horizontalNew / Math.PI)) * Math.PI - 0.001;
}
- else {
- return {
- offset: 0,
- scale: 1
- };
+ if (Math.abs(Math.cos(horizontalNew)) < snapValue) {
+ horizontalNew = (Math.round((horizontalNew/ Math.PI - 0.5)) + 0.5) * Math.PI - 0.001;
}
- };
- /**
- * Start dragging horizontally or vertically
- * @param {Event} event
- * @private
- */
- Range.prototype._onDragStart = function(event) {
- // only allow dragging when configured as movable
- if (!this.options.moveable) return;
+ // snap vertically to nice angles
+ if (Math.abs(Math.sin(verticalNew)) < snapValue) {
+ verticalNew = Math.round((verticalNew / Math.PI)) * Math.PI;
+ }
+ if (Math.abs(Math.cos(verticalNew)) < snapValue) {
+ verticalNew = (Math.round((verticalNew/ Math.PI - 0.5)) + 0.5) * Math.PI;
+ }
- // refuse to drag when we where pinching to prevent the timeline make a jump
- // when releasing the fingers in opposite order from the touch screen
- if (!this.props.touch.allowDragging) return;
+ this.camera.setArmRotation(horizontalNew, verticalNew);
+ this.redraw();
- this.props.touch.start = this.start;
- this.props.touch.end = this.end;
+ // fire a cameraPositionChange event
+ var parameters = this.getCameraPosition();
+ this.emit('cameraPositionChange', parameters);
- if (this.body.dom.root) {
- this.body.dom.root.style.cursor = 'move';
- }
+ G3DpreventDefault(event);
};
- /**
- * Perform dragging operation
- * @param {Event} event
- * @private
- */
- Range.prototype._onDrag = function (event) {
- // only allow dragging when configured as movable
- if (!this.options.moveable) return;
- var direction = this.options.direction;
- validateDirection(direction);
- // refuse to drag when we where pinching to prevent the timeline make a jump
- // when releasing the fingers in opposite order from the touch screen
- if (!this.props.touch.allowDragging) return;
- var delta = (direction == 'horizontal') ? event.gesture.deltaX : event.gesture.deltaY,
- interval = (this.props.touch.end - this.props.touch.start),
- width = (direction == 'horizontal') ? this.body.domProps.center.width : this.body.domProps.center.height,
- diffRange = -delta / width * interval;
- this._applyRange(this.props.touch.start + diffRange, this.props.touch.end + diffRange);
- this.body.emitter.emit('rangechange', {
- start: new Date(this.start),
- end: new Date(this.end)
- });
- };
/**
- * Stop dragging operation
- * @param {event} event
- * @private
+ * Stop moving operating.
+ * This function activated from within the funcion Graph.mouseDown().
+ * @param {event} event The event
*/
- Range.prototype._onDragEnd = function (event) {
- // only allow dragging when configured as movable
- if (!this.options.moveable) return;
-
- // refuse to drag when we where pinching to prevent the timeline make a jump
- // when releasing the fingers in opposite order from the touch screen
- if (!this.props.touch.allowDragging) return;
-
- if (this.body.dom.root) {
- this.body.dom.root.style.cursor = 'auto';
- }
+ Graph3d.prototype._onMouseUp = function (event) {
+ this.frame.style.cursor = 'auto';
+ this.leftButtonDown = false;
- // fire a rangechanged event
- this.body.emitter.emit('rangechanged', {
- start: new Date(this.start),
- end: new Date(this.end)
- });
+ // remove event listeners here
+ G3DremoveEventListener(document, 'mousemove', this.onmousemove);
+ G3DremoveEventListener(document, 'mouseup', this.onmouseup);
+ G3DpreventDefault(event);
};
/**
- * Event handler for mouse wheel event, used to zoom
- * Code from http://adomas.org/javascript-mouse-wheel/
- * @param {Event} event
- * @private
+ * After having moved the mouse, a tooltip should pop up when the mouse is resting on a data point
+ * @param {Event} event A mouse move event
*/
- Range.prototype._onMouseWheel = function(event) {
- // only allow zooming when configured as zoomable and moveable
- if (!(this.options.zoomable && this.options.moveable)) return;
+ Graph3d.prototype._onTooltip = function (event) {
+ var delay = 300; // ms
+ var mouseX = getMouseX(event) - getAbsoluteLeft(this.frame);
+ var mouseY = getMouseY(event) - getAbsoluteTop(this.frame);
- // retrieve delta
- var delta = 0;
- if (event.wheelDelta) { /* IE/Opera. */
- delta = event.wheelDelta / 120;
- } else if (event.detail) { /* Mozilla case. */
- // In Mozilla, sign of delta is different than in IE.
- // Also, delta is multiple of 3.
- delta = -event.detail / 3;
+ if (!this.showTooltip) {
+ return;
}
- // If delta is nonzero, handle it.
- // Basically, delta is now positive if wheel was scrolled up,
- // and negative, if wheel was scrolled down.
- if (delta) {
- // perform the zoom action. Delta is normally 1 or -1
+ if (this.tooltipTimeout) {
+ clearTimeout(this.tooltipTimeout);
+ }
- // adjust a negative delta such that zooming in with delta 0.1
- // equals zooming out with a delta -0.1
- var scale;
- if (delta < 0) {
- scale = 1 - (delta / 5);
- }
- else {
- scale = 1 / (1 + (delta / 5)) ;
- }
+ // (delayed) display of a tooltip only if no mouse button is down
+ if (this.leftButtonDown) {
+ this._hideTooltip();
+ return;
+ }
- // calculate center, the date to zoom around
- var gesture = util.fakeGesture(this, event),
- pointer = getPointer(gesture.center, this.body.dom.center),
- pointerDate = this._pointerToDate(pointer);
+ if (this.tooltip && this.tooltip.dataPoint) {
+ // tooltip is currently visible
+ var dataPoint = this._dataPointFromXY(mouseX, mouseY);
+ if (dataPoint !== this.tooltip.dataPoint) {
+ // datapoint changed
+ if (dataPoint) {
+ this._showTooltip(dataPoint);
+ }
+ else {
+ this._hideTooltip();
+ }
+ }
+ }
+ else {
+ // tooltip is currently not visible
+ var me = this;
+ this.tooltipTimeout = setTimeout(function () {
+ me.tooltipTimeout = null;
- this.zoom(scale, pointerDate);
+ // show a tooltip if we have a data point
+ var dataPoint = me._dataPointFromXY(mouseX, mouseY);
+ if (dataPoint) {
+ me._showTooltip(dataPoint);
+ }
+ }, delay);
}
+ };
- // Prevent default actions caused by mouse wheel
- // (else the page and timeline both zoom and scroll)
- event.preventDefault();
+ /**
+ * Event handler for touchstart event on mobile devices
+ */
+ Graph3d.prototype._onTouchStart = function(event) {
+ this.touchDown = true;
+
+ var me = this;
+ this.ontouchmove = function (event) {me._onTouchMove(event);};
+ this.ontouchend = function (event) {me._onTouchEnd(event);};
+ G3DaddEventListener(document, 'touchmove', me.ontouchmove);
+ G3DaddEventListener(document, 'touchend', me.ontouchend);
+
+ this._onMouseDown(event);
};
/**
- * Start of a touch gesture
- * @private
+ * Event handler for touchmove event on mobile devices
*/
- Range.prototype._onTouch = function (event) {
- this.props.touch.start = this.start;
- this.props.touch.end = this.end;
- this.props.touch.allowDragging = true;
- this.props.touch.center = null;
+ Graph3d.prototype._onTouchMove = function(event) {
+ this._onMouseMove(event);
};
/**
- * On start of a hold gesture
- * @private
+ * Event handler for touchend event on mobile devices
*/
- Range.prototype._onHold = function () {
- this.props.touch.allowDragging = false;
+ Graph3d.prototype._onTouchEnd = function(event) {
+ this.touchDown = false;
+
+ G3DremoveEventListener(document, 'touchmove', this.ontouchmove);
+ G3DremoveEventListener(document, 'touchend', this.ontouchend);
+
+ this._onMouseUp(event);
};
+
/**
- * Handle pinch event
- * @param {Event} event
- * @private
+ * Event handler for mouse wheel event, used to zoom the graph
+ * Code from http://adomas.org/javascript-mouse-wheel/
+ * @param {event} event The event
*/
- Range.prototype._onPinch = function (event) {
- // only allow zooming when configured as zoomable and moveable
- if (!(this.options.zoomable && this.options.moveable)) return;
-
- this.props.touch.allowDragging = false;
+ Graph3d.prototype._onWheel = function(event) {
+ if (!event) /* For IE. */
+ event = window.event;
- if (event.gesture.touches.length > 1) {
- if (!this.props.touch.center) {
- this.props.touch.center = getPointer(event.gesture.center, this.body.dom.center);
- }
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) { /* IE/Opera. */
+ delta = event.wheelDelta/120;
+ } else if (event.detail) { /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail/3;
+ }
- var scale = 1 / event.gesture.scale,
- initDate = this._pointerToDate(this.props.touch.center);
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta) {
+ var oldLength = this.camera.getArmLength();
+ var newLength = oldLength * (1 - delta / 10);
- // calculate new start and end
- var newStart = parseInt(initDate + (this.props.touch.start - initDate) * scale);
- var newEnd = parseInt(initDate + (this.props.touch.end - initDate) * scale);
+ this.camera.setArmLength(newLength);
+ this.redraw();
- // apply new range
- this.setRange(newStart, newEnd);
+ this._hideTooltip();
}
+
+ // fire a cameraPositionChange event
+ var parameters = this.getCameraPosition();
+ this.emit('cameraPositionChange', parameters);
+
+ // Prevent default actions caused by mouse wheel.
+ // That might be ugly, but we handle scrolls somehow
+ // anyway, so don't bother here..
+ G3DpreventDefault(event);
};
/**
- * Helper function to calculate the center date for zooming
- * @param {{x: Number, y: Number}} pointer
- * @return {number} date
+ * Test whether a point lies inside given 2D triangle
+ * @param {Point2d} point
+ * @param {Point2d[]} triangle
+ * @return {boolean} Returns true if given point lies inside or on the edge of the triangle
* @private
*/
- Range.prototype._pointerToDate = function (pointer) {
- var conversion;
- var direction = this.options.direction;
-
- validateDirection(direction);
+ Graph3d.prototype._insideTriangle = function (point, triangle) {
+ var a = triangle[0],
+ b = triangle[1],
+ c = triangle[2];
- if (direction == 'horizontal') {
- var width = this.body.domProps.center.width;
- conversion = this.conversion(width);
- return pointer.x / conversion.scale + conversion.offset;
- }
- else {
- var height = this.body.domProps.center.height;
- conversion = this.conversion(height);
- return pointer.y / conversion.scale + conversion.offset;
+ function sign (x) {
+ return x > 0 ? 1 : x < 0 ? -1 : 0;
}
+
+ var as = sign((b.x - a.x) * (point.y - a.y) - (b.y - a.y) * (point.x - a.x));
+ var bs = sign((c.x - b.x) * (point.y - b.y) - (c.y - b.y) * (point.x - b.x));
+ var cs = sign((a.x - c.x) * (point.y - c.y) - (a.y - c.y) * (point.x - c.x));
+
+ // each of the three signs must be either equal to each other or zero
+ return (as == 0 || bs == 0 || as == bs) &&
+ (bs == 0 || cs == 0 || bs == cs) &&
+ (as == 0 || cs == 0 || as == cs);
};
/**
- * Get the pointer location relative to the location of the dom element
- * @param {{pageX: Number, pageY: Number}} touch
- * @param {Element} element HTML DOM element
- * @return {{x: Number, y: Number}} pointer
+ * Find a data point close to given screen position (x, y)
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Object | null} The closest data point or null if not close to any data point
* @private
*/
- function getPointer (touch, element) {
- return {
- x: touch.pageX - util.getAbsoluteLeft(element),
- y: touch.pageY - util.getAbsoluteTop(element)
- };
- }
+ Graph3d.prototype._dataPointFromXY = function (x, y) {
+ var i,
+ distMax = 100, // px
+ dataPoint = null,
+ closestDataPoint = null,
+ closestDist = null,
+ center = new Point2d(x, y);
- /**
- * Zoom the range the given scale in or out. Start and end date will
- * be adjusted, and the timeline will be redrawn. You can optionally give a
- * date around which to zoom.
- * For example, try scale = 0.9 or 1.1
- * @param {Number} scale Scaling factor. Values above 1 will zoom out,
- * values below 1 will zoom in.
- * @param {Number} [center] Value representing a date around which will
- * be zoomed.
- */
- Range.prototype.zoom = function(scale, center) {
- // if centerDate is not provided, take it half between start Date and end Date
- if (center == null) {
- center = (this.start + this.end) / 2;
+ if (this.style === Graph3d.STYLE.BAR ||
+ this.style === Graph3d.STYLE.BARCOLOR ||
+ this.style === Graph3d.STYLE.BARSIZE) {
+ // the data points are ordered from far away to closest
+ for (i = this.dataPoints.length - 1; i >= 0; i--) {
+ dataPoint = this.dataPoints[i];
+ var surfaces = dataPoint.surfaces;
+ if (surfaces) {
+ for (var s = surfaces.length - 1; s >= 0; s--) {
+ // split each surface in two triangles, and see if the center point is inside one of these
+ var surface = surfaces[s];
+ var corners = surface.corners;
+ var triangle1 = [corners[0].screen, corners[1].screen, corners[2].screen];
+ var triangle2 = [corners[2].screen, corners[3].screen, corners[0].screen];
+ if (this._insideTriangle(center, triangle1) ||
+ this._insideTriangle(center, triangle2)) {
+ // return immediately at the first hit
+ return dataPoint;
+ }
+ }
+ }
+ }
}
+ else {
+ // find the closest data point, using distance to the center of the point on 2d screen
+ for (i = 0; i < this.dataPoints.length; i++) {
+ dataPoint = this.dataPoints[i];
+ var point = dataPoint.screen;
+ if (point) {
+ var distX = Math.abs(x - point.x);
+ var distY = Math.abs(y - point.y);
+ var dist = Math.sqrt(distX * distX + distY * distY);
- // calculate new start and end
- var newStart = center + (this.start - center) * scale;
- var newEnd = center + (this.end - center) * scale;
+ if ((closestDist === null || dist < closestDist) && dist < distMax) {
+ closestDist = dist;
+ closestDataPoint = dataPoint;
+ }
+ }
+ }
+ }
- this.setRange(newStart, newEnd);
+
+ return closestDataPoint;
};
/**
- * Move the range with a given delta to the left or right. Start and end
- * value will be adjusted. For example, try delta = 0.1 or -0.1
- * @param {Number} delta Moving amount. Positive value will move right,
- * negative value will move left
+ * Display a tooltip for given data point
+ * @param {Object} dataPoint
+ * @private
*/
- Range.prototype.move = function(delta) {
- // zoom start Date and end Date relative to the centerDate
- var diff = (this.end - this.start);
-
- // apply new values
- var newStart = this.start + diff * delta;
- var newEnd = this.end + diff * delta;
+ Graph3d.prototype._showTooltip = function (dataPoint) {
+ var content, line, dot;
- // TODO: reckon with min and max range
+ if (!this.tooltip) {
+ content = document.createElement('div');
+ content.style.position = 'absolute';
+ content.style.padding = '10px';
+ content.style.border = '1px solid #4d4d4d';
+ content.style.color = '#1a1a1a';
+ content.style.background = 'rgba(255,255,255,0.7)';
+ content.style.borderRadius = '2px';
+ content.style.boxShadow = '5px 5px 10px rgba(128,128,128,0.5)';
- this.start = newStart;
- this.end = newEnd;
- };
+ line = document.createElement('div');
+ line.style.position = 'absolute';
+ line.style.height = '40px';
+ line.style.width = '0';
+ line.style.borderLeft = '1px solid #4d4d4d';
- /**
- * Move the range to a new center point
- * @param {Number} moveTo New center point of the range
- */
- Range.prototype.moveTo = function(moveTo) {
- var center = (this.start + this.end) / 2;
+ dot = document.createElement('div');
+ dot.style.position = 'absolute';
+ dot.style.height = '0';
+ dot.style.width = '0';
+ dot.style.border = '5px solid #4d4d4d';
+ dot.style.borderRadius = '5px';
- var diff = center - moveTo;
+ this.tooltip = {
+ dataPoint: null,
+ dom: {
+ content: content,
+ line: line,
+ dot: dot
+ }
+ };
+ }
+ else {
+ content = this.tooltip.dom.content;
+ line = this.tooltip.dom.line;
+ dot = this.tooltip.dom.dot;
+ }
- // calculate new start and end
- var newStart = this.start - diff;
- var newEnd = this.end - diff;
+ this._hideTooltip();
- this.setRange(newStart, newEnd);
- };
+ this.tooltip.dataPoint = dataPoint;
+ if (typeof this.showTooltip === 'function') {
+ content.innerHTML = this.showTooltip(dataPoint.point);
+ }
+ else {
+ content.innerHTML = '
' +
+ '
x:
' + dataPoint.point.x + '
' +
+ '
y:
' + dataPoint.point.y + '
' +
+ '
z:
' + dataPoint.point.z + '
' +
+ '
';
+ }
- module.exports = Range;
+ content.style.left = '0';
+ content.style.top = '0';
+ this.frame.appendChild(content);
+ this.frame.appendChild(line);
+ this.frame.appendChild(dot);
+ // calculate sizes
+ var contentWidth = content.offsetWidth;
+ var contentHeight = content.offsetHeight;
+ var lineHeight = line.offsetHeight;
+ var dotWidth = dot.offsetWidth;
+ var dotHeight = dot.offsetHeight;
-/***/ },
-/* 9 */
-/***/ function(module, exports, __webpack_require__) {
+ var left = dataPoint.screen.x - contentWidth / 2;
+ left = Math.min(Math.max(left, 10), this.frame.clientWidth - 10 - contentWidth);
- // Utility functions for ordering and stacking of items
- var EPSILON = 0.001; // used when checking collisions, to prevent round-off errors
+ line.style.left = dataPoint.screen.x + 'px';
+ line.style.top = (dataPoint.screen.y - lineHeight) + 'px';
+ content.style.left = left + 'px';
+ content.style.top = (dataPoint.screen.y - lineHeight - contentHeight) + 'px';
+ dot.style.left = (dataPoint.screen.x - dotWidth / 2) + 'px';
+ dot.style.top = (dataPoint.screen.y - dotHeight / 2) + 'px';
+ };
/**
- * Order items by their start data
- * @param {Item[]} items
+ * Hide the tooltip when displayed
+ * @private
*/
- exports.orderByStart = function(items) {
- items.sort(function (a, b) {
- return a.data.start - b.data.start;
- });
+ Graph3d.prototype._hideTooltip = function () {
+ if (this.tooltip) {
+ this.tooltip.dataPoint = null;
+
+ for (var prop in this.tooltip.dom) {
+ if (this.tooltip.dom.hasOwnProperty(prop)) {
+ var elem = this.tooltip.dom[prop];
+ if (elem && elem.parentNode) {
+ elem.parentNode.removeChild(elem);
+ }
+ }
+ }
+ }
};
+
/**
- * Order items by their end date. If they have no end date, their start date
- * is used.
- * @param {Item[]} items
+ * Add and event listener. Works for all browsers
+ * @param {Element} element An html element
+ * @param {string} action The action, for example 'click',
+ * without the prefix 'on'
+ * @param {function} listener The callback function to be executed
+ * @param {boolean} useCapture
*/
- exports.orderByEnd = function(items) {
- items.sort(function (a, b) {
- var aTime = ('end' in a.data) ? a.data.end : a.data.start,
- bTime = ('end' in b.data) ? b.data.end : b.data.start;
+ G3DaddEventListener = function(element, action, listener, useCapture) {
+ if (element.addEventListener) {
+ if (useCapture === undefined)
+ useCapture = false;
- return aTime - bTime;
- });
+ if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {
+ action = 'DOMMouseScroll'; // For Firefox
+ }
+
+ element.addEventListener(action, listener, useCapture);
+ } else {
+ element.attachEvent('on' + action, listener); // IE browsers
+ }
};
/**
- * Adjust vertical positions of the items such that they don't overlap each
- * other.
- * @param {Item[]} items
- * All visible items
- * @param {{item: number, axis: number}} margin
- * Margins between items and between items and the axis.
- * @param {boolean} [force=false]
- * If true, all items will be repositioned. If false (default), only
- * items having a top===null will be re-stacked
+ * Remove an event listener from an element
+ * @param {Element} element An html dom element
+ * @param {string} action The name of the event, for example 'mousedown'
+ * @param {function} listener The listener function
+ * @param {boolean} useCapture
*/
- exports.stack = function(items, margin, force) {
- var i, iMax;
+ G3DremoveEventListener = function(element, action, listener, useCapture) {
+ if (element.removeEventListener) {
+ // non-IE browsers
+ if (useCapture === undefined)
+ useCapture = false;
- if (force) {
- // reset top position of all items
- for (i = 0, iMax = items.length; i < iMax; i++) {
- items[i].top = null;
+ if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {
+ action = 'DOMMouseScroll'; // For Firefox
}
- }
- // calculate new, non-overlapping positions
- for (i = 0, iMax = items.length; i < iMax; i++) {
- var item = items[i];
- if (item.top === null) {
- // initialize top position
- item.top = margin.axis;
+ element.removeEventListener(action, listener, useCapture);
+ } else {
+ // IE browsers
+ element.detachEvent('on' + action, listener);
+ }
+ };
- do {
- // TODO: optimize checking for overlap. when there is a gap without items,
- // you only need to check for items from the next item on, not from zero
- var collidingItem = null;
- for (var j = 0, jj = items.length; j < jj; j++) {
- var other = items[j];
- if (other.top !== null && other !== item && exports.collision(item, other, margin.item)) {
- collidingItem = other;
- break;
- }
- }
+ /**
+ * Stop event propagation
+ */
+ G3DstopPropagation = function(event) {
+ if (!event)
+ event = window.event;
- if (collidingItem != null) {
- // There is a collision. Reposition the items above the colliding element
- item.top = collidingItem.top + collidingItem.height + margin.item;
- }
- } while (collidingItem);
- }
+ if (event.stopPropagation) {
+ event.stopPropagation(); // non-IE browsers
+ }
+ else {
+ event.cancelBubble = true; // IE browsers
}
};
+
/**
- * Adjust vertical positions of the items without stacking them
- * @param {Item[]} items
- * All visible items
- * @param {{item: number, axis: number}} margin
- * Margins between items and between items and the axis.
+ * Cancels the event if it is cancelable, without stopping further propagation of the event.
*/
- exports.nostack = function(items, margin) {
- var i, iMax;
+ G3DpreventDefault = function (event) {
+ if (!event)
+ event = window.event;
- // reset top position of all items
- for (i = 0, iMax = items.length; i < iMax; i++) {
- items[i].top = margin.axis;
+ if (event.preventDefault) {
+ event.preventDefault(); // non-IE browsers
+ }
+ else {
+ event.returnValue = false; // IE browsers
}
};
/**
- * Test if the two provided items collide
- * The items must have parameters left, width, top, and height.
- * @param {Item} a The first item
- * @param {Item} b The second item
- * @param {Number} margin A minimum required margin.
- * If margin is provided, the two items will be
- * marked colliding when they overlap or
- * when the margin between the two is smaller than
- * the requested margin.
- * @return {boolean} true if a and b collide, else false
+ * @constructor Slider
+ *
+ * An html slider control with start/stop/prev/next buttons
+ * @param {Element} container The element where the slider will be created
+ * @param {Object} options Available options:
+ * {boolean} visible If true (default) the
+ * slider is visible.
*/
- exports.collision = function(a, b, margin) {
- return ((a.left - margin + EPSILON) < (b.left + b.width) &&
- (a.left + a.width + margin - EPSILON) > b.left &&
- (a.top - margin + EPSILON) < (b.top + b.height) &&
- (a.top + a.height + margin - EPSILON) > b.top);
- };
+ function Slider(container, options) {
+ if (container === undefined) {
+ throw 'Error: No container element defined';
+ }
+ this.container = container;
+ this.visible = (options && options.visible != undefined) ? options.visible : true;
+ if (this.visible) {
+ this.frame = document.createElement('DIV');
+ //this.frame.style.backgroundColor = '#E5E5E5';
+ this.frame.style.width = '100%';
+ this.frame.style.position = 'relative';
+ this.container.appendChild(this.frame);
-/***/ },
-/* 10 */
-/***/ function(module, exports, __webpack_require__) {
+ this.frame.prev = document.createElement('INPUT');
+ this.frame.prev.type = 'BUTTON';
+ this.frame.prev.value = 'Prev';
+ this.frame.appendChild(this.frame.prev);
- var moment = __webpack_require__(39);
+ this.frame.play = document.createElement('INPUT');
+ this.frame.play.type = 'BUTTON';
+ this.frame.play.value = 'Play';
+ this.frame.appendChild(this.frame.play);
- /**
- * @constructor TimeStep
- * The class TimeStep is an iterator for dates. You provide a start date and an
- * end date. The class itself determines the best scale (step size) based on the
- * provided start Date, end Date, and minimumStep.
- *
- * If minimumStep is provided, the step size is chosen as close as possible
- * to the minimumStep but larger than minimumStep. If minimumStep is not
- * provided, the scale is set to 1 DAY.
- * The minimumStep should correspond with the onscreen size of about 6 characters
- *
- * Alternatively, you can set a scale by hand.
- * After creation, you can initialize the class by executing first(). Then you
- * can iterate from the start date to the end date via next(). You can check if
- * the end date is reached with the function hasNext(). After each step, you can
- * retrieve the current date via getCurrent().
- * The TimeStep has scales ranging from milliseconds, seconds, minutes, hours,
- * days, to years.
- *
- * Version: 1.2
- *
- * @param {Date} [start] The start date, for example new Date(2010, 9, 21)
- * or new Date(2010, 9, 21, 23, 45, 00)
- * @param {Date} [end] The end date
- * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
- */
- function TimeStep(start, end, minimumStep) {
- // variables
- this.current = new Date();
- this._start = new Date();
- this._end = new Date();
+ this.frame.next = document.createElement('INPUT');
+ this.frame.next.type = 'BUTTON';
+ this.frame.next.value = 'Next';
+ this.frame.appendChild(this.frame.next);
- this.autoScale = true;
- this.scale = TimeStep.SCALE.DAY;
- this.step = 1;
+ this.frame.bar = document.createElement('INPUT');
+ this.frame.bar.type = 'BUTTON';
+ this.frame.bar.style.position = 'absolute';
+ this.frame.bar.style.border = '1px solid red';
+ this.frame.bar.style.width = '100px';
+ this.frame.bar.style.height = '6px';
+ this.frame.bar.style.borderRadius = '2px';
+ this.frame.bar.style.MozBorderRadius = '2px';
+ this.frame.bar.style.border = '1px solid #7F7F7F';
+ this.frame.bar.style.backgroundColor = '#E5E5E5';
+ this.frame.appendChild(this.frame.bar);
- // initialize the range
- this.setRange(start, end, minimumStep);
- }
+ this.frame.slide = document.createElement('INPUT');
+ this.frame.slide.type = 'BUTTON';
+ this.frame.slide.style.margin = '0px';
+ this.frame.slide.value = ' ';
+ this.frame.slide.style.position = 'relative';
+ this.frame.slide.style.left = '-100px';
+ this.frame.appendChild(this.frame.slide);
+
+ // create events
+ var me = this;
+ this.frame.slide.onmousedown = function (event) {me._onMouseDown(event);};
+ this.frame.prev.onclick = function (event) {me.prev(event);};
+ this.frame.play.onclick = function (event) {me.togglePlay(event);};
+ this.frame.next.onclick = function (event) {me.next(event);};
+ }
- /// enum scale
- TimeStep.SCALE = {
- MILLISECOND: 1,
- SECOND: 2,
- MINUTE: 3,
- HOUR: 4,
- DAY: 5,
- WEEKDAY: 6,
- MONTH: 7,
- YEAR: 8
- };
+ this.onChangeCallback = undefined;
+
+ this.values = [];
+ this.index = undefined;
+ this.playTimeout = undefined;
+ this.playInterval = 1000; // milliseconds
+ this.playLoop = true;
+ }
/**
- * Set a new range
- * If minimumStep is provided, the step size is chosen as close as possible
- * to the minimumStep but larger than minimumStep. If minimumStep is not
- * provided, the scale is set to 1 DAY.
- * The minimumStep should correspond with the onscreen size of about 6 characters
- * @param {Date} [start] The start date and time.
- * @param {Date} [end] The end date and time.
- * @param {int} [minimumStep] Optional. Minimum step size in milliseconds
+ * Select the previous index
*/
- TimeStep.prototype.setRange = function(start, end, minimumStep) {
- if (!(start instanceof Date) || !(end instanceof Date)) {
- throw "No legal start or end date in method setRange";
- }
-
- this._start = (start != undefined) ? new Date(start.valueOf()) : new Date();
- this._end = (end != undefined) ? new Date(end.valueOf()) : new Date();
-
- if (this.autoScale) {
- this.setMinimumStep(minimumStep);
+ Slider.prototype.prev = function() {
+ var index = this.getIndex();
+ if (index > 0) {
+ index--;
+ this.setIndex(index);
}
};
/**
- * Set the range iterator to the start date.
+ * Select the next index
*/
- TimeStep.prototype.first = function() {
- this.current = new Date(this._start.valueOf());
- this.roundToMinor();
+ Slider.prototype.next = function() {
+ var index = this.getIndex();
+ if (index < this.values.length - 1) {
+ index++;
+ this.setIndex(index);
+ }
};
/**
- * Round the current date to the first minor date value
- * This must be executed once when the current date is set to start Date
+ * Select the next index
*/
- TimeStep.prototype.roundToMinor = function() {
- // round to floor
- // IMPORTANT: we have no breaks in this switch! (this is no bug)
- //noinspection FallthroughInSwitchStatementJS
- 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: // intentional fall through
- 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);
- //case TimeStep.SCALE.MILLISECOND: // nothing to do for milliseconds
- }
+ Slider.prototype.playNext = function() {
+ var start = new Date();
- if (this.step != 1) {
- // round down to the first minor value that is a multiple of the current step size
- 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: // intentional fall through
- 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: break;
- }
+ var index = this.getIndex();
+ if (index < this.values.length - 1) {
+ index++;
+ this.setIndex(index);
+ }
+ else if (this.playLoop) {
+ // jump to the start
+ index = 0;
+ this.setIndex(index);
}
+
+ var end = new Date();
+ var diff = (end - start);
+
+ // calculate how much time it to to set the index and to execute the callback
+ // function.
+ var interval = Math.max(this.playInterval - diff, 0);
+ // document.title = diff // TODO: cleanup
+
+ var me = this;
+ this.playTimeout = setTimeout(function() {me.playNext();}, interval);
};
/**
- * Check if the there is a next step
- * @return {boolean} true if the current date has not passed the end date
+ * Toggle start or stop playing
*/
- TimeStep.prototype.hasNext = function () {
- return (this.current.valueOf() <= this._end.valueOf());
+ Slider.prototype.togglePlay = function() {
+ if (this.playTimeout === undefined) {
+ this.play();
+ } else {
+ this.stop();
+ }
};
/**
- * Do the next step
+ * Start playing
*/
- TimeStep.prototype.next = function() {
- var prev = this.current.valueOf();
+ Slider.prototype.play = function() {
+ // Test whether already playing
+ if (this.playTimeout) return;
- // Two cases, needed to prevent issues with switching daylight savings
- // (end of March and end of October)
- if (this.current.getMonth() < 6) {
- switch (this.scale) {
- case TimeStep.SCALE.MILLISECOND:
+ this.playNext();
- this.current = new Date(this.current.valueOf() + this.step); break;
- case TimeStep.SCALE.SECOND: this.current = new Date(this.current.valueOf() + this.step * 1000); break;
- case TimeStep.SCALE.MINUTE: this.current = new Date(this.current.valueOf() + this.step * 1000 * 60); break;
- case TimeStep.SCALE.HOUR:
- this.current = new Date(this.current.valueOf() + this.step * 1000 * 60 * 60);
- // in case of skipping an hour for daylight savings, adjust the hour again (else you get: 0h 5h 9h ... instead of 0h 4h 8h ...)
- var h = this.current.getHours();
- this.current.setHours(h - (h % this.step));
- break;
- case TimeStep.SCALE.WEEKDAY: // intentional fall through
- 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: break;
- }
- }
- 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: // intentional fall through
- 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: break;
- }
+ if (this.frame) {
+ this.frame.play.value = 'Stop';
}
+ };
- if (this.step != 1) {
- // round down to the correct major value
- switch (this.scale) {
- case TimeStep.SCALE.MILLISECOND: if(this.current.getMilliseconds() < this.step) this.current.setMilliseconds(0); break;
- case TimeStep.SCALE.SECOND: if(this.current.getSeconds() < this.step) this.current.setSeconds(0); break;
- case TimeStep.SCALE.MINUTE: if(this.current.getMinutes() < this.step) this.current.setMinutes(0); break;
- case TimeStep.SCALE.HOUR: if(this.current.getHours() < this.step) this.current.setHours(0); break;
- case TimeStep.SCALE.WEEKDAY: // intentional fall through
- case TimeStep.SCALE.DAY: if(this.current.getDate() < this.step+1) this.current.setDate(1); break;
- case TimeStep.SCALE.MONTH: if(this.current.getMonth() < this.step) this.current.setMonth(0); break;
- case TimeStep.SCALE.YEAR: break; // nothing to do for year
- default: break;
- }
- }
+ /**
+ * Stop playing
+ */
+ Slider.prototype.stop = function() {
+ clearInterval(this.playTimeout);
+ this.playTimeout = undefined;
- // safety mechanism: if current time is still unchanged, move to the end
- if (this.current.valueOf() == prev) {
- this.current = new Date(this._end.valueOf());
+ if (this.frame) {
+ this.frame.play.value = 'Play';
}
};
+ /**
+ * Set a callback function which will be triggered when the value of the
+ * slider bar has changed.
+ */
+ Slider.prototype.setOnChangeCallback = function(callback) {
+ this.onChangeCallback = callback;
+ };
+
+ /**
+ * Set the interval for playing the list
+ * @param {Number} interval The interval in milliseconds
+ */
+ Slider.prototype.setPlayInterval = function(interval) {
+ this.playInterval = interval;
+ };
/**
- * Get the current datetime
- * @return {Date} current The current date
+ * Retrieve the current play interval
+ * @return {Number} interval The interval in milliseconds
*/
- TimeStep.prototype.getCurrent = function() {
- return this.current;
+ Slider.prototype.getPlayInterval = function(interval) {
+ return this.playInterval;
};
/**
- * Set a custom scale. Autoscaling will be disabled.
- * For example setScale(SCALE.MINUTES, 5) will result
- * in minor steps of 5 minutes, and major steps of an hour.
- *
- * @param {TimeStep.SCALE} newScale
- * A scale. Choose from SCALE.MILLISECOND,
- * SCALE.SECOND, SCALE.MINUTE, SCALE.HOUR,
- * SCALE.WEEKDAY, SCALE.DAY, SCALE.MONTH,
- * SCALE.YEAR.
- * @param {Number} newStep A step size, by default 1. Choose for
- * example 1, 2, 5, or 10.
+ * Set looping on or off
+ * @pararm {boolean} doLoop If true, the slider will jump to the start when
+ * the end is passed, and will jump to the end
+ * when the start is passed.
*/
- TimeStep.prototype.setScale = function(newScale, newStep) {
- this.scale = newScale;
+ Slider.prototype.setPlayLoop = function(doLoop) {
+ this.playLoop = doLoop;
+ };
- if (newStep > 0) {
- this.step = newStep;
- }
- this.autoScale = false;
+ /**
+ * Execute the onchange callback function
+ */
+ Slider.prototype.onChange = function() {
+ if (this.onChangeCallback !== undefined) {
+ this.onChangeCallback();
+ }
};
/**
- * Enable or disable autoscaling
- * @param {boolean} enable If true, autoascaling is set true
+ * redraw the slider on the correct place
*/
- TimeStep.prototype.setAutoScale = function (enable) {
- this.autoScale = enable;
+ Slider.prototype.redraw = function() {
+ if (this.frame) {
+ // resize the bar
+ this.frame.bar.style.top = (this.frame.clientHeight/2 -
+ this.frame.bar.offsetHeight/2) + 'px';
+ this.frame.bar.style.width = (this.frame.clientWidth -
+ this.frame.prev.clientWidth -
+ this.frame.play.clientWidth -
+ this.frame.next.clientWidth - 30) + 'px';
+
+ // position the slider button
+ var left = this.indexToLeft(this.index);
+ this.frame.slide.style.left = (left) + 'px';
+ }
};
/**
- * Automatically determine the scale that bests fits the provided minimum step
- * @param {Number} [minimumStep] The minimum step size in milliseconds
+ * Set the list with values for the slider
+ * @param {Array} values A javascript array with values (any type)
*/
- TimeStep.prototype.setMinimumStep = function(minimumStep) {
- if (minimumStep == undefined) {
- return;
- }
-
- var stepYear = (1000 * 60 * 60 * 24 * 30 * 12);
- var stepMonth = (1000 * 60 * 60 * 24 * 30);
- var stepDay = (1000 * 60 * 60 * 24);
- var stepHour = (1000 * 60 * 60);
- var stepMinute = (1000 * 60);
- var stepSecond = (1000);
- var stepMillisecond= (1);
+ Slider.prototype.setValues = function(values) {
+ this.values = values;
- // find the smallest step that is larger than the provided minimumStep
- if (stepYear*1000 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 1000;}
- if (stepYear*500 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 500;}
- if (stepYear*100 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 100;}
- if (stepYear*50 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 50;}
- if (stepYear*10 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 10;}
- if (stepYear*5 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 5;}
- if (stepYear > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 1;}
- if (stepMonth*3 > minimumStep) {this.scale = TimeStep.SCALE.MONTH; this.step = 3;}
- if (stepMonth > minimumStep) {this.scale = TimeStep.SCALE.MONTH; this.step = 1;}
- if (stepDay*5 > minimumStep) {this.scale = TimeStep.SCALE.DAY; this.step = 5;}
- if (stepDay*2 > minimumStep) {this.scale = TimeStep.SCALE.DAY; this.step = 2;}
- if (stepDay > minimumStep) {this.scale = TimeStep.SCALE.DAY; this.step = 1;}
- if (stepDay/2 > minimumStep) {this.scale = TimeStep.SCALE.WEEKDAY; this.step = 1;}
- if (stepHour*4 > minimumStep) {this.scale = TimeStep.SCALE.HOUR; this.step = 4;}
- if (stepHour > minimumStep) {this.scale = TimeStep.SCALE.HOUR; this.step = 1;}
- if (stepMinute*15 > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 15;}
- if (stepMinute*10 > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 10;}
- if (stepMinute*5 > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 5;}
- if (stepMinute > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 1;}
- if (stepSecond*15 > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 15;}
- if (stepSecond*10 > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 10;}
- if (stepSecond*5 > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 5;}
- if (stepSecond > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 1;}
- if (stepMillisecond*200 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 200;}
- if (stepMillisecond*100 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 100;}
- if (stepMillisecond*50 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 50;}
- if (stepMillisecond*10 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 10;}
- if (stepMillisecond*5 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 5;}
- if (stepMillisecond > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 1;}
+ if (this.values.length > 0)
+ this.setIndex(0);
+ else
+ this.index = undefined;
};
/**
- * Snap a date to a rounded value.
- * The snap intervals are dependent on the current scale and step.
- * @param {Date} date the date to be snapped.
- * @return {Date} snappedDate
+ * Select a value by its index
+ * @param {Number} index
*/
- TimeStep.prototype.snap = function(date) {
- var clone = new Date(date.valueOf());
-
- if (this.scale == TimeStep.SCALE.YEAR) {
- var year = clone.getFullYear() + Math.round(clone.getMonth() / 12);
- clone.setFullYear(Math.round(year / this.step) * this.step);
- clone.setMonth(0);
- clone.setDate(0);
- clone.setHours(0);
- clone.setMinutes(0);
- clone.setSeconds(0);
- clone.setMilliseconds(0);
- }
- else if (this.scale == TimeStep.SCALE.MONTH) {
- if (clone.getDate() > 15) {
- clone.setDate(1);
- clone.setMonth(clone.getMonth() + 1);
- // important: first set Date to 1, after that change the month.
- }
- else {
- clone.setDate(1);
- }
+ Slider.prototype.setIndex = function(index) {
+ if (index < this.values.length) {
+ this.index = index;
- clone.setHours(0);
- clone.setMinutes(0);
- clone.setSeconds(0);
- clone.setMilliseconds(0);
- }
- else if (this.scale == TimeStep.SCALE.DAY) {
- //noinspection FallthroughInSwitchStatementJS
- switch (this.step) {
- case 5:
- case 2:
- clone.setHours(Math.round(clone.getHours() / 24) * 24); break;
- default:
- clone.setHours(Math.round(clone.getHours() / 12) * 12); break;
- }
- clone.setMinutes(0);
- clone.setSeconds(0);
- clone.setMilliseconds(0);
- }
- else if (this.scale == TimeStep.SCALE.WEEKDAY) {
- //noinspection FallthroughInSwitchStatementJS
- switch (this.step) {
- case 5:
- case 2:
- clone.setHours(Math.round(clone.getHours() / 12) * 12); break;
- default:
- clone.setHours(Math.round(clone.getHours() / 6) * 6); break;
- }
- clone.setMinutes(0);
- clone.setSeconds(0);
- clone.setMilliseconds(0);
- }
- else if (this.scale == TimeStep.SCALE.HOUR) {
- switch (this.step) {
- case 4:
- clone.setMinutes(Math.round(clone.getMinutes() / 60) * 60); break;
- default:
- clone.setMinutes(Math.round(clone.getMinutes() / 30) * 30); break;
- }
- clone.setSeconds(0);
- clone.setMilliseconds(0);
- } else if (this.scale == TimeStep.SCALE.MINUTE) {
- //noinspection FallthroughInSwitchStatementJS
- switch (this.step) {
- case 15:
- case 10:
- clone.setMinutes(Math.round(clone.getMinutes() / 5) * 5);
- clone.setSeconds(0);
- break;
- case 5:
- clone.setSeconds(Math.round(clone.getSeconds() / 60) * 60); break;
- default:
- clone.setSeconds(Math.round(clone.getSeconds() / 30) * 30); break;
- }
- clone.setMilliseconds(0);
- }
- else if (this.scale == TimeStep.SCALE.SECOND) {
- //noinspection FallthroughInSwitchStatementJS
- switch (this.step) {
- case 15:
- case 10:
- clone.setSeconds(Math.round(clone.getSeconds() / 5) * 5);
- clone.setMilliseconds(0);
- break;
- case 5:
- clone.setMilliseconds(Math.round(clone.getMilliseconds() / 1000) * 1000); break;
- default:
- clone.setMilliseconds(Math.round(clone.getMilliseconds() / 500) * 500); break;
- }
+ this.redraw();
+ this.onChange();
}
- else if (this.scale == TimeStep.SCALE.MILLISECOND) {
- var step = this.step > 5 ? this.step / 2 : 1;
- clone.setMilliseconds(Math.round(clone.getMilliseconds() / step) * step);
+ else {
+ throw 'Error: index out of range';
}
-
- return clone;
};
/**
- * Check if the current value is a major value (for example when the step
- * is DAY, a major value is each first day of the MONTH)
- * @return {boolean} true if current date is major, else false.
+ * retrieve the index of the currently selected vaue
+ * @return {Number} index
*/
- TimeStep.prototype.isMajor = function() {
- switch (this.scale) {
- case TimeStep.SCALE.MILLISECOND:
- return (this.current.getMilliseconds() == 0);
- case TimeStep.SCALE.SECOND:
- return (this.current.getSeconds() == 0);
- case TimeStep.SCALE.MINUTE:
- return (this.current.getHours() == 0) && (this.current.getMinutes() == 0);
- // Note: this is no bug. Major label is equal for both minute and hour scale
- case TimeStep.SCALE.HOUR:
- return (this.current.getHours() == 0);
- case TimeStep.SCALE.WEEKDAY: // intentional fall through
- case TimeStep.SCALE.DAY:
- return (this.current.getDate() == 1);
- case TimeStep.SCALE.MONTH:
- return (this.current.getMonth() == 0);
- case TimeStep.SCALE.YEAR:
- return false;
- default:
- return false;
- }
+ Slider.prototype.getIndex = function() {
+ return this.index;
};
/**
- * Returns formatted text for the minor axislabel, depending on the current
- * date and the scale. For example when scale is MINUTE, the current time is
- * formatted as "hh:mm".
- * @param {Date} [date] custom date. if not provided, current date is taken
+ * retrieve the currently selected value
+ * @return {*} value
*/
- TimeStep.prototype.getLabelMinor = function(date) {
- if (date == undefined) {
- date = this.current;
- }
+ Slider.prototype.get = function() {
+ return this.values[this.index];
+ };
- switch (this.scale) {
- case TimeStep.SCALE.MILLISECOND: return moment(date).format('SSS');
- case TimeStep.SCALE.SECOND: return moment(date).format('s');
- case TimeStep.SCALE.MINUTE: return moment(date).format('HH:mm');
- case TimeStep.SCALE.HOUR: return moment(date).format('HH:mm');
- case TimeStep.SCALE.WEEKDAY: return moment(date).format('ddd D');
- case TimeStep.SCALE.DAY: return moment(date).format('D');
- case TimeStep.SCALE.MONTH: return moment(date).format('MMM');
- case TimeStep.SCALE.YEAR: return moment(date).format('YYYY');
- default: return '';
- }
+
+ Slider.prototype._onMouseDown = function(event) {
+ // only react on left mouse button down
+ var leftButtonDown = event.which ? (event.which === 1) : (event.button === 1);
+ if (!leftButtonDown) return;
+
+ this.startClientX = event.clientX;
+ this.startSlideX = parseFloat(this.frame.slide.style.left);
+
+ this.frame.style.cursor = 'move';
+
+ // add event listeners to handle moving the contents
+ // we store the function onmousemove and onmouseup in the graph, so we can
+ // remove the eventlisteners lateron in the function mouseUp()
+ var me = this;
+ this.onmousemove = function (event) {me._onMouseMove(event);};
+ this.onmouseup = function (event) {me._onMouseUp(event);};
+ G3DaddEventListener(document, 'mousemove', this.onmousemove);
+ G3DaddEventListener(document, 'mouseup', this.onmouseup);
+ G3DpreventDefault(event);
};
- /**
- * Returns formatted text for the major axis label, depending on the current
- * date and the scale. For example when scale is MINUTE, the major scale is
- * hours, and the hour will be formatted as "hh".
- * @param {Date} [date] custom date. if not provided, current date is taken
- */
- TimeStep.prototype.getLabelMajor = function(date) {
- if (date == undefined) {
- date = this.current;
- }
+ Slider.prototype.leftToIndex = function (left) {
+ var width = parseFloat(this.frame.bar.style.width) -
+ this.frame.slide.clientWidth - 10;
+ var x = left - 3;
+
+ var index = Math.round(x / width * (this.values.length-1));
+ if (index < 0) index = 0;
+ if (index > this.values.length-1) index = this.values.length-1;
- //noinspection FallthroughInSwitchStatementJS
- switch (this.scale) {
- case TimeStep.SCALE.MILLISECOND:return moment(date).format('HH:mm:ss');
- case TimeStep.SCALE.SECOND: return moment(date).format('D MMMM HH:mm');
- case TimeStep.SCALE.MINUTE:
- case TimeStep.SCALE.HOUR: return moment(date).format('ddd D MMMM');
- case TimeStep.SCALE.WEEKDAY:
- case TimeStep.SCALE.DAY: return moment(date).format('MMMM YYYY');
- case TimeStep.SCALE.MONTH: return moment(date).format('YYYY');
- case TimeStep.SCALE.YEAR: return '';
- default: return '';
- }
+ return index;
};
- module.exports = TimeStep;
+ Slider.prototype.indexToLeft = function (index) {
+ var width = parseFloat(this.frame.bar.style.width) -
+ this.frame.slide.clientWidth - 10;
+ var x = index / (this.values.length-1) * width;
+ var left = x + 3;
-/***/ },
-/* 11 */
-/***/ function(module, exports, __webpack_require__) {
+ return left;
+ };
- var Emitter = __webpack_require__(41);
- var DataSet = __webpack_require__(3);
- var DataView = __webpack_require__(4);
- var Point3d = __webpack_require__(33);
- var Point2d = __webpack_require__(34);
- var Filter = __webpack_require__(35);
- var StepNumber = __webpack_require__(36);
- /**
- * @constructor Graph3d
- * Graph3d displays data in 3d.
- *
- * Graph3d is developed in javascript as a Google Visualization Chart.
- *
- * @param {Element} container The DOM element in which the Graph3d will
- * be created. Normally a div element.
- * @param {DataSet | DataView | Array} [data]
- * @param {Object} [options]
- */
- function Graph3d(container, data, options) {
- if (!(this instanceof Graph3d)) {
- throw new SyntaxError('Constructor must be called with the new operator');
- }
- // create variables and set default values
- this.containerElement = container;
- this.width = '400px';
- this.height = '400px';
- this.margin = 10; // px
- this.defaultXCenter = '55%';
- this.defaultYCenter = '50%';
+ Slider.prototype._onMouseMove = function (event) {
+ var diff = event.clientX - this.startClientX;
+ var x = this.startSlideX + diff;
- this.xLabel = 'x';
- this.yLabel = 'y';
- this.zLabel = 'z';
- this.filterLabel = 'time';
- this.legendLabel = 'value';
+ var index = this.leftToIndex(x);
- this.style = Graph3d.STYLE.DOT;
- this.showPerspective = true;
- this.showGrid = true;
- this.keepAspectRatio = true;
- this.showShadow = false;
- this.showGrayBottom = false; // TODO: this does not work correctly
- this.showTooltip = false;
- this.verticalRatio = 0.5; // 0.1 to 1.0, where 1.0 results in a 'cube'
+ this.setIndex(index);
- this.animationInterval = 1000; // milliseconds
- this.animationPreload = false;
+ G3DpreventDefault();
+ };
- this.camera = new Graph3d.Camera();
- this.eye = new Point3d(0, 0, -1); // TODO: set eye.z about 3/4 of the width of the window?
- this.dataTable = null; // The original data table
- this.dataPoints = null; // The table with point objects
+ Slider.prototype._onMouseUp = function (event) {
+ this.frame.style.cursor = 'auto';
- // the column indexes
- this.colX = undefined;
- this.colY = undefined;
- this.colZ = undefined;
- this.colValue = undefined;
- this.colFilter = undefined;
+ // remove event listeners
+ G3DremoveEventListener(document, 'mousemove', this.onmousemove);
+ G3DremoveEventListener(document, 'mouseup', this.onmouseup);
- this.xMin = 0;
- this.xStep = undefined; // auto by default
- this.xMax = 1;
- this.yMin = 0;
- this.yStep = undefined; // auto by default
- this.yMax = 1;
- this.zMin = 0;
- this.zStep = undefined; // auto by default
- this.zMax = 1;
- this.valueMin = 0;
- this.valueMax = 1;
- this.xBarWidth = 1;
- this.yBarWidth = 1;
- // TODO: customize axis range
+ G3DpreventDefault();
+ };
- // constants
- this.colorAxis = '#4D4D4D';
- this.colorGrid = '#D3D3D3';
- this.colorDot = '#7DC1FF';
- this.colorDotBorder = '#3267D2';
- // create a frame and canvas
- this.create();
- // apply options (also when undefined)
- this.setOptions(options);
+ /**--------------------------------------------------------------------------**/
- // apply data
- if (data) {
- this.setData(data);
- }
- }
- // Extend Graph3d with an Emitter mixin
- Emitter(Graph3d.prototype);
/**
- * @class Camera
- * The camera is mounted on a (virtual) camera arm. The camera arm can rotate
- * The camera is always looking in the direction of the origin of the arm.
- * This way, the camera always rotates around one fixed point, the location
- * of the camera arm.
- *
- * Documentation:
- * http://en.wikipedia.org/wiki/3D_projection
+ * Retrieve the absolute left value of a DOM element
+ * @param {Element} elem A dom element, for example a div
+ * @return {Number} left The absolute left position of this element
+ * in the browser page.
*/
- Graph3d.Camera = function () {
- this.armLocation = new Point3d();
- this.armRotation = {};
- this.armRotation.horizontal = 0;
- this.armRotation.vertical = 0;
- this.armLength = 1.7;
-
- this.cameraLocation = new Point3d();
- this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0);
-
- this.calculateCameraOrientation();
+ getAbsoluteLeft = function(elem) {
+ var left = 0;
+ while( elem !== null ) {
+ left += elem.offsetLeft;
+ left -= elem.scrollLeft;
+ elem = elem.offsetParent;
+ }
+ return left;
};
/**
- * Set the location (origin) of the arm
- * @param {Number} x Normalized value of x
- * @param {Number} y Normalized value of y
- * @param {Number} z Normalized value of z
+ * Retrieve the absolute top value of a DOM element
+ * @param {Element} elem A dom element, for example a div
+ * @return {Number} top The absolute top position of this element
+ * in the browser page.
*/
- Graph3d.Camera.prototype.setArmLocation = function(x, y, z) {
- this.armLocation.x = x;
- this.armLocation.y = y;
- this.armLocation.z = z;
+ getAbsoluteTop = function(elem) {
+ var top = 0;
+ while( elem !== null ) {
+ top += elem.offsetTop;
+ top -= elem.scrollTop;
+ elem = elem.offsetParent;
+ }
+ return top;
+ };
- this.calculateCameraOrientation();
+ /**
+ * Get the horizontal mouse position from a mouse event
+ * @param {Event} event
+ * @return {Number} mouse x
+ */
+ getMouseX = function(event) {
+ if ('clientX' in event) return event.clientX;
+ return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
};
/**
- * Set the rotation of the camera arm
- * @param {Number} horizontal The horizontal rotation, between 0 and 2*PI.
- * Optional, can be left undefined.
- * @param {Number} vertical The vertical rotation, between 0 and 0.5*PI
- * if vertical=0.5*PI, the graph is shown from the
- * top. Optional, can be left undefined.
+ * Get the vertical mouse position from a mouse event
+ * @param {Event} event
+ * @return {Number} mouse y
*/
- Graph3d.Camera.prototype.setArmRotation = function(horizontal, vertical) {
- if (horizontal !== undefined) {
- this.armRotation.horizontal = horizontal;
- }
+ getMouseY = function(event) {
+ if ('clientY' in event) return event.clientY;
+ return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
+ };
- if (vertical !== undefined) {
- this.armRotation.vertical = vertical;
- if (this.armRotation.vertical < 0) this.armRotation.vertical = 0;
- if (this.armRotation.vertical > 0.5*Math.PI) this.armRotation.vertical = 0.5*Math.PI;
- }
+ module.exports = Graph3d;
- if (horizontal !== undefined || vertical !== undefined) {
- this.calculateCameraOrientation();
- }
- };
+
+/***/ },
+/* 6 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var Emitter = __webpack_require__(41);
+ var Hammer = __webpack_require__(49);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(3);
+ var DataView = __webpack_require__(4);
+ var Range = __webpack_require__(9);
+ var TimeAxis = __webpack_require__(21);
+ var CurrentTime = __webpack_require__(13);
+ var CustomTime = __webpack_require__(14);
+ var ItemSet = __webpack_require__(18);
/**
- * Retrieve the current arm rotation
- * @return {object} An object with parameters horizontal and vertical
+ * Create a timeline visualization
+ * @param {HTMLElement} container
+ * @param {vis.DataSet | Array | google.visualization.DataTable} [items]
+ * @param {Object} [options] See Timeline.setOptions for the available options.
+ * @constructor
*/
- Graph3d.Camera.prototype.getArmRotation = function() {
- var rot = {};
- rot.horizontal = this.armRotation.horizontal;
- rot.vertical = this.armRotation.vertical;
+ function Timeline (container, items, options) {
+ if (!(this instanceof Timeline)) {
+ throw new SyntaxError('Constructor must be called with the new operator');
+ }
+
+ var me = this;
+ this.defaultOptions = {
+ start: null,
+ end: null,
+
+ autoResize: true,
+
+ orientation: 'bottom',
+ width: null,
+ height: null,
+ maxHeight: null,
+ minHeight: null
+ };
+ this.options = util.deepExtend({}, this.defaultOptions);
+
+ // Create the DOM, props, and emitter
+ this._create(container);
- return rot;
- };
+ // all components listed here will be repainted automatically
+ this.components = [];
- /**
- * Set the (normalized) length of the camera arm.
- * @param {Number} length A length between 0.71 and 5.0
- */
- Graph3d.Camera.prototype.setArmLength = function(length) {
- if (length === undefined)
- return;
+ this.body = {
+ dom: this.dom,
+ domProps: this.props,
+ emitter: {
+ on: this.on.bind(this),
+ off: this.off.bind(this),
+ emit: this.emit.bind(this)
+ },
+ util: {
+ snap: null, // will be specified after TimeAxis is created
+ toScreen: me._toScreen.bind(me),
+ toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
+ toTime: me._toTime.bind(me),
+ toGlobalTime : me._toGlobalTime.bind(me)
+ }
+ };
- this.armLength = length;
+ // range
+ this.range = new Range(this.body);
+ this.components.push(this.range);
+ this.body.range = this.range;
- // Radius must be larger than the corner of the graph,
- // which has a distance of sqrt(0.5^2+0.5^2) = 0.71 from the center of the
- // graph
- if (this.armLength < 0.71) this.armLength = 0.71;
- if (this.armLength > 5.0) this.armLength = 5.0;
+ // time axis
+ this.timeAxis = new TimeAxis(this.body);
+ this.components.push(this.timeAxis);
+ this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);
- this.calculateCameraOrientation();
- };
+ // current time bar
+ this.currentTime = new CurrentTime(this.body);
+ this.components.push(this.currentTime);
- /**
- * Retrieve the arm length
- * @return {Number} length
- */
- Graph3d.Camera.prototype.getArmLength = function() {
- return this.armLength;
- };
+ // custom time bar
+ // Note: time bar will be attached in this.setOptions when selected
+ this.customTime = new CustomTime(this.body);
+ this.components.push(this.customTime);
- /**
- * Retrieve the camera location
- * @return {Point3d} cameraLocation
- */
- Graph3d.Camera.prototype.getCameraLocation = function() {
- return this.cameraLocation;
- };
+ // item set
+ this.itemSet = new ItemSet(this.body);
+ this.components.push(this.itemSet);
- /**
- * Retrieve the camera rotation
- * @return {Point3d} cameraRotation
- */
- Graph3d.Camera.prototype.getCameraRotation = function() {
- return this.cameraRotation;
- };
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
- /**
- * Calculate the location and rotation of the camera based on the
- * position and orientation of the camera arm
- */
- Graph3d.Camera.prototype.calculateCameraOrientation = function() {
- // calculate location of the camera
- this.cameraLocation.x = this.armLocation.x - this.armLength * Math.sin(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
- this.cameraLocation.y = this.armLocation.y - this.armLength * Math.cos(this.armRotation.horizontal) * Math.cos(this.armRotation.vertical);
- this.cameraLocation.z = this.armLocation.z + this.armLength * Math.sin(this.armRotation.vertical);
+ // apply options
+ if (options) {
+ this.setOptions(options);
+ }
- // calculate rotation of the camera
- this.cameraRotation.x = Math.PI/2 - this.armRotation.vertical;
- this.cameraRotation.y = 0;
- this.cameraRotation.z = -this.armRotation.horizontal;
- };
+ // create itemset
+ if (items) {
+ this.setItems(items);
+ }
+ else {
+ this.redraw();
+ }
+ }
+
+ // turn Timeline into an event emitter
+ Emitter(Timeline.prototype);
/**
- * Calculate the scaling values, dependent on the range in x, y, and z direction
+ * Create the main DOM for the Timeline: a root panel containing left, right,
+ * top, bottom, content, and background panel.
+ * @param {Element} container The container element where the Timeline will
+ * be attached.
+ * @private
*/
- Graph3d.prototype._setScale = function() {
- this.scale = new Point3d(1 / (this.xMax - this.xMin),
- 1 / (this.yMax - this.yMin),
- 1 / (this.zMax - this.zMin));
-
- // keep aspect ration between x and y scale if desired
- if (this.keepAspectRatio) {
- if (this.scale.x < this.scale.y) {
- //noinspection JSSuspiciousNameCombination
- this.scale.y = this.scale.x;
- }
- else {
- //noinspection JSSuspiciousNameCombination
- this.scale.x = this.scale.y;
- }
- }
+ Timeline.prototype._create = function (container) {
+ this.dom = {};
- // scale the vertical axis
- this.scale.z *= this.verticalRatio;
- // TODO: can this be automated? verticalRatio?
+ this.dom.root = document.createElement('div');
+ this.dom.background = document.createElement('div');
+ this.dom.backgroundVertical = document.createElement('div');
+ this.dom.backgroundHorizontal = document.createElement('div');
+ this.dom.centerContainer = document.createElement('div');
+ this.dom.leftContainer = document.createElement('div');
+ this.dom.rightContainer = document.createElement('div');
+ this.dom.center = document.createElement('div');
+ this.dom.left = document.createElement('div');
+ this.dom.right = document.createElement('div');
+ this.dom.top = document.createElement('div');
+ this.dom.bottom = document.createElement('div');
+ this.dom.shadowTop = document.createElement('div');
+ this.dom.shadowBottom = document.createElement('div');
+ this.dom.shadowTopLeft = document.createElement('div');
+ this.dom.shadowBottomLeft = document.createElement('div');
+ this.dom.shadowTopRight = document.createElement('div');
+ this.dom.shadowBottomRight = document.createElement('div');
- // determine scale for (optional) value
- this.scale.value = 1 / (this.valueMax - this.valueMin);
+ this.dom.background.className = 'vispanel background';
+ this.dom.backgroundVertical.className = 'vispanel background vertical';
+ this.dom.backgroundHorizontal.className = 'vispanel background horizontal';
+ this.dom.centerContainer.className = 'vispanel center';
+ this.dom.leftContainer.className = 'vispanel left';
+ this.dom.rightContainer.className = 'vispanel right';
+ this.dom.top.className = 'vispanel top';
+ this.dom.bottom.className = 'vispanel bottom';
+ this.dom.left.className = 'content';
+ this.dom.center.className = 'content';
+ this.dom.right.className = 'content';
+ this.dom.shadowTop.className = 'shadow top';
+ this.dom.shadowBottom.className = 'shadow bottom';
+ this.dom.shadowTopLeft.className = 'shadow top';
+ this.dom.shadowBottomLeft.className = 'shadow bottom';
+ this.dom.shadowTopRight.className = 'shadow top';
+ this.dom.shadowBottomRight.className = 'shadow bottom';
- // position the camera arm
- var xCenter = (this.xMax + this.xMin) / 2 * this.scale.x;
- var yCenter = (this.yMax + this.yMin) / 2 * this.scale.y;
- var zCenter = (this.zMax + this.zMin) / 2 * this.scale.z;
- this.camera.setArmLocation(xCenter, yCenter, zCenter);
- };
+ this.dom.root.appendChild(this.dom.background);
+ this.dom.root.appendChild(this.dom.backgroundVertical);
+ this.dom.root.appendChild(this.dom.backgroundHorizontal);
+ this.dom.root.appendChild(this.dom.centerContainer);
+ this.dom.root.appendChild(this.dom.leftContainer);
+ this.dom.root.appendChild(this.dom.rightContainer);
+ this.dom.root.appendChild(this.dom.top);
+ this.dom.root.appendChild(this.dom.bottom);
+ this.dom.centerContainer.appendChild(this.dom.center);
+ this.dom.leftContainer.appendChild(this.dom.left);
+ this.dom.rightContainer.appendChild(this.dom.right);
- /**
- * Convert a 3D location to a 2D location on screen
- * http://en.wikipedia.org/wiki/3D_projection
- * @param {Point3d} point3d A 3D point with parameters x, y, z
- * @return {Point2d} point2d A 2D point with parameters x, y
- */
- Graph3d.prototype._convert3Dto2D = function(point3d) {
- var translation = this._convertPointToTranslation(point3d);
- return this._convertTranslationToScreen(translation);
- };
+ this.dom.centerContainer.appendChild(this.dom.shadowTop);
+ this.dom.centerContainer.appendChild(this.dom.shadowBottom);
+ this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);
+ this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);
+ this.dom.rightContainer.appendChild(this.dom.shadowTopRight);
+ this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);
- /**
- * Convert a 3D location its translation seen from the camera
- * http://en.wikipedia.org/wiki/3D_projection
- * @param {Point3d} point3d A 3D point with parameters x, y, z
- * @return {Point3d} translation A 3D point with parameters x, y, z This is
- * the translation of the point, seen from the
- * camera
- */
- Graph3d.prototype._convertPointToTranslation = function(point3d) {
- var ax = point3d.x * this.scale.x,
- ay = point3d.y * this.scale.y,
- az = point3d.z * this.scale.z,
+ this.on('rangechange', this.redraw.bind(this));
+ this.on('change', this.redraw.bind(this));
+ this.on('touch', this._onTouch.bind(this));
+ this.on('pinch', this._onPinch.bind(this));
+ this.on('dragstart', this._onDragStart.bind(this));
+ this.on('drag', this._onDrag.bind(this));
- cx = this.camera.getCameraLocation().x,
- cy = this.camera.getCameraLocation().y,
- cz = this.camera.getCameraLocation().z,
+ // create event listeners for all interesting events, these events will be
+ // emitted via emitter
+ this.hammer = Hammer(this.dom.root, {
+ prevent_default: true
+ });
+ this.listeners = {};
- // calculate angles
- sinTx = Math.sin(this.camera.getCameraRotation().x),
- cosTx = Math.cos(this.camera.getCameraRotation().x),
- sinTy = Math.sin(this.camera.getCameraRotation().y),
- cosTy = Math.cos(this.camera.getCameraRotation().y),
- sinTz = Math.sin(this.camera.getCameraRotation().z),
- cosTz = Math.cos(this.camera.getCameraRotation().z),
+ var me = this;
+ var events = [
+ 'touch', 'pinch',
+ 'tap', 'doubletap', 'hold',
+ 'dragstart', 'drag', 'dragend',
+ 'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox
+ ];
+ events.forEach(function (event) {
+ var listener = function () {
+ var args = [event].concat(Array.prototype.slice.call(arguments, 0));
+ me.emit.apply(me, args);
+ };
+ me.hammer.on(event, listener);
+ me.listeners[event] = listener;
+ });
- // calculate translation
- dx = cosTy * (sinTz * (ay - cy) + cosTz * (ax - cx)) - sinTy * (az - cz),
- dy = sinTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) + cosTx * (cosTz * (ay - cy) - sinTz * (ax-cx)),
- dz = cosTx * (cosTy * (az - cz) + sinTy * (sinTz * (ay - cy) + cosTz * (ax - cx))) - sinTx * (cosTz * (ay - cy) - sinTz * (ax-cx));
+ // size properties of each of the panels
+ this.props = {
+ root: {},
+ background: {},
+ centerContainer: {},
+ leftContainer: {},
+ rightContainer: {},
+ center: {},
+ left: {},
+ right: {},
+ top: {},
+ bottom: {},
+ border: {},
+ scrollTop: 0,
+ scrollTopMin: 0
+ };
+ this.touch = {}; // store state information needed for touch events
- return new Point3d(dx, dy, dz);
+ // attach the root panel to the provided container
+ if (!container) throw new Error('No container provided');
+ container.appendChild(this.dom.root);
};
/**
- * Convert a translation point to a point on the screen
- * @param {Point3d} translation A 3D point with parameters x, y, z This is
- * the translation of the point, seen from the
- * camera
- * @return {Point2d} point2d A 2D point with parameters x, y
+ * Destroy the Timeline, clean up all DOM elements and event listeners.
*/
- Graph3d.prototype._convertTranslationToScreen = function(translation) {
- var ex = this.eye.x,
- ey = this.eye.y,
- ez = this.eye.z,
- dx = translation.x,
- dy = translation.y,
- dz = translation.z;
+ Timeline.prototype.destroy = function () {
+ // unbind datasets
+ this.clear();
- // calculate position on screen from translation
- var bx;
- var by;
- if (this.showPerspective) {
- bx = (dx - ex) * (ez / dz);
- by = (dy - ey) * (ez / dz);
+ // remove all event listeners
+ this.off();
+
+ // stop checking for changed size
+ this._stopAutoResize();
+
+ // remove from DOM
+ if (this.dom.root.parentNode) {
+ this.dom.root.parentNode.removeChild(this.dom.root);
}
- else {
- bx = dx * -(ez / this.camera.getArmLength());
- by = dy * -(ez / this.camera.getArmLength());
+ this.dom = null;
+
+ // cleanup hammer touch events
+ for (var event in this.listeners) {
+ if (this.listeners.hasOwnProperty(event)) {
+ delete this.listeners[event];
+ }
}
+ this.listeners = null;
+ this.hammer = null;
- // shift and scale the point to the center of the screen
- // use the width of the graph to scale both horizontally and vertically.
- return new Point2d(
- this.xcenter + bx * this.frame.canvas.clientWidth,
- this.ycenter - by * this.frame.canvas.clientWidth);
+ // give all components the opportunity to cleanup
+ this.components.forEach(function (component) {
+ component.destroy();
+ });
+
+ this.body = null;
};
/**
- * Set the background styling for the graph
- * @param {string | {fill: string, stroke: string, strokeWidth: string}} backgroundColor
+ * Set options. Options will be passed to all components loaded in the Timeline.
+ * @param {Object} [options]
+ * {String} orientation
+ * Vertical orientation for the Timeline,
+ * can be 'bottom' (default) or 'top'.
+ * {String | Number} width
+ * Width for the timeline, a number in pixels or
+ * a css string like '1000px' or '75%'. '100%' by default.
+ * {String | Number} height
+ * Fixed height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'. If undefined,
+ * The Timeline will automatically size such that
+ * its contents fit.
+ * {String | Number} minHeight
+ * Minimum height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {String | Number} maxHeight
+ * Maximum height for the Timeline, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {Number | Date | String} start
+ * Start date for the visible window
+ * {Number | Date | String} end
+ * End date for the visible window
*/
- Graph3d.prototype._setBackgroundColor = function(backgroundColor) {
- var fill = 'white';
- var stroke = 'gray';
- var strokeWidth = 1;
+ Timeline.prototype.setOptions = function (options) {
+ if (options) {
+ // copy the known options
+ var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'orientation'];
+ util.selectiveExtend(fields, this.options, options);
- if (typeof(backgroundColor) === 'string') {
- fill = backgroundColor;
- stroke = 'none';
- strokeWidth = 0;
- }
- else if (typeof(backgroundColor) === 'object') {
- if (backgroundColor.fill !== undefined) fill = backgroundColor.fill;
- if (backgroundColor.stroke !== undefined) stroke = backgroundColor.stroke;
- if (backgroundColor.strokeWidth !== undefined) strokeWidth = backgroundColor.strokeWidth;
- }
- else if (backgroundColor === undefined) {
- // use use defaults
- }
- else {
- throw 'Unsupported type of backgroundColor';
+ // enable/disable autoResize
+ this._initAutoResize();
}
- this.frame.style.backgroundColor = fill;
- this.frame.style.borderColor = stroke;
- this.frame.style.borderWidth = strokeWidth + 'px';
- this.frame.style.borderStyle = 'solid';
- };
+ // propagate options to all components
+ this.components.forEach(function (component) {
+ component.setOptions(options);
+ });
+ // TODO: remove deprecation error one day (deprecated since version 0.8.0)
+ if (options && options.order) {
+ throw new Error('Option order is deprecated. There is no replacement for this feature.');
+ }
- /// enumerate the available styles
- Graph3d.STYLE = {
- BAR: 0,
- BARCOLOR: 1,
- BARSIZE: 2,
- DOT : 3,
- DOTLINE : 4,
- DOTCOLOR: 5,
- DOTSIZE: 6,
- GRID : 7,
- LINE: 8,
- SURFACE : 9
+ // redraw everything
+ this.redraw();
};
/**
- * Retrieve the style index from given styleName
- * @param {string} styleName Style name such as 'dot', 'grid', 'dot-line'
- * @return {Number} styleNumber Enumeration value representing the style, or -1
- * when not found
+ * Set a custom time bar
+ * @param {Date} time
*/
- Graph3d.prototype._getStyleNumber = function(styleName) {
- switch (styleName) {
- case 'dot': return Graph3d.STYLE.DOT;
- case 'dot-line': return Graph3d.STYLE.DOTLINE;
- case 'dot-color': return Graph3d.STYLE.DOTCOLOR;
- case 'dot-size': return Graph3d.STYLE.DOTSIZE;
- case 'line': return Graph3d.STYLE.LINE;
- case 'grid': return Graph3d.STYLE.GRID;
- case 'surface': return Graph3d.STYLE.SURFACE;
- case 'bar': return Graph3d.STYLE.BAR;
- case 'bar-color': return Graph3d.STYLE.BARCOLOR;
- case 'bar-size': return Graph3d.STYLE.BARSIZE;
+ Timeline.prototype.setCustomTime = function (time) {
+ if (!this.customTime) {
+ throw new Error('Cannot get custom time: Custom time bar is not enabled');
}
- return -1;
+ this.customTime.setCustomTime(time);
};
/**
- * Determine the indexes of the data columns, based on the given style and data
- * @param {DataSet} data
- * @param {Number} style
+ * Retrieve the current custom time.
+ * @return {Date} customTime
*/
- Graph3d.prototype._determineColumnIndexes = function(data, style) {
- if (this.style === Graph3d.STYLE.DOT ||
- this.style === Graph3d.STYLE.DOTLINE ||
- this.style === Graph3d.STYLE.LINE ||
- this.style === Graph3d.STYLE.GRID ||
- this.style === Graph3d.STYLE.SURFACE ||
- this.style === Graph3d.STYLE.BAR) {
- // 3 columns expected, and optionally a 4th with filter values
- this.colX = 0;
- this.colY = 1;
- this.colZ = 2;
- this.colValue = undefined;
-
- if (data.getNumberOfColumns() > 3) {
- this.colFilter = 3;
- }
+ Timeline.prototype.getCustomTime = function() {
+ if (!this.customTime) {
+ throw new Error('Cannot get custom time: Custom time bar is not enabled');
}
- else if (this.style === Graph3d.STYLE.DOTCOLOR ||
- this.style === Graph3d.STYLE.DOTSIZE ||
- this.style === Graph3d.STYLE.BARCOLOR ||
- this.style === Graph3d.STYLE.BARSIZE) {
- // 4 columns expected, and optionally a 5th with filter values
- this.colX = 0;
- this.colY = 1;
- this.colZ = 2;
- this.colValue = 3;
- if (data.getNumberOfColumns() > 4) {
- this.colFilter = 4;
- }
- }
- else {
- throw 'Unknown style "' + this.style + '"';
- }
+ return this.customTime.getCustomTime();
};
- Graph3d.prototype.getNumberOfRows = function(data) {
- return data.length;
- }
-
+ /**
+ * Set items
+ * @param {vis.DataSet | Array | google.visualization.DataTable | null} items
+ */
+ Timeline.prototype.setItems = function(items) {
+ var initialLoad = (this.itemsData == null);
- Graph3d.prototype.getNumberOfColumns = function(data) {
- var counter = 0;
- for (var column in data[0]) {
- if (data[0].hasOwnProperty(column)) {
- counter++;
- }
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!items) {
+ newDataSet = null;
}
- return counter;
- }
-
-
- Graph3d.prototype.getDistinctValues = function(data, column) {
- var distinctValues = [];
- for (var i = 0; i < data.length; i++) {
- if (distinctValues.indexOf(data[i][column]) == -1) {
- distinctValues.push(data[i][column]);
- }
+ else if (items instanceof DataSet || items instanceof DataView) {
+ newDataSet = items;
+ }
+ else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(items, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
}
- return distinctValues;
- }
+ // set items
+ this.itemsData = newDataSet;
+ this.itemSet && this.itemSet.setItems(newDataSet);
- Graph3d.prototype.getColumnRange = function(data,column) {
- var minMax = {min:data[0][column],max:data[0][column]};
- for (var i = 0; i < data.length; i++) {
- if (minMax.min > data[i][column]) { minMax.min = data[i][column]; }
- if (minMax.max < data[i][column]) { minMax.max = data[i][column]; }
+ if (initialLoad && ('start' in this.options || 'end' in this.options)) {
+ this.fit();
+
+ var start = ('start' in this.options) ? util.convert(this.options.start, 'Date') : null;
+ var end = ('end' in this.options) ? util.convert(this.options.end, 'Date') : null;
+
+ this.setWindow(start, end);
}
- return minMax;
};
/**
- * Initialize the data from the data table. Calculate minimum and maximum values
- * and column index values
- * @param {Array | DataSet | DataView} rawData The data containing the items for the Graph.
- * @param {Number} style Style Number
+ * Set groups
+ * @param {vis.DataSet | Array | google.visualization.DataTable} groups
*/
- Graph3d.prototype._dataInitialize = function (rawData, style) {
- var me = this;
-
- // unsubscribe from the dataTable
- if (this.dataSet) {
- this.dataSet.off('*', this._onChange);
- }
-
- if (rawData === undefined)
- return;
-
- if (Array.isArray(rawData)) {
- rawData = new DataSet(rawData);
+ Timeline.prototype.setGroups = function(groups) {
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!groups) {
+ newDataSet = null;
}
-
- var data;
- if (rawData instanceof DataSet || rawData instanceof DataView) {
- data = rawData.get();
+ else if (groups instanceof DataSet || groups instanceof DataView) {
+ newDataSet = groups;
}
else {
- throw new Error('Array, DataSet, or DataView expected');
+ // turn an array into a dataset
+ newDataSet = new DataSet(groups);
}
- if (data.length == 0)
- return;
-
- this.dataSet = rawData;
- this.dataTable = data;
+ this.groupsData = newDataSet;
+ this.itemSet.setGroups(newDataSet);
+ };
- // subscribe to changes in the dataset
- this._onChange = function () {
- me.setData(me.dataSet);
- };
- this.dataSet.on('*', this._onChange);
+ /**
+ * Clear the Timeline. By Default, items, groups and options are cleared.
+ * Example usage:
+ *
+ * timeline.clear(); // clear items, groups, and options
+ * timeline.clear({options: true}); // clear options only
+ *
+ * @param {Object} [what] Optionally specify what to clear. By default:
+ * {items: true, groups: true, options: true}
+ */
+ Timeline.prototype.clear = function(what) {
+ // clear items
+ if (!what || what.items) {
+ this.setItems(null);
+ }
- // _determineColumnIndexes
- // getNumberOfRows (points)
- // getNumberOfColumns (x,y,z,v,t,t1,t2...)
- // getDistinctValues (unique values?)
- // getColumnRange
+ // clear groups
+ if (!what || what.groups) {
+ this.setGroups(null);
+ }
- // determine the location of x,y,z,value,filter columns
- this.colX = 'x';
- this.colY = 'y';
- this.colZ = 'z';
- this.colValue = 'style';
- this.colFilter = 'filter';
+ // clear options of timeline and of each of the components
+ if (!what || what.options) {
+ this.components.forEach(function (component) {
+ component.setOptions(component.defaultOptions);
+ });
+ this.setOptions(this.defaultOptions); // this will also do a redraw
+ }
+ };
+ /**
+ * Set Timeline window such that it fits all items
+ */
+ Timeline.prototype.fit = function() {
+ // apply the data range as range
+ var dataRange = this.getItemRange();
- // check if a filter column is provided
- if (data[0].hasOwnProperty('filter')) {
- if (this.dataFilter === undefined) {
- this.dataFilter = new Filter(rawData, this.colFilter, this);
- this.dataFilter.setOnLoadCallback(function() {me.redraw();});
+ // add 5% space on both sides
+ var start = dataRange.min;
+ var end = dataRange.max;
+ if (start != null && end != null) {
+ var interval = (end.valueOf() - start.valueOf());
+ if (interval <= 0) {
+ // prevent an empty interval
+ interval = 24 * 60 * 60 * 1000; // 1 day
}
+ start = new Date(start.valueOf() - interval * 0.05);
+ end = new Date(end.valueOf() + interval * 0.05);
+ }
+
+ // skip range set if there is no start and end date
+ if (start === null && end === null) {
+ return;
}
+ this.range.setRange(start, end);
+ };
- var withBars = this.style == Graph3d.STYLE.BAR ||
- this.style == Graph3d.STYLE.BARCOLOR ||
- this.style == Graph3d.STYLE.BARSIZE;
+ /**
+ * Get the data range of the item set.
+ * @returns {{min: Date, max: Date}} range A range with a start and end Date.
+ * When no minimum is found, min==null
+ * When no maximum is found, max==null
+ */
+ Timeline.prototype.getItemRange = function() {
+ // calculate min from start filed
+ var dataset = this.itemsData.getDataSet(),
+ min = null,
+ max = null;
- // determine barWidth from data
- if (withBars) {
- if (this.defaultXBarWidth !== undefined) {
- this.xBarWidth = this.defaultXBarWidth;
- }
- else {
- var dataX = this.getDistinctValues(data,this.colX);
- this.xBarWidth = (dataX[1] - dataX[0]) || 1;
- }
+ if (dataset) {
+ // calculate the minimum value of the field 'start'
+ var minItem = dataset.min('start');
+ min = minItem ? util.convert(minItem.start, 'Date').valueOf() : null;
+ // Note: we convert first to Date and then to number because else
+ // a conversion from ISODate to Number will fail
- if (this.defaultYBarWidth !== undefined) {
- this.yBarWidth = this.defaultYBarWidth;
+ // calculate maximum value of fields 'start' and 'end'
+ var maxStartItem = dataset.max('start');
+ if (maxStartItem) {
+ max = util.convert(maxStartItem.start, 'Date').valueOf();
}
- else {
- var dataY = this.getDistinctValues(data,this.colY);
- this.yBarWidth = (dataY[1] - dataY[0]) || 1;
+ var maxEndItem = dataset.max('end');
+ if (maxEndItem) {
+ if (max == null) {
+ max = util.convert(maxEndItem.end, 'Date').valueOf();
+ }
+ else {
+ max = Math.max(max, util.convert(maxEndItem.end, 'Date').valueOf());
+ }
}
}
- // calculate minimums and maximums
- var xRange = this.getColumnRange(data,this.colX);
- if (withBars) {
- xRange.min -= this.xBarWidth / 2;
- xRange.max += this.xBarWidth / 2;
- }
- this.xMin = (this.defaultXMin !== undefined) ? this.defaultXMin : xRange.min;
- this.xMax = (this.defaultXMax !== undefined) ? this.defaultXMax : xRange.max;
- if (this.xMax <= this.xMin) this.xMax = this.xMin + 1;
- this.xStep = (this.defaultXStep !== undefined) ? this.defaultXStep : (this.xMax-this.xMin)/5;
+ return {
+ min: (min != null) ? new Date(min) : null,
+ max: (max != null) ? new Date(max) : null
+ };
+ };
- var yRange = this.getColumnRange(data,this.colY);
- if (withBars) {
- yRange.min -= this.yBarWidth / 2;
- yRange.max += this.yBarWidth / 2;
- }
- this.yMin = (this.defaultYMin !== undefined) ? this.defaultYMin : yRange.min;
- this.yMax = (this.defaultYMax !== undefined) ? this.defaultYMax : yRange.max;
- if (this.yMax <= this.yMin) this.yMax = this.yMin + 1;
- this.yStep = (this.defaultYStep !== undefined) ? this.defaultYStep : (this.yMax-this.yMin)/5;
+ /**
+ * Set selected items by their id. Replaces the current selection
+ * Unknown id's are silently ignored.
+ * @param {Array} [ids] An array with zero or more id's of the items to be
+ * selected. If ids is an empty array, all items will be
+ * unselected.
+ */
+ Timeline.prototype.setSelection = function(ids) {
+ this.itemSet && this.itemSet.setSelection(ids);
+ };
- var zRange = this.getColumnRange(data,this.colZ);
- this.zMin = (this.defaultZMin !== undefined) ? this.defaultZMin : zRange.min;
- this.zMax = (this.defaultZMax !== undefined) ? this.defaultZMax : zRange.max;
- if (this.zMax <= this.zMin) this.zMax = this.zMin + 1;
- this.zStep = (this.defaultZStep !== undefined) ? this.defaultZStep : (this.zMax-this.zMin)/5;
+ /**
+ * Get the selected items by their id
+ * @return {Array} ids The ids of the selected items
+ */
+ Timeline.prototype.getSelection = function() {
+ return this.itemSet && this.itemSet.getSelection() || [];
+ };
- if (this.colValue !== undefined) {
- var valueRange = this.getColumnRange(data,this.colValue);
- this.valueMin = (this.defaultValueMin !== undefined) ? this.defaultValueMin : valueRange.min;
- this.valueMax = (this.defaultValueMax !== undefined) ? this.defaultValueMax : valueRange.max;
- if (this.valueMax <= this.valueMin) this.valueMax = this.valueMin + 1;
+ /**
+ * Set the visible window. Both parameters are optional, you can change only
+ * start or only end. Syntax:
+ *
+ * TimeLine.setWindow(start, end)
+ * TimeLine.setWindow(range)
+ *
+ * Where start and end can be a Date, number, or string, and range is an
+ * object with properties start and end.
+ *
+ * @param {Date | Number | String | Object} [start] Start date of visible window
+ * @param {Date | Number | String} [end] End date of visible window
+ */
+ Timeline.prototype.setWindow = function(start, end) {
+ if (arguments.length == 1) {
+ var range = arguments[0];
+ this.range.setRange(range.start, range.end);
+ }
+ else {
+ this.range.setRange(start, end);
}
+ };
- // set the scale dependent on the ranges.
- this._setScale();
+ /**
+ * Get the visible window
+ * @return {{start: Date, end: Date}} Visible range
+ */
+ Timeline.prototype.getWindow = function() {
+ var range = this.range.getRange();
+ return {
+ start: new Date(range.start),
+ end: new Date(range.end)
+ };
};
-
-
/**
- * Filter the data based on the current filter
- * @param {Array} data
- * @return {Array} dataPoints Array with point objects which can be drawn on screen
+ * Force a redraw of the Timeline. Can be useful to manually redraw when
+ * option autoResize=false
*/
- Graph3d.prototype._getDataPoints = function (data) {
- // TODO: store the created matrix dataPoints in the filters instead of reloading each time
- var x, y, i, z, obj, point;
-
- var dataPoints = [];
-
- if (this.style === Graph3d.STYLE.GRID ||
- this.style === Graph3d.STYLE.SURFACE) {
- // copy all values from the google data table to a matrix
- // the provided values are supposed to form a grid of (x,y) positions
-
- // create two lists with all present x and y values
- var dataX = [];
- var dataY = [];
- for (i = 0; i < this.getNumberOfRows(data); i++) {
- x = data[i][this.colX] || 0;
- y = data[i][this.colY] || 0;
-
- if (dataX.indexOf(x) === -1) {
- dataX.push(x);
- }
- if (dataY.indexOf(y) === -1) {
- dataY.push(y);
- }
- }
-
- function sortNumber(a, b) {
- return a - b;
- }
- dataX.sort(sortNumber);
- dataY.sort(sortNumber);
-
- // create a grid, a 2d matrix, with all values.
- var dataMatrix = []; // temporary data matrix
- for (i = 0; i < data.length; i++) {
- x = data[i][this.colX] || 0;
- y = data[i][this.colY] || 0;
- z = data[i][this.colZ] || 0;
+ Timeline.prototype.redraw = function() {
+ var resized = false,
+ options = this.options,
+ props = this.props,
+ dom = this.dom;
- var xIndex = dataX.indexOf(x); // TODO: implement Array().indexOf() for Internet Explorer
- var yIndex = dataY.indexOf(y);
+ if (!dom) return; // when destroyed
- if (dataMatrix[xIndex] === undefined) {
- dataMatrix[xIndex] = [];
- }
+ // update class names
+ dom.root.className = 'vis timeline root ' + options.orientation;
- var point3d = new Point3d();
- point3d.x = x;
- point3d.y = y;
- point3d.z = z;
+ // update root width and height options
+ dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');
+ dom.root.style.minHeight = util.option.asSize(options.minHeight, '');
+ dom.root.style.width = util.option.asSize(options.width, '');
- obj = {};
- obj.point = point3d;
- obj.trans = undefined;
- obj.screen = undefined;
- obj.bottom = new Point3d(x, y, this.zMin);
+ // calculate border widths
+ props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;
+ props.border.right = props.border.left;
+ props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2;
+ props.border.bottom = props.border.top;
+ var borderRootHeight= dom.root.offsetHeight - dom.root.clientHeight;
+ var borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth;
- dataMatrix[xIndex][yIndex] = obj;
+ // calculate the heights. If any of the side panels is empty, we set the height to
+ // minus the border width, such that the border will be invisible
+ props.center.height = dom.center.offsetHeight;
+ props.left.height = dom.left.offsetHeight;
+ props.right.height = dom.right.offsetHeight;
+ props.top.height = dom.top.clientHeight || -props.border.top;
+ props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;
- dataPoints.push(obj);
- }
+ // TODO: compensate borders when any of the panels is empty.
- // fill in the pointers to the neighbors.
- for (x = 0; x < dataMatrix.length; x++) {
- for (y = 0; y < dataMatrix[x].length; y++) {
- if (dataMatrix[x][y]) {
- dataMatrix[x][y].pointRight = (x < dataMatrix.length-1) ? dataMatrix[x+1][y] : undefined;
- dataMatrix[x][y].pointTop = (y < dataMatrix[x].length-1) ? dataMatrix[x][y+1] : undefined;
- dataMatrix[x][y].pointCross =
- (x < dataMatrix.length-1 && y < dataMatrix[x].length-1) ?
- dataMatrix[x+1][y+1] :
- undefined;
- }
- }
- }
- }
- else { // 'dot', 'dot-line', etc.
- // copy all values from the google data table to a list with Point3d objects
- for (i = 0; i < data.length; i++) {
- point = new Point3d();
- point.x = data[i][this.colX] || 0;
- point.y = data[i][this.colY] || 0;
- point.z = data[i][this.colZ] || 0;
+ // apply auto height
+ // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)
+ var contentHeight = Math.max(props.left.height, props.center.height, props.right.height);
+ var autoHeight = props.top.height + contentHeight + props.bottom.height +
+ borderRootHeight + props.border.top + props.border.bottom;
+ dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px');
- if (this.colValue !== undefined) {
- point.value = data[i][this.colValue] || 0;
- }
+ // calculate heights of the content panels
+ props.root.height = dom.root.offsetHeight;
+ props.background.height = props.root.height - borderRootHeight;
+ var containerHeight = props.root.height - props.top.height - props.bottom.height -
+ borderRootHeight;
+ props.centerContainer.height = containerHeight;
+ props.leftContainer.height = containerHeight;
+ props.rightContainer.height = props.leftContainer.height;
- obj = {};
- obj.point = point;
- obj.bottom = new Point3d(point.x, point.y, this.zMin);
- obj.trans = undefined;
- obj.screen = undefined;
+ // calculate the widths of the panels
+ props.root.width = dom.root.offsetWidth;
+ props.background.width = props.root.width - borderRootWidth;
+ props.left.width = dom.leftContainer.clientWidth || -props.border.left;
+ props.leftContainer.width = props.left.width;
+ props.right.width = dom.rightContainer.clientWidth || -props.border.right;
+ props.rightContainer.width = props.right.width;
+ var centerWidth = props.root.width - props.left.width - props.right.width - borderRootWidth;
+ props.center.width = centerWidth;
+ props.centerContainer.width = centerWidth;
+ props.top.width = centerWidth;
+ props.bottom.width = centerWidth;
- dataPoints.push(obj);
- }
- }
+ // resize the panels
+ dom.background.style.height = props.background.height + 'px';
+ dom.backgroundVertical.style.height = props.background.height + 'px';
+ dom.backgroundHorizontal.style.height = props.centerContainer.height + 'px';
+ dom.centerContainer.style.height = props.centerContainer.height + 'px';
+ dom.leftContainer.style.height = props.leftContainer.height + 'px';
+ dom.rightContainer.style.height = props.rightContainer.height + 'px';
- return dataPoints;
- };
+ dom.background.style.width = props.background.width + 'px';
+ dom.backgroundVertical.style.width = props.centerContainer.width + 'px';
+ dom.backgroundHorizontal.style.width = props.background.width + 'px';
+ dom.centerContainer.style.width = props.center.width + 'px';
+ dom.top.style.width = props.top.width + 'px';
+ dom.bottom.style.width = props.bottom.width + 'px';
- /**
- * Create the main frame for the Graph3d.
- * This function is executed once when a Graph3d object is created. The frame
- * contains a canvas, and this canvas contains all objects like the axis and
- * nodes.
- */
- Graph3d.prototype.create = function () {
- // remove all elements from the container element.
- while (this.containerElement.hasChildNodes()) {
- this.containerElement.removeChild(this.containerElement.firstChild);
- }
+ // reposition the panels
+ dom.background.style.left = '0';
+ dom.background.style.top = '0';
+ dom.backgroundVertical.style.left = props.left.width + 'px';
+ dom.backgroundVertical.style.top = '0';
+ dom.backgroundHorizontal.style.left = '0';
+ dom.backgroundHorizontal.style.top = props.top.height + 'px';
+ dom.centerContainer.style.left = props.left.width + 'px';
+ dom.centerContainer.style.top = props.top.height + 'px';
+ dom.leftContainer.style.left = '0';
+ dom.leftContainer.style.top = props.top.height + 'px';
+ dom.rightContainer.style.left = (props.left.width + props.center.width) + 'px';
+ dom.rightContainer.style.top = props.top.height + 'px';
+ dom.top.style.left = props.left.width + 'px';
+ dom.top.style.top = '0';
+ dom.bottom.style.left = props.left.width + 'px';
+ dom.bottom.style.top = (props.top.height + props.centerContainer.height) + 'px';
- this.frame = document.createElement('div');
- this.frame.style.position = 'relative';
- this.frame.style.overflow = 'hidden';
+ // update the scrollTop, feasible range for the offset can be changed
+ // when the height of the Timeline or of the contents of the center changed
+ this._updateScrollTop();
- // create the graph canvas (HTML canvas element)
- this.frame.canvas = document.createElement( 'canvas' );
- this.frame.canvas.style.position = 'relative';
- this.frame.appendChild(this.frame.canvas);
- //if (!this.frame.canvas.getContext) {
- {
- var noCanvas = document.createElement( 'DIV' );
- noCanvas.style.color = 'red';
- noCanvas.style.fontWeight = 'bold' ;
- noCanvas.style.padding = '10px';
- noCanvas.innerHTML = 'Error: your browser does not support HTML canvas';
- this.frame.canvas.appendChild(noCanvas);
+ // reposition the scrollable contents
+ var offset = this.props.scrollTop;
+ if (options.orientation == 'bottom') {
+ offset += Math.max(this.props.centerContainer.height - this.props.center.height -
+ this.props.border.top - this.props.border.bottom, 0);
}
+ dom.center.style.left = '0';
+ dom.center.style.top = offset + 'px';
+ dom.left.style.left = '0';
+ dom.left.style.top = offset + 'px';
+ dom.right.style.left = '0';
+ dom.right.style.top = offset + 'px';
- this.frame.filter = document.createElement( 'div' );
- this.frame.filter.style.position = 'absolute';
- this.frame.filter.style.bottom = '0px';
- this.frame.filter.style.left = '0px';
- this.frame.filter.style.width = '100%';
- this.frame.appendChild(this.frame.filter);
-
- // add event listeners to handle moving and zooming the contents
- var me = this;
- var onmousedown = function (event) {me._onMouseDown(event);};
- var ontouchstart = function (event) {me._onTouchStart(event);};
- var onmousewheel = function (event) {me._onWheel(event);};
- var ontooltip = function (event) {me._onTooltip(event);};
- // TODO: these events are never cleaned up... can give a 'memory leakage'
-
- G3DaddEventListener(this.frame.canvas, 'keydown', onkeydown);
- G3DaddEventListener(this.frame.canvas, 'mousedown', onmousedown);
- G3DaddEventListener(this.frame.canvas, 'touchstart', ontouchstart);
- G3DaddEventListener(this.frame.canvas, 'mousewheel', onmousewheel);
- G3DaddEventListener(this.frame.canvas, 'mousemove', ontooltip);
+ // show shadows when vertical scrolling is available
+ var visibilityTop = this.props.scrollTop == 0 ? 'hidden' : '';
+ var visibilityBottom = this.props.scrollTop == this.props.scrollTopMin ? 'hidden' : '';
+ dom.shadowTop.style.visibility = visibilityTop;
+ dom.shadowBottom.style.visibility = visibilityBottom;
+ dom.shadowTopLeft.style.visibility = visibilityTop;
+ dom.shadowBottomLeft.style.visibility = visibilityBottom;
+ dom.shadowTopRight.style.visibility = visibilityTop;
+ dom.shadowBottomRight.style.visibility = visibilityBottom;
- // add the new graph to the container element
- this.containerElement.appendChild(this.frame);
+ // redraw all components
+ this.components.forEach(function (component) {
+ resized = component.redraw() || resized;
+ });
+ if (resized) {
+ // keep repainting until all sizes are settled
+ this.redraw();
+ }
};
+ // TODO: deprecated since version 1.1.0, remove some day
+ Timeline.prototype.repaint = function () {
+ throw new Error('Function repaint is deprecated. Use redraw instead.');
+ };
/**
- * Set a new size for the graph
- * @param {string} width Width in pixels or percentage (for example '800px'
- * or '50%')
- * @param {string} height Height in pixels or percentage (for example '400px'
- * or '30%')
+ * Convert a position on screen (pixels) to a datetime
+ * @param {int} x Position on the screen in pixels
+ * @return {Date} time The datetime the corresponds with given position x
+ * @private
*/
- Graph3d.prototype.setSize = function(width, height) {
- this.frame.style.width = width;
- this.frame.style.height = height;
-
- this._resizeCanvas();
+ // TODO: move this function to Range
+ Timeline.prototype._toTime = function(x) {
+ var conversion = this.range.conversion(this.props.center.width);
+ return new Date(x / conversion.scale + conversion.offset);
};
+
/**
- * Resize the canvas to the current size of the frame
+ * Convert a position on the global screen (pixels) to a datetime
+ * @param {int} x Position on the screen in pixels
+ * @return {Date} time The datetime the corresponds with given position x
+ * @private
*/
- Graph3d.prototype._resizeCanvas = function() {
- this.frame.canvas.style.width = '100%';
- this.frame.canvas.style.height = '100%';
-
- this.frame.canvas.width = this.frame.canvas.clientWidth;
- this.frame.canvas.height = this.frame.canvas.clientHeight;
-
- // adjust with for margin
- this.frame.filter.style.width = (this.frame.canvas.clientWidth - 2 * 10) + 'px';
+ // TODO: move this function to Range
+ Timeline.prototype._toGlobalTime = function(x) {
+ var conversion = this.range.conversion(this.props.root.width);
+ return new Date(x / conversion.scale + conversion.offset);
};
/**
- * Start animation
+ * Convert a datetime (Date object) into a position on the screen
+ * @param {Date} time A date
+ * @return {int} x The position on the screen in pixels which corresponds
+ * with the given date.
+ * @private
*/
- Graph3d.prototype.animationStart = function() {
- if (!this.frame.filter || !this.frame.filter.slider)
- throw 'No animation available';
-
- this.frame.filter.slider.play();
+ // TODO: move this function to Range
+ Timeline.prototype._toScreen = function(time) {
+ var conversion = this.range.conversion(this.props.center.width);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
};
/**
- * Stop animation
+ * Convert a datetime (Date object) into a position on the root
+ * This is used to get the pixel density estimate for the screen, not the center panel
+ * @param {Date} time A date
+ * @return {int} x The position on root in pixels which corresponds
+ * with the given date.
+ * @private
*/
- Graph3d.prototype.animationStop = function() {
- if (!this.frame.filter || !this.frame.filter.slider) return;
-
- this.frame.filter.slider.stop();
+ // TODO: move this function to Range
+ Timeline.prototype._toGlobalScreen = function(time) {
+ var conversion = this.range.conversion(this.props.root.width);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
};
/**
- * Resize the center position based on the current values in this.defaultXCenter
- * and this.defaultYCenter (which are strings with a percentage or a value
- * in pixels). The center positions are the variables this.xCenter
- * and this.yCenter
+ * Initialize watching when option autoResize is true
+ * @private
*/
- Graph3d.prototype._resizeCenter = function() {
- // calculate the horizontal center position
- if (this.defaultXCenter.charAt(this.defaultXCenter.length-1) === '%') {
- this.xcenter =
- parseFloat(this.defaultXCenter) / 100 *
- this.frame.canvas.clientWidth;
- }
- else {
- this.xcenter = parseFloat(this.defaultXCenter); // supposed to be in px
- }
-
- // calculate the vertical center position
- if (this.defaultYCenter.charAt(this.defaultYCenter.length-1) === '%') {
- this.ycenter =
- parseFloat(this.defaultYCenter) / 100 *
- (this.frame.canvas.clientHeight - this.frame.filter.clientHeight);
+ Timeline.prototype._initAutoResize = function () {
+ if (this.options.autoResize == true) {
+ this._startAutoResize();
}
else {
- this.ycenter = parseFloat(this.defaultYCenter); // supposed to be in px
+ this._stopAutoResize();
}
};
/**
- * Set the rotation and distance of the camera
- * @param {Object} pos An object with the camera position. The object
- * contains three parameters:
- * - horizontal {Number}
- * The horizontal rotation, between 0 and 2*PI.
- * Optional, can be left undefined.
- * - vertical {Number}
- * The vertical rotation, between 0 and 0.5*PI
- * if vertical=0.5*PI, the graph is shown from the
- * top. Optional, can be left undefined.
- * - distance {Number}
- * The (normalized) distance of the camera to the
- * center of the graph, a value between 0.71 and 5.0.
- * Optional, can be left undefined.
+ * Watch for changes in the size of the container. On resize, the Panel will
+ * automatically redraw itself.
+ * @private
*/
- Graph3d.prototype.setCameraPosition = function(pos) {
- if (pos === undefined) {
- return;
- }
+ Timeline.prototype._startAutoResize = function () {
+ var me = this;
- if (pos.horizontal !== undefined && pos.vertical !== undefined) {
- this.camera.setArmRotation(pos.horizontal, pos.vertical);
- }
+ this._stopAutoResize();
- if (pos.distance !== undefined) {
- this.camera.setArmLength(pos.distance);
+ this._onResize = function() {
+ if (me.options.autoResize != true) {
+ // stop watching when the option autoResize is changed to false
+ me._stopAutoResize();
+ return;
+ }
+
+ if (me.dom.root) {
+ // check whether the frame is resized
+ if ((me.dom.root.clientWidth != me.props.lastWidth) ||
+ (me.dom.root.clientHeight != me.props.lastHeight)) {
+ me.props.lastWidth = me.dom.root.clientWidth;
+ me.props.lastHeight = me.dom.root.clientHeight;
+
+ me.emit('change');
+ }
+ }
+ };
+
+ // add event listener to window resize
+ util.addEventListener(window, 'resize', this._onResize);
+
+ this.watchTimer = setInterval(this._onResize, 1000);
+ };
+
+ /**
+ * Stop watching for a resize of the frame.
+ * @private
+ */
+ Timeline.prototype._stopAutoResize = function () {
+ if (this.watchTimer) {
+ clearInterval(this.watchTimer);
+ this.watchTimer = undefined;
}
- this.redraw();
+ // remove event listener on window.resize
+ util.removeEventListener(window, 'resize', this._onResize);
+ this._onResize = null;
};
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Timeline.prototype._onTouch = function (event) {
+ this.touch.allowDragging = true;
+ };
/**
- * Retrieve the current camera rotation
- * @return {object} An object with parameters horizontal, vertical, and
- * distance
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
*/
- Graph3d.prototype.getCameraPosition = function() {
- var pos = this.camera.getArmRotation();
- pos.distance = this.camera.getArmLength();
- return pos;
+ Timeline.prototype._onPinch = function (event) {
+ this.touch.allowDragging = false;
};
/**
- * Load data into the 3D Graph
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
*/
- Graph3d.prototype._readData = function(data) {
- // read the data
- this._dataInitialize(data, this.style);
+ Timeline.prototype._onDragStart = function (event) {
+ this.touch.initialScrollTop = this.props.scrollTop;
+ };
+ /**
+ * Move the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Timeline.prototype._onDrag = function (event) {
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.touch.allowDragging) return;
- if (this.dataFilter) {
- // apply filtering
- this.dataPoints = this.dataFilter._getDataPoints();
- }
- else {
- // no filtering. load all data
- this.dataPoints = this._getDataPoints(this.dataTable);
- }
+ var delta = event.gesture.deltaY;
- // draw the filter
- this._redrawFilter();
+ var oldScrollTop = this._getScrollTop();
+ var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);
+
+ if (newScrollTop != oldScrollTop) {
+ this.redraw(); // TODO: this causes two redraws when dragging, the other is triggered by rangechange already
+ }
};
/**
- * Replace the dataset of the Graph3d
- * @param {Array | DataSet | DataView} data
+ * Apply a scrollTop
+ * @param {Number} scrollTop
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
*/
- Graph3d.prototype.setData = function (data) {
- this._readData(data);
- this.redraw();
+ Timeline.prototype._setScrollTop = function (scrollTop) {
+ this.props.scrollTop = scrollTop;
+ this._updateScrollTop();
+ return this.props.scrollTop;
+ };
- // start animation when option is true
- if (this.animationAutoStart && this.dataFilter) {
- this.animationStart();
+ /**
+ * Update the current scrollTop when the height of the containers has been changed
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
+ */
+ Timeline.prototype._updateScrollTop = function () {
+ // recalculate the scrollTopMin
+ var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
+ if (scrollTopMin != this.props.scrollTopMin) {
+ // in case of bottom orientation, change the scrollTop such that the contents
+ // do not move relative to the time axis at the bottom
+ if (this.options.orientation == 'bottom') {
+ this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin);
+ }
+ this.props.scrollTopMin = scrollTopMin;
}
+
+ // limit the scrollTop to the feasible scroll range
+ if (this.props.scrollTop > 0) this.props.scrollTop = 0;
+ if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;
+
+ return this.props.scrollTop;
};
/**
- * Update the options. Options will be merged with current options
- * @param {Object} options
+ * Get the current scrollTop
+ * @returns {number} scrollTop
+ * @private
*/
- Graph3d.prototype.setOptions = function (options) {
- var cameraPosition = undefined;
+ Timeline.prototype._getScrollTop = function () {
+ return this.props.scrollTop;
+ };
- this.animationStop();
+ module.exports = Timeline;
- if (options !== undefined) {
- // retrieve parameter values
- if (options.width !== undefined) this.width = options.width;
- if (options.height !== undefined) this.height = options.height;
- if (options.xCenter !== undefined) this.defaultXCenter = options.xCenter;
- if (options.yCenter !== undefined) this.defaultYCenter = options.yCenter;
+/***/ },
+/* 7 */
+/***/ function(module, exports, __webpack_require__) {
- if (options.filterLabel !== undefined) this.filterLabel = options.filterLabel;
- if (options.legendLabel !== undefined) this.legendLabel = options.legendLabel;
- if (options.xLabel !== undefined) this.xLabel = options.xLabel;
- if (options.yLabel !== undefined) this.yLabel = options.yLabel;
- if (options.zLabel !== undefined) this.zLabel = options.zLabel;
+ var Emitter = __webpack_require__(41);
+ var Hammer = __webpack_require__(49);
+ var util = __webpack_require__(1);
+ var DataSet = __webpack_require__(3);
+ var DataView = __webpack_require__(4);
+ var Range = __webpack_require__(9);
+ var TimeAxis = __webpack_require__(21);
+ var CurrentTime = __webpack_require__(13);
+ var CustomTime = __webpack_require__(14);
+ var LineGraph = __webpack_require__(20);
- if (options.style !== undefined) {
- var styleNumber = this._getStyleNumber(options.style);
- if (styleNumber !== -1) {
- this.style = styleNumber;
- }
- }
- if (options.showGrid !== undefined) this.showGrid = options.showGrid;
- if (options.showPerspective !== undefined) this.showPerspective = options.showPerspective;
- if (options.showShadow !== undefined) this.showShadow = options.showShadow;
- if (options.tooltip !== undefined) this.showTooltip = options.tooltip;
- if (options.showAnimationControls !== undefined) this.showAnimationControls = options.showAnimationControls;
- if (options.keepAspectRatio !== undefined) this.keepAspectRatio = options.keepAspectRatio;
- if (options.verticalRatio !== undefined) this.verticalRatio = options.verticalRatio;
+ /**
+ * Create a timeline visualization
+ * @param {HTMLElement} container
+ * @param {vis.DataSet | Array | google.visualization.DataTable} [items]
+ * @param {Object} [options] See Graph2d.setOptions for the available options.
+ * @constructor
+ */
+ function Graph2d (container, items, options, groups) {
+ var me = this;
+ this.defaultOptions = {
+ start: null,
+ end: null,
- if (options.animationInterval !== undefined) this.animationInterval = options.animationInterval;
- if (options.animationPreload !== undefined) this.animationPreload = options.animationPreload;
- if (options.animationAutoStart !== undefined)this.animationAutoStart = options.animationAutoStart;
+ autoResize: true,
- if (options.xBarWidth !== undefined) this.defaultXBarWidth = options.xBarWidth;
- if (options.yBarWidth !== undefined) this.defaultYBarWidth = options.yBarWidth;
+ orientation: 'bottom',
+ width: null,
+ height: null,
+ maxHeight: null,
+ minHeight: null
+ };
+ this.options = util.deepExtend({}, this.defaultOptions);
- if (options.xMin !== undefined) this.defaultXMin = options.xMin;
- if (options.xStep !== undefined) this.defaultXStep = options.xStep;
- if (options.xMax !== undefined) this.defaultXMax = options.xMax;
- if (options.yMin !== undefined) this.defaultYMin = options.yMin;
- if (options.yStep !== undefined) this.defaultYStep = options.yStep;
- if (options.yMax !== undefined) this.defaultYMax = options.yMax;
- if (options.zMin !== undefined) this.defaultZMin = options.zMin;
- if (options.zStep !== undefined) this.defaultZStep = options.zStep;
- if (options.zMax !== undefined) this.defaultZMax = options.zMax;
- if (options.valueMin !== undefined) this.defaultValueMin = options.valueMin;
- if (options.valueMax !== undefined) this.defaultValueMax = options.valueMax;
+ // Create the DOM, props, and emitter
+ this._create(container);
- if (options.cameraPosition !== undefined) cameraPosition = options.cameraPosition;
+ // all components listed here will be repainted automatically
+ this.components = [];
- if (cameraPosition !== undefined) {
- this.camera.setArmRotation(cameraPosition.horizontal, cameraPosition.vertical);
- this.camera.setArmLength(cameraPosition.distance);
- }
- else {
- this.camera.setArmRotation(1.0, 0.5);
- this.camera.setArmLength(1.7);
+ this.body = {
+ dom: this.dom,
+ domProps: this.props,
+ emitter: {
+ on: this.on.bind(this),
+ off: this.off.bind(this),
+ emit: this.emit.bind(this)
+ },
+ util: {
+ snap: null, // will be specified after TimeAxis is created
+ toScreen: me._toScreen.bind(me),
+ toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width
+ toTime: me._toTime.bind(me),
+ toGlobalTime : me._toGlobalTime.bind(me)
}
- }
+ };
- this._setBackgroundColor(options && options.backgroundColor);
+ // range
+ this.range = new Range(this.body);
+ this.components.push(this.range);
+ this.body.range = this.range;
- this.setSize(this.width, this.height);
+ // time axis
+ this.timeAxis = new TimeAxis(this.body);
+ this.components.push(this.timeAxis);
+ this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);
- // re-load the data
- if (this.dataTable) {
- this.setData(this.dataTable);
- }
+ // current time bar
+ this.currentTime = new CurrentTime(this.body);
+ this.components.push(this.currentTime);
- // start animation when option is true
- if (this.animationAutoStart && this.dataFilter) {
- this.animationStart();
- }
- };
+ // custom time bar
+ // Note: time bar will be attached in this.setOptions when selected
+ this.customTime = new CustomTime(this.body);
+ this.components.push(this.customTime);
- /**
- * Redraw the Graph.
- */
- Graph3d.prototype.redraw = function() {
- if (this.dataPoints === undefined) {
- throw 'Error: graph data not initialized';
- }
+ // item set
+ this.linegraph = new LineGraph(this.body);
+ this.components.push(this.linegraph);
- this._resizeCanvas();
- this._resizeCenter();
- this._redrawSlider();
- this._redrawClear();
- this._redrawAxis();
+ this.itemsData = null; // DataSet
+ this.groupsData = null; // DataSet
- if (this.style === Graph3d.STYLE.GRID ||
- this.style === Graph3d.STYLE.SURFACE) {
- this._redrawDataGrid();
+ // apply options
+ if (options) {
+ this.setOptions(options);
}
- else if (this.style === Graph3d.STYLE.LINE) {
- this._redrawDataLine();
+
+ // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!
+ if (groups) {
+ this.setGroups(groups);
}
- else if (this.style === Graph3d.STYLE.BAR ||
- this.style === Graph3d.STYLE.BARCOLOR ||
- this.style === Graph3d.STYLE.BARSIZE) {
- this._redrawDataBar();
+
+ // create itemset
+ if (items) {
+ this.setItems(items);
}
else {
- // style is DOT, DOTLINE, DOTCOLOR, DOTSIZE
- this._redrawDataDot();
+ this.redraw();
}
+ }
- this._redrawInfo();
- this._redrawLegend();
- };
-
- /**
- * Clear the canvas before redrawing
- */
- Graph3d.prototype._redrawClear = function() {
- var canvas = this.frame.canvas;
- var ctx = canvas.getContext('2d');
-
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- };
-
+ // turn Graph2d into an event emitter
+ Emitter(Graph2d.prototype);
/**
- * Redraw the legend showing the colors
+ * Create the main DOM for the Graph2d: a root panel containing left, right,
+ * top, bottom, content, and background panel.
+ * @param {Element} container The container element where the Graph2d will
+ * be attached.
+ * @private
*/
- Graph3d.prototype._redrawLegend = function() {
- var y;
-
- if (this.style === Graph3d.STYLE.DOTCOLOR ||
- this.style === Graph3d.STYLE.DOTSIZE) {
-
- var dotSize = this.frame.clientWidth * 0.02;
-
- var widthMin, widthMax;
- if (this.style === Graph3d.STYLE.DOTSIZE) {
- widthMin = dotSize / 2; // px
- widthMax = dotSize / 2 + dotSize * 2; // Todo: put this in one function
- }
- else {
- widthMin = 20; // px
- widthMax = 20; // px
- }
-
- var height = Math.max(this.frame.clientHeight * 0.25, 100);
- var top = this.margin;
- var right = this.frame.clientWidth - this.margin;
- var left = right - widthMax;
- var bottom = top + height;
- }
-
- var canvas = this.frame.canvas;
- var ctx = canvas.getContext('2d');
- ctx.lineWidth = 1;
- ctx.font = '14px arial'; // TODO: put in options
+ Graph2d.prototype._create = function (container) {
+ this.dom = {};
- if (this.style === Graph3d.STYLE.DOTCOLOR) {
- // draw the color bar
- var ymin = 0;
- var ymax = height; // Todo: make height customizable
- for (y = ymin; y < ymax; y++) {
- var f = (y - ymin) / (ymax - ymin);
+ this.dom.root = document.createElement('div');
+ this.dom.background = document.createElement('div');
+ this.dom.backgroundVertical = document.createElement('div');
+ this.dom.backgroundHorizontalContainer = document.createElement('div');
+ this.dom.centerContainer = document.createElement('div');
+ this.dom.leftContainer = document.createElement('div');
+ this.dom.rightContainer = document.createElement('div');
+ this.dom.backgroundHorizontal = document.createElement('div');
+ this.dom.center = document.createElement('div');
+ this.dom.left = document.createElement('div');
+ this.dom.right = document.createElement('div');
+ this.dom.top = document.createElement('div');
+ this.dom.bottom = document.createElement('div');
+ this.dom.shadowTop = document.createElement('div');
+ this.dom.shadowBottom = document.createElement('div');
+ this.dom.shadowTopLeft = document.createElement('div');
+ this.dom.shadowBottomLeft = document.createElement('div');
+ this.dom.shadowTopRight = document.createElement('div');
+ this.dom.shadowBottomRight = document.createElement('div');
- //var width = (dotSize / 2 + (1-f) * dotSize * 2); // Todo: put this in one function
- var hue = f * 240;
- var color = this._hsv2rgb(hue, 1, 1);
+ this.dom.background.className = 'vispanel background';
+ this.dom.backgroundVertical.className = 'vispanel background vertical';
+ this.dom.backgroundHorizontalContainer.className = 'vispanel background horizontal';
+ this.dom.backgroundHorizontal.className = 'vispanel background horizontal';
+ this.dom.centerContainer.className = 'vispanel center';
+ this.dom.leftContainer.className = 'vispanel left';
+ this.dom.rightContainer.className = 'vispanel right';
+ this.dom.top.className = 'vispanel top';
+ this.dom.bottom.className = 'vispanel bottom';
+ this.dom.left.className = 'content';
+ this.dom.center.className = 'content';
+ this.dom.right.className = 'content';
+ this.dom.shadowTop.className = 'shadow top';
+ this.dom.shadowBottom.className = 'shadow bottom';
+ this.dom.shadowTopLeft.className = 'shadow top';
+ this.dom.shadowBottomLeft.className = 'shadow bottom';
+ this.dom.shadowTopRight.className = 'shadow top';
+ this.dom.shadowBottomRight.className = 'shadow bottom';
- ctx.strokeStyle = color;
- ctx.beginPath();
- ctx.moveTo(left, top + y);
- ctx.lineTo(right, top + y);
- ctx.stroke();
- }
+ this.dom.root.appendChild(this.dom.background);
+ this.dom.root.appendChild(this.dom.backgroundVertical);
+ this.dom.root.appendChild(this.dom.backgroundHorizontalContainer);
+ this.dom.root.appendChild(this.dom.centerContainer);
+ this.dom.root.appendChild(this.dom.leftContainer);
+ this.dom.root.appendChild(this.dom.rightContainer);
+ this.dom.root.appendChild(this.dom.top);
+ this.dom.root.appendChild(this.dom.bottom);
- ctx.strokeStyle = this.colorAxis;
- ctx.strokeRect(left, top, widthMax, height);
- }
+ this.dom.backgroundHorizontalContainer.appendChild(this.dom.backgroundHorizontal);
+ this.dom.centerContainer.appendChild(this.dom.center);
+ this.dom.leftContainer.appendChild(this.dom.left);
+ this.dom.rightContainer.appendChild(this.dom.right);
- if (this.style === Graph3d.STYLE.DOTSIZE) {
- // draw border around color bar
- ctx.strokeStyle = this.colorAxis;
- ctx.fillStyle = this.colorDot;
- ctx.beginPath();
- ctx.moveTo(left, top);
- ctx.lineTo(right, top);
- ctx.lineTo(right - widthMax + widthMin, bottom);
- ctx.lineTo(left, bottom);
- ctx.closePath();
- ctx.fill();
- ctx.stroke();
- }
+ this.dom.centerContainer.appendChild(this.dom.shadowTop);
+ this.dom.centerContainer.appendChild(this.dom.shadowBottom);
+ this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);
+ this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);
+ this.dom.rightContainer.appendChild(this.dom.shadowTopRight);
+ this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);
- if (this.style === Graph3d.STYLE.DOTCOLOR ||
- this.style === Graph3d.STYLE.DOTSIZE) {
- // print values along the color bar
- var gridLineLen = 5; // px
- var step = new StepNumber(this.valueMin, this.valueMax, (this.valueMax-this.valueMin)/5, true);
- step.start();
- if (step.getCurrent() < this.valueMin) {
- step.next();
- }
- while (!step.end()) {
- y = bottom - (step.getCurrent() - this.valueMin) / (this.valueMax - this.valueMin) * height;
+ this.on('rangechange', this.redraw.bind(this));
+ this.on('change', this.redraw.bind(this));
+ this.on('touch', this._onTouch.bind(this));
+ this.on('pinch', this._onPinch.bind(this));
+ this.on('dragstart', this._onDragStart.bind(this));
+ this.on('drag', this._onDrag.bind(this));
- ctx.beginPath();
- ctx.moveTo(left - gridLineLen, y);
- ctx.lineTo(left, y);
- ctx.stroke();
+ // create event listeners for all interesting events, these events will be
+ // emitted via emitter
+ this.hammer = Hammer(this.dom.root, {
+ prevent_default: true
+ });
+ this.listeners = {};
- ctx.textAlign = 'right';
- ctx.textBaseline = 'middle';
- ctx.fillStyle = this.colorAxis;
- ctx.fillText(step.getCurrent(), left - 2 * gridLineLen, y);
+ var me = this;
+ var events = [
+ 'touch', 'pinch',
+ 'tap', 'doubletap', 'hold',
+ 'dragstart', 'drag', 'dragend',
+ 'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox
+ ];
+ events.forEach(function (event) {
+ var listener = function () {
+ var args = [event].concat(Array.prototype.slice.call(arguments, 0));
+ me.emit.apply(me, args);
+ };
+ me.hammer.on(event, listener);
+ me.listeners[event] = listener;
+ });
- step.next();
- }
+ // size properties of each of the panels
+ this.props = {
+ root: {},
+ background: {},
+ centerContainer: {},
+ leftContainer: {},
+ rightContainer: {},
+ center: {},
+ left: {},
+ right: {},
+ top: {},
+ bottom: {},
+ border: {},
+ scrollTop: 0,
+ scrollTopMin: 0
+ };
+ this.touch = {}; // store state information needed for touch events
- ctx.textAlign = 'right';
- ctx.textBaseline = 'top';
- var label = this.legendLabel;
- ctx.fillText(label, right, bottom + this.margin);
- }
+ // attach the root panel to the provided container
+ if (!container) throw new Error('No container provided');
+ container.appendChild(this.dom.root);
};
/**
- * Redraw the filter
+ * Destroy the Graph2d, clean up all DOM elements and event listeners.
*/
- Graph3d.prototype._redrawFilter = function() {
- this.frame.filter.innerHTML = '';
+ Graph2d.prototype.destroy = function () {
+ // unbind datasets
+ this.clear();
- if (this.dataFilter) {
- var options = {
- 'visible': this.showAnimationControls
- };
- var slider = new Slider(this.frame.filter, options);
- this.frame.filter.slider = slider;
+ // remove all event listeners
+ this.off();
- // TODO: css here is not nice here...
- this.frame.filter.style.padding = '10px';
- //this.frame.filter.style.backgroundColor = '#EFEFEF';
+ // stop checking for changed size
+ this._stopAutoResize();
- slider.setValues(this.dataFilter.values);
- slider.setPlayInterval(this.animationInterval);
+ // remove from DOM
+ if (this.dom.root.parentNode) {
+ this.dom.root.parentNode.removeChild(this.dom.root);
+ }
+ this.dom = null;
- // create an event handler
- var me = this;
- var onchange = function () {
- var index = slider.getIndex();
+ // cleanup hammer touch events
+ for (var event in this.listeners) {
+ if (this.listeners.hasOwnProperty(event)) {
+ delete this.listeners[event];
+ }
+ }
+ this.listeners = null;
+ this.hammer = null;
- me.dataFilter.selectValue(index);
- me.dataPoints = me.dataFilter._getDataPoints();
+ // give all components the opportunity to cleanup
+ this.components.forEach(function (component) {
+ component.destroy();
+ });
- me.redraw();
- };
- slider.setOnChangeCallback(onchange);
- }
- else {
- this.frame.filter.slider = undefined;
- }
+ this.body = null;
};
/**
- * Redraw the slider
+ * Set options. Options will be passed to all components loaded in the Graph2d.
+ * @param {Object} [options]
+ * {String} orientation
+ * Vertical orientation for the Graph2d,
+ * can be 'bottom' (default) or 'top'.
+ * {String | Number} width
+ * Width for the timeline, a number in pixels or
+ * a css string like '1000px' or '75%'. '100%' by default.
+ * {String | Number} height
+ * Fixed height for the Graph2d, a number in pixels or
+ * a css string like '400px' or '75%'. If undefined,
+ * The Graph2d will automatically size such that
+ * its contents fit.
+ * {String | Number} minHeight
+ * Minimum height for the Graph2d, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {String | Number} maxHeight
+ * Maximum height for the Graph2d, a number in pixels or
+ * a css string like '400px' or '75%'.
+ * {Number | Date | String} start
+ * Start date for the visible window
+ * {Number | Date | String} end
+ * End date for the visible window
*/
- Graph3d.prototype._redrawSlider = function() {
- if ( this.frame.filter.slider !== undefined) {
- this.frame.filter.slider.redraw();
- }
- };
-
+ Graph2d.prototype.setOptions = function (options) {
+ if (options) {
+ // copy the known options
+ var fields = ['width', 'height', 'minHeight', 'maxHeight', 'autoResize', 'start', 'end', 'orientation'];
+ util.selectiveExtend(fields, this.options, options);
- /**
- * Redraw common information
- */
- Graph3d.prototype._redrawInfo = function() {
- if (this.dataFilter) {
- var canvas = this.frame.canvas;
- var ctx = canvas.getContext('2d');
+ // enable/disable autoResize
+ this._initAutoResize();
+ }
- ctx.font = '14px arial'; // TODO: put in options
- ctx.lineStyle = 'gray';
- ctx.fillStyle = 'gray';
- ctx.textAlign = 'left';
- ctx.textBaseline = 'top';
+ // propagate options to all components
+ this.components.forEach(function (component) {
+ component.setOptions(options);
+ });
- var x = this.margin;
- var y = this.margin;
- ctx.fillText(this.dataFilter.getLabel() + ': ' + this.dataFilter.getSelectedValue(), x, y);
+ // TODO: remove deprecation error one day (deprecated since version 0.8.0)
+ if (options && options.order) {
+ throw new Error('Option order is deprecated. There is no replacement for this feature.');
}
- };
+ // redraw everything
+ this.redraw();
+ };
/**
- * Redraw the axis
+ * Set a custom time bar
+ * @param {Date} time
*/
- Graph3d.prototype._redrawAxis = function() {
- var canvas = this.frame.canvas,
- ctx = canvas.getContext('2d'),
- from, to, step, prettyStep,
- text, xText, yText, zText,
- offset, xOffset, yOffset,
- xMin2d, xMax2d;
-
- // TODO: get the actual rendered style of the containerElement
- //ctx.font = this.containerElement.style.font;
- ctx.font = 24 / this.camera.getArmLength() + 'px arial';
+ Graph2d.prototype.setCustomTime = function (time) {
+ if (!this.customTime) {
+ throw new Error('Cannot get custom time: Custom time bar is not enabled');
+ }
- // calculate the length for the short grid lines
- var gridLenX = 0.025 / this.scale.x;
- var gridLenY = 0.025 / this.scale.y;
- var textMargin = 5 / this.camera.getArmLength(); // px
- var armAngle = this.camera.getArmRotation().horizontal;
+ this.customTime.setCustomTime(time);
+ };
- // draw x-grid lines
- ctx.lineWidth = 1;
- prettyStep = (this.defaultXStep === undefined);
- step = new StepNumber(this.xMin, this.xMax, this.xStep, prettyStep);
- step.start();
- if (step.getCurrent() < this.xMin) {
- step.next();
+ /**
+ * Retrieve the current custom time.
+ * @return {Date} customTime
+ */
+ Graph2d.prototype.getCustomTime = function() {
+ if (!this.customTime) {
+ throw new Error('Cannot get custom time: Custom time bar is not enabled');
}
- while (!step.end()) {
- var x = step.getCurrent();
-
- if (this.showGrid) {
- from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
- to = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
- ctx.strokeStyle = this.colorGrid;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- }
- else {
- from = this._convert3Dto2D(new Point3d(x, this.yMin, this.zMin));
- to = this._convert3Dto2D(new Point3d(x, this.yMin+gridLenX, this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- from = this._convert3Dto2D(new Point3d(x, this.yMax, this.zMin));
- to = this._convert3Dto2D(new Point3d(x, this.yMax-gridLenX, this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- }
+ return this.customTime.getCustomTime();
+ };
- yText = (Math.cos(armAngle) > 0) ? this.yMin : this.yMax;
- text = this._convert3Dto2D(new Point3d(x, yText, this.zMin));
- if (Math.cos(armAngle * 2) > 0) {
- ctx.textAlign = 'center';
- ctx.textBaseline = 'top';
- text.y += textMargin;
- }
- else if (Math.sin(armAngle * 2) < 0){
- ctx.textAlign = 'right';
- ctx.textBaseline = 'middle';
- }
- else {
- ctx.textAlign = 'left';
- ctx.textBaseline = 'middle';
- }
- ctx.fillStyle = this.colorAxis;
- ctx.fillText(' ' + step.getCurrent() + ' ', text.x, text.y);
+ /**
+ * Set items
+ * @param {vis.DataSet | Array | google.visualization.DataTable | null} items
+ */
+ Graph2d.prototype.setItems = function(items) {
+ var initialLoad = (this.itemsData == null);
- step.next();
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!items) {
+ newDataSet = null;
}
-
- // draw y-grid lines
- ctx.lineWidth = 1;
- prettyStep = (this.defaultYStep === undefined);
- step = new StepNumber(this.yMin, this.yMax, this.yStep, prettyStep);
- step.start();
- if (step.getCurrent() < this.yMin) {
- step.next();
+ else if (items instanceof DataSet || items instanceof DataView) {
+ newDataSet = items;
+ }
+ else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(items, {
+ type: {
+ start: 'Date',
+ end: 'Date'
+ }
+ });
}
- while (!step.end()) {
- if (this.showGrid) {
- from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
- to = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
- ctx.strokeStyle = this.colorGrid;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- }
- else {
- from = this._convert3Dto2D(new Point3d(this.xMin, step.getCurrent(), this.zMin));
- to = this._convert3Dto2D(new Point3d(this.xMin+gridLenY, step.getCurrent(), this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- from = this._convert3Dto2D(new Point3d(this.xMax, step.getCurrent(), this.zMin));
- to = this._convert3Dto2D(new Point3d(this.xMax-gridLenY, step.getCurrent(), this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- }
+ // set items
+ this.itemsData = newDataSet;
+ this.linegraph && this.linegraph.setItems(newDataSet);
- xText = (Math.sin(armAngle ) > 0) ? this.xMin : this.xMax;
- text = this._convert3Dto2D(new Point3d(xText, step.getCurrent(), this.zMin));
- if (Math.cos(armAngle * 2) < 0) {
- ctx.textAlign = 'center';
- ctx.textBaseline = 'top';
- text.y += textMargin;
- }
- else if (Math.sin(armAngle * 2) > 0){
- ctx.textAlign = 'right';
- ctx.textBaseline = 'middle';
- }
- else {
- ctx.textAlign = 'left';
- ctx.textBaseline = 'middle';
- }
- ctx.fillStyle = this.colorAxis;
- ctx.fillText(' ' + step.getCurrent() + ' ', text.x, text.y);
+ if (initialLoad && ('start' in this.options || 'end' in this.options)) {
+ this.fit();
- step.next();
- }
+ var start = ('start' in this.options) ? util.convert(this.options.start, 'Date') : null;
+ var end = ('end' in this.options) ? util.convert(this.options.end, 'Date') : null;
- // draw z-grid lines and axis
- ctx.lineWidth = 1;
- prettyStep = (this.defaultZStep === undefined);
- step = new StepNumber(this.zMin, this.zMax, this.zStep, prettyStep);
- step.start();
- if (step.getCurrent() < this.zMin) {
- step.next();
+ this.setWindow(start, end);
}
- xText = (Math.cos(armAngle ) > 0) ? this.xMin : this.xMax;
- yText = (Math.sin(armAngle ) < 0) ? this.yMin : this.yMax;
- while (!step.end()) {
- // TODO: make z-grid lines really 3d?
- from = this._convert3Dto2D(new Point3d(xText, yText, step.getCurrent()));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(from.x - textMargin, from.y);
- ctx.stroke();
-
- ctx.textAlign = 'right';
- ctx.textBaseline = 'middle';
- ctx.fillStyle = this.colorAxis;
- ctx.fillText(step.getCurrent() + ' ', from.x - 5, from.y);
+ };
- step.next();
+ /**
+ * Set groups
+ * @param {vis.DataSet | Array | google.visualization.DataTable} groups
+ */
+ Graph2d.prototype.setGroups = function(groups) {
+ // convert to type DataSet when needed
+ var newDataSet;
+ if (!groups) {
+ newDataSet = null;
+ }
+ else if (groups instanceof DataSet || groups instanceof DataView) {
+ newDataSet = groups;
+ }
+ else {
+ // turn an array into a dataset
+ newDataSet = new DataSet(groups);
}
- ctx.lineWidth = 1;
- from = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
- to = this._convert3Dto2D(new Point3d(xText, yText, this.zMax));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- // draw x-axis
- ctx.lineWidth = 1;
- // line at yMin
- xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
- xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(xMin2d.x, xMin2d.y);
- ctx.lineTo(xMax2d.x, xMax2d.y);
- ctx.stroke();
- // line at ymax
- xMin2d = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
- xMax2d = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(xMin2d.x, xMin2d.y);
- ctx.lineTo(xMax2d.x, xMax2d.y);
- ctx.stroke();
+ this.groupsData = newDataSet;
+ this.linegraph.setGroups(newDataSet);
+ };
+
+ /**
+ * Clear the Graph2d. By Default, items, groups and options are cleared.
+ * Example usage:
+ *
+ * timeline.clear(); // clear items, groups, and options
+ * timeline.clear({options: true}); // clear options only
+ *
+ * @param {Object} [what] Optionally specify what to clear. By default:
+ * {items: true, groups: true, options: true}
+ */
+ Graph2d.prototype.clear = function(what) {
+ // clear items
+ if (!what || what.items) {
+ this.setItems(null);
+ }
- // draw y-axis
- ctx.lineWidth = 1;
- // line at xMin
- from = this._convert3Dto2D(new Point3d(this.xMin, this.yMin, this.zMin));
- to = this._convert3Dto2D(new Point3d(this.xMin, this.yMax, this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
- // line at xMax
- from = this._convert3Dto2D(new Point3d(this.xMax, this.yMin, this.zMin));
- to = this._convert3Dto2D(new Point3d(this.xMax, this.yMax, this.zMin));
- ctx.strokeStyle = this.colorAxis;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(to.x, to.y);
- ctx.stroke();
+ // clear groups
+ if (!what || what.groups) {
+ this.setGroups(null);
+ }
- // draw x-label
- var xLabel = this.xLabel;
- if (xLabel.length > 0) {
- yOffset = 0.1 / this.scale.y;
- xText = (this.xMin + this.xMax) / 2;
- yText = (Math.cos(armAngle) > 0) ? this.yMin - yOffset: this.yMax + yOffset;
- text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
- if (Math.cos(armAngle * 2) > 0) {
- ctx.textAlign = 'center';
- ctx.textBaseline = 'top';
- }
- else if (Math.sin(armAngle * 2) < 0){
- ctx.textAlign = 'right';
- ctx.textBaseline = 'middle';
- }
- else {
- ctx.textAlign = 'left';
- ctx.textBaseline = 'middle';
- }
- ctx.fillStyle = this.colorAxis;
- ctx.fillText(xLabel, text.x, text.y);
+ // clear options of timeline and of each of the components
+ if (!what || what.options) {
+ this.components.forEach(function (component) {
+ component.setOptions(component.defaultOptions);
+ });
+
+ this.setOptions(this.defaultOptions); // this will also do a redraw
}
+ };
- // draw y-label
- var yLabel = this.yLabel;
- if (yLabel.length > 0) {
- xOffset = 0.1 / this.scale.x;
- xText = (Math.sin(armAngle ) > 0) ? this.xMin - xOffset : this.xMax + xOffset;
- yText = (this.yMin + this.yMax) / 2;
- text = this._convert3Dto2D(new Point3d(xText, yText, this.zMin));
- if (Math.cos(armAngle * 2) < 0) {
- ctx.textAlign = 'center';
- ctx.textBaseline = 'top';
- }
- else if (Math.sin(armAngle * 2) > 0){
- ctx.textAlign = 'right';
- ctx.textBaseline = 'middle';
- }
- else {
- ctx.textAlign = 'left';
- ctx.textBaseline = 'middle';
+ /**
+ * Set Graph2d window such that it fits all items
+ */
+ Graph2d.prototype.fit = function() {
+ // apply the data range as range
+ var dataRange = this.getItemRange();
+
+ // add 5% space on both sides
+ var start = dataRange.min;
+ var end = dataRange.max;
+ if (start != null && end != null) {
+ var interval = (end.valueOf() - start.valueOf());
+ if (interval <= 0) {
+ // prevent an empty interval
+ interval = 24 * 60 * 60 * 1000; // 1 day
}
- ctx.fillStyle = this.colorAxis;
- ctx.fillText(yLabel, text.x, text.y);
+ start = new Date(start.valueOf() - interval * 0.05);
+ end = new Date(end.valueOf() + interval * 0.05);
}
- // draw z-label
- var zLabel = this.zLabel;
- if (zLabel.length > 0) {
- offset = 30; // pixels. // TODO: relate to the max width of the values on the z axis?
- xText = (Math.cos(armAngle ) > 0) ? this.xMin : this.xMax;
- yText = (Math.sin(armAngle ) < 0) ? this.yMin : this.yMax;
- zText = (this.zMin + this.zMax) / 2;
- text = this._convert3Dto2D(new Point3d(xText, yText, zText));
- ctx.textAlign = 'right';
- ctx.textBaseline = 'middle';
- ctx.fillStyle = this.colorAxis;
- ctx.fillText(zLabel, text.x - offset, text.y);
+ // skip range set if there is no start and end date
+ if (start === null && end === null) {
+ return;
}
+
+ this.range.setRange(start, end);
};
/**
- * Calculate the color based on the given value.
- * @param {Number} H Hue, a value be between 0 and 360
- * @param {Number} S Saturation, a value between 0 and 1
- * @param {Number} V Value, a value between 0 and 1
+ * Get the data range of the item set.
+ * @returns {{min: Date, max: Date}} range A range with a start and end Date.
+ * When no minimum is found, min==null
+ * When no maximum is found, max==null
*/
- Graph3d.prototype._hsv2rgb = function(H, S, V) {
- var R, G, B, C, Hi, X;
-
- C = V * S;
- Hi = Math.floor(H/60); // hi = 0,1,2,3,4,5
- X = C * (1 - Math.abs(((H/60) % 2) - 1));
+ Graph2d.prototype.getItemRange = function() {
+ // calculate min from start filed
+ var itemsData = this.itemsData,
+ min = null,
+ max = null;
- switch (Hi) {
- case 0: R = C; G = X; B = 0; break;
- case 1: R = X; G = C; B = 0; break;
- case 2: R = 0; G = C; B = X; break;
- case 3: R = 0; G = X; B = C; break;
- case 4: R = X; G = 0; B = C; break;
- case 5: R = C; G = 0; B = X; break;
+ if (itemsData) {
+ // calculate the minimum value of the field 'start'
+ var minItem = itemsData.min('start');
+ min = minItem ? util.convert(minItem.start, 'Date').valueOf() : null;
+ // Note: we convert first to Date and then to number because else
+ // a conversion from ISODate to Number will fail
- default: R = 0; G = 0; B = 0; break;
+ // calculate maximum value of fields 'start' and 'end'
+ var maxStartItem = itemsData.max('start');
+ if (maxStartItem) {
+ max = util.convert(maxStartItem.start, 'Date').valueOf();
+ }
+ var maxEndItem = itemsData.max('end');
+ if (maxEndItem) {
+ if (max == null) {
+ max = util.convert(maxEndItem.end, 'Date').valueOf();
+ }
+ else {
+ max = Math.max(max, util.convert(maxEndItem.end, 'Date').valueOf());
+ }
+ }
}
- return 'RGB(' + parseInt(R*255) + ',' + parseInt(G*255) + ',' + parseInt(B*255) + ')';
+ return {
+ min: (min != null) ? new Date(min) : null,
+ max: (max != null) ? new Date(max) : null
+ };
};
-
/**
- * Draw all datapoints as a grid
- * This function can be used when the style is 'grid'
+ * Set the visible window. Both parameters are optional, you can change only
+ * start or only end. Syntax:
+ *
+ * TimeLine.setWindow(start, end)
+ * TimeLine.setWindow(range)
+ *
+ * Where start and end can be a Date, number, or string, and range is an
+ * object with properties start and end.
+ *
+ * @param {Date | Number | String | Object} [start] Start date of visible window
+ * @param {Date | Number | String} [end] End date of visible window
*/
- Graph3d.prototype._redrawDataGrid = function() {
- var canvas = this.frame.canvas,
- ctx = canvas.getContext('2d'),
- point, right, top, cross,
- i,
- topSideVisible, fillStyle, strokeStyle, lineWidth,
- h, s, v, zAvg;
+ Graph2d.prototype.setWindow = function(start, end) {
+ if (arguments.length == 1) {
+ var range = arguments[0];
+ this.range.setRange(range.start, range.end);
+ }
+ else {
+ this.range.setRange(start, end);
+ }
+ };
+ /**
+ * Get the visible window
+ * @return {{start: Date, end: Date}} Visible range
+ */
+ Graph2d.prototype.getWindow = function() {
+ var range = this.range.getRange();
+ return {
+ start: new Date(range.start),
+ end: new Date(range.end)
+ };
+ };
- if (this.dataPoints === undefined || this.dataPoints.length <= 0)
- return; // TODO: throw exception?
+ /**
+ * Force a redraw of the Graph2d. Can be useful to manually redraw when
+ * option autoResize=false
+ */
+ Graph2d.prototype.redraw = function() {
+ var resized = false,
+ options = this.options,
+ props = this.props,
+ dom = this.dom;
- // calculate the translations and screen position of all points
- for (i = 0; i < this.dataPoints.length; i++) {
- var trans = this._convertPointToTranslation(this.dataPoints[i].point);
- var screen = this._convertTranslationToScreen(trans);
+ if (!dom) return; // when destroyed
- this.dataPoints[i].trans = trans;
- this.dataPoints[i].screen = screen;
+ // update class names
+ dom.root.className = 'vis timeline root ' + options.orientation;
- // calculate the translation of the point at the bottom (needed for sorting)
- var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
- this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
- }
+ // update root width and height options
+ dom.root.style.maxHeight = util.option.asSize(options.maxHeight, '');
+ dom.root.style.minHeight = util.option.asSize(options.minHeight, '');
+ dom.root.style.width = util.option.asSize(options.width, '');
- // sort the points on depth of their (x,y) position (not on z)
- var sortDepth = function (a, b) {
- return b.dist - a.dist;
- };
- this.dataPoints.sort(sortDepth);
+ // calculate border widths
+ props.border.left = (dom.centerContainer.offsetWidth - dom.centerContainer.clientWidth) / 2;
+ props.border.right = props.border.left;
+ props.border.top = (dom.centerContainer.offsetHeight - dom.centerContainer.clientHeight) / 2;
+ props.border.bottom = props.border.top;
+ var borderRootHeight= dom.root.offsetHeight - dom.root.clientHeight;
+ var borderRootWidth = dom.root.offsetWidth - dom.root.clientWidth;
- if (this.style === Graph3d.STYLE.SURFACE) {
- for (i = 0; i < this.dataPoints.length; i++) {
- point = this.dataPoints[i];
- right = this.dataPoints[i].pointRight;
- top = this.dataPoints[i].pointTop;
- cross = this.dataPoints[i].pointCross;
+ // calculate the heights. If any of the side panels is empty, we set the height to
+ // minus the border width, such that the border will be invisible
+ props.center.height = dom.center.offsetHeight;
+ props.left.height = dom.left.offsetHeight;
+ props.right.height = dom.right.offsetHeight;
+ props.top.height = dom.top.clientHeight || -props.border.top;
+ props.bottom.height = dom.bottom.clientHeight || -props.border.bottom;
- if (point !== undefined && right !== undefined && top !== undefined && cross !== undefined) {
+ // TODO: compensate borders when any of the panels is empty.
- if (this.showGrayBottom || this.showShadow) {
- // calculate the cross product of the two vectors from center
- // to left and right, in order to know whether we are looking at the
- // bottom or at the top side. We can also use the cross product
- // for calculating light intensity
- var aDiff = Point3d.subtract(cross.trans, point.trans);
- var bDiff = Point3d.subtract(top.trans, right.trans);
- var crossproduct = Point3d.crossProduct(aDiff, bDiff);
- var len = crossproduct.length();
- // FIXME: there is a bug with determining the surface side (shadow or colored)
+ // apply auto height
+ // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)
+ var contentHeight = Math.max(props.left.height, props.center.height, props.right.height);
+ var autoHeight = props.top.height + contentHeight + props.bottom.height +
+ borderRootHeight + props.border.top + props.border.bottom;
+ dom.root.style.height = util.option.asSize(options.height, autoHeight + 'px');
- topSideVisible = (crossproduct.z > 0);
- }
- else {
- topSideVisible = true;
- }
+ // calculate heights of the content panels
+ props.root.height = dom.root.offsetHeight;
+ props.background.height = props.root.height - borderRootHeight;
+ var containerHeight = props.root.height - props.top.height - props.bottom.height -
+ borderRootHeight;
+ props.centerContainer.height = containerHeight;
+ props.leftContainer.height = containerHeight;
+ props.rightContainer.height = props.leftContainer.height;
- if (topSideVisible) {
- // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
- zAvg = (point.point.z + right.point.z + top.point.z + cross.point.z) / 4;
- h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
- s = 1; // saturation
+ // calculate the widths of the panels
+ props.root.width = dom.root.offsetWidth;
+ props.background.width = props.root.width - borderRootWidth;
+ props.left.width = dom.leftContainer.clientWidth || -props.border.left;
+ props.leftContainer.width = props.left.width;
+ props.right.width = dom.rightContainer.clientWidth || -props.border.right;
+ props.rightContainer.width = props.right.width;
+ var centerWidth = props.root.width - props.left.width - props.right.width - borderRootWidth;
+ props.center.width = centerWidth;
+ props.centerContainer.width = centerWidth;
+ props.top.width = centerWidth;
+ props.bottom.width = centerWidth;
- if (this.showShadow) {
- v = Math.min(1 + (crossproduct.x / len) / 2, 1); // value. TODO: scale
- fillStyle = this._hsv2rgb(h, s, v);
- strokeStyle = fillStyle;
- }
- else {
- v = 1;
- fillStyle = this._hsv2rgb(h, s, v);
- strokeStyle = this.colorAxis;
- }
- }
- else {
- fillStyle = 'gray';
- strokeStyle = this.colorAxis;
- }
- lineWidth = 0.5;
+ // resize the panels
+ dom.background.style.height = props.background.height + 'px';
+ dom.backgroundVertical.style.height = props.background.height + 'px';
+ dom.backgroundHorizontalContainer.style.height = props.centerContainer.height + 'px';
+ dom.centerContainer.style.height = props.centerContainer.height + 'px';
+ dom.leftContainer.style.height = props.leftContainer.height + 'px';
+ dom.rightContainer.style.height = props.rightContainer.height + 'px';
- ctx.lineWidth = lineWidth;
- ctx.fillStyle = fillStyle;
- ctx.strokeStyle = strokeStyle;
- ctx.beginPath();
- ctx.moveTo(point.screen.x, point.screen.y);
- ctx.lineTo(right.screen.x, right.screen.y);
- ctx.lineTo(cross.screen.x, cross.screen.y);
- ctx.lineTo(top.screen.x, top.screen.y);
- ctx.closePath();
- ctx.fill();
- ctx.stroke();
- }
- }
- }
- else { // grid style
- for (i = 0; i < this.dataPoints.length; i++) {
- point = this.dataPoints[i];
- right = this.dataPoints[i].pointRight;
- top = this.dataPoints[i].pointTop;
+ dom.background.style.width = props.background.width + 'px';
+ dom.backgroundVertical.style.width = props.centerContainer.width + 'px';
+ dom.backgroundHorizontalContainer.style.width = props.background.width + 'px';
+ dom.backgroundHorizontal.style.width = props.background.width + 'px';
+ dom.centerContainer.style.width = props.center.width + 'px';
+ dom.top.style.width = props.top.width + 'px';
+ dom.bottom.style.width = props.bottom.width + 'px';
- if (point !== undefined) {
- if (this.showPerspective) {
- lineWidth = 2 / -point.trans.z;
- }
- else {
- lineWidth = 2 * -(this.eye.z / this.camera.getArmLength());
- }
- }
+ // reposition the panels
+ dom.background.style.left = '0';
+ dom.background.style.top = '0';
+ dom.backgroundVertical.style.left = props.left.width + 'px';
+ dom.backgroundVertical.style.top = '0';
+ dom.backgroundHorizontalContainer.style.left = '0';
+ dom.backgroundHorizontalContainer.style.top = props.top.height + 'px';
+ dom.centerContainer.style.left = props.left.width + 'px';
+ dom.centerContainer.style.top = props.top.height + 'px';
+ dom.leftContainer.style.left = '0';
+ dom.leftContainer.style.top = props.top.height + 'px';
+ dom.rightContainer.style.left = (props.left.width + props.center.width) + 'px';
+ dom.rightContainer.style.top = props.top.height + 'px';
+ dom.top.style.left = props.left.width + 'px';
+ dom.top.style.top = '0';
+ dom.bottom.style.left = props.left.width + 'px';
+ dom.bottom.style.top = (props.top.height + props.centerContainer.height) + 'px';
- if (point !== undefined && right !== undefined) {
- // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
- zAvg = (point.point.z + right.point.z) / 2;
- h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ // update the scrollTop, feasible range for the offset can be changed
+ // when the height of the Graph2d or of the contents of the center changed
+ this._updateScrollTop();
- ctx.lineWidth = lineWidth;
- ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
- ctx.beginPath();
- ctx.moveTo(point.screen.x, point.screen.y);
- ctx.lineTo(right.screen.x, right.screen.y);
- ctx.stroke();
- }
+ // reposition the scrollable contents
+ var offset = this.props.scrollTop;
+ if (options.orientation == 'bottom') {
+ offset += Math.max(this.props.centerContainer.height - this.props.center.height -
+ this.props.border.top - this.props.border.bottom, 0);
+ }
+ dom.center.style.left = '0';
+ dom.center.style.top = offset + 'px';
+ dom.backgroundHorizontal.style.left = '0';
+ dom.backgroundHorizontal.style.top = offset + 'px';
+ dom.left.style.left = '0';
+ dom.left.style.top = offset + 'px';
+ dom.right.style.left = '0';
+ dom.right.style.top = offset + 'px';
- if (point !== undefined && top !== undefined) {
- // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
- zAvg = (point.point.z + top.point.z) / 2;
- h = (1 - (zAvg - this.zMin) * this.scale.z / this.verticalRatio) * 240;
+ // show shadows when vertical scrolling is available
+ var visibilityTop = this.props.scrollTop == 0 ? 'hidden' : '';
+ var visibilityBottom = this.props.scrollTop == this.props.scrollTopMin ? 'hidden' : '';
+ dom.shadowTop.style.visibility = visibilityTop;
+ dom.shadowBottom.style.visibility = visibilityBottom;
+ dom.shadowTopLeft.style.visibility = visibilityTop;
+ dom.shadowBottomLeft.style.visibility = visibilityBottom;
+ dom.shadowTopRight.style.visibility = visibilityTop;
+ dom.shadowBottomRight.style.visibility = visibilityBottom;
- ctx.lineWidth = lineWidth;
- ctx.strokeStyle = this._hsv2rgb(h, 1, 1);
- ctx.beginPath();
- ctx.moveTo(point.screen.x, point.screen.y);
- ctx.lineTo(top.screen.x, top.screen.y);
- ctx.stroke();
- }
- }
+ // redraw all components
+ this.components.forEach(function (component) {
+ resized = component.redraw() || resized;
+ });
+ if (resized) {
+ // keep redrawing until all sizes are settled
+ this.redraw();
}
};
+ /**
+ * Convert a position on screen (pixels) to a datetime
+ * @param {int} x Position on the screen in pixels
+ * @return {Date} time The datetime the corresponds with given position x
+ * @private
+ */
+ // TODO: move this function to Range
+ Graph2d.prototype._toTime = function(x) {
+ var conversion = this.range.conversion(this.props.center.width);
+ return new Date(x / conversion.scale + conversion.offset);
+ };
/**
- * Draw all datapoints as dots.
- * This function can be used when the style is 'dot' or 'dot-line'
+ * Convert a datetime (Date object) into a position on the root
+ * This is used to get the pixel density estimate for the screen, not the center panel
+ * @param {Date} time A date
+ * @return {int} x The position on root in pixels which corresponds
+ * with the given date.
+ * @private
*/
- Graph3d.prototype._redrawDataDot = function() {
- var canvas = this.frame.canvas;
- var ctx = canvas.getContext('2d');
- var i;
+ // TODO: move this function to Range
+ Graph2d.prototype._toGlobalTime = function(x) {
+ var conversion = this.range.conversion(this.props.root.width);
+ return new Date(x / conversion.scale + conversion.offset);
+ };
- if (this.dataPoints === undefined || this.dataPoints.length <= 0)
- return; // TODO: throw exception?
+ /**
+ * Convert a datetime (Date object) into a position on the screen
+ * @param {Date} time A date
+ * @return {int} x The position on the screen in pixels which corresponds
+ * with the given date.
+ * @private
+ */
+ // TODO: move this function to Range
+ Graph2d.prototype._toScreen = function(time) {
+ var conversion = this.range.conversion(this.props.center.width);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
+ };
- // calculate the translations of all points
- for (i = 0; i < this.dataPoints.length; i++) {
- var trans = this._convertPointToTranslation(this.dataPoints[i].point);
- var screen = this._convertTranslationToScreen(trans);
- this.dataPoints[i].trans = trans;
- this.dataPoints[i].screen = screen;
- // calculate the distance from the point at the bottom to the camera
- var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
- this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
- }
+ /**
+ * Convert a datetime (Date object) into a position on the root
+ * This is used to get the pixel density estimate for the screen, not the center panel
+ * @param {Date} time A date
+ * @return {int} x The position on root in pixels which corresponds
+ * with the given date.
+ * @private
+ */
+ // TODO: move this function to Range
+ Graph2d.prototype._toGlobalScreen = function(time) {
+ var conversion = this.range.conversion(this.props.root.width);
+ return (time.valueOf() - conversion.offset) * conversion.scale;
+ };
- // order the translated points by depth
- var sortDepth = function (a, b) {
- return b.dist - a.dist;
- };
- this.dataPoints.sort(sortDepth);
+ /**
+ * Initialize watching when option autoResize is true
+ * @private
+ */
+ Graph2d.prototype._initAutoResize = function () {
+ if (this.options.autoResize == true) {
+ this._startAutoResize();
+ }
+ else {
+ this._stopAutoResize();
+ }
+ };
- // draw the datapoints as colored circles
- var dotSize = this.frame.clientWidth * 0.02; // px
- for (i = 0; i < this.dataPoints.length; i++) {
- var point = this.dataPoints[i];
+ /**
+ * Watch for changes in the size of the container. On resize, the Panel will
+ * automatically redraw itself.
+ * @private
+ */
+ Graph2d.prototype._startAutoResize = function () {
+ var me = this;
- if (this.style === Graph3d.STYLE.DOTLINE) {
- // draw a vertical line from the bottom to the graph value
- //var from = this._convert3Dto2D(new Point3d(point.point.x, point.point.y, this.zMin));
- var from = this._convert3Dto2D(point.bottom);
- ctx.lineWidth = 1;
- ctx.strokeStyle = this.colorGrid;
- ctx.beginPath();
- ctx.moveTo(from.x, from.y);
- ctx.lineTo(point.screen.x, point.screen.y);
- ctx.stroke();
- }
+ this._stopAutoResize();
- // calculate radius for the circle
- var size;
- if (this.style === Graph3d.STYLE.DOTSIZE) {
- size = dotSize/2 + 2*dotSize * (point.point.value - this.valueMin) / (this.valueMax - this.valueMin);
- }
- else {
- size = dotSize;
+ this._onResize = function() {
+ if (me.options.autoResize != true) {
+ // stop watching when the option autoResize is changed to false
+ me._stopAutoResize();
+ return;
}
- var radius;
- if (this.showPerspective) {
- radius = size / -point.trans.z;
- }
- else {
- radius = size * -(this.eye.z / this.camera.getArmLength());
- }
- if (radius < 0) {
- radius = 0;
- }
+ if (me.dom.root) {
+ // check whether the frame is resized
+ if ((me.dom.root.clientWidth != me.props.lastWidth) ||
+ (me.dom.root.clientHeight != me.props.lastHeight)) {
+ me.props.lastWidth = me.dom.root.clientWidth;
+ me.props.lastHeight = me.dom.root.clientHeight;
- var hue, color, borderColor;
- if (this.style === Graph3d.STYLE.DOTCOLOR ) {
- // calculate the color based on the value
- hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
- color = this._hsv2rgb(hue, 1, 1);
- borderColor = this._hsv2rgb(hue, 1, 0.8);
- }
- else if (this.style === Graph3d.STYLE.DOTSIZE) {
- color = this.colorDot;
- borderColor = this.colorDotBorder;
- }
- else {
- // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
- hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
- color = this._hsv2rgb(hue, 1, 1);
- borderColor = this._hsv2rgb(hue, 1, 0.8);
+ me.emit('change');
+ }
}
+ };
- // draw the circle
- ctx.lineWidth = 1.0;
- ctx.strokeStyle = borderColor;
- ctx.fillStyle = color;
- ctx.beginPath();
- ctx.arc(point.screen.x, point.screen.y, radius, 0, Math.PI*2, true);
- ctx.fill();
- ctx.stroke();
- }
+ // add event listener to window resize
+ util.addEventListener(window, 'resize', this._onResize);
+
+ this.watchTimer = setInterval(this._onResize, 1000);
};
/**
- * Draw all datapoints as bars.
- * This function can be used when the style is 'bar', 'bar-color', or 'bar-size'
+ * Stop watching for a resize of the frame.
+ * @private
*/
- Graph3d.prototype._redrawDataBar = function() {
- var canvas = this.frame.canvas;
- var ctx = canvas.getContext('2d');
- var i, j, surface, corners;
-
- if (this.dataPoints === undefined || this.dataPoints.length <= 0)
- return; // TODO: throw exception?
-
- // calculate the translations of all points
- for (i = 0; i < this.dataPoints.length; i++) {
- var trans = this._convertPointToTranslation(this.dataPoints[i].point);
- var screen = this._convertTranslationToScreen(trans);
- this.dataPoints[i].trans = trans;
- this.dataPoints[i].screen = screen;
-
- // calculate the distance from the point at the bottom to the camera
- var transBottom = this._convertPointToTranslation(this.dataPoints[i].bottom);
- this.dataPoints[i].dist = this.showPerspective ? transBottom.length() : -transBottom.z;
+ Graph2d.prototype._stopAutoResize = function () {
+ if (this.watchTimer) {
+ clearInterval(this.watchTimer);
+ this.watchTimer = undefined;
}
- // order the translated points by depth
- var sortDepth = function (a, b) {
- return b.dist - a.dist;
- };
- this.dataPoints.sort(sortDepth);
+ // remove event listener on window.resize
+ util.removeEventListener(window, 'resize', this._onResize);
+ this._onResize = null;
+ };
- // draw the datapoints as bars
- var xWidth = this.xBarWidth / 2;
- var yWidth = this.yBarWidth / 2;
- for (i = 0; i < this.dataPoints.length; i++) {
- var point = this.dataPoints[i];
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Graph2d.prototype._onTouch = function (event) {
+ this.touch.allowDragging = true;
+ };
- // determine color
- var hue, color, borderColor;
- if (this.style === Graph3d.STYLE.BARCOLOR ) {
- // calculate the color based on the value
- hue = (1 - (point.point.value - this.valueMin) * this.scale.value) * 240;
- color = this._hsv2rgb(hue, 1, 1);
- borderColor = this._hsv2rgb(hue, 1, 0.8);
- }
- else if (this.style === Graph3d.STYLE.BARSIZE) {
- color = this.colorDot;
- borderColor = this.colorDotBorder;
- }
- else {
- // calculate Hue from the current value. At zMin the hue is 240, at zMax the hue is 0
- hue = (1 - (point.point.z - this.zMin) * this.scale.z / this.verticalRatio) * 240;
- color = this._hsv2rgb(hue, 1, 1);
- borderColor = this._hsv2rgb(hue, 1, 0.8);
- }
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Graph2d.prototype._onPinch = function (event) {
+ this.touch.allowDragging = false;
+ };
- // calculate size for the bar
- if (this.style === Graph3d.STYLE.BARSIZE) {
- xWidth = (this.xBarWidth / 2) * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
- yWidth = (this.yBarWidth / 2) * ((point.point.value - this.valueMin) / (this.valueMax - this.valueMin) * 0.8 + 0.2);
- }
+ /**
+ * Start moving the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Graph2d.prototype._onDragStart = function (event) {
+ this.touch.initialScrollTop = this.props.scrollTop;
+ };
- // calculate all corner points
- var me = this;
- var point3d = point.point;
- var top = [
- {point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, point3d.z)},
- {point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, point3d.z)},
- {point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, point3d.z)},
- {point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, point3d.z)}
- ];
- var bottom = [
- {point: new Point3d(point3d.x - xWidth, point3d.y - yWidth, this.zMin)},
- {point: new Point3d(point3d.x + xWidth, point3d.y - yWidth, this.zMin)},
- {point: new Point3d(point3d.x + xWidth, point3d.y + yWidth, this.zMin)},
- {point: new Point3d(point3d.x - xWidth, point3d.y + yWidth, this.zMin)}
- ];
+ /**
+ * Move the timeline vertically
+ * @param {Event} event
+ * @private
+ */
+ Graph2d.prototype._onDrag = function (event) {
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.touch.allowDragging) return;
- // calculate screen location of the points
- top.forEach(function (obj) {
- obj.screen = me._convert3Dto2D(obj.point);
- });
- bottom.forEach(function (obj) {
- obj.screen = me._convert3Dto2D(obj.point);
- });
+ var delta = event.gesture.deltaY;
- // create five sides, calculate both corner points and center points
- var surfaces = [
- {corners: top, center: Point3d.avg(bottom[0].point, bottom[2].point)},
- {corners: [top[0], top[1], bottom[1], bottom[0]], center: Point3d.avg(bottom[1].point, bottom[0].point)},
- {corners: [top[1], top[2], bottom[2], bottom[1]], center: Point3d.avg(bottom[2].point, bottom[1].point)},
- {corners: [top[2], top[3], bottom[3], bottom[2]], center: Point3d.avg(bottom[3].point, bottom[2].point)},
- {corners: [top[3], top[0], bottom[0], bottom[3]], center: Point3d.avg(bottom[0].point, bottom[3].point)}
- ];
- point.surfaces = surfaces;
+ var oldScrollTop = this._getScrollTop();
+ var newScrollTop = this._setScrollTop(this.touch.initialScrollTop + delta);
- // calculate the distance of each of the surface centers to the camera
- for (j = 0; j < surfaces.length; j++) {
- surface = surfaces[j];
- var transCenter = this._convertPointToTranslation(surface.center);
- surface.dist = this.showPerspective ? transCenter.length() : -transCenter.z;
- // TODO: this dept calculation doesn't work 100% of the cases due to perspective,
- // but the current solution is fast/simple and works in 99.9% of all cases
- // the issue is visible in example 14, with graph.setCameraPosition({horizontal: 2.97, vertical: 0.5, distance: 0.9})
- }
+ if (newScrollTop != oldScrollTop) {
+ this.redraw(); // TODO: this causes two redraws when dragging, the other is triggered by rangechange already
+ }
+ };
- // order the surfaces by their (translated) depth
- surfaces.sort(function (a, b) {
- var diff = b.dist - a.dist;
- if (diff) return diff;
+ /**
+ * Apply a scrollTop
+ * @param {Number} scrollTop
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
+ */
+ Graph2d.prototype._setScrollTop = function (scrollTop) {
+ this.props.scrollTop = scrollTop;
+ this._updateScrollTop();
+ return this.props.scrollTop;
+ };
+
+ /**
+ * Update the current scrollTop when the height of the containers has been changed
+ * @returns {Number} scrollTop Returns the applied scrollTop
+ * @private
+ */
+ Graph2d.prototype._updateScrollTop = function () {
+ // recalculate the scrollTopMin
+ var scrollTopMin = Math.min(this.props.centerContainer.height - this.props.center.height, 0); // is negative or zero
+ if (scrollTopMin != this.props.scrollTopMin) {
+ // in case of bottom orientation, change the scrollTop such that the contents
+ // do not move relative to the time axis at the bottom
+ if (this.options.orientation == 'bottom') {
+ this.props.scrollTop += (scrollTopMin - this.props.scrollTopMin);
+ }
+ this.props.scrollTopMin = scrollTopMin;
+ }
- // if equal depth, sort the top surface last
- if (a.corners === top) return 1;
- if (b.corners === top) return -1;
+ // limit the scrollTop to the feasible scroll range
+ if (this.props.scrollTop > 0) this.props.scrollTop = 0;
+ if (this.props.scrollTop < scrollTopMin) this.props.scrollTop = scrollTopMin;
- // both are equal
- return 0;
- });
+ return this.props.scrollTop;
+ };
- // draw the ordered surfaces
- ctx.lineWidth = 1;
- ctx.strokeStyle = borderColor;
- ctx.fillStyle = color;
- // NOTE: we start at j=2 instead of j=0 as we don't need to draw the two surfaces at the backside
- for (j = 2; j < surfaces.length; j++) {
- surface = surfaces[j];
- corners = surface.corners;
- ctx.beginPath();
- ctx.moveTo(corners[3].screen.x, corners[3].screen.y);
- ctx.lineTo(corners[0].screen.x, corners[0].screen.y);
- ctx.lineTo(corners[1].screen.x, corners[1].screen.y);
- ctx.lineTo(corners[2].screen.x, corners[2].screen.y);
- ctx.lineTo(corners[3].screen.x, corners[3].screen.y);
- ctx.fill();
- ctx.stroke();
- }
- }
+ /**
+ * Get the current scrollTop
+ * @returns {number} scrollTop
+ * @private
+ */
+ Graph2d.prototype._getScrollTop = function () {
+ return this.props.scrollTop;
};
+ module.exports = Graph2d;
+
+
+/***/ },
+/* 8 */
+/***/ function(module, exports, __webpack_require__) {
/**
- * Draw a line through all datapoints.
- * This function can be used when the style is 'line'
+ * @constructor DataStep
+ * The class DataStep is an iterator for data for the lineGraph. You provide a start data point and an
+ * end data point. The class itself determines the best scale (step size) based on the
+ * provided start Date, end Date, and minimumStep.
+ *
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ *
+ * Alternatively, you can set a scale by hand.
+ * After creation, you can initialize the class by executing first(). Then you
+ * can iterate from the start date to the end date via next(). You can check if
+ * the end date is reached with the function hasNext(). After each step, you can
+ * retrieve the current date via getCurrent().
+ * The DataStep has scales ranging from milliseconds, seconds, minutes, hours,
+ * days, to years.
+ *
+ * Version: 1.2
+ *
+ * @param {Date} [start] The start date, for example new Date(2010, 9, 21)
+ * or new Date(2010, 9, 21, 23, 45, 00)
+ * @param {Date} [end] The end date
+ * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
*/
- Graph3d.prototype._redrawDataLine = function() {
- var canvas = this.frame.canvas,
- ctx = canvas.getContext('2d'),
- point, i;
-
- if (this.dataPoints === undefined || this.dataPoints.length <= 0)
- return; // TODO: throw exception?
+ function DataStep(start, end, minimumStep, containerHeight, forcedStepSize) {
+ // variables
+ this.current = 0;
- // calculate the translations of all points
- for (i = 0; i < this.dataPoints.length; i++) {
- var trans = this._convertPointToTranslation(this.dataPoints[i].point);
- var screen = this._convertTranslationToScreen(trans);
+ this.autoScale = true;
+ this.stepIndex = 0;
+ this.step = 1;
+ this.scale = 1;
- this.dataPoints[i].trans = trans;
- this.dataPoints[i].screen = screen;
- }
+ this.marginStart;
+ this.marginEnd;
- // start the line
- if (this.dataPoints.length > 0) {
- point = this.dataPoints[0];
+ this.majorSteps = [1, 2, 5, 10];
+ this.minorSteps = [0.25, 0.5, 1, 2];
- ctx.lineWidth = 1; // TODO: make customizable
- ctx.strokeStyle = 'blue'; // TODO: make customizable
- ctx.beginPath();
- ctx.moveTo(point.screen.x, point.screen.y);
- }
+ this.setRange(start, end, minimumStep, containerHeight, forcedStepSize);
+ }
- // draw the datapoints as colored circles
- for (i = 1; i < this.dataPoints.length; i++) {
- point = this.dataPoints[i];
- ctx.lineTo(point.screen.x, point.screen.y);
- }
- // finish the line
- if (this.dataPoints.length > 0) {
- ctx.stroke();
- }
- };
/**
- * Start a moving operation inside the provided parent element
- * @param {Event} event The event that occurred (required for
- * retrieving the mouse position)
+ * Set a new range
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ * @param {Number} [start] The start date and time.
+ * @param {Number} [end] The end date and time.
+ * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
*/
- Graph3d.prototype._onMouseDown = function(event) {
- event = event || window.event;
+ DataStep.prototype.setRange = function(start, end, minimumStep, containerHeight, forcedStepSize) {
+ this._start = start;
+ this._end = end;
- // check if mouse is still down (may be up when focus is lost for example
- // in an iframe)
- if (this.leftButtonDown) {
- this._onMouseUp(event);
+ if (this.autoScale) {
+ this.setMinimumStep(minimumStep, containerHeight, forcedStepSize);
}
+ this.setFirst();
+ };
- // only react on left mouse button down
- this.leftButtonDown = event.which ? (event.which === 1) : (event.button === 1);
- if (!this.leftButtonDown && !this.touchDown) return;
-
- // get mouse position (different code for IE and all other browsers)
- this.startMouseX = getMouseX(event);
- this.startMouseY = getMouseY(event);
+ /**
+ * Automatically determine the scale that bests fits the provided minimum step
+ * @param {Number} [minimumStep] The minimum step size in milliseconds
+ */
+ DataStep.prototype.setMinimumStep = function(minimumStep, containerHeight) {
+ // round to floor
+ var size = this._end - this._start;
+ var safeSize = size * 1.1;
+ var minimumStepValue = minimumStep * (safeSize / containerHeight);
+ var orderOfMagnitude = Math.round(Math.log(safeSize)/Math.LN10);
- this.startStart = new Date(this.start);
- this.startEnd = new Date(this.end);
- this.startArmRotation = this.camera.getArmRotation();
+ var minorStepIdx = -1;
+ var magnitudefactor = Math.pow(10,orderOfMagnitude);
- this.frame.style.cursor = 'move';
+ var start = 0;
+ if (orderOfMagnitude < 0) {
+ start = orderOfMagnitude;
+ }
- // add event listeners to handle moving the contents
- // we store the function onmousemove and onmouseup in the graph, so we can
- // remove the eventlisteners lateron in the function mouseUp()
- var me = this;
- this.onmousemove = function (event) {me._onMouseMove(event);};
- this.onmouseup = function (event) {me._onMouseUp(event);};
- G3DaddEventListener(document, 'mousemove', me.onmousemove);
- G3DaddEventListener(document, 'mouseup', me.onmouseup);
- G3DpreventDefault(event);
+ var solutionFound = false;
+ for (var i = start; Math.abs(i) <= Math.abs(orderOfMagnitude); i++) {
+ magnitudefactor = Math.pow(10,i);
+ for (var j = 0; j < this.minorSteps.length; j++) {
+ var stepSize = magnitudefactor * this.minorSteps[j];
+ if (stepSize >= minimumStepValue) {
+ solutionFound = true;
+ minorStepIdx = j;
+ break;
+ }
+ }
+ if (solutionFound == true) {
+ break;
+ }
+ }
+ this.stepIndex = minorStepIdx;
+ this.scale = magnitudefactor;
+ this.step = magnitudefactor * this.minorSteps[minorStepIdx];
};
/**
- * Perform moving operating.
- * This function activated from within the funcion Graph.mouseDown().
- * @param {Event} event Well, eehh, the event
+ * Set the range iterator to the start date.
*/
- Graph3d.prototype._onMouseMove = function (event) {
- event = event || window.event;
+ DataStep.prototype.first = function() {
+ this.setFirst();
+ };
- // calculate change in mouse position
- var diffX = parseFloat(getMouseX(event)) - this.startMouseX;
- var diffY = parseFloat(getMouseY(event)) - this.startMouseY;
+ /**
+ * Round the current date to the first minor date value
+ * This must be executed once when the current date is set to start Date
+ */
+ DataStep.prototype.setFirst = function() {
+ var niceStart = this._start - (this.scale * this.minorSteps[this.stepIndex]);
+ var niceEnd = this._end + (this.scale * this.minorSteps[this.stepIndex]);
- var horizontalNew = this.startArmRotation.horizontal + diffX / 200;
- var verticalNew = this.startArmRotation.vertical + diffY / 200;
+ this.marginEnd = this.roundToMinor(niceEnd);
+ this.marginStart = this.roundToMinor(niceStart);
+ this.marginRange = this.marginEnd - this.marginStart;
- var snapAngle = 4; // degrees
- var snapValue = Math.sin(snapAngle / 360 * 2 * Math.PI);
+ this.current = this.marginEnd;
- // snap horizontally to nice angles at 0pi, 0.5pi, 1pi, 1.5pi, etc...
- // the -0.001 is to take care that the vertical axis is always drawn at the left front corner
- if (Math.abs(Math.sin(horizontalNew)) < snapValue) {
- horizontalNew = Math.round((horizontalNew / Math.PI)) * Math.PI - 0.001;
- }
- if (Math.abs(Math.cos(horizontalNew)) < snapValue) {
- horizontalNew = (Math.round((horizontalNew/ Math.PI - 0.5)) + 0.5) * Math.PI - 0.001;
- }
+ };
- // snap vertically to nice angles
- if (Math.abs(Math.sin(verticalNew)) < snapValue) {
- verticalNew = Math.round((verticalNew / Math.PI)) * Math.PI;
+ DataStep.prototype.roundToMinor = function(value) {
+ var rounded = value - (value % (this.scale * this.minorSteps[this.stepIndex]));
+ if (value % (this.scale * this.minorSteps[this.stepIndex]) > 0.5 * (this.scale * this.minorSteps[this.stepIndex])) {
+ return rounded + (this.scale * this.minorSteps[this.stepIndex]);
}
- if (Math.abs(Math.cos(verticalNew)) < snapValue) {
- verticalNew = (Math.round((verticalNew/ Math.PI - 0.5)) + 0.5) * Math.PI;
+ else {
+ return rounded;
}
+ }
- this.camera.setArmRotation(horizontalNew, verticalNew);
- this.redraw();
-
- // fire a cameraPositionChange event
- var parameters = this.getCameraPosition();
- this.emit('cameraPositionChange', parameters);
- G3DpreventDefault(event);
+ /**
+ * Check if the there is a next step
+ * @return {boolean} true if the current date has not passed the end date
+ */
+ DataStep.prototype.hasNext = function () {
+ return (this.current >= this.marginStart);
};
-
/**
- * Stop moving operating.
- * This function activated from within the funcion Graph.mouseDown().
- * @param {event} event The event
+ * Do the next step
*/
- Graph3d.prototype._onMouseUp = function (event) {
- this.frame.style.cursor = 'auto';
- this.leftButtonDown = false;
+ DataStep.prototype.next = function() {
+ var prev = this.current;
+ this.current -= this.step;
- // remove event listeners here
- G3DremoveEventListener(document, 'mousemove', this.onmousemove);
- G3DremoveEventListener(document, 'mouseup', this.onmouseup);
- G3DpreventDefault(event);
+ // safety mechanism: if current time is still unchanged, move to the end
+ if (this.current == prev) {
+ this.current = this._end;
+ }
};
/**
- * After having moved the mouse, a tooltip should pop up when the mouse is resting on a data point
- * @param {Event} event A mouse move event
+ * Do the next step
*/
- Graph3d.prototype._onTooltip = function (event) {
- var delay = 300; // ms
- var mouseX = getMouseX(event) - getAbsoluteLeft(this.frame);
- var mouseY = getMouseY(event) - getAbsoluteTop(this.frame);
-
- if (!this.showTooltip) {
- return;
- }
+ DataStep.prototype.previous = function() {
+ this.current += this.step;
+ this.marginEnd += this.step;
+ this.marginRange = this.marginEnd - this.marginStart;
+ };
- if (this.tooltipTimeout) {
- clearTimeout(this.tooltipTimeout);
- }
- // (delayed) display of a tooltip only if no mouse button is down
- if (this.leftButtonDown) {
- this._hideTooltip();
- return;
- }
- if (this.tooltip && this.tooltip.dataPoint) {
- // tooltip is currently visible
- var dataPoint = this._dataPointFromXY(mouseX, mouseY);
- if (dataPoint !== this.tooltip.dataPoint) {
- // datapoint changed
- if (dataPoint) {
- this._showTooltip(dataPoint);
- }
- else {
- this._hideTooltip();
- }
+ /**
+ * Get the current datetime
+ * @return {String} current The current date
+ */
+ DataStep.prototype.getCurrent = function() {
+ var toPrecision = '' + Number(this.current).toPrecision(5);
+ for (var i = toPrecision.length-1; i > 0; i--) {
+ if (toPrecision[i] == "0") {
+ toPrecision = toPrecision.slice(0,i);
+ }
+ else if (toPrecision[i] == "." || toPrecision[i] == ",") {
+ toPrecision = toPrecision.slice(0,i);
+ break;
+ }
+ else{
+ break;
}
}
- else {
- // tooltip is currently not visible
- var me = this;
- this.tooltipTimeout = setTimeout(function () {
- me.tooltipTimeout = null;
- // show a tooltip if we have a data point
- var dataPoint = me._dataPointFromXY(mouseX, mouseY);
- if (dataPoint) {
- me._showTooltip(dataPoint);
- }
- }, delay);
- }
+ return toPrecision;
};
+
+
/**
- * Event handler for touchstart event on mobile devices
+ * Snap a date to a rounded value.
+ * The snap intervals are dependent on the current scale and step.
+ * @param {Date} date the date to be snapped.
+ * @return {Date} snappedDate
*/
- Graph3d.prototype._onTouchStart = function(event) {
- this.touchDown = true;
-
- var me = this;
- this.ontouchmove = function (event) {me._onTouchMove(event);};
- this.ontouchend = function (event) {me._onTouchEnd(event);};
- G3DaddEventListener(document, 'touchmove', me.ontouchmove);
- G3DaddEventListener(document, 'touchend', me.ontouchend);
+ DataStep.prototype.snap = function(date) {
- this._onMouseDown(event);
};
/**
- * Event handler for touchmove event on mobile devices
+ * Check if the current value is a major value (for example when the step
+ * is DAY, a major value is each first day of the MONTH)
+ * @return {boolean} true if current date is major, else false.
*/
- Graph3d.prototype._onTouchMove = function(event) {
- this._onMouseMove(event);
+ DataStep.prototype.isMajor = function() {
+ return (this.current % (this.scale * this.majorSteps[this.stepIndex]) == 0);
};
- /**
- * Event handler for touchend event on mobile devices
- */
- Graph3d.prototype._onTouchEnd = function(event) {
- this.touchDown = false;
+ module.exports = DataStep;
- G3DremoveEventListener(document, 'touchmove', this.ontouchmove);
- G3DremoveEventListener(document, 'touchend', this.ontouchend);
- this._onMouseUp(event);
- };
+/***/ },
+/* 9 */
+/***/ function(module, exports, __webpack_require__) {
+ var util = __webpack_require__(1);
+ var moment = __webpack_require__(39);
+ var Component = __webpack_require__(12);
/**
- * Event handler for mouse wheel event, used to zoom the graph
- * Code from http://adomas.org/javascript-mouse-wheel/
- * @param {event} event The event
+ * @constructor Range
+ * A Range controls a numeric range with a start and end value.
+ * The Range adjusts the range based on mouse events or programmatic changes,
+ * and triggers events when the range is changing or has been changed.
+ * @param {{dom: Object, domProps: Object, emitter: Emitter}} body
+ * @param {Object} [options] See description at Range.setOptions
*/
- Graph3d.prototype._onWheel = function(event) {
- if (!event) /* For IE. */
- event = window.event;
+ function Range(body, options) {
+ var now = moment().hours(0).minutes(0).seconds(0).milliseconds(0);
+ this.start = now.clone().add('days', -3).valueOf(); // Number
+ this.end = now.clone().add('days', 4).valueOf(); // Number
- // retrieve delta
- var delta = 0;
- if (event.wheelDelta) { /* IE/Opera. */
- delta = event.wheelDelta/120;
- } else if (event.detail) { /* Mozilla case. */
- // In Mozilla, sign of delta is different than in IE.
- // Also, delta is multiple of 3.
- delta = -event.detail/3;
- }
+ this.body = body;
- // If delta is nonzero, handle it.
- // Basically, delta is now positive if wheel was scrolled up,
- // and negative, if wheel was scrolled down.
- if (delta) {
- var oldLength = this.camera.getArmLength();
- var newLength = oldLength * (1 - delta / 10);
+ // default options
+ this.defaultOptions = {
+ start: null,
+ end: null,
+ direction: 'horizontal', // 'horizontal' or 'vertical'
+ moveable: true,
+ zoomable: true,
+ min: null,
+ max: null,
+ zoomMin: 10, // milliseconds
+ zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000 // milliseconds
+ };
+ this.options = util.extend({}, this.defaultOptions);
- this.camera.setArmLength(newLength);
- this.redraw();
+ this.props = {
+ touch: {}
+ };
- this._hideTooltip();
- }
+ // drag listeners for dragging
+ this.body.emitter.on('dragstart', this._onDragStart.bind(this));
+ this.body.emitter.on('drag', this._onDrag.bind(this));
+ this.body.emitter.on('dragend', this._onDragEnd.bind(this));
- // fire a cameraPositionChange event
- var parameters = this.getCameraPosition();
- this.emit('cameraPositionChange', parameters);
+ // ignore dragging when holding
+ this.body.emitter.on('hold', this._onHold.bind(this));
- // Prevent default actions caused by mouse wheel.
- // That might be ugly, but we handle scrolls somehow
- // anyway, so don't bother here..
- G3DpreventDefault(event);
+ // mouse wheel for zooming
+ this.body.emitter.on('mousewheel', this._onMouseWheel.bind(this));
+ this.body.emitter.on('DOMMouseScroll', this._onMouseWheel.bind(this)); // For FF
+
+ // pinch to zoom
+ this.body.emitter.on('touch', this._onTouch.bind(this));
+ this.body.emitter.on('pinch', this._onPinch.bind(this));
+
+ this.setOptions(options);
+ }
+
+ Range.prototype = new Component();
+
+ /**
+ * Set options for the range controller
+ * @param {Object} options Available options:
+ * {Number | Date | String} start Start date for the range
+ * {Number | Date | String} end End date for the range
+ * {Number} min Minimum value for start
+ * {Number} max Maximum value for end
+ * {Number} zoomMin Set a minimum value for
+ * (end - start).
+ * {Number} zoomMax Set a maximum value for
+ * (end - start).
+ * {Boolean} moveable Enable moving of the range
+ * by dragging. True by default
+ * {Boolean} zoomable Enable zooming of the range
+ * by pinching/scrolling. True by default
+ */
+ Range.prototype.setOptions = function (options) {
+ if (options) {
+ // copy the options that we know
+ var fields = ['direction', 'min', 'max', 'zoomMin', 'zoomMax', 'moveable', 'zoomable'];
+ util.selectiveExtend(fields, this.options, options);
+
+ if ('start' in options || 'end' in options) {
+ // apply a new range. both start and end are optional
+ this.setRange(options.start, options.end);
+ }
+ }
};
/**
- * Test whether a point lies inside given 2D triangle
- * @param {Point2d} point
- * @param {Point2d[]} triangle
- * @return {boolean} Returns true if given point lies inside or on the edge of the triangle
- * @private
+ * Test whether direction has a valid value
+ * @param {String} direction 'horizontal' or 'vertical'
*/
- Graph3d.prototype._insideTriangle = function (point, triangle) {
- var a = triangle[0],
- b = triangle[1],
- c = triangle[2];
+ function validateDirection (direction) {
+ if (direction != 'horizontal' && direction != 'vertical') {
+ throw new TypeError('Unknown direction "' + direction + '". ' +
+ 'Choose "horizontal" or "vertical".');
+ }
+ }
- function sign (x) {
- return x > 0 ? 1 : x < 0 ? -1 : 0;
+ /**
+ * Set a new start and end range
+ * @param {Number} [start]
+ * @param {Number} [end]
+ */
+ Range.prototype.setRange = function(start, end) {
+ var changed = this._applyRange(start, end);
+ if (changed) {
+ var params = {
+ start: new Date(this.start),
+ end: new Date(this.end)
+ };
+ this.body.emitter.emit('rangechange', params);
+ this.body.emitter.emit('rangechanged', params);
}
-
- var as = sign((b.x - a.x) * (point.y - a.y) - (b.y - a.y) * (point.x - a.x));
- var bs = sign((c.x - b.x) * (point.y - b.y) - (c.y - b.y) * (point.x - b.x));
- var cs = sign((a.x - c.x) * (point.y - c.y) - (a.y - c.y) * (point.x - c.x));
-
- // each of the three signs must be either equal to each other or zero
- return (as == 0 || bs == 0 || as == bs) &&
- (bs == 0 || cs == 0 || bs == cs) &&
- (as == 0 || cs == 0 || as == cs);
};
/**
- * Find a data point close to given screen position (x, y)
- * @param {Number} x
- * @param {Number} y
- * @return {Object | null} The closest data point or null if not close to any data point
+ * Set a new start and end range. This method is the same as setRange, but
+ * does not trigger a range change and range changed event, and it returns
+ * true when the range is changed
+ * @param {Number} [start]
+ * @param {Number} [end]
+ * @return {Boolean} changed
* @private
*/
- Graph3d.prototype._dataPointFromXY = function (x, y) {
- var i,
- distMax = 100, // px
- dataPoint = null,
- closestDataPoint = null,
- closestDist = null,
- center = new Point2d(x, y);
+ Range.prototype._applyRange = function(start, end) {
+ var newStart = (start != null) ? util.convert(start, 'Date').valueOf() : this.start,
+ newEnd = (end != null) ? util.convert(end, 'Date').valueOf() : this.end,
+ max = (this.options.max != null) ? util.convert(this.options.max, 'Date').valueOf() : null,
+ min = (this.options.min != null) ? util.convert(this.options.min, 'Date').valueOf() : null,
+ diff;
- if (this.style === Graph3d.STYLE.BAR ||
- this.style === Graph3d.STYLE.BARCOLOR ||
- this.style === Graph3d.STYLE.BARSIZE) {
- // the data points are ordered from far away to closest
- for (i = this.dataPoints.length - 1; i >= 0; i--) {
- dataPoint = this.dataPoints[i];
- var surfaces = dataPoint.surfaces;
- if (surfaces) {
- for (var s = surfaces.length - 1; s >= 0; s--) {
- // split each surface in two triangles, and see if the center point is inside one of these
- var surface = surfaces[s];
- var corners = surface.corners;
- var triangle1 = [corners[0].screen, corners[1].screen, corners[2].screen];
- var triangle2 = [corners[2].screen, corners[3].screen, corners[0].screen];
- if (this._insideTriangle(center, triangle1) ||
- this._insideTriangle(center, triangle2)) {
- // return immediately at the first hit
- return dataPoint;
- }
+ // check for valid number
+ if (isNaN(newStart) || newStart === null) {
+ throw new Error('Invalid start "' + start + '"');
+ }
+ if (isNaN(newEnd) || newEnd === null) {
+ throw new Error('Invalid end "' + end + '"');
+ }
+
+ // prevent start < end
+ if (newEnd < newStart) {
+ newEnd = newStart;
+ }
+
+ // prevent start < min
+ if (min !== null) {
+ if (newStart < min) {
+ diff = (min - newStart);
+ newStart += diff;
+ newEnd += diff;
+
+ // prevent end > max
+ if (max != null) {
+ if (newEnd > max) {
+ newEnd = max;
}
}
}
}
- else {
- // find the closest data point, using distance to the center of the point on 2d screen
- for (i = 0; i < this.dataPoints.length; i++) {
- dataPoint = this.dataPoints[i];
- var point = dataPoint.screen;
- if (point) {
- var distX = Math.abs(x - point.x);
- var distY = Math.abs(y - point.y);
- var dist = Math.sqrt(distX * distX + distY * distY);
- if ((closestDist === null || dist < closestDist) && dist < distMax) {
- closestDist = dist;
- closestDataPoint = dataPoint;
+ // prevent end > max
+ if (max !== null) {
+ if (newEnd > max) {
+ diff = (newEnd - max);
+ newStart -= diff;
+ newEnd -= diff;
+
+ // prevent start < min
+ if (min != null) {
+ if (newStart < min) {
+ newStart = min;
}
}
}
}
-
- return closestDataPoint;
- };
-
- /**
- * Display a tooltip for given data point
- * @param {Object} dataPoint
- * @private
- */
- Graph3d.prototype._showTooltip = function (dataPoint) {
- var content, line, dot;
-
- if (!this.tooltip) {
- content = document.createElement('div');
- content.style.position = 'absolute';
- content.style.padding = '10px';
- content.style.border = '1px solid #4d4d4d';
- content.style.color = '#1a1a1a';
- content.style.background = 'rgba(255,255,255,0.7)';
- content.style.borderRadius = '2px';
- content.style.boxShadow = '5px 5px 10px rgba(128,128,128,0.5)';
-
- line = document.createElement('div');
- line.style.position = 'absolute';
- line.style.height = '40px';
- line.style.width = '0';
- line.style.borderLeft = '1px solid #4d4d4d';
-
- dot = document.createElement('div');
- dot.style.position = 'absolute';
- dot.style.height = '0';
- dot.style.width = '0';
- dot.style.border = '5px solid #4d4d4d';
- dot.style.borderRadius = '5px';
-
- this.tooltip = {
- dataPoint: null,
- dom: {
- content: content,
- line: line,
- dot: dot
+ // prevent (end-start) < zoomMin
+ if (this.options.zoomMin !== null) {
+ var zoomMin = parseFloat(this.options.zoomMin);
+ if (zoomMin < 0) {
+ zoomMin = 0;
+ }
+ if ((newEnd - newStart) < zoomMin) {
+ if ((this.end - this.start) === zoomMin) {
+ // ignore this action, we are already zoomed to the minimum
+ newStart = this.start;
+ newEnd = this.end;
}
- };
+ else {
+ // zoom to the minimum
+ diff = (zoomMin - (newEnd - newStart));
+ newStart -= diff / 2;
+ newEnd += diff / 2;
+ }
+ }
}
- else {
- content = this.tooltip.dom.content;
- line = this.tooltip.dom.line;
- dot = this.tooltip.dom.dot;
+
+ // prevent (end-start) > zoomMax
+ if (this.options.zoomMax !== null) {
+ var zoomMax = parseFloat(this.options.zoomMax);
+ if (zoomMax < 0) {
+ zoomMax = 0;
+ }
+ if ((newEnd - newStart) > zoomMax) {
+ if ((this.end - this.start) === zoomMax) {
+ // ignore this action, we are already zoomed to the maximum
+ newStart = this.start;
+ newEnd = this.end;
+ }
+ else {
+ // zoom to the maximum
+ diff = ((newEnd - newStart) - zoomMax);
+ newStart += diff / 2;
+ newEnd -= diff / 2;
+ }
+ }
}
- this._hideTooltip();
+ var changed = (this.start != newStart || this.end != newEnd);
- this.tooltip.dataPoint = dataPoint;
- if (typeof this.showTooltip === 'function') {
- content.innerHTML = this.showTooltip(dataPoint.point);
- }
- else {
- content.innerHTML = '
' +
- '
x:
' + dataPoint.point.x + '
' +
- '
y:
' + dataPoint.point.y + '
' +
- '
z:
' + dataPoint.point.z + '
' +
- '
';
- }
+ this.start = newStart;
+ this.end = newEnd;
- content.style.left = '0';
- content.style.top = '0';
- this.frame.appendChild(content);
- this.frame.appendChild(line);
- this.frame.appendChild(dot);
+ return changed;
+ };
- // calculate sizes
- var contentWidth = content.offsetWidth;
- var contentHeight = content.offsetHeight;
- var lineHeight = line.offsetHeight;
- var dotWidth = dot.offsetWidth;
- var dotHeight = dot.offsetHeight;
+ /**
+ * Retrieve the current range.
+ * @return {Object} An object with start and end properties
+ */
+ Range.prototype.getRange = function() {
+ return {
+ start: this.start,
+ end: this.end
+ };
+ };
- var left = dataPoint.screen.x - contentWidth / 2;
- left = Math.min(Math.max(left, 10), this.frame.clientWidth - 10 - contentWidth);
+ /**
+ * Calculate the conversion offset and scale for current range, based on
+ * the provided width
+ * @param {Number} width
+ * @returns {{offset: number, scale: number}} conversion
+ */
+ Range.prototype.conversion = function (width) {
+ return Range.conversion(this.start, this.end, width);
+ };
- line.style.left = dataPoint.screen.x + 'px';
- line.style.top = (dataPoint.screen.y - lineHeight) + 'px';
- content.style.left = left + 'px';
- content.style.top = (dataPoint.screen.y - lineHeight - contentHeight) + 'px';
- dot.style.left = (dataPoint.screen.x - dotWidth / 2) + 'px';
- dot.style.top = (dataPoint.screen.y - dotHeight / 2) + 'px';
+ /**
+ * Static method to calculate the conversion offset and scale for a range,
+ * based on the provided start, end, and width
+ * @param {Number} start
+ * @param {Number} end
+ * @param {Number} width
+ * @returns {{offset: number, scale: number}} conversion
+ */
+ Range.conversion = function (start, end, width) {
+ if (width != 0 && (end - start != 0)) {
+ return {
+ offset: start,
+ scale: width / (end - start)
+ }
+ }
+ else {
+ return {
+ offset: 0,
+ scale: 1
+ };
+ }
};
/**
- * Hide the tooltip when displayed
+ * Start dragging horizontally or vertically
+ * @param {Event} event
* @private
*/
- Graph3d.prototype._hideTooltip = function () {
- if (this.tooltip) {
- this.tooltip.dataPoint = null;
+ Range.prototype._onDragStart = function(event) {
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
- for (var prop in this.tooltip.dom) {
- if (this.tooltip.dom.hasOwnProperty(prop)) {
- var elem = this.tooltip.dom[prop];
- if (elem && elem.parentNode) {
- elem.parentNode.removeChild(elem);
- }
- }
- }
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+
+ this.props.touch.start = this.start;
+ this.props.touch.end = this.end;
+
+ if (this.body.dom.root) {
+ this.body.dom.root.style.cursor = 'move';
}
};
+ /**
+ * Perform dragging operation
+ * @param {Event} event
+ * @private
+ */
+ Range.prototype._onDrag = function (event) {
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
+ var direction = this.options.direction;
+ validateDirection(direction);
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
+ var delta = (direction == 'horizontal') ? event.gesture.deltaX : event.gesture.deltaY,
+ interval = (this.props.touch.end - this.props.touch.start),
+ width = (direction == 'horizontal') ? this.body.domProps.center.width : this.body.domProps.center.height,
+ diffRange = -delta / width * interval;
+ this._applyRange(this.props.touch.start + diffRange, this.props.touch.end + diffRange);
+ this.body.emitter.emit('rangechange', {
+ start: new Date(this.start),
+ end: new Date(this.end)
+ });
+ };
/**
- * Add and event listener. Works for all browsers
- * @param {Element} element An html element
- * @param {string} action The action, for example 'click',
- * without the prefix 'on'
- * @param {function} listener The callback function to be executed
- * @param {boolean} useCapture
+ * Stop dragging operation
+ * @param {event} event
+ * @private
*/
- G3DaddEventListener = function(element, action, listener, useCapture) {
- if (element.addEventListener) {
- if (useCapture === undefined)
- useCapture = false;
+ Range.prototype._onDragEnd = function (event) {
+ // only allow dragging when configured as movable
+ if (!this.options.moveable) return;
- if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {
- action = 'DOMMouseScroll'; // For Firefox
- }
+ // refuse to drag when we where pinching to prevent the timeline make a jump
+ // when releasing the fingers in opposite order from the touch screen
+ if (!this.props.touch.allowDragging) return;
- element.addEventListener(action, listener, useCapture);
- } else {
- element.attachEvent('on' + action, listener); // IE browsers
+ if (this.body.dom.root) {
+ this.body.dom.root.style.cursor = 'auto';
}
+
+ // fire a rangechanged event
+ this.body.emitter.emit('rangechanged', {
+ start: new Date(this.start),
+ end: new Date(this.end)
+ });
};
/**
- * Remove an event listener from an element
- * @param {Element} element An html dom element
- * @param {string} action The name of the event, for example 'mousedown'
- * @param {function} listener The listener function
- * @param {boolean} useCapture
+ * Event handler for mouse wheel event, used to zoom
+ * Code from http://adomas.org/javascript-mouse-wheel/
+ * @param {Event} event
+ * @private
*/
- G3DremoveEventListener = function(element, action, listener, useCapture) {
- if (element.removeEventListener) {
- // non-IE browsers
- if (useCapture === undefined)
- useCapture = false;
+ Range.prototype._onMouseWheel = function(event) {
+ // only allow zooming when configured as zoomable and moveable
+ if (!(this.options.zoomable && this.options.moveable)) return;
- if (action === 'mousewheel' && navigator.userAgent.indexOf('Firefox') >= 0) {
- action = 'DOMMouseScroll'; // For Firefox
+ // retrieve delta
+ var delta = 0;
+ if (event.wheelDelta) { /* IE/Opera. */
+ delta = event.wheelDelta / 120;
+ } else if (event.detail) { /* Mozilla case. */
+ // In Mozilla, sign of delta is different than in IE.
+ // Also, delta is multiple of 3.
+ delta = -event.detail / 3;
+ }
+
+ // If delta is nonzero, handle it.
+ // Basically, delta is now positive if wheel was scrolled up,
+ // and negative, if wheel was scrolled down.
+ if (delta) {
+ // perform the zoom action. Delta is normally 1 or -1
+
+ // adjust a negative delta such that zooming in with delta 0.1
+ // equals zooming out with a delta -0.1
+ var scale;
+ if (delta < 0) {
+ scale = 1 - (delta / 5);
+ }
+ else {
+ scale = 1 / (1 + (delta / 5)) ;
}
- element.removeEventListener(action, listener, useCapture);
- } else {
- // IE browsers
- element.detachEvent('on' + action, listener);
+ // calculate center, the date to zoom around
+ var gesture = util.fakeGesture(this, event),
+ pointer = getPointer(gesture.center, this.body.dom.center),
+ pointerDate = this._pointerToDate(pointer);
+
+ this.zoom(scale, pointerDate);
}
+
+ // Prevent default actions caused by mouse wheel
+ // (else the page and timeline both zoom and scroll)
+ event.preventDefault();
};
/**
- * Stop event propagation
+ * Start of a touch gesture
+ * @private
*/
- G3DstopPropagation = function(event) {
- if (!event)
- event = window.event;
-
- if (event.stopPropagation) {
- event.stopPropagation(); // non-IE browsers
- }
- else {
- event.cancelBubble = true; // IE browsers
- }
+ Range.prototype._onTouch = function (event) {
+ this.props.touch.start = this.start;
+ this.props.touch.end = this.end;
+ this.props.touch.allowDragging = true;
+ this.props.touch.center = null;
};
-
/**
- * Cancels the event if it is cancelable, without stopping further propagation of the event.
+ * On start of a hold gesture
+ * @private
*/
- G3DpreventDefault = function (event) {
- if (!event)
- event = window.event;
-
- if (event.preventDefault) {
- event.preventDefault(); // non-IE browsers
- }
- else {
- event.returnValue = false; // IE browsers
- }
+ Range.prototype._onHold = function () {
+ this.props.touch.allowDragging = false;
};
/**
- * @constructor Slider
- *
- * An html slider control with start/stop/prev/next buttons
- * @param {Element} container The element where the slider will be created
- * @param {Object} options Available options:
- * {boolean} visible If true (default) the
- * slider is visible.
+ * Handle pinch event
+ * @param {Event} event
+ * @private
*/
- function Slider(container, options) {
- if (container === undefined) {
- throw 'Error: No container element defined';
- }
- this.container = container;
- this.visible = (options && options.visible != undefined) ? options.visible : true;
-
- if (this.visible) {
- this.frame = document.createElement('DIV');
- //this.frame.style.backgroundColor = '#E5E5E5';
- this.frame.style.width = '100%';
- this.frame.style.position = 'relative';
- this.container.appendChild(this.frame);
-
- this.frame.prev = document.createElement('INPUT');
- this.frame.prev.type = 'BUTTON';
- this.frame.prev.value = 'Prev';
- this.frame.appendChild(this.frame.prev);
+ Range.prototype._onPinch = function (event) {
+ // only allow zooming when configured as zoomable and moveable
+ if (!(this.options.zoomable && this.options.moveable)) return;
- this.frame.play = document.createElement('INPUT');
- this.frame.play.type = 'BUTTON';
- this.frame.play.value = 'Play';
- this.frame.appendChild(this.frame.play);
+ this.props.touch.allowDragging = false;
- this.frame.next = document.createElement('INPUT');
- this.frame.next.type = 'BUTTON';
- this.frame.next.value = 'Next';
- this.frame.appendChild(this.frame.next);
+ if (event.gesture.touches.length > 1) {
+ if (!this.props.touch.center) {
+ this.props.touch.center = getPointer(event.gesture.center, this.body.dom.center);
+ }
- this.frame.bar = document.createElement('INPUT');
- this.frame.bar.type = 'BUTTON';
- this.frame.bar.style.position = 'absolute';
- this.frame.bar.style.border = '1px solid red';
- this.frame.bar.style.width = '100px';
- this.frame.bar.style.height = '6px';
- this.frame.bar.style.borderRadius = '2px';
- this.frame.bar.style.MozBorderRadius = '2px';
- this.frame.bar.style.border = '1px solid #7F7F7F';
- this.frame.bar.style.backgroundColor = '#E5E5E5';
- this.frame.appendChild(this.frame.bar);
+ var scale = 1 / event.gesture.scale,
+ initDate = this._pointerToDate(this.props.touch.center);
- this.frame.slide = document.createElement('INPUT');
- this.frame.slide.type = 'BUTTON';
- this.frame.slide.style.margin = '0px';
- this.frame.slide.value = ' ';
- this.frame.slide.style.position = 'relative';
- this.frame.slide.style.left = '-100px';
- this.frame.appendChild(this.frame.slide);
+ // calculate new start and end
+ var newStart = parseInt(initDate + (this.props.touch.start - initDate) * scale);
+ var newEnd = parseInt(initDate + (this.props.touch.end - initDate) * scale);
- // create events
- var me = this;
- this.frame.slide.onmousedown = function (event) {me._onMouseDown(event);};
- this.frame.prev.onclick = function (event) {me.prev(event);};
- this.frame.play.onclick = function (event) {me.togglePlay(event);};
- this.frame.next.onclick = function (event) {me.next(event);};
+ // apply new range
+ this.setRange(newStart, newEnd);
}
+ };
- this.onChangeCallback = undefined;
+ /**
+ * Helper function to calculate the center date for zooming
+ * @param {{x: Number, y: Number}} pointer
+ * @return {number} date
+ * @private
+ */
+ Range.prototype._pointerToDate = function (pointer) {
+ var conversion;
+ var direction = this.options.direction;
- this.values = [];
- this.index = undefined;
+ validateDirection(direction);
- this.playTimeout = undefined;
- this.playInterval = 1000; // milliseconds
- this.playLoop = true;
+ if (direction == 'horizontal') {
+ var width = this.body.domProps.center.width;
+ conversion = this.conversion(width);
+ return pointer.x / conversion.scale + conversion.offset;
+ }
+ else {
+ var height = this.body.domProps.center.height;
+ conversion = this.conversion(height);
+ return pointer.y / conversion.scale + conversion.offset;
+ }
+ };
+
+ /**
+ * Get the pointer location relative to the location of the dom element
+ * @param {{pageX: Number, pageY: Number}} touch
+ * @param {Element} element HTML DOM element
+ * @return {{x: Number, y: Number}} pointer
+ * @private
+ */
+ function getPointer (touch, element) {
+ return {
+ x: touch.pageX - util.getAbsoluteLeft(element),
+ y: touch.pageY - util.getAbsoluteTop(element)
+ };
}
/**
- * Select the previous index
+ * Zoom the range the given scale in or out. Start and end date will
+ * be adjusted, and the timeline will be redrawn. You can optionally give a
+ * date around which to zoom.
+ * For example, try scale = 0.9 or 1.1
+ * @param {Number} scale Scaling factor. Values above 1 will zoom out,
+ * values below 1 will zoom in.
+ * @param {Number} [center] Value representing a date around which will
+ * be zoomed.
*/
- Slider.prototype.prev = function() {
- var index = this.getIndex();
- if (index > 0) {
- index--;
- this.setIndex(index);
+ Range.prototype.zoom = function(scale, center) {
+ // if centerDate is not provided, take it half between start Date and end Date
+ if (center == null) {
+ center = (this.start + this.end) / 2;
}
+
+ // calculate new start and end
+ var newStart = center + (this.start - center) * scale;
+ var newEnd = center + (this.end - center) * scale;
+
+ this.setRange(newStart, newEnd);
};
/**
- * Select the next index
+ * Move the range with a given delta to the left or right. Start and end
+ * value will be adjusted. For example, try delta = 0.1 or -0.1
+ * @param {Number} delta Moving amount. Positive value will move right,
+ * negative value will move left
*/
- Slider.prototype.next = function() {
- var index = this.getIndex();
- if (index < this.values.length - 1) {
- index++;
- this.setIndex(index);
- }
+ Range.prototype.move = function(delta) {
+ // zoom start Date and end Date relative to the centerDate
+ var diff = (this.end - this.start);
+
+ // apply new values
+ var newStart = this.start + diff * delta;
+ var newEnd = this.end + diff * delta;
+
+ // TODO: reckon with min and max range
+
+ this.start = newStart;
+ this.end = newEnd;
};
/**
- * Select the next index
+ * Move the range to a new center point
+ * @param {Number} moveTo New center point of the range
*/
- Slider.prototype.playNext = function() {
- var start = new Date();
+ Range.prototype.moveTo = function(moveTo) {
+ var center = (this.start + this.end) / 2;
- var index = this.getIndex();
- if (index < this.values.length - 1) {
- index++;
- this.setIndex(index);
- }
- else if (this.playLoop) {
- // jump to the start
- index = 0;
- this.setIndex(index);
- }
+ var diff = center - moveTo;
- var end = new Date();
- var diff = (end - start);
+ // calculate new start and end
+ var newStart = this.start - diff;
+ var newEnd = this.end - diff;
- // calculate how much time it to to set the index and to execute the callback
- // function.
- var interval = Math.max(this.playInterval - diff, 0);
- // document.title = diff // TODO: cleanup
+ this.setRange(newStart, newEnd);
+ };
- var me = this;
- this.playTimeout = setTimeout(function() {me.playNext();}, interval);
+ module.exports = Range;
+
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ // Utility functions for ordering and stacking of items
+ var EPSILON = 0.001; // used when checking collisions, to prevent round-off errors
+
+ /**
+ * Order items by their start data
+ * @param {Item[]} items
+ */
+ exports.orderByStart = function(items) {
+ items.sort(function (a, b) {
+ return a.data.start - b.data.start;
+ });
};
/**
- * Toggle start or stop playing
+ * Order items by their end date. If they have no end date, their start date
+ * is used.
+ * @param {Item[]} items
*/
- Slider.prototype.togglePlay = function() {
- if (this.playTimeout === undefined) {
- this.play();
- } else {
- this.stop();
- }
+ exports.orderByEnd = function(items) {
+ items.sort(function (a, b) {
+ var aTime = ('end' in a.data) ? a.data.end : a.data.start,
+ bTime = ('end' in b.data) ? b.data.end : b.data.start;
+
+ return aTime - bTime;
+ });
};
/**
- * Start playing
+ * Adjust vertical positions of the items such that they don't overlap each
+ * other.
+ * @param {Item[]} items
+ * All visible items
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * Margins between items and between items and the axis.
+ * @param {boolean} [force=false]
+ * If true, all items will be repositioned. If false (default), only
+ * items having a top===null will be re-stacked
*/
- Slider.prototype.play = function() {
- // Test whether already playing
- if (this.playTimeout) return;
+ exports.stack = function(items, margin, force) {
+ var i, iMax;
- this.playNext();
+ if (force) {
+ // reset top position of all items
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ items[i].top = null;
+ }
+ }
- if (this.frame) {
- this.frame.play.value = 'Stop';
+ // calculate new, non-overlapping positions
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ var item = items[i];
+ if (item.top === null) {
+ // initialize top position
+ item.top = margin.axis;
+
+ do {
+ // TODO: optimize checking for overlap. when there is a gap without items,
+ // you only need to check for items from the next item on, not from zero
+ var collidingItem = null;
+ for (var j = 0, jj = items.length; j < jj; j++) {
+ var other = items[j];
+ if (other.top !== null && other !== item && exports.collision(item, other, margin.item)) {
+ collidingItem = other;
+ break;
+ }
+ }
+
+ if (collidingItem != null) {
+ // There is a collision. Reposition the items above the colliding element
+ item.top = collidingItem.top + collidingItem.height + margin.item.vertical;
+ }
+ } while (collidingItem);
+ }
}
};
/**
- * Stop playing
+ * Adjust vertical positions of the items without stacking them
+ * @param {Item[]} items
+ * All visible items
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
+ * Margins between items and between items and the axis.
*/
- Slider.prototype.stop = function() {
- clearInterval(this.playTimeout);
- this.playTimeout = undefined;
+ exports.nostack = function(items, margin) {
+ var i, iMax;
- if (this.frame) {
- this.frame.play.value = 'Play';
+ // reset top position of all items
+ for (i = 0, iMax = items.length; i < iMax; i++) {
+ items[i].top = margin.axis;
}
};
/**
- * Set a callback function which will be triggered when the value of the
- * slider bar has changed.
+ * Test if the two provided items collide
+ * The items must have parameters left, width, top, and height.
+ * @param {Item} a The first item
+ * @param {Item} b The second item
+ * @param {{horizontal: number, vertical: number}} margin
+ * An object containing a horizontal and vertical
+ * minimum required margin.
+ * @return {boolean} true if a and b collide, else false
*/
- Slider.prototype.setOnChangeCallback = function(callback) {
- this.onChangeCallback = callback;
+ exports.collision = function(a, b, margin) {
+ return ((a.left - margin.horizontal + EPSILON) < (b.left + b.width) &&
+ (a.left + a.width + margin.horizontal - EPSILON) > b.left &&
+ (a.top - margin.vertical + EPSILON) < (b.top + b.height) &&
+ (a.top + a.height + margin.vertical - EPSILON) > b.top);
};
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var moment = __webpack_require__(39);
+
/**
- * Set the interval for playing the list
- * @param {Number} interval The interval in milliseconds
+ * @constructor TimeStep
+ * The class TimeStep is an iterator for dates. You provide a start date and an
+ * end date. The class itself determines the best scale (step size) based on the
+ * provided start Date, end Date, and minimumStep.
+ *
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ *
+ * Alternatively, you can set a scale by hand.
+ * After creation, you can initialize the class by executing first(). Then you
+ * can iterate from the start date to the end date via next(). You can check if
+ * the end date is reached with the function hasNext(). After each step, you can
+ * retrieve the current date via getCurrent().
+ * The TimeStep has scales ranging from milliseconds, seconds, minutes, hours,
+ * days, to years.
+ *
+ * Version: 1.2
+ *
+ * @param {Date} [start] The start date, for example new Date(2010, 9, 21)
+ * or new Date(2010, 9, 21, 23, 45, 00)
+ * @param {Date} [end] The end date
+ * @param {Number} [minimumStep] Optional. Minimum step size in milliseconds
*/
- Slider.prototype.setPlayInterval = function(interval) {
- this.playInterval = interval;
- };
+ function TimeStep(start, end, minimumStep) {
+ // variables
+ this.current = new Date();
+ this._start = new Date();
+ this._end = new Date();
- /**
- * Retrieve the current play interval
- * @return {Number} interval The interval in milliseconds
- */
- Slider.prototype.getPlayInterval = function(interval) {
- return this.playInterval;
- };
+ this.autoScale = true;
+ this.scale = TimeStep.SCALE.DAY;
+ this.step = 1;
- /**
- * Set looping on or off
- * @pararm {boolean} doLoop If true, the slider will jump to the start when
- * the end is passed, and will jump to the end
- * when the start is passed.
- */
- Slider.prototype.setPlayLoop = function(doLoop) {
- this.playLoop = doLoop;
+ // initialize the range
+ this.setRange(start, end, minimumStep);
+ }
+
+ /// enum scale
+ TimeStep.SCALE = {
+ MILLISECOND: 1,
+ SECOND: 2,
+ MINUTE: 3,
+ HOUR: 4,
+ DAY: 5,
+ WEEKDAY: 6,
+ MONTH: 7,
+ YEAR: 8
};
/**
- * Execute the onchange callback function
+ * Set a new range
+ * If minimumStep is provided, the step size is chosen as close as possible
+ * to the minimumStep but larger than minimumStep. If minimumStep is not
+ * provided, the scale is set to 1 DAY.
+ * The minimumStep should correspond with the onscreen size of about 6 characters
+ * @param {Date} [start] The start date and time.
+ * @param {Date} [end] The end date and time.
+ * @param {int} [minimumStep] Optional. Minimum step size in milliseconds
*/
- Slider.prototype.onChange = function() {
- if (this.onChangeCallback !== undefined) {
- this.onChangeCallback();
+ TimeStep.prototype.setRange = function(start, end, minimumStep) {
+ if (!(start instanceof Date) || !(end instanceof Date)) {
+ throw "No legal start or end date in method setRange";
}
- };
- /**
- * redraw the slider on the correct place
- */
- Slider.prototype.redraw = function() {
- if (this.frame) {
- // resize the bar
- this.frame.bar.style.top = (this.frame.clientHeight/2 -
- this.frame.bar.offsetHeight/2) + 'px';
- this.frame.bar.style.width = (this.frame.clientWidth -
- this.frame.prev.clientWidth -
- this.frame.play.clientWidth -
- this.frame.next.clientWidth - 30) + 'px';
+ this._start = (start != undefined) ? new Date(start.valueOf()) : new Date();
+ this._end = (end != undefined) ? new Date(end.valueOf()) : new Date();
- // position the slider button
- var left = this.indexToLeft(this.index);
- this.frame.slide.style.left = (left) + 'px';
+ if (this.autoScale) {
+ this.setMinimumStep(minimumStep);
}
};
-
/**
- * Set the list with values for the slider
- * @param {Array} values A javascript array with values (any type)
+ * Set the range iterator to the start date.
*/
- Slider.prototype.setValues = function(values) {
- this.values = values;
-
- if (this.values.length > 0)
- this.setIndex(0);
- else
- this.index = undefined;
+ TimeStep.prototype.first = function() {
+ this.current = new Date(this._start.valueOf());
+ this.roundToMinor();
};
/**
- * Select a value by its index
- * @param {Number} index
+ * Round the current date to the first minor date value
+ * This must be executed once when the current date is set to start Date
*/
- Slider.prototype.setIndex = function(index) {
- if (index < this.values.length) {
- this.index = index;
-
- this.redraw();
- this.onChange();
+ TimeStep.prototype.roundToMinor = function() {
+ // round to floor
+ // IMPORTANT: we have no breaks in this switch! (this is no bug)
+ //noinspection FallthroughInSwitchStatementJS
+ 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: // intentional fall through
+ 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);
+ //case TimeStep.SCALE.MILLISECOND: // nothing to do for milliseconds
}
- else {
- throw 'Error: index out of range';
+
+ if (this.step != 1) {
+ // round down to the first minor value that is a multiple of the current step size
+ 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: // intentional fall through
+ 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: break;
+ }
}
};
/**
- * retrieve the index of the currently selected vaue
- * @return {Number} index
+ * Check if the there is a next step
+ * @return {boolean} true if the current date has not passed the end date
*/
- Slider.prototype.getIndex = function() {
- return this.index;
+ TimeStep.prototype.hasNext = function () {
+ return (this.current.valueOf() <= this._end.valueOf());
};
-
/**
- * retrieve the currently selected value
- * @return {*} value
+ * Do the next step
*/
- Slider.prototype.get = function() {
- return this.values[this.index];
- };
-
-
- Slider.prototype._onMouseDown = function(event) {
- // only react on left mouse button down
- var leftButtonDown = event.which ? (event.which === 1) : (event.button === 1);
- if (!leftButtonDown) return;
-
- this.startClientX = event.clientX;
- this.startSlideX = parseFloat(this.frame.slide.style.left);
-
- this.frame.style.cursor = 'move';
-
- // add event listeners to handle moving the contents
- // we store the function onmousemove and onmouseup in the graph, so we can
- // remove the eventlisteners lateron in the function mouseUp()
- var me = this;
- this.onmousemove = function (event) {me._onMouseMove(event);};
- this.onmouseup = function (event) {me._onMouseUp(event);};
- G3DaddEventListener(document, 'mousemove', this.onmousemove);
- G3DaddEventListener(document, 'mouseup', this.onmouseup);
- G3DpreventDefault(event);
- };
-
-
- Slider.prototype.leftToIndex = function (left) {
- var width = parseFloat(this.frame.bar.style.width) -
- this.frame.slide.clientWidth - 10;
- var x = left - 3;
-
- var index = Math.round(x / width * (this.values.length-1));
- if (index < 0) index = 0;
- if (index > this.values.length-1) index = this.values.length-1;
+ TimeStep.prototype.next = function() {
+ var prev = this.current.valueOf();
- return index;
- };
+ // Two cases, needed to prevent issues with switching daylight savings
+ // (end of March and end of October)
+ if (this.current.getMonth() < 6) {
+ switch (this.scale) {
+ case TimeStep.SCALE.MILLISECOND:
- Slider.prototype.indexToLeft = function (index) {
- var width = parseFloat(this.frame.bar.style.width) -
- this.frame.slide.clientWidth - 10;
+ this.current = new Date(this.current.valueOf() + this.step); break;
+ case TimeStep.SCALE.SECOND: this.current = new Date(this.current.valueOf() + this.step * 1000); break;
+ case TimeStep.SCALE.MINUTE: this.current = new Date(this.current.valueOf() + this.step * 1000 * 60); break;
+ case TimeStep.SCALE.HOUR:
+ this.current = new Date(this.current.valueOf() + this.step * 1000 * 60 * 60);
+ // in case of skipping an hour for daylight savings, adjust the hour again (else you get: 0h 5h 9h ... instead of 0h 4h 8h ...)
+ var h = this.current.getHours();
+ this.current.setHours(h - (h % this.step));
+ break;
+ case TimeStep.SCALE.WEEKDAY: // intentional fall through
+ 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: break;
+ }
+ }
+ 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: // intentional fall through
+ 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: break;
+ }
+ }
- var x = index / (this.values.length-1) * width;
- var left = x + 3;
+ if (this.step != 1) {
+ // round down to the correct major value
+ switch (this.scale) {
+ case TimeStep.SCALE.MILLISECOND: if(this.current.getMilliseconds() < this.step) this.current.setMilliseconds(0); break;
+ case TimeStep.SCALE.SECOND: if(this.current.getSeconds() < this.step) this.current.setSeconds(0); break;
+ case TimeStep.SCALE.MINUTE: if(this.current.getMinutes() < this.step) this.current.setMinutes(0); break;
+ case TimeStep.SCALE.HOUR: if(this.current.getHours() < this.step) this.current.setHours(0); break;
+ case TimeStep.SCALE.WEEKDAY: // intentional fall through
+ case TimeStep.SCALE.DAY: if(this.current.getDate() < this.step+1) this.current.setDate(1); break;
+ case TimeStep.SCALE.MONTH: if(this.current.getMonth() < this.step) this.current.setMonth(0); break;
+ case TimeStep.SCALE.YEAR: break; // nothing to do for year
+ default: break;
+ }
+ }
- return left;
+ // safety mechanism: if current time is still unchanged, move to the end
+ if (this.current.valueOf() == prev) {
+ this.current = new Date(this._end.valueOf());
+ }
};
-
- Slider.prototype._onMouseMove = function (event) {
- var diff = event.clientX - this.startClientX;
- var x = this.startSlideX + diff;
-
- var index = this.leftToIndex(x);
-
- this.setIndex(index);
-
- G3DpreventDefault();
+ /**
+ * Get the current datetime
+ * @return {Date} current The current date
+ */
+ TimeStep.prototype.getCurrent = function() {
+ return this.current;
};
+ /**
+ * Set a custom scale. Autoscaling will be disabled.
+ * For example setScale(SCALE.MINUTES, 5) will result
+ * in minor steps of 5 minutes, and major steps of an hour.
+ *
+ * @param {TimeStep.SCALE} newScale
+ * A scale. Choose from SCALE.MILLISECOND,
+ * SCALE.SECOND, SCALE.MINUTE, SCALE.HOUR,
+ * SCALE.WEEKDAY, SCALE.DAY, SCALE.MONTH,
+ * SCALE.YEAR.
+ * @param {Number} newStep A step size, by default 1. Choose for
+ * example 1, 2, 5, or 10.
+ */
+ TimeStep.prototype.setScale = function(newScale, newStep) {
+ this.scale = newScale;
- Slider.prototype._onMouseUp = function (event) {
- this.frame.style.cursor = 'auto';
-
- // remove event listeners
- G3DremoveEventListener(document, 'mousemove', this.onmousemove);
- G3DremoveEventListener(document, 'mouseup', this.onmouseup);
+ if (newStep > 0) {
+ this.step = newStep;
+ }
- G3DpreventDefault();
+ this.autoScale = false;
};
+ /**
+ * Enable or disable autoscaling
+ * @param {boolean} enable If true, autoascaling is set true
+ */
+ TimeStep.prototype.setAutoScale = function (enable) {
+ this.autoScale = enable;
+ };
- /**--------------------------------------------------------------------------**/
+ /**
+ * Automatically determine the scale that bests fits the provided minimum step
+ * @param {Number} [minimumStep] The minimum step size in milliseconds
+ */
+ TimeStep.prototype.setMinimumStep = function(minimumStep) {
+ if (minimumStep == undefined) {
+ return;
+ }
+ var stepYear = (1000 * 60 * 60 * 24 * 30 * 12);
+ var stepMonth = (1000 * 60 * 60 * 24 * 30);
+ var stepDay = (1000 * 60 * 60 * 24);
+ var stepHour = (1000 * 60 * 60);
+ var stepMinute = (1000 * 60);
+ var stepSecond = (1000);
+ var stepMillisecond= (1);
+ // find the smallest step that is larger than the provided minimumStep
+ if (stepYear*1000 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 1000;}
+ if (stepYear*500 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 500;}
+ if (stepYear*100 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 100;}
+ if (stepYear*50 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 50;}
+ if (stepYear*10 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 10;}
+ if (stepYear*5 > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 5;}
+ if (stepYear > minimumStep) {this.scale = TimeStep.SCALE.YEAR; this.step = 1;}
+ if (stepMonth*3 > minimumStep) {this.scale = TimeStep.SCALE.MONTH; this.step = 3;}
+ if (stepMonth > minimumStep) {this.scale = TimeStep.SCALE.MONTH; this.step = 1;}
+ if (stepDay*5 > minimumStep) {this.scale = TimeStep.SCALE.DAY; this.step = 5;}
+ if (stepDay*2 > minimumStep) {this.scale = TimeStep.SCALE.DAY; this.step = 2;}
+ if (stepDay > minimumStep) {this.scale = TimeStep.SCALE.DAY; this.step = 1;}
+ if (stepDay/2 > minimumStep) {this.scale = TimeStep.SCALE.WEEKDAY; this.step = 1;}
+ if (stepHour*4 > minimumStep) {this.scale = TimeStep.SCALE.HOUR; this.step = 4;}
+ if (stepHour > minimumStep) {this.scale = TimeStep.SCALE.HOUR; this.step = 1;}
+ if (stepMinute*15 > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 15;}
+ if (stepMinute*10 > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 10;}
+ if (stepMinute*5 > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 5;}
+ if (stepMinute > minimumStep) {this.scale = TimeStep.SCALE.MINUTE; this.step = 1;}
+ if (stepSecond*15 > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 15;}
+ if (stepSecond*10 > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 10;}
+ if (stepSecond*5 > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 5;}
+ if (stepSecond > minimumStep) {this.scale = TimeStep.SCALE.SECOND; this.step = 1;}
+ if (stepMillisecond*200 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 200;}
+ if (stepMillisecond*100 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 100;}
+ if (stepMillisecond*50 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 50;}
+ if (stepMillisecond*10 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 10;}
+ if (stepMillisecond*5 > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 5;}
+ if (stepMillisecond > minimumStep) {this.scale = TimeStep.SCALE.MILLISECOND; this.step = 1;}
+ };
/**
- * Retrieve the absolute left value of a DOM element
- * @param {Element} elem A dom element, for example a div
- * @return {Number} left The absolute left position of this element
- * in the browser page.
+ * Snap a date to a rounded value.
+ * The snap intervals are dependent on the current scale and step.
+ * @param {Date} date the date to be snapped.
+ * @return {Date} snappedDate
*/
- getAbsoluteLeft = function(elem) {
- var left = 0;
- while( elem !== null ) {
- left += elem.offsetLeft;
- left -= elem.scrollLeft;
- elem = elem.offsetParent;
+ TimeStep.prototype.snap = function(date) {
+ var clone = new Date(date.valueOf());
+
+ if (this.scale == TimeStep.SCALE.YEAR) {
+ var year = clone.getFullYear() + Math.round(clone.getMonth() / 12);
+ clone.setFullYear(Math.round(year / this.step) * this.step);
+ clone.setMonth(0);
+ clone.setDate(0);
+ clone.setHours(0);
+ clone.setMinutes(0);
+ clone.setSeconds(0);
+ clone.setMilliseconds(0);
}
- return left;
+ else if (this.scale == TimeStep.SCALE.MONTH) {
+ if (clone.getDate() > 15) {
+ clone.setDate(1);
+ clone.setMonth(clone.getMonth() + 1);
+ // important: first set Date to 1, after that change the month.
+ }
+ else {
+ clone.setDate(1);
+ }
+
+ clone.setHours(0);
+ clone.setMinutes(0);
+ clone.setSeconds(0);
+ clone.setMilliseconds(0);
+ }
+ else if (this.scale == TimeStep.SCALE.DAY) {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (this.step) {
+ case 5:
+ case 2:
+ clone.setHours(Math.round(clone.getHours() / 24) * 24); break;
+ default:
+ clone.setHours(Math.round(clone.getHours() / 12) * 12); break;
+ }
+ clone.setMinutes(0);
+ clone.setSeconds(0);
+ clone.setMilliseconds(0);
+ }
+ else if (this.scale == TimeStep.SCALE.WEEKDAY) {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (this.step) {
+ case 5:
+ case 2:
+ clone.setHours(Math.round(clone.getHours() / 12) * 12); break;
+ default:
+ clone.setHours(Math.round(clone.getHours() / 6) * 6); break;
+ }
+ clone.setMinutes(0);
+ clone.setSeconds(0);
+ clone.setMilliseconds(0);
+ }
+ else if (this.scale == TimeStep.SCALE.HOUR) {
+ switch (this.step) {
+ case 4:
+ clone.setMinutes(Math.round(clone.getMinutes() / 60) * 60); break;
+ default:
+ clone.setMinutes(Math.round(clone.getMinutes() / 30) * 30); break;
+ }
+ clone.setSeconds(0);
+ clone.setMilliseconds(0);
+ } else if (this.scale == TimeStep.SCALE.MINUTE) {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (this.step) {
+ case 15:
+ case 10:
+ clone.setMinutes(Math.round(clone.getMinutes() / 5) * 5);
+ clone.setSeconds(0);
+ break;
+ case 5:
+ clone.setSeconds(Math.round(clone.getSeconds() / 60) * 60); break;
+ default:
+ clone.setSeconds(Math.round(clone.getSeconds() / 30) * 30); break;
+ }
+ clone.setMilliseconds(0);
+ }
+ else if (this.scale == TimeStep.SCALE.SECOND) {
+ //noinspection FallthroughInSwitchStatementJS
+ switch (this.step) {
+ case 15:
+ case 10:
+ clone.setSeconds(Math.round(clone.getSeconds() / 5) * 5);
+ clone.setMilliseconds(0);
+ break;
+ case 5:
+ clone.setMilliseconds(Math.round(clone.getMilliseconds() / 1000) * 1000); break;
+ default:
+ clone.setMilliseconds(Math.round(clone.getMilliseconds() / 500) * 500); break;
+ }
+ }
+ else if (this.scale == TimeStep.SCALE.MILLISECOND) {
+ var step = this.step > 5 ? this.step / 2 : 1;
+ clone.setMilliseconds(Math.round(clone.getMilliseconds() / step) * step);
+ }
+
+ return clone;
};
/**
- * Retrieve the absolute top value of a DOM element
- * @param {Element} elem A dom element, for example a div
- * @return {Number} top The absolute top position of this element
- * in the browser page.
+ * Check if the current value is a major value (for example when the step
+ * is DAY, a major value is each first day of the MONTH)
+ * @return {boolean} true if current date is major, else false.
*/
- getAbsoluteTop = function(elem) {
- var top = 0;
- while( elem !== null ) {
- top += elem.offsetTop;
- top -= elem.scrollTop;
- elem = elem.offsetParent;
+ TimeStep.prototype.isMajor = function() {
+ switch (this.scale) {
+ case TimeStep.SCALE.MILLISECOND:
+ return (this.current.getMilliseconds() == 0);
+ case TimeStep.SCALE.SECOND:
+ return (this.current.getSeconds() == 0);
+ case TimeStep.SCALE.MINUTE:
+ return (this.current.getHours() == 0) && (this.current.getMinutes() == 0);
+ // Note: this is no bug. Major label is equal for both minute and hour scale
+ case TimeStep.SCALE.HOUR:
+ return (this.current.getHours() == 0);
+ case TimeStep.SCALE.WEEKDAY: // intentional fall through
+ case TimeStep.SCALE.DAY:
+ return (this.current.getDate() == 1);
+ case TimeStep.SCALE.MONTH:
+ return (this.current.getMonth() == 0);
+ case TimeStep.SCALE.YEAR:
+ return false;
+ default:
+ return false;
}
- return top;
};
+
/**
- * Get the horizontal mouse position from a mouse event
- * @param {Event} event
- * @return {Number} mouse x
+ * Returns formatted text for the minor axislabel, depending on the current
+ * date and the scale. For example when scale is MINUTE, the current time is
+ * formatted as "hh:mm".
+ * @param {Date} [date] custom date. if not provided, current date is taken
*/
- getMouseX = function(event) {
- if ('clientX' in event) return event.clientX;
- return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
+ TimeStep.prototype.getLabelMinor = function(date) {
+ if (date == undefined) {
+ date = this.current;
+ }
+
+ switch (this.scale) {
+ case TimeStep.SCALE.MILLISECOND: return moment(date).format('SSS');
+ case TimeStep.SCALE.SECOND: return moment(date).format('s');
+ case TimeStep.SCALE.MINUTE: return moment(date).format('HH:mm');
+ case TimeStep.SCALE.HOUR: return moment(date).format('HH:mm');
+ case TimeStep.SCALE.WEEKDAY: return moment(date).format('ddd D');
+ case TimeStep.SCALE.DAY: return moment(date).format('D');
+ case TimeStep.SCALE.MONTH: return moment(date).format('MMM');
+ case TimeStep.SCALE.YEAR: return moment(date).format('YYYY');
+ default: return '';
+ }
};
+
/**
- * Get the vertical mouse position from a mouse event
- * @param {Event} event
- * @return {Number} mouse y
+ * Returns formatted text for the major axis label, depending on the current
+ * date and the scale. For example when scale is MINUTE, the major scale is
+ * hours, and the hour will be formatted as "hh".
+ * @param {Date} [date] custom date. if not provided, current date is taken
*/
- getMouseY = function(event) {
- if ('clientY' in event) return event.clientY;
- return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
+ TimeStep.prototype.getLabelMajor = function(date) {
+ if (date == undefined) {
+ date = this.current;
+ }
+
+ //noinspection FallthroughInSwitchStatementJS
+ switch (this.scale) {
+ case TimeStep.SCALE.MILLISECOND:return moment(date).format('HH:mm:ss');
+ case TimeStep.SCALE.SECOND: return moment(date).format('D MMMM HH:mm');
+ case TimeStep.SCALE.MINUTE:
+ case TimeStep.SCALE.HOUR: return moment(date).format('ddd D MMMM');
+ case TimeStep.SCALE.WEEKDAY:
+ case TimeStep.SCALE.DAY: return moment(date).format('MMMM YYYY');
+ case TimeStep.SCALE.MONTH: return moment(date).format('YYYY');
+ case TimeStep.SCALE.YEAR: return '';
+ default: return '';
+ }
};
- module.exports = Graph3d;
+ module.exports = TimeStep;
/***/ },
@@ -9040,7 +9038,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 14 */
/***/ function(module, exports, __webpack_require__) {
- var Hammer = __webpack_require__(50);
+ var Hammer = __webpack_require__(49);
var util = __webpack_require__(1);
var Component = __webpack_require__(12);
@@ -9237,7 +9235,7 @@ return /******/ (function(modules) { // webpackBootstrap
var util = __webpack_require__(1);
var DOMutil = __webpack_require__(2);
var Component = __webpack_require__(12);
- var DataStep = __webpack_require__(6);
+ var DataStep = __webpack_require__(8);
/**
* A horizontal time axis
@@ -9843,7 +9841,7 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {
var util = __webpack_require__(1);
- var stack = __webpack_require__(9);
+ var stack = __webpack_require__(10);
var ItemRange = __webpack_require__(25);
/**
@@ -9967,7 +9965,7 @@ return /******/ (function(modules) { // webpackBootstrap
/**
* Repaint this group
* @param {{start: number, end: number}} range
- * @param {{item: number, axis: number}} margin
+ * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin
* @param {boolean} [restack=false] Force restacking of all items
* @return {boolean} Returns true if the group is resized
*/
@@ -10016,10 +10014,10 @@ return /******/ (function(modules) { // webpackBootstrap
item.top -= offset;
});
}
- height = max + margin.item / 2;
+ height = max + margin.item.vertical / 2;
}
else {
- height = margin.axis + margin.item;
+ height = margin.axis + margin.item.vertical;
}
height = Math.max(height, this.props.label.height);
@@ -10272,7 +10270,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 18 */
/***/ function(module, exports, __webpack_require__) {
- var Hammer = __webpack_require__(50);
+ var Hammer = __webpack_require__(49);
var util = __webpack_require__(1);
var DataSet = __webpack_require__(3);
var DataView = __webpack_require__(4);
@@ -10326,7 +10324,10 @@ return /******/ (function(modules) { // webpackBootstrap
},
margin: {
- item: 10,
+ item: {
+ horizontal: 10,
+ vertical: 10
+ },
axis: 20
},
padding: 5
@@ -10485,8 +10486,15 @@ return /******/ (function(modules) { // webpackBootstrap
* {Number} margin.axis
* Margin between the axis and the items in pixels.
* Default is 20.
+ * {Number} margin.item.horizontal
+ * Horizontal margin between items in pixels.
+ * Default is 10.
+ * {Number} margin.item.vertical
+ * Vertical Margin between items in pixels.
+ * Default is 10.
* {Number} margin.item
- * Margin between items in pixels. Default is 10.
+ * Margin between items in pixels in both horizontal
+ * and vertical direction. Default is 10.
* {Number} margin
* Set margin for both axis and items in pixels.
* {Number} padding
@@ -10528,10 +10536,20 @@ return /******/ (function(modules) { // webpackBootstrap
if ('margin' in options) {
if (typeof options.margin === 'number') {
this.options.margin.axis = options.margin;
- this.options.margin.item = options.margin;
- }
- else if (typeof options.margin === 'object'){
- util.selectiveExtend(['axis', 'item'], this.options.margin, options.margin);
+ this.options.margin.item.horizontal = options.margin;
+ this.options.margin.item.vertical = options.margin;
+ }
+ else if (typeof options.margin === 'object') {
+ util.selectiveExtend(['axis'], this.options.margin, options.margin);
+ if ('item' in options.margin) {
+ if (typeof options.margin.item === 'number') {
+ this.options.margin.item.horizontal = options.margin.item;
+ this.options.margin.item.vertical = options.margin.item;
+ }
+ else if (typeof options.margin.item === 'object') {
+ util.selectiveExtend(['horizontal', 'vertical'], this.options.margin.item, options.margin.item);
+ }
+ }
}
}
@@ -10722,10 +10740,10 @@ return /******/ (function(modules) { // webpackBootstrap
},
nonFirstMargin = {
item: margin.item,
- axis: margin.item / 2
+ axis: margin.item.vertical / 2
},
height = 0,
- minHeight = margin.axis + margin.item;
+ minHeight = margin.axis + margin.item.vertical;
util.forEach(this.groups, function (group) {
var groupMargin = (group == firstGroup) ? firstMargin : nonFirstMargin;
var groupResized = group.redraw(range, groupMargin, restack);
@@ -12878,7 +12896,7 @@ return /******/ (function(modules) { // webpackBootstrap
var util = __webpack_require__(1);
var Component = __webpack_require__(12);
- var TimeStep = __webpack_require__(10);
+ var TimeStep = __webpack_require__(11);
/**
* A horizontal time axis
@@ -13277,7 +13295,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 22 */
/***/ function(module, exports, __webpack_require__) {
- var Hammer = __webpack_require__(50);
+ var Hammer = __webpack_require__(49);
/**
* @constructor Item
@@ -13878,7 +13896,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 25 */
/***/ function(module, exports, __webpack_require__) {
- var Hammer = __webpack_require__(50);
+ var Hammer = __webpack_require__(49);
var Item = __webpack_require__(22);
/**
@@ -14176,8 +14194,8 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ function(module, exports, __webpack_require__) {
var Emitter = __webpack_require__(41);
- var Hammer = __webpack_require__(50);
- var mousetrap = __webpack_require__(48);
+ var Hammer = __webpack_require__(49);
+ var mousetrap = __webpack_require__(42);
var util = __webpack_require__(1);
var DataSet = __webpack_require__(3);
var DataView = __webpack_require__(4);
@@ -16047,1465 +16065,803 @@ return /******/ (function(modules) { // webpackBootstrap
* @private
*/
Network.prototype._YconvertDOMtoCanvas = function(y) {
- return (y - this.translation.y) / this.scale;
- };
-
- /**
- * Convert the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to
- * the Y coordinate in DOM-space (coordinate point in browser relative to the container div)
- * @param {number} y
- * @returns {number}
- * @private
- */
- Network.prototype._YconvertCanvasToDOM = function(y) {
- return y * this.scale + this.translation.y ;
- };
-
-
- /**
- *
- * @param {object} pos = {x: number, y: number}
- * @returns {{x: number, y: number}}
- * @constructor
- */
- Network.prototype.canvasToDOM = function(pos) {
- return {x:this._XconvertCanvasToDOM(pos.x),y:this._YconvertCanvasToDOM(pos.y)};
- }
-
- /**
- *
- * @param {object} pos = {x: number, y: number}
- * @returns {{x: number, y: number}}
- * @constructor
- */
- Network.prototype.DOMtoCanvas = function(pos) {
- return {x:this._XconvertDOMtoCanvas(pos.x),y:this._YconvertDOMtoCanvas(pos.y)};
- }
-
- /**
- * Redraw all nodes
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
- * @param {CanvasRenderingContext2D} ctx
- * @param {Boolean} [alwaysShow]
- * @private
- */
- Network.prototype._drawNodes = function(ctx,alwaysShow) {
- if (alwaysShow === undefined) {
- alwaysShow = false;
- }
-
- // first draw the unselected nodes
- var nodes = this.nodes;
- var selected = [];
-
- for (var id in nodes) {
- if (nodes.hasOwnProperty(id)) {
- nodes[id].setScaleAndPos(this.scale,this.canvasTopLeft,this.canvasBottomRight);
- if (nodes[id].isSelected()) {
- selected.push(id);
- }
- else {
- if (nodes[id].inArea() || alwaysShow) {
- nodes[id].draw(ctx);
- }
- }
- }
- }
-
- // draw the selected nodes on top
- for (var s = 0, sMax = selected.length; s < sMax; s++) {
- if (nodes[selected[s]].inArea() || alwaysShow) {
- nodes[selected[s]].draw(ctx);
- }
- }
- };
-
- /**
- * Redraw all edges
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
- * @param {CanvasRenderingContext2D} ctx
- * @private
- */
- Network.prototype._drawEdges = function(ctx) {
- var edges = this.edges;
- for (var id in edges) {
- if (edges.hasOwnProperty(id)) {
- var edge = edges[id];
- edge.setScale(this.scale);
- if (edge.connected) {
- edges[id].draw(ctx);
- }
- }
- }
- };
-
- /**
- * Redraw all edges
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
- * @param {CanvasRenderingContext2D} ctx
- * @private
- */
- Network.prototype._drawControlNodes = function(ctx) {
- var edges = this.edges;
- for (var id in edges) {
- if (edges.hasOwnProperty(id)) {
- edges[id]._drawControlNodes(ctx);
- }
- }
- };
-
- /**
- * Find a stable position for all nodes
- * @private
- */
- Network.prototype._stabilize = function() {
- if (this.constants.freezeForStabilization == true) {
- this._freezeDefinedNodes();
- }
-
- // find stable position
- var count = 0;
- while (this.moving && count < this.constants.stabilizationIterations) {
- this._physicsTick();
- count++;
- }
- this.zoomExtent(false,true);
- if (this.constants.freezeForStabilization == true) {
- this._restoreFrozenNodes();
- }
- this.emit("stabilized",{iterations:count});
- };
-
- /**
- * When initializing and stabilizing, we can freeze nodes with a predefined position. This greatly speeds up stabilization
- * because only the supportnodes for the smoothCurves have to settle.
- *
- * @private
- */
- Network.prototype._freezeDefinedNodes = function() {
- var nodes = this.nodes;
- for (var id in nodes) {
- if (nodes.hasOwnProperty(id)) {
- if (nodes[id].x != null && nodes[id].y != null) {
- nodes[id].fixedData.x = nodes[id].xFixed;
- nodes[id].fixedData.y = nodes[id].yFixed;
- nodes[id].xFixed = true;
- nodes[id].yFixed = true;
- }
- }
- }
- };
-
- /**
- * Unfreezes the nodes that have been frozen by _freezeDefinedNodes.
- *
- * @private
- */
- Network.prototype._restoreFrozenNodes = function() {
- var nodes = this.nodes;
- for (var id in nodes) {
- if (nodes.hasOwnProperty(id)) {
- if (nodes[id].fixedData.x != null) {
- nodes[id].xFixed = nodes[id].fixedData.x;
- nodes[id].yFixed = nodes[id].fixedData.y;
- }
- }
- }
- };
-
-
- /**
- * Check if any of the nodes is still moving
- * @param {number} vmin the minimum velocity considered as 'moving'
- * @return {boolean} true if moving, false if non of the nodes is moving
- * @private
- */
- Network.prototype._isMoving = function(vmin) {
- var nodes = this.nodes;
- for (var id in nodes) {
- if (nodes.hasOwnProperty(id) && nodes[id].isMoving(vmin)) {
- return true;
- }
- }
- return false;
- };
-
-
- /**
- * /**
- * Perform one discrete step for all nodes
- *
- * @private
- */
- Network.prototype._discreteStepNodes = function() {
- var interval = this.physicsDiscreteStepsize;
- var nodes = this.nodes;
- var nodeId;
- var nodesPresent = false;
-
- if (this.constants.maxVelocity > 0) {
- for (nodeId in nodes) {
- if (nodes.hasOwnProperty(nodeId)) {
- nodes[nodeId].discreteStepLimited(interval, this.constants.maxVelocity);
- nodesPresent = true;
- }
- }
- }
- else {
- for (nodeId in nodes) {
- if (nodes.hasOwnProperty(nodeId)) {
- nodes[nodeId].discreteStep(interval);
- nodesPresent = true;
- }
- }
- }
-
- if (nodesPresent == true) {
- var vminCorrected = this.constants.minVelocity / Math.max(this.scale,0.05);
- if (vminCorrected > 0.5*this.constants.maxVelocity) {
- this.moving = true;
- }
- else {
- this.moving = this._isMoving(vminCorrected) || this.constants.configurePhysics;
- }
- }
+ return (y - this.translation.y) / this.scale;
};
/**
- * A single simulation step (or "tick") in the physics simulation
- *
+ * Convert the Y coordinate in canvas-space (the simulation sandbox, which the camera looks upon) to
+ * the Y coordinate in DOM-space (coordinate point in browser relative to the container div)
+ * @param {number} y
+ * @returns {number}
* @private
*/
- Network.prototype._physicsTick = function() {
- if (!this.freezeSimulation) {
- if (this.moving) {
- this._doInAllActiveSectors("_initializeForceCalculation");
- this._doInAllActiveSectors("_discreteStepNodes");
- if (this.constants.smoothCurves) {
- this._doInSupportSector("_discreteStepNodes");
- }
- this._findCenter(this._getRange())
- }
- }
+ Network.prototype._YconvertCanvasToDOM = function(y) {
+ return y * this.scale + this.translation.y ;
};
/**
- * This function runs one step of the animation. It calls an x amount of physics ticks and one render tick.
- * It reschedules itself at the beginning of the function
*
- * @private
+ * @param {object} pos = {x: number, y: number}
+ * @returns {{x: number, y: number}}
+ * @constructor
*/
- Network.prototype._animationStep = function() {
- // reset the timer so a new scheduled animation step can be set
- this.timer = undefined;
- // handle the keyboad movement
- this._handleNavigation();
-
- // this schedules a new animation step
- this.start();
-
- // start the physics simulation
- var calculationTime = Date.now();
- var maxSteps = 1;
- this._physicsTick();
- var timeRequired = Date.now() - calculationTime;
- while (timeRequired < 0.9*(this.renderTimestep - this.renderTime) && maxSteps < this.maxPhysicsTicksPerRender) {
- this._physicsTick();
- timeRequired = Date.now() - calculationTime;
- maxSteps++;
- }
-
- // start the rendering process
- var renderTime = Date.now();
- this._redraw();
- this.renderTime = Date.now() - renderTime;
-
- };
+ Network.prototype.canvasToDOM = function(pos) {
+ return {x:this._XconvertCanvasToDOM(pos.x),y:this._YconvertCanvasToDOM(pos.y)};
+ }
- if (typeof window !== 'undefined') {
- window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
- window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+ /**
+ *
+ * @param {object} pos = {x: number, y: number}
+ * @returns {{x: number, y: number}}
+ * @constructor
+ */
+ Network.prototype.DOMtoCanvas = function(pos) {
+ return {x:this._XconvertDOMtoCanvas(pos.x),y:this._YconvertDOMtoCanvas(pos.y)};
}
/**
- * Schedule a animation step with the refreshrate interval.
+ * Redraw all nodes
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Boolean} [alwaysShow]
+ * @private
*/
- Network.prototype.start = function() {
- if (this.moving || this.xIncrement != 0 || this.yIncrement != 0 || this.zoomIncrement != 0) {
- if (!this.timer) {
- var ua = navigator.userAgent.toLowerCase();
+ Network.prototype._drawNodes = function(ctx,alwaysShow) {
+ if (alwaysShow === undefined) {
+ alwaysShow = false;
+ }
- var requiresTimeout = false;
- if (ua.indexOf('msie 9.0') != -1) { // IE 9
- requiresTimeout = true;
- }
- else if (ua.indexOf('safari') != -1) { // safari
- if (ua.indexOf('chrome') <= -1) {
- requiresTimeout = true;
- }
- }
+ // first draw the unselected nodes
+ var nodes = this.nodes;
+ var selected = [];
- if (requiresTimeout == true) {
- this.timer = window.setTimeout(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ nodes[id].setScaleAndPos(this.scale,this.canvasTopLeft,this.canvasBottomRight);
+ if (nodes[id].isSelected()) {
+ selected.push(id);
}
- else{
- this.timer = window.requestAnimationFrame(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
+ else {
+ if (nodes[id].inArea() || alwaysShow) {
+ nodes[id].draw(ctx);
+ }
}
}
}
- else {
- this._redraw();
+
+ // draw the selected nodes on top
+ for (var s = 0, sMax = selected.length; s < sMax; s++) {
+ if (nodes[selected[s]].inArea() || alwaysShow) {
+ nodes[selected[s]].draw(ctx);
+ }
}
};
-
/**
- * Move the network according to the keyboard presses.
- *
+ * Redraw all edges
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
* @private
*/
- Network.prototype._handleNavigation = function() {
- if (this.xIncrement != 0 || this.yIncrement != 0) {
- var translation = this._getTranslation();
- this._setTranslation(translation.x+this.xIncrement, translation.y+this.yIncrement);
- }
- if (this.zoomIncrement != 0) {
- var center = {
- x: this.frame.canvas.clientWidth / 2,
- y: this.frame.canvas.clientHeight / 2
- };
- this._zoom(this.scale*(1 + this.zoomIncrement), center);
+ Network.prototype._drawEdges = function(ctx) {
+ var edges = this.edges;
+ for (var id in edges) {
+ if (edges.hasOwnProperty(id)) {
+ var edge = edges[id];
+ edge.setScale(this.scale);
+ if (edge.connected) {
+ edges[id].draw(ctx);
+ }
+ }
}
};
-
/**
- * Freeze the _animationStep
+ * Redraw all edges
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext('2d');
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
*/
- Network.prototype.toggleFreeze = function() {
- if (this.freezeSimulation == false) {
- this.freezeSimulation = true;
- }
- else {
- this.freezeSimulation = false;
- this.start();
+ Network.prototype._drawControlNodes = function(ctx) {
+ var edges = this.edges;
+ for (var id in edges) {
+ if (edges.hasOwnProperty(id)) {
+ edges[id]._drawControlNodes(ctx);
+ }
}
};
-
/**
- * This function cleans the support nodes if they are not needed and adds them when they are.
- *
- * @param {boolean} [disableStart]
+ * Find a stable position for all nodes
* @private
*/
- Network.prototype._configureSmoothCurves = function(disableStart) {
- if (disableStart === undefined) {
- disableStart = true;
- }
- if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
- this._createBezierNodes();
+ Network.prototype._stabilize = function() {
+ if (this.constants.freezeForStabilization == true) {
+ this._freezeDefinedNodes();
}
- else {
- // delete the support nodes
- this.sectors['support']['nodes'] = {};
- for (var edgeId in this.edges) {
- if (this.edges.hasOwnProperty(edgeId)) {
- this.edges[edgeId].smooth = false;
- this.edges[edgeId].via = null;
- }
- }
+
+ // find stable position
+ var count = 0;
+ while (this.moving && count < this.constants.stabilizationIterations) {
+ this._physicsTick();
+ count++;
}
- this._updateCalculationNodes();
- if (!disableStart) {
- this.moving = true;
- this.start();
+ this.zoomExtent(false,true);
+ if (this.constants.freezeForStabilization == true) {
+ this._restoreFrozenNodes();
}
+ this.emit("stabilized",{iterations:count});
};
-
/**
- * Bezier curves require an anchor point to calculate the smooth flow. These points are nodes. These nodes are invisible but
- * are used for the force calculation.
+ * When initializing and stabilizing, we can freeze nodes with a predefined position. This greatly speeds up stabilization
+ * because only the supportnodes for the smoothCurves have to settle.
*
* @private
*/
- Network.prototype._createBezierNodes = function() {
- if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
- for (var edgeId in this.edges) {
- if (this.edges.hasOwnProperty(edgeId)) {
- var edge = this.edges[edgeId];
- if (edge.via == null) {
- edge.smooth = true;
- var nodeId = "edgeId:".concat(edge.id);
- this.sectors['support']['nodes'][nodeId] = new Node(
- {id:nodeId,
- mass:1,
- shape:'circle',
- image:"",
- internalMultiplier:1
- },{},{},this.constants);
- edge.via = this.sectors['support']['nodes'][nodeId];
- edge.via.parentEdgeId = edge.id;
- edge.positionBezierNode();
- }
+ Network.prototype._freezeDefinedNodes = function() {
+ var nodes = this.nodes;
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ if (nodes[id].x != null && nodes[id].y != null) {
+ nodes[id].fixedData.x = nodes[id].xFixed;
+ nodes[id].fixedData.y = nodes[id].yFixed;
+ nodes[id].xFixed = true;
+ nodes[id].yFixed = true;
}
}
}
};
/**
- * load the functions that load the mixins into the prototype.
+ * Unfreezes the nodes that have been frozen by _freezeDefinedNodes.
*
* @private
*/
- Network.prototype._initializeMixinLoaders = function () {
- for (var mixin in MixinLoader) {
- if (MixinLoader.hasOwnProperty(mixin)) {
- Network.prototype[mixin] = MixinLoader[mixin];
- }
- }
- };
-
- /**
- * Load the XY positions of the nodes into the dataset.
- */
- Network.prototype.storePosition = function() {
- var dataArray = [];
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- var node = this.nodes[nodeId];
- var allowedToMoveX = !this.nodes.xFixed;
- var allowedToMoveY = !this.nodes.yFixed;
- if (this.nodesData._data[nodeId].x != Math.round(node.x) || this.nodesData._data[nodeId].y != Math.round(node.y)) {
- dataArray.push({id:nodeId,x:Math.round(node.x),y:Math.round(node.y),allowedToMoveX:allowedToMoveX,allowedToMoveY:allowedToMoveY});
+ Network.prototype._restoreFrozenNodes = function() {
+ var nodes = this.nodes;
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id)) {
+ if (nodes[id].fixedData.x != null) {
+ nodes[id].xFixed = nodes[id].fixedData.x;
+ nodes[id].yFixed = nodes[id].fixedData.y;
}
}
}
- this.nodesData.update(dataArray);
};
/**
- * Center a node in view.
- *
- * @param {Number} nodeId
- * @param {Number} [zoomLevel]
+ * Check if any of the nodes is still moving
+ * @param {number} vmin the minimum velocity considered as 'moving'
+ * @return {boolean} true if moving, false if non of the nodes is moving
+ * @private
*/
- Network.prototype.focusOnNode = function (nodeId, zoomLevel) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- if (zoomLevel === undefined) {
- zoomLevel = this._getScale();
+ Network.prototype._isMoving = function(vmin) {
+ var nodes = this.nodes;
+ for (var id in nodes) {
+ if (nodes.hasOwnProperty(id) && nodes[id].isMoving(vmin)) {
+ return true;
}
- var nodePosition= {x: this.nodes[nodeId].x, y: this.nodes[nodeId].y};
-
- var requiredScale = zoomLevel;
- this._setScale(requiredScale);
-
- var canvasCenter = this.DOMtoCanvas({x:0.5 * this.frame.canvas.width,y:0.5 * this.frame.canvas.height});
- var translation = this._getTranslation();
-
- var distanceFromCenter = {x:canvasCenter.x - nodePosition.x,
- y:canvasCenter.y - nodePosition.y};
-
- this._setTranslation(translation.x + requiredScale * distanceFromCenter.x,
- translation.y + requiredScale * distanceFromCenter.y);
- this.redraw();
- }
- else {
- console.log("This nodeId cannot be found.")
}
+ return false;
};
- module.exports = Network;
-
-
-/***/ },
-/* 27 */
-/***/ function(module, exports, __webpack_require__) {
-
- var util = __webpack_require__(1);
- var Node = __webpack_require__(30);
/**
- * @class Edge
+ * /**
+ * Perform one discrete step for all nodes
*
- * A edge connects two nodes
- * @param {Object} properties Object with properties. Must contain
- * At least properties from and to.
- * Available properties: from (number),
- * to (number), label (string, color (string),
- * width (number), style (string),
- * length (number), title (string)
- * @param {Network} network A Network object, used to find and edge to
- * nodes.
- * @param {Object} constants An object with default values for
- * example for the color
- */
- function Edge (properties, network, constants) {
- if (!network) {
- throw "No network provided";
- }
- this.network = network;
-
- // initialize constants
- this.widthMin = constants.edges.widthMin;
- this.widthMax = constants.edges.widthMax;
-
- // initialize variables
- this.id = undefined;
- this.fromId = undefined;
- this.toId = undefined;
- this.style = constants.edges.style;
- this.title = undefined;
- this.width = constants.edges.width;
- this.widthSelectionMultiplier = constants.edges.widthSelectionMultiplier;
- this.widthSelected = this.width * this.widthSelectionMultiplier;
- this.hoverWidth = constants.edges.hoverWidth;
- this.value = undefined;
- this.length = constants.physics.springLength;
- this.customLength = false;
- this.selected = false;
- this.hover = false;
- this.smoothCurves = constants.smoothCurves;
- this.dynamicSmoothCurves = constants.dynamicSmoothCurves;
- this.arrowScaleFactor = constants.edges.arrowScaleFactor;
- this.inheritColor = constants.edges.inheritColor;
-
- this.from = null; // a node
- this.to = null; // a node
- this.via = null; // a temp node
-
- // we use this to be able to reconnect the edge to a cluster if its node is put into a cluster
- // by storing the original information we can revert to the original connection when the cluser is opened.
- this.originalFromId = [];
- this.originalToId = [];
-
- this.connected = false;
-
- // Added to support dashed lines
- // David Jordan
- // 2012-08-08
- this.dash = util.extend({}, constants.edges.dash); // contains properties length, gap, altLength
-
- this.color = {color:constants.edges.color.color,
- highlight:constants.edges.color.highlight,
- hover:constants.edges.color.hover};
- this.widthFixed = false;
- this.lengthFixed = false;
-
- this.setProperties(properties, constants);
-
- this.controlNodesEnabled = false;
- this.controlNodes = {from:null, to:null, positions:{}};
- this.connectedNode = null;
- }
-
- /**
- * Set or overwrite properties for the edge
- * @param {Object} properties an object with properties
- * @param {Object} constants and object with default, global properties
+ * @private
*/
- Edge.prototype.setProperties = function(properties, constants) {
- if (!properties) {
- return;
- }
-
- if (properties.from !== undefined) {this.fromId = properties.from;}
- if (properties.to !== undefined) {this.toId = properties.to;}
-
- if (properties.id !== undefined) {this.id = properties.id;}
- if (properties.style !== undefined) {this.style = properties.style;}
- if (properties.label !== undefined) {this.label = properties.label;}
-
- if (this.label) {
- this.fontSize = constants.edges.fontSize;
- this.fontFace = constants.edges.fontFace;
- this.fontColor = constants.edges.fontColor;
- this.fontFill = constants.edges.fontFill;
+ Network.prototype._discreteStepNodes = function() {
+ var interval = this.physicsDiscreteStepsize;
+ var nodes = this.nodes;
+ var nodeId;
+ var nodesPresent = false;
- if (properties.fontColor !== undefined) {this.fontColor = properties.fontColor;}
- if (properties.fontSize !== undefined) {this.fontSize = properties.fontSize;}
- if (properties.fontFace !== undefined) {this.fontFace = properties.fontFace;}
- if (properties.fontFill !== undefined) {this.fontFill = properties.fontFill;}
+ if (this.constants.maxVelocity > 0) {
+ for (nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ nodes[nodeId].discreteStepLimited(interval, this.constants.maxVelocity);
+ nodesPresent = true;
+ }
+ }
}
-
- if (properties.title !== undefined) {this.title = properties.title;}
- if (properties.width !== undefined) {this.width = properties.width;}
- if (properties.widthSelectionMultiplier !== undefined)
- {this.widthSelectionMultiplier = properties.widthSelectionMultiplier;}
- if (properties.hoverWidth !== undefined) {this.hoverWidth = properties.hoverWidth;}
- if (properties.value !== undefined) {this.value = properties.value;}
- if (properties.length !== undefined) {this.length = properties.length;
- this.customLength = true;}
-
- // scale the arrow
- if (properties.arrowScaleFactor !== undefined) {this.arrowScaleFactor = properties.arrowScaleFactor;}
-
- if (properties.inheritColor !== undefined) {this.inheritColor = properties.inheritColor;}
-
- // Added to support dashed lines
- // David Jordan
- // 2012-08-08
- if (properties.dash) {
- if (properties.dash.length !== undefined) {this.dash.length = properties.dash.length;}
- if (properties.dash.gap !== undefined) {this.dash.gap = properties.dash.gap;}
- if (properties.dash.altLength !== undefined) {this.dash.altLength = properties.dash.altLength;}
+ else {
+ for (nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ nodes[nodeId].discreteStep(interval);
+ nodesPresent = true;
+ }
+ }
}
- if (properties.color !== undefined) {
- if (util.isString(properties.color)) {
- this.color.color = properties.color;
- this.color.highlight = properties.color;
+ if (nodesPresent == true) {
+ var vminCorrected = this.constants.minVelocity / Math.max(this.scale,0.05);
+ if (vminCorrected > 0.5*this.constants.maxVelocity) {
+ this.moving = true;
}
else {
- if (properties.color.color !== undefined) {this.color.color = properties.color.color;}
- if (properties.color.highlight !== undefined) {this.color.highlight = properties.color.highlight;}
- if (properties.color.hover !== undefined) {this.color.hover = properties.color.hover;}
+ this.moving = this._isMoving(vminCorrected) || this.constants.configurePhysics;
}
}
+ };
- // A node is connected when it has a from and to node.
- this.connect();
+ /**
+ * A single simulation step (or "tick") in the physics simulation
+ *
+ * @private
+ */
+ Network.prototype._physicsTick = function() {
+ if (!this.freezeSimulation) {
+ if (this.moving) {
+ this._doInAllActiveSectors("_initializeForceCalculation");
+ this._doInAllActiveSectors("_discreteStepNodes");
+ if (this.constants.smoothCurves) {
+ this._doInSupportSector("_discreteStepNodes");
+ }
+ this._findCenter(this._getRange())
+ }
+ }
+ };
- this.widthFixed = this.widthFixed || (properties.width !== undefined);
- this.lengthFixed = this.lengthFixed || (properties.length !== undefined);
- this.widthSelected = this.width * this.widthSelectionMultiplier;
+ /**
+ * This function runs one step of the animation. It calls an x amount of physics ticks and one render tick.
+ * It reschedules itself at the beginning of the function
+ *
+ * @private
+ */
+ Network.prototype._animationStep = function() {
+ // reset the timer so a new scheduled animation step can be set
+ this.timer = undefined;
+ // handle the keyboad movement
+ this._handleNavigation();
- // set draw method based on style
- switch (this.style) {
- case 'line': this.draw = this._drawLine; break;
- case 'arrow': this.draw = this._drawArrow; break;
- case 'arrow-center': this.draw = this._drawArrowCenter; break;
- case 'dash-line': this.draw = this._drawDashLine; break;
- default: this.draw = this._drawLine; break;
+ // this schedules a new animation step
+ this.start();
+
+ // start the physics simulation
+ var calculationTime = Date.now();
+ var maxSteps = 1;
+ this._physicsTick();
+ var timeRequired = Date.now() - calculationTime;
+ while (timeRequired < 0.9*(this.renderTimestep - this.renderTime) && maxSteps < this.maxPhysicsTicksPerRender) {
+ this._physicsTick();
+ timeRequired = Date.now() - calculationTime;
+ maxSteps++;
}
+
+ // start the rendering process
+ var renderTime = Date.now();
+ this._redraw();
+ this.renderTime = Date.now() - renderTime;
+
};
+ if (typeof window !== 'undefined') {
+ window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||
+ window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+ }
+
/**
- * Connect an edge to its nodes
+ * Schedule a animation step with the refreshrate interval.
*/
- Edge.prototype.connect = function () {
- this.disconnect();
+ Network.prototype.start = function() {
+ if (this.moving || this.xIncrement != 0 || this.yIncrement != 0 || this.zoomIncrement != 0) {
+ if (!this.timer) {
+ var ua = navigator.userAgent.toLowerCase();
- this.from = this.network.nodes[this.fromId] || null;
- this.to = this.network.nodes[this.toId] || null;
- this.connected = (this.from && this.to);
+ var requiresTimeout = false;
+ if (ua.indexOf('msie 9.0') != -1) { // IE 9
+ requiresTimeout = true;
+ }
+ else if (ua.indexOf('safari') != -1) { // safari
+ if (ua.indexOf('chrome') <= -1) {
+ requiresTimeout = true;
+ }
+ }
- if (this.connected) {
- this.from.attachEdge(this);
- this.to.attachEdge(this);
+ if (requiresTimeout == true) {
+ this.timer = window.setTimeout(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
+ }
+ else{
+ this.timer = window.requestAnimationFrame(this._animationStep.bind(this), this.renderTimestep); // wait this.renderTimeStep milliseconds and perform the animation step function
+ }
+ }
}
else {
- if (this.from) {
- this.from.detachEdge(this);
- }
- if (this.to) {
- this.to.detachEdge(this);
- }
+ this._redraw();
}
};
+
/**
- * Disconnect an edge from its nodes
+ * Move the network according to the keyboard presses.
+ *
+ * @private
*/
- Edge.prototype.disconnect = function () {
- if (this.from) {
- this.from.detachEdge(this);
- this.from = null;
+ Network.prototype._handleNavigation = function() {
+ if (this.xIncrement != 0 || this.yIncrement != 0) {
+ var translation = this._getTranslation();
+ this._setTranslation(translation.x+this.xIncrement, translation.y+this.yIncrement);
}
- if (this.to) {
- this.to.detachEdge(this);
- this.to = null;
+ if (this.zoomIncrement != 0) {
+ var center = {
+ x: this.frame.canvas.clientWidth / 2,
+ y: this.frame.canvas.clientHeight / 2
+ };
+ this._zoom(this.scale*(1 + this.zoomIncrement), center);
}
-
- this.connected = false;
- };
-
- /**
- * get the title of this edge.
- * @return {string} title The title of the edge, or undefined when no title
- * has been set.
- */
- Edge.prototype.getTitle = function() {
- return typeof this.title === "function" ? this.title() : this.title;
};
/**
- * Retrieve the value of the edge. Can be undefined
- * @return {Number} value
- */
- Edge.prototype.getValue = function() {
- return this.value;
- };
-
- /**
- * Adjust the value range of the edge. The edge will adjust it's width
- * based on its value.
- * @param {Number} min
- * @param {Number} max
+ * Freeze the _animationStep
*/
- Edge.prototype.setValueRange = function(min, max) {
- if (!this.widthFixed && this.value !== undefined) {
- var scale = (this.widthMax - this.widthMin) / (max - min);
- this.width = (this.value - min) * scale + this.widthMin;
+ Network.prototype.toggleFreeze = function() {
+ if (this.freezeSimulation == false) {
+ this.freezeSimulation = true;
+ }
+ else {
+ this.freezeSimulation = false;
+ this.start();
}
};
- /**
- * Redraw a edge
- * Draw this edge in the given canvas
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
- * @param {CanvasRenderingContext2D} ctx
- */
- Edge.prototype.draw = function(ctx) {
- throw "Method draw not initialized in edge";
- };
/**
- * Check if this object is overlapping with the provided object
- * @param {Object} obj an object with parameters left, top
- * @return {boolean} True if location is located on the edge
+ * This function cleans the support nodes if they are not needed and adds them when they are.
+ *
+ * @param {boolean} [disableStart]
+ * @private
*/
- Edge.prototype.isOverlappingWith = function(obj) {
- if (this.connected) {
- var distMax = 10;
- var xFrom = this.from.x;
- var yFrom = this.from.y;
- var xTo = this.to.x;
- var yTo = this.to.y;
- var xObj = obj.left;
- var yObj = obj.top;
-
- var dist = this._getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj);
-
- return (dist < distMax);
+ Network.prototype._configureSmoothCurves = function(disableStart) {
+ if (disableStart === undefined) {
+ disableStart = true;
}
- else {
- return false
+ if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
+ this._createBezierNodes();
}
- };
-
- Edge.prototype._getColor = function() {
- var colorObj = this.color;
- if (this.inheritColor == "to") {
- colorObj = {
- highlight: this.to.color.highlight.border,
- hover: this.to.color.hover.border,
- color: this.to.color.border
- };
+ else {
+ // delete the support nodes
+ this.sectors['support']['nodes'] = {};
+ for (var edgeId in this.edges) {
+ if (this.edges.hasOwnProperty(edgeId)) {
+ this.edges[edgeId].smooth = false;
+ this.edges[edgeId].via = null;
+ }
+ }
}
- else if (this.inheritColor == "from" || this.inheritColor == true) {
- colorObj = {
- highlight: this.from.color.highlight.border,
- hover: this.from.color.hover.border,
- color: this.from.color.border
- };
+ this._updateCalculationNodes();
+ if (!disableStart) {
+ this.moving = true;
+ this.start();
}
-
- if (this.selected == true) {return colorObj.highlight;}
- else if (this.hover == true) {return colorObj.hover;}
- else {return colorObj.color;}
- }
+ };
/**
- * Redraw a edge as a line
- * Draw this edge in the given canvas
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
- * @param {CanvasRenderingContext2D} ctx
+ * Bezier curves require an anchor point to calculate the smooth flow. These points are nodes. These nodes are invisible but
+ * are used for the force calculation.
+ *
* @private
*/
- Edge.prototype._drawLine = function(ctx) {
- // set style
- ctx.strokeStyle = this._getColor();
- ctx.lineWidth = this._getLineWidth();
-
- if (this.from != this.to) {
- // draw line
- var via = this._line(ctx);
-
- // draw label
- var point;
- if (this.label) {
- if (this.smoothCurves.enabled == true && via != null) {
- var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
- var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
- point = {x:midpointX, y:midpointY};
- }
- else {
- point = this._pointOnLine(0.5);
+ Network.prototype._createBezierNodes = function() {
+ if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
+ for (var edgeId in this.edges) {
+ if (this.edges.hasOwnProperty(edgeId)) {
+ var edge = this.edges[edgeId];
+ if (edge.via == null) {
+ edge.smooth = true;
+ var nodeId = "edgeId:".concat(edge.id);
+ this.sectors['support']['nodes'][nodeId] = new Node(
+ {id:nodeId,
+ mass:1,
+ shape:'circle',
+ image:"",
+ internalMultiplier:1
+ },{},{},this.constants);
+ edge.via = this.sectors['support']['nodes'][nodeId];
+ edge.via.parentEdgeId = edge.id;
+ edge.positionBezierNode();
+ }
}
- this._label(ctx, this.label, point.x, point.y);
}
}
- else {
- var x, y;
- var radius = this.length / 4;
- var node = this.from;
- if (!node.width) {
- node.resize(ctx);
- }
- if (node.width > node.height) {
- x = node.x + node.width / 2;
- y = node.y - radius;
+ };
+
+ /**
+ * load the functions that load the mixins into the prototype.
+ *
+ * @private
+ */
+ Network.prototype._initializeMixinLoaders = function () {
+ for (var mixin in MixinLoader) {
+ if (MixinLoader.hasOwnProperty(mixin)) {
+ Network.prototype[mixin] = MixinLoader[mixin];
}
- else {
- x = node.x + radius;
- y = node.y - node.height / 2;
+ }
+ };
+
+ /**
+ * Load the XY positions of the nodes into the dataset.
+ */
+ Network.prototype.storePosition = function() {
+ var dataArray = [];
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ var node = this.nodes[nodeId];
+ var allowedToMoveX = !this.nodes.xFixed;
+ var allowedToMoveY = !this.nodes.yFixed;
+ if (this.nodesData._data[nodeId].x != Math.round(node.x) || this.nodesData._data[nodeId].y != Math.round(node.y)) {
+ dataArray.push({id:nodeId,x:Math.round(node.x),y:Math.round(node.y),allowedToMoveX:allowedToMoveX,allowedToMoveY:allowedToMoveY});
+ }
}
- this._circle(ctx, x, y, radius);
- point = this._pointOnCircle(x, y, radius, 0.5);
- this._label(ctx, this.label, point.x, point.y);
}
+ this.nodesData.update(dataArray);
};
+
/**
- * Get the line width of the edge. Depends on width and whether one of the
- * connected nodes is selected.
- * @return {Number} width
- * @private
+ * Center a node in view.
+ *
+ * @param {Number} nodeId
+ * @param {Number} [zoomLevel]
*/
- Edge.prototype._getLineWidth = function() {
- if (this.selected == true) {
- return Math.min(this.widthSelected, this.widthMax)*this.networkScaleInv;
+ Network.prototype.focusOnNode = function (nodeId, zoomLevel) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ if (zoomLevel === undefined) {
+ zoomLevel = this._getScale();
+ }
+ var nodePosition= {x: this.nodes[nodeId].x, y: this.nodes[nodeId].y};
+
+ var requiredScale = zoomLevel;
+ this._setScale(requiredScale);
+
+ var canvasCenter = this.DOMtoCanvas({x:0.5 * this.frame.canvas.width,y:0.5 * this.frame.canvas.height});
+ var translation = this._getTranslation();
+
+ var distanceFromCenter = {x:canvasCenter.x - nodePosition.x,
+ y:canvasCenter.y - nodePosition.y};
+
+ this._setTranslation(translation.x + requiredScale * distanceFromCenter.x,
+ translation.y + requiredScale * distanceFromCenter.y);
+ this.redraw();
}
else {
- if (this.hover == true) {
- return Math.min(this.hoverWidth, this.widthMax)*this.networkScaleInv;
- }
- else {
- return this.width*this.networkScaleInv;
- }
+ console.log("This nodeId cannot be found.")
}
};
- Edge.prototype._getViaCoordinates = function () {
- var xVia = null;
- var yVia = null;
- var factor = this.smoothCurves.roundness;
- var type = this.smoothCurves.type;
- if (factor == 0) {
- return {x:null,y:null};
- }
+ module.exports = Network;
- var dx = Math.abs(this.from.x - this.to.x);
- var dy = Math.abs(this.from.y - this.to.y);
- if (type == 'discrete' || type == 'diagonalCross') {
- if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) {
- if (this.from.y > this.to.y) {
- if (this.from.x < this.to.x) {
- xVia = this.from.x + factor * dy;
- yVia = this.from.y - factor * dy;
- }
- else if (this.from.x > this.to.x) {
- xVia = this.from.x - factor * dy;
- yVia = this.from.y - factor * dy;
- }
- }
- else if (this.from.y < this.to.y) {
- if (this.from.x < this.to.x) {
- xVia = this.from.x + factor * dy;
- yVia = this.from.y + factor * dy;
- }
- else if (this.from.x > this.to.x) {
- xVia = this.from.x - factor * dy;
- yVia = this.from.y + factor * dy;
- }
- }
- if (type == "discrete") {
- xVia = dx < factor * dy ? this.from.x : xVia;
- }
- }
- else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
- if (this.from.y > this.to.y) {
- if (this.from.x < this.to.x) {
- xVia = this.from.x + factor * dx;
- yVia = this.from.y - factor * dx;
- }
- else if (this.from.x > this.to.x) {
- xVia = this.from.x - factor * dx;
- yVia = this.from.y - factor * dx;
- }
- }
- else if (this.from.y < this.to.y) {
- if (this.from.x < this.to.x) {
- xVia = this.from.x + factor * dx;
- yVia = this.from.y + factor * dx;
- }
- else if (this.from.x > this.to.x) {
- xVia = this.from.x - factor * dx;
- yVia = this.from.y + factor * dx;
- }
- }
- if (type == "discrete") {
- yVia = dy < factor * dx ? this.from.y : yVia;
- }
- }
- }
- else if (type == "straightCross") {
- if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) {
- xVia = this.from.x;
- yVia = this.to.y
- }
- else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
- xVia = this.to.x;
- yVia = this.from.y;
- }
- }
- else if (type == 'horizontal') {
- xVia = this.to.x;
- yVia = this.from.y;
- }
- else if (type == 'vertical') {
- xVia = this.from.x;
- yVia = this.to.y;
- }
- else { // continuous
- if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) {
- if (this.from.y > this.to.y) {
- if (this.from.x < this.to.x) {
- // console.log(1)
- xVia = this.from.x + factor * dy;
- yVia = this.from.y - factor * dy;
- xVia = this.to.x < xVia ? this.to.x : xVia;
- }
- else if (this.from.x > this.to.x) {
- // console.log(2)
- xVia = this.from.x - factor * dy;
- yVia = this.from.y - factor * dy;
- xVia = this.to.x > xVia ? this.to.x :xVia;
- }
- }
- else if (this.from.y < this.to.y) {
- if (this.from.x < this.to.x) {
- // console.log(3)
- xVia = this.from.x + factor * dy;
- yVia = this.from.y + factor * dy;
- xVia = this.to.x < xVia ? this.to.x : xVia;
- }
- else if (this.from.x > this.to.x) {
- // console.log(4, this.from.x, this.to.x)
- xVia = this.from.x - factor * dy;
- yVia = this.from.y + factor * dy;
- xVia = this.to.x > xVia ? this.to.x : xVia;
- }
- }
- }
- else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
- if (this.from.y > this.to.y) {
- if (this.from.x < this.to.x) {
- // console.log(5)
- xVia = this.from.x + factor * dx;
- yVia = this.from.y - factor * dx;
- yVia = this.to.y > yVia ? this.to.y : yVia;
- }
- else if (this.from.x > this.to.x) {
- // console.log(6)
- xVia = this.from.x - factor * dx;
- yVia = this.from.y - factor * dx;
- yVia = this.to.y > yVia ? this.to.y : yVia;
- }
- }
- else if (this.from.y < this.to.y) {
- if (this.from.x < this.to.x) {
- // console.log(7)
- xVia = this.from.x + factor * dx;
- yVia = this.from.y + factor * dx;
- yVia = this.to.y < yVia ? this.to.y : yVia;
- }
- else if (this.from.x > this.to.x) {
- // console.log(8)
- xVia = this.from.x - factor * dx;
- yVia = this.from.y + factor * dx;
- yVia = this.to.y < yVia ? this.to.y : yVia;
- }
- }
- }
+
+/***/ },
+/* 27 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var util = __webpack_require__(1);
+ var Node = __webpack_require__(30);
+
+ /**
+ * @class Edge
+ *
+ * A edge connects two nodes
+ * @param {Object} properties Object with properties. Must contain
+ * At least properties from and to.
+ * Available properties: from (number),
+ * to (number), label (string, color (string),
+ * width (number), style (string),
+ * length (number), title (string)
+ * @param {Network} network A Network object, used to find and edge to
+ * nodes.
+ * @param {Object} constants An object with default values for
+ * example for the color
+ */
+ function Edge (properties, network, constants) {
+ if (!network) {
+ throw "No network provided";
}
+ this.network = network;
+
+ // initialize constants
+ this.widthMin = constants.edges.widthMin;
+ this.widthMax = constants.edges.widthMax;
+
+ // initialize variables
+ this.id = undefined;
+ this.fromId = undefined;
+ this.toId = undefined;
+ this.style = constants.edges.style;
+ this.title = undefined;
+ this.width = constants.edges.width;
+ this.widthSelectionMultiplier = constants.edges.widthSelectionMultiplier;
+ this.widthSelected = this.width * this.widthSelectionMultiplier;
+ this.hoverWidth = constants.edges.hoverWidth;
+ this.value = undefined;
+ this.length = constants.physics.springLength;
+ this.customLength = false;
+ this.selected = false;
+ this.hover = false;
+ this.smoothCurves = constants.smoothCurves;
+ this.dynamicSmoothCurves = constants.dynamicSmoothCurves;
+ this.arrowScaleFactor = constants.edges.arrowScaleFactor;
+ this.inheritColor = constants.edges.inheritColor;
+
+ this.from = null; // a node
+ this.to = null; // a node
+ this.via = null; // a temp node
+
+ // we use this to be able to reconnect the edge to a cluster if its node is put into a cluster
+ // by storing the original information we can revert to the original connection when the cluser is opened.
+ this.originalFromId = [];
+ this.originalToId = [];
+
+ this.connected = false;
+
+ // Added to support dashed lines
+ // David Jordan
+ // 2012-08-08
+ this.dash = util.extend({}, constants.edges.dash); // contains properties length, gap, altLength
+
+ this.color = {color:constants.edges.color.color,
+ highlight:constants.edges.color.highlight,
+ hover:constants.edges.color.hover};
+ this.widthFixed = false;
+ this.lengthFixed = false;
+ this.setProperties(properties, constants);
- return {x:xVia, y:yVia};
+ this.controlNodesEnabled = false;
+ this.controlNodes = {from:null, to:null, positions:{}};
+ this.connectedNode = null;
}
/**
- * Draw a line between two nodes
- * @param {CanvasRenderingContext2D} ctx
- * @private
+ * Set or overwrite properties for the edge
+ * @param {Object} properties an object with properties
+ * @param {Object} constants and object with default, global properties
*/
- Edge.prototype._line = function (ctx) {
- // draw a straight line
- ctx.beginPath();
- ctx.moveTo(this.from.x, this.from.y);
- if (this.smoothCurves.enabled == true) {
- if (this.smoothCurves.dynamic == false) {
- var via = this._getViaCoordinates();
- if (via.x == null) {
- ctx.lineTo(this.to.x, this.to.y);
- ctx.stroke();
- return null;
- }
- else {
- // this.via.x = via.x;
- // this.via.y = via.y;
- ctx.quadraticCurveTo(via.x,via.y,this.to.x, this.to.y);
- ctx.stroke();
- return via;
- }
- }
- else {
- ctx.quadraticCurveTo(this.via.x,this.via.y,this.to.x, this.to.y);
- ctx.stroke();
- return this.via;
- }
- }
- else {
- ctx.lineTo(this.to.x, this.to.y);
- ctx.stroke();
- return null;
+ Edge.prototype.setProperties = function(properties, constants) {
+ if (!properties) {
+ return;
}
- };
- /**
- * Draw a line from a node to itself, a circle
- * @param {CanvasRenderingContext2D} ctx
- * @param {Number} x
- * @param {Number} y
- * @param {Number} radius
- * @private
- */
- Edge.prototype._circle = function (ctx, x, y, radius) {
- // draw a circle
- ctx.beginPath();
- ctx.arc(x, y, radius, 0, 2 * Math.PI, false);
- ctx.stroke();
- };
+ if (properties.from !== undefined) {this.fromId = properties.from;}
+ if (properties.to !== undefined) {this.toId = properties.to;}
- /**
- * Draw label with white background and with the middle at (x, y)
- * @param {CanvasRenderingContext2D} ctx
- * @param {String} text
- * @param {Number} x
- * @param {Number} y
- * @private
- */
- Edge.prototype._label = function (ctx, text, x, y) {
- if (text) {
- // TODO: cache the calculated size
- ctx.font = ((this.from.selected || this.to.selected) ? "bold " : "") +
- this.fontSize + "px " + this.fontFace;
- ctx.fillStyle = this.fontFill;
- var width = ctx.measureText(text).width;
- var height = this.fontSize;
- var left = x - width / 2;
- var top = y - height / 2;
+ if (properties.id !== undefined) {this.id = properties.id;}
+ if (properties.style !== undefined) {this.style = properties.style;}
+ if (properties.label !== undefined) {this.label = properties.label;}
- ctx.fillRect(left, top, width, height);
+ if (this.label) {
+ this.fontSize = constants.edges.fontSize;
+ this.fontFace = constants.edges.fontFace;
+ this.fontColor = constants.edges.fontColor;
+ this.fontFill = constants.edges.fontFill;
- // draw text
- ctx.fillStyle = this.fontColor || "black";
- ctx.textAlign = "left";
- ctx.textBaseline = "top";
- ctx.fillText(text, left, top);
+ if (properties.fontColor !== undefined) {this.fontColor = properties.fontColor;}
+ if (properties.fontSize !== undefined) {this.fontSize = properties.fontSize;}
+ if (properties.fontFace !== undefined) {this.fontFace = properties.fontFace;}
+ if (properties.fontFill !== undefined) {this.fontFill = properties.fontFill;}
}
- };
- /**
- * Redraw a edge as a dashed line
- * Draw this edge in the given canvas
- * @author David Jordan
- * @date 2012-08-08
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
- * @param {CanvasRenderingContext2D} ctx
- * @private
- */
- Edge.prototype._drawDashLine = function(ctx) {
- // set style
- if (this.selected == true) {ctx.strokeStyle = this.color.highlight;}
- else if (this.hover == true) {ctx.strokeStyle = this.color.hover;}
- else {ctx.strokeStyle = this.color.color;}
+ if (properties.title !== undefined) {this.title = properties.title;}
+ if (properties.width !== undefined) {this.width = properties.width;}
+ if (properties.widthSelectionMultiplier !== undefined)
+ {this.widthSelectionMultiplier = properties.widthSelectionMultiplier;}
+ if (properties.hoverWidth !== undefined) {this.hoverWidth = properties.hoverWidth;}
+ if (properties.value !== undefined) {this.value = properties.value;}
+ if (properties.length !== undefined) {this.length = properties.length;
+ this.customLength = true;}
- ctx.lineWidth = this._getLineWidth();
+ // scale the arrow
+ if (properties.arrowScaleFactor !== undefined) {this.arrowScaleFactor = properties.arrowScaleFactor;}
- var via = null;
- // only firefox and chrome support this method, else we use the legacy one.
- if (ctx.mozDash !== undefined || ctx.setLineDash !== undefined) {
- // configure the dash pattern
- var pattern = [0];
- if (this.dash.length !== undefined && this.dash.gap !== undefined) {
- pattern = [this.dash.length,this.dash.gap];
+ if (properties.inheritColor !== undefined) {this.inheritColor = properties.inheritColor;}
+
+ // Added to support dashed lines
+ // David Jordan
+ // 2012-08-08
+ if (properties.dash) {
+ if (properties.dash.length !== undefined) {this.dash.length = properties.dash.length;}
+ if (properties.dash.gap !== undefined) {this.dash.gap = properties.dash.gap;}
+ if (properties.dash.altLength !== undefined) {this.dash.altLength = properties.dash.altLength;}
+ }
+
+ if (properties.color !== undefined) {
+ if (util.isString(properties.color)) {
+ this.color.color = properties.color;
+ this.color.highlight = properties.color;
}
else {
- pattern = [5,5];
+ if (properties.color.color !== undefined) {this.color.color = properties.color.color;}
+ if (properties.color.highlight !== undefined) {this.color.highlight = properties.color.highlight;}
+ if (properties.color.hover !== undefined) {this.color.hover = properties.color.hover;}
}
+ }
- // set dash settings for chrome or firefox
- if (typeof ctx.setLineDash !== 'undefined') { //Chrome
- ctx.setLineDash(pattern);
- ctx.lineDashOffset = 0;
+ // A node is connected when it has a from and to node.
+ this.connect();
- } else { //Firefox
- ctx.mozDash = pattern;
- ctx.mozDashOffset = 0;
- }
+ this.widthFixed = this.widthFixed || (properties.width !== undefined);
+ this.lengthFixed = this.lengthFixed || (properties.length !== undefined);
- // draw the line
- via = this._line(ctx);
+ this.widthSelected = this.width * this.widthSelectionMultiplier;
- // restore the dash settings.
- if (typeof ctx.setLineDash !== 'undefined') { //Chrome
- ctx.setLineDash([0]);
- ctx.lineDashOffset = 0;
+ // set draw method based on style
+ switch (this.style) {
+ case 'line': this.draw = this._drawLine; break;
+ case 'arrow': this.draw = this._drawArrow; break;
+ case 'arrow-center': this.draw = this._drawArrowCenter; break;
+ case 'dash-line': this.draw = this._drawDashLine; break;
+ default: this.draw = this._drawLine; break;
+ }
+ };
- } else { //Firefox
- ctx.mozDash = [0];
- ctx.mozDashOffset = 0;
- }
+ /**
+ * Connect an edge to its nodes
+ */
+ Edge.prototype.connect = function () {
+ this.disconnect();
+
+ this.from = this.network.nodes[this.fromId] || null;
+ this.to = this.network.nodes[this.toId] || null;
+ this.connected = (this.from && this.to);
+
+ if (this.connected) {
+ this.from.attachEdge(this);
+ this.to.attachEdge(this);
}
- else { // unsupporting smooth lines
- // draw dashed line
- ctx.beginPath();
- ctx.lineCap = 'round';
- if (this.dash.altLength !== undefined) //If an alt dash value has been set add to the array this value
- {
- ctx.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,
- [this.dash.length,this.dash.gap,this.dash.altLength,this.dash.gap]);
- }
- else if (this.dash.length !== undefined && this.dash.gap !== undefined) //If a dash and gap value has been set add to the array this value
- {
- ctx.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,
- [this.dash.length,this.dash.gap]);
+ else {
+ if (this.from) {
+ this.from.detachEdge(this);
}
- else //If all else fails draw a line
- {
- ctx.moveTo(this.from.x, this.from.y);
- ctx.lineTo(this.to.x, this.to.y);
+ if (this.to) {
+ this.to.detachEdge(this);
}
- ctx.stroke();
}
+ };
- // draw label
- if (this.label) {
- var point;
- if (this.smoothCurves.enabled == true && via != null) {
- var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
- var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
- point = {x:midpointX, y:midpointY};
- }
- else {
- point = this._pointOnLine(0.5);
- }
- this._label(ctx, this.label, point.x, point.y);
+ /**
+ * Disconnect an edge from its nodes
+ */
+ Edge.prototype.disconnect = function () {
+ if (this.from) {
+ this.from.detachEdge(this);
+ this.from = null;
+ }
+ if (this.to) {
+ this.to.detachEdge(this);
+ this.to = null;
}
+
+ this.connected = false;
+ };
+
+ /**
+ * get the title of this edge.
+ * @return {string} title The title of the edge, or undefined when no title
+ * has been set.
+ */
+ Edge.prototype.getTitle = function() {
+ return typeof this.title === "function" ? this.title() : this.title;
};
+
/**
- * Get a point on a line
- * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
- * @return {Object} point
- * @private
+ * Retrieve the value of the edge. Can be undefined
+ * @return {Number} value
*/
- Edge.prototype._pointOnLine = function (percentage) {
- return {
- x: (1 - percentage) * this.from.x + percentage * this.to.x,
- y: (1 - percentage) * this.from.y + percentage * this.to.y
- }
+ Edge.prototype.getValue = function() {
+ return this.value;
};
/**
- * Get a point on a circle
- * @param {Number} x
- * @param {Number} y
- * @param {Number} radius
- * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
- * @return {Object} point
- * @private
+ * Adjust the value range of the edge. The edge will adjust it's width
+ * based on its value.
+ * @param {Number} min
+ * @param {Number} max
*/
- Edge.prototype._pointOnCircle = function (x, y, radius, percentage) {
- var angle = (percentage - 3/8) * 2 * Math.PI;
- return {
- x: x + radius * Math.cos(angle),
- y: y - radius * Math.sin(angle)
+ Edge.prototype.setValueRange = function(min, max) {
+ if (!this.widthFixed && this.value !== undefined) {
+ var scale = (this.widthMax - this.widthMin) / (max - min);
+ this.width = (this.value - min) * scale + this.widthMin;
}
};
/**
- * Redraw a edge as a line with an arrow halfway the line
+ * Redraw a edge
* Draw this edge in the given canvas
* The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
* @param {CanvasRenderingContext2D} ctx
- * @private
*/
- Edge.prototype._drawArrowCenter = function(ctx) {
- var point;
- // set style
- if (this.selected == true) {ctx.strokeStyle = this.color.highlight; ctx.fillStyle = this.color.highlight;}
- else if (this.hover == true) {ctx.strokeStyle = this.color.hover; ctx.fillStyle = this.color.hover;}
- else {ctx.strokeStyle = this.color.color; ctx.fillStyle = this.color.color;}
- ctx.lineWidth = this._getLineWidth();
-
- if (this.from != this.to) {
- // draw line
- var via = this._line(ctx);
-
- var angle = Math.atan2((this.to.y - this.from.y), (this.to.x - this.from.x));
- var length = (10 + 5 * this.width) * this.arrowScaleFactor;
- // draw an arrow halfway the line
- if (this.smoothCurves.enabled == true && via != null) {
- var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
- var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
- point = {x:midpointX, y:midpointY};
- }
- else {
- point = this._pointOnLine(0.5);
- }
-
- ctx.arrow(point.x, point.y, angle, length);
- ctx.fill();
- ctx.stroke();
-
- // draw label
- if (this.label) {
- this._label(ctx, this.label, point.x, point.y);
- }
- }
- else {
- // draw circle
- var x, y;
- var radius = 0.25 * Math.max(100,this.length);
- var node = this.from;
- if (!node.width) {
- node.resize(ctx);
- }
- if (node.width > node.height) {
- x = node.x + node.width * 0.5;
- y = node.y - radius;
- }
- else {
- x = node.x + radius;
- y = node.y - node.height * 0.5;
- }
- this._circle(ctx, x, y, radius);
-
- // draw all arrows
- var angle = 0.2 * Math.PI;
- var length = (10 + 5 * this.width) * this.arrowScaleFactor;
- point = this._pointOnCircle(x, y, radius, 0.5);
- ctx.arrow(point.x, point.y, angle, length);
- ctx.fill();
- ctx.stroke();
-
- // draw label
- if (this.label) {
- point = this._pointOnCircle(x, y, radius, 0.5);
- this._label(ctx, this.label, point.x, point.y);
- }
- }
+ Edge.prototype.draw = function(ctx) {
+ throw "Method draw not initialized in edge";
};
-
-
/**
- * Redraw a edge as a line with an arrow
- * Draw this edge in the given canvas
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
- * @param {CanvasRenderingContext2D} ctx
- * @private
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top
+ * @return {boolean} True if location is located on the edge
*/
- Edge.prototype._drawArrow = function(ctx) {
- // set style
- if (this.selected == true) {ctx.strokeStyle = this.color.highlight; ctx.fillStyle = this.color.highlight;}
- else if (this.hover == true) {ctx.strokeStyle = this.color.hover; ctx.fillStyle = this.color.hover;}
- else {ctx.strokeStyle = this.color.color; ctx.fillStyle = this.color.color;}
-
- ctx.lineWidth = this._getLineWidth();
-
- var angle, length;
- //draw a line
- if (this.from != this.to) {
- angle = Math.atan2((this.to.y - this.from.y), (this.to.x - this.from.x));
- var dx = (this.to.x - this.from.x);
- var dy = (this.to.y - this.from.y);
- var edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
-
- var fromBorderDist = this.from.distanceToBorder(ctx, angle + Math.PI);
- var fromBorderPoint = (edgeSegmentLength - fromBorderDist) / edgeSegmentLength;
- var xFrom = (fromBorderPoint) * this.from.x + (1 - fromBorderPoint) * this.to.x;
- var yFrom = (fromBorderPoint) * this.from.y + (1 - fromBorderPoint) * this.to.y;
-
- var via;
- if (this.smoothCurves.dynamic == true && this.smoothCurves.enabled == true ) {
- via = this.via;
- }
- else if (this.smoothCurves.enabled == true) {
- via = this._getViaCoordinates();
- }
-
- if (this.smoothCurves.enabled == true && via.x != null) {
- angle = Math.atan2((this.to.y - via.y), (this.to.x - via.x));
- dx = (this.to.x - via.x);
- dy = (this.to.y - via.y);
- edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
- }
- var toBorderDist = this.to.distanceToBorder(ctx, angle);
- var toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;
-
- var xTo,yTo;
- if (this.smoothCurves.enabled == true && via.x != null) {
- xTo = (1 - toBorderPoint) * via.x + toBorderPoint * this.to.x;
- yTo = (1 - toBorderPoint) * via.y + toBorderPoint * this.to.y;
- }
- else {
- xTo = (1 - toBorderPoint) * this.from.x + toBorderPoint * this.to.x;
- yTo = (1 - toBorderPoint) * this.from.y + toBorderPoint * this.to.y;
- }
-
- ctx.beginPath();
- ctx.moveTo(xFrom,yFrom);
- if (this.smoothCurves.enabled == true && via.x != null) {
- ctx.quadraticCurveTo(via.x,via.y,xTo, yTo);
- }
- else {
- ctx.lineTo(xTo, yTo);
- }
- ctx.stroke();
+ Edge.prototype.isOverlappingWith = function(obj) {
+ if (this.connected) {
+ var distMax = 10;
+ var xFrom = this.from.x;
+ var yFrom = this.from.y;
+ var xTo = this.to.x;
+ var yTo = this.to.y;
+ var xObj = obj.left;
+ var yObj = obj.top;
- // draw arrow at the end of the line
- length = (10 + 5 * this.width) * this.arrowScaleFactor;
- ctx.arrow(xTo, yTo, angle, length);
- ctx.fill();
- ctx.stroke();
+ var dist = this._getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj);
- // draw label
- if (this.label) {
- var point;
- if (this.smoothCurves.enabled == true && via != null) {
- var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
- var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
- point = {x:midpointX, y:midpointY};
- }
- else {
- point = this._pointOnLine(0.5);
- }
- this._label(ctx, this.label, point.x, point.y);
- }
+ return (dist < distMax);
}
else {
- // draw circle
- var node = this.from;
- var x, y, arrow;
- var radius = 0.25 * Math.max(100,this.length);
- if (!node.width) {
- node.resize(ctx);
- }
- if (node.width > node.height) {
- x = node.x + node.width * 0.5;
- y = node.y - radius;
- arrow = {
- x: x,
- y: node.y,
- angle: 0.9 * Math.PI
- };
- }
- else {
- x = node.x + radius;
- y = node.y - node.height * 0.5;
- arrow = {
- x: node.x,
- y: y,
- angle: 0.6 * Math.PI
- };
- }
- ctx.beginPath();
- // TODO: similarly, for a line without arrows, draw to the border of the nodes instead of the center
- ctx.arc(x, y, radius, 0, 2 * Math.PI, false);
- ctx.stroke();
-
- // draw all arrows
- var length = (10 + 5 * this.width) * this.arrowScaleFactor;
- ctx.arrow(arrow.x, arrow.y, arrow.angle, length);
- ctx.fill();
- ctx.stroke();
+ return false
+ }
+ };
- // draw label
- if (this.label) {
- point = this._pointOnCircle(x, y, radius, 0.5);
- this._label(ctx, this.label, point.x, point.y);
- }
+ Edge.prototype._getColor = function() {
+ var colorObj = this.color;
+ if (this.inheritColor == "to") {
+ colorObj = {
+ highlight: this.to.color.highlight.border,
+ hover: this.to.color.hover.border,
+ color: this.to.color.border
+ };
+ }
+ else if (this.inheritColor == "from" || this.inheritColor == true) {
+ colorObj = {
+ highlight: this.from.color.highlight.border,
+ hover: this.from.color.hover.border,
+ color: this.from.color.border
+ };
}
- };
+ if (this.selected == true) {return colorObj.highlight;}
+ else if (this.hover == true) {return colorObj.hover;}
+ else {return colorObj.color;}
+ }
/**
- * Calculate the distance between a point (x3,y3) and a line segment from
- * (x1,y1) to (x2,y2).
- * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {number} x3
- * @param {number} y3
+ * Redraw a edge as a line
+ * Draw this edge in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
* @private
*/
- Edge.prototype._getDistanceToEdge = function (x1,y1, x2,y2, x3,y3) { // x3,y3 is the point
+ Edge.prototype._drawLine = function(ctx) {
+ // set style
+ ctx.strokeStyle = this._getColor();
+ ctx.lineWidth = this._getLineWidth();
+
if (this.from != this.to) {
- if (this.smoothCurves.enabled == true) {
- var xVia, yVia;
- if (this.smoothCurves.enabled == true && this.smoothCurves.dynamic == true) {
- xVia = this.via.x;
- yVia = this.via.y;
- }
- else {
- var via = this._getViaCoordinates();
- xVia = via.x;
- yVia = via.y;
- }
- var minDistance = 1e9;
- var i,t,x,y,dx,dy;
- for (i = 0; i < 10; i++) {
- t = 0.1*i;
- x = Math.pow(1-t,2)*x1 + (2*t*(1 - t))*xVia + Math.pow(t,2)*x2;
- y = Math.pow(1-t,2)*y1 + (2*t*(1 - t))*yVia + Math.pow(t,2)*y2;
- dx = Math.abs(x3-x);
- dy = Math.abs(y3-y);
- minDistance = Math.min(minDistance,Math.sqrt(dx*dx + dy*dy));
- }
- return minDistance
- }
- else {
- var px = x2-x1,
- py = y2-y1,
- something = px*px + py*py,
- u = ((x3 - x1) * px + (y3 - y1) * py) / something;
+ // draw line
+ var via = this._line(ctx);
- if (u > 1) {
- u = 1;
+ // draw label
+ var point;
+ if (this.label) {
+ if (this.smoothCurves.enabled == true && via != null) {
+ var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
+ var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
+ point = {x:midpointX, y:midpointY};
}
- else if (u < 0) {
- u = 0;
+ else {
+ point = this._pointOnLine(0.5);
}
-
- var x = x1 + u * px,
- y = y1 + u * py,
- dx = x - x3,
- dy = y - y3;
-
- //# Note: If the actual distance does not matter,
- //# if you only want to compare what this function
- //# returns to other results of this function, you
- //# can just return the squared distance instead
- //# (i.e. remove the sqrt) to gain a little performance
-
- return Math.sqrt(dx*dx + dy*dy);
+ this._label(ctx, this.label, point.x, point.y);
}
}
else {
- var x, y, dx, dy;
+ var x, y;
var radius = this.length / 4;
var node = this.from;
if (!node.width) {
@@ -17519,9842 +16875,10504 @@ return /******/ (function(modules) { // webpackBootstrap
x = node.x + radius;
y = node.y - node.height / 2;
}
- dx = x - x3;
- dy = y - y3;
- return Math.abs(Math.sqrt(dx*dx + dy*dy) - radius);
+ this._circle(ctx, x, y, radius);
+ point = this._pointOnCircle(x, y, radius, 0.5);
+ this._label(ctx, this.label, point.x, point.y);
}
};
-
-
/**
- * This allows the zoom level of the network to influence the rendering
- *
- * @param scale
+ * Get the line width of the edge. Depends on width and whether one of the
+ * connected nodes is selected.
+ * @return {Number} width
+ * @private
*/
- Edge.prototype.setScale = function(scale) {
- this.networkScaleInv = 1.0/scale;
+ Edge.prototype._getLineWidth = function() {
+ if (this.selected == true) {
+ return Math.min(this.widthSelected, this.widthMax)*this.networkScaleInv;
+ }
+ else {
+ if (this.hover == true) {
+ return Math.min(this.hoverWidth, this.widthMax)*this.networkScaleInv;
+ }
+ else {
+ return this.width*this.networkScaleInv;
+ }
+ }
};
+ Edge.prototype._getViaCoordinates = function () {
+ var xVia = null;
+ var yVia = null;
+ var factor = this.smoothCurves.roundness;
+ var type = this.smoothCurves.type;
+ if (factor == 0) {
+ return {x:null,y:null};
+ }
- Edge.prototype.select = function() {
- this.selected = true;
- };
+ var dx = Math.abs(this.from.x - this.to.x);
+ var dy = Math.abs(this.from.y - this.to.y);
+ if (type == 'discrete' || type == 'diagonalCross') {
+ if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y > this.to.y) {
+ if (this.from.x < this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y - factor * dy;
+ }
+ else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y - factor * dy;
+ }
+ }
+ else if (this.from.y < this.to.y) {
+ if (this.from.x < this.to.x) {
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y + factor * dy;
+ }
+ else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y + factor * dy;
+ }
+ }
+ if (type == "discrete") {
+ xVia = dx < factor * dy ? this.from.x : xVia;
+ }
+ }
+ else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y > this.to.y) {
+ if (this.from.x < this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y - factor * dx;
+ }
+ else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y - factor * dx;
+ }
+ }
+ else if (this.from.y < this.to.y) {
+ if (this.from.x < this.to.x) {
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y + factor * dx;
+ }
+ else if (this.from.x > this.to.x) {
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y + factor * dx;
+ }
+ }
+ if (type == "discrete") {
+ yVia = dy < factor * dx ? this.from.y : yVia;
+ }
+ }
+ }
+ else if (type == "straightCross") {
+ if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) {
+ xVia = this.from.x;
+ yVia = this.to.y
+ }
+ else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ xVia = this.to.x;
+ yVia = this.from.y;
+ }
+ }
+ else if (type == 'horizontal') {
+ xVia = this.to.x;
+ yVia = this.from.y;
+ }
+ else if (type == 'vertical') {
+ xVia = this.from.x;
+ yVia = this.to.y;
+ }
+ else { // continuous
+ if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y > this.to.y) {
+ if (this.from.x < this.to.x) {
+ // console.log(1)
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y - factor * dy;
+ xVia = this.to.x < xVia ? this.to.x : xVia;
+ }
+ else if (this.from.x > this.to.x) {
+ // console.log(2)
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y - factor * dy;
+ xVia = this.to.x > xVia ? this.to.x :xVia;
+ }
+ }
+ else if (this.from.y < this.to.y) {
+ if (this.from.x < this.to.x) {
+ // console.log(3)
+ xVia = this.from.x + factor * dy;
+ yVia = this.from.y + factor * dy;
+ xVia = this.to.x < xVia ? this.to.x : xVia;
+ }
+ else if (this.from.x > this.to.x) {
+ // console.log(4, this.from.x, this.to.x)
+ xVia = this.from.x - factor * dy;
+ yVia = this.from.y + factor * dy;
+ xVia = this.to.x > xVia ? this.to.x : xVia;
+ }
+ }
+ }
+ else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) {
+ if (this.from.y > this.to.y) {
+ if (this.from.x < this.to.x) {
+ // console.log(5)
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y - factor * dx;
+ yVia = this.to.y > yVia ? this.to.y : yVia;
+ }
+ else if (this.from.x > this.to.x) {
+ // console.log(6)
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y - factor * dx;
+ yVia = this.to.y > yVia ? this.to.y : yVia;
+ }
+ }
+ else if (this.from.y < this.to.y) {
+ if (this.from.x < this.to.x) {
+ // console.log(7)
+ xVia = this.from.x + factor * dx;
+ yVia = this.from.y + factor * dx;
+ yVia = this.to.y < yVia ? this.to.y : yVia;
+ }
+ else if (this.from.x > this.to.x) {
+ // console.log(8)
+ xVia = this.from.x - factor * dx;
+ yVia = this.from.y + factor * dx;
+ yVia = this.to.y < yVia ? this.to.y : yVia;
+ }
+ }
+ }
+ }
- Edge.prototype.unselect = function() {
- this.selected = false;
- };
- Edge.prototype.positionBezierNode = function() {
- if (this.via !== null) {
- this.via.x = 0.5 * (this.from.x + this.to.x);
- this.via.y = 0.5 * (this.from.y + this.to.y);
- }
- };
+ return {x:xVia, y:yVia};
+ }
/**
- * This function draws the control nodes for the manipulator. In order to enable this, only set the this.controlNodesEnabled to true.
- * @param ctx
+ * Draw a line between two nodes
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
*/
- Edge.prototype._drawControlNodes = function(ctx) {
- if (this.controlNodesEnabled == true) {
- if (this.controlNodes.from === null && this.controlNodes.to === null) {
- var nodeIdFrom = "edgeIdFrom:".concat(this.id);
- var nodeIdTo = "edgeIdTo:".concat(this.id);
- var constants = {
- nodes:{group:'', radius:8},
- physics:{damping:0},
- clustering: {maxNodeSizeIncrements: 0 ,nodeScaling: {width:0, height: 0, radius:0}}
- };
- this.controlNodes.from = new Node(
- {id:nodeIdFrom,
- shape:'dot',
- color:{background:'#ff4e00', border:'#3c3c3c', highlight: {background:'#07f968'}}
- },{},{},constants);
- this.controlNodes.to = new Node(
- {id:nodeIdTo,
- shape:'dot',
- color:{background:'#ff4e00', border:'#3c3c3c', highlight: {background:'#07f968'}}
- },{},{},constants);
+ Edge.prototype._line = function (ctx) {
+ // draw a straight line
+ ctx.beginPath();
+ ctx.moveTo(this.from.x, this.from.y);
+ if (this.smoothCurves.enabled == true) {
+ if (this.smoothCurves.dynamic == false) {
+ var via = this._getViaCoordinates();
+ if (via.x == null) {
+ ctx.lineTo(this.to.x, this.to.y);
+ ctx.stroke();
+ return null;
+ }
+ else {
+ // this.via.x = via.x;
+ // this.via.y = via.y;
+ ctx.quadraticCurveTo(via.x,via.y,this.to.x, this.to.y);
+ ctx.stroke();
+ return via;
+ }
}
-
- if (this.controlNodes.from.selected == false && this.controlNodes.to.selected == false) {
- this.controlNodes.positions = this.getControlNodePositions(ctx);
- this.controlNodes.from.x = this.controlNodes.positions.from.x;
- this.controlNodes.from.y = this.controlNodes.positions.from.y;
- this.controlNodes.to.x = this.controlNodes.positions.to.x;
- this.controlNodes.to.y = this.controlNodes.positions.to.y;
+ else {
+ ctx.quadraticCurveTo(this.via.x,this.via.y,this.to.x, this.to.y);
+ ctx.stroke();
+ return this.via;
}
-
- this.controlNodes.from.draw(ctx);
- this.controlNodes.to.draw(ctx);
}
else {
- this.controlNodes = {from:null, to:null, positions:{}};
+ ctx.lineTo(this.to.x, this.to.y);
+ ctx.stroke();
+ return null;
}
};
/**
- * Enable control nodes.
+ * Draw a line from a node to itself, a circle
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
* @private
*/
- Edge.prototype._enableControlNodes = function() {
- this.controlNodesEnabled = true;
+ Edge.prototype._circle = function (ctx, x, y, radius) {
+ // draw a circle
+ ctx.beginPath();
+ ctx.arc(x, y, radius, 0, 2 * Math.PI, false);
+ ctx.stroke();
};
/**
- * disable control nodes
+ * Draw label with white background and with the middle at (x, y)
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {String} text
+ * @param {Number} x
+ * @param {Number} y
* @private
*/
- Edge.prototype._disableControlNodes = function() {
- this.controlNodesEnabled = false;
- };
+ Edge.prototype._label = function (ctx, text, x, y) {
+ if (text) {
+ // TODO: cache the calculated size
+ ctx.font = ((this.from.selected || this.to.selected) ? "bold " : "") +
+ this.fontSize + "px " + this.fontFace;
+ ctx.fillStyle = this.fontFill;
+ var width = ctx.measureText(text).width;
+ var height = this.fontSize;
+ var left = x - width / 2;
+ var top = y - height / 2;
- /**
- * This checks if one of the control nodes is selected and if so, returns the control node object. Else it returns null.
- * @param x
- * @param y
- * @returns {null}
- * @private
- */
- Edge.prototype._getSelectedControlNode = function(x,y) {
- var positions = this.controlNodes.positions;
- var fromDistance = Math.sqrt(Math.pow(x - positions.from.x,2) + Math.pow(y - positions.from.y,2));
- var toDistance = Math.sqrt(Math.pow(x - positions.to.x ,2) + Math.pow(y - positions.to.y ,2));
+ ctx.fillRect(left, top, width, height);
- if (fromDistance < 15) {
- this.connectedNode = this.from;
- this.from = this.controlNodes.from;
- return this.controlNodes.from;
- }
- else if (toDistance < 15) {
- this.connectedNode = this.to;
- this.to = this.controlNodes.to;
- return this.controlNodes.to;
- }
- else {
- return null;
+ // draw text
+ ctx.fillStyle = this.fontColor || "black";
+ ctx.textAlign = "left";
+ ctx.textBaseline = "top";
+ ctx.fillText(text, left, top);
}
};
-
/**
- * this resets the control nodes to their original position.
+ * Redraw a edge as a dashed line
+ * Draw this edge in the given canvas
+ * @author David Jordan
+ * @date 2012-08-08
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
* @private
*/
- Edge.prototype._restoreControlNodes = function() {
- if (this.controlNodes.from.selected == true) {
- this.from = this.connectedNode;
- this.connectedNode = null;
- this.controlNodes.from.unselect();
- }
- if (this.controlNodes.to.selected == true) {
- this.to = this.connectedNode;
- this.connectedNode = null;
- this.controlNodes.to.unselect();
- }
- };
-
- /**
- * this calculates the position of the control nodes on the edges of the parent nodes.
- *
- * @param ctx
- * @returns {{from: {x: number, y: number}, to: {x: *, y: *}}}
- */
- Edge.prototype.getControlNodePositions = function(ctx) {
- var angle = Math.atan2((this.to.y - this.from.y), (this.to.x - this.from.x));
- var dx = (this.to.x - this.from.x);
- var dy = (this.to.y - this.from.y);
- var edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
- var fromBorderDist = this.from.distanceToBorder(ctx, angle + Math.PI);
- var fromBorderPoint = (edgeSegmentLength - fromBorderDist) / edgeSegmentLength;
- var xFrom = (fromBorderPoint) * this.from.x + (1 - fromBorderPoint) * this.to.x;
- var yFrom = (fromBorderPoint) * this.from.y + (1 - fromBorderPoint) * this.to.y;
-
- var via;
- if (this.smoothCurves.dynamic == true && this.smoothCurves.enabled == true) {
- via = this.via;
- }
- else if (this.smoothCurves.enabled == true) {
- via = this._getViaCoordinates();
- }
-
- if (this.smoothCurves.enabled == true && via.x != null) {
- angle = Math.atan2((this.to.y - via.y), (this.to.x - via.x));
- dx = (this.to.x - via.x);
- dy = (this.to.y - via.y);
- edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
- }
- var toBorderDist = this.to.distanceToBorder(ctx, angle);
- var toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;
-
- var xTo,yTo;
- if (this.smoothCurves.enabled == true && via.x != null) {
- xTo = (1 - toBorderPoint) * via.x + toBorderPoint * this.to.x;
- yTo = (1 - toBorderPoint) * via.y + toBorderPoint * this.to.y;
- }
- else {
- xTo = (1 - toBorderPoint) * this.from.x + toBorderPoint * this.to.x;
- yTo = (1 - toBorderPoint) * this.from.y + toBorderPoint * this.to.y;
- }
-
- return {from:{x:xFrom,y:yFrom},to:{x:xTo,y:yTo}};
- };
-
- module.exports = Edge;
-
-/***/ },
-/* 28 */
-/***/ function(module, exports, __webpack_require__) {
+ Edge.prototype._drawDashLine = function(ctx) {
+ // set style
+ if (this.selected == true) {ctx.strokeStyle = this.color.highlight;}
+ else if (this.hover == true) {ctx.strokeStyle = this.color.hover;}
+ else {ctx.strokeStyle = this.color.color;}
- var util = __webpack_require__(1);
+ ctx.lineWidth = this._getLineWidth();
- /**
- * @class Groups
- * This class can store groups and properties specific for groups.
- */
- function Groups() {
- this.clear();
- this.defaultIndex = 0;
- }
+ var via = null;
+ // only firefox and chrome support this method, else we use the legacy one.
+ if (ctx.mozDash !== undefined || ctx.setLineDash !== undefined) {
+ // configure the dash pattern
+ var pattern = [0];
+ if (this.dash.length !== undefined && this.dash.gap !== undefined) {
+ pattern = [this.dash.length,this.dash.gap];
+ }
+ else {
+ pattern = [5,5];
+ }
+ // set dash settings for chrome or firefox
+ if (typeof ctx.setLineDash !== 'undefined') { //Chrome
+ ctx.setLineDash(pattern);
+ ctx.lineDashOffset = 0;
- /**
- * default constants for group colors
- */
- Groups.DEFAULT = [
- {border: "#2B7CE9", background: "#97C2FC", highlight: {border: "#2B7CE9", background: "#D2E5FF"}, hover: {border: "#2B7CE9", background: "#D2E5FF"}}, // blue
- {border: "#FFA500", background: "#FFFF00", highlight: {border: "#FFA500", background: "#FFFFA3"}, hover: {border: "#FFA500", background: "#FFFFA3"}}, // yellow
- {border: "#FA0A10", background: "#FB7E81", highlight: {border: "#FA0A10", background: "#FFAFB1"}, hover: {border: "#FA0A10", background: "#FFAFB1"}}, // red
- {border: "#41A906", background: "#7BE141", highlight: {border: "#41A906", background: "#A1EC76"}, hover: {border: "#41A906", background: "#A1EC76"}}, // green
- {border: "#E129F0", background: "#EB7DF4", highlight: {border: "#E129F0", background: "#F0B3F5"}, hover: {border: "#E129F0", background: "#F0B3F5"}}, // magenta
- {border: "#7C29F0", background: "#AD85E4", highlight: {border: "#7C29F0", background: "#D3BDF0"}, hover: {border: "#7C29F0", background: "#D3BDF0"}}, // purple
- {border: "#C37F00", background: "#FFA807", highlight: {border: "#C37F00", background: "#FFCA66"}, hover: {border: "#C37F00", background: "#FFCA66"}}, // orange
- {border: "#4220FB", background: "#6E6EFD", highlight: {border: "#4220FB", background: "#9B9BFD"}, hover: {border: "#4220FB", background: "#9B9BFD"}}, // darkblue
- {border: "#FD5A77", background: "#FFC0CB", highlight: {border: "#FD5A77", background: "#FFD1D9"}, hover: {border: "#FD5A77", background: "#FFD1D9"}}, // pink
- {border: "#4AD63A", background: "#C2FABC", highlight: {border: "#4AD63A", background: "#E6FFE3"}, hover: {border: "#4AD63A", background: "#E6FFE3"}} // mint
- ];
+ } else { //Firefox
+ ctx.mozDash = pattern;
+ ctx.mozDashOffset = 0;
+ }
+ // draw the line
+ via = this._line(ctx);
- /**
- * Clear all groups
- */
- Groups.prototype.clear = function () {
- this.groups = {};
- this.groups.length = function()
- {
- var i = 0;
- for ( var p in this ) {
- if (this.hasOwnProperty(p)) {
- i++;
- }
+ // restore the dash settings.
+ if (typeof ctx.setLineDash !== 'undefined') { //Chrome
+ ctx.setLineDash([0]);
+ ctx.lineDashOffset = 0;
+
+ } else { //Firefox
+ ctx.mozDash = [0];
+ ctx.mozDashOffset = 0;
}
- return i;
}
- };
+ else { // unsupporting smooth lines
+ // draw dashed line
+ ctx.beginPath();
+ ctx.lineCap = 'round';
+ if (this.dash.altLength !== undefined) //If an alt dash value has been set add to the array this value
+ {
+ ctx.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,
+ [this.dash.length,this.dash.gap,this.dash.altLength,this.dash.gap]);
+ }
+ else if (this.dash.length !== undefined && this.dash.gap !== undefined) //If a dash and gap value has been set add to the array this value
+ {
+ ctx.dashedLine(this.from.x,this.from.y,this.to.x,this.to.y,
+ [this.dash.length,this.dash.gap]);
+ }
+ else //If all else fails draw a line
+ {
+ ctx.moveTo(this.from.x, this.from.y);
+ ctx.lineTo(this.to.x, this.to.y);
+ }
+ ctx.stroke();
+ }
+ // draw label
+ if (this.label) {
+ var point;
+ if (this.smoothCurves.enabled == true && via != null) {
+ var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
+ var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
+ point = {x:midpointX, y:midpointY};
+ }
+ else {
+ point = this._pointOnLine(0.5);
+ }
+ this._label(ctx, this.label, point.x, point.y);
+ }
+ };
/**
- * get group properties of a groupname. If groupname is not found, a new group
- * is added.
- * @param {*} groupname Can be a number, string, Date, etc.
- * @return {Object} group The created group, containing all group properties
+ * Get a point on a line
+ * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
+ * @return {Object} point
+ * @private
*/
- Groups.prototype.get = function (groupname) {
- var group = this.groups[groupname];
-
- if (group == undefined) {
- // create new group
- var index = this.defaultIndex % Groups.DEFAULT.length;
- this.defaultIndex++;
- group = {};
- group.color = Groups.DEFAULT[index];
- this.groups[groupname] = group;
+ Edge.prototype._pointOnLine = function (percentage) {
+ return {
+ x: (1 - percentage) * this.from.x + percentage * this.to.x,
+ y: (1 - percentage) * this.from.y + percentage * this.to.y
}
-
- return group;
};
/**
- * Add a custom group style
- * @param {String} groupname
- * @param {Object} style An object containing borderColor,
- * backgroundColor, etc.
- * @return {Object} group The created group object
+ * Get a point on a circle
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} radius
+ * @param {Number} percentage. Value between 0 (line start) and 1 (line end)
+ * @return {Object} point
+ * @private
*/
- Groups.prototype.add = function (groupname, style) {
- this.groups[groupname] = style;
- if (style.color) {
- style.color = util.parseColor(style.color);
+ Edge.prototype._pointOnCircle = function (x, y, radius, percentage) {
+ var angle = (percentage - 3/8) * 2 * Math.PI;
+ return {
+ x: x + radius * Math.cos(angle),
+ y: y - radius * Math.sin(angle)
}
- return style;
};
- module.exports = Groups;
-
-
-/***/ },
-/* 29 */
-/***/ function(module, exports, __webpack_require__) {
-
/**
- * @class Images
- * This class loads images and keeps them stored.
+ * Redraw a edge as a line with an arrow halfway the line
+ * Draw this edge in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
*/
- function Images() {
- this.images = {};
+ Edge.prototype._drawArrowCenter = function(ctx) {
+ var point;
+ // set style
+ if (this.selected == true) {ctx.strokeStyle = this.color.highlight; ctx.fillStyle = this.color.highlight;}
+ else if (this.hover == true) {ctx.strokeStyle = this.color.hover; ctx.fillStyle = this.color.hover;}
+ else {ctx.strokeStyle = this.color.color; ctx.fillStyle = this.color.color;}
+ ctx.lineWidth = this._getLineWidth();
- this.callback = undefined;
- }
+ if (this.from != this.to) {
+ // draw line
+ var via = this._line(ctx);
- /**
- * Set an onload callback function. This will be called each time an image
- * is loaded
- * @param {function} callback
- */
- Images.prototype.setOnloadCallback = function(callback) {
- this.callback = callback;
- };
+ var angle = Math.atan2((this.to.y - this.from.y), (this.to.x - this.from.x));
+ var length = (10 + 5 * this.width) * this.arrowScaleFactor;
+ // draw an arrow halfway the line
+ if (this.smoothCurves.enabled == true && via != null) {
+ var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
+ var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
+ point = {x:midpointX, y:midpointY};
+ }
+ else {
+ point = this._pointOnLine(0.5);
+ }
- /**
- *
- * @param {string} url Url of the image
- * @return {Image} img The image object
- */
- Images.prototype.load = function(url) {
- var img = this.images[url];
- if (img == undefined) {
- // create the image
- var images = this;
- img = new Image();
- this.images[url] = img;
- img.onload = function() {
- if (images.callback) {
- images.callback(this);
- }
- };
- img.src = url;
- }
+ ctx.arrow(point.x, point.y, angle, length);
+ ctx.fill();
+ ctx.stroke();
- return img;
- };
+ // draw label
+ if (this.label) {
+ this._label(ctx, this.label, point.x, point.y);
+ }
+ }
+ else {
+ // draw circle
+ var x, y;
+ var radius = 0.25 * Math.max(100,this.length);
+ var node = this.from;
+ if (!node.width) {
+ node.resize(ctx);
+ }
+ if (node.width > node.height) {
+ x = node.x + node.width * 0.5;
+ y = node.y - radius;
+ }
+ else {
+ x = node.x + radius;
+ y = node.y - node.height * 0.5;
+ }
+ this._circle(ctx, x, y, radius);
- module.exports = Images;
+ // draw all arrows
+ var angle = 0.2 * Math.PI;
+ var length = (10 + 5 * this.width) * this.arrowScaleFactor;
+ point = this._pointOnCircle(x, y, radius, 0.5);
+ ctx.arrow(point.x, point.y, angle, length);
+ ctx.fill();
+ ctx.stroke();
+ // draw label
+ if (this.label) {
+ point = this._pointOnCircle(x, y, radius, 0.5);
+ this._label(ctx, this.label, point.x, point.y);
+ }
+ }
+ };
-/***/ },
-/* 30 */
-/***/ function(module, exports, __webpack_require__) {
- var util = __webpack_require__(1);
/**
- * @class Node
- * A node. A node can be connected to other nodes via one or multiple edges.
- * @param {object} properties An object containing properties for the node. All
- * properties are optional, except for the id.
- * {number} id Id of the node. Required
- * {string} label Text label for the node
- * {number} x Horizontal position of the node
- * {number} y Vertical position of the node
- * {string} shape Node shape, available:
- * "database", "circle", "ellipse",
- * "box", "image", "text", "dot",
- * "star", "triangle", "triangleDown",
- * "square"
- * {string} image An image url
- * {string} title An title text, can be HTML
- * {anytype} group A group name or number
- * @param {Network.Images} imagelist A list with images. Only needed
- * when the node has an image
- * @param {Network.Groups} grouplist A list with groups. Needed for
- * retrieving group properties
- * @param {Object} constants An object with default values for
- * example for the color
- *
- */
- function Node(properties, imagelist, grouplist, constants) {
- this.selected = false;
- this.hover = false;
-
- this.edges = []; // all edges connected to this node
- this.dynamicEdges = [];
- this.reroutedEdges = {};
+ * Redraw a edge as a line with an arrow
+ * Draw this edge in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ * @private
+ */
+ Edge.prototype._drawArrow = function(ctx) {
+ // set style
+ if (this.selected == true) {ctx.strokeStyle = this.color.highlight; ctx.fillStyle = this.color.highlight;}
+ else if (this.hover == true) {ctx.strokeStyle = this.color.hover; ctx.fillStyle = this.color.hover;}
+ else {ctx.strokeStyle = this.color.color; ctx.fillStyle = this.color.color;}
- this.group = constants.nodes.group;
- this.fontSize = Number(constants.nodes.fontSize);
- this.fontFace = constants.nodes.fontFace;
- this.fontColor = constants.nodes.fontColor;
- this.fontDrawThreshold = 3;
+ ctx.lineWidth = this._getLineWidth();
- this.color = constants.nodes.color;
+ var angle, length;
+ //draw a line
+ if (this.from != this.to) {
+ angle = Math.atan2((this.to.y - this.from.y), (this.to.x - this.from.x));
+ var dx = (this.to.x - this.from.x);
+ var dy = (this.to.y - this.from.y);
+ var edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
- // set defaults for the properties
- this.id = undefined;
- this.shape = constants.nodes.shape;
- this.image = constants.nodes.image;
- this.x = null;
- this.y = null;
- this.xFixed = false;
- this.yFixed = false;
- this.horizontalAlignLeft = true; // these are for the navigation controls
- this.verticalAlignTop = true; // these are for the navigation controls
- this.radius = constants.nodes.radius;
- this.baseRadiusValue = constants.nodes.radius;
- this.radiusFixed = false;
- this.radiusMin = constants.nodes.radiusMin;
- this.radiusMax = constants.nodes.radiusMax;
- this.level = -1;
- this.preassignedLevel = false;
+ var fromBorderDist = this.from.distanceToBorder(ctx, angle + Math.PI);
+ var fromBorderPoint = (edgeSegmentLength - fromBorderDist) / edgeSegmentLength;
+ var xFrom = (fromBorderPoint) * this.from.x + (1 - fromBorderPoint) * this.to.x;
+ var yFrom = (fromBorderPoint) * this.from.y + (1 - fromBorderPoint) * this.to.y;
+ var via;
+ if (this.smoothCurves.dynamic == true && this.smoothCurves.enabled == true ) {
+ via = this.via;
+ }
+ else if (this.smoothCurves.enabled == true) {
+ via = this._getViaCoordinates();
+ }
- this.imagelist = imagelist;
- this.grouplist = grouplist;
+ if (this.smoothCurves.enabled == true && via.x != null) {
+ angle = Math.atan2((this.to.y - via.y), (this.to.x - via.x));
+ dx = (this.to.x - via.x);
+ dy = (this.to.y - via.y);
+ edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
+ }
+ var toBorderDist = this.to.distanceToBorder(ctx, angle);
+ var toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;
- // physics properties
- this.fx = 0.0; // external force x
- this.fy = 0.0; // external force y
- this.vx = 0.0; // velocity x
- this.vy = 0.0; // velocity y
- this.minForce = constants.minForce;
- this.damping = constants.physics.damping;
- this.mass = 1; // kg
- this.fixedData = {x:null,y:null};
+ var xTo,yTo;
+ if (this.smoothCurves.enabled == true && via.x != null) {
+ xTo = (1 - toBorderPoint) * via.x + toBorderPoint * this.to.x;
+ yTo = (1 - toBorderPoint) * via.y + toBorderPoint * this.to.y;
+ }
+ else {
+ xTo = (1 - toBorderPoint) * this.from.x + toBorderPoint * this.to.x;
+ yTo = (1 - toBorderPoint) * this.from.y + toBorderPoint * this.to.y;
+ }
- this.setProperties(properties, constants);
+ ctx.beginPath();
+ ctx.moveTo(xFrom,yFrom);
+ if (this.smoothCurves.enabled == true && via.x != null) {
+ ctx.quadraticCurveTo(via.x,via.y,xTo, yTo);
+ }
+ else {
+ ctx.lineTo(xTo, yTo);
+ }
+ ctx.stroke();
- // creating the variables for clustering
- this.resetCluster();
- this.dynamicEdgesLength = 0;
- this.clusterSession = 0;
- this.clusterSizeWidthFactor = constants.clustering.nodeScaling.width;
- this.clusterSizeHeightFactor = constants.clustering.nodeScaling.height;
- this.clusterSizeRadiusFactor = constants.clustering.nodeScaling.radius;
- this.maxNodeSizeIncrements = constants.clustering.maxNodeSizeIncrements;
- this.growthIndicator = 0;
+ // draw arrow at the end of the line
+ length = (10 + 5 * this.width) * this.arrowScaleFactor;
+ ctx.arrow(xTo, yTo, angle, length);
+ ctx.fill();
+ ctx.stroke();
- // variables to tell the node about the network.
- this.networkScaleInv = 1;
- this.networkScale = 1;
- this.canvasTopLeft = {"x": -300, "y": -300};
- this.canvasBottomRight = {"x": 300, "y": 300};
- this.parentEdgeId = null;
- }
+ // draw label
+ if (this.label) {
+ var point;
+ if (this.smoothCurves.enabled == true && via != null) {
+ var midpointX = 0.5*(0.5*(this.from.x + via.x) + 0.5*(this.to.x + via.x));
+ var midpointY = 0.5*(0.5*(this.from.y + via.y) + 0.5*(this.to.y + via.y));
+ point = {x:midpointX, y:midpointY};
+ }
+ else {
+ point = this._pointOnLine(0.5);
+ }
+ this._label(ctx, this.label, point.x, point.y);
+ }
+ }
+ else {
+ // draw circle
+ var node = this.from;
+ var x, y, arrow;
+ var radius = 0.25 * Math.max(100,this.length);
+ if (!node.width) {
+ node.resize(ctx);
+ }
+ if (node.width > node.height) {
+ x = node.x + node.width * 0.5;
+ y = node.y - radius;
+ arrow = {
+ x: x,
+ y: node.y,
+ angle: 0.9 * Math.PI
+ };
+ }
+ else {
+ x = node.x + radius;
+ y = node.y - node.height * 0.5;
+ arrow = {
+ x: node.x,
+ y: y,
+ angle: 0.6 * Math.PI
+ };
+ }
+ ctx.beginPath();
+ // TODO: similarly, for a line without arrows, draw to the border of the nodes instead of the center
+ ctx.arc(x, y, radius, 0, 2 * Math.PI, false);
+ ctx.stroke();
- /**
- * (re)setting the clustering variables and objects
- */
- Node.prototype.resetCluster = function() {
- // clustering variables
- this.formationScale = undefined; // this is used to determine when to open the cluster
- this.clusterSize = 1; // this signifies the total amount of nodes in this cluster
- this.containedNodes = {};
- this.containedEdges = {};
- this.clusterSessions = [];
- };
+ // draw all arrows
+ var length = (10 + 5 * this.width) * this.arrowScaleFactor;
+ ctx.arrow(arrow.x, arrow.y, arrow.angle, length);
+ ctx.fill();
+ ctx.stroke();
- /**
- * Attach a edge to the node
- * @param {Edge} edge
- */
- Node.prototype.attachEdge = function(edge) {
- if (this.edges.indexOf(edge) == -1) {
- this.edges.push(edge);
- }
- if (this.dynamicEdges.indexOf(edge) == -1) {
- this.dynamicEdges.push(edge);
+ // draw label
+ if (this.label) {
+ point = this._pointOnCircle(x, y, radius, 0.5);
+ this._label(ctx, this.label, point.x, point.y);
+ }
}
- this.dynamicEdgesLength = this.dynamicEdges.length;
};
- /**
- * Detach a edge from the node
- * @param {Edge} edge
- */
- Node.prototype.detachEdge = function(edge) {
- var index = this.edges.indexOf(edge);
- if (index != -1) {
- this.edges.splice(index, 1);
- this.dynamicEdges.splice(index, 1);
- }
- this.dynamicEdgesLength = this.dynamicEdges.length;
- };
/**
- * Set or overwrite properties for the node
- * @param {Object} properties an object with properties
- * @param {Object} constants and object with default, global properties
+ * Calculate the distance between a point (x3,y3) and a line segment from
+ * (x1,y1) to (x2,y2).
+ * http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
+ * @param {number} x1
+ * @param {number} y1
+ * @param {number} x2
+ * @param {number} y2
+ * @param {number} x3
+ * @param {number} y3
+ * @private
*/
- Node.prototype.setProperties = function(properties, constants) {
- if (!properties) {
- return;
- }
- this.originalLabel = undefined;
- // basic properties
- if (properties.id !== undefined) {this.id = properties.id;}
- if (properties.label !== undefined) {this.label = properties.label; this.originalLabel = properties.label;}
- if (properties.title !== undefined) {this.title = properties.title;}
- if (properties.group !== undefined) {this.group = properties.group;}
- if (properties.x !== undefined) {this.x = properties.x;}
- if (properties.y !== undefined) {this.y = properties.y;}
- if (properties.value !== undefined) {this.value = properties.value;}
- if (properties.level !== undefined) {this.level = properties.level; this.preassignedLevel = true;}
-
-
- // physics
- if (properties.mass !== undefined) {this.mass = properties.mass;}
-
- // navigation controls properties
- if (properties.horizontalAlignLeft !== undefined) {this.horizontalAlignLeft = properties.horizontalAlignLeft;}
- if (properties.verticalAlignTop !== undefined) {this.verticalAlignTop = properties.verticalAlignTop;}
- if (properties.triggerFunction !== undefined) {this.triggerFunction = properties.triggerFunction;}
-
- if (this.id === undefined) {
- throw "Node must have an id";
- }
-
- // copy group properties
- if (this.group) {
- var groupObj = this.grouplist.get(this.group);
- for (var prop in groupObj) {
- if (groupObj.hasOwnProperty(prop)) {
- this[prop] = groupObj[prop];
+ Edge.prototype._getDistanceToEdge = function (x1,y1, x2,y2, x3,y3) { // x3,y3 is the point
+ if (this.from != this.to) {
+ if (this.smoothCurves.enabled == true) {
+ var xVia, yVia;
+ if (this.smoothCurves.enabled == true && this.smoothCurves.dynamic == true) {
+ xVia = this.via.x;
+ yVia = this.via.y;
+ }
+ else {
+ var via = this._getViaCoordinates();
+ xVia = via.x;
+ yVia = via.y;
+ }
+ var minDistance = 1e9;
+ var i,t,x,y,dx,dy;
+ for (i = 0; i < 10; i++) {
+ t = 0.1*i;
+ x = Math.pow(1-t,2)*x1 + (2*t*(1 - t))*xVia + Math.pow(t,2)*x2;
+ y = Math.pow(1-t,2)*y1 + (2*t*(1 - t))*yVia + Math.pow(t,2)*y2;
+ dx = Math.abs(x3-x);
+ dy = Math.abs(y3-y);
+ minDistance = Math.min(minDistance,Math.sqrt(dx*dx + dy*dy));
}
+ return minDistance
}
- }
+ else {
+ var px = x2-x1,
+ py = y2-y1,
+ something = px*px + py*py,
+ u = ((x3 - x1) * px + (y3 - y1) * py) / something;
- // individual shape properties
- if (properties.shape !== undefined) {this.shape = properties.shape;}
- if (properties.image !== undefined) {this.image = properties.image;}
- if (properties.radius !== undefined) {this.radius = properties.radius;}
- if (properties.color !== undefined) {this.color = util.parseColor(properties.color);}
+ if (u > 1) {
+ u = 1;
+ }
+ else if (u < 0) {
+ u = 0;
+ }
- if (properties.fontColor !== undefined) {this.fontColor = properties.fontColor;}
- if (properties.fontSize !== undefined) {this.fontSize = properties.fontSize;}
- if (properties.fontFace !== undefined) {this.fontFace = properties.fontFace;}
+ var x = x1 + u * px,
+ y = y1 + u * py,
+ dx = x - x3,
+ dy = y - y3;
- if (this.image !== undefined && this.image != "") {
- if (this.imagelist) {
- this.imageObj = this.imagelist.load(this.image);
+ //# Note: If the actual distance does not matter,
+ //# if you only want to compare what this function
+ //# returns to other results of this function, you
+ //# can just return the squared distance instead
+ //# (i.e. remove the sqrt) to gain a little performance
+
+ return Math.sqrt(dx*dx + dy*dy);
+ }
+ }
+ else {
+ var x, y, dx, dy;
+ var radius = this.length / 4;
+ var node = this.from;
+ if (!node.width) {
+ node.resize(ctx);
+ }
+ if (node.width > node.height) {
+ x = node.x + node.width / 2;
+ y = node.y - radius;
}
else {
- throw "No imagelist provided";
+ x = node.x + radius;
+ y = node.y - node.height / 2;
}
+ dx = x - x3;
+ dy = y - y3;
+ return Math.abs(Math.sqrt(dx*dx + dy*dy) - radius);
}
-
- this.xFixed = this.xFixed || (properties.x !== undefined && !properties.allowedToMoveX);
- this.yFixed = this.yFixed || (properties.y !== undefined && !properties.allowedToMoveY);
- this.radiusFixed = this.radiusFixed || (properties.radius !== undefined);
-
- if (this.shape == 'image') {
- this.radiusMin = constants.nodes.widthMin;
- this.radiusMax = constants.nodes.widthMax;
- }
-
- // choose draw method depending on the shape
- switch (this.shape) {
- case 'database': this.draw = this._drawDatabase; this.resize = this._resizeDatabase; break;
- case 'box': this.draw = this._drawBox; this.resize = this._resizeBox; break;
- case 'circle': this.draw = this._drawCircle; this.resize = this._resizeCircle; break;
- case 'ellipse': this.draw = this._drawEllipse; this.resize = this._resizeEllipse; break;
- // TODO: add diamond shape
- case 'image': this.draw = this._drawImage; this.resize = this._resizeImage; break;
- case 'text': this.draw = this._drawText; this.resize = this._resizeText; break;
- case 'dot': this.draw = this._drawDot; this.resize = this._resizeShape; break;
- case 'square': this.draw = this._drawSquare; this.resize = this._resizeShape; break;
- case 'triangle': this.draw = this._drawTriangle; this.resize = this._resizeShape; break;
- case 'triangleDown': this.draw = this._drawTriangleDown; this.resize = this._resizeShape; break;
- case 'star': this.draw = this._drawStar; this.resize = this._resizeShape; break;
- default: this.draw = this._drawEllipse; this.resize = this._resizeEllipse; break;
- }
- // reset the size of the node, this can be changed
- this._reset();
};
- /**
- * select this node
- */
- Node.prototype.select = function() {
- this.selected = true;
- this._reset();
- };
+
/**
- * unselect this node
+ * This allows the zoom level of the network to influence the rendering
+ *
+ * @param scale
*/
- Node.prototype.unselect = function() {
- this.selected = false;
- this._reset();
+ Edge.prototype.setScale = function(scale) {
+ this.networkScaleInv = 1.0/scale;
};
- /**
- * Reset the calculated size of the node, forces it to recalculate its size
- */
- Node.prototype.clearSizeCache = function() {
- this._reset();
+ Edge.prototype.select = function() {
+ this.selected = true;
};
- /**
- * Reset the calculated size of the node, forces it to recalculate its size
- * @private
- */
- Node.prototype._reset = function() {
- this.width = undefined;
- this.height = undefined;
+ Edge.prototype.unselect = function() {
+ this.selected = false;
};
- /**
- * get the title of this node.
- * @return {string} title The title of the node, or undefined when no title
- * has been set.
- */
- Node.prototype.getTitle = function() {
- return typeof this.title === "function" ? this.title() : this.title;
+ Edge.prototype.positionBezierNode = function() {
+ if (this.via !== null) {
+ this.via.x = 0.5 * (this.from.x + this.to.x);
+ this.via.y = 0.5 * (this.from.y + this.to.y);
+ }
};
/**
- * Calculate the distance to the border of the Node
- * @param {CanvasRenderingContext2D} ctx
- * @param {Number} angle Angle in radians
- * @returns {number} distance Distance to the border in pixels
+ * This function draws the control nodes for the manipulator. In order to enable this, only set the this.controlNodesEnabled to true.
+ * @param ctx
*/
- Node.prototype.distanceToBorder = function (ctx, angle) {
- var borderWidth = 1;
-
- if (!this.width) {
- this.resize(ctx);
- }
-
- switch (this.shape) {
- case 'circle':
- case 'dot':
- return this.radius + borderWidth;
-
- case 'ellipse':
- var a = this.width / 2;
- var b = this.height / 2;
- var w = (Math.sin(angle) * a);
- var h = (Math.cos(angle) * b);
- return a * b / Math.sqrt(w * w + h * h);
-
- // TODO: implement distanceToBorder for database
- // TODO: implement distanceToBorder for triangle
- // TODO: implement distanceToBorder for triangleDown
+ Edge.prototype._drawControlNodes = function(ctx) {
+ if (this.controlNodesEnabled == true) {
+ if (this.controlNodes.from === null && this.controlNodes.to === null) {
+ var nodeIdFrom = "edgeIdFrom:".concat(this.id);
+ var nodeIdTo = "edgeIdTo:".concat(this.id);
+ var constants = {
+ nodes:{group:'', radius:8},
+ physics:{damping:0},
+ clustering: {maxNodeSizeIncrements: 0 ,nodeScaling: {width:0, height: 0, radius:0}}
+ };
+ this.controlNodes.from = new Node(
+ {id:nodeIdFrom,
+ shape:'dot',
+ color:{background:'#ff4e00', border:'#3c3c3c', highlight: {background:'#07f968'}}
+ },{},{},constants);
+ this.controlNodes.to = new Node(
+ {id:nodeIdTo,
+ shape:'dot',
+ color:{background:'#ff4e00', border:'#3c3c3c', highlight: {background:'#07f968'}}
+ },{},{},constants);
+ }
- case 'box':
- case 'image':
- case 'text':
- default:
- if (this.width) {
- return Math.min(
- Math.abs(this.width / 2 / Math.cos(angle)),
- Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
- // TODO: reckon with border radius too in case of box
- }
- else {
- return 0;
- }
+ if (this.controlNodes.from.selected == false && this.controlNodes.to.selected == false) {
+ this.controlNodes.positions = this.getControlNodePositions(ctx);
+ this.controlNodes.from.x = this.controlNodes.positions.from.x;
+ this.controlNodes.from.y = this.controlNodes.positions.from.y;
+ this.controlNodes.to.x = this.controlNodes.positions.to.x;
+ this.controlNodes.to.y = this.controlNodes.positions.to.y;
+ }
+ this.controlNodes.from.draw(ctx);
+ this.controlNodes.to.draw(ctx);
+ }
+ else {
+ this.controlNodes = {from:null, to:null, positions:{}};
}
- // TODO: implement calculation of distance to border for all shapes
};
/**
- * Set forces acting on the node
- * @param {number} fx Force in horizontal direction
- * @param {number} fy Force in vertical direction
+ * Enable control nodes.
+ * @private
*/
- Node.prototype._setForce = function(fx, fy) {
- this.fx = fx;
- this.fy = fy;
+ Edge.prototype._enableControlNodes = function() {
+ this.controlNodesEnabled = true;
};
/**
- * Add forces acting on the node
- * @param {number} fx Force in horizontal direction
- * @param {number} fy Force in vertical direction
+ * disable control nodes
* @private
*/
- Node.prototype._addForce = function(fx, fy) {
- this.fx += fx;
- this.fy += fy;
+ Edge.prototype._disableControlNodes = function() {
+ this.controlNodesEnabled = false;
};
/**
- * Perform one discrete step for the node
- * @param {number} interval Time interval in seconds
+ * This checks if one of the control nodes is selected and if so, returns the control node object. Else it returns null.
+ * @param x
+ * @param y
+ * @returns {null}
+ * @private
*/
- Node.prototype.discreteStep = function(interval) {
- if (!this.xFixed) {
- var dx = this.damping * this.vx; // damping force
- var ax = (this.fx - dx) / this.mass; // acceleration
- this.vx += ax * interval; // velocity
- this.x += this.vx * interval; // position
- }
+ Edge.prototype._getSelectedControlNode = function(x,y) {
+ var positions = this.controlNodes.positions;
+ var fromDistance = Math.sqrt(Math.pow(x - positions.from.x,2) + Math.pow(y - positions.from.y,2));
+ var toDistance = Math.sqrt(Math.pow(x - positions.to.x ,2) + Math.pow(y - positions.to.y ,2));
- if (!this.yFixed) {
- var dy = this.damping * this.vy; // damping force
- var ay = (this.fy - dy) / this.mass; // acceleration
- this.vy += ay * interval; // velocity
- this.y += this.vy * interval; // position
+ if (fromDistance < 15) {
+ this.connectedNode = this.from;
+ this.from = this.controlNodes.from;
+ return this.controlNodes.from;
+ }
+ else if (toDistance < 15) {
+ this.connectedNode = this.to;
+ this.to = this.controlNodes.to;
+ return this.controlNodes.to;
+ }
+ else {
+ return null;
}
};
+ /**
+ * this resets the control nodes to their original position.
+ * @private
+ */
+ Edge.prototype._restoreControlNodes = function() {
+ if (this.controlNodes.from.selected == true) {
+ this.from = this.connectedNode;
+ this.connectedNode = null;
+ this.controlNodes.from.unselect();
+ }
+ if (this.controlNodes.to.selected == true) {
+ this.to = this.connectedNode;
+ this.connectedNode = null;
+ this.controlNodes.to.unselect();
+ }
+ };
/**
- * Perform one discrete step for the node
- * @param {number} interval Time interval in seconds
- * @param {number} maxVelocity The speed limit imposed on the velocity
+ * this calculates the position of the control nodes on the edges of the parent nodes.
+ *
+ * @param ctx
+ * @returns {{from: {x: number, y: number}, to: {x: *, y: *}}}
*/
- Node.prototype.discreteStepLimited = function(interval, maxVelocity) {
- if (!this.xFixed) {
- var dx = this.damping * this.vx; // damping force
- var ax = (this.fx - dx) / this.mass; // acceleration
- this.vx += ax * interval; // velocity
- this.vx = (Math.abs(this.vx) > maxVelocity) ? ((this.vx > 0) ? maxVelocity : -maxVelocity) : this.vx;
- this.x += this.vx * interval; // position
+ Edge.prototype.getControlNodePositions = function(ctx) {
+ var angle = Math.atan2((this.to.y - this.from.y), (this.to.x - this.from.x));
+ var dx = (this.to.x - this.from.x);
+ var dy = (this.to.y - this.from.y);
+ var edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
+ var fromBorderDist = this.from.distanceToBorder(ctx, angle + Math.PI);
+ var fromBorderPoint = (edgeSegmentLength - fromBorderDist) / edgeSegmentLength;
+ var xFrom = (fromBorderPoint) * this.from.x + (1 - fromBorderPoint) * this.to.x;
+ var yFrom = (fromBorderPoint) * this.from.y + (1 - fromBorderPoint) * this.to.y;
+
+ var via;
+ if (this.smoothCurves.dynamic == true && this.smoothCurves.enabled == true) {
+ via = this.via;
}
- else {
- this.fx = 0;
+ else if (this.smoothCurves.enabled == true) {
+ via = this._getViaCoordinates();
}
- if (!this.yFixed) {
- var dy = this.damping * this.vy; // damping force
- var ay = (this.fy - dy) / this.mass; // acceleration
- this.vy += ay * interval; // velocity
- this.vy = (Math.abs(this.vy) > maxVelocity) ? ((this.vy > 0) ? maxVelocity : -maxVelocity) : this.vy;
- this.y += this.vy * interval; // position
+ if (this.smoothCurves.enabled == true && via.x != null) {
+ angle = Math.atan2((this.to.y - via.y), (this.to.x - via.x));
+ dx = (this.to.x - via.x);
+ dy = (this.to.y - via.y);
+ edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
+ }
+ var toBorderDist = this.to.distanceToBorder(ctx, angle);
+ var toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;
+
+ var xTo,yTo;
+ if (this.smoothCurves.enabled == true && via.x != null) {
+ xTo = (1 - toBorderPoint) * via.x + toBorderPoint * this.to.x;
+ yTo = (1 - toBorderPoint) * via.y + toBorderPoint * this.to.y;
}
else {
- this.fy = 0;
+ xTo = (1 - toBorderPoint) * this.from.x + toBorderPoint * this.to.x;
+ yTo = (1 - toBorderPoint) * this.from.y + toBorderPoint * this.to.y;
}
- };
- /**
- * Check if this node has a fixed x and y position
- * @return {boolean} true if fixed, false if not
- */
- Node.prototype.isFixed = function() {
- return (this.xFixed && this.yFixed);
+ return {from:{x:xFrom,y:yFrom},to:{x:xTo,y:yTo}};
};
- /**
- * Check if this node is moving
- * @param {number} vmin the minimum velocity considered as "moving"
- * @return {boolean} true if moving, false if it has no velocity
- */
- // TODO: replace this method with calculating the kinetic energy
- Node.prototype.isMoving = function(vmin) {
- return (Math.abs(this.vx) > vmin || Math.abs(this.vy) > vmin);
- };
+ module.exports = Edge;
- /**
- * check if this node is selecte
- * @return {boolean} selected True if node is selected, else false
- */
- Node.prototype.isSelected = function() {
- return this.selected;
- };
+/***/ },
+/* 28 */
+/***/ function(module, exports, __webpack_require__) {
+
+ var util = __webpack_require__(1);
/**
- * Retrieve the value of the node. Can be undefined
- * @return {Number} value
+ * @class Groups
+ * This class can store groups and properties specific for groups.
*/
- Node.prototype.getValue = function() {
- return this.value;
- };
+ function Groups() {
+ this.clear();
+ this.defaultIndex = 0;
+ }
+
/**
- * Calculate the distance from the nodes location to the given location (x,y)
- * @param {Number} x
- * @param {Number} y
- * @return {Number} value
+ * default constants for group colors
*/
- Node.prototype.getDistance = function(x, y) {
- var dx = this.x - x,
- dy = this.y - y;
- return Math.sqrt(dx * dx + dy * dy);
- };
+ Groups.DEFAULT = [
+ {border: "#2B7CE9", background: "#97C2FC", highlight: {border: "#2B7CE9", background: "#D2E5FF"}, hover: {border: "#2B7CE9", background: "#D2E5FF"}}, // blue
+ {border: "#FFA500", background: "#FFFF00", highlight: {border: "#FFA500", background: "#FFFFA3"}, hover: {border: "#FFA500", background: "#FFFFA3"}}, // yellow
+ {border: "#FA0A10", background: "#FB7E81", highlight: {border: "#FA0A10", background: "#FFAFB1"}, hover: {border: "#FA0A10", background: "#FFAFB1"}}, // red
+ {border: "#41A906", background: "#7BE141", highlight: {border: "#41A906", background: "#A1EC76"}, hover: {border: "#41A906", background: "#A1EC76"}}, // green
+ {border: "#E129F0", background: "#EB7DF4", highlight: {border: "#E129F0", background: "#F0B3F5"}, hover: {border: "#E129F0", background: "#F0B3F5"}}, // magenta
+ {border: "#7C29F0", background: "#AD85E4", highlight: {border: "#7C29F0", background: "#D3BDF0"}, hover: {border: "#7C29F0", background: "#D3BDF0"}}, // purple
+ {border: "#C37F00", background: "#FFA807", highlight: {border: "#C37F00", background: "#FFCA66"}, hover: {border: "#C37F00", background: "#FFCA66"}}, // orange
+ {border: "#4220FB", background: "#6E6EFD", highlight: {border: "#4220FB", background: "#9B9BFD"}, hover: {border: "#4220FB", background: "#9B9BFD"}}, // darkblue
+ {border: "#FD5A77", background: "#FFC0CB", highlight: {border: "#FD5A77", background: "#FFD1D9"}, hover: {border: "#FD5A77", background: "#FFD1D9"}}, // pink
+ {border: "#4AD63A", background: "#C2FABC", highlight: {border: "#4AD63A", background: "#E6FFE3"}, hover: {border: "#4AD63A", background: "#E6FFE3"}} // mint
+ ];
/**
- * Adjust the value range of the node. The node will adjust it's radius
- * based on its value.
- * @param {Number} min
- * @param {Number} max
+ * Clear all groups
*/
- Node.prototype.setValueRange = function(min, max) {
- if (!this.radiusFixed && this.value !== undefined) {
- if (max == min) {
- this.radius = (this.radiusMin + this.radiusMax) / 2;
- }
- else {
- var scale = (this.radiusMax - this.radiusMin) / (max - min);
- this.radius = (this.value - min) * scale + this.radiusMin;
+ Groups.prototype.clear = function () {
+ this.groups = {};
+ this.groups.length = function()
+ {
+ var i = 0;
+ for ( var p in this ) {
+ if (this.hasOwnProperty(p)) {
+ i++;
+ }
}
+ return i;
}
- this.baseRadiusValue = this.radius;
};
- /**
- * Draw this node in the given canvas
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
- * @param {CanvasRenderingContext2D} ctx
- */
- Node.prototype.draw = function(ctx) {
- throw "Draw method not initialized for node";
- };
/**
- * Recalculate the size of this node in the given canvas
- * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
- * @param {CanvasRenderingContext2D} ctx
+ * get group properties of a groupname. If groupname is not found, a new group
+ * is added.
+ * @param {*} groupname Can be a number, string, Date, etc.
+ * @return {Object} group The created group, containing all group properties
*/
- Node.prototype.resize = function(ctx) {
- throw "Resize method not initialized for node";
+ Groups.prototype.get = function (groupname) {
+ var group = this.groups[groupname];
+
+ if (group == undefined) {
+ // create new group
+ var index = this.defaultIndex % Groups.DEFAULT.length;
+ this.defaultIndex++;
+ group = {};
+ group.color = Groups.DEFAULT[index];
+ this.groups[groupname] = group;
+ }
+
+ return group;
};
/**
- * Check if this object is overlapping with the provided object
- * @param {Object} obj an object with parameters left, top, right, bottom
- * @return {boolean} True if location is located on node
+ * Add a custom group style
+ * @param {String} groupname
+ * @param {Object} style An object containing borderColor,
+ * backgroundColor, etc.
+ * @return {Object} group The created group object
*/
- Node.prototype.isOverlappingWith = function(obj) {
- return (this.left < obj.right &&
- this.left + this.width > obj.left &&
- this.top < obj.bottom &&
- this.top + this.height > obj.top);
+ Groups.prototype.add = function (groupname, style) {
+ this.groups[groupname] = style;
+ if (style.color) {
+ style.color = util.parseColor(style.color);
+ }
+ return style;
};
- Node.prototype._resizeImage = function (ctx) {
- // TODO: pre calculate the image size
-
- if (!this.width || !this.height) { // undefined or 0
- var width, height;
- if (this.value) {
- this.radius = this.baseRadiusValue;
- var scale = this.imageObj.height / this.imageObj.width;
- if (scale !== undefined) {
- width = this.radius || this.imageObj.width;
- height = this.radius * scale || this.imageObj.height;
- }
- else {
- width = 0;
- height = 0;
- }
- }
- else {
- width = this.imageObj.width;
- height = this.imageObj.height;
- }
- this.width = width;
- this.height = height;
-
- this.growthIndicator = 0;
- if (this.width > 0 && this.height > 0) {
- this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
- this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
- this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
- this.growthIndicator = this.width - width;
- }
- }
+ module.exports = Groups;
- };
- Node.prototype._drawImage = function (ctx) {
- this._resizeImage(ctx);
+/***/ },
+/* 29 */
+/***/ function(module, exports, __webpack_require__) {
- this.left = this.x - this.width / 2;
- this.top = this.y - this.height / 2;
+ /**
+ * @class Images
+ * This class loads images and keeps them stored.
+ */
+ function Images() {
+ this.images = {};
- var yLabel;
- if (this.imageObj.width != 0 ) {
- // draw the shade
- if (this.clusterSize > 1) {
- var lineWidth = ((this.clusterSize > 1) ? 10 : 0.0);
- lineWidth *= this.networkScaleInv;
- lineWidth = Math.min(0.2 * this.width,lineWidth);
+ this.callback = undefined;
+ }
- ctx.globalAlpha = 0.5;
- ctx.drawImage(this.imageObj, this.left - lineWidth, this.top - lineWidth, this.width + 2*lineWidth, this.height + 2*lineWidth);
- }
+ /**
+ * Set an onload callback function. This will be called each time an image
+ * is loaded
+ * @param {function} callback
+ */
+ Images.prototype.setOnloadCallback = function(callback) {
+ this.callback = callback;
+ };
- // draw the image
- ctx.globalAlpha = 1.0;
- ctx.drawImage(this.imageObj, this.left, this.top, this.width, this.height);
- yLabel = this.y + this.height / 2;
- }
- else {
- // image still loading... just draw the label for now
- yLabel = this.y;
+ /**
+ *
+ * @param {string} url Url of the image
+ * @return {Image} img The image object
+ */
+ Images.prototype.load = function(url) {
+ var img = this.images[url];
+ if (img == undefined) {
+ // create the image
+ var images = this;
+ img = new Image();
+ this.images[url] = img;
+ img.onload = function() {
+ if (images.callback) {
+ images.callback(this);
+ }
+ };
+ img.src = url;
}
- this._label(ctx, this.label, this.x, yLabel, undefined, "top");
+ return img;
};
+ module.exports = Images;
- Node.prototype._resizeBox = function (ctx) {
- if (!this.width) {
- var margin = 5;
- var textSize = this.getTextSize(ctx);
- this.width = textSize.width + 2 * margin;
- this.height = textSize.height + 2 * margin;
- this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeWidthFactor;
- this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeHeightFactor;
- this.growthIndicator = this.width - (textSize.width + 2 * margin);
- // this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeRadiusFactor;
+/***/ },
+/* 30 */
+/***/ function(module, exports, __webpack_require__) {
- }
- };
+ var util = __webpack_require__(1);
- Node.prototype._drawBox = function (ctx) {
- this._resizeBox(ctx);
+ /**
+ * @class Node
+ * A node. A node can be connected to other nodes via one or multiple edges.
+ * @param {object} properties An object containing properties for the node. All
+ * properties are optional, except for the id.
+ * {number} id Id of the node. Required
+ * {string} label Text label for the node
+ * {number} x Horizontal position of the node
+ * {number} y Vertical position of the node
+ * {string} shape Node shape, available:
+ * "database", "circle", "ellipse",
+ * "box", "image", "text", "dot",
+ * "star", "triangle", "triangleDown",
+ * "square"
+ * {string} image An image url
+ * {string} title An title text, can be HTML
+ * {anytype} group A group name or number
+ * @param {Network.Images} imagelist A list with images. Only needed
+ * when the node has an image
+ * @param {Network.Groups} grouplist A list with groups. Needed for
+ * retrieving group properties
+ * @param {Object} constants An object with default values for
+ * example for the color
+ *
+ */
+ function Node(properties, imagelist, grouplist, constants) {
+ this.selected = false;
+ this.hover = false;
- this.left = this.x - this.width / 2;
- this.top = this.y - this.height / 2;
+ this.edges = []; // all edges connected to this node
+ this.dynamicEdges = [];
+ this.reroutedEdges = {};
- var clusterLineWidth = 2.5;
- var selectionLineWidth = 2;
+ this.group = constants.nodes.group;
+ this.fontSize = Number(constants.nodes.fontSize);
+ this.fontFace = constants.nodes.fontFace;
+ this.fontColor = constants.nodes.fontColor;
+ this.fontDrawThreshold = 3;
- ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
+ this.color = constants.nodes.color;
- // draw the outer border
- if (this.clusterSize > 1) {
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+ // set defaults for the properties
+ this.id = undefined;
+ this.shape = constants.nodes.shape;
+ this.image = constants.nodes.image;
+ this.x = null;
+ this.y = null;
+ this.xFixed = false;
+ this.yFixed = false;
+ this.horizontalAlignLeft = true; // these are for the navigation controls
+ this.verticalAlignTop = true; // these are for the navigation controls
+ this.radius = constants.nodes.radius;
+ this.baseRadiusValue = constants.nodes.radius;
+ this.radiusFixed = false;
+ this.radiusMin = constants.nodes.radiusMin;
+ this.radiusMax = constants.nodes.radiusMax;
+ this.level = -1;
+ this.preassignedLevel = false;
- ctx.roundRect(this.left-2*ctx.lineWidth, this.top-2*ctx.lineWidth, this.width+4*ctx.lineWidth, this.height+4*ctx.lineWidth, this.radius);
- ctx.stroke();
- }
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- ctx.fillStyle = this.selected ? this.color.highlight.background : this.color.background;
+ this.imagelist = imagelist;
+ this.grouplist = grouplist;
- ctx.roundRect(this.left, this.top, this.width, this.height, this.radius);
- ctx.fill();
- ctx.stroke();
+ // physics properties
+ this.fx = 0.0; // external force x
+ this.fy = 0.0; // external force y
+ this.vx = 0.0; // velocity x
+ this.vy = 0.0; // velocity y
+ this.minForce = constants.minForce;
+ this.damping = constants.physics.damping;
+ this.mass = 1; // kg
+ this.fixedData = {x:null,y:null};
- this._label(ctx, this.label, this.x, this.y);
- };
+ this.setProperties(properties, constants);
+ // creating the variables for clustering
+ this.resetCluster();
+ this.dynamicEdgesLength = 0;
+ this.clusterSession = 0;
+ this.clusterSizeWidthFactor = constants.clustering.nodeScaling.width;
+ this.clusterSizeHeightFactor = constants.clustering.nodeScaling.height;
+ this.clusterSizeRadiusFactor = constants.clustering.nodeScaling.radius;
+ this.maxNodeSizeIncrements = constants.clustering.maxNodeSizeIncrements;
+ this.growthIndicator = 0;
- Node.prototype._resizeDatabase = function (ctx) {
- if (!this.width) {
- var margin = 5;
- var textSize = this.getTextSize(ctx);
- var size = textSize.width + 2 * margin;
- this.width = size;
- this.height = size;
+ // variables to tell the node about the network.
+ this.networkScaleInv = 1;
+ this.networkScale = 1;
+ this.canvasTopLeft = {"x": -300, "y": -300};
+ this.canvasBottomRight = {"x": 300, "y": 300};
+ this.parentEdgeId = null;
+ }
- // scaling used for clustering
- this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
- this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
- this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
- this.growthIndicator = this.width - size;
- }
+ /**
+ * (re)setting the clustering variables and objects
+ */
+ Node.prototype.resetCluster = function() {
+ // clustering variables
+ this.formationScale = undefined; // this is used to determine when to open the cluster
+ this.clusterSize = 1; // this signifies the total amount of nodes in this cluster
+ this.containedNodes = {};
+ this.containedEdges = {};
+ this.clusterSessions = [];
};
- Node.prototype._drawDatabase = function (ctx) {
- this._resizeDatabase(ctx);
- this.left = this.x - this.width / 2;
- this.top = this.y - this.height / 2;
-
- var clusterLineWidth = 2.5;
- var selectionLineWidth = 2;
+ /**
+ * Attach a edge to the node
+ * @param {Edge} edge
+ */
+ Node.prototype.attachEdge = function(edge) {
+ if (this.edges.indexOf(edge) == -1) {
+ this.edges.push(edge);
+ }
+ if (this.dynamicEdges.indexOf(edge) == -1) {
+ this.dynamicEdges.push(edge);
+ }
+ this.dynamicEdgesLength = this.dynamicEdges.length;
+ };
- ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
+ /**
+ * Detach a edge from the node
+ * @param {Edge} edge
+ */
+ Node.prototype.detachEdge = function(edge) {
+ var index = this.edges.indexOf(edge);
+ if (index != -1) {
+ this.edges.splice(index, 1);
+ this.dynamicEdges.splice(index, 1);
+ }
+ this.dynamicEdgesLength = this.dynamicEdges.length;
+ };
- // draw the outer border
- if (this.clusterSize > 1) {
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- ctx.database(this.x - this.width/2 - 2*ctx.lineWidth, this.y - this.height*0.5 - 2*ctx.lineWidth, this.width + 4*ctx.lineWidth, this.height + 4*ctx.lineWidth);
- ctx.stroke();
+ /**
+ * Set or overwrite properties for the node
+ * @param {Object} properties an object with properties
+ * @param {Object} constants and object with default, global properties
+ */
+ Node.prototype.setProperties = function(properties, constants) {
+ if (!properties) {
+ return;
}
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
-
- ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
- ctx.database(this.x - this.width/2, this.y - this.height*0.5, this.width, this.height);
- ctx.fill();
- ctx.stroke();
+ this.originalLabel = undefined;
+ // basic properties
+ if (properties.id !== undefined) {this.id = properties.id;}
+ if (properties.label !== undefined) {this.label = properties.label; this.originalLabel = properties.label;}
+ if (properties.title !== undefined) {this.title = properties.title;}
+ if (properties.group !== undefined) {this.group = properties.group;}
+ if (properties.x !== undefined) {this.x = properties.x;}
+ if (properties.y !== undefined) {this.y = properties.y;}
+ if (properties.value !== undefined) {this.value = properties.value;}
+ if (properties.level !== undefined) {this.level = properties.level; this.preassignedLevel = true;}
- this._label(ctx, this.label, this.x, this.y);
- };
+ // physics
+ if (properties.mass !== undefined) {this.mass = properties.mass;}
- Node.prototype._resizeCircle = function (ctx) {
- if (!this.width) {
- var margin = 5;
- var textSize = this.getTextSize(ctx);
- var diameter = Math.max(textSize.width, textSize.height) + 2 * margin;
- this.radius = diameter / 2;
+ // navigation controls properties
+ if (properties.horizontalAlignLeft !== undefined) {this.horizontalAlignLeft = properties.horizontalAlignLeft;}
+ if (properties.verticalAlignTop !== undefined) {this.verticalAlignTop = properties.verticalAlignTop;}
+ if (properties.triggerFunction !== undefined) {this.triggerFunction = properties.triggerFunction;}
- this.width = diameter;
- this.height = diameter;
+ if (this.id === undefined) {
+ throw "Node must have an id";
+ }
- // scaling used for clustering
- // this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeWidthFactor;
- // this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeHeightFactor;
- this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeRadiusFactor;
- this.growthIndicator = this.radius - 0.5*diameter;
+ // copy group properties
+ if (this.group) {
+ var groupObj = this.grouplist.get(this.group);
+ for (var prop in groupObj) {
+ if (groupObj.hasOwnProperty(prop)) {
+ this[prop] = groupObj[prop];
+ }
+ }
}
- };
- Node.prototype._drawCircle = function (ctx) {
- this._resizeCircle(ctx);
- this.left = this.x - this.width / 2;
- this.top = this.y - this.height / 2;
+ // individual shape properties
+ if (properties.shape !== undefined) {this.shape = properties.shape;}
+ if (properties.image !== undefined) {this.image = properties.image;}
+ if (properties.radius !== undefined) {this.radius = properties.radius;}
+ if (properties.color !== undefined) {this.color = util.parseColor(properties.color);}
- var clusterLineWidth = 2.5;
- var selectionLineWidth = 2;
+ if (properties.fontColor !== undefined) {this.fontColor = properties.fontColor;}
+ if (properties.fontSize !== undefined) {this.fontSize = properties.fontSize;}
+ if (properties.fontFace !== undefined) {this.fontFace = properties.fontFace;}
- ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
+ if (this.image !== undefined && this.image != "") {
+ if (this.imagelist) {
+ this.imageObj = this.imagelist.load(this.image);
+ }
+ else {
+ throw "No imagelist provided";
+ }
+ }
- // draw the outer border
- if (this.clusterSize > 1) {
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+ this.xFixed = this.xFixed || (properties.x !== undefined && !properties.allowedToMoveX);
+ this.yFixed = this.yFixed || (properties.y !== undefined && !properties.allowedToMoveY);
+ this.radiusFixed = this.radiusFixed || (properties.radius !== undefined);
- ctx.circle(this.x, this.y, this.radius+2*ctx.lineWidth);
- ctx.stroke();
+ if (this.shape == 'image') {
+ this.radiusMin = constants.nodes.widthMin;
+ this.radiusMax = constants.nodes.widthMax;
}
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
- ctx.circle(this.x, this.y, this.radius);
- ctx.fill();
- ctx.stroke();
+ // choose draw method depending on the shape
+ switch (this.shape) {
+ case 'database': this.draw = this._drawDatabase; this.resize = this._resizeDatabase; break;
+ case 'box': this.draw = this._drawBox; this.resize = this._resizeBox; break;
+ case 'circle': this.draw = this._drawCircle; this.resize = this._resizeCircle; break;
+ case 'ellipse': this.draw = this._drawEllipse; this.resize = this._resizeEllipse; break;
+ // TODO: add diamond shape
+ case 'image': this.draw = this._drawImage; this.resize = this._resizeImage; break;
+ case 'text': this.draw = this._drawText; this.resize = this._resizeText; break;
+ case 'dot': this.draw = this._drawDot; this.resize = this._resizeShape; break;
+ case 'square': this.draw = this._drawSquare; this.resize = this._resizeShape; break;
+ case 'triangle': this.draw = this._drawTriangle; this.resize = this._resizeShape; break;
+ case 'triangleDown': this.draw = this._drawTriangleDown; this.resize = this._resizeShape; break;
+ case 'star': this.draw = this._drawStar; this.resize = this._resizeShape; break;
+ default: this.draw = this._drawEllipse; this.resize = this._resizeEllipse; break;
+ }
+ // reset the size of the node, this can be changed
+ this._reset();
+ };
- this._label(ctx, this.label, this.x, this.y);
+ /**
+ * select this node
+ */
+ Node.prototype.select = function() {
+ this.selected = true;
+ this._reset();
};
- Node.prototype._resizeEllipse = function (ctx) {
- if (!this.width) {
- var textSize = this.getTextSize(ctx);
+ /**
+ * unselect this node
+ */
+ Node.prototype.unselect = function() {
+ this.selected = false;
+ this._reset();
+ };
- this.width = textSize.width * 1.5;
- this.height = textSize.height * 2;
- if (this.width < this.height) {
- this.width = this.height;
- }
- var defaultSize = this.width;
- // scaling used for clustering
- this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
- this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
- this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
- this.growthIndicator = this.width - defaultSize;
- }
+ /**
+ * Reset the calculated size of the node, forces it to recalculate its size
+ */
+ Node.prototype.clearSizeCache = function() {
+ this._reset();
};
- Node.prototype._drawEllipse = function (ctx) {
- this._resizeEllipse(ctx);
- this.left = this.x - this.width / 2;
- this.top = this.y - this.height / 2;
-
- var clusterLineWidth = 2.5;
- var selectionLineWidth = 2;
+ /**
+ * Reset the calculated size of the node, forces it to recalculate its size
+ * @private
+ */
+ Node.prototype._reset = function() {
+ this.width = undefined;
+ this.height = undefined;
+ };
- ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
+ /**
+ * get the title of this node.
+ * @return {string} title The title of the node, or undefined when no title
+ * has been set.
+ */
+ Node.prototype.getTitle = function() {
+ return typeof this.title === "function" ? this.title() : this.title;
+ };
- // draw the outer border
- if (this.clusterSize > 1) {
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+ /**
+ * Calculate the distance to the border of the Node
+ * @param {CanvasRenderingContext2D} ctx
+ * @param {Number} angle Angle in radians
+ * @returns {number} distance Distance to the border in pixels
+ */
+ Node.prototype.distanceToBorder = function (ctx, angle) {
+ var borderWidth = 1;
- ctx.ellipse(this.left-2*ctx.lineWidth, this.top-2*ctx.lineWidth, this.width+4*ctx.lineWidth, this.height+4*ctx.lineWidth);
- ctx.stroke();
+ if (!this.width) {
+ this.resize(ctx);
}
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
+ switch (this.shape) {
+ case 'circle':
+ case 'dot':
+ return this.radius + borderWidth;
- ctx.ellipse(this.left, this.top, this.width, this.height);
- ctx.fill();
- ctx.stroke();
- this._label(ctx, this.label, this.x, this.y);
- };
+ case 'ellipse':
+ var a = this.width / 2;
+ var b = this.height / 2;
+ var w = (Math.sin(angle) * a);
+ var h = (Math.cos(angle) * b);
+ return a * b / Math.sqrt(w * w + h * h);
- Node.prototype._drawDot = function (ctx) {
- this._drawShape(ctx, 'circle');
- };
+ // TODO: implement distanceToBorder for database
+ // TODO: implement distanceToBorder for triangle
+ // TODO: implement distanceToBorder for triangleDown
- Node.prototype._drawTriangle = function (ctx) {
- this._drawShape(ctx, 'triangle');
- };
+ case 'box':
+ case 'image':
+ case 'text':
+ default:
+ if (this.width) {
+ return Math.min(
+ Math.abs(this.width / 2 / Math.cos(angle)),
+ Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
+ // TODO: reckon with border radius too in case of box
+ }
+ else {
+ return 0;
+ }
- Node.prototype._drawTriangleDown = function (ctx) {
- this._drawShape(ctx, 'triangleDown');
+ }
+ // TODO: implement calculation of distance to border for all shapes
};
- Node.prototype._drawSquare = function (ctx) {
- this._drawShape(ctx, 'square');
+ /**
+ * Set forces acting on the node
+ * @param {number} fx Force in horizontal direction
+ * @param {number} fy Force in vertical direction
+ */
+ Node.prototype._setForce = function(fx, fy) {
+ this.fx = fx;
+ this.fy = fy;
};
- Node.prototype._drawStar = function (ctx) {
- this._drawShape(ctx, 'star');
+ /**
+ * Add forces acting on the node
+ * @param {number} fx Force in horizontal direction
+ * @param {number} fy Force in vertical direction
+ * @private
+ */
+ Node.prototype._addForce = function(fx, fy) {
+ this.fx += fx;
+ this.fy += fy;
};
- Node.prototype._resizeShape = function (ctx) {
- if (!this.width) {
- this.radius = this.baseRadiusValue;
- var size = 2 * this.radius;
- this.width = size;
- this.height = size;
+ /**
+ * Perform one discrete step for the node
+ * @param {number} interval Time interval in seconds
+ */
+ Node.prototype.discreteStep = function(interval) {
+ if (!this.xFixed) {
+ var dx = this.damping * this.vx; // damping force
+ var ax = (this.fx - dx) / this.mass; // acceleration
+ this.vx += ax * interval; // velocity
+ this.x += this.vx * interval; // position
+ }
- // scaling used for clustering
- this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
- this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
- this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeRadiusFactor;
- this.growthIndicator = this.width - size;
+ if (!this.yFixed) {
+ var dy = this.damping * this.vy; // damping force
+ var ay = (this.fy - dy) / this.mass; // acceleration
+ this.vy += ay * interval; // velocity
+ this.y += this.vy * interval; // position
}
};
- Node.prototype._drawShape = function (ctx, shape) {
- this._resizeShape(ctx);
- this.left = this.x - this.width / 2;
- this.top = this.y - this.height / 2;
- var clusterLineWidth = 2.5;
- var selectionLineWidth = 2;
- var radiusMultiplier = 2;
+ /**
+ * Perform one discrete step for the node
+ * @param {number} interval Time interval in seconds
+ * @param {number} maxVelocity The speed limit imposed on the velocity
+ */
+ Node.prototype.discreteStepLimited = function(interval, maxVelocity) {
+ if (!this.xFixed) {
+ var dx = this.damping * this.vx; // damping force
+ var ax = (this.fx - dx) / this.mass; // acceleration
+ this.vx += ax * interval; // velocity
+ this.vx = (Math.abs(this.vx) > maxVelocity) ? ((this.vx > 0) ? maxVelocity : -maxVelocity) : this.vx;
+ this.x += this.vx * interval; // position
+ }
+ else {
+ this.fx = 0;
+ }
- // choose draw method depending on the shape
- switch (shape) {
- case 'dot': radiusMultiplier = 2; break;
- case 'square': radiusMultiplier = 2; break;
- case 'triangle': radiusMultiplier = 3; break;
- case 'triangleDown': radiusMultiplier = 3; break;
- case 'star': radiusMultiplier = 4; break;
+ if (!this.yFixed) {
+ var dy = this.damping * this.vy; // damping force
+ var ay = (this.fy - dy) / this.mass; // acceleration
+ this.vy += ay * interval; // velocity
+ this.vy = (Math.abs(this.vy) > maxVelocity) ? ((this.vy > 0) ? maxVelocity : -maxVelocity) : this.vy;
+ this.y += this.vy * interval; // position
+ }
+ else {
+ this.fy = 0;
}
+ };
- ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
+ /**
+ * Check if this node has a fixed x and y position
+ * @return {boolean} true if fixed, false if not
+ */
+ Node.prototype.isFixed = function() {
+ return (this.xFixed && this.yFixed);
+ };
- // draw the outer border
- if (this.clusterSize > 1) {
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+ /**
+ * Check if this node is moving
+ * @param {number} vmin the minimum velocity considered as "moving"
+ * @return {boolean} true if moving, false if it has no velocity
+ */
+ // TODO: replace this method with calculating the kinetic energy
+ Node.prototype.isMoving = function(vmin) {
+ return (Math.abs(this.vx) > vmin || Math.abs(this.vy) > vmin);
+ };
- ctx[shape](this.x, this.y, this.radius + radiusMultiplier * ctx.lineWidth);
- ctx.stroke();
- }
- ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
- ctx.lineWidth *= this.networkScaleInv;
- ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+ /**
+ * check if this node is selecte
+ * @return {boolean} selected True if node is selected, else false
+ */
+ Node.prototype.isSelected = function() {
+ return this.selected;
+ };
- ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
- ctx[shape](this.x, this.y, this.radius);
- ctx.fill();
- ctx.stroke();
+ /**
+ * Retrieve the value of the node. Can be undefined
+ * @return {Number} value
+ */
+ Node.prototype.getValue = function() {
+ return this.value;
+ };
- if (this.label) {
- this._label(ctx, this.label, this.x, this.y + this.height / 2, undefined, 'top',true);
- }
+ /**
+ * Calculate the distance from the nodes location to the given location (x,y)
+ * @param {Number} x
+ * @param {Number} y
+ * @return {Number} value
+ */
+ Node.prototype.getDistance = function(x, y) {
+ var dx = this.x - x,
+ dy = this.y - y;
+ return Math.sqrt(dx * dx + dy * dy);
};
- Node.prototype._resizeText = function (ctx) {
- if (!this.width) {
- var margin = 5;
- var textSize = this.getTextSize(ctx);
- this.width = textSize.width + 2 * margin;
- this.height = textSize.height + 2 * margin;
- // scaling used for clustering
- this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
- this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
- this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
- this.growthIndicator = this.width - (textSize.width + 2 * margin);
+ /**
+ * Adjust the value range of the node. The node will adjust it's radius
+ * based on its value.
+ * @param {Number} min
+ * @param {Number} max
+ */
+ Node.prototype.setValueRange = function(min, max) {
+ if (!this.radiusFixed && this.value !== undefined) {
+ if (max == min) {
+ this.radius = (this.radiusMin + this.radiusMax) / 2;
+ }
+ else {
+ var scale = (this.radiusMax - this.radiusMin) / (max - min);
+ this.radius = (this.value - min) * scale + this.radiusMin;
+ }
}
+ this.baseRadiusValue = this.radius;
};
- Node.prototype._drawText = function (ctx) {
- this._resizeText(ctx);
- this.left = this.x - this.width / 2;
- this.top = this.y - this.height / 2;
+ /**
+ * Draw this node in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+ Node.prototype.draw = function(ctx) {
+ throw "Draw method not initialized for node";
+ };
- this._label(ctx, this.label, this.x, this.y);
+ /**
+ * Recalculate the size of this node in the given canvas
+ * The 2d context of a HTML canvas can be retrieved by canvas.getContext("2d");
+ * @param {CanvasRenderingContext2D} ctx
+ */
+ Node.prototype.resize = function(ctx) {
+ throw "Resize method not initialized for node";
};
+ /**
+ * Check if this object is overlapping with the provided object
+ * @param {Object} obj an object with parameters left, top, right, bottom
+ * @return {boolean} True if location is located on node
+ */
+ Node.prototype.isOverlappingWith = function(obj) {
+ return (this.left < obj.right &&
+ this.left + this.width > obj.left &&
+ this.top < obj.bottom &&
+ this.top + this.height > obj.top);
+ };
- Node.prototype._label = function (ctx, text, x, y, align, baseline, labelUnderNode) {
- if (text && this.fontSize * this.networkScale > this.fontDrawThreshold) {
- ctx.font = (this.selected ? "bold " : "") + this.fontSize + "px " + this.fontFace;
- ctx.fillStyle = this.fontColor || "black";
- ctx.textAlign = align || "center";
- ctx.textBaseline = baseline || "middle";
+ Node.prototype._resizeImage = function (ctx) {
+ // TODO: pre calculate the image size
- var lines = text.split('\n');
- var lineCount = lines.length;
- var fontSize = (this.fontSize + 4);
- var yLine = y + (1 - lineCount) / 2 * fontSize;
- if (labelUnderNode == true) {
- yLine = y + (1 - lineCount) / (2 * fontSize);
+ if (!this.width || !this.height) { // undefined or 0
+ var width, height;
+ if (this.value) {
+ this.radius = this.baseRadiusValue;
+ var scale = this.imageObj.height / this.imageObj.width;
+ if (scale !== undefined) {
+ width = this.radius || this.imageObj.width;
+ height = this.radius * scale || this.imageObj.height;
+ }
+ else {
+ width = 0;
+ height = 0;
+ }
+ }
+ else {
+ width = this.imageObj.width;
+ height = this.imageObj.height;
}
+ this.width = width;
+ this.height = height;
- for (var i = 0; i < lineCount; i++) {
- ctx.fillText(lines[i], x, yLine);
- yLine += fontSize;
+ this.growthIndicator = 0;
+ if (this.width > 0 && this.height > 0) {
+ this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
+ this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
+ this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
+ this.growthIndicator = this.width - width;
}
}
+
};
+ Node.prototype._drawImage = function (ctx) {
+ this._resizeImage(ctx);
- Node.prototype.getTextSize = function(ctx) {
- if (this.label !== undefined) {
- ctx.font = (this.selected ? "bold " : "") + this.fontSize + "px " + this.fontFace;
+ this.left = this.x - this.width / 2;
+ this.top = this.y - this.height / 2;
- var lines = this.label.split('\n'),
- height = (this.fontSize + 4) * lines.length,
- width = 0;
+ var yLabel;
+ if (this.imageObj.width != 0 ) {
+ // draw the shade
+ if (this.clusterSize > 1) {
+ var lineWidth = ((this.clusterSize > 1) ? 10 : 0.0);
+ lineWidth *= this.networkScaleInv;
+ lineWidth = Math.min(0.2 * this.width,lineWidth);
- for (var i = 0, iMax = lines.length; i < iMax; i++) {
- width = Math.max(width, ctx.measureText(lines[i]).width);
+ ctx.globalAlpha = 0.5;
+ ctx.drawImage(this.imageObj, this.left - lineWidth, this.top - lineWidth, this.width + 2*lineWidth, this.height + 2*lineWidth);
}
- return {"width": width, "height": height};
- }
- else {
- return {"width": 0, "height": 0};
- }
- };
-
- /**
- * this is used to determine if a node is visible at all. this is used to determine when it needs to be drawn.
- * there is a safety margin of 0.3 * width;
- *
- * @returns {boolean}
- */
- Node.prototype.inArea = function() {
- if (this.width !== undefined) {
- return (this.x + this.width *this.networkScaleInv >= this.canvasTopLeft.x &&
- this.x - this.width *this.networkScaleInv < this.canvasBottomRight.x &&
- this.y + this.height*this.networkScaleInv >= this.canvasTopLeft.y &&
- this.y - this.height*this.networkScaleInv < this.canvasBottomRight.y);
+ // draw the image
+ ctx.globalAlpha = 1.0;
+ ctx.drawImage(this.imageObj, this.left, this.top, this.width, this.height);
+ yLabel = this.y + this.height / 2;
}
else {
- return true;
+ // image still loading... just draw the label for now
+ yLabel = this.y;
}
- };
- /**
- * checks if the core of the node is in the display area, this is used for opening clusters around zoom
- * @returns {boolean}
- */
- Node.prototype.inView = function() {
- return (this.x >= this.canvasTopLeft.x &&
- this.x < this.canvasBottomRight.x &&
- this.y >= this.canvasTopLeft.y &&
- this.y < this.canvasBottomRight.y);
+ this._label(ctx, this.label, this.x, yLabel, undefined, "top");
};
- /**
- * This allows the zoom level of the network to influence the rendering
- * We store the inverted scale and the coordinates of the top left, and bottom right points of the canvas
- *
- * @param scale
- * @param canvasTopLeft
- * @param canvasBottomRight
- */
- Node.prototype.setScaleAndPos = function(scale,canvasTopLeft,canvasBottomRight) {
- this.networkScaleInv = 1.0/scale;
- this.networkScale = scale;
- this.canvasTopLeft = canvasTopLeft;
- this.canvasBottomRight = canvasBottomRight;
- };
+ Node.prototype._resizeBox = function (ctx) {
+ if (!this.width) {
+ var margin = 5;
+ var textSize = this.getTextSize(ctx);
+ this.width = textSize.width + 2 * margin;
+ this.height = textSize.height + 2 * margin;
+
+ this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeWidthFactor;
+ this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeHeightFactor;
+ this.growthIndicator = this.width - (textSize.width + 2 * margin);
+ // this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeRadiusFactor;
- /**
- * This allows the zoom level of the network to influence the rendering
- *
- * @param scale
- */
- Node.prototype.setScale = function(scale) {
- this.networkScaleInv = 1.0/scale;
- this.networkScale = scale;
+ }
};
+ Node.prototype._drawBox = function (ctx) {
+ this._resizeBox(ctx);
+ this.left = this.x - this.width / 2;
+ this.top = this.y - this.height / 2;
- /**
- * set the velocity at 0. Is called when this node is contained in another during clustering
- */
- Node.prototype.clearVelocity = function() {
- this.vx = 0;
- this.vy = 0;
- };
+ var clusterLineWidth = 2.5;
+ var selectionLineWidth = 2;
+ ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
- /**
- * Basic preservation of (kinectic) energy
- *
- * @param massBeforeClustering
- */
- Node.prototype.updateVelocity = function(massBeforeClustering) {
- var energyBefore = this.vx * this.vx * massBeforeClustering;
- //this.vx = (this.vx < 0) ? -Math.sqrt(energyBefore/this.mass) : Math.sqrt(energyBefore/this.mass);
- this.vx = Math.sqrt(energyBefore/this.mass);
- energyBefore = this.vy * this.vy * massBeforeClustering;
- //this.vy = (this.vy < 0) ? -Math.sqrt(energyBefore/this.mass) : Math.sqrt(energyBefore/this.mass);
- this.vy = Math.sqrt(energyBefore/this.mass);
- };
+ // draw the outer border
+ if (this.clusterSize > 1) {
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- module.exports = Node;
+ ctx.roundRect(this.left-2*ctx.lineWidth, this.top-2*ctx.lineWidth, this.width+4*ctx.lineWidth, this.height+4*ctx.lineWidth, this.radius);
+ ctx.stroke();
+ }
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+ ctx.fillStyle = this.selected ? this.color.highlight.background : this.color.background;
-/***/ },
-/* 31 */
-/***/ function(module, exports, __webpack_require__) {
+ ctx.roundRect(this.left, this.top, this.width, this.height, this.radius);
+ ctx.fill();
+ ctx.stroke();
- /**
- * Popup is a class to create a popup window with some text
- * @param {Element} container The container object.
- * @param {Number} [x]
- * @param {Number} [y]
- * @param {String} [text]
- * @param {Object} [style] An object containing borderColor,
- * backgroundColor, etc.
- */
- function Popup(container, x, y, text, style) {
- if (container) {
- this.container = container;
- }
- else {
- this.container = document.body;
- }
+ this._label(ctx, this.label, this.x, this.y);
+ };
- // x, y and text are optional, see if a style object was passed in their place
- if (style === undefined) {
- if (typeof x === "object") {
- style = x;
- x = undefined;
- } else if (typeof text === "object") {
- style = text;
- text = undefined;
- } else {
- // for backwards compatibility, in case clients other than Network are creating Popup directly
- style = {
- fontColor: 'black',
- fontSize: 14, // px
- fontFace: 'verdana',
- color: {
- border: '#666',
- background: '#FFFFC6'
- }
- }
- }
- }
- this.x = 0;
- this.y = 0;
- this.padding = 5;
+ Node.prototype._resizeDatabase = function (ctx) {
+ if (!this.width) {
+ var margin = 5;
+ var textSize = this.getTextSize(ctx);
+ var size = textSize.width + 2 * margin;
+ this.width = size;
+ this.height = size;
- if (x !== undefined && y !== undefined ) {
- this.setPosition(x, y);
- }
- if (text !== undefined) {
- this.setText(text);
+ // scaling used for clustering
+ this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
+ this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
+ this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
+ this.growthIndicator = this.width - size;
}
+ };
- // create the frame
- this.frame = document.createElement("div");
- var styleAttr = this.frame.style;
- styleAttr.position = "absolute";
- styleAttr.visibility = "hidden";
- styleAttr.border = "1px solid " + style.color.border;
- styleAttr.color = style.fontColor;
- styleAttr.fontSize = style.fontSize + "px";
- styleAttr.fontFamily = style.fontFace;
- styleAttr.padding = this.padding + "px";
- styleAttr.backgroundColor = style.color.background;
- styleAttr.borderRadius = "3px";
- styleAttr.MozBorderRadius = "3px";
- styleAttr.WebkitBorderRadius = "3px";
- styleAttr.boxShadow = "3px 3px 10px rgba(128, 128, 128, 0.5)";
- styleAttr.whiteSpace = "nowrap";
- this.container.appendChild(this.frame);
- }
+ Node.prototype._drawDatabase = function (ctx) {
+ this._resizeDatabase(ctx);
+ this.left = this.x - this.width / 2;
+ this.top = this.y - this.height / 2;
- /**
- * @param {number} x Horizontal position of the popup window
- * @param {number} y Vertical position of the popup window
- */
- Popup.prototype.setPosition = function(x, y) {
- this.x = parseInt(x);
- this.y = parseInt(y);
- };
+ var clusterLineWidth = 2.5;
+ var selectionLineWidth = 2;
- /**
- * Set the text for the popup window. This can be HTML code
- * @param {string} text
- */
- Popup.prototype.setText = function(text) {
- this.frame.innerHTML = text;
- };
+ ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
- /**
- * Show the popup window
- * @param {boolean} show Optional. Show or hide the window
- */
- Popup.prototype.show = function (show) {
- if (show === undefined) {
- show = true;
+ // draw the outer border
+ if (this.clusterSize > 1) {
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+
+ ctx.database(this.x - this.width/2 - 2*ctx.lineWidth, this.y - this.height*0.5 - 2*ctx.lineWidth, this.width + 4*ctx.lineWidth, this.height + 4*ctx.lineWidth);
+ ctx.stroke();
}
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- if (show) {
- var height = this.frame.clientHeight;
- var width = this.frame.clientWidth;
- var maxHeight = this.frame.parentNode.clientHeight;
- var maxWidth = this.frame.parentNode.clientWidth;
+ ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
+ ctx.database(this.x - this.width/2, this.y - this.height*0.5, this.width, this.height);
+ ctx.fill();
+ ctx.stroke();
- var top = (this.y - height);
- if (top + height + this.padding > maxHeight) {
- top = maxHeight - height - this.padding;
- }
- if (top < this.padding) {
- top = this.padding;
- }
+ this._label(ctx, this.label, this.x, this.y);
+ };
- var left = this.x;
- if (left + width + this.padding > maxWidth) {
- left = maxWidth - width - this.padding;
- }
- if (left < this.padding) {
- left = this.padding;
- }
- this.frame.style.left = left + "px";
- this.frame.style.top = top + "px";
- this.frame.style.visibility = "visible";
- }
- else {
- this.hide();
+ Node.prototype._resizeCircle = function (ctx) {
+ if (!this.width) {
+ var margin = 5;
+ var textSize = this.getTextSize(ctx);
+ var diameter = Math.max(textSize.width, textSize.height) + 2 * margin;
+ this.radius = diameter / 2;
+
+ this.width = diameter;
+ this.height = diameter;
+
+ // scaling used for clustering
+ // this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeWidthFactor;
+ // this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeHeightFactor;
+ this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeRadiusFactor;
+ this.growthIndicator = this.radius - 0.5*diameter;
}
};
- /**
- * Hide the popup window
- */
- Popup.prototype.hide = function () {
- this.frame.style.visibility = "hidden";
- };
+ Node.prototype._drawCircle = function (ctx) {
+ this._resizeCircle(ctx);
+ this.left = this.x - this.width / 2;
+ this.top = this.y - this.height / 2;
- module.exports = Popup;
+ var clusterLineWidth = 2.5;
+ var selectionLineWidth = 2;
+ ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
-/***/ },
-/* 32 */
-/***/ function(module, exports, __webpack_require__) {
+ // draw the outer border
+ if (this.clusterSize > 1) {
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- /**
- * Parse a text source containing data in DOT language into a JSON object.
- * The object contains two lists: one with nodes and one with edges.
- *
- * DOT language reference: http://www.graphviz.org/doc/info/lang.html
- *
- * @param {String} data Text containing a graph in DOT-notation
- * @return {Object} graph An object containing two parameters:
- * {Object[]} nodes
- * {Object[]} edges
- */
- function parseDOT (data) {
- dot = data;
- return parseGraph();
- }
+ ctx.circle(this.x, this.y, this.radius+2*ctx.lineWidth);
+ ctx.stroke();
+ }
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- // token types enumeration
- var TOKENTYPE = {
- NULL : 0,
- DELIMITER : 1,
- IDENTIFIER: 2,
- UNKNOWN : 3
+ ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
+ ctx.circle(this.x, this.y, this.radius);
+ ctx.fill();
+ ctx.stroke();
+
+ this._label(ctx, this.label, this.x, this.y);
};
- // map with all delimiters
- var DELIMITERS = {
- '{': true,
- '}': true,
- '[': true,
- ']': true,
- ';': true,
- '=': true,
- ',': true,
+ Node.prototype._resizeEllipse = function (ctx) {
+ if (!this.width) {
+ var textSize = this.getTextSize(ctx);
- '->': true,
- '--': true
- };
+ this.width = textSize.width * 1.5;
+ this.height = textSize.height * 2;
+ if (this.width < this.height) {
+ this.width = this.height;
+ }
+ var defaultSize = this.width;
- var dot = ''; // current dot file
- var index = 0; // current index in dot file
- var c = ''; // current token character in expr
- var token = ''; // current token
- var tokenType = TOKENTYPE.NULL; // type of the token
+ // scaling used for clustering
+ this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
+ this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
+ this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
+ this.growthIndicator = this.width - defaultSize;
+ }
+ };
- /**
- * Get the first character from the dot file.
- * The character is stored into the char c. If the end of the dot file is
- * reached, the function puts an empty string in c.
- */
- function first() {
- index = 0;
- c = dot.charAt(0);
- }
+ Node.prototype._drawEllipse = function (ctx) {
+ this._resizeEllipse(ctx);
+ this.left = this.x - this.width / 2;
+ this.top = this.y - this.height / 2;
- /**
- * Get the next character from the dot file.
- * The character is stored into the char c. If the end of the dot file is
- * reached, the function puts an empty string in c.
- */
- function next() {
- index++;
- c = dot.charAt(index);
- }
+ var clusterLineWidth = 2.5;
+ var selectionLineWidth = 2;
- /**
- * Preview the next character from the dot file.
- * @return {String} cNext
- */
- function nextPreview() {
- return dot.charAt(index + 1);
- }
+ ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
- /**
- * Test whether given character is alphabetic or numeric
- * @param {String} c
- * @return {Boolean} isAlphaNumeric
- */
- var regexAlphaNumeric = /[a-zA-Z_0-9.:#]/;
- function isAlphaNumeric(c) {
- return regexAlphaNumeric.test(c);
- }
+ // draw the outer border
+ if (this.clusterSize > 1) {
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- /**
- * Merge all properties of object b into object b
- * @param {Object} a
- * @param {Object} b
- * @return {Object} a
- */
- function merge (a, b) {
- if (!a) {
- a = {};
+ ctx.ellipse(this.left-2*ctx.lineWidth, this.top-2*ctx.lineWidth, this.width+4*ctx.lineWidth, this.height+4*ctx.lineWidth);
+ ctx.stroke();
}
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
- if (b) {
- for (var name in b) {
- if (b.hasOwnProperty(name)) {
- a[name] = b[name];
- }
- }
- }
- return a;
- }
+ ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
- /**
- * Set a value in an object, where the provided parameter name can be a
- * path with nested parameters. For example:
- *
- * var obj = {a: 2};
- * setValue(obj, 'b.c', 3); // obj = {a: 2, b: {c: 3}}
- *
- * @param {Object} obj
- * @param {String} path A parameter name or dot-separated parameter path,
- * like "color.highlight.border".
- * @param {*} value
- */
- function setValue(obj, path, value) {
- var keys = path.split('.');
- var o = obj;
- while (keys.length) {
- var key = keys.shift();
- if (keys.length) {
- // this isn't the end point
- if (!o[key]) {
- o[key] = {};
- }
- o = o[key];
- }
- else {
- // this is the end point
- o[key] = value;
- }
- }
- }
+ ctx.ellipse(this.left, this.top, this.width, this.height);
+ ctx.fill();
+ ctx.stroke();
+ this._label(ctx, this.label, this.x, this.y);
+ };
- /**
- * Add a node to a graph object. If there is already a node with
- * the same id, their attributes will be merged.
- * @param {Object} graph
- * @param {Object} node
- */
- function addNode(graph, node) {
- var i, len;
- var current = null;
+ Node.prototype._drawDot = function (ctx) {
+ this._drawShape(ctx, 'circle');
+ };
- // find root graph (in case of subgraph)
- var graphs = [graph]; // list with all graphs from current graph to root graph
- var root = graph;
- while (root.parent) {
- graphs.push(root.parent);
- root = root.parent;
- }
+ Node.prototype._drawTriangle = function (ctx) {
+ this._drawShape(ctx, 'triangle');
+ };
- // find existing node (at root level) by its id
- if (root.nodes) {
- for (i = 0, len = root.nodes.length; i < len; i++) {
- if (node.id === root.nodes[i].id) {
- current = root.nodes[i];
- break;
- }
- }
- }
+ Node.prototype._drawTriangleDown = function (ctx) {
+ this._drawShape(ctx, 'triangleDown');
+ };
- if (!current) {
- // this is a new node
- current = {
- id: node.id
- };
- if (graph.node) {
- // clone default attributes
- current.attr = merge(current.attr, graph.node);
- }
+ Node.prototype._drawSquare = function (ctx) {
+ this._drawShape(ctx, 'square');
+ };
+
+ Node.prototype._drawStar = function (ctx) {
+ this._drawShape(ctx, 'star');
+ };
+
+ Node.prototype._resizeShape = function (ctx) {
+ if (!this.width) {
+ this.radius = this.baseRadiusValue;
+ var size = 2 * this.radius;
+ this.width = size;
+ this.height = size;
+
+ // scaling used for clustering
+ this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
+ this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
+ this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * 0.5 * this.clusterSizeRadiusFactor;
+ this.growthIndicator = this.width - size;
}
+ };
- // add node to this (sub)graph and all its parent graphs
- for (i = graphs.length - 1; i >= 0; i--) {
- var g = graphs[i];
+ Node.prototype._drawShape = function (ctx, shape) {
+ this._resizeShape(ctx);
- if (!g.nodes) {
- g.nodes = [];
- }
- if (g.nodes.indexOf(current) == -1) {
- g.nodes.push(current);
- }
- }
+ this.left = this.x - this.width / 2;
+ this.top = this.y - this.height / 2;
- // merge attributes
- if (node.attr) {
- current.attr = merge(current.attr, node.attr);
+ var clusterLineWidth = 2.5;
+ var selectionLineWidth = 2;
+ var radiusMultiplier = 2;
+
+ // choose draw method depending on the shape
+ switch (shape) {
+ case 'dot': radiusMultiplier = 2; break;
+ case 'square': radiusMultiplier = 2; break;
+ case 'triangle': radiusMultiplier = 3; break;
+ case 'triangleDown': radiusMultiplier = 3; break;
+ case 'star': radiusMultiplier = 4; break;
}
- }
- /**
- * Add an edge to a graph object
- * @param {Object} graph
- * @param {Object} edge
- */
- function addEdge(graph, edge) {
- if (!graph.edges) {
- graph.edges = [];
+ ctx.strokeStyle = this.selected ? this.color.highlight.border : this.hover ? this.color.hover.border : this.color.border;
+
+ // draw the outer border
+ if (this.clusterSize > 1) {
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+
+ ctx[shape](this.x, this.y, this.radius + radiusMultiplier * ctx.lineWidth);
+ ctx.stroke();
}
- graph.edges.push(edge);
- if (graph.edge) {
- var attr = merge({}, graph.edge); // clone default attributes
- edge.attr = merge(attr, edge.attr); // merge attributes
+ ctx.lineWidth = (this.selected ? selectionLineWidth : 1.0) + ((this.clusterSize > 1) ? clusterLineWidth : 0.0);
+ ctx.lineWidth *= this.networkScaleInv;
+ ctx.lineWidth = Math.min(0.1 * this.width,ctx.lineWidth);
+
+ ctx.fillStyle = this.selected ? this.color.highlight.background : this.hover ? this.color.hover.background : this.color.background;
+ ctx[shape](this.x, this.y, this.radius);
+ ctx.fill();
+ ctx.stroke();
+
+ if (this.label) {
+ this._label(ctx, this.label, this.x, this.y + this.height / 2, undefined, 'top',true);
}
- }
+ };
- /**
- * Create an edge to a graph object
- * @param {Object} graph
- * @param {String | Number | Object} from
- * @param {String | Number | Object} to
- * @param {String} type
- * @param {Object | null} attr
- * @return {Object} edge
- */
- function createEdge(graph, from, to, type, attr) {
- var edge = {
- from: from,
- to: to,
- type: type
- };
+ Node.prototype._resizeText = function (ctx) {
+ if (!this.width) {
+ var margin = 5;
+ var textSize = this.getTextSize(ctx);
+ this.width = textSize.width + 2 * margin;
+ this.height = textSize.height + 2 * margin;
- if (graph.edge) {
- edge.attr = merge({}, graph.edge); // clone default attributes
+ // scaling used for clustering
+ this.width += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeWidthFactor;
+ this.height += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeHeightFactor;
+ this.radius += Math.min(this.clusterSize - 1, this.maxNodeSizeIncrements) * this.clusterSizeRadiusFactor;
+ this.growthIndicator = this.width - (textSize.width + 2 * margin);
}
- edge.attr = merge(edge.attr || {}, attr); // merge attributes
+ };
- return edge;
- }
+ Node.prototype._drawText = function (ctx) {
+ this._resizeText(ctx);
+ this.left = this.x - this.width / 2;
+ this.top = this.y - this.height / 2;
- /**
- * Get next token in the current dot file.
- * The token and token type are available as token and tokenType
- */
- function getToken() {
- tokenType = TOKENTYPE.NULL;
- token = '';
+ this._label(ctx, this.label, this.x, this.y);
+ };
- // skip over whitespaces
- while (c == ' ' || c == '\t' || c == '\n' || c == '\r') { // space, tab, enter
- next();
- }
- do {
- var isComment = false;
+ Node.prototype._label = function (ctx, text, x, y, align, baseline, labelUnderNode) {
+ if (text && this.fontSize * this.networkScale > this.fontDrawThreshold) {
+ ctx.font = (this.selected ? "bold " : "") + this.fontSize + "px " + this.fontFace;
+ ctx.fillStyle = this.fontColor || "black";
+ ctx.textAlign = align || "center";
+ ctx.textBaseline = baseline || "middle";
- // skip comment
- if (c == '#') {
- // find the previous non-space character
- var i = index - 1;
- while (dot.charAt(i) == ' ' || dot.charAt(i) == '\t') {
- i--;
- }
- if (dot.charAt(i) == '\n' || dot.charAt(i) == '') {
- // the # is at the start of a line, this is indeed a line comment
- while (c != '' && c != '\n') {
- next();
- }
- isComment = true;
- }
- }
- if (c == '/' && nextPreview() == '/') {
- // skip line comment
- while (c != '' && c != '\n') {
- next();
- }
- isComment = true;
- }
- if (c == '/' && nextPreview() == '*') {
- // skip block comment
- while (c != '') {
- if (c == '*' && nextPreview() == '/') {
- // end of block comment found. skip these last two characters
- next();
- next();
- break;
- }
- else {
- next();
- }
- }
- isComment = true;
+ var lines = text.split('\n');
+ var lineCount = lines.length;
+ var fontSize = (this.fontSize + 4);
+ var yLine = y + (1 - lineCount) / 2 * fontSize;
+ if (labelUnderNode == true) {
+ yLine = y + (1 - lineCount) / (2 * fontSize);
}
- // skip over whitespaces
- while (c == ' ' || c == '\t' || c == '\n' || c == '\r') { // space, tab, enter
- next();
+ for (var i = 0; i < lineCount; i++) {
+ ctx.fillText(lines[i], x, yLine);
+ yLine += fontSize;
}
}
- while (isComment);
+ };
- // check for end of dot file
- if (c == '') {
- // token is still empty
- tokenType = TOKENTYPE.DELIMITER;
- return;
- }
- // check for delimiters consisting of 2 characters
- var c2 = c + nextPreview();
- if (DELIMITERS[c2]) {
- tokenType = TOKENTYPE.DELIMITER;
- token = c2;
- next();
- next();
- return;
+ Node.prototype.getTextSize = function(ctx) {
+ if (this.label !== undefined) {
+ ctx.font = (this.selected ? "bold " : "") + this.fontSize + "px " + this.fontFace;
+
+ var lines = this.label.split('\n'),
+ height = (this.fontSize + 4) * lines.length,
+ width = 0;
+
+ for (var i = 0, iMax = lines.length; i < iMax; i++) {
+ width = Math.max(width, ctx.measureText(lines[i]).width);
+ }
+
+ return {"width": width, "height": height};
}
+ else {
+ return {"width": 0, "height": 0};
+ }
+ };
- // check for delimiters consisting of 1 character
- if (DELIMITERS[c]) {
- tokenType = TOKENTYPE.DELIMITER;
- token = c;
- next();
- return;
+ /**
+ * this is used to determine if a node is visible at all. this is used to determine when it needs to be drawn.
+ * there is a safety margin of 0.3 * width;
+ *
+ * @returns {boolean}
+ */
+ Node.prototype.inArea = function() {
+ if (this.width !== undefined) {
+ return (this.x + this.width *this.networkScaleInv >= this.canvasTopLeft.x &&
+ this.x - this.width *this.networkScaleInv < this.canvasBottomRight.x &&
+ this.y + this.height*this.networkScaleInv >= this.canvasTopLeft.y &&
+ this.y - this.height*this.networkScaleInv < this.canvasBottomRight.y);
+ }
+ else {
+ return true;
}
+ };
+
+ /**
+ * checks if the core of the node is in the display area, this is used for opening clusters around zoom
+ * @returns {boolean}
+ */
+ Node.prototype.inView = function() {
+ return (this.x >= this.canvasTopLeft.x &&
+ this.x < this.canvasBottomRight.x &&
+ this.y >= this.canvasTopLeft.y &&
+ this.y < this.canvasBottomRight.y);
+ };
+
+ /**
+ * This allows the zoom level of the network to influence the rendering
+ * We store the inverted scale and the coordinates of the top left, and bottom right points of the canvas
+ *
+ * @param scale
+ * @param canvasTopLeft
+ * @param canvasBottomRight
+ */
+ Node.prototype.setScaleAndPos = function(scale,canvasTopLeft,canvasBottomRight) {
+ this.networkScaleInv = 1.0/scale;
+ this.networkScale = scale;
+ this.canvasTopLeft = canvasTopLeft;
+ this.canvasBottomRight = canvasBottomRight;
+ };
- // check for an identifier (number or string)
- // TODO: more precise parsing of numbers/strings (and the port separator ':')
- if (isAlphaNumeric(c) || c == '-') {
- token += c;
- next();
- while (isAlphaNumeric(c)) {
- token += c;
- next();
- }
- if (token == 'false') {
- token = false; // convert to boolean
- }
- else if (token == 'true') {
- token = true; // convert to boolean
- }
- else if (!isNaN(Number(token))) {
- token = Number(token); // convert to number
- }
- tokenType = TOKENTYPE.IDENTIFIER;
- return;
- }
+ /**
+ * This allows the zoom level of the network to influence the rendering
+ *
+ * @param scale
+ */
+ Node.prototype.setScale = function(scale) {
+ this.networkScaleInv = 1.0/scale;
+ this.networkScale = scale;
+ };
- // check for a string enclosed by double quotes
- if (c == '"') {
- next();
- while (c != '' && (c != '"' || (c == '"' && nextPreview() == '"'))) {
- token += c;
- if (c == '"') { // skip the escape character
- next();
- }
- next();
- }
- if (c != '"') {
- throw newSyntaxError('End of string " expected');
- }
- next();
- tokenType = TOKENTYPE.IDENTIFIER;
- return;
- }
- // something unknown is found, wrong characters, a syntax error
- tokenType = TOKENTYPE.UNKNOWN;
- while (c != '') {
- token += c;
- next();
- }
- throw new SyntaxError('Syntax error in part "' + chop(token, 30) + '"');
- }
/**
- * Parse a graph.
- * @returns {Object} graph
+ * set the velocity at 0. Is called when this node is contained in another during clustering
*/
- function parseGraph() {
- var graph = {};
+ Node.prototype.clearVelocity = function() {
+ this.vx = 0;
+ this.vy = 0;
+ };
- first();
- getToken();
- // optional strict keyword
- if (token == 'strict') {
- graph.strict = true;
- getToken();
- }
+ /**
+ * Basic preservation of (kinectic) energy
+ *
+ * @param massBeforeClustering
+ */
+ Node.prototype.updateVelocity = function(massBeforeClustering) {
+ var energyBefore = this.vx * this.vx * massBeforeClustering;
+ //this.vx = (this.vx < 0) ? -Math.sqrt(energyBefore/this.mass) : Math.sqrt(energyBefore/this.mass);
+ this.vx = Math.sqrt(energyBefore/this.mass);
+ energyBefore = this.vy * this.vy * massBeforeClustering;
+ //this.vy = (this.vy < 0) ? -Math.sqrt(energyBefore/this.mass) : Math.sqrt(energyBefore/this.mass);
+ this.vy = Math.sqrt(energyBefore/this.mass);
+ };
- // graph or digraph keyword
- if (token == 'graph' || token == 'digraph') {
- graph.type = token;
- getToken();
- }
+ module.exports = Node;
- // optional graph id
- if (tokenType == TOKENTYPE.IDENTIFIER) {
- graph.id = token;
- getToken();
+
+/***/ },
+/* 31 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /**
+ * Popup is a class to create a popup window with some text
+ * @param {Element} container The container object.
+ * @param {Number} [x]
+ * @param {Number} [y]
+ * @param {String} [text]
+ * @param {Object} [style] An object containing borderColor,
+ * backgroundColor, etc.
+ */
+ function Popup(container, x, y, text, style) {
+ if (container) {
+ this.container = container;
+ }
+ else {
+ this.container = document.body;
}
- // open angle bracket
- if (token != '{') {
- throw newSyntaxError('Angle bracket { expected');
+ // x, y and text are optional, see if a style object was passed in their place
+ if (style === undefined) {
+ if (typeof x === "object") {
+ style = x;
+ x = undefined;
+ } else if (typeof text === "object") {
+ style = text;
+ text = undefined;
+ } else {
+ // for backwards compatibility, in case clients other than Network are creating Popup directly
+ style = {
+ fontColor: 'black',
+ fontSize: 14, // px
+ fontFace: 'verdana',
+ color: {
+ border: '#666',
+ background: '#FFFFC6'
+ }
+ }
+ }
}
- getToken();
- // statements
- parseStatements(graph);
+ this.x = 0;
+ this.y = 0;
+ this.padding = 5;
- // close angle bracket
- if (token != '}') {
- throw newSyntaxError('Angle bracket } expected');
+ if (x !== undefined && y !== undefined ) {
+ this.setPosition(x, y);
}
- getToken();
-
- // end of file
- if (token !== '') {
- throw newSyntaxError('End of file expected');
+ if (text !== undefined) {
+ this.setText(text);
}
- getToken();
-
- // remove temporary default properties
- delete graph.node;
- delete graph.edge;
- delete graph.graph;
- return graph;
+ // create the frame
+ this.frame = document.createElement("div");
+ var styleAttr = this.frame.style;
+ styleAttr.position = "absolute";
+ styleAttr.visibility = "hidden";
+ styleAttr.border = "1px solid " + style.color.border;
+ styleAttr.color = style.fontColor;
+ styleAttr.fontSize = style.fontSize + "px";
+ styleAttr.fontFamily = style.fontFace;
+ styleAttr.padding = this.padding + "px";
+ styleAttr.backgroundColor = style.color.background;
+ styleAttr.borderRadius = "3px";
+ styleAttr.MozBorderRadius = "3px";
+ styleAttr.WebkitBorderRadius = "3px";
+ styleAttr.boxShadow = "3px 3px 10px rgba(128, 128, 128, 0.5)";
+ styleAttr.whiteSpace = "nowrap";
+ this.container.appendChild(this.frame);
}
/**
- * Parse a list with statements.
- * @param {Object} graph
+ * @param {number} x Horizontal position of the popup window
+ * @param {number} y Vertical position of the popup window
*/
- function parseStatements (graph) {
- while (token !== '' && token != '}') {
- parseStatement(graph);
- if (token == ';') {
- getToken();
- }
- }
- }
+ Popup.prototype.setPosition = function(x, y) {
+ this.x = parseInt(x);
+ this.y = parseInt(y);
+ };
/**
- * Parse a single statement. Can be a an attribute statement, node
- * statement, a series of node statements and edge statements, or a
- * parameter.
- * @param {Object} graph
+ * Set the text for the popup window. This can be HTML code
+ * @param {string} text
*/
- function parseStatement(graph) {
- // parse subgraph
- var subgraph = parseSubgraph(graph);
- if (subgraph) {
- // edge statements
- parseEdge(graph, subgraph);
+ Popup.prototype.setText = function(text) {
+ this.frame.innerHTML = text;
+ };
- return;
+ /**
+ * Show the popup window
+ * @param {boolean} show Optional. Show or hide the window
+ */
+ Popup.prototype.show = function (show) {
+ if (show === undefined) {
+ show = true;
}
- // parse an attribute statement
- var attr = parseAttributeStatement(graph);
- if (attr) {
- return;
- }
+ if (show) {
+ var height = this.frame.clientHeight;
+ var width = this.frame.clientWidth;
+ var maxHeight = this.frame.parentNode.clientHeight;
+ var maxWidth = this.frame.parentNode.clientWidth;
- // parse node
- if (tokenType != TOKENTYPE.IDENTIFIER) {
- throw newSyntaxError('Identifier expected');
- }
- var id = token; // id can be a string or a number
- getToken();
+ var top = (this.y - height);
+ if (top + height + this.padding > maxHeight) {
+ top = maxHeight - height - this.padding;
+ }
+ if (top < this.padding) {
+ top = this.padding;
+ }
- if (token == '=') {
- // id statement
- getToken();
- if (tokenType != TOKENTYPE.IDENTIFIER) {
- throw newSyntaxError('Identifier expected');
+ var left = this.x;
+ if (left + width + this.padding > maxWidth) {
+ left = maxWidth - width - this.padding;
}
- graph[id] = token;
- getToken();
- // TODO: implement comma separated list with "a_list: ID=ID [','] [a_list] "
+ if (left < this.padding) {
+ left = this.padding;
+ }
+
+ this.frame.style.left = left + "px";
+ this.frame.style.top = top + "px";
+ this.frame.style.visibility = "visible";
}
else {
- parseNodeStatement(graph, id);
+ this.hide();
}
- }
+ };
/**
- * Parse a subgraph
- * @param {Object} graph parent graph object
- * @return {Object | null} subgraph
+ * Hide the popup window
*/
- function parseSubgraph (graph) {
- var subgraph = null;
+ Popup.prototype.hide = function () {
+ this.frame.style.visibility = "hidden";
+ };
- // optional subgraph keyword
- if (token == 'subgraph') {
- subgraph = {};
- subgraph.type = 'subgraph';
- getToken();
+ module.exports = Popup;
- // optional graph id
- if (tokenType == TOKENTYPE.IDENTIFIER) {
- subgraph.id = token;
- getToken();
- }
- }
- // open angle bracket
- if (token == '{') {
- getToken();
+/***/ },
+/* 32 */
+/***/ function(module, exports, __webpack_require__) {
- if (!subgraph) {
- subgraph = {};
- }
- subgraph.parent = graph;
- subgraph.node = graph.node;
- subgraph.edge = graph.edge;
- subgraph.graph = graph.graph;
+ /**
+ * Parse a text source containing data in DOT language into a JSON object.
+ * The object contains two lists: one with nodes and one with edges.
+ *
+ * DOT language reference: http://www.graphviz.org/doc/info/lang.html
+ *
+ * @param {String} data Text containing a graph in DOT-notation
+ * @return {Object} graph An object containing two parameters:
+ * {Object[]} nodes
+ * {Object[]} edges
+ */
+ function parseDOT (data) {
+ dot = data;
+ return parseGraph();
+ }
- // statements
- parseStatements(subgraph);
+ // token types enumeration
+ var TOKENTYPE = {
+ NULL : 0,
+ DELIMITER : 1,
+ IDENTIFIER: 2,
+ UNKNOWN : 3
+ };
- // close angle bracket
- if (token != '}') {
- throw newSyntaxError('Angle bracket } expected');
- }
- getToken();
+ // map with all delimiters
+ var DELIMITERS = {
+ '{': true,
+ '}': true,
+ '[': true,
+ ']': true,
+ ';': true,
+ '=': true,
+ ',': true,
- // remove temporary default properties
- delete subgraph.node;
- delete subgraph.edge;
- delete subgraph.graph;
- delete subgraph.parent;
+ '->': true,
+ '--': true
+ };
- // register at the parent graph
- if (!graph.subgraphs) {
- graph.subgraphs = [];
- }
- graph.subgraphs.push(subgraph);
- }
+ var dot = ''; // current dot file
+ var index = 0; // current index in dot file
+ var c = ''; // current token character in expr
+ var token = ''; // current token
+ var tokenType = TOKENTYPE.NULL; // type of the token
- return subgraph;
+ /**
+ * Get the first character from the dot file.
+ * The character is stored into the char c. If the end of the dot file is
+ * reached, the function puts an empty string in c.
+ */
+ function first() {
+ index = 0;
+ c = dot.charAt(0);
}
/**
- * parse an attribute statement like "node [shape=circle fontSize=16]".
- * Available keywords are 'node', 'edge', 'graph'.
- * The previous list with default attributes will be replaced
- * @param {Object} graph
- * @returns {String | null} keyword Returns the name of the parsed attribute
- * (node, edge, graph), or null if nothing
- * is parsed.
+ * Get the next character from the dot file.
+ * The character is stored into the char c. If the end of the dot file is
+ * reached, the function puts an empty string in c.
*/
- function parseAttributeStatement (graph) {
- // attribute statements
- if (token == 'node') {
- getToken();
-
- // node attributes
- graph.node = parseAttributeList();
- return 'node';
- }
- else if (token == 'edge') {
- getToken();
-
- // edge attributes
- graph.edge = parseAttributeList();
- return 'edge';
- }
- else if (token == 'graph') {
- getToken();
+ function next() {
+ index++;
+ c = dot.charAt(index);
+ }
- // graph attributes
- graph.graph = parseAttributeList();
- return 'graph';
- }
+ /**
+ * Preview the next character from the dot file.
+ * @return {String} cNext
+ */
+ function nextPreview() {
+ return dot.charAt(index + 1);
+ }
- return null;
+ /**
+ * Test whether given character is alphabetic or numeric
+ * @param {String} c
+ * @return {Boolean} isAlphaNumeric
+ */
+ var regexAlphaNumeric = /[a-zA-Z_0-9.:#]/;
+ function isAlphaNumeric(c) {
+ return regexAlphaNumeric.test(c);
}
/**
- * parse a node statement
- * @param {Object} graph
- * @param {String | Number} id
+ * Merge all properties of object b into object b
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
*/
- function parseNodeStatement(graph, id) {
- // node statement
- var node = {
- id: id
- };
- var attr = parseAttributeList();
- if (attr) {
- node.attr = attr;
+ function merge (a, b) {
+ if (!a) {
+ a = {};
}
- addNode(graph, node);
- // edge statements
- parseEdge(graph, id);
+ if (b) {
+ for (var name in b) {
+ if (b.hasOwnProperty(name)) {
+ a[name] = b[name];
+ }
+ }
+ }
+ return a;
}
/**
- * Parse an edge or a series of edges
- * @param {Object} graph
- * @param {String | Number} from Id of the from node
+ * Set a value in an object, where the provided parameter name can be a
+ * path with nested parameters. For example:
+ *
+ * var obj = {a: 2};
+ * setValue(obj, 'b.c', 3); // obj = {a: 2, b: {c: 3}}
+ *
+ * @param {Object} obj
+ * @param {String} path A parameter name or dot-separated parameter path,
+ * like "color.highlight.border".
+ * @param {*} value
*/
- function parseEdge(graph, from) {
- while (token == '->' || token == '--') {
- var to;
- var type = token;
- getToken();
-
- var subgraph = parseSubgraph(graph);
- if (subgraph) {
- to = subgraph;
+ function setValue(obj, path, value) {
+ var keys = path.split('.');
+ var o = obj;
+ while (keys.length) {
+ var key = keys.shift();
+ if (keys.length) {
+ // this isn't the end point
+ if (!o[key]) {
+ o[key] = {};
+ }
+ o = o[key];
}
else {
- if (tokenType != TOKENTYPE.IDENTIFIER) {
- throw newSyntaxError('Identifier or subgraph expected');
- }
- to = token;
- addNode(graph, {
- id: to
- });
- getToken();
+ // this is the end point
+ o[key] = value;
}
-
- // parse edge attributes
- var attr = parseAttributeList();
-
- // create edge
- var edge = createEdge(graph, from, to, type, attr);
- addEdge(graph, edge);
-
- from = to;
}
}
/**
- * Parse a set with attributes,
- * for example [label="1.000", shape=solid]
- * @return {Object | null} attr
- */
- function parseAttributeList() {
- var attr = null;
-
- while (token == '[') {
- getToken();
- attr = {};
- while (token !== '' && token != ']') {
- if (tokenType != TOKENTYPE.IDENTIFIER) {
- throw newSyntaxError('Attribute name expected');
- }
- var name = token;
+ * Add a node to a graph object. If there is already a node with
+ * the same id, their attributes will be merged.
+ * @param {Object} graph
+ * @param {Object} node
+ */
+ function addNode(graph, node) {
+ var i, len;
+ var current = null;
- getToken();
- if (token != '=') {
- throw newSyntaxError('Equal sign = expected');
- }
- getToken();
+ // find root graph (in case of subgraph)
+ var graphs = [graph]; // list with all graphs from current graph to root graph
+ var root = graph;
+ while (root.parent) {
+ graphs.push(root.parent);
+ root = root.parent;
+ }
- if (tokenType != TOKENTYPE.IDENTIFIER) {
- throw newSyntaxError('Attribute value expected');
+ // find existing node (at root level) by its id
+ if (root.nodes) {
+ for (i = 0, len = root.nodes.length; i < len; i++) {
+ if (node.id === root.nodes[i].id) {
+ current = root.nodes[i];
+ break;
}
- var value = token;
- setValue(attr, name, value); // name can be a path
+ }
+ }
- getToken();
- if (token ==',') {
- getToken();
- }
+ if (!current) {
+ // this is a new node
+ current = {
+ id: node.id
+ };
+ if (graph.node) {
+ // clone default attributes
+ current.attr = merge(current.attr, graph.node);
}
+ }
- if (token != ']') {
- throw newSyntaxError('Bracket ] expected');
+ // add node to this (sub)graph and all its parent graphs
+ for (i = graphs.length - 1; i >= 0; i--) {
+ var g = graphs[i];
+
+ if (!g.nodes) {
+ g.nodes = [];
+ }
+ if (g.nodes.indexOf(current) == -1) {
+ g.nodes.push(current);
}
- getToken();
}
- return attr;
+ // merge attributes
+ if (node.attr) {
+ current.attr = merge(current.attr, node.attr);
+ }
}
/**
- * Create a syntax error with extra information on current token and index.
- * @param {String} message
- * @returns {SyntaxError} err
+ * Add an edge to a graph object
+ * @param {Object} graph
+ * @param {Object} edge
*/
- function newSyntaxError(message) {
- return new SyntaxError(message + ', got "' + chop(token, 30) + '" (char ' + index + ')');
+ function addEdge(graph, edge) {
+ if (!graph.edges) {
+ graph.edges = [];
+ }
+ graph.edges.push(edge);
+ if (graph.edge) {
+ var attr = merge({}, graph.edge); // clone default attributes
+ edge.attr = merge(attr, edge.attr); // merge attributes
+ }
}
/**
- * Chop off text after a maximum length
- * @param {String} text
- * @param {Number} maxLength
- * @returns {String}
+ * Create an edge to a graph object
+ * @param {Object} graph
+ * @param {String | Number | Object} from
+ * @param {String | Number | Object} to
+ * @param {String} type
+ * @param {Object | null} attr
+ * @return {Object} edge
*/
- function chop (text, maxLength) {
- return (text.length <= maxLength) ? text : (text.substr(0, 27) + '...');
- }
+ function createEdge(graph, from, to, type, attr) {
+ var edge = {
+ from: from,
+ to: to,
+ type: type
+ };
- /**
- * Execute a function fn for each pair of elements in two arrays
- * @param {Array | *} array1
- * @param {Array | *} array2
- * @param {function} fn
- */
- function forEach2(array1, array2, fn) {
- if (array1 instanceof Array) {
- array1.forEach(function (elem1) {
- if (array2 instanceof Array) {
- array2.forEach(function (elem2) {
- fn(elem1, elem2);
- });
- }
- else {
- fn(elem1, array2);
- }
- });
- }
- else {
- if (array2 instanceof Array) {
- array2.forEach(function (elem2) {
- fn(array1, elem2);
- });
- }
- else {
- fn(array1, array2);
- }
+ if (graph.edge) {
+ edge.attr = merge({}, graph.edge); // clone default attributes
}
+ edge.attr = merge(edge.attr || {}, attr); // merge attributes
+
+ return edge;
}
/**
- * Convert a string containing a graph in DOT language into a map containing
- * with nodes and edges in the format of graph.
- * @param {String} data Text containing a graph in DOT-notation
- * @return {Object} graphData
+ * Get next token in the current dot file.
+ * The token and token type are available as token and tokenType
*/
- function DOTToGraph (data) {
- // parse the DOT file
- var dotData = parseDOT(data);
- var graphData = {
- nodes: [],
- edges: [],
- options: {}
- };
+ function getToken() {
+ tokenType = TOKENTYPE.NULL;
+ token = '';
- // copy the nodes
- if (dotData.nodes) {
- dotData.nodes.forEach(function (dotNode) {
- var graphNode = {
- id: dotNode.id,
- label: String(dotNode.label || dotNode.id)
- };
- merge(graphNode, dotNode.attr);
- if (graphNode.image) {
- graphNode.shape = 'image';
- }
- graphData.nodes.push(graphNode);
- });
+ // skip over whitespaces
+ while (c == ' ' || c == '\t' || c == '\n' || c == '\r') { // space, tab, enter
+ next();
}
- // copy the edges
- if (dotData.edges) {
- /**
- * Convert an edge in DOT format to an edge with VisGraph format
- * @param {Object} dotEdge
- * @returns {Object} graphEdge
- */
- function convertEdge(dotEdge) {
- var graphEdge = {
- from: dotEdge.from,
- to: dotEdge.to
- };
- merge(graphEdge, dotEdge.attr);
- graphEdge.style = (dotEdge.type == '->') ? 'arrow' : 'line';
- return graphEdge;
- }
+ do {
+ var isComment = false;
- dotData.edges.forEach(function (dotEdge) {
- var from, to;
- if (dotEdge.from instanceof Object) {
- from = dotEdge.from.nodes;
+ // skip comment
+ if (c == '#') {
+ // find the previous non-space character
+ var i = index - 1;
+ while (dot.charAt(i) == ' ' || dot.charAt(i) == '\t') {
+ i--;
}
- else {
- from = {
- id: dotEdge.from
+ if (dot.charAt(i) == '\n' || dot.charAt(i) == '') {
+ // the # is at the start of a line, this is indeed a line comment
+ while (c != '' && c != '\n') {
+ next();
}
+ isComment = true;
}
-
- if (dotEdge.to instanceof Object) {
- to = dotEdge.to.nodes;
+ }
+ if (c == '/' && nextPreview() == '/') {
+ // skip line comment
+ while (c != '' && c != '\n') {
+ next();
}
- else {
- to = {
- id: dotEdge.to
+ isComment = true;
+ }
+ if (c == '/' && nextPreview() == '*') {
+ // skip block comment
+ while (c != '') {
+ if (c == '*' && nextPreview() == '/') {
+ // end of block comment found. skip these last two characters
+ next();
+ next();
+ break;
+ }
+ else {
+ next();
}
}
+ isComment = true;
+ }
+
+ // skip over whitespaces
+ while (c == ' ' || c == '\t' || c == '\n' || c == '\r') { // space, tab, enter
+ next();
+ }
+ }
+ while (isComment);
+
+ // check for end of dot file
+ if (c == '') {
+ // token is still empty
+ tokenType = TOKENTYPE.DELIMITER;
+ return;
+ }
+
+ // check for delimiters consisting of 2 characters
+ var c2 = c + nextPreview();
+ if (DELIMITERS[c2]) {
+ tokenType = TOKENTYPE.DELIMITER;
+ token = c2;
+ next();
+ next();
+ return;
+ }
+
+ // check for delimiters consisting of 1 character
+ if (DELIMITERS[c]) {
+ tokenType = TOKENTYPE.DELIMITER;
+ token = c;
+ next();
+ return;
+ }
- if (dotEdge.from instanceof Object && dotEdge.from.edges) {
- dotEdge.from.edges.forEach(function (subEdge) {
- var graphEdge = convertEdge(subEdge);
- graphData.edges.push(graphEdge);
- });
- }
+ // check for an identifier (number or string)
+ // TODO: more precise parsing of numbers/strings (and the port separator ':')
+ if (isAlphaNumeric(c) || c == '-') {
+ token += c;
+ next();
- forEach2(from, to, function (from, to) {
- var subEdge = createEdge(graphData, from.id, to.id, dotEdge.type, dotEdge.attr);
- var graphEdge = convertEdge(subEdge);
- graphData.edges.push(graphEdge);
- });
+ while (isAlphaNumeric(c)) {
+ token += c;
+ next();
+ }
+ if (token == 'false') {
+ token = false; // convert to boolean
+ }
+ else if (token == 'true') {
+ token = true; // convert to boolean
+ }
+ else if (!isNaN(Number(token))) {
+ token = Number(token); // convert to number
+ }
+ tokenType = TOKENTYPE.IDENTIFIER;
+ return;
+ }
- if (dotEdge.to instanceof Object && dotEdge.to.edges) {
- dotEdge.to.edges.forEach(function (subEdge) {
- var graphEdge = convertEdge(subEdge);
- graphData.edges.push(graphEdge);
- });
+ // check for a string enclosed by double quotes
+ if (c == '"') {
+ next();
+ while (c != '' && (c != '"' || (c == '"' && nextPreview() == '"'))) {
+ token += c;
+ if (c == '"') { // skip the escape character
+ next();
}
- });
+ next();
+ }
+ if (c != '"') {
+ throw newSyntaxError('End of string " expected');
+ }
+ next();
+ tokenType = TOKENTYPE.IDENTIFIER;
+ return;
}
- // copy the options
- if (dotData.attr) {
- graphData.options = dotData.attr;
+ // something unknown is found, wrong characters, a syntax error
+ tokenType = TOKENTYPE.UNKNOWN;
+ while (c != '') {
+ token += c;
+ next();
}
-
- return graphData;
+ throw new SyntaxError('Syntax error in part "' + chop(token, 30) + '"');
}
- // exports
- exports.parseDOT = parseDOT;
- exports.DOTToGraph = DOTToGraph;
-
-
-/***/ },
-/* 33 */
-/***/ function(module, exports, __webpack_require__) {
-
/**
- * @prototype Point3d
- * @param {Number} [x]
- * @param {Number} [y]
- * @param {Number} [z]
+ * Parse a graph.
+ * @returns {Object} graph
*/
- function Point3d(x, y, z) {
- this.x = x !== undefined ? x : 0;
- this.y = y !== undefined ? y : 0;
- this.z = z !== undefined ? z : 0;
- };
+ function parseGraph() {
+ var graph = {};
- /**
- * Subtract the two provided points, returns a-b
- * @param {Point3d} a
- * @param {Point3d} b
- * @return {Point3d} a-b
- */
- Point3d.subtract = function(a, b) {
- var sub = new Point3d();
- sub.x = a.x - b.x;
- sub.y = a.y - b.y;
- sub.z = a.z - b.z;
- return sub;
- };
+ first();
+ getToken();
- /**
- * Add the two provided points, returns a+b
- * @param {Point3d} a
- * @param {Point3d} b
- * @return {Point3d} a+b
- */
- Point3d.add = function(a, b) {
- var sum = new Point3d();
- sum.x = a.x + b.x;
- sum.y = a.y + b.y;
- sum.z = a.z + b.z;
- return sum;
- };
+ // optional strict keyword
+ if (token == 'strict') {
+ graph.strict = true;
+ getToken();
+ }
- /**
- * Calculate the average of two 3d points
- * @param {Point3d} a
- * @param {Point3d} b
- * @return {Point3d} The average, (a+b)/2
- */
- Point3d.avg = function(a, b) {
- return new Point3d(
- (a.x + b.x) / 2,
- (a.y + b.y) / 2,
- (a.z + b.z) / 2
- );
- };
+ // graph or digraph keyword
+ if (token == 'graph' || token == 'digraph') {
+ graph.type = token;
+ getToken();
+ }
- /**
- * Calculate the cross product of the two provided points, returns axb
- * Documentation: http://en.wikipedia.org/wiki/Cross_product
- * @param {Point3d} a
- * @param {Point3d} b
- * @return {Point3d} cross product axb
- */
- Point3d.crossProduct = function(a, b) {
- var crossproduct = new Point3d();
+ // optional graph id
+ if (tokenType == TOKENTYPE.IDENTIFIER) {
+ graph.id = token;
+ getToken();
+ }
- crossproduct.x = a.y * b.z - a.z * b.y;
- crossproduct.y = a.z * b.x - a.x * b.z;
- crossproduct.z = a.x * b.y - a.y * b.x;
+ // open angle bracket
+ if (token != '{') {
+ throw newSyntaxError('Angle bracket { expected');
+ }
+ getToken();
- return crossproduct;
- };
+ // statements
+ parseStatements(graph);
+ // close angle bracket
+ if (token != '}') {
+ throw newSyntaxError('Angle bracket } expected');
+ }
+ getToken();
- /**
- * Rtrieve the length of the vector (or the distance from this point to the origin
- * @return {Number} length
- */
- Point3d.prototype.length = function() {
- return Math.sqrt(
- this.x * this.x +
- this.y * this.y +
- this.z * this.z
- );
- };
+ // end of file
+ if (token !== '') {
+ throw newSyntaxError('End of file expected');
+ }
+ getToken();
- module.exports = Point3d;
+ // remove temporary default properties
+ delete graph.node;
+ delete graph.edge;
+ delete graph.graph;
+ return graph;
+ }
-/***/ },
-/* 34 */
-/***/ function(module, exports, __webpack_require__) {
+ /**
+ * Parse a list with statements.
+ * @param {Object} graph
+ */
+ function parseStatements (graph) {
+ while (token !== '' && token != '}') {
+ parseStatement(graph);
+ if (token == ';') {
+ getToken();
+ }
+ }
+ }
/**
- * @prototype Point2d
- * @param {Number} [x]
- * @param {Number} [y]
+ * Parse a single statement. Can be a an attribute statement, node
+ * statement, a series of node statements and edge statements, or a
+ * parameter.
+ * @param {Object} graph
*/
- Point2d = function (x, y) {
- this.x = x !== undefined ? x : 0;
- this.y = y !== undefined ? y : 0;
- };
+ function parseStatement(graph) {
+ // parse subgraph
+ var subgraph = parseSubgraph(graph);
+ if (subgraph) {
+ // edge statements
+ parseEdge(graph, subgraph);
- module.exports = Point2d;
+ return;
+ }
+ // parse an attribute statement
+ var attr = parseAttributeStatement(graph);
+ if (attr) {
+ return;
+ }
-/***/ },
-/* 35 */
-/***/ function(module, exports, __webpack_require__) {
+ // parse node
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier expected');
+ }
+ var id = token; // id can be a string or a number
+ getToken();
- var DataView = __webpack_require__(4);
+ if (token == '=') {
+ // id statement
+ getToken();
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier expected');
+ }
+ graph[id] = token;
+ getToken();
+ // TODO: implement comma separated list with "a_list: ID=ID [','] [a_list] "
+ }
+ else {
+ parseNodeStatement(graph, id);
+ }
+ }
/**
- * @class Filter
- *
- * @param {DataSet} data The google data table
- * @param {Number} column The index of the column to be filtered
- * @param {Graph} graph The graph
+ * Parse a subgraph
+ * @param {Object} graph parent graph object
+ * @return {Object | null} subgraph
*/
- function Filter (data, column, graph) {
- this.data = data;
- this.column = column;
- this.graph = graph; // the parent graph
+ function parseSubgraph (graph) {
+ var subgraph = null;
- this.index = undefined;
- this.value = undefined;
+ // optional subgraph keyword
+ if (token == 'subgraph') {
+ subgraph = {};
+ subgraph.type = 'subgraph';
+ getToken();
- // read all distinct values and select the first one
- this.values = graph.getDistinctValues(data.get(), this.column);
+ // optional graph id
+ if (tokenType == TOKENTYPE.IDENTIFIER) {
+ subgraph.id = token;
+ getToken();
+ }
+ }
- // sort both numeric and string values correctly
- this.values.sort(function (a, b) {
- return a > b ? 1 : a < b ? -1 : 0;
- });
+ // open angle bracket
+ if (token == '{') {
+ getToken();
- if (this.values.length > 0) {
- this.selectValue(0);
- }
+ if (!subgraph) {
+ subgraph = {};
+ }
+ subgraph.parent = graph;
+ subgraph.node = graph.node;
+ subgraph.edge = graph.edge;
+ subgraph.graph = graph.graph;
- // create an array with the filtered datapoints. this will be loaded afterwards
- this.dataPoints = [];
+ // statements
+ parseStatements(subgraph);
- this.loaded = false;
- this.onLoadCallback = undefined;
+ // close angle bracket
+ if (token != '}') {
+ throw newSyntaxError('Angle bracket } expected');
+ }
+ getToken();
- if (graph.animationPreload) {
- this.loaded = false;
- this.loadInBackground();
- }
- else {
- this.loaded = true;
+ // remove temporary default properties
+ delete subgraph.node;
+ delete subgraph.edge;
+ delete subgraph.graph;
+ delete subgraph.parent;
+
+ // register at the parent graph
+ if (!graph.subgraphs) {
+ graph.subgraphs = [];
+ }
+ graph.subgraphs.push(subgraph);
}
- };
+ return subgraph;
+ }
/**
- * Return the label
- * @return {string} label
+ * parse an attribute statement like "node [shape=circle fontSize=16]".
+ * Available keywords are 'node', 'edge', 'graph'.
+ * The previous list with default attributes will be replaced
+ * @param {Object} graph
+ * @returns {String | null} keyword Returns the name of the parsed attribute
+ * (node, edge, graph), or null if nothing
+ * is parsed.
*/
- Filter.prototype.isLoaded = function() {
- return this.loaded;
- };
-
+ function parseAttributeStatement (graph) {
+ // attribute statements
+ if (token == 'node') {
+ getToken();
- /**
- * Return the loaded progress
- * @return {Number} percentage between 0 and 100
- */
- Filter.prototype.getLoadedProgress = function() {
- var len = this.values.length;
+ // node attributes
+ graph.node = parseAttributeList();
+ return 'node';
+ }
+ else if (token == 'edge') {
+ getToken();
- var i = 0;
- while (this.dataPoints[i]) {
- i++;
+ // edge attributes
+ graph.edge = parseAttributeList();
+ return 'edge';
}
+ else if (token == 'graph') {
+ getToken();
- return Math.round(i / len * 100);
- };
+ // graph attributes
+ graph.graph = parseAttributeList();
+ return 'graph';
+ }
+ return null;
+ }
/**
- * Return the label
- * @return {string} label
+ * parse a node statement
+ * @param {Object} graph
+ * @param {String | Number} id
*/
- Filter.prototype.getLabel = function() {
- return this.graph.filterLabel;
- };
-
+ function parseNodeStatement(graph, id) {
+ // node statement
+ var node = {
+ id: id
+ };
+ var attr = parseAttributeList();
+ if (attr) {
+ node.attr = attr;
+ }
+ addNode(graph, node);
- /**
- * Return the columnIndex of the filter
- * @return {Number} columnIndex
- */
- Filter.prototype.getColumn = function() {
- return this.column;
- };
+ // edge statements
+ parseEdge(graph, id);
+ }
/**
- * Return the currently selected value. Returns undefined if there is no selection
- * @return {*} value
+ * Parse an edge or a series of edges
+ * @param {Object} graph
+ * @param {String | Number} from Id of the from node
*/
- Filter.prototype.getSelectedValue = function() {
- if (this.index === undefined)
- return undefined;
-
- return this.values[this.index];
- };
+ function parseEdge(graph, from) {
+ while (token == '->' || token == '--') {
+ var to;
+ var type = token;
+ getToken();
- /**
- * Retrieve all values of the filter
- * @return {Array} values
- */
- Filter.prototype.getValues = function() {
- return this.values;
- };
+ var subgraph = parseSubgraph(graph);
+ if (subgraph) {
+ to = subgraph;
+ }
+ else {
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Identifier or subgraph expected');
+ }
+ to = token;
+ addNode(graph, {
+ id: to
+ });
+ getToken();
+ }
- /**
- * Retrieve one value of the filter
- * @param {Number} index
- * @return {*} value
- */
- Filter.prototype.getValue = function(index) {
- if (index >= this.values.length)
- throw 'Error: index out of range';
+ // parse edge attributes
+ var attr = parseAttributeList();
- return this.values[index];
- };
+ // create edge
+ var edge = createEdge(graph, from, to, type, attr);
+ addEdge(graph, edge);
+ from = to;
+ }
+ }
/**
- * Retrieve the (filtered) dataPoints for the currently selected filter index
- * @param {Number} [index] (optional)
- * @return {Array} dataPoints
+ * Parse a set with attributes,
+ * for example [label="1.000", shape=solid]
+ * @return {Object | null} attr
*/
- Filter.prototype._getDataPoints = function(index) {
- if (index === undefined)
- index = this.index;
-
- if (index === undefined)
- return [];
+ function parseAttributeList() {
+ var attr = null;
- var dataPoints;
- if (this.dataPoints[index]) {
- dataPoints = this.dataPoints[index];
- }
- else {
- var f = {};
- f.column = this.column;
- f.value = this.values[index];
+ while (token == '[') {
+ getToken();
+ attr = {};
+ while (token !== '' && token != ']') {
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Attribute name expected');
+ }
+ var name = token;
- var dataView = new DataView(this.data,{filter: function (item) {return (item[f.column] == f.value);}}).get();
- dataPoints = this.graph._getDataPoints(dataView);
+ getToken();
+ if (token != '=') {
+ throw newSyntaxError('Equal sign = expected');
+ }
+ getToken();
- this.dataPoints[index] = dataPoints;
- }
+ if (tokenType != TOKENTYPE.IDENTIFIER) {
+ throw newSyntaxError('Attribute value expected');
+ }
+ var value = token;
+ setValue(attr, name, value); // name can be a path
- return dataPoints;
- };
+ getToken();
+ if (token ==',') {
+ getToken();
+ }
+ }
+ if (token != ']') {
+ throw newSyntaxError('Bracket ] expected');
+ }
+ getToken();
+ }
+ return attr;
+ }
/**
- * Set a callback function when the filter is fully loaded.
+ * Create a syntax error with extra information on current token and index.
+ * @param {String} message
+ * @returns {SyntaxError} err
*/
- Filter.prototype.setOnLoadCallback = function(callback) {
- this.onLoadCallback = callback;
- };
-
+ function newSyntaxError(message) {
+ return new SyntaxError(message + ', got "' + chop(token, 30) + '" (char ' + index + ')');
+ }
/**
- * Add a value to the list with available values for this filter
- * No double entries will be created.
- * @param {Number} index
+ * Chop off text after a maximum length
+ * @param {String} text
+ * @param {Number} maxLength
+ * @returns {String}
*/
- Filter.prototype.selectValue = function(index) {
- if (index >= this.values.length)
- throw 'Error: index out of range';
-
- this.index = index;
- this.value = this.values[index];
- };
+ function chop (text, maxLength) {
+ return (text.length <= maxLength) ? text : (text.substr(0, 27) + '...');
+ }
/**
- * Load all filtered rows in the background one by one
- * Start this method without providing an index!
+ * Execute a function fn for each pair of elements in two arrays
+ * @param {Array | *} array1
+ * @param {Array | *} array2
+ * @param {function} fn
*/
- Filter.prototype.loadInBackground = function(index) {
- if (index === undefined)
- index = 0;
-
- var frame = this.graph.frame;
-
- if (index < this.values.length) {
- var dataPointsTemp = this._getDataPoints(index);
- //this.graph.redrawInfo(); // TODO: not neat
-
- // create a progress box
- if (frame.progress === undefined) {
- frame.progress = document.createElement('DIV');
- frame.progress.style.position = 'absolute';
- frame.progress.style.color = 'gray';
- frame.appendChild(frame.progress);
- }
- var progress = this.getLoadedProgress();
- frame.progress.innerHTML = 'Loading animation... ' + progress + '%';
- // TODO: this is no nice solution...
- frame.progress.style.bottom = 60 + 'px'; // TODO: use height of slider
- frame.progress.style.left = 10 + 'px';
-
- var me = this;
- setTimeout(function() {me.loadInBackground(index+1);}, 10);
- this.loaded = false;
+ function forEach2(array1, array2, fn) {
+ if (array1 instanceof Array) {
+ array1.forEach(function (elem1) {
+ if (array2 instanceof Array) {
+ array2.forEach(function (elem2) {
+ fn(elem1, elem2);
+ });
+ }
+ else {
+ fn(elem1, array2);
+ }
+ });
}
else {
- this.loaded = true;
-
- // remove the progress box
- if (frame.progress !== undefined) {
- frame.removeChild(frame.progress);
- frame.progress = undefined;
+ if (array2 instanceof Array) {
+ array2.forEach(function (elem2) {
+ fn(array1, elem2);
+ });
+ }
+ else {
+ fn(array1, array2);
}
-
- if (this.onLoadCallback)
- this.onLoadCallback();
}
- };
-
- module.exports = Filter;
-
-
-/***/ },
-/* 36 */
-/***/ function(module, exports, __webpack_require__) {
+ }
/**
- * @prototype StepNumber
- * The class StepNumber is an iterator for Numbers. You provide a start and end
- * value, and a best step size. StepNumber itself rounds to fixed values and
- * a finds the step that best fits the provided step.
- *
- * If prettyStep is true, the step size is chosen as close as possible to the
- * provided step, but being a round value like 1, 2, 5, 10, 20, 50, ....
- *
- * Example usage:
- * var step = new StepNumber(0, 10, 2.5, true);
- * step.start();
- * while (!step.end()) {
- * alert(step.getCurrent());
- * step.next();
- * }
- *
- * Version: 1.0
- *
- * @param {Number} start The start value
- * @param {Number} end The end value
- * @param {Number} step Optional. Step size. Must be a positive value.
- * @param {boolean} prettyStep Optional. If true, the step size is rounded
- * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
+ * Convert a string containing a graph in DOT language into a map containing
+ * with nodes and edges in the format of graph.
+ * @param {String} data Text containing a graph in DOT-notation
+ * @return {Object} graphData
*/
- function StepNumber(start, end, step, prettyStep) {
- // set default values
- this._start = 0;
- this._end = 0;
- this._step = 1;
- this.prettyStep = true;
- this.precision = 5;
+ function DOTToGraph (data) {
+ // parse the DOT file
+ var dotData = parseDOT(data);
+ var graphData = {
+ nodes: [],
+ edges: [],
+ options: {}
+ };
- this._current = 0;
- this.setRange(start, end, step, prettyStep);
- };
+ // copy the nodes
+ if (dotData.nodes) {
+ dotData.nodes.forEach(function (dotNode) {
+ var graphNode = {
+ id: dotNode.id,
+ label: String(dotNode.label || dotNode.id)
+ };
+ merge(graphNode, dotNode.attr);
+ if (graphNode.image) {
+ graphNode.shape = 'image';
+ }
+ graphData.nodes.push(graphNode);
+ });
+ }
- /**
- * Set a new range: start, end and step.
- *
- * @param {Number} start The start value
- * @param {Number} end The end value
- * @param {Number} step Optional. Step size. Must be a positive value.
- * @param {boolean} prettyStep Optional. If true, the step size is rounded
- * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
- */
- StepNumber.prototype.setRange = function(start, end, step, prettyStep) {
- this._start = start ? start : 0;
- this._end = end ? end : 0;
+ // copy the edges
+ if (dotData.edges) {
+ /**
+ * Convert an edge in DOT format to an edge with VisGraph format
+ * @param {Object} dotEdge
+ * @returns {Object} graphEdge
+ */
+ function convertEdge(dotEdge) {
+ var graphEdge = {
+ from: dotEdge.from,
+ to: dotEdge.to
+ };
+ merge(graphEdge, dotEdge.attr);
+ graphEdge.style = (dotEdge.type == '->') ? 'arrow' : 'line';
+ return graphEdge;
+ }
- this.setStep(step, prettyStep);
- };
+ dotData.edges.forEach(function (dotEdge) {
+ var from, to;
+ if (dotEdge.from instanceof Object) {
+ from = dotEdge.from.nodes;
+ }
+ else {
+ from = {
+ id: dotEdge.from
+ }
+ }
- /**
- * Set a new step size
- * @param {Number} step New step size. Must be a positive value
- * @param {boolean} prettyStep Optional. If true, the provided step is rounded
- * to a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
- */
- StepNumber.prototype.setStep = function(step, prettyStep) {
- if (step === undefined || step <= 0)
- return;
+ if (dotEdge.to instanceof Object) {
+ to = dotEdge.to.nodes;
+ }
+ else {
+ to = {
+ id: dotEdge.to
+ }
+ }
- if (prettyStep !== undefined)
- this.prettyStep = prettyStep;
+ if (dotEdge.from instanceof Object && dotEdge.from.edges) {
+ dotEdge.from.edges.forEach(function (subEdge) {
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+ }
- if (this.prettyStep === true)
- this._step = StepNumber.calculatePrettyStep(step);
- else
- this._step = step;
- };
+ forEach2(from, to, function (from, to) {
+ var subEdge = createEdge(graphData, from.id, to.id, dotEdge.type, dotEdge.attr);
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
- /**
- * Calculate a nice step size, closest to the desired step size.
- * Returns a value in one of the ranges 1*10^n, 2*10^n, or 5*10^n, where n is an
- * integer Number. For example 1, 2, 5, 10, 20, 50, etc...
- * @param {Number} step Desired step size
- * @return {Number} Nice step size
- */
- StepNumber.calculatePrettyStep = function (step) {
- var log10 = function (x) {return Math.log(x) / Math.LN10;};
+ if (dotEdge.to instanceof Object && dotEdge.to.edges) {
+ dotEdge.to.edges.forEach(function (subEdge) {
+ var graphEdge = convertEdge(subEdge);
+ graphData.edges.push(graphEdge);
+ });
+ }
+ });
+ }
- // try three steps (multiple of 1, 2, or 5
- var step1 = Math.pow(10, Math.round(log10(step))),
- step2 = 2 * Math.pow(10, Math.round(log10(step / 2))),
- step5 = 5 * Math.pow(10, Math.round(log10(step / 5)));
+ // copy the options
+ if (dotData.attr) {
+ graphData.options = dotData.attr;
+ }
- // choose the best step (closest to minimum step)
- var prettyStep = step1;
- if (Math.abs(step2 - step) <= Math.abs(prettyStep - step)) prettyStep = step2;
- if (Math.abs(step5 - step) <= Math.abs(prettyStep - step)) prettyStep = step5;
+ return graphData;
+ }
- // for safety
- if (prettyStep <= 0) {
- prettyStep = 1;
- }
+ // exports
+ exports.parseDOT = parseDOT;
+ exports.DOTToGraph = DOTToGraph;
- return prettyStep;
- };
+
+/***/ },
+/* 33 */
+/***/ function(module, exports, __webpack_require__) {
/**
- * returns the current value of the step
- * @return {Number} current value
+ * @prototype Point3d
+ * @param {Number} [x]
+ * @param {Number} [y]
+ * @param {Number} [z]
*/
- StepNumber.prototype.getCurrent = function () {
- return parseFloat(this._current.toPrecision(this.precision));
+ function Point3d(x, y, z) {
+ this.x = x !== undefined ? x : 0;
+ this.y = y !== undefined ? y : 0;
+ this.z = z !== undefined ? z : 0;
};
/**
- * returns the current step size
- * @return {Number} current step size
+ * Subtract the two provided points, returns a-b
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} a-b
*/
- StepNumber.prototype.getStep = function () {
- return this._step;
+ Point3d.subtract = function(a, b) {
+ var sub = new Point3d();
+ sub.x = a.x - b.x;
+ sub.y = a.y - b.y;
+ sub.z = a.z - b.z;
+ return sub;
};
/**
- * Set the current value to the largest value smaller than start, which
- * is a multiple of the step size
+ * Add the two provided points, returns a+b
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} a+b
*/
- StepNumber.prototype.start = function() {
- this._current = this._start - this._start % this._step;
+ Point3d.add = function(a, b) {
+ var sum = new Point3d();
+ sum.x = a.x + b.x;
+ sum.y = a.y + b.y;
+ sum.z = a.z + b.z;
+ return sum;
};
/**
- * Do a step, add the step size to the current value
+ * Calculate the average of two 3d points
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} The average, (a+b)/2
*/
- StepNumber.prototype.next = function () {
- this._current += this._step;
+ Point3d.avg = function(a, b) {
+ return new Point3d(
+ (a.x + b.x) / 2,
+ (a.y + b.y) / 2,
+ (a.z + b.z) / 2
+ );
};
/**
- * Returns true whether the end is reached
- * @return {boolean} True if the current value has passed the end value.
+ * Calculate the cross product of the two provided points, returns axb
+ * Documentation: http://en.wikipedia.org/wiki/Cross_product
+ * @param {Point3d} a
+ * @param {Point3d} b
+ * @return {Point3d} cross product axb
*/
- StepNumber.prototype.end = function () {
- return (this._current > this._end);
- };
+ Point3d.crossProduct = function(a, b) {
+ var crossproduct = new Point3d();
- module.exports = StepNumber;
+ crossproduct.x = a.y * b.z - a.z * b.y;
+ crossproduct.y = a.z * b.x - a.x * b.z;
+ crossproduct.z = a.x * b.y - a.y * b.x;
+ return crossproduct;
+ };
-/***/ },
-/* 37 */
-/***/ function(module, exports, __webpack_require__) {
/**
- * Canvas shapes used by Network
+ * Rtrieve the length of the vector (or the distance from this point to the origin
+ * @return {Number} length
*/
- if (typeof CanvasRenderingContext2D !== 'undefined') {
-
- /**
- * Draw a circle shape
- */
- CanvasRenderingContext2D.prototype.circle = function(x, y, r) {
- this.beginPath();
- this.arc(x, y, r, 0, 2*Math.PI, false);
- };
-
- /**
- * Draw a square shape
- * @param {Number} x horizontal center
- * @param {Number} y vertical center
- * @param {Number} r size, width and height of the square
- */
- CanvasRenderingContext2D.prototype.square = function(x, y, r) {
- this.beginPath();
- this.rect(x - r, y - r, r * 2, r * 2);
- };
-
- /**
- * Draw a triangle shape
- * @param {Number} x horizontal center
- * @param {Number} y vertical center
- * @param {Number} r radius, half the length of the sides of the triangle
- */
- CanvasRenderingContext2D.prototype.triangle = function(x, y, r) {
- // http://en.wikipedia.org/wiki/Equilateral_triangle
- this.beginPath();
-
- var s = r * 2;
- var s2 = s / 2;
- var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
- var h = Math.sqrt(s * s - s2 * s2); // height
-
- this.moveTo(x, y - (h - ir));
- this.lineTo(x + s2, y + ir);
- this.lineTo(x - s2, y + ir);
- this.lineTo(x, y - (h - ir));
- this.closePath();
- };
-
- /**
- * Draw a triangle shape in downward orientation
- * @param {Number} x horizontal center
- * @param {Number} y vertical center
- * @param {Number} r radius
- */
- CanvasRenderingContext2D.prototype.triangleDown = function(x, y, r) {
- // http://en.wikipedia.org/wiki/Equilateral_triangle
- this.beginPath();
-
- var s = r * 2;
- var s2 = s / 2;
- var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
- var h = Math.sqrt(s * s - s2 * s2); // height
-
- this.moveTo(x, y + (h - ir));
- this.lineTo(x + s2, y - ir);
- this.lineTo(x - s2, y - ir);
- this.lineTo(x, y + (h - ir));
- this.closePath();
- };
-
- /**
- * Draw a star shape, a star with 5 points
- * @param {Number} x horizontal center
- * @param {Number} y vertical center
- * @param {Number} r radius, half the length of the sides of the triangle
- */
- CanvasRenderingContext2D.prototype.star = function(x, y, r) {
- // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/
- this.beginPath();
-
- for (var n = 0; n < 10; n++) {
- var radius = (n % 2 === 0) ? r * 1.3 : r * 0.5;
- this.lineTo(
- x + radius * Math.sin(n * 2 * Math.PI / 10),
- y - radius * Math.cos(n * 2 * Math.PI / 10)
- );
- }
-
- this.closePath();
- };
-
- /**
- * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas
- */
- CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
- var r2d = Math.PI/180;
- if( w - ( 2 * r ) < 0 ) { r = ( w / 2 ); } //ensure that the radius isn't too large for x
- if( h - ( 2 * r ) < 0 ) { r = ( h / 2 ); } //ensure that the radius isn't too large for y
- this.beginPath();
- this.moveTo(x+r,y);
- this.lineTo(x+w-r,y);
- this.arc(x+w-r,y+r,r,r2d*270,r2d*360,false);
- this.lineTo(x+w,y+h-r);
- this.arc(x+w-r,y+h-r,r,0,r2d*90,false);
- this.lineTo(x+r,y+h);
- this.arc(x+r,y+h-r,r,r2d*90,r2d*180,false);
- this.lineTo(x,y+r);
- this.arc(x+r,y+r,r,r2d*180,r2d*270,false);
- };
-
- /**
- * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
- */
- CanvasRenderingContext2D.prototype.ellipse = function(x, y, w, h) {
- var kappa = .5522848,
- ox = (w / 2) * kappa, // control point offset horizontal
- oy = (h / 2) * kappa, // control point offset vertical
- xe = x + w, // x-end
- ye = y + h, // y-end
- xm = x + w / 2, // x-middle
- ym = y + h / 2; // y-middle
-
- this.beginPath();
- this.moveTo(x, ym);
- this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
- this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
- this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
- this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
- };
-
-
-
- /**
- * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
- */
- CanvasRenderingContext2D.prototype.database = function(x, y, w, h) {
- var f = 1/3;
- var wEllipse = w;
- var hEllipse = h * f;
-
- var kappa = .5522848,
- ox = (wEllipse / 2) * kappa, // control point offset horizontal
- oy = (hEllipse / 2) * kappa, // control point offset vertical
- xe = x + wEllipse, // x-end
- ye = y + hEllipse, // y-end
- xm = x + wEllipse / 2, // x-middle
- ym = y + hEllipse / 2, // y-middle
- ymb = y + (h - hEllipse/2), // y-midlle, bottom ellipse
- yeb = y + h; // y-end, bottom ellipse
-
- this.beginPath();
- this.moveTo(xe, ym);
+ Point3d.prototype.length = function() {
+ return Math.sqrt(
+ this.x * this.x +
+ this.y * this.y +
+ this.z * this.z
+ );
+ };
- this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
- this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
+ module.exports = Point3d;
- this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
- this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
- this.lineTo(xe, ymb);
+/***/ },
+/* 34 */
+/***/ function(module, exports, __webpack_require__) {
- this.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb);
- this.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb);
+ /**
+ * @prototype Point2d
+ * @param {Number} [x]
+ * @param {Number} [y]
+ */
+ Point2d = function (x, y) {
+ this.x = x !== undefined ? x : 0;
+ this.y = y !== undefined ? y : 0;
+ };
- this.lineTo(x, ym);
- };
+ module.exports = Point2d;
- /**
- * Draw an arrow point (no line)
- */
- CanvasRenderingContext2D.prototype.arrow = function(x, y, angle, length) {
- // tail
- var xt = x - length * Math.cos(angle);
- var yt = y - length * Math.sin(angle);
+/***/ },
+/* 35 */
+/***/ function(module, exports, __webpack_require__) {
- // inner tail
- // TODO: allow to customize different shapes
- var xi = x - length * 0.9 * Math.cos(angle);
- var yi = y - length * 0.9 * Math.sin(angle);
+ var DataView = __webpack_require__(4);
- // left
- var xl = xt + length / 3 * Math.cos(angle + 0.5 * Math.PI);
- var yl = yt + length / 3 * Math.sin(angle + 0.5 * Math.PI);
+ /**
+ * @class Filter
+ *
+ * @param {DataSet} data The google data table
+ * @param {Number} column The index of the column to be filtered
+ * @param {Graph} graph The graph
+ */
+ function Filter (data, column, graph) {
+ this.data = data;
+ this.column = column;
+ this.graph = graph; // the parent graph
- // right
- var xr = xt + length / 3 * Math.cos(angle - 0.5 * Math.PI);
- var yr = yt + length / 3 * Math.sin(angle - 0.5 * Math.PI);
+ this.index = undefined;
+ this.value = undefined;
- this.beginPath();
- this.moveTo(x, y);
- this.lineTo(xl, yl);
- this.lineTo(xi, yi);
- this.lineTo(xr, yr);
- this.closePath();
- };
+ // read all distinct values and select the first one
+ this.values = graph.getDistinctValues(data.get(), this.column);
- /**
- * Sets up the dashedLine functionality for drawing
- * Original code came from http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas
- * @author David Jordan
- * @date 2012-08-08
- */
- CanvasRenderingContext2D.prototype.dashedLine = function(x,y,x2,y2,dashArray){
- if (!dashArray) dashArray=[10,5];
- if (dashLength==0) dashLength = 0.001; // Hack for Safari
- var dashCount = dashArray.length;
- this.moveTo(x, y);
- var dx = (x2-x), dy = (y2-y);
- var slope = dy/dx;
- var distRemaining = Math.sqrt( dx*dx + dy*dy );
- var dashIndex=0, draw=true;
- while (distRemaining>=0.1){
- var dashLength = dashArray[dashIndex++%dashCount];
- if (dashLength > distRemaining) dashLength = distRemaining;
- var xStep = Math.sqrt( dashLength*dashLength / (1 + slope*slope) );
- if (dx<0) xStep = -xStep;
- x += xStep;
- y += slope*xStep;
- this[draw ? 'lineTo' : 'moveTo'](x,y);
- distRemaining -= dashLength;
- draw = !draw;
- }
- };
+ // sort both numeric and string values correctly
+ this.values.sort(function (a, b) {
+ return a > b ? 1 : a < b ? -1 : 0;
+ });
- // TODO: add diamond shape
- }
+ if (this.values.length > 0) {
+ this.selectValue(0);
+ }
+ // create an array with the filtered datapoints. this will be loaded afterwards
+ this.dataPoints = [];
-/***/ },
-/* 38 */
-/***/ function(module, exports, __webpack_require__) {
+ this.loaded = false;
+ this.onLoadCallback = undefined;
- // Only load hammer.js when in a browser environment
- // (loading hammer.js in a node.js environment gives errors)
- if (typeof window !== 'undefined') {
- module.exports = window['Hammer'] || __webpack_require__(50);
- // TODO: throw an error when hammerjs is not available?
- }
- else {
- module.exports = function () {
- throw Error('hammer.js is only available in a browser, not in node.js.');
+ if (graph.animationPreload) {
+ this.loaded = false;
+ this.loadInBackground();
}
- }
+ else {
+ this.loaded = true;
+ }
+ };
-/***/ },
-/* 39 */
-/***/ function(module, exports, __webpack_require__) {
+ /**
+ * Return the label
+ * @return {string} label
+ */
+ Filter.prototype.isLoaded = function() {
+ return this.loaded;
+ };
- // first check if moment.js is already loaded in the browser window, if so,
- // use this instance. Else, load via commonjs.
- module.exports = (typeof window !== 'undefined') && window['moment'] || __webpack_require__(51);
+ /**
+ * Return the loaded progress
+ * @return {Number} percentage between 0 and 100
+ */
+ Filter.prototype.getLoadedProgress = function() {
+ var len = this.values.length;
+
+ var i = 0;
+ while (this.dataPoints[i]) {
+ i++;
+ }
-/***/ },
-/* 40 */
-/***/ function(module, exports, __webpack_require__) {
+ return Math.round(i / len * 100);
+ };
- var PhysicsMixin = __webpack_require__(49);
- var ClusterMixin = __webpack_require__(42);
- var SectorsMixin = __webpack_require__(43);
- var SelectionMixin = __webpack_require__(44);
- var ManipulationMixin = __webpack_require__(45);
- var NavigationMixin = __webpack_require__(46);
- var HierarchicalLayoutMixin = __webpack_require__(47);
/**
- * Load a mixin into the network object
- *
- * @param {Object} sourceVariable | this object has to contain functions.
- * @private
+ * Return the label
+ * @return {string} label
*/
- exports._loadMixin = function (sourceVariable) {
- for (var mixinFunction in sourceVariable) {
- if (sourceVariable.hasOwnProperty(mixinFunction)) {
- this[mixinFunction] = sourceVariable[mixinFunction];
- }
- }
+ Filter.prototype.getLabel = function() {
+ return this.graph.filterLabel;
};
/**
- * removes a mixin from the network object.
- *
- * @param {Object} sourceVariable | this object has to contain functions.
- * @private
+ * Return the columnIndex of the filter
+ * @return {Number} columnIndex
*/
- exports._clearMixin = function (sourceVariable) {
- for (var mixinFunction in sourceVariable) {
- if (sourceVariable.hasOwnProperty(mixinFunction)) {
- this[mixinFunction] = undefined;
- }
- }
+ Filter.prototype.getColumn = function() {
+ return this.column;
};
-
/**
- * Mixin the physics system and initialize the parameters required.
- *
- * @private
+ * Return the currently selected value. Returns undefined if there is no selection
+ * @return {*} value
*/
- exports._loadPhysicsSystem = function () {
- this._loadMixin(PhysicsMixin);
- this._loadSelectedForceSolver();
- if (this.constants.configurePhysics == true) {
- this._loadPhysicsConfiguration();
- }
+ Filter.prototype.getSelectedValue = function() {
+ if (this.index === undefined)
+ return undefined;
+
+ return this.values[this.index];
};
+ /**
+ * Retrieve all values of the filter
+ * @return {Array} values
+ */
+ Filter.prototype.getValues = function() {
+ return this.values;
+ };
/**
- * Mixin the cluster system and initialize the parameters required.
- *
- * @private
+ * Retrieve one value of the filter
+ * @param {Number} index
+ * @return {*} value
*/
- exports._loadClusterSystem = function () {
- this.clusterSession = 0;
- this.hubThreshold = 5;
- this._loadMixin(ClusterMixin);
+ Filter.prototype.getValue = function(index) {
+ if (index >= this.values.length)
+ throw 'Error: index out of range';
+
+ return this.values[index];
};
/**
- * Mixin the sector system and initialize the parameters required
- *
- * @private
+ * Retrieve the (filtered) dataPoints for the currently selected filter index
+ * @param {Number} [index] (optional)
+ * @return {Array} dataPoints
*/
- exports._loadSectorSystem = function () {
- this.sectors = {};
- this.activeSector = ["default"];
- this.sectors["active"] = {};
- this.sectors["active"]["default"] = {"nodes": {},
- "edges": {},
- "nodeIndices": [],
- "formationScale": 1.0,
- "drawingNode": undefined };
- this.sectors["frozen"] = {};
- this.sectors["support"] = {"nodes": {},
- "edges": {},
- "nodeIndices": [],
- "formationScale": 1.0,
- "drawingNode": undefined };
+ Filter.prototype._getDataPoints = function(index) {
+ if (index === undefined)
+ index = this.index;
+
+ if (index === undefined)
+ return [];
+
+ var dataPoints;
+ if (this.dataPoints[index]) {
+ dataPoints = this.dataPoints[index];
+ }
+ else {
+ var f = {};
+ f.column = this.column;
+ f.value = this.values[index];
- this.nodeIndices = this.sectors["active"]["default"]["nodeIndices"]; // the node indices list is used to speed up the computation of the repulsion fields
+ var dataView = new DataView(this.data,{filter: function (item) {return (item[f.column] == f.value);}}).get();
+ dataPoints = this.graph._getDataPoints(dataView);
- this._loadMixin(SectorsMixin);
+ this.dataPoints[index] = dataPoints;
+ }
+
+ return dataPoints;
};
+
/**
- * Mixin the selection system and initialize the parameters required
- *
- * @private
+ * Set a callback function when the filter is fully loaded.
*/
- exports._loadSelectionSystem = function () {
- this.selectionObj = {nodes: {}, edges: {}};
-
- this._loadMixin(SelectionMixin);
+ Filter.prototype.setOnLoadCallback = function(callback) {
+ this.onLoadCallback = callback;
};
/**
- * Mixin the navigationUI (User Interface) system and initialize the parameters required
- *
- * @private
+ * Add a value to the list with available values for this filter
+ * No double entries will be created.
+ * @param {Number} index
*/
- exports._loadManipulationSystem = function () {
- // reset global variables -- these are used by the selection of nodes and edges.
- this.blockConnectingEdgeSelection = false;
- this.forceAppendSelection = false;
+ Filter.prototype.selectValue = function(index) {
+ if (index >= this.values.length)
+ throw 'Error: index out of range';
- if (this.constants.dataManipulation.enabled == true) {
- // load the manipulator HTML elements. All styling done in css.
- if (this.manipulationDiv === undefined) {
- this.manipulationDiv = document.createElement('div');
- this.manipulationDiv.className = 'network-manipulationDiv';
- this.manipulationDiv.id = 'network-manipulationDiv';
- if (this.editMode == true) {
- this.manipulationDiv.style.display = "block";
- }
- else {
- this.manipulationDiv.style.display = "none";
- }
- this.containerElement.insertBefore(this.manipulationDiv, this.frame);
- }
+ this.index = index;
+ this.value = this.values[index];
+ };
- if (this.editModeDiv === undefined) {
- this.editModeDiv = document.createElement('div');
- this.editModeDiv.className = 'network-manipulation-editMode';
- this.editModeDiv.id = 'network-manipulation-editMode';
- if (this.editMode == true) {
- this.editModeDiv.style.display = "none";
- }
- else {
- this.editModeDiv.style.display = "block";
- }
- this.containerElement.insertBefore(this.editModeDiv, this.frame);
- }
+ /**
+ * Load all filtered rows in the background one by one
+ * Start this method without providing an index!
+ */
+ Filter.prototype.loadInBackground = function(index) {
+ if (index === undefined)
+ index = 0;
- if (this.closeDiv === undefined) {
- this.closeDiv = document.createElement('div');
- this.closeDiv.className = 'network-manipulation-closeDiv';
- this.closeDiv.id = 'network-manipulation-closeDiv';
- this.closeDiv.style.display = this.manipulationDiv.style.display;
- this.containerElement.insertBefore(this.closeDiv, this.frame);
- }
+ var frame = this.graph.frame;
- // load the manipulation functions
- this._loadMixin(ManipulationMixin);
+ if (index < this.values.length) {
+ var dataPointsTemp = this._getDataPoints(index);
+ //this.graph.redrawInfo(); // TODO: not neat
- // create the manipulator toolbar
- this._createManipulatorBar();
+ // create a progress box
+ if (frame.progress === undefined) {
+ frame.progress = document.createElement('DIV');
+ frame.progress.style.position = 'absolute';
+ frame.progress.style.color = 'gray';
+ frame.appendChild(frame.progress);
+ }
+ var progress = this.getLoadedProgress();
+ frame.progress.innerHTML = 'Loading animation... ' + progress + '%';
+ // TODO: this is no nice solution...
+ frame.progress.style.bottom = 60 + 'px'; // TODO: use height of slider
+ frame.progress.style.left = 10 + 'px';
+
+ var me = this;
+ setTimeout(function() {me.loadInBackground(index+1);}, 10);
+ this.loaded = false;
}
else {
- if (this.manipulationDiv !== undefined) {
- // removes all the bindings and overloads
- this._createManipulatorBar();
- // remove the manipulation divs
- this.containerElement.removeChild(this.manipulationDiv);
- this.containerElement.removeChild(this.editModeDiv);
- this.containerElement.removeChild(this.closeDiv);
+ this.loaded = true;
- this.manipulationDiv = undefined;
- this.editModeDiv = undefined;
- this.closeDiv = undefined;
- // remove the mixin functions
- this._clearMixin(ManipulationMixin);
+ // remove the progress box
+ if (frame.progress !== undefined) {
+ frame.removeChild(frame.progress);
+ frame.progress = undefined;
}
- }
- };
-
-
- /**
- * Mixin the navigation (User Interface) system and initialize the parameters required
- *
- * @private
- */
- exports._loadNavigationControls = function () {
- this._loadMixin(NavigationMixin);
- // the clean function removes the button divs, this is done to remove the bindings.
- this._cleanNavigation();
- if (this.constants.navigation.enabled == true) {
- this._loadNavigationElements();
+ if (this.onLoadCallback)
+ this.onLoadCallback();
}
};
-
- /**
- * Mixin the hierarchical layout system.
- *
- * @private
- */
- exports._loadHierarchySystem = function () {
- this._loadMixin(HierarchicalLayoutMixin);
- };
+ module.exports = Filter;
/***/ },
-/* 41 */
+/* 36 */
/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Expose `Emitter`.
- */
-
- module.exports = Emitter;
-
/**
- * Initialize a new `Emitter`.
+ * @prototype StepNumber
+ * The class StepNumber is an iterator for Numbers. You provide a start and end
+ * value, and a best step size. StepNumber itself rounds to fixed values and
+ * a finds the step that best fits the provided step.
*
- * @api public
- */
-
- function Emitter(obj) {
- if (obj) return mixin(obj);
- };
-
- /**
- * Mixin the emitter properties.
+ * If prettyStep is true, the step size is chosen as close as possible to the
+ * provided step, but being a round value like 1, 2, 5, 10, 20, 50, ....
*
- * @param {Object} obj
- * @return {Object}
- * @api private
+ * Example usage:
+ * var step = new StepNumber(0, 10, 2.5, true);
+ * step.start();
+ * while (!step.end()) {
+ * alert(step.getCurrent());
+ * step.next();
+ * }
+ *
+ * Version: 1.0
+ *
+ * @param {Number} start The start value
+ * @param {Number} end The end value
+ * @param {Number} step Optional. Step size. Must be a positive value.
+ * @param {boolean} prettyStep Optional. If true, the step size is rounded
+ * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
*/
+ function StepNumber(start, end, step, prettyStep) {
+ // set default values
+ this._start = 0;
+ this._end = 0;
+ this._step = 1;
+ this.prettyStep = true;
+ this.precision = 5;
- function mixin(obj) {
- for (var key in Emitter.prototype) {
- obj[key] = Emitter.prototype[key];
- }
- return obj;
- }
+ this._current = 0;
+ this.setRange(start, end, step, prettyStep);
+ };
/**
- * Listen on the given `event` with `fn`.
+ * Set a new range: start, end and step.
*
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
+ * @param {Number} start The start value
+ * @param {Number} end The end value
+ * @param {Number} step Optional. Step size. Must be a positive value.
+ * @param {boolean} prettyStep Optional. If true, the step size is rounded
+ * To a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
*/
+ StepNumber.prototype.setRange = function(start, end, step, prettyStep) {
+ this._start = start ? start : 0;
+ this._end = end ? end : 0;
- Emitter.prototype.on =
- Emitter.prototype.addEventListener = function(event, fn){
- this._callbacks = this._callbacks || {};
- (this._callbacks[event] = this._callbacks[event] || [])
- .push(fn);
- return this;
+ this.setStep(step, prettyStep);
};
/**
- * Adds an `event` listener that will be invoked a single
- * time then automatically removed.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
+ * Set a new step size
+ * @param {Number} step New step size. Must be a positive value
+ * @param {boolean} prettyStep Optional. If true, the provided step is rounded
+ * to a pretty step size (like 1, 2, 5, 10, 20, 50, ...)
*/
+ StepNumber.prototype.setStep = function(step, prettyStep) {
+ if (step === undefined || step <= 0)
+ return;
- Emitter.prototype.once = function(event, fn){
- var self = this;
- this._callbacks = this._callbacks || {};
-
- function on() {
- self.off(event, on);
- fn.apply(this, arguments);
- }
+ if (prettyStep !== undefined)
+ this.prettyStep = prettyStep;
- on.fn = fn;
- this.on(event, on);
- return this;
+ if (this.prettyStep === true)
+ this._step = StepNumber.calculatePrettyStep(step);
+ else
+ this._step = step;
};
/**
- * Remove the given callback for `event` or all
- * registered callbacks.
- *
- * @param {String} event
- * @param {Function} fn
- * @return {Emitter}
- * @api public
+ * Calculate a nice step size, closest to the desired step size.
+ * Returns a value in one of the ranges 1*10^n, 2*10^n, or 5*10^n, where n is an
+ * integer Number. For example 1, 2, 5, 10, 20, 50, etc...
+ * @param {Number} step Desired step size
+ * @return {Number} Nice step size
*/
+ StepNumber.calculatePrettyStep = function (step) {
+ var log10 = function (x) {return Math.log(x) / Math.LN10;};
- Emitter.prototype.off =
- Emitter.prototype.removeListener =
- Emitter.prototype.removeAllListeners =
- Emitter.prototype.removeEventListener = function(event, fn){
- this._callbacks = this._callbacks || {};
-
- // all
- if (0 == arguments.length) {
- this._callbacks = {};
- return this;
- }
+ // try three steps (multiple of 1, 2, or 5
+ var step1 = Math.pow(10, Math.round(log10(step))),
+ step2 = 2 * Math.pow(10, Math.round(log10(step / 2))),
+ step5 = 5 * Math.pow(10, Math.round(log10(step / 5)));
- // specific event
- var callbacks = this._callbacks[event];
- if (!callbacks) return this;
+ // choose the best step (closest to minimum step)
+ var prettyStep = step1;
+ if (Math.abs(step2 - step) <= Math.abs(prettyStep - step)) prettyStep = step2;
+ if (Math.abs(step5 - step) <= Math.abs(prettyStep - step)) prettyStep = step5;
- // remove all handlers
- if (1 == arguments.length) {
- delete this._callbacks[event];
- return this;
+ // for safety
+ if (prettyStep <= 0) {
+ prettyStep = 1;
}
- // remove specific handler
- var cb;
- for (var i = 0; i < callbacks.length; i++) {
- cb = callbacks[i];
- if (cb === fn || cb.fn === fn) {
- callbacks.splice(i, 1);
- break;
- }
- }
- return this;
+ return prettyStep;
};
/**
- * Emit `event` with the given args.
- *
- * @param {String} event
- * @param {Mixed} ...
- * @return {Emitter}
+ * returns the current value of the step
+ * @return {Number} current value
*/
-
- Emitter.prototype.emit = function(event){
- this._callbacks = this._callbacks || {};
- var args = [].slice.call(arguments, 1)
- , callbacks = this._callbacks[event];
-
- if (callbacks) {
- callbacks = callbacks.slice(0);
- for (var i = 0, len = callbacks.length; i < len; ++i) {
- callbacks[i].apply(this, args);
- }
- }
-
- return this;
+ StepNumber.prototype.getCurrent = function () {
+ return parseFloat(this._current.toPrecision(this.precision));
};
/**
- * Return array of callbacks for `event`.
- *
- * @param {String} event
- * @return {Array}
- * @api public
+ * returns the current step size
+ * @return {Number} current step size
*/
+ StepNumber.prototype.getStep = function () {
+ return this._step;
+ };
- Emitter.prototype.listeners = function(event){
- this._callbacks = this._callbacks || {};
- return this._callbacks[event] || [];
+ /**
+ * Set the current value to the largest value smaller than start, which
+ * is a multiple of the step size
+ */
+ StepNumber.prototype.start = function() {
+ this._current = this._start - this._start % this._step;
};
/**
- * Check if this emitter has `event` handlers.
- *
- * @param {String} event
- * @return {Boolean}
- * @api public
+ * Do a step, add the step size to the current value
*/
+ StepNumber.prototype.next = function () {
+ this._current += this._step;
+ };
- Emitter.prototype.hasListeners = function(event){
- return !! this.listeners(event).length;
+ /**
+ * Returns true whether the end is reached
+ * @return {boolean} True if the current value has passed the end value.
+ */
+ StepNumber.prototype.end = function () {
+ return (this._current > this._end);
};
+ module.exports = StepNumber;
+
/***/ },
-/* 42 */
+/* 37 */
/***/ function(module, exports, __webpack_require__) {
/**
- * Creation of the ClusterMixin var.
- *
- * This contains all the functions the Network object can use to employ clustering
+ * Canvas shapes used by Network
*/
+ if (typeof CanvasRenderingContext2D !== 'undefined') {
- /**
- * This is only called in the constructor of the network object
- *
- */
- exports.startWithClustering = function() {
- // cluster if the data set is big
- this.clusterToFit(this.constants.clustering.initialMaxNodes, true);
+ /**
+ * Draw a circle shape
+ */
+ CanvasRenderingContext2D.prototype.circle = function(x, y, r) {
+ this.beginPath();
+ this.arc(x, y, r, 0, 2*Math.PI, false);
+ };
- // updates the lables after clustering
- this.updateLabels();
+ /**
+ * Draw a square shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r size, width and height of the square
+ */
+ CanvasRenderingContext2D.prototype.square = function(x, y, r) {
+ this.beginPath();
+ this.rect(x - r, y - r, r * 2, r * 2);
+ };
- // this is called here because if clusterin is disabled, the start and stabilize are called in
- // the setData function.
- if (this.stabilize) {
- this._stabilize();
- }
- this.start();
- };
+ /**
+ * Draw a triangle shape
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.triangle = function(x, y, r) {
+ // http://en.wikipedia.org/wiki/Equilateral_triangle
+ this.beginPath();
- /**
- * This function clusters until the initialMaxNodes has been reached
- *
- * @param {Number} maxNumberOfNodes
- * @param {Boolean} reposition
- */
- exports.clusterToFit = function(maxNumberOfNodes, reposition) {
- var numberOfNodes = this.nodeIndices.length;
+ var s = r * 2;
+ var s2 = s / 2;
+ var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
+ var h = Math.sqrt(s * s - s2 * s2); // height
- var maxLevels = 50;
- var level = 0;
+ this.moveTo(x, y - (h - ir));
+ this.lineTo(x + s2, y + ir);
+ this.lineTo(x - s2, y + ir);
+ this.lineTo(x, y - (h - ir));
+ this.closePath();
+ };
+
+ /**
+ * Draw a triangle shape in downward orientation
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius
+ */
+ CanvasRenderingContext2D.prototype.triangleDown = function(x, y, r) {
+ // http://en.wikipedia.org/wiki/Equilateral_triangle
+ this.beginPath();
+
+ var s = r * 2;
+ var s2 = s / 2;
+ var ir = Math.sqrt(3) / 6 * s; // radius of inner circle
+ var h = Math.sqrt(s * s - s2 * s2); // height
+
+ this.moveTo(x, y + (h - ir));
+ this.lineTo(x + s2, y - ir);
+ this.lineTo(x - s2, y - ir);
+ this.lineTo(x, y + (h - ir));
+ this.closePath();
+ };
+
+ /**
+ * Draw a star shape, a star with 5 points
+ * @param {Number} x horizontal center
+ * @param {Number} y vertical center
+ * @param {Number} r radius, half the length of the sides of the triangle
+ */
+ CanvasRenderingContext2D.prototype.star = function(x, y, r) {
+ // http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/
+ this.beginPath();
+
+ for (var n = 0; n < 10; n++) {
+ var radius = (n % 2 === 0) ? r * 1.3 : r * 0.5;
+ this.lineTo(
+ x + radius * Math.sin(n * 2 * Math.PI / 10),
+ y - radius * Math.cos(n * 2 * Math.PI / 10)
+ );
+ }
+
+ this.closePath();
+ };
+
+ /**
+ * http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas
+ */
+ CanvasRenderingContext2D.prototype.roundRect = function(x, y, w, h, r) {
+ var r2d = Math.PI/180;
+ if( w - ( 2 * r ) < 0 ) { r = ( w / 2 ); } //ensure that the radius isn't too large for x
+ if( h - ( 2 * r ) < 0 ) { r = ( h / 2 ); } //ensure that the radius isn't too large for y
+ this.beginPath();
+ this.moveTo(x+r,y);
+ this.lineTo(x+w-r,y);
+ this.arc(x+w-r,y+r,r,r2d*270,r2d*360,false);
+ this.lineTo(x+w,y+h-r);
+ this.arc(x+w-r,y+h-r,r,0,r2d*90,false);
+ this.lineTo(x+r,y+h);
+ this.arc(x+r,y+h-r,r,r2d*90,r2d*180,false);
+ this.lineTo(x,y+r);
+ this.arc(x+r,y+r,r,r2d*180,r2d*270,false);
+ };
+
+ /**
+ * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
+ */
+ CanvasRenderingContext2D.prototype.ellipse = function(x, y, w, h) {
+ var kappa = .5522848,
+ ox = (w / 2) * kappa, // control point offset horizontal
+ oy = (h / 2) * kappa, // control point offset vertical
+ xe = x + w, // x-end
+ ye = y + h, // y-end
+ xm = x + w / 2, // x-middle
+ ym = y + h / 2; // y-middle
- // we first cluster the hubs, then we pull in the outliers, repeat
- while (numberOfNodes > maxNumberOfNodes && level < maxLevels) {
- if (level % 3 == 0) {
- this.forceAggregateHubs(true);
- this.normalizeClusterLevels();
- }
- else {
- this.increaseClusterLevel(); // this also includes a cluster normalization
- }
+ this.beginPath();
+ this.moveTo(x, ym);
+ this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
+ this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
+ this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
+ this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
+ };
- numberOfNodes = this.nodeIndices.length;
- level += 1;
- }
- // after the clustering we reposition the nodes to reduce the initial chaos
- if (level > 0 && reposition == true) {
- this.repositionNodes();
- }
- this._updateCalculationNodes();
- };
- /**
- * This function can be called to open up a specific cluster. It is only called by
- * It will unpack the cluster back one level.
- *
- * @param node | Node object: cluster to open.
- */
- exports.openCluster = function(node) {
- var isMovingBeforeClustering = this.moving;
- if (node.clusterSize > this.constants.clustering.sectorThreshold && this._nodeInActiveArea(node) &&
- !(this._sector() == "default" && this.nodeIndices.length == 1)) {
- // this loads a new sector, loads the nodes and edges and nodeIndices of it.
- this._addSector(node);
- var level = 0;
+ /**
+ * http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas
+ */
+ CanvasRenderingContext2D.prototype.database = function(x, y, w, h) {
+ var f = 1/3;
+ var wEllipse = w;
+ var hEllipse = h * f;
- // we decluster until we reach a decent number of nodes
- while ((this.nodeIndices.length < this.constants.clustering.initialMaxNodes) && (level < 10)) {
- this.decreaseClusterLevel();
- level += 1;
- }
+ var kappa = .5522848,
+ ox = (wEllipse / 2) * kappa, // control point offset horizontal
+ oy = (hEllipse / 2) * kappa, // control point offset vertical
+ xe = x + wEllipse, // x-end
+ ye = y + hEllipse, // y-end
+ xm = x + wEllipse / 2, // x-middle
+ ym = y + hEllipse / 2, // y-middle
+ ymb = y + (h - hEllipse/2), // y-midlle, bottom ellipse
+ yeb = y + h; // y-end, bottom ellipse
- }
- else {
- this._expandClusterNode(node,false,true);
+ this.beginPath();
+ this.moveTo(xe, ym);
- // update the index list, dynamic edges and labels
- this._updateNodeIndexList();
- this._updateDynamicEdges();
- this._updateCalculationNodes();
- this.updateLabels();
- }
+ this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
+ this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
- // if the simulation was settled, we restart the simulation if a cluster has been formed or expanded
- if (this.moving != isMovingBeforeClustering) {
- this.start();
- }
- };
+ this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
+ this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
+ this.lineTo(xe, ymb);
- /**
- * This calls the updateClustes with default arguments
- */
- exports.updateClustersDefault = function() {
- if (this.constants.clustering.enabled == true) {
- this.updateClusters(0,false,false);
- }
- };
+ this.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb);
+ this.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb);
+ this.lineTo(x, ym);
+ };
- /**
- * This function can be called to increase the cluster level. This means that the nodes with only one edge connection will
- * be clustered with their connected node. This can be repeated as many times as needed.
- * This can be called externally (by a keybind for instance) to reduce the complexity of big datasets.
- */
- exports.increaseClusterLevel = function() {
- this.updateClusters(-1,false,true);
- };
+ /**
+ * Draw an arrow point (no line)
+ */
+ CanvasRenderingContext2D.prototype.arrow = function(x, y, angle, length) {
+ // tail
+ var xt = x - length * Math.cos(angle);
+ var yt = y - length * Math.sin(angle);
- /**
- * This function can be called to decrease the cluster level. This means that the nodes with only one edge connection will
- * be unpacked if they are a cluster. This can be repeated as many times as needed.
- * This can be called externally (by a key-bind for instance) to look into clusters without zooming.
- */
- exports.decreaseClusterLevel = function() {
- this.updateClusters(1,false,true);
- };
+ // inner tail
+ // TODO: allow to customize different shapes
+ var xi = x - length * 0.9 * Math.cos(angle);
+ var yi = y - length * 0.9 * Math.sin(angle);
+ // left
+ var xl = xt + length / 3 * Math.cos(angle + 0.5 * Math.PI);
+ var yl = yt + length / 3 * Math.sin(angle + 0.5 * Math.PI);
- /**
- * This is the main clustering function. It clusters and declusters on zoom or forced
- * This function clusters on zoom, it can be called with a predefined zoom direction
- * If out, check if we can form clusters, if in, check if we can open clusters.
- * This function is only called from _zoom()
- *
- * @param {Number} zoomDirection | -1 / 0 / +1 for zoomOut / determineByZoom / zoomIn
- * @param {Boolean} recursive | enabled or disable recursive calling of the opening of clusters
- * @param {Boolean} force | enabled or disable forcing
- * @param {Boolean} doNotStart | if true do not call start
- *
- */
- exports.updateClusters = function(zoomDirection,recursive,force,doNotStart) {
- var isMovingBeforeClustering = this.moving;
- var amountOfNodes = this.nodeIndices.length;
+ // right
+ var xr = xt + length / 3 * Math.cos(angle - 0.5 * Math.PI);
+ var yr = yt + length / 3 * Math.sin(angle - 0.5 * Math.PI);
- // on zoom out collapse the sector if the scale is at the level the sector was made
- if (this.previousScale > this.scale && zoomDirection == 0) {
- this._collapseSector();
- }
+ this.beginPath();
+ this.moveTo(x, y);
+ this.lineTo(xl, yl);
+ this.lineTo(xi, yi);
+ this.lineTo(xr, yr);
+ this.closePath();
+ };
- // check if we zoom in or out
- if (this.previousScale > this.scale || zoomDirection == -1) { // zoom out
- // forming clusters when forced pulls outliers in. When not forced, the edge length of the
- // outer nodes determines if it is being clustered
- this._formClusters(force);
- }
- else if (this.previousScale < this.scale || zoomDirection == 1) { // zoom in
- if (force == true) {
- // _openClusters checks for each node if the formationScale of the cluster is smaller than
- // the current scale and if so, declusters. When forced, all clusters are reduced by one step
- this._openClusters(recursive,force);
- }
- else {
- // if a cluster takes up a set percentage of the active window
- this._openClustersBySize();
+ /**
+ * Sets up the dashedLine functionality for drawing
+ * Original code came from http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas
+ * @author David Jordan
+ * @date 2012-08-08
+ */
+ CanvasRenderingContext2D.prototype.dashedLine = function(x,y,x2,y2,dashArray){
+ if (!dashArray) dashArray=[10,5];
+ if (dashLength==0) dashLength = 0.001; // Hack for Safari
+ var dashCount = dashArray.length;
+ this.moveTo(x, y);
+ var dx = (x2-x), dy = (y2-y);
+ var slope = dy/dx;
+ var distRemaining = Math.sqrt( dx*dx + dy*dy );
+ var dashIndex=0, draw=true;
+ while (distRemaining>=0.1){
+ var dashLength = dashArray[dashIndex++%dashCount];
+ if (dashLength > distRemaining) dashLength = distRemaining;
+ var xStep = Math.sqrt( dashLength*dashLength / (1 + slope*slope) );
+ if (dx<0) xStep = -xStep;
+ x += xStep;
+ y += slope*xStep;
+ this[draw ? 'lineTo' : 'moveTo'](x,y);
+ distRemaining -= dashLength;
+ draw = !draw;
}
- }
- this._updateNodeIndexList();
-
- // if a cluster was NOT formed and the user zoomed out, we try clustering by hubs
- if (this.nodeIndices.length == amountOfNodes && (this.previousScale > this.scale || zoomDirection == -1)) {
- this._aggregateHubs(force);
- this._updateNodeIndexList();
- }
+ };
- // we now reduce chains.
- if (this.previousScale > this.scale || zoomDirection == -1) { // zoom out
- this.handleChains();
- this._updateNodeIndexList();
- }
+ // TODO: add diamond shape
+ }
- this.previousScale = this.scale;
- // rest of the update the index list, dynamic edges and labels
- this._updateDynamicEdges();
- this.updateLabels();
+/***/ },
+/* 38 */
+/***/ function(module, exports, __webpack_require__) {
- // if a cluster was formed, we increase the clusterSession
- if (this.nodeIndices.length < amountOfNodes) { // this means a clustering operation has taken place
- this.clusterSession += 1;
- // if clusters have been made, we normalize the cluster level
- this.normalizeClusterLevels();
+ // Only load hammer.js when in a browser environment
+ // (loading hammer.js in a node.js environment gives errors)
+ if (typeof window !== 'undefined') {
+ module.exports = window['Hammer'] || __webpack_require__(49);
+ // TODO: throw an error when hammerjs is not available?
+ }
+ else {
+ module.exports = function () {
+ throw Error('hammer.js is only available in a browser, not in node.js.');
}
+ }
- if (doNotStart == false || doNotStart === undefined) {
- // if the simulation was settled, we restart the simulation if a cluster has been formed or expanded
- if (this.moving != isMovingBeforeClustering) {
- this.start();
- }
- }
- this._updateCalculationNodes();
- };
+/***/ },
+/* 39 */
+/***/ function(module, exports, __webpack_require__) {
- /**
- * This function handles the chains. It is called on every updateClusters().
- */
- exports.handleChains = function() {
- // after clustering we check how many chains there are
- var chainPercentage = this._getChainFraction();
- if (chainPercentage > this.constants.clustering.chainThreshold) {
- this._reduceAmountOfChains(1 - this.constants.clustering.chainThreshold / chainPercentage)
+ // first check if moment.js is already loaded in the browser window, if so,
+ // use this instance. Else, load via commonjs.
+ module.exports = (typeof window !== 'undefined') && window['moment'] || __webpack_require__(51);
+
+
+/***/ },
+/* 40 */
+/***/ function(module, exports, __webpack_require__) {
- }
- };
+ var PhysicsMixin = __webpack_require__(50);
+ var ClusterMixin = __webpack_require__(43);
+ var SectorsMixin = __webpack_require__(44);
+ var SelectionMixin = __webpack_require__(45);
+ var ManipulationMixin = __webpack_require__(46);
+ var NavigationMixin = __webpack_require__(47);
+ var HierarchicalLayoutMixin = __webpack_require__(48);
/**
- * this functions starts clustering by hubs
- * The minimum hub threshold is set globally
+ * Load a mixin into the network object
*
+ * @param {Object} sourceVariable | this object has to contain functions.
* @private
*/
- exports._aggregateHubs = function(force) {
- this._getHubSize();
- this._formClustersByHub(force,false);
+ exports._loadMixin = function (sourceVariable) {
+ for (var mixinFunction in sourceVariable) {
+ if (sourceVariable.hasOwnProperty(mixinFunction)) {
+ this[mixinFunction] = sourceVariable[mixinFunction];
+ }
+ }
};
/**
- * This function is fired by keypress. It forces hubs to form.
+ * removes a mixin from the network object.
*
+ * @param {Object} sourceVariable | this object has to contain functions.
+ * @private
*/
- exports.forceAggregateHubs = function(doNotStart) {
- var isMovingBeforeClustering = this.moving;
- var amountOfNodes = this.nodeIndices.length;
-
- this._aggregateHubs(true);
-
- // update the index list, dynamic edges and labels
- this._updateNodeIndexList();
- this._updateDynamicEdges();
- this.updateLabels();
-
- // if a cluster was formed, we increase the clusterSession
- if (this.nodeIndices.length != amountOfNodes) {
- this.clusterSession += 1;
- }
-
- if (doNotStart == false || doNotStart === undefined) {
- // if the simulation was settled, we restart the simulation if a cluster has been formed or expanded
- if (this.moving != isMovingBeforeClustering) {
- this.start();
+ exports._clearMixin = function (sourceVariable) {
+ for (var mixinFunction in sourceVariable) {
+ if (sourceVariable.hasOwnProperty(mixinFunction)) {
+ this[mixinFunction] = undefined;
}
}
};
+
/**
- * If a cluster takes up more than a set percentage of the screen, open the cluster
+ * Mixin the physics system and initialize the parameters required.
*
* @private
*/
- exports._openClustersBySize = function() {
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- var node = this.nodes[nodeId];
- if (node.inView() == true) {
- if ((node.width*this.scale > this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientWidth) ||
- (node.height*this.scale > this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientHeight)) {
- this.openCluster(node);
- }
- }
- }
+ exports._loadPhysicsSystem = function () {
+ this._loadMixin(PhysicsMixin);
+ this._loadSelectedForceSolver();
+ if (this.constants.configurePhysics == true) {
+ this._loadPhysicsConfiguration();
}
};
/**
- * This function loops over all nodes in the nodeIndices list. For each node it checks if it is a cluster and if it
- * has to be opened based on the current zoom level.
+ * Mixin the cluster system and initialize the parameters required.
*
* @private
*/
- exports._openClusters = function(recursive,force) {
- for (var i = 0; i < this.nodeIndices.length; i++) {
- var node = this.nodes[this.nodeIndices[i]];
- this._expandClusterNode(node,recursive,force);
- this._updateCalculationNodes();
- }
+ exports._loadClusterSystem = function () {
+ this.clusterSession = 0;
+ this.hubThreshold = 5;
+ this._loadMixin(ClusterMixin);
};
+
/**
- * This function checks if a node has to be opened. This is done by checking the zoom level.
- * If the node contains child nodes, this function is recursively called on the child nodes as well.
- * This recursive behaviour is optional and can be set by the recursive argument.
+ * Mixin the sector system and initialize the parameters required
*
- * @param {Node} parentNode | to check for cluster and expand
- * @param {Boolean} recursive | enabled or disable recursive calling
- * @param {Boolean} force | enabled or disable forcing
- * @param {Boolean} [openAll] | This will recursively force all nodes in the parent to be released
* @private
*/
- exports._expandClusterNode = function(parentNode, recursive, force, openAll) {
- // first check if node is a cluster
- if (parentNode.clusterSize > 1) {
- // this means that on a double tap event or a zoom event, the cluster fully unpacks if it is smaller than 20
- if (parentNode.clusterSize < this.constants.clustering.sectorThreshold) {
- openAll = true;
- }
- recursive = openAll ? true : recursive;
+ exports._loadSectorSystem = function () {
+ this.sectors = {};
+ this.activeSector = ["default"];
+ this.sectors["active"] = {};
+ this.sectors["active"]["default"] = {"nodes": {},
+ "edges": {},
+ "nodeIndices": [],
+ "formationScale": 1.0,
+ "drawingNode": undefined };
+ this.sectors["frozen"] = {};
+ this.sectors["support"] = {"nodes": {},
+ "edges": {},
+ "nodeIndices": [],
+ "formationScale": 1.0,
+ "drawingNode": undefined };
- // if the last child has been added on a smaller scale than current scale decluster
- if (parentNode.formationScale < this.scale || force == true) {
- // we will check if any of the contained child nodes should be removed from the cluster
- for (var containedNodeId in parentNode.containedNodes) {
- if (parentNode.containedNodes.hasOwnProperty(containedNodeId)) {
- var childNode = parentNode.containedNodes[containedNodeId];
+ this.nodeIndices = this.sectors["active"]["default"]["nodeIndices"]; // the node indices list is used to speed up the computation of the repulsion fields
- // force expand will expand the largest cluster size clusters. Since we cluster from outside in, we assume that
- // the largest cluster is the one that comes from outside
- if (force == true) {
- if (childNode.clusterSession == parentNode.clusterSessions[parentNode.clusterSessions.length-1]
- || openAll) {
- this._expelChildFromParent(parentNode,containedNodeId,recursive,force,openAll);
- }
- }
- else {
- if (this._nodeInActiveArea(parentNode)) {
- this._expelChildFromParent(parentNode,containedNodeId,recursive,force,openAll);
- }
- }
- }
- }
- }
- }
+ this._loadMixin(SectorsMixin);
};
+
/**
- * ONLY CALLED FROM _expandClusterNode
- *
- * This function will expel a child_node from a parent_node. This is to de-cluster the node. This function will remove
- * the child node from the parent contained_node object and put it back into the global nodes object.
- * The same holds for the edge that was connected to the child node. It is moved back into the global edges object.
+ * Mixin the selection system and initialize the parameters required
*
- * @param {Node} parentNode | the parent node
- * @param {String} containedNodeId | child_node id as it is contained in the containedNodes object of the parent node
- * @param {Boolean} recursive | This will also check if the child needs to be expanded.
- * With force and recursive both true, the entire cluster is unpacked
- * @param {Boolean} force | This will disregard the zoom level and will expel this child from the parent
- * @param {Boolean} openAll | This will recursively force all nodes in the parent to be released
* @private
*/
- exports._expelChildFromParent = function(parentNode, containedNodeId, recursive, force, openAll) {
- var childNode = parentNode.containedNodes[containedNodeId];
-
- // if child node has been added on smaller scale than current, kick out
- if (childNode.formationScale < this.scale || force == true) {
- // unselect all selected items
- this._unselectAll();
-
- // put the child node back in the global nodes object
- this.nodes[containedNodeId] = childNode;
-
- // release the contained edges from this childNode back into the global edges
- this._releaseContainedEdges(parentNode,childNode);
-
- // reconnect rerouted edges to the childNode
- this._connectEdgeBackToChild(parentNode,childNode);
-
- // validate all edges in dynamicEdges
- this._validateEdges(parentNode);
+ exports._loadSelectionSystem = function () {
+ this.selectionObj = {nodes: {}, edges: {}};
- // undo the changes from the clustering operation on the parent node
- parentNode.mass -= childNode.mass;
- parentNode.clusterSize -= childNode.clusterSize;
- parentNode.fontSize = Math.min(this.constants.clustering.maxFontSize, this.constants.nodes.fontSize + this.constants.clustering.fontSizeMultiplier*parentNode.clusterSize);
- parentNode.dynamicEdgesLength = parentNode.dynamicEdges.length;
+ this._loadMixin(SelectionMixin);
+ };
- // place the child node near the parent, not at the exact same location to avoid chaos in the system
- childNode.x = parentNode.x + parentNode.growthIndicator * (0.5 - Math.random());
- childNode.y = parentNode.y + parentNode.growthIndicator * (0.5 - Math.random());
- // remove node from the list
- delete parentNode.containedNodes[containedNodeId];
+ /**
+ * Mixin the navigationUI (User Interface) system and initialize the parameters required
+ *
+ * @private
+ */
+ exports._loadManipulationSystem = function () {
+ // reset global variables -- these are used by the selection of nodes and edges.
+ this.blockConnectingEdgeSelection = false;
+ this.forceAppendSelection = false;
- // check if there are other childs with this clusterSession in the parent.
- var othersPresent = false;
- for (var childNodeId in parentNode.containedNodes) {
- if (parentNode.containedNodes.hasOwnProperty(childNodeId)) {
- if (parentNode.containedNodes[childNodeId].clusterSession == childNode.clusterSession) {
- othersPresent = true;
- break;
- }
+ if (this.constants.dataManipulation.enabled == true) {
+ // load the manipulator HTML elements. All styling done in css.
+ if (this.manipulationDiv === undefined) {
+ this.manipulationDiv = document.createElement('div');
+ this.manipulationDiv.className = 'network-manipulationDiv';
+ this.manipulationDiv.id = 'network-manipulationDiv';
+ if (this.editMode == true) {
+ this.manipulationDiv.style.display = "block";
}
- }
- // if there are no others, remove the cluster session from the list
- if (othersPresent == false) {
- parentNode.clusterSessions.pop();
+ else {
+ this.manipulationDiv.style.display = "none";
+ }
+ this.containerElement.insertBefore(this.manipulationDiv, this.frame);
}
- this._repositionBezierNodes(childNode);
- // this._repositionBezierNodes(parentNode);
+ if (this.editModeDiv === undefined) {
+ this.editModeDiv = document.createElement('div');
+ this.editModeDiv.className = 'network-manipulation-editMode';
+ this.editModeDiv.id = 'network-manipulation-editMode';
+ if (this.editMode == true) {
+ this.editModeDiv.style.display = "none";
+ }
+ else {
+ this.editModeDiv.style.display = "block";
+ }
+ this.containerElement.insertBefore(this.editModeDiv, this.frame);
+ }
- // remove the clusterSession from the child node
- childNode.clusterSession = 0;
+ if (this.closeDiv === undefined) {
+ this.closeDiv = document.createElement('div');
+ this.closeDiv.className = 'network-manipulation-closeDiv';
+ this.closeDiv.id = 'network-manipulation-closeDiv';
+ this.closeDiv.style.display = this.manipulationDiv.style.display;
+ this.containerElement.insertBefore(this.closeDiv, this.frame);
+ }
- // recalculate the size of the node on the next time the node is rendered
- parentNode.clearSizeCache();
+ // load the manipulation functions
+ this._loadMixin(ManipulationMixin);
- // restart the simulation to reorganise all nodes
- this.moving = true;
+ // create the manipulator toolbar
+ this._createManipulatorBar();
}
+ else {
+ if (this.manipulationDiv !== undefined) {
+ // removes all the bindings and overloads
+ this._createManipulatorBar();
+ // remove the manipulation divs
+ this.containerElement.removeChild(this.manipulationDiv);
+ this.containerElement.removeChild(this.editModeDiv);
+ this.containerElement.removeChild(this.closeDiv);
- // check if a further expansion step is possible if recursivity is enabled
- if (recursive == true) {
- this._expandClusterNode(childNode,recursive,force,openAll);
+ this.manipulationDiv = undefined;
+ this.editModeDiv = undefined;
+ this.closeDiv = undefined;
+ // remove the mixin functions
+ this._clearMixin(ManipulationMixin);
+ }
}
};
/**
- * position the bezier nodes at the center of the edges
+ * Mixin the navigation (User Interface) system and initialize the parameters required
*
- * @param node
* @private
*/
- exports._repositionBezierNodes = function(node) {
- for (var i = 0; i < node.dynamicEdges.length; i++) {
- node.dynamicEdges[i].positionBezierNode();
+ exports._loadNavigationControls = function () {
+ this._loadMixin(NavigationMixin);
+
+ // the clean function removes the button divs, this is done to remove the bindings.
+ this._cleanNavigation();
+ if (this.constants.navigation.enabled == true) {
+ this._loadNavigationElements();
}
};
/**
- * This function checks if any nodes at the end of their trees have edges below a threshold length
- * This function is called only from updateClusters()
- * forceLevelCollapse ignores the length of the edge and collapses one level
- * This means that a node with only one edge will be clustered with its connected node
+ * Mixin the hierarchical layout system.
*
* @private
- * @param {Boolean} force
*/
- exports._formClusters = function(force) {
- if (force == false) {
- this._formClustersByZoom();
- }
- else {
- this._forceClustersByZoom();
- }
+ exports._loadHierarchySystem = function () {
+ this._loadMixin(HierarchicalLayoutMixin);
};
+/***/ },
+/* 41 */
+/***/ function(module, exports, __webpack_require__) {
+
+
/**
- * This function handles the clustering by zooming out, this is based on a minimum edge distance
- *
- * @private
+ * Expose `Emitter`.
*/
- exports._formClustersByZoom = function() {
- var dx,dy,length,
- minLength = this.constants.clustering.clusterEdgeThreshold/this.scale;
-
- // check if any edges are shorter than minLength and start the clustering
- // the clustering favours the node with the larger mass
- for (var edgeId in this.edges) {
- if (this.edges.hasOwnProperty(edgeId)) {
- var edge = this.edges[edgeId];
- if (edge.connected) {
- if (edge.toId != edge.fromId) {
- dx = (edge.to.x - edge.from.x);
- dy = (edge.to.y - edge.from.y);
- length = Math.sqrt(dx * dx + dy * dy);
+ module.exports = Emitter;
- if (length < minLength) {
- // first check which node is larger
- var parentNode = edge.from;
- var childNode = edge.to;
- if (edge.to.mass > edge.from.mass) {
- parentNode = edge.to;
- childNode = edge.from;
- }
+ /**
+ * Initialize a new `Emitter`.
+ *
+ * @api public
+ */
- if (childNode.dynamicEdgesLength == 1) {
- this._addToCluster(parentNode,childNode,false);
- }
- else if (parentNode.dynamicEdgesLength == 1) {
- this._addToCluster(childNode,parentNode,false);
- }
- }
- }
- }
- }
- }
+ function Emitter(obj) {
+ if (obj) return mixin(obj);
};
/**
- * This function forces the network to cluster all nodes with only one connecting edge to their
- * connected node.
+ * Mixin the emitter properties.
*
- * @private
+ * @param {Object} obj
+ * @return {Object}
+ * @api private
*/
- exports._forceClustersByZoom = function() {
- for (var nodeId in this.nodes) {
- // another node could have absorbed this child.
- if (this.nodes.hasOwnProperty(nodeId)) {
- var childNode = this.nodes[nodeId];
- // the edges can be swallowed by another decrease
- if (childNode.dynamicEdgesLength == 1 && childNode.dynamicEdges.length != 0) {
- var edge = childNode.dynamicEdges[0];
- var parentNode = (edge.toId == childNode.id) ? this.nodes[edge.fromId] : this.nodes[edge.toId];
-
- // group to the largest node
- if (childNode.id != parentNode.id) {
- if (parentNode.mass > childNode.mass) {
- this._addToCluster(parentNode,childNode,true);
- }
- else {
- this._addToCluster(childNode,parentNode,true);
- }
- }
- }
- }
+ function mixin(obj) {
+ for (var key in Emitter.prototype) {
+ obj[key] = Emitter.prototype[key];
}
- };
-
+ return obj;
+ }
/**
- * To keep the nodes of roughly equal size we normalize the cluster levels.
- * This function clusters a node to its smallest connected neighbour.
+ * Listen on the given `event` with `fn`.
*
- * @param node
- * @private
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
*/
- exports._clusterToSmallestNeighbour = function(node) {
- var smallestNeighbour = -1;
- var smallestNeighbourNode = null;
- for (var i = 0; i < node.dynamicEdges.length; i++) {
- if (node.dynamicEdges[i] !== undefined) {
- var neighbour = null;
- if (node.dynamicEdges[i].fromId != node.id) {
- neighbour = node.dynamicEdges[i].from;
- }
- else if (node.dynamicEdges[i].toId != node.id) {
- neighbour = node.dynamicEdges[i].to;
- }
-
-
- if (neighbour != null && smallestNeighbour > neighbour.clusterSessions.length) {
- smallestNeighbour = neighbour.clusterSessions.length;
- smallestNeighbourNode = neighbour;
- }
- }
- }
- if (neighbour != null && this.nodes[neighbour.id] !== undefined) {
- this._addToCluster(neighbour, node, true);
- }
+ Emitter.prototype.on =
+ Emitter.prototype.addEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+ (this._callbacks[event] = this._callbacks[event] || [])
+ .push(fn);
+ return this;
};
-
/**
- * This function forms clusters from hubs, it loops over all nodes
+ * Adds an `event` listener that will be invoked a single
+ * time then automatically removed.
*
- * @param {Boolean} force | Disregard zoom level
- * @param {Boolean} onlyEqual | This only clusters a hub with a specific number of edges
- * @private
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
*/
- exports._formClustersByHub = function(force, onlyEqual) {
- // we loop over all nodes in the list
- for (var nodeId in this.nodes) {
- // we check if it is still available since it can be used by the clustering in this loop
- if (this.nodes.hasOwnProperty(nodeId)) {
- this._formClusterFromHub(this.nodes[nodeId],force,onlyEqual);
- }
+
+ Emitter.prototype.once = function(event, fn){
+ var self = this;
+ this._callbacks = this._callbacks || {};
+
+ function on() {
+ self.off(event, on);
+ fn.apply(this, arguments);
}
+
+ on.fn = fn;
+ this.on(event, on);
+ return this;
};
/**
- * This function forms a cluster from a specific preselected hub node
+ * Remove the given callback for `event` or all
+ * registered callbacks.
*
- * @param {Node} hubNode | the node we will cluster as a hub
- * @param {Boolean} force | Disregard zoom level
- * @param {Boolean} onlyEqual | This only clusters a hub with a specific number of edges
- * @param {Number} [absorptionSizeOffset] |
- * @private
+ * @param {String} event
+ * @param {Function} fn
+ * @return {Emitter}
+ * @api public
*/
- exports._formClusterFromHub = function(hubNode, force, onlyEqual, absorptionSizeOffset) {
- if (absorptionSizeOffset === undefined) {
- absorptionSizeOffset = 0;
+
+ Emitter.prototype.off =
+ Emitter.prototype.removeListener =
+ Emitter.prototype.removeAllListeners =
+ Emitter.prototype.removeEventListener = function(event, fn){
+ this._callbacks = this._callbacks || {};
+
+ // all
+ if (0 == arguments.length) {
+ this._callbacks = {};
+ return this;
}
- // we decide if the node is a hub
- if ((hubNode.dynamicEdgesLength >= this.hubThreshold && onlyEqual == false) ||
- (hubNode.dynamicEdgesLength == this.hubThreshold && onlyEqual == true)) {
- // initialize variables
- var dx,dy,length;
- var minLength = this.constants.clustering.clusterEdgeThreshold/this.scale;
- var allowCluster = false;
- // we create a list of edges because the dynamicEdges change over the course of this loop
- var edgesIdarray = [];
- var amountOfInitialEdges = hubNode.dynamicEdges.length;
- for (var j = 0; j < amountOfInitialEdges; j++) {
- edgesIdarray.push(hubNode.dynamicEdges[j].id);
- }
+ // specific event
+ var callbacks = this._callbacks[event];
+ if (!callbacks) return this;
- // if the hub clustering is not forces, we check if one of the edges connected
- // to a cluster is small enough based on the constants.clustering.clusterEdgeThreshold
- if (force == false) {
- allowCluster = false;
- for (j = 0; j < amountOfInitialEdges; j++) {
- var edge = this.edges[edgesIdarray[j]];
- if (edge !== undefined) {
- if (edge.connected) {
- if (edge.toId != edge.fromId) {
- dx = (edge.to.x - edge.from.x);
- dy = (edge.to.y - edge.from.y);
- length = Math.sqrt(dx * dx + dy * dy);
+ // remove all handlers
+ if (1 == arguments.length) {
+ delete this._callbacks[event];
+ return this;
+ }
- if (length < minLength) {
- allowCluster = true;
- break;
- }
- }
- }
- }
- }
+ // remove specific handler
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
}
+ }
+ return this;
+ };
- // start the clustering if allowed
- if ((!force && allowCluster) || force) {
- // we loop over all edges INITIALLY connected to this hub
- for (j = 0; j < amountOfInitialEdges; j++) {
- edge = this.edges[edgesIdarray[j]];
- // the edge can be clustered by this function in a previous loop
- if (edge !== undefined) {
- var childNode = this.nodes[(edge.fromId == hubNode.id) ? edge.toId : edge.fromId];
- // we do not want hubs to merge with other hubs nor do we want to cluster itself.
- if ((childNode.dynamicEdges.length <= (this.hubThreshold + absorptionSizeOffset)) &&
- (childNode.id != hubNode.id)) {
- this._addToCluster(hubNode,childNode,force);
- }
- }
- }
+ /**
+ * Emit `event` with the given args.
+ *
+ * @param {String} event
+ * @param {Mixed} ...
+ * @return {Emitter}
+ */
+
+ Emitter.prototype.emit = function(event){
+ this._callbacks = this._callbacks || {};
+ var args = [].slice.call(arguments, 1)
+ , callbacks = this._callbacks[event];
+
+ if (callbacks) {
+ callbacks = callbacks.slice(0);
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
+ callbacks[i].apply(this, args);
}
}
+
+ return this;
};
+ /**
+ * Return array of callbacks for `event`.
+ *
+ * @param {String} event
+ * @return {Array}
+ * @api public
+ */
+ Emitter.prototype.listeners = function(event){
+ this._callbacks = this._callbacks || {};
+ return this._callbacks[event] || [];
+ };
/**
- * This function adds the child node to the parent node, creating a cluster if it is not already.
+ * Check if this emitter has `event` handlers.
*
- * @param {Node} parentNode | this is the node that will house the child node
- * @param {Node} childNode | this node will be deleted from the global this.nodes and stored in the parent node
- * @param {Boolean} force | true will only update the remainingEdges at the very end of the clustering, ensuring single level collapse
- * @private
+ * @param {String} event
+ * @return {Boolean}
+ * @api public
*/
- exports._addToCluster = function(parentNode, childNode, force) {
- // join child node in the parent node
- parentNode.containedNodes[childNode.id] = childNode;
- // manage all the edges connected to the child and parent nodes
- for (var i = 0; i < childNode.dynamicEdges.length; i++) {
- var edge = childNode.dynamicEdges[i];
- if (edge.toId == parentNode.id || edge.fromId == parentNode.id) { // edge connected to parentNode
- this._addToContainedEdges(parentNode,childNode,edge);
- }
- else {
- this._connectEdgeToCluster(parentNode,childNode,edge);
- }
- }
- // a contained node has no dynamic edges.
- childNode.dynamicEdges = [];
+ Emitter.prototype.hasListeners = function(event){
+ return !! this.listeners(event).length;
+ };
- // remove circular edges from clusters
- this._containCircularEdgesFromNode(parentNode,childNode);
+/***/ },
+/* 42 */
+/***/ function(module, exports, __webpack_require__) {
- // remove the childNode from the global nodes object
- delete this.nodes[childNode.id];
+ /**
+ * Copyright 2012 Craig Campbell
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Mousetrap is a simple keyboard shortcut library for Javascript with
+ * no external dependencies
+ *
+ * @version 1.1.2
+ * @url craig.is/killing/mice
+ */
- // update the properties of the child and parent
- var massBefore = parentNode.mass;
- childNode.clusterSession = this.clusterSession;
- parentNode.mass += childNode.mass;
- parentNode.clusterSize += childNode.clusterSize;
- parentNode.fontSize = Math.min(this.constants.clustering.maxFontSize, this.constants.nodes.fontSize + this.constants.clustering.fontSizeMultiplier*parentNode.clusterSize);
+ /**
+ * mapping of special keycodes to their corresponding keys
+ *
+ * everything in this dictionary cannot use keypress events
+ * so it has to be here to map to the correct keycodes for
+ * keyup/keydown events
+ *
+ * @type {Object}
+ */
+ var _MAP = {
+ 8: 'backspace',
+ 9: 'tab',
+ 13: 'enter',
+ 16: 'shift',
+ 17: 'ctrl',
+ 18: 'alt',
+ 20: 'capslock',
+ 27: 'esc',
+ 32: 'space',
+ 33: 'pageup',
+ 34: 'pagedown',
+ 35: 'end',
+ 36: 'home',
+ 37: 'left',
+ 38: 'up',
+ 39: 'right',
+ 40: 'down',
+ 45: 'ins',
+ 46: 'del',
+ 91: 'meta',
+ 93: 'meta',
+ 224: 'meta'
+ },
- // keep track of the clustersessions so we can open the cluster up as it has been formed.
- if (parentNode.clusterSessions[parentNode.clusterSessions.length - 1] != this.clusterSession) {
- parentNode.clusterSessions.push(this.clusterSession);
- }
+ /**
+ * mapping for special characters so they can support
+ *
+ * this dictionary is only used incase you want to bind a
+ * keyup or keydown event to one of these keys
+ *
+ * @type {Object}
+ */
+ _KEYCODE_MAP = {
+ 106: '*',
+ 107: '+',
+ 109: '-',
+ 110: '.',
+ 111 : '/',
+ 186: ';',
+ 187: '=',
+ 188: ',',
+ 189: '-',
+ 190: '.',
+ 191: '/',
+ 192: '`',
+ 219: '[',
+ 220: '\\',
+ 221: ']',
+ 222: '\''
+ },
- // forced clusters only open from screen size and double tap
- if (force == true) {
- // parentNode.formationScale = Math.pow(1 - (1.0/11.0),this.clusterSession+3);
- parentNode.formationScale = 0;
- }
- else {
- parentNode.formationScale = this.scale; // The latest child has been added on this scale
- }
+ /**
+ * this is a mapping of keys that require shift on a US keypad
+ * back to the non shift equivelents
+ *
+ * this is so you can use keyup events with these keys
+ *
+ * note that this will only work reliably on US keyboards
+ *
+ * @type {Object}
+ */
+ _SHIFT_MAP = {
+ '~': '`',
+ '!': '1',
+ '@': '2',
+ '#': '3',
+ '$': '4',
+ '%': '5',
+ '^': '6',
+ '&': '7',
+ '*': '8',
+ '(': '9',
+ ')': '0',
+ '_': '-',
+ '+': '=',
+ ':': ';',
+ '\"': '\'',
+ '<': ',',
+ '>': '.',
+ '?': '/',
+ '|': '\\'
+ },
- // recalculate the size of the node on the next time the node is rendered
- parentNode.clearSizeCache();
+ /**
+ * this is a list of special strings you can use to map
+ * to modifier keys when you specify your keyboard shortcuts
+ *
+ * @type {Object}
+ */
+ _SPECIAL_ALIASES = {
+ 'option': 'alt',
+ 'command': 'meta',
+ 'return': 'enter',
+ 'escape': 'esc'
+ },
- // set the pop-out scale for the childnode
- parentNode.containedNodes[childNode.id].formationScale = parentNode.formationScale;
+ /**
+ * variable to store the flipped version of _MAP from above
+ * needed to check if we should use keypress or not when no action
+ * is specified
+ *
+ * @type {Object|undefined}
+ */
+ _REVERSE_MAP,
- // nullify the movement velocity of the child, this is to avoid hectic behaviour
- childNode.clearVelocity();
+ /**
+ * a list of all the callbacks setup via Mousetrap.bind()
+ *
+ * @type {Object}
+ */
+ _callbacks = {},
- // the mass has altered, preservation of energy dictates the velocity to be updated
- parentNode.updateVelocity(massBefore);
+ /**
+ * direct map of string combinations to callbacks used for trigger()
+ *
+ * @type {Object}
+ */
+ _direct_map = {},
- // restart the simulation to reorganise all nodes
- this.moving = true;
- };
+ /**
+ * keeps track of what level each sequence is at since multiple
+ * sequences can start out with the same sequence
+ *
+ * @type {Object}
+ */
+ _sequence_levels = {},
+ /**
+ * variable to store the setTimeout call
+ *
+ * @type {null|number}
+ */
+ _reset_timer,
- /**
- * This function will apply the changes made to the remainingEdges during the formation of the clusters.
- * This is a seperate function to allow for level-wise collapsing of the node barnesHutTree.
- * It has to be called if a level is collapsed. It is called by _formClusters().
- * @private
- */
- exports._updateDynamicEdges = function() {
- for (var i = 0; i < this.nodeIndices.length; i++) {
- var node = this.nodes[this.nodeIndices[i]];
- node.dynamicEdgesLength = node.dynamicEdges.length;
+ /**
+ * temporary state where we will ignore the next keyup
+ *
+ * @type {boolean|string}
+ */
+ _ignore_next_keyup = false,
- // this corrects for multiple edges pointing at the same other node
- var correction = 0;
- if (node.dynamicEdgesLength > 1) {
- for (var j = 0; j < node.dynamicEdgesLength - 1; j++) {
- var edgeToId = node.dynamicEdges[j].toId;
- var edgeFromId = node.dynamicEdges[j].fromId;
- for (var k = j+1; k < node.dynamicEdgesLength; k++) {
- if ((node.dynamicEdges[k].toId == edgeToId && node.dynamicEdges[k].fromId == edgeFromId) ||
- (node.dynamicEdges[k].fromId == edgeToId && node.dynamicEdges[k].toId == edgeFromId)) {
- correction += 1;
- }
- }
- }
- }
- node.dynamicEdgesLength -= correction;
- }
- };
+ /**
+ * are we currently inside of a sequence?
+ * type of action ("keyup" or "keydown" or "keypress") or false
+ *
+ * @type {boolean|string}
+ */
+ _inside_sequence = false;
+ /**
+ * loop through the f keys, f1 to f19 and add them to the map
+ * programatically
+ */
+ for (var i = 1; i < 20; ++i) {
+ _MAP[111 + i] = 'f' + i;
+ }
- /**
- * This adds an edge from the childNode to the contained edges of the parent node
- *
- * @param parentNode | Node object
- * @param childNode | Node object
- * @param edge | Edge object
- * @private
- */
- exports._addToContainedEdges = function(parentNode, childNode, edge) {
- // create an array object if it does not yet exist for this childNode
- if (!(parentNode.containedEdges.hasOwnProperty(childNode.id))) {
- parentNode.containedEdges[childNode.id] = []
+ /**
+ * loop through to map numbers on the numeric keypad
+ */
+ for (i = 0; i <= 9; ++i) {
+ _MAP[i + 96] = i;
}
- // add this edge to the list
- parentNode.containedEdges[childNode.id].push(edge);
- // remove the edge from the global edges object
- delete this.edges[edge.id];
+ /**
+ * cross browser add event method
+ *
+ * @param {Element|HTMLDocument} object
+ * @param {string} type
+ * @param {Function} callback
+ * @returns void
+ */
+ function _addEvent(object, type, callback) {
+ if (object.addEventListener) {
+ return object.addEventListener(type, callback, false);
+ }
- // remove the edge from the parent object
- for (var i = 0; i < parentNode.dynamicEdges.length; i++) {
- if (parentNode.dynamicEdges[i].id == edge.id) {
- parentNode.dynamicEdges.splice(i,1);
- break;
- }
+ object.attachEvent('on' + type, callback);
}
- };
- /**
- * This function connects an edge that was connected to a child node to the parent node.
- * It keeps track of which nodes it has been connected to with the originalId array.
- *
- * @param {Node} parentNode | Node object
- * @param {Node} childNode | Node object
- * @param {Edge} edge | Edge object
- * @private
- */
- exports._connectEdgeToCluster = function(parentNode, childNode, edge) {
- // handle circular edges
- if (edge.toId == edge.fromId) {
- this._addToContainedEdges(parentNode, childNode, edge);
- }
- else {
- if (edge.toId == childNode.id) { // edge connected to other node on the "to" side
- edge.originalToId.push(childNode.id);
- edge.to = parentNode;
- edge.toId = parentNode.id;
- }
- else { // edge connected to other node with the "from" side
+ /**
+ * takes the event and returns the key character
+ *
+ * @param {Event} e
+ * @return {string}
+ */
+ function _characterFromEvent(e) {
- edge.originalFromId.push(childNode.id);
- edge.from = parentNode;
- edge.fromId = parentNode.id;
- }
+ // for keypress events we should return the character as is
+ if (e.type == 'keypress') {
+ return String.fromCharCode(e.which);
+ }
- this._addToReroutedEdges(parentNode,childNode,edge);
- }
- };
+ // for non keypress events the special maps are needed
+ if (_MAP[e.which]) {
+ return _MAP[e.which];
+ }
+ if (_KEYCODE_MAP[e.which]) {
+ return _KEYCODE_MAP[e.which];
+ }
- /**
- * If a node is connected to itself, a circular edge is drawn. When clustering we want to contain
- * these edges inside of the cluster.
- *
- * @param parentNode
- * @param childNode
- * @private
- */
- exports._containCircularEdgesFromNode = function(parentNode, childNode) {
- // manage all the edges connected to the child and parent nodes
- for (var i = 0; i < parentNode.dynamicEdges.length; i++) {
- var edge = parentNode.dynamicEdges[i];
- // handle circular edges
- if (edge.toId == edge.fromId) {
- this._addToContainedEdges(parentNode, childNode, edge);
- }
+ // if it is not in the special map
+ return String.fromCharCode(e.which).toLowerCase();
}
- };
-
- /**
- * This adds an edge from the childNode to the rerouted edges of the parent node
- *
- * @param parentNode | Node object
- * @param childNode | Node object
- * @param edge | Edge object
- * @private
- */
- exports._addToReroutedEdges = function(parentNode, childNode, edge) {
- // create an array object if it does not yet exist for this childNode
- // we store the edge in the rerouted edges so we can restore it when the cluster pops open
- if (!(parentNode.reroutedEdges.hasOwnProperty(childNode.id))) {
- parentNode.reroutedEdges[childNode.id] = [];
- }
- parentNode.reroutedEdges[childNode.id].push(edge);
+ /**
+ * should we stop this event before firing off callbacks
+ *
+ * @param {Event} e
+ * @return {boolean}
+ */
+ function _stop(e) {
+ var element = e.target || e.srcElement,
+ tag_name = element.tagName;
- // this edge becomes part of the dynamicEdges of the cluster node
- parentNode.dynamicEdges.push(edge);
- };
+ // if the element has the class "mousetrap" then no need to stop
+ if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
+ return false;
+ }
+ // stop for input, select, and textarea
+ return tag_name == 'INPUT' || tag_name == 'SELECT' || tag_name == 'TEXTAREA' || (element.contentEditable && element.contentEditable == 'true');
+ }
+ /**
+ * checks if two arrays are equal
+ *
+ * @param {Array} modifiers1
+ * @param {Array} modifiers2
+ * @returns {boolean}
+ */
+ function _modifiersMatch(modifiers1, modifiers2) {
+ return modifiers1.sort().join(',') === modifiers2.sort().join(',');
+ }
- /**
- * This function connects an edge that was connected to a cluster node back to the child node.
- *
- * @param parentNode | Node object
- * @param childNode | Node object
- * @private
- */
- exports._connectEdgeBackToChild = function(parentNode, childNode) {
- if (parentNode.reroutedEdges.hasOwnProperty(childNode.id)) {
- for (var i = 0; i < parentNode.reroutedEdges[childNode.id].length; i++) {
- var edge = parentNode.reroutedEdges[childNode.id][i];
- if (edge.originalFromId[edge.originalFromId.length-1] == childNode.id) {
- edge.originalFromId.pop();
- edge.fromId = childNode.id;
- edge.from = childNode;
- }
- else {
- edge.originalToId.pop();
- edge.toId = childNode.id;
- edge.to = childNode;
- }
+ /**
+ * resets all sequence counters except for the ones passed in
+ *
+ * @param {Object} do_not_reset
+ * @returns void
+ */
+ function _resetSequences(do_not_reset) {
+ do_not_reset = do_not_reset || {};
- // append this edge to the list of edges connecting to the childnode
- childNode.dynamicEdges.push(edge);
+ var active_sequences = false,
+ key;
- // remove the edge from the parent object
- for (var j = 0; j < parentNode.dynamicEdges.length; j++) {
- if (parentNode.dynamicEdges[j].id == edge.id) {
- parentNode.dynamicEdges.splice(j,1);
- break;
- }
+ for (key in _sequence_levels) {
+ if (do_not_reset[key]) {
+ active_sequences = true;
+ continue;
+ }
+ _sequence_levels[key] = 0;
+ }
+
+ if (!active_sequences) {
+ _inside_sequence = false;
}
- }
- // remove the entry from the rerouted edges
- delete parentNode.reroutedEdges[childNode.id];
}
- };
+ /**
+ * finds all callbacks that match based on the keycode, modifiers,
+ * and action
+ *
+ * @param {string} character
+ * @param {Array} modifiers
+ * @param {string} action
+ * @param {boolean=} remove - should we remove any matches
+ * @param {string=} combination
+ * @returns {Array}
+ */
+ function _getMatches(character, modifiers, action, remove, combination) {
+ var i,
+ callback,
+ matches = [];
- /**
- * When loops are clustered, an edge can be both in the rerouted array and the contained array.
- * This function is called last to verify that all edges in dynamicEdges are in fact connected to the
- * parentNode
- *
- * @param parentNode | Node object
- * @private
- */
- exports._validateEdges = function(parentNode) {
- for (var i = 0; i < parentNode.dynamicEdges.length; i++) {
- var edge = parentNode.dynamicEdges[i];
- if (parentNode.id != edge.toId && parentNode.id != edge.fromId) {
- parentNode.dynamicEdges.splice(i,1);
- }
- }
- };
+ // if there are no events related to this keycode
+ if (!_callbacks[character]) {
+ return [];
+ }
+ // if a modifier key is coming up on its own we should allow it
+ if (action == 'keyup' && _isModifier(character)) {
+ modifiers = [character];
+ }
- /**
- * This function released the contained edges back into the global domain and puts them back into the
- * dynamic edges of both parent and child.
- *
- * @param {Node} parentNode |
- * @param {Node} childNode |
- * @private
- */
- exports._releaseContainedEdges = function(parentNode, childNode) {
- for (var i = 0; i < parentNode.containedEdges[childNode.id].length; i++) {
- var edge = parentNode.containedEdges[childNode.id][i];
+ // loop through all callbacks for the key that was pressed
+ // and see if any of them match
+ for (i = 0; i < _callbacks[character].length; ++i) {
+ callback = _callbacks[character][i];
- // put the edge back in the global edges object
- this.edges[edge.id] = edge;
+ // if this is a sequence but it is not at the right level
+ // then move onto the next match
+ if (callback.seq && _sequence_levels[callback.seq] != callback.level) {
+ continue;
+ }
- // put the edge back in the dynamic edges of the child and parent
- childNode.dynamicEdges.push(edge);
- parentNode.dynamicEdges.push(edge);
- }
- // remove the entry from the contained edges
- delete parentNode.containedEdges[childNode.id];
+ // if the action we are looking for doesn't match the action we got
+ // then we should keep going
+ if (action != callback.action) {
+ continue;
+ }
- };
+ // if this is a keypress event that means that we need to only
+ // look at the character, otherwise check the modifiers as
+ // well
+ if (action == 'keypress' || _modifiersMatch(modifiers, callback.modifiers)) {
+ // remove is used so if you change your mind and call bind a
+ // second time with a new function the first one is overwritten
+ if (remove && callback.combo == combination) {
+ _callbacks[character].splice(i, 1);
+ }
+ matches.push(callback);
+ }
+ }
+ return matches;
+ }
- // ------------------- UTILITY FUNCTIONS ---------------------------- //
+ /**
+ * takes a key event and figures out what the modifiers are
+ *
+ * @param {Event} e
+ * @returns {Array}
+ */
+ function _eventModifiers(e) {
+ var modifiers = [];
+ if (e.shiftKey) {
+ modifiers.push('shift');
+ }
- /**
- * This updates the node labels for all nodes (for debugging purposes)
- */
- exports.updateLabels = function() {
- var nodeId;
- // update node labels
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- var node = this.nodes[nodeId];
- if (node.clusterSize > 1) {
- node.label = "[".concat(String(node.clusterSize),"]");
+ if (e.altKey) {
+ modifiers.push('alt');
}
- }
- }
- // update node labels
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- node = this.nodes[nodeId];
- if (node.clusterSize == 1) {
- if (node.originalLabel !== undefined) {
- node.label = node.originalLabel;
- }
- else {
- node.label = String(node.id);
- }
+ if (e.ctrlKey) {
+ modifiers.push('ctrl');
}
- }
- }
- // /* Debug Override */
- // for (nodeId in this.nodes) {
- // if (this.nodes.hasOwnProperty(nodeId)) {
- // node = this.nodes[nodeId];
- // node.label = String(node.level);
- // }
- // }
+ if (e.metaKey) {
+ modifiers.push('meta');
+ }
- };
+ return modifiers;
+ }
+ /**
+ * actually calls the callback function
+ *
+ * if your callback function returns false this will use the jquery
+ * convention - prevent default and stop propogation on the event
+ *
+ * @param {Function} callback
+ * @param {Event} e
+ * @returns void
+ */
+ function _fireCallback(callback, e) {
+ if (callback(e) === false) {
+ if (e.preventDefault) {
+ e.preventDefault();
+ }
- /**
- * We want to keep the cluster level distribution rather small. This means we do not want unclustered nodes
- * if the rest of the nodes are already a few cluster levels in.
- * To fix this we use this function. It determines the min and max cluster level and sends nodes that have not
- * clustered enough to the clusterToSmallestNeighbours function.
- */
- exports.normalizeClusterLevels = function() {
- var maxLevel = 0;
- var minLevel = 1e9;
- var clusterLevel = 0;
- var nodeId;
+ if (e.stopPropagation) {
+ e.stopPropagation();
+ }
- // we loop over all nodes in the list
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- clusterLevel = this.nodes[nodeId].clusterSessions.length;
- if (maxLevel < clusterLevel) {maxLevel = clusterLevel;}
- if (minLevel > clusterLevel) {minLevel = clusterLevel;}
- }
+ e.returnValue = false;
+ e.cancelBubble = true;
+ }
}
- if (maxLevel - minLevel > this.constants.clustering.clusterLevelDifference) {
- var amountOfNodes = this.nodeIndices.length;
- var targetLevel = maxLevel - this.constants.clustering.clusterLevelDifference;
- // we loop over all nodes in the list
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- if (this.nodes[nodeId].clusterSessions.length < targetLevel) {
- this._clusterToSmallestNeighbour(this.nodes[nodeId]);
- }
+ /**
+ * handles a character key event
+ *
+ * @param {string} character
+ * @param {Event} e
+ * @returns void
+ */
+ function _handleCharacter(character, e) {
+
+ // if this event should not happen stop here
+ if (_stop(e)) {
+ return;
}
- }
- this._updateNodeIndexList();
- this._updateDynamicEdges();
- // if a cluster was formed, we increase the clusterSession
- if (this.nodeIndices.length != amountOfNodes) {
- this.clusterSession += 1;
- }
- }
- };
+ var callbacks = _getMatches(character, _eventModifiers(e), e.type),
+ i,
+ do_not_reset = {},
+ processed_sequence_callback = false;
+
+ // loop through matching callbacks for this key event
+ for (i = 0; i < callbacks.length; ++i) {
+ // fire for all sequence callbacks
+ // this is because if for example you have multiple sequences
+ // bound such as "g i" and "g t" they both need to fire the
+ // callback for matching g cause otherwise you can only ever
+ // match the first one
+ if (callbacks[i].seq) {
+ processed_sequence_callback = true;
- /**
- * This function determines if the cluster we want to decluster is in the active area
- * this means around the zoom center
- *
- * @param {Node} node
- * @returns {boolean}
- * @private
- */
- exports._nodeInActiveArea = function(node) {
- return (
- Math.abs(node.x - this.areaCenter.x) <= this.constants.clustering.activeAreaBoxSize/this.scale
- &&
- Math.abs(node.y - this.areaCenter.y) <= this.constants.clustering.activeAreaBoxSize/this.scale
- )
- };
+ // keep a list of which sequences were matches for later
+ do_not_reset[callbacks[i].seq] = 1;
+ _fireCallback(callbacks[i].callback, e);
+ continue;
+ }
+ // if there were no sequence matches but we are still here
+ // that means this is a regular match so we should fire that
+ if (!processed_sequence_callback && !_inside_sequence) {
+ _fireCallback(callbacks[i].callback, e);
+ }
+ }
- /**
- * This is an adaptation of the original repositioning function. This is called if the system is clustered initially
- * It puts large clusters away from the center and randomizes the order.
- *
- */
- exports.repositionNodes = function() {
- for (var i = 0; i < this.nodeIndices.length; i++) {
- var node = this.nodes[this.nodeIndices[i]];
- if ((node.xFixed == false || node.yFixed == false)) {
- var radius = 10 * 0.1*this.nodeIndices.length * Math.min(100,node.mass);
- var angle = 2 * Math.PI * Math.random();
- if (node.xFixed == false) {node.x = radius * Math.cos(angle);}
- if (node.yFixed == false) {node.y = radius * Math.sin(angle);}
- this._repositionBezierNodes(node);
- }
+ // if you are inside of a sequence and the key you are pressing
+ // is not a modifier key then we should reset all sequences
+ // that were not matched by this key event
+ if (e.type == _inside_sequence && !_isModifier(character)) {
+ _resetSequences(do_not_reset);
+ }
}
- };
+ /**
+ * handles a keydown event
+ *
+ * @param {Event} e
+ * @returns void
+ */
+ function _handleKey(e) {
- /**
- * We determine how many connections denote an important hub.
- * We take the mean + 2*std as the important hub size. (Assuming a normal distribution of data, ~2.2%)
- *
- * @private
- */
- exports._getHubSize = function() {
- var average = 0;
- var averageSquared = 0;
- var hubCounter = 0;
- var largestHub = 0;
+ // normalize e.which for key events
+ // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
+ e.which = typeof e.which == "number" ? e.which : e.keyCode;
- for (var i = 0; i < this.nodeIndices.length; i++) {
+ var character = _characterFromEvent(e);
- var node = this.nodes[this.nodeIndices[i]];
- if (node.dynamicEdgesLength > largestHub) {
- largestHub = node.dynamicEdgesLength;
- }
- average += node.dynamicEdgesLength;
- averageSquared += Math.pow(node.dynamicEdgesLength,2);
- hubCounter += 1;
- }
- average = average / hubCounter;
- averageSquared = averageSquared / hubCounter;
+ // no character found then stop
+ if (!character) {
+ return;
+ }
- var variance = averageSquared - Math.pow(average,2);
+ if (e.type == 'keyup' && _ignore_next_keyup == character) {
+ _ignore_next_keyup = false;
+ return;
+ }
- var standardDeviation = Math.sqrt(variance);
+ _handleCharacter(character, e);
+ }
- this.hubThreshold = Math.floor(average + 2*standardDeviation);
+ /**
+ * determines if the keycode specified is a modifier key or not
+ *
+ * @param {string} key
+ * @returns {boolean}
+ */
+ function _isModifier(key) {
+ return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
+ }
- // always have at least one to cluster
- if (this.hubThreshold > largestHub) {
- this.hubThreshold = largestHub;
+ /**
+ * called to set a 1 second timeout on the specified sequence
+ *
+ * this is so after each key press in the sequence you have 1 second
+ * to press the next key before you have to start over
+ *
+ * @returns void
+ */
+ function _resetSequenceTimer() {
+ clearTimeout(_reset_timer);
+ _reset_timer = setTimeout(_resetSequences, 1000);
}
- // console.log("average",average,"averageSQ",averageSquared,"var",variance,"std",standardDeviation);
- // console.log("hubThreshold:",this.hubThreshold);
- };
+ /**
+ * reverses the map lookup so that we can look for specific keys
+ * to see what can and can't use keypress
+ *
+ * @return {Object}
+ */
+ function _getReverseMap() {
+ if (!_REVERSE_MAP) {
+ _REVERSE_MAP = {};
+ for (var key in _MAP) {
+ // pull out the numeric keypad from here cause keypress should
+ // be able to detect the keys from the character
+ if (key > 95 && key < 112) {
+ continue;
+ }
- /**
- * We reduce the amount of "extension nodes" or chains. These are not quickly clustered with the outliers and hubs methods
- * with this amount we can cluster specifically on these chains.
- *
- * @param {Number} fraction | between 0 and 1, the percentage of chains to reduce
- * @private
- */
- exports._reduceAmountOfChains = function(fraction) {
- this.hubThreshold = 2;
- var reduceAmount = Math.floor(this.nodeIndices.length * fraction);
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- if (this.nodes[nodeId].dynamicEdgesLength == 2 && this.nodes[nodeId].dynamicEdges.length >= 2) {
- if (reduceAmount > 0) {
- this._formClusterFromHub(this.nodes[nodeId],true,true,1);
- reduceAmount -= 1;
- }
+ if (_MAP.hasOwnProperty(key)) {
+ _REVERSE_MAP[_MAP[key]] = key;
+ }
+ }
}
- }
+ return _REVERSE_MAP;
}
- };
- /**
- * We get the amount of "extension nodes" or chains. These are not quickly clustered with the outliers and hubs methods
- * with this amount we can cluster specifically on these chains.
- *
- * @private
- */
- exports._getChainFraction = function() {
- var chains = 0;
- var total = 0;
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- if (this.nodes[nodeId].dynamicEdgesLength == 2 && this.nodes[nodeId].dynamicEdges.length >= 2) {
- chains += 1;
+ /**
+ * picks the best action based on the key combination
+ *
+ * @param {string} key - character for key
+ * @param {Array} modifiers
+ * @param {string=} action passed in
+ */
+ function _pickBestAction(key, modifiers, action) {
+
+ // if no action was picked in we should try to pick the one
+ // that we think would work best for this key
+ if (!action) {
+ action = _getReverseMap()[key] ? 'keydown' : 'keypress';
}
- total += 1;
- }
- }
- return chains/total;
- };
+ // modifier keys don't work as expected with keypress,
+ // switch to keydown
+ if (action == 'keypress' && modifiers.length) {
+ action = 'keydown';
+ }
-/***/ },
-/* 43 */
-/***/ function(module, exports, __webpack_require__) {
+ return action;
+ }
- var util = __webpack_require__(1);
+ /**
+ * binds a key sequence to an event
+ *
+ * @param {string} combo - combo specified in bind call
+ * @param {Array} keys
+ * @param {Function} callback
+ * @param {string=} action
+ * @returns void
+ */
+ function _bindSequence(combo, keys, callback, action) {
- /**
- * Creation of the SectorMixin var.
- *
- * This contains all the functions the Network object can use to employ the sector system.
- * The sector system is always used by Network, though the benefits only apply to the use of clustering.
- * If clustering is not used, there is no overhead except for a duplicate object with references to nodes and edges.
- */
+ // start off by adding a sequence level record for this combination
+ // and setting the level to 0
+ _sequence_levels[combo] = 0;
- /**
- * This function is only called by the setData function of the Network object.
- * This loads the global references into the active sector. This initializes the sector.
- *
- * @private
- */
- exports._putDataInSector = function() {
- this.sectors["active"][this._sector()].nodes = this.nodes;
- this.sectors["active"][this._sector()].edges = this.edges;
- this.sectors["active"][this._sector()].nodeIndices = this.nodeIndices;
- };
+ // if there is no action pick the best one for the first key
+ // in the sequence
+ if (!action) {
+ action = _pickBestAction(keys[0], []);
+ }
+
+ /**
+ * callback to increase the sequence level for this sequence and reset
+ * all other sequences that were active
+ *
+ * @param {Event} e
+ * @returns void
+ */
+ var _increaseSequence = function(e) {
+ _inside_sequence = action;
+ ++_sequence_levels[combo];
+ _resetSequenceTimer();
+ },
+ /**
+ * wraps the specified callback inside of another function in order
+ * to reset all sequence counters as soon as this sequence is done
+ *
+ * @param {Event} e
+ * @returns void
+ */
+ _callbackAndReset = function(e) {
+ _fireCallback(callback, e);
- /**
- * /**
- * This function sets the global references to nodes, edges and nodeIndices back to
- * those of the supplied (active) sector. If a type is defined, do the specific type
- *
- * @param {String} sectorId
- * @param {String} [sectorType] | "active" or "frozen"
- * @private
- */
- exports._switchToSector = function(sectorId, sectorType) {
- if (sectorType === undefined || sectorType == "active") {
- this._switchToActiveSector(sectorId);
- }
- else {
- this._switchToFrozenSector(sectorId);
+ // we should ignore the next key up if the action is key down
+ // or keypress. this is so if you finish a sequence and
+ // release the key the final key will not trigger a keyup
+ if (action !== 'keyup') {
+ _ignore_next_keyup = _characterFromEvent(e);
+ }
+
+ // weird race condition if a sequence ends with the key
+ // another sequence begins with
+ setTimeout(_resetSequences, 10);
+ },
+ i;
+
+ // loop through keys one at a time and bind the appropriate callback
+ // function. for any key leading up to the final one it should
+ // increase the sequence. after the final, it should reset all sequences
+ for (i = 0; i < keys.length; ++i) {
+ _bindSingle(keys[i], i < keys.length - 1 ? _increaseSequence : _callbackAndReset, action, combo, i);
+ }
}
- };
+ /**
+ * binds a single keyboard combination
+ *
+ * @param {string} combination
+ * @param {Function} callback
+ * @param {string=} action
+ * @param {string=} sequence_name - name of sequence if part of sequence
+ * @param {number=} level - what part of the sequence the command is
+ * @returns void
+ */
+ function _bindSingle(combination, callback, action, sequence_name, level) {
- /**
- * This function sets the global references to nodes, edges and nodeIndices back to
- * those of the supplied active sector.
- *
- * @param sectorId
- * @private
- */
- exports._switchToActiveSector = function(sectorId) {
- this.nodeIndices = this.sectors["active"][sectorId]["nodeIndices"];
- this.nodes = this.sectors["active"][sectorId]["nodes"];
- this.edges = this.sectors["active"][sectorId]["edges"];
- };
+ // make sure multiple spaces in a row become a single space
+ combination = combination.replace(/\s+/g, ' ');
+ var sequence = combination.split(' '),
+ i,
+ key,
+ keys,
+ modifiers = [];
- /**
- * This function sets the global references to nodes, edges and nodeIndices back to
- * those of the supplied active sector.
- *
- * @private
- */
- exports._switchToSupportSector = function() {
- this.nodeIndices = this.sectors["support"]["nodeIndices"];
- this.nodes = this.sectors["support"]["nodes"];
- this.edges = this.sectors["support"]["edges"];
- };
+ // if this pattern is a sequence of keys then run through this method
+ // to reprocess each pattern one key at a time
+ if (sequence.length > 1) {
+ return _bindSequence(combination, sequence, callback, action);
+ }
+ // take the keys from this pattern and figure out what the actual
+ // pattern is all about
+ keys = combination === '+' ? ['+'] : combination.split('+');
- /**
- * This function sets the global references to nodes, edges and nodeIndices back to
- * those of the supplied frozen sector.
- *
- * @param sectorId
- * @private
- */
- exports._switchToFrozenSector = function(sectorId) {
- this.nodeIndices = this.sectors["frozen"][sectorId]["nodeIndices"];
- this.nodes = this.sectors["frozen"][sectorId]["nodes"];
- this.edges = this.sectors["frozen"][sectorId]["edges"];
- };
+ for (i = 0; i < keys.length; ++i) {
+ key = keys[i];
+ // normalize key names
+ if (_SPECIAL_ALIASES[key]) {
+ key = _SPECIAL_ALIASES[key];
+ }
- /**
- * This function sets the global references to nodes, edges and nodeIndices back to
- * those of the currently active sector.
- *
- * @private
- */
- exports._loadLatestSector = function() {
- this._switchToSector(this._sector());
- };
+ // if this is not a keypress event then we should
+ // be smart about using shift keys
+ // this will only work for US keyboards however
+ if (action && action != 'keypress' && _SHIFT_MAP[key]) {
+ key = _SHIFT_MAP[key];
+ modifiers.push('shift');
+ }
+ // if this key is a modifier then add it to the list of modifiers
+ if (_isModifier(key)) {
+ modifiers.push(key);
+ }
+ }
- /**
- * This function returns the currently active sector Id
- *
- * @returns {String}
- * @private
- */
- exports._sector = function() {
- return this.activeSector[this.activeSector.length-1];
- };
+ // depending on what the key combination is
+ // we will try to pick the best event for it
+ action = _pickBestAction(key, modifiers, action);
+ // make sure to initialize array if this is the first time
+ // a callback is added for this key
+ if (!_callbacks[key]) {
+ _callbacks[key] = [];
+ }
- /**
- * This function returns the previously active sector Id
- *
- * @returns {String}
- * @private
- */
- exports._previousSector = function() {
- if (this.activeSector.length > 1) {
- return this.activeSector[this.activeSector.length-2];
+ // remove an existing match if there is one
+ _getMatches(key, modifiers, action, !sequence_name, combination);
+
+ // add this call back to the array
+ // if it is a sequence put it at the beginning
+ // if not put it at the end
+ //
+ // this is important because the way these are processed expects
+ // the sequence ones to come first
+ _callbacks[key][sequence_name ? 'unshift' : 'push']({
+ callback: callback,
+ modifiers: modifiers,
+ action: action,
+ seq: sequence_name,
+ level: level,
+ combo: combination
+ });
}
- else {
- throw new TypeError('there are not enough sectors in the this.activeSector array.');
+
+ /**
+ * binds multiple combinations to the same callback
+ *
+ * @param {Array} combinations
+ * @param {Function} callback
+ * @param {string|undefined} action
+ * @returns void
+ */
+ function _bindMultiple(combinations, callback, action) {
+ for (var i = 0; i < combinations.length; ++i) {
+ _bindSingle(combinations[i], callback, action);
+ }
}
- };
+ // start!
+ _addEvent(document, 'keypress', _handleKey);
+ _addEvent(document, 'keydown', _handleKey);
+ _addEvent(document, 'keyup', _handleKey);
- /**
- * We add the active sector at the end of the this.activeSector array
- * This ensures it is the currently active sector returned by _sector() and it reaches the top
- * of the activeSector stack. When we reverse our steps we move from the end to the beginning of this stack.
- *
- * @param newId
- * @private
- */
- exports._setActiveSector = function(newId) {
- this.activeSector.push(newId);
- };
+ var mousetrap = {
+
+ /**
+ * binds an event to mousetrap
+ *
+ * can be a single key, a combination of keys separated with +,
+ * a comma separated list of keys, an array of keys, or
+ * a sequence of keys separated by spaces
+ *
+ * be sure to list the modifier keys first to make sure that the
+ * correct key ends up getting bound (the last key in the pattern)
+ *
+ * @param {string|Array} keys
+ * @param {Function} callback
+ * @param {string=} action - 'keypress', 'keydown', or 'keyup'
+ * @returns void
+ */
+ bind: function(keys, callback, action) {
+ _bindMultiple(keys instanceof Array ? keys : [keys], callback, action);
+ _direct_map[keys + ':' + action] = callback;
+ return this;
+ },
+
+ /**
+ * unbinds an event to mousetrap
+ *
+ * the unbinding sets the callback function of the specified key combo
+ * to an empty function and deletes the corresponding key in the
+ * _direct_map dict.
+ *
+ * the keycombo+action has to be exactly the same as
+ * it was defined in the bind method
+ *
+ * TODO: actually remove this from the _callbacks dictionary instead
+ * of binding an empty function
+ *
+ * @param {string|Array} keys
+ * @param {string} action
+ * @returns void
+ */
+ unbind: function(keys, action) {
+ if (_direct_map[keys + ':' + action]) {
+ delete _direct_map[keys + ':' + action];
+ this.bind(keys, function() {}, action);
+ }
+ return this;
+ },
+ /**
+ * triggers an event that has already been bound
+ *
+ * @param {string} keys
+ * @param {string=} action
+ * @returns void
+ */
+ trigger: function(keys, action) {
+ _direct_map[keys + ':' + action]();
+ return this;
+ },
- /**
- * We remove the currently active sector id from the active sector stack. This happens when
- * we reactivate the previously active sector
- *
- * @private
- */
- exports._forgetLastSector = function() {
- this.activeSector.pop();
- };
+ /**
+ * resets the library back to its initial state. this is useful
+ * if you want to clear out the current keyboard shortcuts and bind
+ * new ones - for example if you switch to another page
+ *
+ * @returns void
+ */
+ reset: function() {
+ _callbacks = {};
+ _direct_map = {};
+ return this;
+ }
+ };
+ module.exports = mousetrap;
- /**
- * This function creates a new active sector with the supplied newId. This newId
- * is the expanding node id.
- *
- * @param {String} newId | Id of the new active sector
- * @private
- */
- exports._createNewSector = function(newId) {
- // create the new sector
- this.sectors["active"][newId] = {"nodes":{},
- "edges":{},
- "nodeIndices":[],
- "formationScale": this.scale,
- "drawingNode": undefined};
- // create the new sector render node. This gives visual feedback that you are in a new sector.
- this.sectors["active"][newId]['drawingNode'] = new Node(
- {id:newId,
- color: {
- background: "#eaefef",
- border: "495c5e"
- }
- },{},{},this.constants);
- this.sectors["active"][newId]['drawingNode'].clusterSize = 2;
- };
+/***/ },
+/* 43 */
+/***/ function(module, exports, __webpack_require__) {
/**
- * This function removes the currently active sector. This is called when we create a new
- * active sector.
+ * Creation of the ClusterMixin var.
*
- * @param {String} sectorId | Id of the active sector that will be removed
- * @private
+ * This contains all the functions the Network object can use to employ clustering
*/
- exports._deleteActiveSector = function(sectorId) {
- delete this.sectors["active"][sectorId];
- };
-
/**
- * This function removes the currently active sector. This is called when we reactivate
- * the previously active sector.
- *
- * @param {String} sectorId | Id of the active sector that will be removed
- * @private
- */
- exports._deleteFrozenSector = function(sectorId) {
- delete this.sectors["frozen"][sectorId];
- };
-
+ * This is only called in the constructor of the network object
+ *
+ */
+ exports.startWithClustering = function() {
+ // cluster if the data set is big
+ this.clusterToFit(this.constants.clustering.initialMaxNodes, true);
- /**
- * Freezing an active sector means moving it from the "active" object to the "frozen" object.
- * We copy the references, then delete the active entree.
- *
- * @param sectorId
- * @private
- */
- exports._freezeSector = function(sectorId) {
- // we move the set references from the active to the frozen stack.
- this.sectors["frozen"][sectorId] = this.sectors["active"][sectorId];
+ // updates the lables after clustering
+ this.updateLabels();
- // we have moved the sector data into the frozen set, we now remove it from the active set
- this._deleteActiveSector(sectorId);
+ // this is called here because if clusterin is disabled, the start and stabilize are called in
+ // the setData function.
+ if (this.stabilize) {
+ this._stabilize();
+ }
+ this.start();
};
-
/**
- * This is the reverse operation of _freezeSector. Activating means moving the sector from the "frozen"
- * object to the "active" object.
+ * This function clusters until the initialMaxNodes has been reached
*
- * @param sectorId
- * @private
+ * @param {Number} maxNumberOfNodes
+ * @param {Boolean} reposition
*/
- exports._activateSector = function(sectorId) {
- // we move the set references from the frozen to the active stack.
- this.sectors["active"][sectorId] = this.sectors["frozen"][sectorId];
-
- // we have moved the sector data into the active set, we now remove it from the frozen stack
- this._deleteFrozenSector(sectorId);
- };
+ exports.clusterToFit = function(maxNumberOfNodes, reposition) {
+ var numberOfNodes = this.nodeIndices.length;
+ var maxLevels = 50;
+ var level = 0;
- /**
- * This function merges the data from the currently active sector with a frozen sector. This is used
- * in the process of reverting back to the previously active sector.
- * The data that is placed in the frozen (the previously active) sector is the node that has been removed from it
- * upon the creation of a new active sector.
- *
- * @param sectorId
- * @private
- */
- exports._mergeThisWithFrozen = function(sectorId) {
- // copy all nodes
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- this.sectors["frozen"][sectorId]["nodes"][nodeId] = this.nodes[nodeId];
+ // we first cluster the hubs, then we pull in the outliers, repeat
+ while (numberOfNodes > maxNumberOfNodes && level < maxLevels) {
+ if (level % 3 == 0) {
+ this.forceAggregateHubs(true);
+ this.normalizeClusterLevels();
}
- }
-
- // copy all edges (if not fully clustered, else there are no edges)
- for (var edgeId in this.edges) {
- if (this.edges.hasOwnProperty(edgeId)) {
- this.sectors["frozen"][sectorId]["edges"][edgeId] = this.edges[edgeId];
+ else {
+ this.increaseClusterLevel(); // this also includes a cluster normalization
}
- }
- // merge the nodeIndices
- for (var i = 0; i < this.nodeIndices.length; i++) {
- this.sectors["frozen"][sectorId]["nodeIndices"].push(this.nodeIndices[i]);
+ numberOfNodes = this.nodeIndices.length;
+ level += 1;
}
- };
-
- /**
- * This clusters the sector to one cluster. It was a single cluster before this process started so
- * we revert to that state. The clusterToFit function with a maximum size of 1 node does this.
- *
- * @private
- */
- exports._collapseThisToSingleCluster = function() {
- this.clusterToFit(1,false);
+ // after the clustering we reposition the nodes to reduce the initial chaos
+ if (level > 0 && reposition == true) {
+ this.repositionNodes();
+ }
+ this._updateCalculationNodes();
};
-
/**
- * We create a new active sector from the node that we want to open.
+ * This function can be called to open up a specific cluster. It is only called by
+ * It will unpack the cluster back one level.
*
- * @param node
- * @private
+ * @param node | Node object: cluster to open.
*/
- exports._addSector = function(node) {
- // this is the currently active sector
- var sector = this._sector();
-
- // // this should allow me to select nodes from a frozen set.
- // if (this.sectors['active'][sector]["nodes"].hasOwnProperty(node.id)) {
- // console.log("the node is part of the active sector");
- // }
- // else {
- // console.log("I dont know what the fuck happened!!");
- // }
-
- // when we switch to a new sector, we remove the node that will be expanded from the current nodes list.
- delete this.nodes[node.id];
-
- var unqiueIdentifier = util.randomUUID();
-
- // we fully freeze the currently active sector
- this._freezeSector(sector);
+ exports.openCluster = function(node) {
+ var isMovingBeforeClustering = this.moving;
+ if (node.clusterSize > this.constants.clustering.sectorThreshold && this._nodeInActiveArea(node) &&
+ !(this._sector() == "default" && this.nodeIndices.length == 1)) {
+ // this loads a new sector, loads the nodes and edges and nodeIndices of it.
+ this._addSector(node);
+ var level = 0;
- // we create a new active sector. This sector has the Id of the node to ensure uniqueness
- this._createNewSector(unqiueIdentifier);
+ // we decluster until we reach a decent number of nodes
+ while ((this.nodeIndices.length < this.constants.clustering.initialMaxNodes) && (level < 10)) {
+ this.decreaseClusterLevel();
+ level += 1;
+ }
- // we add the active sector to the sectors array to be able to revert these steps later on
- this._setActiveSector(unqiueIdentifier);
+ }
+ else {
+ this._expandClusterNode(node,false,true);
- // we redirect the global references to the new sector's references. this._sector() now returns unqiueIdentifier
- this._switchToSector(this._sector());
+ // update the index list, dynamic edges and labels
+ this._updateNodeIndexList();
+ this._updateDynamicEdges();
+ this._updateCalculationNodes();
+ this.updateLabels();
+ }
- // finally we add the node we removed from our previous active sector to the new active sector
- this.nodes[node.id] = node;
+ // if the simulation was settled, we restart the simulation if a cluster has been formed or expanded
+ if (this.moving != isMovingBeforeClustering) {
+ this.start();
+ }
};
/**
- * We close the sector that is currently open and revert back to the one before.
- * If the active sector is the "default" sector, nothing happens.
- *
- * @private
+ * This calls the updateClustes with default arguments
*/
- exports._collapseSector = function() {
- // the currently active sector
- var sector = this._sector();
-
- // we cannot collapse the default sector
- if (sector != "default") {
- if ((this.nodeIndices.length == 1) ||
- (this.sectors["active"][sector]["drawingNode"].width*this.scale < this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientWidth) ||
- (this.sectors["active"][sector]["drawingNode"].height*this.scale < this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientHeight)) {
- var previousSector = this._previousSector();
-
- // we collapse the sector back to a single cluster
- this._collapseThisToSingleCluster();
-
- // we move the remaining nodes, edges and nodeIndices to the previous sector.
- // This previous sector is the one we will reactivate
- this._mergeThisWithFrozen(previousSector);
-
- // the previously active (frozen) sector now has all the data from the currently active sector.
- // we can now delete the active sector.
- this._deleteActiveSector(sector);
-
- // we activate the previously active (and currently frozen) sector.
- this._activateSector(previousSector);
-
- // we load the references from the newly active sector into the global references
- this._switchToSector(previousSector);
-
- // we forget the previously active sector because we reverted to the one before
- this._forgetLastSector();
+ exports.updateClustersDefault = function() {
+ if (this.constants.clustering.enabled == true) {
+ this.updateClusters(0,false,false);
+ }
+ };
- // finally, we update the node index list.
- this._updateNodeIndexList();
- // we refresh the list with calulation nodes and calculation node indices.
- this._updateCalculationNodes();
- }
- }
+ /**
+ * This function can be called to increase the cluster level. This means that the nodes with only one edge connection will
+ * be clustered with their connected node. This can be repeated as many times as needed.
+ * This can be called externally (by a keybind for instance) to reduce the complexity of big datasets.
+ */
+ exports.increaseClusterLevel = function() {
+ this.updateClusters(-1,false,true);
};
/**
- * This runs a function in all active sectors. This is used in _redraw() and the _initializeForceCalculation().
- *
- * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
- * | we dont pass the function itself because then the "this" is the window object
- * | instead of the Network object
- * @param {*} [argument] | Optional: arguments to pass to the runFunction
- * @private
+ * This function can be called to decrease the cluster level. This means that the nodes with only one edge connection will
+ * be unpacked if they are a cluster. This can be repeated as many times as needed.
+ * This can be called externally (by a key-bind for instance) to look into clusters without zooming.
*/
- exports._doInAllActiveSectors = function(runFunction,argument) {
- if (argument === undefined) {
- for (var sector in this.sectors["active"]) {
- if (this.sectors["active"].hasOwnProperty(sector)) {
- // switch the global references to those of this sector
- this._switchToActiveSector(sector);
- this[runFunction]();
- }
- }
- }
- else {
- for (var sector in this.sectors["active"]) {
- if (this.sectors["active"].hasOwnProperty(sector)) {
- // switch the global references to those of this sector
- this._switchToActiveSector(sector);
- var args = Array.prototype.splice.call(arguments, 1);
- if (args.length > 1) {
- this[runFunction](args[0],args[1]);
- }
- else {
- this[runFunction](argument);
- }
- }
- }
- }
- // we revert the global references back to our active sector
- this._loadLatestSector();
+ exports.decreaseClusterLevel = function() {
+ this.updateClusters(1,false,true);
};
/**
- * This runs a function in all active sectors. This is used in _redraw() and the _initializeForceCalculation().
+ * This is the main clustering function. It clusters and declusters on zoom or forced
+ * This function clusters on zoom, it can be called with a predefined zoom direction
+ * If out, check if we can form clusters, if in, check if we can open clusters.
+ * This function is only called from _zoom()
+ *
+ * @param {Number} zoomDirection | -1 / 0 / +1 for zoomOut / determineByZoom / zoomIn
+ * @param {Boolean} recursive | enabled or disable recursive calling of the opening of clusters
+ * @param {Boolean} force | enabled or disable forcing
+ * @param {Boolean} doNotStart | if true do not call start
*
- * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
- * | we dont pass the function itself because then the "this" is the window object
- * | instead of the Network object
- * @param {*} [argument] | Optional: arguments to pass to the runFunction
- * @private
*/
- exports._doInSupportSector = function(runFunction,argument) {
- if (argument === undefined) {
- this._switchToSupportSector();
- this[runFunction]();
+ exports.updateClusters = function(zoomDirection,recursive,force,doNotStart) {
+ var isMovingBeforeClustering = this.moving;
+ var amountOfNodes = this.nodeIndices.length;
+
+ // on zoom out collapse the sector if the scale is at the level the sector was made
+ if (this.previousScale > this.scale && zoomDirection == 0) {
+ this._collapseSector();
}
- else {
- this._switchToSupportSector();
- var args = Array.prototype.splice.call(arguments, 1);
- if (args.length > 1) {
- this[runFunction](args[0],args[1]);
+
+ // check if we zoom in or out
+ if (this.previousScale > this.scale || zoomDirection == -1) { // zoom out
+ // forming clusters when forced pulls outliers in. When not forced, the edge length of the
+ // outer nodes determines if it is being clustered
+ this._formClusters(force);
+ }
+ else if (this.previousScale < this.scale || zoomDirection == 1) { // zoom in
+ if (force == true) {
+ // _openClusters checks for each node if the formationScale of the cluster is smaller than
+ // the current scale and if so, declusters. When forced, all clusters are reduced by one step
+ this._openClusters(recursive,force);
}
else {
- this[runFunction](argument);
+ // if a cluster takes up a set percentage of the active window
+ this._openClustersBySize();
}
}
- // we revert the global references back to our active sector
- this._loadLatestSector();
- };
+ this._updateNodeIndexList();
+ // if a cluster was NOT formed and the user zoomed out, we try clustering by hubs
+ if (this.nodeIndices.length == amountOfNodes && (this.previousScale > this.scale || zoomDirection == -1)) {
+ this._aggregateHubs(force);
+ this._updateNodeIndexList();
+ }
- /**
- * This runs a function in all frozen sectors. This is used in the _redraw().
- *
- * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
- * | we don't pass the function itself because then the "this" is the window object
- * | instead of the Network object
- * @param {*} [argument] | Optional: arguments to pass to the runFunction
- * @private
- */
- exports._doInAllFrozenSectors = function(runFunction,argument) {
- if (argument === undefined) {
- for (var sector in this.sectors["frozen"]) {
- if (this.sectors["frozen"].hasOwnProperty(sector)) {
- // switch the global references to those of this sector
- this._switchToFrozenSector(sector);
- this[runFunction]();
- }
- }
+ // we now reduce chains.
+ if (this.previousScale > this.scale || zoomDirection == -1) { // zoom out
+ this.handleChains();
+ this._updateNodeIndexList();
}
- else {
- for (var sector in this.sectors["frozen"]) {
- if (this.sectors["frozen"].hasOwnProperty(sector)) {
- // switch the global references to those of this sector
- this._switchToFrozenSector(sector);
- var args = Array.prototype.splice.call(arguments, 1);
- if (args.length > 1) {
- this[runFunction](args[0],args[1]);
- }
- else {
- this[runFunction](argument);
- }
- }
+
+ this.previousScale = this.scale;
+
+ // rest of the update the index list, dynamic edges and labels
+ this._updateDynamicEdges();
+ this.updateLabels();
+
+ // if a cluster was formed, we increase the clusterSession
+ if (this.nodeIndices.length < amountOfNodes) { // this means a clustering operation has taken place
+ this.clusterSession += 1;
+ // if clusters have been made, we normalize the cluster level
+ this.normalizeClusterLevels();
+ }
+
+ if (doNotStart == false || doNotStart === undefined) {
+ // if the simulation was settled, we restart the simulation if a cluster has been formed or expanded
+ if (this.moving != isMovingBeforeClustering) {
+ this.start();
}
}
- this._loadLatestSector();
- };
+ this._updateCalculationNodes();
+ };
/**
- * This runs a function in all sectors. This is used in the _redraw().
- *
- * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
- * | we don't pass the function itself because then the "this" is the window object
- * | instead of the Network object
- * @param {*} [argument] | Optional: arguments to pass to the runFunction
- * @private
+ * This function handles the chains. It is called on every updateClusters().
*/
- exports._doInAllSectors = function(runFunction,argument) {
- var args = Array.prototype.splice.call(arguments, 1);
- if (argument === undefined) {
- this._doInAllActiveSectors(runFunction);
- this._doInAllFrozenSectors(runFunction);
- }
- else {
- if (args.length > 1) {
- this._doInAllActiveSectors(runFunction,args[0],args[1]);
- this._doInAllFrozenSectors(runFunction,args[0],args[1]);
- }
- else {
- this._doInAllActiveSectors(runFunction,argument);
- this._doInAllFrozenSectors(runFunction,argument);
- }
+ exports.handleChains = function() {
+ // after clustering we check how many chains there are
+ var chainPercentage = this._getChainFraction();
+ if (chainPercentage > this.constants.clustering.chainThreshold) {
+ this._reduceAmountOfChains(1 - this.constants.clustering.chainThreshold / chainPercentage)
+
}
};
-
/**
- * This clears the nodeIndices list. We cannot use this.nodeIndices = [] because we would break the link with the
- * active sector. Thus we clear the nodeIndices in the active sector, then reconnect the this.nodeIndices to it.
+ * this functions starts clustering by hubs
+ * The minimum hub threshold is set globally
*
* @private
*/
- exports._clearNodeIndexList = function() {
- var sector = this._sector();
- this.sectors["active"][sector]["nodeIndices"] = [];
- this.nodeIndices = this.sectors["active"][sector]["nodeIndices"];
+ exports._aggregateHubs = function(force) {
+ this._getHubSize();
+ this._formClustersByHub(force,false);
};
/**
- * Draw the encompassing sector node
+ * This function is fired by keypress. It forces hubs to form.
*
- * @param ctx
- * @param sectorType
- * @private
*/
- exports._drawSectorNodes = function(ctx,sectorType) {
- var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node;
- for (var sector in this.sectors[sectorType]) {
- if (this.sectors[sectorType].hasOwnProperty(sector)) {
- if (this.sectors[sectorType][sector]["drawingNode"] !== undefined) {
-
- this._switchToSector(sector,sectorType);
-
- minY = 1e9; maxY = -1e9; minX = 1e9; maxX = -1e9;
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- node = this.nodes[nodeId];
- node.resize(ctx);
- if (minX > node.x - 0.5 * node.width) {minX = node.x - 0.5 * node.width;}
- if (maxX < node.x + 0.5 * node.width) {maxX = node.x + 0.5 * node.width;}
- if (minY > node.y - 0.5 * node.height) {minY = node.y - 0.5 * node.height;}
- if (maxY < node.y + 0.5 * node.height) {maxY = node.y + 0.5 * node.height;}
- }
- }
- node = this.sectors[sectorType][sector]["drawingNode"];
- node.x = 0.5 * (maxX + minX);
- node.y = 0.5 * (maxY + minY);
- node.width = 2 * (node.x - minX);
- node.height = 2 * (node.y - minY);
- node.radius = Math.sqrt(Math.pow(0.5*node.width,2) + Math.pow(0.5*node.height,2));
- node.setScale(this.scale);
- node._drawCircle(ctx);
- }
- }
- }
- };
+ exports.forceAggregateHubs = function(doNotStart) {
+ var isMovingBeforeClustering = this.moving;
+ var amountOfNodes = this.nodeIndices.length;
- exports._drawAllSectorNodes = function(ctx) {
- this._drawSectorNodes(ctx,"frozen");
- this._drawSectorNodes(ctx,"active");
- this._loadLatestSector();
- };
+ this._aggregateHubs(true);
+ // update the index list, dynamic edges and labels
+ this._updateNodeIndexList();
+ this._updateDynamicEdges();
+ this.updateLabels();
-/***/ },
-/* 44 */
-/***/ function(module, exports, __webpack_require__) {
+ // if a cluster was formed, we increase the clusterSession
+ if (this.nodeIndices.length != amountOfNodes) {
+ this.clusterSession += 1;
+ }
- var Node = __webpack_require__(30);
+ if (doNotStart == false || doNotStart === undefined) {
+ // if the simulation was settled, we restart the simulation if a cluster has been formed or expanded
+ if (this.moving != isMovingBeforeClustering) {
+ this.start();
+ }
+ }
+ };
/**
- * This function can be called from the _doInAllSectors function
+ * If a cluster takes up more than a set percentage of the screen, open the cluster
*
- * @param object
- * @param overlappingNodes
* @private
*/
- exports._getNodesOverlappingWith = function(object, overlappingNodes) {
- var nodes = this.nodes;
- for (var nodeId in nodes) {
- if (nodes.hasOwnProperty(nodeId)) {
- if (nodes[nodeId].isOverlappingWith(object)) {
- overlappingNodes.push(nodeId);
+ exports._openClustersBySize = function() {
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ var node = this.nodes[nodeId];
+ if (node.inView() == true) {
+ if ((node.width*this.scale > this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientWidth) ||
+ (node.height*this.scale > this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientHeight)) {
+ this.openCluster(node);
+ }
}
}
}
};
+
/**
- * retrieve all nodes overlapping with given object
- * @param {Object} object An object with parameters left, top, right, bottom
- * @return {Number[]} An array with id's of the overlapping nodes
+ * This function loops over all nodes in the nodeIndices list. For each node it checks if it is a cluster and if it
+ * has to be opened based on the current zoom level.
+ *
* @private
*/
- exports._getAllNodesOverlappingWith = function (object) {
- var overlappingNodes = [];
- this._doInAllActiveSectors("_getNodesOverlappingWith",object,overlappingNodes);
- return overlappingNodes;
+ exports._openClusters = function(recursive,force) {
+ for (var i = 0; i < this.nodeIndices.length; i++) {
+ var node = this.nodes[this.nodeIndices[i]];
+ this._expandClusterNode(node,recursive,force);
+ this._updateCalculationNodes();
+ }
};
-
/**
- * Return a position object in canvasspace from a single point in screenspace
+ * This function checks if a node has to be opened. This is done by checking the zoom level.
+ * If the node contains child nodes, this function is recursively called on the child nodes as well.
+ * This recursive behaviour is optional and can be set by the recursive argument.
*
- * @param pointer
- * @returns {{left: number, top: number, right: number, bottom: number}}
+ * @param {Node} parentNode | to check for cluster and expand
+ * @param {Boolean} recursive | enabled or disable recursive calling
+ * @param {Boolean} force | enabled or disable forcing
+ * @param {Boolean} [openAll] | This will recursively force all nodes in the parent to be released
* @private
*/
- exports._pointerToPositionObject = function(pointer) {
- var x = this._XconvertDOMtoCanvas(pointer.x);
- var y = this._YconvertDOMtoCanvas(pointer.y);
+ exports._expandClusterNode = function(parentNode, recursive, force, openAll) {
+ // first check if node is a cluster
+ if (parentNode.clusterSize > 1) {
+ // this means that on a double tap event or a zoom event, the cluster fully unpacks if it is smaller than 20
+ if (parentNode.clusterSize < this.constants.clustering.sectorThreshold) {
+ openAll = true;
+ }
+ recursive = openAll ? true : recursive;
- return {
- left: x,
- top: y,
- right: x,
- bottom: y
- };
- };
+ // if the last child has been added on a smaller scale than current scale decluster
+ if (parentNode.formationScale < this.scale || force == true) {
+ // we will check if any of the contained child nodes should be removed from the cluster
+ for (var containedNodeId in parentNode.containedNodes) {
+ if (parentNode.containedNodes.hasOwnProperty(containedNodeId)) {
+ var childNode = parentNode.containedNodes[containedNodeId];
+ // force expand will expand the largest cluster size clusters. Since we cluster from outside in, we assume that
+ // the largest cluster is the one that comes from outside
+ if (force == true) {
+ if (childNode.clusterSession == parentNode.clusterSessions[parentNode.clusterSessions.length-1]
+ || openAll) {
+ this._expelChildFromParent(parentNode,containedNodeId,recursive,force,openAll);
+ }
+ }
+ else {
+ if (this._nodeInActiveArea(parentNode)) {
+ this._expelChildFromParent(parentNode,containedNodeId,recursive,force,openAll);
+ }
+ }
+ }
+ }
+ }
+ }
+ };
/**
- * Get the top node at the a specific point (like a click)
+ * ONLY CALLED FROM _expandClusterNode
*
- * @param {{x: Number, y: Number}} pointer
- * @return {Node | null} node
+ * This function will expel a child_node from a parent_node. This is to de-cluster the node. This function will remove
+ * the child node from the parent contained_node object and put it back into the global nodes object.
+ * The same holds for the edge that was connected to the child node. It is moved back into the global edges object.
+ *
+ * @param {Node} parentNode | the parent node
+ * @param {String} containedNodeId | child_node id as it is contained in the containedNodes object of the parent node
+ * @param {Boolean} recursive | This will also check if the child needs to be expanded.
+ * With force and recursive both true, the entire cluster is unpacked
+ * @param {Boolean} force | This will disregard the zoom level and will expel this child from the parent
+ * @param {Boolean} openAll | This will recursively force all nodes in the parent to be released
* @private
*/
- exports._getNodeAt = function (pointer) {
- // we first check if this is an navigation controls element
- var positionObject = this._pointerToPositionObject(pointer);
- var overlappingNodes = this._getAllNodesOverlappingWith(positionObject);
+ exports._expelChildFromParent = function(parentNode, containedNodeId, recursive, force, openAll) {
+ var childNode = parentNode.containedNodes[containedNodeId];
- // if there are overlapping nodes, select the last one, this is the
- // one which is drawn on top of the others
- if (overlappingNodes.length > 0) {
- return this.nodes[overlappingNodes[overlappingNodes.length - 1]];
- }
- else {
- return null;
- }
- };
+ // if child node has been added on smaller scale than current, kick out
+ if (childNode.formationScale < this.scale || force == true) {
+ // unselect all selected items
+ this._unselectAll();
+ // put the child node back in the global nodes object
+ this.nodes[containedNodeId] = childNode;
- /**
- * retrieve all edges overlapping with given object, selector is around center
- * @param {Object} object An object with parameters left, top, right, bottom
- * @return {Number[]} An array with id's of the overlapping nodes
- * @private
- */
- exports._getEdgesOverlappingWith = function (object, overlappingEdges) {
- var edges = this.edges;
- for (var edgeId in edges) {
- if (edges.hasOwnProperty(edgeId)) {
- if (edges[edgeId].isOverlappingWith(object)) {
- overlappingEdges.push(edgeId);
+ // release the contained edges from this childNode back into the global edges
+ this._releaseContainedEdges(parentNode,childNode);
+
+ // reconnect rerouted edges to the childNode
+ this._connectEdgeBackToChild(parentNode,childNode);
+
+ // validate all edges in dynamicEdges
+ this._validateEdges(parentNode);
+
+ // undo the changes from the clustering operation on the parent node
+ parentNode.mass -= childNode.mass;
+ parentNode.clusterSize -= childNode.clusterSize;
+ parentNode.fontSize = Math.min(this.constants.clustering.maxFontSize, this.constants.nodes.fontSize + this.constants.clustering.fontSizeMultiplier*parentNode.clusterSize);
+ parentNode.dynamicEdgesLength = parentNode.dynamicEdges.length;
+
+ // place the child node near the parent, not at the exact same location to avoid chaos in the system
+ childNode.x = parentNode.x + parentNode.growthIndicator * (0.5 - Math.random());
+ childNode.y = parentNode.y + parentNode.growthIndicator * (0.5 - Math.random());
+
+ // remove node from the list
+ delete parentNode.containedNodes[containedNodeId];
+
+ // check if there are other childs with this clusterSession in the parent.
+ var othersPresent = false;
+ for (var childNodeId in parentNode.containedNodes) {
+ if (parentNode.containedNodes.hasOwnProperty(childNodeId)) {
+ if (parentNode.containedNodes[childNodeId].clusterSession == childNode.clusterSession) {
+ othersPresent = true;
+ break;
+ }
}
}
- }
- };
+ // if there are no others, remove the cluster session from the list
+ if (othersPresent == false) {
+ parentNode.clusterSessions.pop();
+ }
+ this._repositionBezierNodes(childNode);
+ // this._repositionBezierNodes(parentNode);
- /**
- * retrieve all nodes overlapping with given object
- * @param {Object} object An object with parameters left, top, right, bottom
- * @return {Number[]} An array with id's of the overlapping nodes
- * @private
- */
- exports._getAllEdgesOverlappingWith = function (object) {
- var overlappingEdges = [];
- this._doInAllActiveSectors("_getEdgesOverlappingWith",object,overlappingEdges);
- return overlappingEdges;
+ // remove the clusterSession from the child node
+ childNode.clusterSession = 0;
+
+ // recalculate the size of the node on the next time the node is rendered
+ parentNode.clearSizeCache();
+
+ // restart the simulation to reorganise all nodes
+ this.moving = true;
+ }
+
+ // check if a further expansion step is possible if recursivity is enabled
+ if (recursive == true) {
+ this._expandClusterNode(childNode,recursive,force,openAll);
+ }
};
+
/**
- * Place holder. To implement change the _getNodeAt to a _getObjectAt. Have the _getObjectAt call
- * _getNodeAt and _getEdgesAt, then priortize the selection to user preferences.
+ * position the bezier nodes at the center of the edges
*
- * @param pointer
- * @returns {null}
+ * @param node
* @private
*/
- exports._getEdgeAt = function(pointer) {
- var positionObject = this._pointerToPositionObject(pointer);
- var overlappingEdges = this._getAllEdgesOverlappingWith(positionObject);
-
- if (overlappingEdges.length > 0) {
- return this.edges[overlappingEdges[overlappingEdges.length - 1]];
- }
- else {
- return null;
+ exports._repositionBezierNodes = function(node) {
+ for (var i = 0; i < node.dynamicEdges.length; i++) {
+ node.dynamicEdges[i].positionBezierNode();
}
};
/**
- * Add object to the selection array.
+ * This function checks if any nodes at the end of their trees have edges below a threshold length
+ * This function is called only from updateClusters()
+ * forceLevelCollapse ignores the length of the edge and collapses one level
+ * This means that a node with only one edge will be clustered with its connected node
*
- * @param obj
* @private
+ * @param {Boolean} force
*/
- exports._addToSelection = function(obj) {
- if (obj instanceof Node) {
- this.selectionObj.nodes[obj.id] = obj;
+ exports._formClusters = function(force) {
+ if (force == false) {
+ this._formClustersByZoom();
}
else {
- this.selectionObj.edges[obj.id] = obj;
+ this._forceClustersByZoom();
}
};
+
/**
- * Add object to the selection array.
+ * This function handles the clustering by zooming out, this is based on a minimum edge distance
*
- * @param obj
* @private
*/
- exports._addToHover = function(obj) {
- if (obj instanceof Node) {
- this.hoverObj.nodes[obj.id] = obj;
- }
- else {
- this.hoverObj.edges[obj.id] = obj;
- }
- };
+ exports._formClustersByZoom = function() {
+ var dx,dy,length,
+ minLength = this.constants.clustering.clusterEdgeThreshold/this.scale;
+
+ // check if any edges are shorter than minLength and start the clustering
+ // the clustering favours the node with the larger mass
+ for (var edgeId in this.edges) {
+ if (this.edges.hasOwnProperty(edgeId)) {
+ var edge = this.edges[edgeId];
+ if (edge.connected) {
+ if (edge.toId != edge.fromId) {
+ dx = (edge.to.x - edge.from.x);
+ dy = (edge.to.y - edge.from.y);
+ length = Math.sqrt(dx * dx + dy * dy);
- /**
- * Remove a single option from selection.
- *
- * @param {Object} obj
- * @private
- */
- exports._removeFromSelection = function(obj) {
- if (obj instanceof Node) {
- delete this.selectionObj.nodes[obj.id];
- }
- else {
- delete this.selectionObj.edges[obj.id];
+ if (length < minLength) {
+ // first check which node is larger
+ var parentNode = edge.from;
+ var childNode = edge.to;
+ if (edge.to.mass > edge.from.mass) {
+ parentNode = edge.to;
+ childNode = edge.from;
+ }
+
+ if (childNode.dynamicEdgesLength == 1) {
+ this._addToCluster(parentNode,childNode,false);
+ }
+ else if (parentNode.dynamicEdgesLength == 1) {
+ this._addToCluster(childNode,parentNode,false);
+ }
+ }
+ }
+ }
+ }
}
};
/**
- * Unselect all. The selectionObj is useful for this.
+ * This function forces the network to cluster all nodes with only one connecting edge to their
+ * connected node.
*
- * @param {Boolean} [doNotTrigger] | ignore trigger
* @private
*/
- exports._unselectAll = function(doNotTrigger) {
- if (doNotTrigger === undefined) {
- doNotTrigger = false;
- }
- for(var nodeId in this.selectionObj.nodes) {
- if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- this.selectionObj.nodes[nodeId].unselect();
- }
- }
- for(var edgeId in this.selectionObj.edges) {
- if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
- this.selectionObj.edges[edgeId].unselect();
- }
- }
+ exports._forceClustersByZoom = function() {
+ for (var nodeId in this.nodes) {
+ // another node could have absorbed this child.
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ var childNode = this.nodes[nodeId];
- this.selectionObj = {nodes:{},edges:{}};
+ // the edges can be swallowed by another decrease
+ if (childNode.dynamicEdgesLength == 1 && childNode.dynamicEdges.length != 0) {
+ var edge = childNode.dynamicEdges[0];
+ var parentNode = (edge.toId == childNode.id) ? this.nodes[edge.fromId] : this.nodes[edge.toId];
- if (doNotTrigger == false) {
- this.emit('select', this.getSelection());
+ // group to the largest node
+ if (childNode.id != parentNode.id) {
+ if (parentNode.mass > childNode.mass) {
+ this._addToCluster(parentNode,childNode,true);
+ }
+ else {
+ this._addToCluster(childNode,parentNode,true);
+ }
+ }
+ }
+ }
}
};
+
/**
- * Unselect all clusters. The selectionObj is useful for this.
+ * To keep the nodes of roughly equal size we normalize the cluster levels.
+ * This function clusters a node to its smallest connected neighbour.
*
- * @param {Boolean} [doNotTrigger] | ignore trigger
+ * @param node
* @private
*/
- exports._unselectClusters = function(doNotTrigger) {
- if (doNotTrigger === undefined) {
- doNotTrigger = false;
- }
+ exports._clusterToSmallestNeighbour = function(node) {
+ var smallestNeighbour = -1;
+ var smallestNeighbourNode = null;
+ for (var i = 0; i < node.dynamicEdges.length; i++) {
+ if (node.dynamicEdges[i] !== undefined) {
+ var neighbour = null;
+ if (node.dynamicEdges[i].fromId != node.id) {
+ neighbour = node.dynamicEdges[i].from;
+ }
+ else if (node.dynamicEdges[i].toId != node.id) {
+ neighbour = node.dynamicEdges[i].to;
+ }
- for (var nodeId in this.selectionObj.nodes) {
- if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
- this.selectionObj.nodes[nodeId].unselect();
- this._removeFromSelection(this.selectionObj.nodes[nodeId]);
+
+ if (neighbour != null && smallestNeighbour > neighbour.clusterSessions.length) {
+ smallestNeighbour = neighbour.clusterSessions.length;
+ smallestNeighbourNode = neighbour;
}
}
}
- if (doNotTrigger == false) {
- this.emit('select', this.getSelection());
+ if (neighbour != null && this.nodes[neighbour.id] !== undefined) {
+ this._addToCluster(neighbour, node, true);
}
};
/**
- * return the number of selected nodes
+ * This function forms clusters from hubs, it loops over all nodes
*
- * @returns {number}
+ * @param {Boolean} force | Disregard zoom level
+ * @param {Boolean} onlyEqual | This only clusters a hub with a specific number of edges
* @private
*/
- exports._getSelectedNodeCount = function() {
- var count = 0;
- for (var nodeId in this.selectionObj.nodes) {
- if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- count += 1;
+ exports._formClustersByHub = function(force, onlyEqual) {
+ // we loop over all nodes in the list
+ for (var nodeId in this.nodes) {
+ // we check if it is still available since it can be used by the clustering in this loop
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ this._formClusterFromHub(this.nodes[nodeId],force,onlyEqual);
}
}
- return count;
};
/**
- * return the selected node
+ * This function forms a cluster from a specific preselected hub node
*
- * @returns {number}
+ * @param {Node} hubNode | the node we will cluster as a hub
+ * @param {Boolean} force | Disregard zoom level
+ * @param {Boolean} onlyEqual | This only clusters a hub with a specific number of edges
+ * @param {Number} [absorptionSizeOffset] |
* @private
*/
- exports._getSelectedNode = function() {
- for (var nodeId in this.selectionObj.nodes) {
- if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- return this.selectionObj.nodes[nodeId];
- }
+ exports._formClusterFromHub = function(hubNode, force, onlyEqual, absorptionSizeOffset) {
+ if (absorptionSizeOffset === undefined) {
+ absorptionSizeOffset = 0;
}
- return null;
- };
+ // we decide if the node is a hub
+ if ((hubNode.dynamicEdgesLength >= this.hubThreshold && onlyEqual == false) ||
+ (hubNode.dynamicEdgesLength == this.hubThreshold && onlyEqual == true)) {
+ // initialize variables
+ var dx,dy,length;
+ var minLength = this.constants.clustering.clusterEdgeThreshold/this.scale;
+ var allowCluster = false;
- /**
- * return the selected edge
- *
- * @returns {number}
- * @private
- */
- exports._getSelectedEdge = function() {
- for (var edgeId in this.selectionObj.edges) {
- if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
- return this.selectionObj.edges[edgeId];
+ // we create a list of edges because the dynamicEdges change over the course of this loop
+ var edgesIdarray = [];
+ var amountOfInitialEdges = hubNode.dynamicEdges.length;
+ for (var j = 0; j < amountOfInitialEdges; j++) {
+ edgesIdarray.push(hubNode.dynamicEdges[j].id);
}
- }
- return null;
- };
+ // if the hub clustering is not forces, we check if one of the edges connected
+ // to a cluster is small enough based on the constants.clustering.clusterEdgeThreshold
+ if (force == false) {
+ allowCluster = false;
+ for (j = 0; j < amountOfInitialEdges; j++) {
+ var edge = this.edges[edgesIdarray[j]];
+ if (edge !== undefined) {
+ if (edge.connected) {
+ if (edge.toId != edge.fromId) {
+ dx = (edge.to.x - edge.from.x);
+ dy = (edge.to.y - edge.from.y);
+ length = Math.sqrt(dx * dx + dy * dy);
- /**
- * return the number of selected edges
- *
- * @returns {number}
- * @private
- */
- exports._getSelectedEdgeCount = function() {
- var count = 0;
- for (var edgeId in this.selectionObj.edges) {
- if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
- count += 1;
+ if (length < minLength) {
+ allowCluster = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // start the clustering if allowed
+ if ((!force && allowCluster) || force) {
+ // we loop over all edges INITIALLY connected to this hub
+ for (j = 0; j < amountOfInitialEdges; j++) {
+ edge = this.edges[edgesIdarray[j]];
+ // the edge can be clustered by this function in a previous loop
+ if (edge !== undefined) {
+ var childNode = this.nodes[(edge.fromId == hubNode.id) ? edge.toId : edge.fromId];
+ // we do not want hubs to merge with other hubs nor do we want to cluster itself.
+ if ((childNode.dynamicEdges.length <= (this.hubThreshold + absorptionSizeOffset)) &&
+ (childNode.id != hubNode.id)) {
+ this._addToCluster(hubNode,childNode,force);
+ }
+ }
+ }
}
}
- return count;
};
+
/**
- * return the number of selected objects.
+ * This function adds the child node to the parent node, creating a cluster if it is not already.
*
- * @returns {number}
+ * @param {Node} parentNode | this is the node that will house the child node
+ * @param {Node} childNode | this node will be deleted from the global this.nodes and stored in the parent node
+ * @param {Boolean} force | true will only update the remainingEdges at the very end of the clustering, ensuring single level collapse
* @private
*/
- exports._getSelectedObjectCount = function() {
- var count = 0;
- for(var nodeId in this.selectionObj.nodes) {
- if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- count += 1;
+ exports._addToCluster = function(parentNode, childNode, force) {
+ // join child node in the parent node
+ parentNode.containedNodes[childNode.id] = childNode;
+
+ // manage all the edges connected to the child and parent nodes
+ for (var i = 0; i < childNode.dynamicEdges.length; i++) {
+ var edge = childNode.dynamicEdges[i];
+ if (edge.toId == parentNode.id || edge.fromId == parentNode.id) { // edge connected to parentNode
+ this._addToContainedEdges(parentNode,childNode,edge);
}
- }
- for(var edgeId in this.selectionObj.edges) {
- if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
- count += 1;
+ else {
+ this._connectEdgeToCluster(parentNode,childNode,edge);
}
}
- return count;
- };
+ // a contained node has no dynamic edges.
+ childNode.dynamicEdges = [];
+
+ // remove circular edges from clusters
+ this._containCircularEdgesFromNode(parentNode,childNode);
+
+
+ // remove the childNode from the global nodes object
+ delete this.nodes[childNode.id];
+
+ // update the properties of the child and parent
+ var massBefore = parentNode.mass;
+ childNode.clusterSession = this.clusterSession;
+ parentNode.mass += childNode.mass;
+ parentNode.clusterSize += childNode.clusterSize;
+ parentNode.fontSize = Math.min(this.constants.clustering.maxFontSize, this.constants.nodes.fontSize + this.constants.clustering.fontSizeMultiplier*parentNode.clusterSize);
+
+ // keep track of the clustersessions so we can open the cluster up as it has been formed.
+ if (parentNode.clusterSessions[parentNode.clusterSessions.length - 1] != this.clusterSession) {
+ parentNode.clusterSessions.push(this.clusterSession);
+ }
- /**
- * Check if anything is selected
- *
- * @returns {boolean}
- * @private
- */
- exports._selectionIsEmpty = function() {
- for(var nodeId in this.selectionObj.nodes) {
- if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- return false;
- }
+ // forced clusters only open from screen size and double tap
+ if (force == true) {
+ // parentNode.formationScale = Math.pow(1 - (1.0/11.0),this.clusterSession+3);
+ parentNode.formationScale = 0;
}
- for(var edgeId in this.selectionObj.edges) {
- if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
- return false;
- }
+ else {
+ parentNode.formationScale = this.scale; // The latest child has been added on this scale
}
- return true;
+
+ // recalculate the size of the node on the next time the node is rendered
+ parentNode.clearSizeCache();
+
+ // set the pop-out scale for the childnode
+ parentNode.containedNodes[childNode.id].formationScale = parentNode.formationScale;
+
+ // nullify the movement velocity of the child, this is to avoid hectic behaviour
+ childNode.clearVelocity();
+
+ // the mass has altered, preservation of energy dictates the velocity to be updated
+ parentNode.updateVelocity(massBefore);
+
+ // restart the simulation to reorganise all nodes
+ this.moving = true;
};
/**
- * check if one of the selected nodes is a cluster.
- *
- * @returns {boolean}
+ * This function will apply the changes made to the remainingEdges during the formation of the clusters.
+ * This is a seperate function to allow for level-wise collapsing of the node barnesHutTree.
+ * It has to be called if a level is collapsed. It is called by _formClusters().
* @private
*/
- exports._clusterInSelection = function() {
- for(var nodeId in this.selectionObj.nodes) {
- if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
- return true;
+ exports._updateDynamicEdges = function() {
+ for (var i = 0; i < this.nodeIndices.length; i++) {
+ var node = this.nodes[this.nodeIndices[i]];
+ node.dynamicEdgesLength = node.dynamicEdges.length;
+
+ // this corrects for multiple edges pointing at the same other node
+ var correction = 0;
+ if (node.dynamicEdgesLength > 1) {
+ for (var j = 0; j < node.dynamicEdgesLength - 1; j++) {
+ var edgeToId = node.dynamicEdges[j].toId;
+ var edgeFromId = node.dynamicEdges[j].fromId;
+ for (var k = j+1; k < node.dynamicEdgesLength; k++) {
+ if ((node.dynamicEdges[k].toId == edgeToId && node.dynamicEdges[k].fromId == edgeFromId) ||
+ (node.dynamicEdges[k].fromId == edgeToId && node.dynamicEdges[k].toId == edgeFromId)) {
+ correction += 1;
+ }
+ }
}
}
+ node.dynamicEdgesLength -= correction;
}
- return false;
};
- /**
- * select the edges connected to the node that is being selected
- *
- * @param {Node} node
- * @private
- */
- exports._selectConnectedEdges = function(node) {
- for (var i = 0; i < node.dynamicEdges.length; i++) {
- var edge = node.dynamicEdges[i];
- edge.select();
- this._addToSelection(edge);
- }
- };
/**
- * select the edges connected to the node that is being selected
+ * This adds an edge from the childNode to the contained edges of the parent node
*
- * @param {Node} node
+ * @param parentNode | Node object
+ * @param childNode | Node object
+ * @param edge | Edge object
* @private
*/
- exports._hoverConnectedEdges = function(node) {
- for (var i = 0; i < node.dynamicEdges.length; i++) {
- var edge = node.dynamicEdges[i];
- edge.hover = true;
- this._addToHover(edge);
+ exports._addToContainedEdges = function(parentNode, childNode, edge) {
+ // create an array object if it does not yet exist for this childNode
+ if (!(parentNode.containedEdges.hasOwnProperty(childNode.id))) {
+ parentNode.containedEdges[childNode.id] = []
}
- };
+ // add this edge to the list
+ parentNode.containedEdges[childNode.id].push(edge);
+ // remove the edge from the global edges object
+ delete this.edges[edge.id];
- /**
- * unselect the edges connected to the node that is being selected
- *
- * @param {Node} node
- * @private
- */
- exports._unselectConnectedEdges = function(node) {
- for (var i = 0; i < node.dynamicEdges.length; i++) {
- var edge = node.dynamicEdges[i];
- edge.unselect();
- this._removeFromSelection(edge);
+ // remove the edge from the parent object
+ for (var i = 0; i < parentNode.dynamicEdges.length; i++) {
+ if (parentNode.dynamicEdges[i].id == edge.id) {
+ parentNode.dynamicEdges.splice(i,1);
+ break;
+ }
}
};
-
-
-
/**
- * This is called when someone clicks on a node. either select or deselect it.
- * If there is an existing selection and we don't want to append to it, clear the existing selection
+ * This function connects an edge that was connected to a child node to the parent node.
+ * It keeps track of which nodes it has been connected to with the originalId array.
*
- * @param {Node || Edge} object
- * @param {Boolean} append
- * @param {Boolean} [doNotTrigger] | ignore trigger
+ * @param {Node} parentNode | Node object
+ * @param {Node} childNode | Node object
+ * @param {Edge} edge | Edge object
* @private
*/
- exports._selectObject = function(object, append, doNotTrigger, highlightEdges) {
- if (doNotTrigger === undefined) {
- doNotTrigger = false;
- }
- if (highlightEdges === undefined) {
- highlightEdges = true;
- }
-
- if (this._selectionIsEmpty() == false && append == false && this.forceAppendSelection == false) {
- this._unselectAll(true);
+ exports._connectEdgeToCluster = function(parentNode, childNode, edge) {
+ // handle circular edges
+ if (edge.toId == edge.fromId) {
+ this._addToContainedEdges(parentNode, childNode, edge);
}
+ else {
+ if (edge.toId == childNode.id) { // edge connected to other node on the "to" side
+ edge.originalToId.push(childNode.id);
+ edge.to = parentNode;
+ edge.toId = parentNode.id;
+ }
+ else { // edge connected to other node with the "from" side
- if (object.selected == false) {
- object.select();
- this._addToSelection(object);
- if (object instanceof Node && this.blockConnectingEdgeSelection == false && highlightEdges == true) {
- this._selectConnectedEdges(object);
+ edge.originalFromId.push(childNode.id);
+ edge.from = parentNode;
+ edge.fromId = parentNode.id;
}
- }
- else {
- object.unselect();
- this._removeFromSelection(object);
- }
- if (doNotTrigger == false) {
- this.emit('select', this.getSelection());
+ this._addToReroutedEdges(parentNode,childNode,edge);
}
};
/**
- * This is called when someone clicks on a node. either select or deselect it.
- * If there is an existing selection and we don't want to append to it, clear the existing selection
+ * If a node is connected to itself, a circular edge is drawn. When clustering we want to contain
+ * these edges inside of the cluster.
*
- * @param {Node || Edge} object
+ * @param parentNode
+ * @param childNode
* @private
*/
- exports._blurObject = function(object) {
- if (object.hover == true) {
- object.hover = false;
- this.emit("blurNode",{node:object.id});
+ exports._containCircularEdgesFromNode = function(parentNode, childNode) {
+ // manage all the edges connected to the child and parent nodes
+ for (var i = 0; i < parentNode.dynamicEdges.length; i++) {
+ var edge = parentNode.dynamicEdges[i];
+ // handle circular edges
+ if (edge.toId == edge.fromId) {
+ this._addToContainedEdges(parentNode, childNode, edge);
+ }
}
};
+
/**
- * This is called when someone clicks on a node. either select or deselect it.
- * If there is an existing selection and we don't want to append to it, clear the existing selection
+ * This adds an edge from the childNode to the rerouted edges of the parent node
*
- * @param {Node || Edge} object
+ * @param parentNode | Node object
+ * @param childNode | Node object
+ * @param edge | Edge object
* @private
*/
- exports._hoverObject = function(object) {
- if (object.hover == false) {
- object.hover = true;
- this._addToHover(object);
- if (object instanceof Node) {
- this.emit("hoverNode",{node:object.id});
- }
- }
- if (object instanceof Node) {
- this._hoverConnectedEdges(object);
+ exports._addToReroutedEdges = function(parentNode, childNode, edge) {
+ // create an array object if it does not yet exist for this childNode
+ // we store the edge in the rerouted edges so we can restore it when the cluster pops open
+ if (!(parentNode.reroutedEdges.hasOwnProperty(childNode.id))) {
+ parentNode.reroutedEdges[childNode.id] = [];
}
- };
+ parentNode.reroutedEdges[childNode.id].push(edge);
+
+ // this edge becomes part of the dynamicEdges of the cluster node
+ parentNode.dynamicEdges.push(edge);
+ };
+
/**
- * handles the selection part of the touch, only for navigation controls elements;
- * Touch is triggered before tap, also before hold. Hold triggers after a while.
- * This is the most responsive solution
+ * This function connects an edge that was connected to a cluster node back to the child node.
*
- * @param {Object} pointer
+ * @param parentNode | Node object
+ * @param childNode | Node object
* @private
*/
- exports._handleTouch = function(pointer) {
+ exports._connectEdgeBackToChild = function(parentNode, childNode) {
+ if (parentNode.reroutedEdges.hasOwnProperty(childNode.id)) {
+ for (var i = 0; i < parentNode.reroutedEdges[childNode.id].length; i++) {
+ var edge = parentNode.reroutedEdges[childNode.id][i];
+ if (edge.originalFromId[edge.originalFromId.length-1] == childNode.id) {
+ edge.originalFromId.pop();
+ edge.fromId = childNode.id;
+ edge.from = childNode;
+ }
+ else {
+ edge.originalToId.pop();
+ edge.toId = childNode.id;
+ edge.to = childNode;
+ }
+
+ // append this edge to the list of edges connecting to the childnode
+ childNode.dynamicEdges.push(edge);
+
+ // remove the edge from the parent object
+ for (var j = 0; j < parentNode.dynamicEdges.length; j++) {
+ if (parentNode.dynamicEdges[j].id == edge.id) {
+ parentNode.dynamicEdges.splice(j,1);
+ break;
+ }
+ }
+ }
+ // remove the entry from the rerouted edges
+ delete parentNode.reroutedEdges[childNode.id];
+ }
};
/**
- * handles the selection part of the tap;
+ * When loops are clustered, an edge can be both in the rerouted array and the contained array.
+ * This function is called last to verify that all edges in dynamicEdges are in fact connected to the
+ * parentNode
*
- * @param {Object} pointer
+ * @param parentNode | Node object
* @private
*/
- exports._handleTap = function(pointer) {
- var node = this._getNodeAt(pointer);
- if (node != null) {
- this._selectObject(node,false);
- }
- else {
- var edge = this._getEdgeAt(pointer);
- if (edge != null) {
- this._selectObject(edge,false);
- }
- else {
- this._unselectAll();
+ exports._validateEdges = function(parentNode) {
+ for (var i = 0; i < parentNode.dynamicEdges.length; i++) {
+ var edge = parentNode.dynamicEdges[i];
+ if (parentNode.id != edge.toId && parentNode.id != edge.fromId) {
+ parentNode.dynamicEdges.splice(i,1);
}
}
- this.emit("click", this.getSelection());
- this._redraw();
};
/**
- * handles the selection part of the double tap and opens a cluster if needed
+ * This function released the contained edges back into the global domain and puts them back into the
+ * dynamic edges of both parent and child.
*
- * @param {Object} pointer
+ * @param {Node} parentNode |
+ * @param {Node} childNode |
* @private
*/
- exports._handleDoubleTap = function(pointer) {
- var node = this._getNodeAt(pointer);
- if (node != null && node !== undefined) {
- // we reset the areaCenter here so the opening of the node will occur
- this.areaCenter = {"x" : this._XconvertDOMtoCanvas(pointer.x),
- "y" : this._YconvertDOMtoCanvas(pointer.y)};
- this.openCluster(node);
+ exports._releaseContainedEdges = function(parentNode, childNode) {
+ for (var i = 0; i < parentNode.containedEdges[childNode.id].length; i++) {
+ var edge = parentNode.containedEdges[childNode.id][i];
+
+ // put the edge back in the global edges object
+ this.edges[edge.id] = edge;
+
+ // put the edge back in the dynamic edges of the child and parent
+ childNode.dynamicEdges.push(edge);
+ parentNode.dynamicEdges.push(edge);
}
- this.emit("doubleClick", this.getSelection());
+ // remove the entry from the contained edges
+ delete parentNode.containedEdges[childNode.id];
+
};
+
+
+ // ------------------- UTILITY FUNCTIONS ---------------------------- //
+
+
/**
- * Handle the onHold selection part
- *
- * @param pointer
- * @private
+ * This updates the node labels for all nodes (for debugging purposes)
*/
- exports._handleOnHold = function(pointer) {
- var node = this._getNodeAt(pointer);
- if (node != null) {
- this._selectObject(node,true);
+ exports.updateLabels = function() {
+ var nodeId;
+ // update node labels
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ var node = this.nodes[nodeId];
+ if (node.clusterSize > 1) {
+ node.label = "[".concat(String(node.clusterSize),"]");
+ }
+ }
}
- else {
- var edge = this._getEdgeAt(pointer);
- if (edge != null) {
- this._selectObject(edge,true);
+
+ // update node labels
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ node = this.nodes[nodeId];
+ if (node.clusterSize == 1) {
+ if (node.originalLabel !== undefined) {
+ node.label = node.originalLabel;
+ }
+ else {
+ node.label = String(node.id);
+ }
+ }
}
}
- this._redraw();
+
+ // /* Debug Override */
+ // for (nodeId in this.nodes) {
+ // if (this.nodes.hasOwnProperty(nodeId)) {
+ // node = this.nodes[nodeId];
+ // node.label = String(node.level);
+ // }
+ // }
+
};
/**
- * handle the onRelease event. These functions are here for the navigation controls module.
- *
- * @private
+ * We want to keep the cluster level distribution rather small. This means we do not want unclustered nodes
+ * if the rest of the nodes are already a few cluster levels in.
+ * To fix this we use this function. It determines the min and max cluster level and sends nodes that have not
+ * clustered enough to the clusterToSmallestNeighbours function.
*/
- exports._handleOnRelease = function(pointer) {
+ exports.normalizeClusterLevels = function() {
+ var maxLevel = 0;
+ var minLevel = 1e9;
+ var clusterLevel = 0;
+ var nodeId;
+
+ // we loop over all nodes in the list
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ clusterLevel = this.nodes[nodeId].clusterSessions.length;
+ if (maxLevel < clusterLevel) {maxLevel = clusterLevel;}
+ if (minLevel > clusterLevel) {minLevel = clusterLevel;}
+ }
+ }
+ if (maxLevel - minLevel > this.constants.clustering.clusterLevelDifference) {
+ var amountOfNodes = this.nodeIndices.length;
+ var targetLevel = maxLevel - this.constants.clustering.clusterLevelDifference;
+ // we loop over all nodes in the list
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ if (this.nodes[nodeId].clusterSessions.length < targetLevel) {
+ this._clusterToSmallestNeighbour(this.nodes[nodeId]);
+ }
+ }
+ }
+ this._updateNodeIndexList();
+ this._updateDynamicEdges();
+ // if a cluster was formed, we increase the clusterSession
+ if (this.nodeIndices.length != amountOfNodes) {
+ this.clusterSession += 1;
+ }
+ }
};
/**
+ * This function determines if the cluster we want to decluster is in the active area
+ * this means around the zoom center
*
- * retrieve the currently selected objects
- * @return {{nodes: Array., edges: Array.}} selection
+ * @param {Node} node
+ * @returns {boolean}
+ * @private
*/
- exports.getSelection = function() {
- var nodeIds = this.getSelectedNodes();
- var edgeIds = this.getSelectedEdges();
- return {nodes:nodeIds, edges:edgeIds};
+ exports._nodeInActiveArea = function(node) {
+ return (
+ Math.abs(node.x - this.areaCenter.x) <= this.constants.clustering.activeAreaBoxSize/this.scale
+ &&
+ Math.abs(node.y - this.areaCenter.y) <= this.constants.clustering.activeAreaBoxSize/this.scale
+ )
};
- /**
- *
- * retrieve the currently selected nodes
- * @return {String[]} selection An array with the ids of the
- * selected nodes.
- */
- exports.getSelectedNodes = function() {
- var idArray = [];
- for(var nodeId in this.selectionObj.nodes) {
- if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- idArray.push(nodeId);
- }
- }
- return idArray
- };
/**
+ * This is an adaptation of the original repositioning function. This is called if the system is clustered initially
+ * It puts large clusters away from the center and randomizes the order.
*
- * retrieve the currently selected edges
- * @return {Array} selection An array with the ids of the
- * selected nodes.
*/
- exports.getSelectedEdges = function() {
- var idArray = [];
- for(var edgeId in this.selectionObj.edges) {
- if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
- idArray.push(edgeId);
+ exports.repositionNodes = function() {
+ for (var i = 0; i < this.nodeIndices.length; i++) {
+ var node = this.nodes[this.nodeIndices[i]];
+ if ((node.xFixed == false || node.yFixed == false)) {
+ var radius = 10 * 0.1*this.nodeIndices.length * Math.min(100,node.mass);
+ var angle = 2 * Math.PI * Math.random();
+ if (node.xFixed == false) {node.x = radius * Math.cos(angle);}
+ if (node.yFixed == false) {node.y = radius * Math.sin(angle);}
+ this._repositionBezierNodes(node);
}
}
- return idArray;
};
/**
- * select zero or more nodes
- * @param {Number[] | String[]} selection An array with the ids of the
- * selected nodes.
+ * We determine how many connections denote an important hub.
+ * We take the mean + 2*std as the important hub size. (Assuming a normal distribution of data, ~2.2%)
+ *
+ * @private
*/
- exports.setSelection = function(selection) {
- var i, iMax, id;
-
- if (!selection || (selection.length == undefined))
- throw 'Selection must be an array with ids';
-
- // first unselect any selected node
- this._unselectAll(true);
+ exports._getHubSize = function() {
+ var average = 0;
+ var averageSquared = 0;
+ var hubCounter = 0;
+ var largestHub = 0;
- for (i = 0, iMax = selection.length; i < iMax; i++) {
- id = selection[i];
+ for (var i = 0; i < this.nodeIndices.length; i++) {
- var node = this.nodes[id];
- if (!node) {
- throw new RangeError('Node with id "' + id + '" not found');
+ var node = this.nodes[this.nodeIndices[i]];
+ if (node.dynamicEdgesLength > largestHub) {
+ largestHub = node.dynamicEdgesLength;
}
- this._selectObject(node,true,true);
+ average += node.dynamicEdgesLength;
+ averageSquared += Math.pow(node.dynamicEdgesLength,2);
+ hubCounter += 1;
}
+ average = average / hubCounter;
+ averageSquared = averageSquared / hubCounter;
- console.log("setSelection is deprecated. Please use selectNodes instead.")
-
- this.redraw();
- };
-
-
- /**
- * select zero or more nodes with the option to highlight edges
- * @param {Number[] | String[]} selection An array with the ids of the
- * selected nodes.
- * @param {boolean} [highlightEdges]
- */
- exports.selectNodes = function(selection, highlightEdges) {
- var i, iMax, id;
-
- if (!selection || (selection.length == undefined))
- throw 'Selection must be an array with ids';
+ var variance = averageSquared - Math.pow(average,2);
- // first unselect any selected node
- this._unselectAll(true);
+ var standardDeviation = Math.sqrt(variance);
- for (i = 0, iMax = selection.length; i < iMax; i++) {
- id = selection[i];
+ this.hubThreshold = Math.floor(average + 2*standardDeviation);
- var node = this.nodes[id];
- if (!node) {
- throw new RangeError('Node with id "' + id + '" not found');
- }
- this._selectObject(node,true,true,highlightEdges);
+ // always have at least one to cluster
+ if (this.hubThreshold > largestHub) {
+ this.hubThreshold = largestHub;
}
- this.redraw();
+
+ // console.log("average",average,"averageSQ",averageSquared,"var",variance,"std",standardDeviation);
+ // console.log("hubThreshold:",this.hubThreshold);
};
/**
- * select zero or more edges
- * @param {Number[] | String[]} selection An array with the ids of the
- * selected nodes.
+ * We reduce the amount of "extension nodes" or chains. These are not quickly clustered with the outliers and hubs methods
+ * with this amount we can cluster specifically on these chains.
+ *
+ * @param {Number} fraction | between 0 and 1, the percentage of chains to reduce
+ * @private
*/
- exports.selectEdges = function(selection) {
- var i, iMax, id;
-
- if (!selection || (selection.length == undefined))
- throw 'Selection must be an array with ids';
-
- // first unselect any selected node
- this._unselectAll(true);
-
- for (i = 0, iMax = selection.length; i < iMax; i++) {
- id = selection[i];
-
- var edge = this.edges[id];
- if (!edge) {
- throw new RangeError('Edge with id "' + id + '" not found');
+ exports._reduceAmountOfChains = function(fraction) {
+ this.hubThreshold = 2;
+ var reduceAmount = Math.floor(this.nodeIndices.length * fraction);
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ if (this.nodes[nodeId].dynamicEdgesLength == 2 && this.nodes[nodeId].dynamicEdges.length >= 2) {
+ if (reduceAmount > 0) {
+ this._formClusterFromHub(this.nodes[nodeId],true,true,1);
+ reduceAmount -= 1;
+ }
+ }
}
- this._selectObject(edge,true,true,highlightEdges);
}
- this.redraw();
};
/**
- * Validate the selection: remove ids of nodes which no longer exist
+ * We get the amount of "extension nodes" or chains. These are not quickly clustered with the outliers and hubs methods
+ * with this amount we can cluster specifically on these chains.
+ *
* @private
*/
- exports._updateSelection = function () {
- for(var nodeId in this.selectionObj.nodes) {
- if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
- if (!this.nodes.hasOwnProperty(nodeId)) {
- delete this.selectionObj.nodes[nodeId];
- }
- }
- }
- for(var edgeId in this.selectionObj.edges) {
- if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
- if (!this.edges.hasOwnProperty(edgeId)) {
- delete this.selectionObj.edges[edgeId];
+ exports._getChainFraction = function() {
+ var chains = 0;
+ var total = 0;
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ if (this.nodes[nodeId].dynamicEdgesLength == 2 && this.nodes[nodeId].dynamicEdges.length >= 2) {
+ chains += 1;
}
+ total += 1;
}
}
+ return chains/total;
};
/***/ },
-/* 45 */
+/* 44 */
/***/ function(module, exports, __webpack_require__) {
var util = __webpack_require__(1);
- var Node = __webpack_require__(30);
- var Edge = __webpack_require__(27);
/**
- * clears the toolbar div element of children
+ * Creation of the SectorMixin var.
*
- * @private
+ * This contains all the functions the Network object can use to employ the sector system.
+ * The sector system is always used by Network, though the benefits only apply to the use of clustering.
+ * If clustering is not used, there is no overhead except for a duplicate object with references to nodes and edges.
*/
- exports._clearManipulatorBar = function() {
- while (this.manipulationDiv.hasChildNodes()) {
- this.manipulationDiv.removeChild(this.manipulationDiv.firstChild);
- }
- };
/**
- * Manipulation UI temporarily overloads certain functions to extend or replace them. To be able to restore
- * these functions to their original functionality, we saved them in this.cachedFunctions.
- * This function restores these functions to their original function.
+ * This function is only called by the setData function of the Network object.
+ * This loads the global references into the active sector. This initializes the sector.
*
* @private
*/
- exports._restoreOverloadedFunctions = function() {
- for (var functionName in this.cachedFunctions) {
- if (this.cachedFunctions.hasOwnProperty(functionName)) {
- this[functionName] = this.cachedFunctions[functionName];
- }
- }
+ exports._putDataInSector = function() {
+ this.sectors["active"][this._sector()].nodes = this.nodes;
+ this.sectors["active"][this._sector()].edges = this.edges;
+ this.sectors["active"][this._sector()].nodeIndices = this.nodeIndices;
};
+
/**
- * Enable or disable edit-mode.
+ * /**
+ * This function sets the global references to nodes, edges and nodeIndices back to
+ * those of the supplied (active) sector. If a type is defined, do the specific type
*
+ * @param {String} sectorId
+ * @param {String} [sectorType] | "active" or "frozen"
* @private
*/
- exports._toggleEditMode = function() {
- this.editMode = !this.editMode;
- var toolbar = document.getElementById("network-manipulationDiv");
- var closeDiv = document.getElementById("network-manipulation-closeDiv");
- var editModeDiv = document.getElementById("network-manipulation-editMode");
- if (this.editMode == true) {
- toolbar.style.display="block";
- closeDiv.style.display="block";
- editModeDiv.style.display="none";
- closeDiv.onclick = this._toggleEditMode.bind(this);
+ exports._switchToSector = function(sectorId, sectorType) {
+ if (sectorType === undefined || sectorType == "active") {
+ this._switchToActiveSector(sectorId);
}
else {
- toolbar.style.display="none";
- closeDiv.style.display="none";
- editModeDiv.style.display="block";
- closeDiv.onclick = null;
+ this._switchToFrozenSector(sectorId);
}
- this._createManipulatorBar()
};
+
/**
- * main function, creates the main toolbar. Removes functions bound to the select event. Binds all the buttons of the toolbar.
+ * This function sets the global references to nodes, edges and nodeIndices back to
+ * those of the supplied active sector.
*
+ * @param sectorId
* @private
*/
- exports._createManipulatorBar = function() {
- // remove bound functions
- if (this.boundFunction) {
- this.off('select', this.boundFunction);
- }
+ exports._switchToActiveSector = function(sectorId) {
+ this.nodeIndices = this.sectors["active"][sectorId]["nodeIndices"];
+ this.nodes = this.sectors["active"][sectorId]["nodes"];
+ this.edges = this.sectors["active"][sectorId]["edges"];
+ };
- if (this.edgeBeingEdited !== undefined) {
- this.edgeBeingEdited._disableControlNodes();
- this.edgeBeingEdited = undefined;
- this.selectedControlNode = null;
- this.controlNodesActive = false;
- }
- // restore overloaded functions
- this._restoreOverloadedFunctions();
+ /**
+ * This function sets the global references to nodes, edges and nodeIndices back to
+ * those of the supplied active sector.
+ *
+ * @private
+ */
+ exports._switchToSupportSector = function() {
+ this.nodeIndices = this.sectors["support"]["nodeIndices"];
+ this.nodes = this.sectors["support"]["nodes"];
+ this.edges = this.sectors["support"]["edges"];
+ };
- // resume calculation
- this.freezeSimulation = false;
- // reset global variables
- this.blockConnectingEdgeSelection = false;
- this.forceAppendSelection = false;
+ /**
+ * This function sets the global references to nodes, edges and nodeIndices back to
+ * those of the supplied frozen sector.
+ *
+ * @param sectorId
+ * @private
+ */
+ exports._switchToFrozenSector = function(sectorId) {
+ this.nodeIndices = this.sectors["frozen"][sectorId]["nodeIndices"];
+ this.nodes = this.sectors["frozen"][sectorId]["nodes"];
+ this.edges = this.sectors["frozen"][sectorId]["edges"];
+ };
- if (this.editMode == true) {
- while (this.manipulationDiv.hasChildNodes()) {
- this.manipulationDiv.removeChild(this.manipulationDiv.firstChild);
- }
- // add the icons to the manipulator div
- this.manipulationDiv.innerHTML = "" +
- "" +
- ""+this.constants.labels['add'] +"" +
- "" +
- "" +
- ""+this.constants.labels['link'] +"";
- if (this._getSelectedNodeCount() == 1 && this.triggerFunctions.edit) {
- this.manipulationDiv.innerHTML += "" +
- "" +
- "" +
- ""+this.constants.labels['editNode'] +"";
- }
- else if (this._getSelectedEdgeCount() == 1 && this._getSelectedNodeCount() == 0) {
- this.manipulationDiv.innerHTML += "" +
- "" +
- "" +
- ""+this.constants.labels['editEdge'] +"";
- }
- if (this._selectionIsEmpty() == false) {
- this.manipulationDiv.innerHTML += "" +
- "" +
- "" +
- ""+this.constants.labels['del'] +"";
- }
+
+ /**
+ * This function sets the global references to nodes, edges and nodeIndices back to
+ * those of the currently active sector.
+ *
+ * @private
+ */
+ exports._loadLatestSector = function() {
+ this._switchToSector(this._sector());
+ };
- // bind the icons
- var addNodeButton = document.getElementById("network-manipulate-addNode");
- addNodeButton.onclick = this._createAddNodeToolbar.bind(this);
- var addEdgeButton = document.getElementById("network-manipulate-connectNode");
- addEdgeButton.onclick = this._createAddEdgeToolbar.bind(this);
- if (this._getSelectedNodeCount() == 1 && this.triggerFunctions.edit) {
- var editButton = document.getElementById("network-manipulate-editNode");
- editButton.onclick = this._editNode.bind(this);
- }
- else if (this._getSelectedEdgeCount() == 1 && this._getSelectedNodeCount() == 0) {
- var editButton = document.getElementById("network-manipulate-editEdge");
- editButton.onclick = this._createEditEdgeToolbar.bind(this);
- }
- if (this._selectionIsEmpty() == false) {
- var deleteButton = document.getElementById("network-manipulate-delete");
- deleteButton.onclick = this._deleteSelected.bind(this);
- }
- var closeDiv = document.getElementById("network-manipulation-closeDiv");
- closeDiv.onclick = this._toggleEditMode.bind(this);
+ /**
+ * This function returns the currently active sector Id
+ *
+ * @returns {String}
+ * @private
+ */
+ exports._sector = function() {
+ return this.activeSector[this.activeSector.length-1];
+ };
- this.boundFunction = this._createManipulatorBar.bind(this);
- this.on('select', this.boundFunction);
+
+ /**
+ * This function returns the previously active sector Id
+ *
+ * @returns {String}
+ * @private
+ */
+ exports._previousSector = function() {
+ if (this.activeSector.length > 1) {
+ return this.activeSector[this.activeSector.length-2];
}
else {
- this.editModeDiv.innerHTML = "" +
- "" +
- "" + this.constants.labels['edit'] + "";
- var editModeButton = document.getElementById("network-manipulate-editModeButton");
- editModeButton.onclick = this._toggleEditMode.bind(this);
+ throw new TypeError('there are not enough sectors in the this.activeSector array.');
}
};
-
/**
- * Create the toolbar for adding Nodes
+ * We add the active sector at the end of the this.activeSector array
+ * This ensures it is the currently active sector returned by _sector() and it reaches the top
+ * of the activeSector stack. When we reverse our steps we move from the end to the beginning of this stack.
*
+ * @param newId
* @private
*/
- exports._createAddNodeToolbar = function() {
- // clear the toolbar
- this._clearManipulatorBar();
- if (this.boundFunction) {
- this.off('select', this.boundFunction);
- }
-
- // create the toolbar contents
- this.manipulationDiv.innerHTML = "" +
- "" +
- "" + this.constants.labels['back'] + " " +
- "" +
- "" +
- "" + this.constants.labels['addDescription'] + "";
+ exports._setActiveSector = function(newId) {
+ this.activeSector.push(newId);
+ };
- // bind the icon
- var backButton = document.getElementById("network-manipulate-back");
- backButton.onclick = this._createManipulatorBar.bind(this);
- // we use the boundFunction so we can reference it when we unbind it from the "select" event.
- this.boundFunction = this._addNode.bind(this);
- this.on('select', this.boundFunction);
+ /**
+ * We remove the currently active sector id from the active sector stack. This happens when
+ * we reactivate the previously active sector
+ *
+ * @private
+ */
+ exports._forgetLastSector = function() {
+ this.activeSector.pop();
};
/**
- * create the toolbar to connect nodes
+ * This function creates a new active sector with the supplied newId. This newId
+ * is the expanding node id.
*
+ * @param {String} newId | Id of the new active sector
* @private
*/
- exports._createAddEdgeToolbar = function() {
- // clear the toolbar
- this._clearManipulatorBar();
- this._unselectAll(true);
- this.freezeSimulation = true;
+ exports._createNewSector = function(newId) {
+ // create the new sector
+ this.sectors["active"][newId] = {"nodes":{},
+ "edges":{},
+ "nodeIndices":[],
+ "formationScale": this.scale,
+ "drawingNode": undefined};
- if (this.boundFunction) {
- this.off('select', this.boundFunction);
- }
+ // create the new sector render node. This gives visual feedback that you are in a new sector.
+ this.sectors["active"][newId]['drawingNode'] = new Node(
+ {id:newId,
+ color: {
+ background: "#eaefef",
+ border: "495c5e"
+ }
+ },{},{},this.constants);
+ this.sectors["active"][newId]['drawingNode'].clusterSize = 2;
+ };
- this._unselectAll();
- this.forceAppendSelection = false;
- this.blockConnectingEdgeSelection = true;
- this.manipulationDiv.innerHTML = "" +
- "" +
- "" + this.constants.labels['back'] + " " +
- "" +
- "" +
- "" + this.constants.labels['linkDescription'] + "";
+ /**
+ * This function removes the currently active sector. This is called when we create a new
+ * active sector.
+ *
+ * @param {String} sectorId | Id of the active sector that will be removed
+ * @private
+ */
+ exports._deleteActiveSector = function(sectorId) {
+ delete this.sectors["active"][sectorId];
+ };
- // bind the icon
- var backButton = document.getElementById("network-manipulate-back");
- backButton.onclick = this._createManipulatorBar.bind(this);
- // we use the boundFunction so we can reference it when we unbind it from the "select" event.
- this.boundFunction = this._handleConnect.bind(this);
- this.on('select', this.boundFunction);
+ /**
+ * This function removes the currently active sector. This is called when we reactivate
+ * the previously active sector.
+ *
+ * @param {String} sectorId | Id of the active sector that will be removed
+ * @private
+ */
+ exports._deleteFrozenSector = function(sectorId) {
+ delete this.sectors["frozen"][sectorId];
+ };
- // temporarily overload functions
- this.cachedFunctions["_handleTouch"] = this._handleTouch;
- this.cachedFunctions["_handleOnRelease"] = this._handleOnRelease;
- this._handleTouch = this._handleConnect;
- this._handleOnRelease = this._finishConnect;
- // redraw to show the unselect
- this._redraw();
+ /**
+ * Freezing an active sector means moving it from the "active" object to the "frozen" object.
+ * We copy the references, then delete the active entree.
+ *
+ * @param sectorId
+ * @private
+ */
+ exports._freezeSector = function(sectorId) {
+ // we move the set references from the active to the frozen stack.
+ this.sectors["frozen"][sectorId] = this.sectors["active"][sectorId];
+
+ // we have moved the sector data into the frozen set, we now remove it from the active set
+ this._deleteActiveSector(sectorId);
};
+
/**
- * create the toolbar to edit edges
+ * This is the reverse operation of _freezeSector. Activating means moving the sector from the "frozen"
+ * object to the "active" object.
*
+ * @param sectorId
* @private
*/
- exports._createEditEdgeToolbar = function() {
- // clear the toolbar
- this._clearManipulatorBar();
- this.controlNodesActive = true;
-
- if (this.boundFunction) {
- this.off('select', this.boundFunction);
- }
+ exports._activateSector = function(sectorId) {
+ // we move the set references from the frozen to the active stack.
+ this.sectors["active"][sectorId] = this.sectors["frozen"][sectorId];
- this.edgeBeingEdited = this._getSelectedEdge();
- this.edgeBeingEdited._enableControlNodes();
+ // we have moved the sector data into the active set, we now remove it from the frozen stack
+ this._deleteFrozenSector(sectorId);
+ };
- this.manipulationDiv.innerHTML = "" +
- "" +
- "" + this.constants.labels['back'] + " " +
- "" +
- "" +
- "" + this.constants.labels['editEdgeDescription'] + "";
- // bind the icon
- var backButton = document.getElementById("network-manipulate-back");
- backButton.onclick = this._createManipulatorBar.bind(this);
+ /**
+ * This function merges the data from the currently active sector with a frozen sector. This is used
+ * in the process of reverting back to the previously active sector.
+ * The data that is placed in the frozen (the previously active) sector is the node that has been removed from it
+ * upon the creation of a new active sector.
+ *
+ * @param sectorId
+ * @private
+ */
+ exports._mergeThisWithFrozen = function(sectorId) {
+ // copy all nodes
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ this.sectors["frozen"][sectorId]["nodes"][nodeId] = this.nodes[nodeId];
+ }
+ }
- // temporarily overload functions
- this.cachedFunctions["_handleTouch"] = this._handleTouch;
- this.cachedFunctions["_handleOnRelease"] = this._handleOnRelease;
- this.cachedFunctions["_handleTap"] = this._handleTap;
- this.cachedFunctions["_handleDragStart"] = this._handleDragStart;
- this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag;
- this._handleTouch = this._selectControlNode;
- this._handleTap = function () {};
- this._handleOnDrag = this._controlNodeDrag;
- this._handleDragStart = function () {}
- this._handleOnRelease = this._releaseControlNode;
+ // copy all edges (if not fully clustered, else there are no edges)
+ for (var edgeId in this.edges) {
+ if (this.edges.hasOwnProperty(edgeId)) {
+ this.sectors["frozen"][sectorId]["edges"][edgeId] = this.edges[edgeId];
+ }
+ }
- // redraw to show the unselect
- this._redraw();
+ // merge the nodeIndices
+ for (var i = 0; i < this.nodeIndices.length; i++) {
+ this.sectors["frozen"][sectorId]["nodeIndices"].push(this.nodeIndices[i]);
+ }
};
-
+ /**
+ * This clusters the sector to one cluster. It was a single cluster before this process started so
+ * we revert to that state. The clusterToFit function with a maximum size of 1 node does this.
+ *
+ * @private
+ */
+ exports._collapseThisToSingleCluster = function() {
+ this.clusterToFit(1,false);
+ };
/**
- * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
- * to walk the user through the process.
+ * We create a new active sector from the node that we want to open.
*
+ * @param node
* @private
*/
- exports._selectControlNode = function(pointer) {
- this.edgeBeingEdited.controlNodes.from.unselect();
- this.edgeBeingEdited.controlNodes.to.unselect();
- this.selectedControlNode = this.edgeBeingEdited._getSelectedControlNode(this._XconvertDOMtoCanvas(pointer.x),this._YconvertDOMtoCanvas(pointer.y));
- if (this.selectedControlNode !== null) {
- this.selectedControlNode.select();
- this.freezeSimulation = true;
- }
- this._redraw();
- };
+ exports._addSector = function(node) {
+ // this is the currently active sector
+ var sector = this._sector();
+
+ // // this should allow me to select nodes from a frozen set.
+ // if (this.sectors['active'][sector]["nodes"].hasOwnProperty(node.id)) {
+ // console.log("the node is part of the active sector");
+ // }
+ // else {
+ // console.log("I dont know what the fuck happened!!");
+ // }
+
+ // when we switch to a new sector, we remove the node that will be expanded from the current nodes list.
+ delete this.nodes[node.id];
+
+ var unqiueIdentifier = util.randomUUID();
+
+ // we fully freeze the currently active sector
+ this._freezeSector(sector);
+
+ // we create a new active sector. This sector has the Id of the node to ensure uniqueness
+ this._createNewSector(unqiueIdentifier);
+
+ // we add the active sector to the sectors array to be able to revert these steps later on
+ this._setActiveSector(unqiueIdentifier);
+
+ // we redirect the global references to the new sector's references. this._sector() now returns unqiueIdentifier
+ this._switchToSector(this._sector());
- /**
- * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
- * to walk the user through the process.
- *
- * @private
- */
- exports._controlNodeDrag = function(event) {
- var pointer = this._getPointer(event.gesture.center);
- if (this.selectedControlNode !== null && this.selectedControlNode !== undefined) {
- this.selectedControlNode.x = this._XconvertDOMtoCanvas(pointer.x);
- this.selectedControlNode.y = this._YconvertDOMtoCanvas(pointer.y);
- }
- this._redraw();
+ // finally we add the node we removed from our previous active sector to the new active sector
+ this.nodes[node.id] = node;
};
- exports._releaseControlNode = function(pointer) {
- var newNode = this._getNodeAt(pointer);
- if (newNode != null) {
- if (this.edgeBeingEdited.controlNodes.from.selected == true) {
- this._editEdge(newNode.id, this.edgeBeingEdited.to.id);
- this.edgeBeingEdited.controlNodes.from.unselect();
- }
- if (this.edgeBeingEdited.controlNodes.to.selected == true) {
- this._editEdge(this.edgeBeingEdited.from.id, newNode.id);
- this.edgeBeingEdited.controlNodes.to.unselect();
- }
- }
- else {
- this.edgeBeingEdited._restoreControlNodes();
- }
- this.freezeSimulation = false;
- this._redraw();
- };
/**
- * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
- * to walk the user through the process.
+ * We close the sector that is currently open and revert back to the one before.
+ * If the active sector is the "default" sector, nothing happens.
*
* @private
*/
- exports._handleConnect = function(pointer) {
- if (this._getSelectedNodeCount() == 0) {
- var node = this._getNodeAt(pointer);
- if (node != null) {
- if (node.clusterSize > 1) {
- alert("Cannot create edges to a cluster.")
- }
- else {
- this._selectObject(node,false);
- // create a node the temporary line can look at
- this.sectors['support']['nodes']['targetNode'] = new Node({id:'targetNode'},{},{},this.constants);
- this.sectors['support']['nodes']['targetNode'].x = node.x;
- this.sectors['support']['nodes']['targetNode'].y = node.y;
- this.sectors['support']['nodes']['targetViaNode'] = new Node({id:'targetViaNode'},{},{},this.constants);
- this.sectors['support']['nodes']['targetViaNode'].x = node.x;
- this.sectors['support']['nodes']['targetViaNode'].y = node.y;
- this.sectors['support']['nodes']['targetViaNode'].parentEdgeId = "connectionEdge";
+ exports._collapseSector = function() {
+ // the currently active sector
+ var sector = this._sector();
- // create a temporary edge
- this.edges['connectionEdge'] = new Edge({id:"connectionEdge",from:node.id,to:this.sectors['support']['nodes']['targetNode'].id}, this, this.constants);
- this.edges['connectionEdge'].from = node;
- this.edges['connectionEdge'].connected = true;
- this.edges['connectionEdge'].smooth = true;
- this.edges['connectionEdge'].selected = true;
- this.edges['connectionEdge'].to = this.sectors['support']['nodes']['targetNode'];
- this.edges['connectionEdge'].via = this.sectors['support']['nodes']['targetViaNode'];
+ // we cannot collapse the default sector
+ if (sector != "default") {
+ if ((this.nodeIndices.length == 1) ||
+ (this.sectors["active"][sector]["drawingNode"].width*this.scale < this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientWidth) ||
+ (this.sectors["active"][sector]["drawingNode"].height*this.scale < this.constants.clustering.screenSizeThreshold * this.frame.canvas.clientHeight)) {
+ var previousSector = this._previousSector();
- this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag;
- this._handleOnDrag = function(event) {
- var pointer = this._getPointer(event.gesture.center);
- this.sectors['support']['nodes']['targetNode'].x = this._XconvertDOMtoCanvas(pointer.x);
- this.sectors['support']['nodes']['targetNode'].y = this._YconvertDOMtoCanvas(pointer.y);
- this.sectors['support']['nodes']['targetViaNode'].x = 0.5 * (this._XconvertDOMtoCanvas(pointer.x) + this.edges['connectionEdge'].from.x);
- this.sectors['support']['nodes']['targetViaNode'].y = this._YconvertDOMtoCanvas(pointer.y);
- };
+ // we collapse the sector back to a single cluster
+ this._collapseThisToSingleCluster();
- this.moving = true;
- this.start();
- }
- }
- }
- };
+ // we move the remaining nodes, edges and nodeIndices to the previous sector.
+ // This previous sector is the one we will reactivate
+ this._mergeThisWithFrozen(previousSector);
- exports._finishConnect = function(pointer) {
- if (this._getSelectedNodeCount() == 1) {
+ // the previously active (frozen) sector now has all the data from the currently active sector.
+ // we can now delete the active sector.
+ this._deleteActiveSector(sector);
- // restore the drag function
- this._handleOnDrag = this.cachedFunctions["_handleOnDrag"];
- delete this.cachedFunctions["_handleOnDrag"];
+ // we activate the previously active (and currently frozen) sector.
+ this._activateSector(previousSector);
- // remember the edge id
- var connectFromId = this.edges['connectionEdge'].fromId;
+ // we load the references from the newly active sector into the global references
+ this._switchToSector(previousSector);
- // remove the temporary nodes and edge
- delete this.edges['connectionEdge'];
- delete this.sectors['support']['nodes']['targetNode'];
- delete this.sectors['support']['nodes']['targetViaNode'];
+ // we forget the previously active sector because we reverted to the one before
+ this._forgetLastSector();
- var node = this._getNodeAt(pointer);
- if (node != null) {
- if (node.clusterSize > 1) {
- alert("Cannot create edges to a cluster.")
- }
- else {
- this._createEdge(connectFromId,node.id);
- this._createManipulatorBar();
- }
+ // finally, we update the node index list.
+ this._updateNodeIndexList();
+
+ // we refresh the list with calulation nodes and calculation node indices.
+ this._updateCalculationNodes();
}
- this._unselectAll();
}
};
/**
- * Adds a node on the specified location
+ * This runs a function in all active sectors. This is used in _redraw() and the _initializeForceCalculation().
+ *
+ * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
+ * | we dont pass the function itself because then the "this" is the window object
+ * | instead of the Network object
+ * @param {*} [argument] | Optional: arguments to pass to the runFunction
+ * @private
*/
- exports._addNode = function() {
- if (this._selectionIsEmpty() && this.editMode == true) {
- var positionObject = this._pointerToPositionObject(this.pointerPosition);
- var defaultData = {id:util.randomUUID(),x:positionObject.left,y:positionObject.top,label:"new",allowedToMoveX:true,allowedToMoveY:true};
- if (this.triggerFunctions.add) {
- if (this.triggerFunctions.add.length == 2) {
- var me = this;
- this.triggerFunctions.add(defaultData, function(finalizedData) {
- me.nodesData.add(finalizedData);
- me._createManipulatorBar();
- me.moving = true;
- me.start();
- });
- }
- else {
- alert(this.constants.labels['addError']);
- this._createManipulatorBar();
- this.moving = true;
- this.start();
+ exports._doInAllActiveSectors = function(runFunction,argument) {
+ if (argument === undefined) {
+ for (var sector in this.sectors["active"]) {
+ if (this.sectors["active"].hasOwnProperty(sector)) {
+ // switch the global references to those of this sector
+ this._switchToActiveSector(sector);
+ this[runFunction]();
}
}
- else {
- this.nodesData.add(defaultData);
- this._createManipulatorBar();
- this.moving = true;
- this.start();
+ }
+ else {
+ for (var sector in this.sectors["active"]) {
+ if (this.sectors["active"].hasOwnProperty(sector)) {
+ // switch the global references to those of this sector
+ this._switchToActiveSector(sector);
+ var args = Array.prototype.splice.call(arguments, 1);
+ if (args.length > 1) {
+ this[runFunction](args[0],args[1]);
+ }
+ else {
+ this[runFunction](argument);
+ }
+ }
}
}
+ // we revert the global references back to our active sector
+ this._loadLatestSector();
};
/**
- * connect two nodes with a new edge.
+ * This runs a function in all active sectors. This is used in _redraw() and the _initializeForceCalculation().
*
+ * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
+ * | we dont pass the function itself because then the "this" is the window object
+ * | instead of the Network object
+ * @param {*} [argument] | Optional: arguments to pass to the runFunction
* @private
*/
- exports._createEdge = function(sourceNodeId,targetNodeId) {
- if (this.editMode == true) {
- var defaultData = {from:sourceNodeId, to:targetNodeId};
- if (this.triggerFunctions.connect) {
- if (this.triggerFunctions.connect.length == 2) {
- var me = this;
- this.triggerFunctions.connect(defaultData, function(finalizedData) {
- me.edgesData.add(finalizedData);
- me.moving = true;
- me.start();
- });
- }
- else {
- alert(this.constants.labels["linkError"]);
- this.moving = true;
- this.start();
- }
+ exports._doInSupportSector = function(runFunction,argument) {
+ if (argument === undefined) {
+ this._switchToSupportSector();
+ this[runFunction]();
+ }
+ else {
+ this._switchToSupportSector();
+ var args = Array.prototype.splice.call(arguments, 1);
+ if (args.length > 1) {
+ this[runFunction](args[0],args[1]);
}
else {
- this.edgesData.add(defaultData);
- this.moving = true;
- this.start();
+ this[runFunction](argument);
}
}
+ // we revert the global references back to our active sector
+ this._loadLatestSector();
};
+
/**
- * connect two nodes with a new edge.
+ * This runs a function in all frozen sectors. This is used in the _redraw().
*
+ * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
+ * | we don't pass the function itself because then the "this" is the window object
+ * | instead of the Network object
+ * @param {*} [argument] | Optional: arguments to pass to the runFunction
* @private
*/
- exports._editEdge = function(sourceNodeId,targetNodeId) {
- if (this.editMode == true) {
- var defaultData = {id: this.edgeBeingEdited.id, from:sourceNodeId, to:targetNodeId};
- if (this.triggerFunctions.editEdge) {
- if (this.triggerFunctions.editEdge.length == 2) {
- var me = this;
- this.triggerFunctions.editEdge(defaultData, function(finalizedData) {
- me.edgesData.update(finalizedData);
- me.moving = true;
- me.start();
- });
+ exports._doInAllFrozenSectors = function(runFunction,argument) {
+ if (argument === undefined) {
+ for (var sector in this.sectors["frozen"]) {
+ if (this.sectors["frozen"].hasOwnProperty(sector)) {
+ // switch the global references to those of this sector
+ this._switchToFrozenSector(sector);
+ this[runFunction]();
}
- else {
- alert(this.constants.labels["linkError"]);
- this.moving = true;
- this.start();
+ }
+ }
+ else {
+ for (var sector in this.sectors["frozen"]) {
+ if (this.sectors["frozen"].hasOwnProperty(sector)) {
+ // switch the global references to those of this sector
+ this._switchToFrozenSector(sector);
+ var args = Array.prototype.splice.call(arguments, 1);
+ if (args.length > 1) {
+ this[runFunction](args[0],args[1]);
+ }
+ else {
+ this[runFunction](argument);
+ }
}
}
- else {
- this.edgesData.update(defaultData);
- this.moving = true;
- this.start();
- }
}
+ this._loadLatestSector();
};
+
/**
- * Create the toolbar to edit the selected node. The label and the color can be changed. Other colors are derived from the chosen color.
+ * This runs a function in all sectors. This is used in the _redraw().
*
+ * @param {String} runFunction | This is the NAME of a function we want to call in all active sectors
+ * | we don't pass the function itself because then the "this" is the window object
+ * | instead of the Network object
+ * @param {*} [argument] | Optional: arguments to pass to the runFunction
* @private
*/
- exports._editNode = function() {
- if (this.triggerFunctions.edit && this.editMode == true) {
- var node = this._getSelectedNode();
- var data = {id:node.id,
- label: node.label,
- group: node.group,
- shape: node.shape,
- color: {
- background:node.color.background,
- border:node.color.border,
- highlight: {
- background:node.color.highlight.background,
- border:node.color.highlight.border
- }
- }};
- if (this.triggerFunctions.edit.length == 2) {
- var me = this;
- this.triggerFunctions.edit(data, function (finalizedData) {
- me.nodesData.update(finalizedData);
- me._createManipulatorBar();
- me.moving = true;
- me.start();
- });
+ exports._doInAllSectors = function(runFunction,argument) {
+ var args = Array.prototype.splice.call(arguments, 1);
+ if (argument === undefined) {
+ this._doInAllActiveSectors(runFunction);
+ this._doInAllFrozenSectors(runFunction);
+ }
+ else {
+ if (args.length > 1) {
+ this._doInAllActiveSectors(runFunction,args[0],args[1]);
+ this._doInAllFrozenSectors(runFunction,args[0],args[1]);
}
else {
- alert(this.constants.labels["editError"]);
+ this._doInAllActiveSectors(runFunction,argument);
+ this._doInAllFrozenSectors(runFunction,argument);
}
}
- else {
- alert(this.constants.labels["editBoundError"]);
- }
};
+ /**
+ * This clears the nodeIndices list. We cannot use this.nodeIndices = [] because we would break the link with the
+ * active sector. Thus we clear the nodeIndices in the active sector, then reconnect the this.nodeIndices to it.
+ *
+ * @private
+ */
+ exports._clearNodeIndexList = function() {
+ var sector = this._sector();
+ this.sectors["active"][sector]["nodeIndices"] = [];
+ this.nodeIndices = this.sectors["active"][sector]["nodeIndices"];
+ };
/**
- * delete everything in the selection
+ * Draw the encompassing sector node
*
+ * @param ctx
+ * @param sectorType
* @private
*/
- exports._deleteSelected = function() {
- if (!this._selectionIsEmpty() && this.editMode == true) {
- if (!this._clusterInSelection()) {
- var selectedNodes = this.getSelectedNodes();
- var selectedEdges = this.getSelectedEdges();
- if (this.triggerFunctions.del) {
- var me = this;
- var data = {nodes: selectedNodes, edges: selectedEdges};
- if (this.triggerFunctions.del.length = 2) {
- this.triggerFunctions.del(data, function (finalizedData) {
- me.edgesData.remove(finalizedData.edges);
- me.nodesData.remove(finalizedData.nodes);
- me._unselectAll();
- me.moving = true;
- me.start();
- });
- }
- else {
- alert(this.constants.labels["deleteError"])
+ exports._drawSectorNodes = function(ctx,sectorType) {
+ var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node;
+ for (var sector in this.sectors[sectorType]) {
+ if (this.sectors[sectorType].hasOwnProperty(sector)) {
+ if (this.sectors[sectorType][sector]["drawingNode"] !== undefined) {
+
+ this._switchToSector(sector,sectorType);
+
+ minY = 1e9; maxY = -1e9; minX = 1e9; maxX = -1e9;
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ node = this.nodes[nodeId];
+ node.resize(ctx);
+ if (minX > node.x - 0.5 * node.width) {minX = node.x - 0.5 * node.width;}
+ if (maxX < node.x + 0.5 * node.width) {maxX = node.x + 0.5 * node.width;}
+ if (minY > node.y - 0.5 * node.height) {minY = node.y - 0.5 * node.height;}
+ if (maxY < node.y + 0.5 * node.height) {maxY = node.y + 0.5 * node.height;}
+ }
}
+ node = this.sectors[sectorType][sector]["drawingNode"];
+ node.x = 0.5 * (maxX + minX);
+ node.y = 0.5 * (maxY + minY);
+ node.width = 2 * (node.x - minX);
+ node.height = 2 * (node.y - minY);
+ node.radius = Math.sqrt(Math.pow(0.5*node.width,2) + Math.pow(0.5*node.height,2));
+ node.setScale(this.scale);
+ node._drawCircle(ctx);
}
- else {
- this.edgesData.remove(selectedEdges);
- this.nodesData.remove(selectedNodes);
- this._unselectAll();
- this.moving = true;
- this.start();
- }
- }
- else {
- alert(this.constants.labels["deleteClusterError"]);
}
}
};
+ exports._drawAllSectorNodes = function(ctx) {
+ this._drawSectorNodes(ctx,"frozen");
+ this._drawSectorNodes(ctx,"active");
+ this._loadLatestSector();
+ };
+
/***/ },
-/* 46 */
+/* 45 */
/***/ function(module, exports, __webpack_require__) {
- exports._cleanNavigation = function() {
- // clean up previous navigation items
- var wrapper = document.getElementById('network-navigation_wrapper');
- if (wrapper != null) {
- this.containerElement.removeChild(wrapper);
- }
- document.onmouseup = null;
- };
+ var Node = __webpack_require__(30);
/**
- * Creation of the navigation controls nodes. They are drawn over the rest of the nodes and are not affected by scale and translation
- * they have a triggerFunction which is called on click. If the position of the navigation controls is dependent
- * on this.frame.canvas.clientWidth or this.frame.canvas.clientHeight, we flag horizontalAlignLeft and verticalAlignTop false.
- * This means that the location will be corrected by the _relocateNavigation function on a size change of the canvas.
+ * This function can be called from the _doInAllSectors function
*
+ * @param object
+ * @param overlappingNodes
* @private
*/
- exports._loadNavigationElements = function() {
- this._cleanNavigation();
-
- this.navigationDivs = {};
- var navigationDivs = ['up','down','left','right','zoomIn','zoomOut','zoomExtends'];
- var navigationDivActions = ['_moveUp','_moveDown','_moveLeft','_moveRight','_zoomIn','_zoomOut','zoomExtent'];
-
- this.navigationDivs['wrapper'] = document.createElement('div');
- this.navigationDivs['wrapper'].id = "network-navigation_wrapper";
- this.navigationDivs['wrapper'].style.position = "absolute";
- this.navigationDivs['wrapper'].style.width = this.frame.canvas.clientWidth + "px";
- this.navigationDivs['wrapper'].style.height = this.frame.canvas.clientHeight + "px";
- this.containerElement.insertBefore(this.navigationDivs['wrapper'],this.frame);
-
- for (var i = 0; i < navigationDivs.length; i++) {
- this.navigationDivs[navigationDivs[i]] = document.createElement('div');
- this.navigationDivs[navigationDivs[i]].id = "network-navigation_" + navigationDivs[i];
- this.navigationDivs[navigationDivs[i]].className = "network-navigation " + navigationDivs[i];
- this.navigationDivs['wrapper'].appendChild(this.navigationDivs[navigationDivs[i]]);
- this.navigationDivs[navigationDivs[i]].onmousedown = this[navigationDivActions[i]].bind(this);
+ exports._getNodesOverlappingWith = function(object, overlappingNodes) {
+ var nodes = this.nodes;
+ for (var nodeId in nodes) {
+ if (nodes.hasOwnProperty(nodeId)) {
+ if (nodes[nodeId].isOverlappingWith(object)) {
+ overlappingNodes.push(nodeId);
+ }
+ }
}
-
- document.onmouseup = this._stopMovement.bind(this);
};
/**
- * this stops all movement induced by the navigation buttons
- *
+ * retrieve all nodes overlapping with given object
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
* @private
*/
- exports._stopMovement = function() {
- this._xStopMoving();
- this._yStopMoving();
- this._stopZoom();
+ exports._getAllNodesOverlappingWith = function (object) {
+ var overlappingNodes = [];
+ this._doInAllActiveSectors("_getNodesOverlappingWith",object,overlappingNodes);
+ return overlappingNodes;
};
/**
- * stops the actions performed by page up and down etc.
+ * Return a position object in canvasspace from a single point in screenspace
*
- * @param event
+ * @param pointer
+ * @returns {{left: number, top: number, right: number, bottom: number}}
* @private
*/
- exports._preventDefault = function(event) {
- if (event !== undefined) {
- if (event.preventDefault) {
- event.preventDefault();
- } else {
- event.returnValue = false;
- }
- }
+ exports._pointerToPositionObject = function(pointer) {
+ var x = this._XconvertDOMtoCanvas(pointer.x);
+ var y = this._YconvertDOMtoCanvas(pointer.y);
+
+ return {
+ left: x,
+ top: y,
+ right: x,
+ bottom: y
+ };
};
/**
- * move the screen up
- * By using the increments, instead of adding a fixed number to the translation, we keep fluent and
- * instant movement. The onKeypress event triggers immediately, then pauses, then triggers frequently
- * To avoid this behaviour, we do the translation in the start loop.
+ * Get the top node at the a specific point (like a click)
*
+ * @param {{x: Number, y: Number}} pointer
+ * @return {Node | null} node
* @private
*/
- exports._moveUp = function(event) {
- this.yIncrement = this.constants.keyboard.speed.y;
- this.start(); // if there is no node movement, the calculation wont be done
- this._preventDefault(event);
- if (this.navigationDivs) {
- this.navigationDivs['up'].className += " active";
- }
- };
-
+ exports._getNodeAt = function (pointer) {
+ // we first check if this is an navigation controls element
+ var positionObject = this._pointerToPositionObject(pointer);
+ var overlappingNodes = this._getAllNodesOverlappingWith(positionObject);
- /**
- * move the screen down
- * @private
- */
- exports._moveDown = function(event) {
- this.yIncrement = -this.constants.keyboard.speed.y;
- this.start(); // if there is no node movement, the calculation wont be done
- this._preventDefault(event);
- if (this.navigationDivs) {
- this.navigationDivs['down'].className += " active";
+ // if there are overlapping nodes, select the last one, this is the
+ // one which is drawn on top of the others
+ if (overlappingNodes.length > 0) {
+ return this.nodes[overlappingNodes[overlappingNodes.length - 1]];
+ }
+ else {
+ return null;
}
};
/**
- * move the screen left
+ * retrieve all edges overlapping with given object, selector is around center
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
* @private
*/
- exports._moveLeft = function(event) {
- this.xIncrement = this.constants.keyboard.speed.x;
- this.start(); // if there is no node movement, the calculation wont be done
- this._preventDefault(event);
- if (this.navigationDivs) {
- this.navigationDivs['left'].className += " active";
+ exports._getEdgesOverlappingWith = function (object, overlappingEdges) {
+ var edges = this.edges;
+ for (var edgeId in edges) {
+ if (edges.hasOwnProperty(edgeId)) {
+ if (edges[edgeId].isOverlappingWith(object)) {
+ overlappingEdges.push(edgeId);
+ }
+ }
}
};
/**
- * move the screen right
+ * retrieve all nodes overlapping with given object
+ * @param {Object} object An object with parameters left, top, right, bottom
+ * @return {Number[]} An array with id's of the overlapping nodes
* @private
*/
- exports._moveRight = function(event) {
- this.xIncrement = -this.constants.keyboard.speed.y;
- this.start(); // if there is no node movement, the calculation wont be done
- this._preventDefault(event);
- if (this.navigationDivs) {
- this.navigationDivs['right'].className += " active";
- }
+ exports._getAllEdgesOverlappingWith = function (object) {
+ var overlappingEdges = [];
+ this._doInAllActiveSectors("_getEdgesOverlappingWith",object,overlappingEdges);
+ return overlappingEdges;
};
-
/**
- * Zoom in, using the same method as the movement.
+ * Place holder. To implement change the _getNodeAt to a _getObjectAt. Have the _getObjectAt call
+ * _getNodeAt and _getEdgesAt, then priortize the selection to user preferences.
+ *
+ * @param pointer
+ * @returns {null}
* @private
*/
- exports._zoomIn = function(event) {
- this.zoomIncrement = this.constants.keyboard.speed.zoom;
- this.start(); // if there is no node movement, the calculation wont be done
- this._preventDefault(event);
- if (this.navigationDivs) {
- this.navigationDivs['zoomIn'].className += " active";
+ exports._getEdgeAt = function(pointer) {
+ var positionObject = this._pointerToPositionObject(pointer);
+ var overlappingEdges = this._getAllEdgesOverlappingWith(positionObject);
+
+ if (overlappingEdges.length > 0) {
+ return this.edges[overlappingEdges[overlappingEdges.length - 1]];
+ }
+ else {
+ return null;
}
};
/**
- * Zoom out
+ * Add object to the selection array.
+ *
+ * @param obj
* @private
*/
- exports._zoomOut = function() {
- this.zoomIncrement = -this.constants.keyboard.speed.zoom;
- this.start(); // if there is no node movement, the calculation wont be done
- this._preventDefault(event);
- if (this.navigationDivs) {
- this.navigationDivs['zoomOut'].className += " active";
+ exports._addToSelection = function(obj) {
+ if (obj instanceof Node) {
+ this.selectionObj.nodes[obj.id] = obj;
+ }
+ else {
+ this.selectionObj.edges[obj.id] = obj;
}
};
-
/**
- * Stop zooming and unhighlight the zoom controls
+ * Add object to the selection array.
+ *
+ * @param obj
* @private
*/
- exports._stopZoom = function() {
- this.zoomIncrement = 0;
- if (this.navigationDivs) {
- this.navigationDivs['zoomIn'].className = this.navigationDivs['zoomIn'].className.replace(" active","");
- this.navigationDivs['zoomOut'].className = this.navigationDivs['zoomOut'].className.replace(" active","");
+ exports._addToHover = function(obj) {
+ if (obj instanceof Node) {
+ this.hoverObj.nodes[obj.id] = obj;
+ }
+ else {
+ this.hoverObj.edges[obj.id] = obj;
}
};
/**
- * Stop moving in the Y direction and unHighlight the up and down
+ * Remove a single option from selection.
+ *
+ * @param {Object} obj
* @private
*/
- exports._yStopMoving = function() {
- this.yIncrement = 0;
- if (this.navigationDivs) {
- this.navigationDivs['up'].className = this.navigationDivs['up'].className.replace(" active","");
- this.navigationDivs['down'].className = this.navigationDivs['down'].className.replace(" active","");
+ exports._removeFromSelection = function(obj) {
+ if (obj instanceof Node) {
+ delete this.selectionObj.nodes[obj.id];
+ }
+ else {
+ delete this.selectionObj.edges[obj.id];
}
};
-
/**
- * Stop moving in the X direction and unHighlight left and right.
+ * Unselect all. The selectionObj is useful for this.
+ *
+ * @param {Boolean} [doNotTrigger] | ignore trigger
* @private
*/
- exports._xStopMoving = function() {
- this.xIncrement = 0;
- if (this.navigationDivs) {
- this.navigationDivs['left'].className = this.navigationDivs['left'].className.replace(" active","");
- this.navigationDivs['right'].className = this.navigationDivs['right'].className.replace(" active","");
+ exports._unselectAll = function(doNotTrigger) {
+ if (doNotTrigger === undefined) {
+ doNotTrigger = false;
+ }
+ for(var nodeId in this.selectionObj.nodes) {
+ if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ this.selectionObj.nodes[nodeId].unselect();
+ }
+ }
+ for(var edgeId in this.selectionObj.edges) {
+ if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ this.selectionObj.edges[edgeId].unselect();
+ }
}
- };
-
-/***/ },
-/* 47 */
-/***/ function(module, exports, __webpack_require__) {
+ this.selectionObj = {nodes:{},edges:{}};
- exports._resetLevels = function() {
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- var node = this.nodes[nodeId];
- if (node.preassignedLevel == false) {
- node.level = -1;
- }
- }
+ if (doNotTrigger == false) {
+ this.emit('select', this.getSelection());
}
};
/**
- * This is the main function to layout the nodes in a hierarchical way.
- * It checks if the node details are supplied correctly
+ * Unselect all clusters. The selectionObj is useful for this.
*
+ * @param {Boolean} [doNotTrigger] | ignore trigger
* @private
*/
- exports._setupHierarchicalLayout = function() {
- if (this.constants.hierarchicalLayout.enabled == true && this.nodeIndices.length > 0) {
- if (this.constants.hierarchicalLayout.direction == "RL" || this.constants.hierarchicalLayout.direction == "DU") {
- this.constants.hierarchicalLayout.levelSeparation *= -1;
- }
- else {
- this.constants.hierarchicalLayout.levelSeparation = Math.abs(this.constants.hierarchicalLayout.levelSeparation);
- }
+ exports._unselectClusters = function(doNotTrigger) {
+ if (doNotTrigger === undefined) {
+ doNotTrigger = false;
+ }
- if (this.constants.hierarchicalLayout.direction == "RL" || this.constants.hierarchicalLayout.direction == "LR") {
- if (this.constants.smoothCurves.enabled == true) {
- this.constants.smoothCurves.type = "vertical";
- }
- }
- else {
- if (this.constants.smoothCurves.enabled == true) {
- this.constants.smoothCurves.type = "horizontal";
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
+ this.selectionObj.nodes[nodeId].unselect();
+ this._removeFromSelection(this.selectionObj.nodes[nodeId]);
}
}
- // get the size of the largest hubs and check if the user has defined a level for a node.
- var hubsize = 0;
- var node, nodeId;
- var definedLevel = false;
- var undefinedLevel = false;
+ }
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- node = this.nodes[nodeId];
- if (node.level != -1) {
- definedLevel = true;
- }
- else {
- undefinedLevel = true;
- }
- if (hubsize < node.edges.length) {
- hubsize = node.edges.length;
- }
- }
- }
+ if (doNotTrigger == false) {
+ this.emit('select', this.getSelection());
+ }
+ };
- // if the user defined some levels but not all, alert and run without hierarchical layout
- if (undefinedLevel == true && definedLevel == true) {
- alert("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");
- this.zoomExtent(true,this.constants.clustering.enabled);
- if (!this.constants.clustering.enabled) {
- this.start();
- }
- }
- else {
- // setup the system to use hierarchical method.
- this._changeConstants();
- // define levels if undefined by the users. Based on hubsize
- if (undefinedLevel == true) {
- this._determineLevels(hubsize);
- }
- // check the distribution of the nodes per level.
- var distribution = this._getDistribution();
+ /**
+ * return the number of selected nodes
+ *
+ * @returns {number}
+ * @private
+ */
+ exports._getSelectedNodeCount = function() {
+ var count = 0;
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ count += 1;
+ }
+ }
+ return count;
+ };
- // place the nodes on the canvas. This also stablilizes the system.
- this._placeNodesByHierarchy(distribution);
+ /**
+ * return the selected node
+ *
+ * @returns {number}
+ * @private
+ */
+ exports._getSelectedNode = function() {
+ for (var nodeId in this.selectionObj.nodes) {
+ if (this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ return this.selectionObj.nodes[nodeId];
+ }
+ }
+ return null;
+ };
- // start the simulation.
- this.start();
+ /**
+ * return the selected edge
+ *
+ * @returns {number}
+ * @private
+ */
+ exports._getSelectedEdge = function() {
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ return this.selectionObj.edges[edgeId];
}
}
+ return null;
};
/**
- * This function places the nodes on the canvas based on the hierarchial distribution.
+ * return the number of selected edges
*
- * @param {Object} distribution | obtained by the function this._getDistribution()
+ * @returns {number}
* @private
*/
- exports._placeNodesByHierarchy = function(distribution) {
- var nodeId, node;
-
- // start placing all the level 0 nodes first. Then recursively position their branches.
- for (nodeId in distribution[0].nodes) {
- if (distribution[0].nodes.hasOwnProperty(nodeId)) {
- node = distribution[0].nodes[nodeId];
- if (this.constants.hierarchicalLayout.direction == "UD" || this.constants.hierarchicalLayout.direction == "DU") {
- if (node.xFixed) {
- node.x = distribution[0].minPos;
- node.xFixed = false;
-
- distribution[0].minPos += distribution[0].nodeSpacing;
- }
- }
- else {
- if (node.yFixed) {
- node.y = distribution[0].minPos;
- node.yFixed = false;
-
- distribution[0].minPos += distribution[0].nodeSpacing;
- }
- }
- this._placeBranchNodes(node.edges,node.id,distribution,node.level);
+ exports._getSelectedEdgeCount = function() {
+ var count = 0;
+ for (var edgeId in this.selectionObj.edges) {
+ if (this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ count += 1;
}
}
-
- // stabilize the system after positioning. This function calls zoomExtent.
- this._stabilize();
+ return count;
};
/**
- * This function get the distribution of levels based on hubsize
+ * return the number of selected objects.
*
- * @returns {Object}
+ * @returns {number}
* @private
*/
- exports._getDistribution = function() {
- var distribution = {};
- var nodeId, node, level;
-
- // we fix Y because the hierarchy is vertical, we fix X so we do not give a node an x position for a second time.
- // the fix of X is removed after the x value has been set.
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- node = this.nodes[nodeId];
- node.xFixed = true;
- node.yFixed = true;
- if (this.constants.hierarchicalLayout.direction == "UD" || this.constants.hierarchicalLayout.direction == "DU") {
- node.y = this.constants.hierarchicalLayout.levelSeparation*node.level;
- }
- else {
- node.x = this.constants.hierarchicalLayout.levelSeparation*node.level;
- }
- if (!distribution.hasOwnProperty(node.level)) {
- distribution[node.level] = {amount: 0, nodes: {}, minPos:0, nodeSpacing:0};
- }
- distribution[node.level].amount += 1;
- distribution[node.level].nodes[node.id] = node;
+ exports._getSelectedObjectCount = function() {
+ var count = 0;
+ for(var nodeId in this.selectionObj.nodes) {
+ if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ count += 1;
}
}
-
- // determine the largest amount of nodes of all levels
- var maxCount = 0;
- for (level in distribution) {
- if (distribution.hasOwnProperty(level)) {
- if (maxCount < distribution[level].amount) {
- maxCount = distribution[level].amount;
- }
+ for(var edgeId in this.selectionObj.edges) {
+ if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ count += 1;
}
}
+ return count;
+ };
- // set the initial position and spacing of each nodes accordingly
- for (level in distribution) {
- if (distribution.hasOwnProperty(level)) {
- distribution[level].nodeSpacing = (maxCount + 1) * this.constants.hierarchicalLayout.nodeSpacing;
- distribution[level].nodeSpacing /= (distribution[level].amount + 1);
- distribution[level].minPos = distribution[level].nodeSpacing - (0.5 * (distribution[level].amount + 1) * distribution[level].nodeSpacing);
+ /**
+ * Check if anything is selected
+ *
+ * @returns {boolean}
+ * @private
+ */
+ exports._selectionIsEmpty = function() {
+ for(var nodeId in this.selectionObj.nodes) {
+ if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ return false;
}
}
-
- return distribution;
+ for(var edgeId in this.selectionObj.edges) {
+ if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ return false;
+ }
+ }
+ return true;
};
/**
- * this function allocates nodes in levels based on the recursive branching from the largest hubs.
+ * check if one of the selected nodes is a cluster.
*
- * @param hubsize
+ * @returns {boolean}
* @private
*/
- exports._determineLevels = function(hubsize) {
- var nodeId, node;
-
- // determine hubs
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- node = this.nodes[nodeId];
- if (node.edges.length == hubsize) {
- node.level = 0;
+ exports._clusterInSelection = function() {
+ for(var nodeId in this.selectionObj.nodes) {
+ if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ if (this.selectionObj.nodes[nodeId].clusterSize > 1) {
+ return true;
}
}
}
+ return false;
+ };
- // branch from hubs
- for (nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- node = this.nodes[nodeId];
- if (node.level == 0) {
- this._setLevel(1,node.edges,node.id);
- }
- }
+ /**
+ * select the edges connected to the node that is being selected
+ *
+ * @param {Node} node
+ * @private
+ */
+ exports._selectConnectedEdges = function(node) {
+ for (var i = 0; i < node.dynamicEdges.length; i++) {
+ var edge = node.dynamicEdges[i];
+ edge.select();
+ this._addToSelection(edge);
}
};
-
/**
- * Since hierarchical layout does not support:
- * - smooth curves (based on the physics),
- * - clustering (based on dynamic node counts)
+ * select the edges connected to the node that is being selected
*
- * We disable both features so there will be no problems.
+ * @param {Node} node
+ * @private
+ */
+ exports._hoverConnectedEdges = function(node) {
+ for (var i = 0; i < node.dynamicEdges.length; i++) {
+ var edge = node.dynamicEdges[i];
+ edge.hover = true;
+ this._addToHover(edge);
+ }
+ };
+
+
+ /**
+ * unselect the edges connected to the node that is being selected
*
+ * @param {Node} node
* @private
*/
- exports._changeConstants = function() {
- this.constants.clustering.enabled = false;
- this.constants.physics.barnesHut.enabled = false;
- this.constants.physics.hierarchicalRepulsion.enabled = true;
- this._loadSelectedForceSolver();
- if (this.constants.smoothCurves.enabled == true) {
- this.constants.smoothCurves.dynamic = false;
+ exports._unselectConnectedEdges = function(node) {
+ for (var i = 0; i < node.dynamicEdges.length; i++) {
+ var edge = node.dynamicEdges[i];
+ edge.unselect();
+ this._removeFromSelection(edge);
}
- this._configureSmoothCurves();
};
+
+
/**
- * This is a recursively called function to enumerate the branches from the largest hubs and place the nodes
- * on a X position that ensures there will be no overlap.
+ * This is called when someone clicks on a node. either select or deselect it.
+ * If there is an existing selection and we don't want to append to it, clear the existing selection
*
- * @param edges
- * @param parentId
- * @param distribution
- * @param parentLevel
+ * @param {Node || Edge} object
+ * @param {Boolean} append
+ * @param {Boolean} [doNotTrigger] | ignore trigger
* @private
*/
- exports._placeBranchNodes = function(edges, parentId, distribution, parentLevel) {
- for (var i = 0; i < edges.length; i++) {
- var childNode = null;
- if (edges[i].toId == parentId) {
- childNode = edges[i].from;
- }
- else {
- childNode = edges[i].to;
- }
+ exports._selectObject = function(object, append, doNotTrigger, highlightEdges) {
+ if (doNotTrigger === undefined) {
+ doNotTrigger = false;
+ }
+ if (highlightEdges === undefined) {
+ highlightEdges = true;
+ }
- // if a node is conneceted to another node on the same level (or higher (means lower level))!, this is not handled here.
- var nodeMoved = false;
- if (this.constants.hierarchicalLayout.direction == "UD" || this.constants.hierarchicalLayout.direction == "DU") {
- if (childNode.xFixed && childNode.level > parentLevel) {
- childNode.xFixed = false;
- childNode.x = distribution[childNode.level].minPos;
- nodeMoved = true;
- }
- }
- else {
- if (childNode.yFixed && childNode.level > parentLevel) {
- childNode.yFixed = false;
- childNode.y = distribution[childNode.level].minPos;
- nodeMoved = true;
- }
+ if (this._selectionIsEmpty() == false && append == false && this.forceAppendSelection == false) {
+ this._unselectAll(true);
+ }
+
+ if (object.selected == false) {
+ object.select();
+ this._addToSelection(object);
+ if (object instanceof Node && this.blockConnectingEdgeSelection == false && highlightEdges == true) {
+ this._selectConnectedEdges(object);
}
+ }
+ else {
+ object.unselect();
+ this._removeFromSelection(object);
+ }
+
+ if (doNotTrigger == false) {
+ this.emit('select', this.getSelection());
+ }
+ };
+
+
+ /**
+ * This is called when someone clicks on a node. either select or deselect it.
+ * If there is an existing selection and we don't want to append to it, clear the existing selection
+ *
+ * @param {Node || Edge} object
+ * @private
+ */
+ exports._blurObject = function(object) {
+ if (object.hover == true) {
+ object.hover = false;
+ this.emit("blurNode",{node:object.id});
+ }
+ };
- if (nodeMoved == true) {
- distribution[childNode.level].minPos += distribution[childNode.level].nodeSpacing;
- if (childNode.edges.length > 1) {
- this._placeBranchNodes(childNode.edges,childNode.id,distribution,childNode.level);
- }
+ /**
+ * This is called when someone clicks on a node. either select or deselect it.
+ * If there is an existing selection and we don't want to append to it, clear the existing selection
+ *
+ * @param {Node || Edge} object
+ * @private
+ */
+ exports._hoverObject = function(object) {
+ if (object.hover == false) {
+ object.hover = true;
+ this._addToHover(object);
+ if (object instanceof Node) {
+ this.emit("hoverNode",{node:object.id});
}
}
+ if (object instanceof Node) {
+ this._hoverConnectedEdges(object);
+ }
};
/**
- * this function is called recursively to enumerate the barnches of the largest hubs and give each node a level.
+ * handles the selection part of the touch, only for navigation controls elements;
+ * Touch is triggered before tap, also before hold. Hold triggers after a while.
+ * This is the most responsive solution
*
- * @param level
- * @param edges
- * @param parentId
+ * @param {Object} pointer
* @private
*/
- exports._setLevel = function(level, edges, parentId) {
- for (var i = 0; i < edges.length; i++) {
- var childNode = null;
- if (edges[i].toId == parentId) {
- childNode = edges[i].from;
+ exports._handleTouch = function(pointer) {
+ };
+
+
+ /**
+ * handles the selection part of the tap;
+ *
+ * @param {Object} pointer
+ * @private
+ */
+ exports._handleTap = function(pointer) {
+ var node = this._getNodeAt(pointer);
+ if (node != null) {
+ this._selectObject(node,false);
+ }
+ else {
+ var edge = this._getEdgeAt(pointer);
+ if (edge != null) {
+ this._selectObject(edge,false);
}
else {
- childNode = edges[i].to;
- }
- if (childNode.level == -1 || childNode.level > level) {
- childNode.level = level;
- if (edges.length > 1) {
- this._setLevel(level+1, childNode.edges, childNode.id);
- }
+ this._unselectAll();
}
}
+ this.emit("click", this.getSelection());
+ this._redraw();
};
/**
- * Unfix nodes
+ * handles the selection part of the double tap and opens a cluster if needed
*
+ * @param {Object} pointer
* @private
*/
- exports._restoreNodes = function() {
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- this.nodes[nodeId].xFixed = false;
- this.nodes[nodeId].yFixed = false;
- }
+ exports._handleDoubleTap = function(pointer) {
+ var node = this._getNodeAt(pointer);
+ if (node != null && node !== undefined) {
+ // we reset the areaCenter here so the opening of the node will occur
+ this.areaCenter = {"x" : this._XconvertDOMtoCanvas(pointer.x),
+ "y" : this._YconvertDOMtoCanvas(pointer.y)};
+ this.openCluster(node);
}
+ this.emit("doubleClick", this.getSelection());
};
-/***/ },
-/* 48 */
-/***/ function(module, exports, __webpack_require__) {
-
/**
- * Copyright 2012 Craig Campbell
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Mousetrap is a simple keyboard shortcut library for Javascript with
- * no external dependencies
+ * Handle the onHold selection part
*
- * @version 1.1.2
- * @url craig.is/killing/mice
+ * @param pointer
+ * @private
*/
+ exports._handleOnHold = function(pointer) {
+ var node = this._getNodeAt(pointer);
+ if (node != null) {
+ this._selectObject(node,true);
+ }
+ else {
+ var edge = this._getEdgeAt(pointer);
+ if (edge != null) {
+ this._selectObject(edge,true);
+ }
+ }
+ this._redraw();
+ };
- /**
- * mapping of special keycodes to their corresponding keys
- *
- * everything in this dictionary cannot use keypress events
- * so it has to be here to map to the correct keycodes for
- * keyup/keydown events
- *
- * @type {Object}
- */
- var _MAP = {
- 8: 'backspace',
- 9: 'tab',
- 13: 'enter',
- 16: 'shift',
- 17: 'ctrl',
- 18: 'alt',
- 20: 'capslock',
- 27: 'esc',
- 32: 'space',
- 33: 'pageup',
- 34: 'pagedown',
- 35: 'end',
- 36: 'home',
- 37: 'left',
- 38: 'up',
- 39: 'right',
- 40: 'down',
- 45: 'ins',
- 46: 'del',
- 91: 'meta',
- 93: 'meta',
- 224: 'meta'
- },
-
- /**
- * mapping for special characters so they can support
- *
- * this dictionary is only used incase you want to bind a
- * keyup or keydown event to one of these keys
- *
- * @type {Object}
- */
- _KEYCODE_MAP = {
- 106: '*',
- 107: '+',
- 109: '-',
- 110: '.',
- 111 : '/',
- 186: ';',
- 187: '=',
- 188: ',',
- 189: '-',
- 190: '.',
- 191: '/',
- 192: '`',
- 219: '[',
- 220: '\\',
- 221: ']',
- 222: '\''
- },
-
- /**
- * this is a mapping of keys that require shift on a US keypad
- * back to the non shift equivelents
- *
- * this is so you can use keyup events with these keys
- *
- * note that this will only work reliably on US keyboards
- *
- * @type {Object}
- */
- _SHIFT_MAP = {
- '~': '`',
- '!': '1',
- '@': '2',
- '#': '3',
- '$': '4',
- '%': '5',
- '^': '6',
- '&': '7',
- '*': '8',
- '(': '9',
- ')': '0',
- '_': '-',
- '+': '=',
- ':': ';',
- '\"': '\'',
- '<': ',',
- '>': '.',
- '?': '/',
- '|': '\\'
- },
-
- /**
- * this is a list of special strings you can use to map
- * to modifier keys when you specify your keyboard shortcuts
- *
- * @type {Object}
- */
- _SPECIAL_ALIASES = {
- 'option': 'alt',
- 'command': 'meta',
- 'return': 'enter',
- 'escape': 'esc'
- },
-
- /**
- * variable to store the flipped version of _MAP from above
- * needed to check if we should use keypress or not when no action
- * is specified
- *
- * @type {Object|undefined}
- */
- _REVERSE_MAP,
-
- /**
- * a list of all the callbacks setup via Mousetrap.bind()
- *
- * @type {Object}
- */
- _callbacks = {},
-
- /**
- * direct map of string combinations to callbacks used for trigger()
- *
- * @type {Object}
- */
- _direct_map = {},
- /**
- * keeps track of what level each sequence is at since multiple
- * sequences can start out with the same sequence
- *
- * @type {Object}
- */
- _sequence_levels = {},
+ /**
+ * handle the onRelease event. These functions are here for the navigation controls module.
+ *
+ * @private
+ */
+ exports._handleOnRelease = function(pointer) {
- /**
- * variable to store the setTimeout call
- *
- * @type {null|number}
- */
- _reset_timer,
+ };
- /**
- * temporary state where we will ignore the next keyup
- *
- * @type {boolean|string}
- */
- _ignore_next_keyup = false,
- /**
- * are we currently inside of a sequence?
- * type of action ("keyup" or "keydown" or "keypress") or false
- *
- * @type {boolean|string}
- */
- _inside_sequence = false;
- /**
- * loop through the f keys, f1 to f19 and add them to the map
- * programatically
- */
- for (var i = 1; i < 20; ++i) {
- _MAP[111 + i] = 'f' + i;
+ /**
+ *
+ * retrieve the currently selected objects
+ * @return {{nodes: Array., edges: Array.}} selection
+ */
+ exports.getSelection = function() {
+ var nodeIds = this.getSelectedNodes();
+ var edgeIds = this.getSelectedEdges();
+ return {nodes:nodeIds, edges:edgeIds};
+ };
+
+ /**
+ *
+ * retrieve the currently selected nodes
+ * @return {String[]} selection An array with the ids of the
+ * selected nodes.
+ */
+ exports.getSelectedNodes = function() {
+ var idArray = [];
+ for(var nodeId in this.selectionObj.nodes) {
+ if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ idArray.push(nodeId);
+ }
}
+ return idArray
+ };
- /**
- * loop through to map numbers on the numeric keypad
- */
- for (i = 0; i <= 9; ++i) {
- _MAP[i + 96] = i;
+ /**
+ *
+ * retrieve the currently selected edges
+ * @return {Array} selection An array with the ids of the
+ * selected nodes.
+ */
+ exports.getSelectedEdges = function() {
+ var idArray = [];
+ for(var edgeId in this.selectionObj.edges) {
+ if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ idArray.push(edgeId);
+ }
}
+ return idArray;
+ };
- /**
- * cross browser add event method
- *
- * @param {Element|HTMLDocument} object
- * @param {string} type
- * @param {Function} callback
- * @returns void
- */
- function _addEvent(object, type, callback) {
- if (object.addEventListener) {
- return object.addEventListener(type, callback, false);
- }
- object.attachEvent('on' + type, callback);
+ /**
+ * select zero or more nodes
+ * @param {Number[] | String[]} selection An array with the ids of the
+ * selected nodes.
+ */
+ exports.setSelection = function(selection) {
+ var i, iMax, id;
+
+ if (!selection || (selection.length == undefined))
+ throw 'Selection must be an array with ids';
+
+ // first unselect any selected node
+ this._unselectAll(true);
+
+ for (i = 0, iMax = selection.length; i < iMax; i++) {
+ id = selection[i];
+
+ var node = this.nodes[id];
+ if (!node) {
+ throw new RangeError('Node with id "' + id + '" not found');
+ }
+ this._selectObject(node,true,true);
}
- /**
- * takes the event and returns the key character
- *
- * @param {Event} e
- * @return {string}
- */
- function _characterFromEvent(e) {
+ console.log("setSelection is deprecated. Please use selectNodes instead.")
- // for keypress events we should return the character as is
- if (e.type == 'keypress') {
- return String.fromCharCode(e.which);
- }
+ this.redraw();
+ };
- // for non keypress events the special maps are needed
- if (_MAP[e.which]) {
- return _MAP[e.which];
- }
- if (_KEYCODE_MAP[e.which]) {
- return _KEYCODE_MAP[e.which];
- }
+ /**
+ * select zero or more nodes with the option to highlight edges
+ * @param {Number[] | String[]} selection An array with the ids of the
+ * selected nodes.
+ * @param {boolean} [highlightEdges]
+ */
+ exports.selectNodes = function(selection, highlightEdges) {
+ var i, iMax, id;
- // if it is not in the special map
- return String.fromCharCode(e.which).toLowerCase();
- }
+ if (!selection || (selection.length == undefined))
+ throw 'Selection must be an array with ids';
- /**
- * should we stop this event before firing off callbacks
- *
- * @param {Event} e
- * @return {boolean}
- */
- function _stop(e) {
- var element = e.target || e.srcElement,
- tag_name = element.tagName;
+ // first unselect any selected node
+ this._unselectAll(true);
- // if the element has the class "mousetrap" then no need to stop
- if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
- return false;
- }
+ for (i = 0, iMax = selection.length; i < iMax; i++) {
+ id = selection[i];
- // stop for input, select, and textarea
- return tag_name == 'INPUT' || tag_name == 'SELECT' || tag_name == 'TEXTAREA' || (element.contentEditable && element.contentEditable == 'true');
+ var node = this.nodes[id];
+ if (!node) {
+ throw new RangeError('Node with id "' + id + '" not found');
+ }
+ this._selectObject(node,true,true,highlightEdges);
}
+ this.redraw();
+ };
- /**
- * checks if two arrays are equal
- *
- * @param {Array} modifiers1
- * @param {Array} modifiers2
- * @returns {boolean}
- */
- function _modifiersMatch(modifiers1, modifiers2) {
- return modifiers1.sort().join(',') === modifiers2.sort().join(',');
- }
- /**
- * resets all sequence counters except for the ones passed in
- *
- * @param {Object} do_not_reset
- * @returns void
- */
- function _resetSequences(do_not_reset) {
- do_not_reset = do_not_reset || {};
+ /**
+ * select zero or more edges
+ * @param {Number[] | String[]} selection An array with the ids of the
+ * selected nodes.
+ */
+ exports.selectEdges = function(selection) {
+ var i, iMax, id;
- var active_sequences = false,
- key;
+ if (!selection || (selection.length == undefined))
+ throw 'Selection must be an array with ids';
- for (key in _sequence_levels) {
- if (do_not_reset[key]) {
- active_sequences = true;
- continue;
- }
- _sequence_levels[key] = 0;
- }
+ // first unselect any selected node
+ this._unselectAll(true);
- if (!active_sequences) {
- _inside_sequence = false;
- }
- }
+ for (i = 0, iMax = selection.length; i < iMax; i++) {
+ id = selection[i];
- /**
- * finds all callbacks that match based on the keycode, modifiers,
- * and action
- *
- * @param {string} character
- * @param {Array} modifiers
- * @param {string} action
- * @param {boolean=} remove - should we remove any matches
- * @param {string=} combination
- * @returns {Array}
- */
- function _getMatches(character, modifiers, action, remove, combination) {
- var i,
- callback,
- matches = [];
+ var edge = this.edges[id];
+ if (!edge) {
+ throw new RangeError('Edge with id "' + id + '" not found');
+ }
+ this._selectObject(edge,true,true,highlightEdges);
+ }
+ this.redraw();
+ };
- // if there are no events related to this keycode
- if (!_callbacks[character]) {
- return [];
+ /**
+ * Validate the selection: remove ids of nodes which no longer exist
+ * @private
+ */
+ exports._updateSelection = function () {
+ for(var nodeId in this.selectionObj.nodes) {
+ if(this.selectionObj.nodes.hasOwnProperty(nodeId)) {
+ if (!this.nodes.hasOwnProperty(nodeId)) {
+ delete this.selectionObj.nodes[nodeId];
}
-
- // if a modifier key is coming up on its own we should allow it
- if (action == 'keyup' && _isModifier(character)) {
- modifiers = [character];
+ }
+ }
+ for(var edgeId in this.selectionObj.edges) {
+ if(this.selectionObj.edges.hasOwnProperty(edgeId)) {
+ if (!this.edges.hasOwnProperty(edgeId)) {
+ delete this.selectionObj.edges[edgeId];
}
+ }
+ }
+ };
- // loop through all callbacks for the key that was pressed
- // and see if any of them match
- for (i = 0; i < _callbacks[character].length; ++i) {
- callback = _callbacks[character][i];
- // if this is a sequence but it is not at the right level
- // then move onto the next match
- if (callback.seq && _sequence_levels[callback.seq] != callback.level) {
- continue;
- }
+/***/ },
+/* 46 */
+/***/ function(module, exports, __webpack_require__) {
- // if the action we are looking for doesn't match the action we got
- // then we should keep going
- if (action != callback.action) {
- continue;
- }
+ var util = __webpack_require__(1);
+ var Node = __webpack_require__(30);
+ var Edge = __webpack_require__(27);
- // if this is a keypress event that means that we need to only
- // look at the character, otherwise check the modifiers as
- // well
- if (action == 'keypress' || _modifiersMatch(modifiers, callback.modifiers)) {
+ /**
+ * clears the toolbar div element of children
+ *
+ * @private
+ */
+ exports._clearManipulatorBar = function() {
+ while (this.manipulationDiv.hasChildNodes()) {
+ this.manipulationDiv.removeChild(this.manipulationDiv.firstChild);
+ }
+ };
- // remove is used so if you change your mind and call bind a
- // second time with a new function the first one is overwritten
- if (remove && callback.combo == combination) {
- _callbacks[character].splice(i, 1);
- }
+ /**
+ * Manipulation UI temporarily overloads certain functions to extend or replace them. To be able to restore
+ * these functions to their original functionality, we saved them in this.cachedFunctions.
+ * This function restores these functions to their original function.
+ *
+ * @private
+ */
+ exports._restoreOverloadedFunctions = function() {
+ for (var functionName in this.cachedFunctions) {
+ if (this.cachedFunctions.hasOwnProperty(functionName)) {
+ this[functionName] = this.cachedFunctions[functionName];
+ }
+ }
+ };
- matches.push(callback);
- }
- }
+ /**
+ * Enable or disable edit-mode.
+ *
+ * @private
+ */
+ exports._toggleEditMode = function() {
+ this.editMode = !this.editMode;
+ var toolbar = document.getElementById("network-manipulationDiv");
+ var closeDiv = document.getElementById("network-manipulation-closeDiv");
+ var editModeDiv = document.getElementById("network-manipulation-editMode");
+ if (this.editMode == true) {
+ toolbar.style.display="block";
+ closeDiv.style.display="block";
+ editModeDiv.style.display="none";
+ closeDiv.onclick = this._toggleEditMode.bind(this);
+ }
+ else {
+ toolbar.style.display="none";
+ closeDiv.style.display="none";
+ editModeDiv.style.display="block";
+ closeDiv.onclick = null;
+ }
+ this._createManipulatorBar()
+ };
- return matches;
+ /**
+ * main function, creates the main toolbar. Removes functions bound to the select event. Binds all the buttons of the toolbar.
+ *
+ * @private
+ */
+ exports._createManipulatorBar = function() {
+ // remove bound functions
+ if (this.boundFunction) {
+ this.off('select', this.boundFunction);
}
- /**
- * takes a key event and figures out what the modifiers are
- *
- * @param {Event} e
- * @returns {Array}
- */
- function _eventModifiers(e) {
- var modifiers = [];
+ if (this.edgeBeingEdited !== undefined) {
+ this.edgeBeingEdited._disableControlNodes();
+ this.edgeBeingEdited = undefined;
+ this.selectedControlNode = null;
+ this.controlNodesActive = false;
+ }
- if (e.shiftKey) {
- modifiers.push('shift');
- }
+ // restore overloaded functions
+ this._restoreOverloadedFunctions();
- if (e.altKey) {
- modifiers.push('alt');
- }
+ // resume calculation
+ this.freezeSimulation = false;
- if (e.ctrlKey) {
- modifiers.push('ctrl');
- }
+ // reset global variables
+ this.blockConnectingEdgeSelection = false;
+ this.forceAppendSelection = false;
- if (e.metaKey) {
- modifiers.push('meta');
- }
+ if (this.editMode == true) {
+ while (this.manipulationDiv.hasChildNodes()) {
+ this.manipulationDiv.removeChild(this.manipulationDiv.firstChild);
+ }
+ // add the icons to the manipulator div
+ this.manipulationDiv.innerHTML = "" +
+ "" +
+ ""+this.constants.labels['add'] +"" +
+ "" +
+ "" +
+ ""+this.constants.labels['link'] +"";
+ if (this._getSelectedNodeCount() == 1 && this.triggerFunctions.edit) {
+ this.manipulationDiv.innerHTML += "" +
+ "" +
+ "" +
+ ""+this.constants.labels['editNode'] +"";
+ }
+ else if (this._getSelectedEdgeCount() == 1 && this._getSelectedNodeCount() == 0) {
+ this.manipulationDiv.innerHTML += "" +
+ "" +
+ "" +
+ ""+this.constants.labels['editEdge'] +"";
+ }
+ if (this._selectionIsEmpty() == false) {
+ this.manipulationDiv.innerHTML += "" +
+ "" +
+ "" +
+ ""+this.constants.labels['del'] +"";
+ }
- return modifiers;
+
+ // bind the icons
+ var addNodeButton = document.getElementById("network-manipulate-addNode");
+ addNodeButton.onclick = this._createAddNodeToolbar.bind(this);
+ var addEdgeButton = document.getElementById("network-manipulate-connectNode");
+ addEdgeButton.onclick = this._createAddEdgeToolbar.bind(this);
+ if (this._getSelectedNodeCount() == 1 && this.triggerFunctions.edit) {
+ var editButton = document.getElementById("network-manipulate-editNode");
+ editButton.onclick = this._editNode.bind(this);
+ }
+ else if (this._getSelectedEdgeCount() == 1 && this._getSelectedNodeCount() == 0) {
+ var editButton = document.getElementById("network-manipulate-editEdge");
+ editButton.onclick = this._createEditEdgeToolbar.bind(this);
+ }
+ if (this._selectionIsEmpty() == false) {
+ var deleteButton = document.getElementById("network-manipulate-delete");
+ deleteButton.onclick = this._deleteSelected.bind(this);
+ }
+ var closeDiv = document.getElementById("network-manipulation-closeDiv");
+ closeDiv.onclick = this._toggleEditMode.bind(this);
+
+ this.boundFunction = this._createManipulatorBar.bind(this);
+ this.on('select', this.boundFunction);
+ }
+ else {
+ this.editModeDiv.innerHTML = "" +
+ "" +
+ "" + this.constants.labels['edit'] + "";
+ var editModeButton = document.getElementById("network-manipulate-editModeButton");
+ editModeButton.onclick = this._toggleEditMode.bind(this);
}
+ };
- /**
- * actually calls the callback function
- *
- * if your callback function returns false this will use the jquery
- * convention - prevent default and stop propogation on the event
- *
- * @param {Function} callback
- * @param {Event} e
- * @returns void
- */
- function _fireCallback(callback, e) {
- if (callback(e) === false) {
- if (e.preventDefault) {
- e.preventDefault();
- }
- if (e.stopPropagation) {
- e.stopPropagation();
- }
- e.returnValue = false;
- e.cancelBubble = true;
- }
+ /**
+ * Create the toolbar for adding Nodes
+ *
+ * @private
+ */
+ exports._createAddNodeToolbar = function() {
+ // clear the toolbar
+ this._clearManipulatorBar();
+ if (this.boundFunction) {
+ this.off('select', this.boundFunction);
}
- /**
- * handles a character key event
- *
- * @param {string} character
- * @param {Event} e
- * @returns void
- */
- function _handleCharacter(character, e) {
+ // create the toolbar contents
+ this.manipulationDiv.innerHTML = "" +
+ "" +
+ "" + this.constants.labels['back'] + " " +
+ "" +
+ "" +
+ "" + this.constants.labels['addDescription'] + "";
- // if this event should not happen stop here
- if (_stop(e)) {
- return;
- }
+ // bind the icon
+ var backButton = document.getElementById("network-manipulate-back");
+ backButton.onclick = this._createManipulatorBar.bind(this);
+
+ // we use the boundFunction so we can reference it when we unbind it from the "select" event.
+ this.boundFunction = this._addNode.bind(this);
+ this.on('select', this.boundFunction);
+ };
+
+
+ /**
+ * create the toolbar to connect nodes
+ *
+ * @private
+ */
+ exports._createAddEdgeToolbar = function() {
+ // clear the toolbar
+ this._clearManipulatorBar();
+ this._unselectAll(true);
+ this.freezeSimulation = true;
- var callbacks = _getMatches(character, _eventModifiers(e), e.type),
- i,
- do_not_reset = {},
- processed_sequence_callback = false;
+ if (this.boundFunction) {
+ this.off('select', this.boundFunction);
+ }
- // loop through matching callbacks for this key event
- for (i = 0; i < callbacks.length; ++i) {
+ this._unselectAll();
+ this.forceAppendSelection = false;
+ this.blockConnectingEdgeSelection = true;
- // fire for all sequence callbacks
- // this is because if for example you have multiple sequences
- // bound such as "g i" and "g t" they both need to fire the
- // callback for matching g cause otherwise you can only ever
- // match the first one
- if (callbacks[i].seq) {
- processed_sequence_callback = true;
+ this.manipulationDiv.innerHTML = "" +
+ "" +
+ "" + this.constants.labels['back'] + " " +
+ "" +
+ "" +
+ "" + this.constants.labels['linkDescription'] + "";
- // keep a list of which sequences were matches for later
- do_not_reset[callbacks[i].seq] = 1;
- _fireCallback(callbacks[i].callback, e);
- continue;
- }
+ // bind the icon
+ var backButton = document.getElementById("network-manipulate-back");
+ backButton.onclick = this._createManipulatorBar.bind(this);
- // if there were no sequence matches but we are still here
- // that means this is a regular match so we should fire that
- if (!processed_sequence_callback && !_inside_sequence) {
- _fireCallback(callbacks[i].callback, e);
- }
- }
+ // we use the boundFunction so we can reference it when we unbind it from the "select" event.
+ this.boundFunction = this._handleConnect.bind(this);
+ this.on('select', this.boundFunction);
- // if you are inside of a sequence and the key you are pressing
- // is not a modifier key then we should reset all sequences
- // that were not matched by this key event
- if (e.type == _inside_sequence && !_isModifier(character)) {
- _resetSequences(do_not_reset);
- }
- }
+ // temporarily overload functions
+ this.cachedFunctions["_handleTouch"] = this._handleTouch;
+ this.cachedFunctions["_handleOnRelease"] = this._handleOnRelease;
+ this._handleTouch = this._handleConnect;
+ this._handleOnRelease = this._finishConnect;
- /**
- * handles a keydown event
- *
- * @param {Event} e
- * @returns void
- */
- function _handleKey(e) {
+ // redraw to show the unselect
+ this._redraw();
+ };
- // normalize e.which for key events
- // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
- e.which = typeof e.which == "number" ? e.which : e.keyCode;
+ /**
+ * create the toolbar to edit edges
+ *
+ * @private
+ */
+ exports._createEditEdgeToolbar = function() {
+ // clear the toolbar
+ this._clearManipulatorBar();
+ this.controlNodesActive = true;
- var character = _characterFromEvent(e);
+ if (this.boundFunction) {
+ this.off('select', this.boundFunction);
+ }
- // no character found then stop
- if (!character) {
- return;
- }
+ this.edgeBeingEdited = this._getSelectedEdge();
+ this.edgeBeingEdited._enableControlNodes();
- if (e.type == 'keyup' && _ignore_next_keyup == character) {
- _ignore_next_keyup = false;
- return;
- }
+ this.manipulationDiv.innerHTML = "" +
+ "" +
+ "" + this.constants.labels['back'] + " " +
+ "" +
+ "" +
+ "" + this.constants.labels['editEdgeDescription'] + "";
- _handleCharacter(character, e);
- }
+ // bind the icon
+ var backButton = document.getElementById("network-manipulate-back");
+ backButton.onclick = this._createManipulatorBar.bind(this);
- /**
- * determines if the keycode specified is a modifier key or not
- *
- * @param {string} key
- * @returns {boolean}
- */
- function _isModifier(key) {
- return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
- }
+ // temporarily overload functions
+ this.cachedFunctions["_handleTouch"] = this._handleTouch;
+ this.cachedFunctions["_handleOnRelease"] = this._handleOnRelease;
+ this.cachedFunctions["_handleTap"] = this._handleTap;
+ this.cachedFunctions["_handleDragStart"] = this._handleDragStart;
+ this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag;
+ this._handleTouch = this._selectControlNode;
+ this._handleTap = function () {};
+ this._handleOnDrag = this._controlNodeDrag;
+ this._handleDragStart = function () {}
+ this._handleOnRelease = this._releaseControlNode;
- /**
- * called to set a 1 second timeout on the specified sequence
- *
- * this is so after each key press in the sequence you have 1 second
- * to press the next key before you have to start over
- *
- * @returns void
- */
- function _resetSequenceTimer() {
- clearTimeout(_reset_timer);
- _reset_timer = setTimeout(_resetSequences, 1000);
- }
+ // redraw to show the unselect
+ this._redraw();
+ };
- /**
- * reverses the map lookup so that we can look for specific keys
- * to see what can and can't use keypress
- *
- * @return {Object}
- */
- function _getReverseMap() {
- if (!_REVERSE_MAP) {
- _REVERSE_MAP = {};
- for (var key in _MAP) {
- // pull out the numeric keypad from here cause keypress should
- // be able to detect the keys from the character
- if (key > 95 && key < 112) {
- continue;
- }
- if (_MAP.hasOwnProperty(key)) {
- _REVERSE_MAP[_MAP[key]] = key;
- }
- }
- }
- return _REVERSE_MAP;
- }
- /**
- * picks the best action based on the key combination
- *
- * @param {string} key - character for key
- * @param {Array} modifiers
- * @param {string=} action passed in
- */
- function _pickBestAction(key, modifiers, action) {
- // if no action was picked in we should try to pick the one
- // that we think would work best for this key
- if (!action) {
- action = _getReverseMap()[key] ? 'keydown' : 'keypress';
- }
+ /**
+ * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
+ * to walk the user through the process.
+ *
+ * @private
+ */
+ exports._selectControlNode = function(pointer) {
+ this.edgeBeingEdited.controlNodes.from.unselect();
+ this.edgeBeingEdited.controlNodes.to.unselect();
+ this.selectedControlNode = this.edgeBeingEdited._getSelectedControlNode(this._XconvertDOMtoCanvas(pointer.x),this._YconvertDOMtoCanvas(pointer.y));
+ if (this.selectedControlNode !== null) {
+ this.selectedControlNode.select();
+ this.freezeSimulation = true;
+ }
+ this._redraw();
+ };
- // modifier keys don't work as expected with keypress,
- // switch to keydown
- if (action == 'keypress' && modifiers.length) {
- action = 'keydown';
- }
+ /**
+ * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
+ * to walk the user through the process.
+ *
+ * @private
+ */
+ exports._controlNodeDrag = function(event) {
+ var pointer = this._getPointer(event.gesture.center);
+ if (this.selectedControlNode !== null && this.selectedControlNode !== undefined) {
+ this.selectedControlNode.x = this._XconvertDOMtoCanvas(pointer.x);
+ this.selectedControlNode.y = this._YconvertDOMtoCanvas(pointer.y);
+ }
+ this._redraw();
+ };
- return action;
+ exports._releaseControlNode = function(pointer) {
+ var newNode = this._getNodeAt(pointer);
+ if (newNode != null) {
+ if (this.edgeBeingEdited.controlNodes.from.selected == true) {
+ this._editEdge(newNode.id, this.edgeBeingEdited.to.id);
+ this.edgeBeingEdited.controlNodes.from.unselect();
+ }
+ if (this.edgeBeingEdited.controlNodes.to.selected == true) {
+ this._editEdge(this.edgeBeingEdited.from.id, newNode.id);
+ this.edgeBeingEdited.controlNodes.to.unselect();
+ }
}
+ else {
+ this.edgeBeingEdited._restoreControlNodes();
+ }
+ this.freezeSimulation = false;
+ this._redraw();
+ };
- /**
- * binds a key sequence to an event
- *
- * @param {string} combo - combo specified in bind call
- * @param {Array} keys
- * @param {Function} callback
- * @param {string=} action
- * @returns void
- */
- function _bindSequence(combo, keys, callback, action) {
+ /**
+ * the function bound to the selection event. It checks if you want to connect a cluster and changes the description
+ * to walk the user through the process.
+ *
+ * @private
+ */
+ exports._handleConnect = function(pointer) {
+ if (this._getSelectedNodeCount() == 0) {
+ var node = this._getNodeAt(pointer);
+ if (node != null) {
+ if (node.clusterSize > 1) {
+ alert("Cannot create edges to a cluster.")
+ }
+ else {
+ this._selectObject(node,false);
+ // create a node the temporary line can look at
+ this.sectors['support']['nodes']['targetNode'] = new Node({id:'targetNode'},{},{},this.constants);
+ this.sectors['support']['nodes']['targetNode'].x = node.x;
+ this.sectors['support']['nodes']['targetNode'].y = node.y;
+ this.sectors['support']['nodes']['targetViaNode'] = new Node({id:'targetViaNode'},{},{},this.constants);
+ this.sectors['support']['nodes']['targetViaNode'].x = node.x;
+ this.sectors['support']['nodes']['targetViaNode'].y = node.y;
+ this.sectors['support']['nodes']['targetViaNode'].parentEdgeId = "connectionEdge";
- // start off by adding a sequence level record for this combination
- // and setting the level to 0
- _sequence_levels[combo] = 0;
+ // create a temporary edge
+ this.edges['connectionEdge'] = new Edge({id:"connectionEdge",from:node.id,to:this.sectors['support']['nodes']['targetNode'].id}, this, this.constants);
+ this.edges['connectionEdge'].from = node;
+ this.edges['connectionEdge'].connected = true;
+ this.edges['connectionEdge'].smooth = true;
+ this.edges['connectionEdge'].selected = true;
+ this.edges['connectionEdge'].to = this.sectors['support']['nodes']['targetNode'];
+ this.edges['connectionEdge'].via = this.sectors['support']['nodes']['targetViaNode'];
- // if there is no action pick the best one for the first key
- // in the sequence
- if (!action) {
- action = _pickBestAction(keys[0], []);
+ this.cachedFunctions["_handleOnDrag"] = this._handleOnDrag;
+ this._handleOnDrag = function(event) {
+ var pointer = this._getPointer(event.gesture.center);
+ this.sectors['support']['nodes']['targetNode'].x = this._XconvertDOMtoCanvas(pointer.x);
+ this.sectors['support']['nodes']['targetNode'].y = this._YconvertDOMtoCanvas(pointer.y);
+ this.sectors['support']['nodes']['targetViaNode'].x = 0.5 * (this._XconvertDOMtoCanvas(pointer.x) + this.edges['connectionEdge'].from.x);
+ this.sectors['support']['nodes']['targetViaNode'].y = this._YconvertDOMtoCanvas(pointer.y);
+ };
+
+ this.moving = true;
+ this.start();
}
+ }
+ }
+ };
- /**
- * callback to increase the sequence level for this sequence and reset
- * all other sequences that were active
- *
- * @param {Event} e
- * @returns void
- */
- var _increaseSequence = function(e) {
- _inside_sequence = action;
- ++_sequence_levels[combo];
- _resetSequenceTimer();
- },
+ exports._finishConnect = function(pointer) {
+ if (this._getSelectedNodeCount() == 1) {
- /**
- * wraps the specified callback inside of another function in order
- * to reset all sequence counters as soon as this sequence is done
- *
- * @param {Event} e
- * @returns void
- */
- _callbackAndReset = function(e) {
- _fireCallback(callback, e);
+ // restore the drag function
+ this._handleOnDrag = this.cachedFunctions["_handleOnDrag"];
+ delete this.cachedFunctions["_handleOnDrag"];
- // we should ignore the next key up if the action is key down
- // or keypress. this is so if you finish a sequence and
- // release the key the final key will not trigger a keyup
- if (action !== 'keyup') {
- _ignore_next_keyup = _characterFromEvent(e);
- }
+ // remember the edge id
+ var connectFromId = this.edges['connectionEdge'].fromId;
- // weird race condition if a sequence ends with the key
- // another sequence begins with
- setTimeout(_resetSequences, 10);
- },
- i;
+ // remove the temporary nodes and edge
+ delete this.edges['connectionEdge'];
+ delete this.sectors['support']['nodes']['targetNode'];
+ delete this.sectors['support']['nodes']['targetViaNode'];
- // loop through keys one at a time and bind the appropriate callback
- // function. for any key leading up to the final one it should
- // increase the sequence. after the final, it should reset all sequences
- for (i = 0; i < keys.length; ++i) {
- _bindSingle(keys[i], i < keys.length - 1 ? _increaseSequence : _callbackAndReset, action, combo, i);
+ var node = this._getNodeAt(pointer);
+ if (node != null) {
+ if (node.clusterSize > 1) {
+ alert("Cannot create edges to a cluster.")
+ }
+ else {
+ this._createEdge(connectFromId,node.id);
+ this._createManipulatorBar();
}
+ }
+ this._unselectAll();
}
+ };
- /**
- * binds a single keyboard combination
- *
- * @param {string} combination
- * @param {Function} callback
- * @param {string=} action
- * @param {string=} sequence_name - name of sequence if part of sequence
- * @param {number=} level - what part of the sequence the command is
- * @returns void
- */
- function _bindSingle(combination, callback, action, sequence_name, level) {
-
- // make sure multiple spaces in a row become a single space
- combination = combination.replace(/\s+/g, ' ');
-
- var sequence = combination.split(' '),
- i,
- key,
- keys,
- modifiers = [];
- // if this pattern is a sequence of keys then run through this method
- // to reprocess each pattern one key at a time
- if (sequence.length > 1) {
- return _bindSequence(combination, sequence, callback, action);
+ /**
+ * Adds a node on the specified location
+ */
+ exports._addNode = function() {
+ if (this._selectionIsEmpty() && this.editMode == true) {
+ var positionObject = this._pointerToPositionObject(this.pointerPosition);
+ var defaultData = {id:util.randomUUID(),x:positionObject.left,y:positionObject.top,label:"new",allowedToMoveX:true,allowedToMoveY:true};
+ if (this.triggerFunctions.add) {
+ if (this.triggerFunctions.add.length == 2) {
+ var me = this;
+ this.triggerFunctions.add(defaultData, function(finalizedData) {
+ me.nodesData.add(finalizedData);
+ me._createManipulatorBar();
+ me.moving = true;
+ me.start();
+ });
+ }
+ else {
+ alert(this.constants.labels['addError']);
+ this._createManipulatorBar();
+ this.moving = true;
+ this.start();
}
+ }
+ else {
+ this.nodesData.add(defaultData);
+ this._createManipulatorBar();
+ this.moving = true;
+ this.start();
+ }
+ }
+ };
- // take the keys from this pattern and figure out what the actual
- // pattern is all about
- keys = combination === '+' ? ['+'] : combination.split('+');
- for (i = 0; i < keys.length; ++i) {
- key = keys[i];
+ /**
+ * connect two nodes with a new edge.
+ *
+ * @private
+ */
+ exports._createEdge = function(sourceNodeId,targetNodeId) {
+ if (this.editMode == true) {
+ var defaultData = {from:sourceNodeId, to:targetNodeId};
+ if (this.triggerFunctions.connect) {
+ if (this.triggerFunctions.connect.length == 2) {
+ var me = this;
+ this.triggerFunctions.connect(defaultData, function(finalizedData) {
+ me.edgesData.add(finalizedData);
+ me.moving = true;
+ me.start();
+ });
+ }
+ else {
+ alert(this.constants.labels["linkError"]);
+ this.moving = true;
+ this.start();
+ }
+ }
+ else {
+ this.edgesData.add(defaultData);
+ this.moving = true;
+ this.start();
+ }
+ }
+ };
- // normalize key names
- if (_SPECIAL_ALIASES[key]) {
- key = _SPECIAL_ALIASES[key];
- }
+ /**
+ * connect two nodes with a new edge.
+ *
+ * @private
+ */
+ exports._editEdge = function(sourceNodeId,targetNodeId) {
+ if (this.editMode == true) {
+ var defaultData = {id: this.edgeBeingEdited.id, from:sourceNodeId, to:targetNodeId};
+ if (this.triggerFunctions.editEdge) {
+ if (this.triggerFunctions.editEdge.length == 2) {
+ var me = this;
+ this.triggerFunctions.editEdge(defaultData, function(finalizedData) {
+ me.edgesData.update(finalizedData);
+ me.moving = true;
+ me.start();
+ });
+ }
+ else {
+ alert(this.constants.labels["linkError"]);
+ this.moving = true;
+ this.start();
+ }
+ }
+ else {
+ this.edgesData.update(defaultData);
+ this.moving = true;
+ this.start();
+ }
+ }
+ };
- // if this is not a keypress event then we should
- // be smart about using shift keys
- // this will only work for US keyboards however
- if (action && action != 'keypress' && _SHIFT_MAP[key]) {
- key = _SHIFT_MAP[key];
- modifiers.push('shift');
- }
+ /**
+ * Create the toolbar to edit the selected node. The label and the color can be changed. Other colors are derived from the chosen color.
+ *
+ * @private
+ */
+ exports._editNode = function() {
+ if (this.triggerFunctions.edit && this.editMode == true) {
+ var node = this._getSelectedNode();
+ var data = {id:node.id,
+ label: node.label,
+ group: node.group,
+ shape: node.shape,
+ color: {
+ background:node.color.background,
+ border:node.color.border,
+ highlight: {
+ background:node.color.highlight.background,
+ border:node.color.highlight.border
+ }
+ }};
+ if (this.triggerFunctions.edit.length == 2) {
+ var me = this;
+ this.triggerFunctions.edit(data, function (finalizedData) {
+ me.nodesData.update(finalizedData);
+ me._createManipulatorBar();
+ me.moving = true;
+ me.start();
+ });
+ }
+ else {
+ alert(this.constants.labels["editError"]);
+ }
+ }
+ else {
+ alert(this.constants.labels["editBoundError"]);
+ }
+ };
- // if this key is a modifier then add it to the list of modifiers
- if (_isModifier(key)) {
- modifiers.push(key);
- }
- }
- // depending on what the key combination is
- // we will try to pick the best event for it
- action = _pickBestAction(key, modifiers, action);
- // make sure to initialize array if this is the first time
- // a callback is added for this key
- if (!_callbacks[key]) {
- _callbacks[key] = [];
+
+ /**
+ * delete everything in the selection
+ *
+ * @private
+ */
+ exports._deleteSelected = function() {
+ if (!this._selectionIsEmpty() && this.editMode == true) {
+ if (!this._clusterInSelection()) {
+ var selectedNodes = this.getSelectedNodes();
+ var selectedEdges = this.getSelectedEdges();
+ if (this.triggerFunctions.del) {
+ var me = this;
+ var data = {nodes: selectedNodes, edges: selectedEdges};
+ if (this.triggerFunctions.del.length = 2) {
+ this.triggerFunctions.del(data, function (finalizedData) {
+ me.edgesData.remove(finalizedData.edges);
+ me.nodesData.remove(finalizedData.nodes);
+ me._unselectAll();
+ me.moving = true;
+ me.start();
+ });
+ }
+ else {
+ alert(this.constants.labels["deleteError"])
+ }
+ }
+ else {
+ this.edgesData.remove(selectedEdges);
+ this.nodesData.remove(selectedNodes);
+ this._unselectAll();
+ this.moving = true;
+ this.start();
}
+ }
+ else {
+ alert(this.constants.labels["deleteClusterError"]);
+ }
+ }
+ };
- // remove an existing match if there is one
- _getMatches(key, modifiers, action, !sequence_name, combination);
- // add this call back to the array
- // if it is a sequence put it at the beginning
- // if not put it at the end
- //
- // this is important because the way these are processed expects
- // the sequence ones to come first
- _callbacks[key][sequence_name ? 'unshift' : 'push']({
- callback: callback,
- modifiers: modifiers,
- action: action,
- seq: sequence_name,
- level: level,
- combo: combination
- });
- }
+/***/ },
+/* 47 */
+/***/ function(module, exports, __webpack_require__) {
- /**
- * binds multiple combinations to the same callback
- *
- * @param {Array} combinations
- * @param {Function} callback
- * @param {string|undefined} action
- * @returns void
- */
- function _bindMultiple(combinations, callback, action) {
- for (var i = 0; i < combinations.length; ++i) {
- _bindSingle(combinations[i], callback, action);
- }
+ exports._cleanNavigation = function() {
+ // clean up previous navigation items
+ var wrapper = document.getElementById('network-navigation_wrapper');
+ if (wrapper != null) {
+ this.containerElement.removeChild(wrapper);
}
+ document.onmouseup = null;
+ };
- // start!
- _addEvent(document, 'keypress', _handleKey);
- _addEvent(document, 'keydown', _handleKey);
- _addEvent(document, 'keyup', _handleKey);
+ /**
+ * Creation of the navigation controls nodes. They are drawn over the rest of the nodes and are not affected by scale and translation
+ * they have a triggerFunction which is called on click. If the position of the navigation controls is dependent
+ * on this.frame.canvas.clientWidth or this.frame.canvas.clientHeight, we flag horizontalAlignLeft and verticalAlignTop false.
+ * This means that the location will be corrected by the _relocateNavigation function on a size change of the canvas.
+ *
+ * @private
+ */
+ exports._loadNavigationElements = function() {
+ this._cleanNavigation();
- var mousetrap = {
+ this.navigationDivs = {};
+ var navigationDivs = ['up','down','left','right','zoomIn','zoomOut','zoomExtends'];
+ var navigationDivActions = ['_moveUp','_moveDown','_moveLeft','_moveRight','_zoomIn','_zoomOut','zoomExtent'];
- /**
- * binds an event to mousetrap
- *
- * can be a single key, a combination of keys separated with +,
- * a comma separated list of keys, an array of keys, or
- * a sequence of keys separated by spaces
- *
- * be sure to list the modifier keys first to make sure that the
- * correct key ends up getting bound (the last key in the pattern)
- *
- * @param {string|Array} keys
- * @param {Function} callback
- * @param {string=} action - 'keypress', 'keydown', or 'keyup'
- * @returns void
- */
- bind: function(keys, callback, action) {
- _bindMultiple(keys instanceof Array ? keys : [keys], callback, action);
- _direct_map[keys + ':' + action] = callback;
- return this;
- },
+ this.navigationDivs['wrapper'] = document.createElement('div');
+ this.navigationDivs['wrapper'].id = "network-navigation_wrapper";
+ this.navigationDivs['wrapper'].style.position = "absolute";
+ this.navigationDivs['wrapper'].style.width = this.frame.canvas.clientWidth + "px";
+ this.navigationDivs['wrapper'].style.height = this.frame.canvas.clientHeight + "px";
+ this.containerElement.insertBefore(this.navigationDivs['wrapper'],this.frame);
- /**
- * unbinds an event to mousetrap
- *
- * the unbinding sets the callback function of the specified key combo
- * to an empty function and deletes the corresponding key in the
- * _direct_map dict.
- *
- * the keycombo+action has to be exactly the same as
- * it was defined in the bind method
- *
- * TODO: actually remove this from the _callbacks dictionary instead
- * of binding an empty function
- *
- * @param {string|Array} keys
- * @param {string} action
- * @returns void
- */
- unbind: function(keys, action) {
- if (_direct_map[keys + ':' + action]) {
- delete _direct_map[keys + ':' + action];
- this.bind(keys, function() {}, action);
- }
- return this;
- },
+ for (var i = 0; i < navigationDivs.length; i++) {
+ this.navigationDivs[navigationDivs[i]] = document.createElement('div');
+ this.navigationDivs[navigationDivs[i]].id = "network-navigation_" + navigationDivs[i];
+ this.navigationDivs[navigationDivs[i]].className = "network-navigation " + navigationDivs[i];
+ this.navigationDivs['wrapper'].appendChild(this.navigationDivs[navigationDivs[i]]);
+ this.navigationDivs[navigationDivs[i]].onmousedown = this[navigationDivActions[i]].bind(this);
+ }
- /**
- * triggers an event that has already been bound
- *
- * @param {string} keys
- * @param {string=} action
- * @returns void
- */
- trigger: function(keys, action) {
- _direct_map[keys + ':' + action]();
- return this;
- },
+ document.onmouseup = this._stopMovement.bind(this);
+ };
- /**
- * resets the library back to its initial state. this is useful
- * if you want to clear out the current keyboard shortcuts and bind
- * new ones - for example if you switch to another page
- *
- * @returns void
- */
- reset: function() {
- _callbacks = {};
- _direct_map = {};
- return this;
- }
- };
+ /**
+ * this stops all movement induced by the navigation buttons
+ *
+ * @private
+ */
+ exports._stopMovement = function() {
+ this._xStopMoving();
+ this._yStopMoving();
+ this._stopZoom();
+ };
- module.exports = mousetrap;
+ /**
+ * stops the actions performed by page up and down etc.
+ *
+ * @param event
+ * @private
+ */
+ exports._preventDefault = function(event) {
+ if (event !== undefined) {
+ if (event.preventDefault) {
+ event.preventDefault();
+ } else {
+ event.returnValue = false;
+ }
+ }
+ };
-/***/ },
-/* 49 */
-/***/ function(module, exports, __webpack_require__) {
+ /**
+ * move the screen up
+ * By using the increments, instead of adding a fixed number to the translation, we keep fluent and
+ * instant movement. The onKeypress event triggers immediately, then pauses, then triggers frequently
+ * To avoid this behaviour, we do the translation in the start loop.
+ *
+ * @private
+ */
+ exports._moveUp = function(event) {
+ this.yIncrement = this.constants.keyboard.speed.y;
+ this.start(); // if there is no node movement, the calculation wont be done
+ this._preventDefault(event);
+ if (this.navigationDivs) {
+ this.navigationDivs['up'].className += " active";
+ }
+ };
- var util = __webpack_require__(1);
- var RepulsionMixin = __webpack_require__(52);
- var HierarchialRepulsionMixin = __webpack_require__(53);
- var BarnesHutMixin = __webpack_require__(54);
/**
- * Toggling barnes Hut calculation on and off.
- *
+ * move the screen down
* @private
*/
- exports._toggleBarnesHut = function () {
- this.constants.physics.barnesHut.enabled = !this.constants.physics.barnesHut.enabled;
- this._loadSelectedForceSolver();
- this.moving = true;
- this.start();
+ exports._moveDown = function(event) {
+ this.yIncrement = -this.constants.keyboard.speed.y;
+ this.start(); // if there is no node movement, the calculation wont be done
+ this._preventDefault(event);
+ if (this.navigationDivs) {
+ this.navigationDivs['down'].className += " active";
+ }
};
/**
- * This loads the node force solver based on the barnes hut or repulsion algorithm
- *
+ * move the screen left
* @private
*/
- exports._loadSelectedForceSolver = function () {
- // this overloads the this._calculateNodeForces
- if (this.constants.physics.barnesHut.enabled == true) {
- this._clearMixin(RepulsionMixin);
- this._clearMixin(HierarchialRepulsionMixin);
-
- this.constants.physics.centralGravity = this.constants.physics.barnesHut.centralGravity;
- this.constants.physics.springLength = this.constants.physics.barnesHut.springLength;
- this.constants.physics.springConstant = this.constants.physics.barnesHut.springConstant;
- this.constants.physics.damping = this.constants.physics.barnesHut.damping;
-
- this._loadMixin(BarnesHutMixin);
+ exports._moveLeft = function(event) {
+ this.xIncrement = this.constants.keyboard.speed.x;
+ this.start(); // if there is no node movement, the calculation wont be done
+ this._preventDefault(event);
+ if (this.navigationDivs) {
+ this.navigationDivs['left'].className += " active";
}
- else if (this.constants.physics.hierarchicalRepulsion.enabled == true) {
- this._clearMixin(BarnesHutMixin);
- this._clearMixin(RepulsionMixin);
+ };
- this.constants.physics.centralGravity = this.constants.physics.hierarchicalRepulsion.centralGravity;
- this.constants.physics.springLength = this.constants.physics.hierarchicalRepulsion.springLength;
- this.constants.physics.springConstant = this.constants.physics.hierarchicalRepulsion.springConstant;
- this.constants.physics.damping = this.constants.physics.hierarchicalRepulsion.damping;
- this._loadMixin(HierarchialRepulsionMixin);
+ /**
+ * move the screen right
+ * @private
+ */
+ exports._moveRight = function(event) {
+ this.xIncrement = -this.constants.keyboard.speed.y;
+ this.start(); // if there is no node movement, the calculation wont be done
+ this._preventDefault(event);
+ if (this.navigationDivs) {
+ this.navigationDivs['right'].className += " active";
}
- else {
- this._clearMixin(BarnesHutMixin);
- this._clearMixin(HierarchialRepulsionMixin);
- this.barnesHutTree = undefined;
+ };
- this.constants.physics.centralGravity = this.constants.physics.repulsion.centralGravity;
- this.constants.physics.springLength = this.constants.physics.repulsion.springLength;
- this.constants.physics.springConstant = this.constants.physics.repulsion.springConstant;
- this.constants.physics.damping = this.constants.physics.repulsion.damping;
- this._loadMixin(RepulsionMixin);
+ /**
+ * Zoom in, using the same method as the movement.
+ * @private
+ */
+ exports._zoomIn = function(event) {
+ this.zoomIncrement = this.constants.keyboard.speed.zoom;
+ this.start(); // if there is no node movement, the calculation wont be done
+ this._preventDefault(event);
+ if (this.navigationDivs) {
+ this.navigationDivs['zoomIn'].className += " active";
}
};
+
/**
- * Before calculating the forces, we check if we need to cluster to keep up performance and we check
- * if there is more than one node. If it is just one node, we dont calculate anything.
- *
+ * Zoom out
* @private
*/
- exports._initializeForceCalculation = function () {
- // stop calculation if there is only one node
- if (this.nodeIndices.length == 1) {
- this.nodes[this.nodeIndices[0]]._setForce(0, 0);
- }
- else {
- // if there are too many nodes on screen, we cluster without repositioning
- if (this.nodeIndices.length > this.constants.clustering.clusterThreshold && this.constants.clustering.enabled == true) {
- this.clusterToFit(this.constants.clustering.reduceToNodes, false);
- }
-
- // we now start the force calculation
- this._calculateForces();
+ exports._zoomOut = function() {
+ this.zoomIncrement = -this.constants.keyboard.speed.zoom;
+ this.start(); // if there is no node movement, the calculation wont be done
+ this._preventDefault(event);
+ if (this.navigationDivs) {
+ this.navigationDivs['zoomOut'].className += " active";
}
};
/**
- * Calculate the external forces acting on the nodes
- * Forces are caused by: edges, repulsing forces between nodes, gravity
+ * Stop zooming and unhighlight the zoom controls
* @private
*/
- exports._calculateForces = function () {
- // Gravity is required to keep separated groups from floating off
- // the forces are reset to zero in this loop by using _setForce instead
- // of _addForce
-
- this._calculateGravitationalForces();
- this._calculateNodeForces();
-
- if (this.constants.springConstant > 0) {
- if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
- this._calculateSpringForcesWithSupport();
- }
- else {
- if (this.constants.physics.hierarchicalRepulsion.enabled == true) {
- this._calculateHierarchicalSpringForces();
- }
- else {
- this._calculateSpringForces();
- }
- }
+ exports._stopZoom = function() {
+ this.zoomIncrement = 0;
+ if (this.navigationDivs) {
+ this.navigationDivs['zoomIn'].className = this.navigationDivs['zoomIn'].className.replace(" active","");
+ this.navigationDivs['zoomOut'].className = this.navigationDivs['zoomOut'].className.replace(" active","");
}
};
/**
- * Smooth curves are created by adding invisible nodes in the center of the edges. These nodes are also
- * handled in the calculateForces function. We then use a quadratic curve with the center node as control.
- * This function joins the datanodes and invisible (called support) nodes into one object.
- * We do this so we do not contaminate this.nodes with the support nodes.
- *
+ * Stop moving in the Y direction and unHighlight the up and down
* @private
*/
- exports._updateCalculationNodes = function () {
- if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
- this.calculationNodes = {};
- this.calculationNodeIndices = [];
-
- for (var nodeId in this.nodes) {
- if (this.nodes.hasOwnProperty(nodeId)) {
- this.calculationNodes[nodeId] = this.nodes[nodeId];
- }
- }
- var supportNodes = this.sectors['support']['nodes'];
- for (var supportNodeId in supportNodes) {
- if (supportNodes.hasOwnProperty(supportNodeId)) {
- if (this.edges.hasOwnProperty(supportNodes[supportNodeId].parentEdgeId)) {
- this.calculationNodes[supportNodeId] = supportNodes[supportNodeId];
- }
- else {
- supportNodes[supportNodeId]._setForce(0, 0);
- }
- }
- }
-
- for (var idx in this.calculationNodes) {
- if (this.calculationNodes.hasOwnProperty(idx)) {
- this.calculationNodeIndices.push(idx);
- }
- }
- }
- else {
- this.calculationNodes = this.nodes;
- this.calculationNodeIndices = this.nodeIndices;
+ exports._yStopMoving = function() {
+ this.yIncrement = 0;
+ if (this.navigationDivs) {
+ this.navigationDivs['up'].className = this.navigationDivs['up'].className.replace(" active","");
+ this.navigationDivs['down'].className = this.navigationDivs['down'].className.replace(" active","");
}
};
/**
- * this function applies the central gravity effect to keep groups from floating off
- *
+ * Stop moving in the X direction and unHighlight left and right.
* @private
*/
- exports._calculateGravitationalForces = function () {
- var dx, dy, distance, node, i;
- var nodes = this.calculationNodes;
- var gravity = this.constants.physics.centralGravity;
- var gravityForce = 0;
-
- for (i = 0; i < this.calculationNodeIndices.length; i++) {
- node = nodes[this.calculationNodeIndices[i]];
- node.damping = this.constants.physics.damping; // possibly add function to alter damping properties of clusters.
- // gravity does not apply when we are in a pocket sector
- if (this._sector() == "default" && gravity != 0) {
- dx = -node.x;
- dy = -node.y;
- distance = Math.sqrt(dx * dx + dy * dy);
-
- gravityForce = (distance == 0) ? 0 : (gravity / distance);
- node.fx = dx * gravityForce;
- node.fy = dy * gravityForce;
- }
- else {
- node.fx = 0;
- node.fy = 0;
- }
+ exports._xStopMoving = function() {
+ this.xIncrement = 0;
+ if (this.navigationDivs) {
+ this.navigationDivs['left'].className = this.navigationDivs['left'].className.replace(" active","");
+ this.navigationDivs['right'].className = this.navigationDivs['right'].className.replace(" active","");
}
};
+/***/ },
+/* 48 */
+/***/ function(module, exports, __webpack_require__) {
+ exports._resetLevels = function() {
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ var node = this.nodes[nodeId];
+ if (node.preassignedLevel == false) {
+ node.level = -1;
+ }
+ }
+ }
+ };
/**
- * this function calculates the effects of the springs in the case of unsmooth curves.
+ * This is the main function to layout the nodes in a hierarchical way.
+ * It checks if the node details are supplied correctly
*
* @private
*/
- exports._calculateSpringForces = function () {
- var edgeLength, edge, edgeId;
- var dx, dy, fx, fy, springForce, distance;
- var edges = this.edges;
+ exports._setupHierarchicalLayout = function() {
+ if (this.constants.hierarchicalLayout.enabled == true && this.nodeIndices.length > 0) {
+ if (this.constants.hierarchicalLayout.direction == "RL" || this.constants.hierarchicalLayout.direction == "DU") {
+ this.constants.hierarchicalLayout.levelSeparation *= -1;
+ }
+ else {
+ this.constants.hierarchicalLayout.levelSeparation = Math.abs(this.constants.hierarchicalLayout.levelSeparation);
+ }
- // forces caused by the edges, modelled as springs
- for (edgeId in edges) {
- if (edges.hasOwnProperty(edgeId)) {
- edge = edges[edgeId];
- if (edge.connected) {
- // only calculate forces if nodes are in the same sector
- if (this.nodes.hasOwnProperty(edge.toId) && this.nodes.hasOwnProperty(edge.fromId)) {
- edgeLength = edge.customLength ? edge.length : this.constants.physics.springLength;
- // this implies that the edges between big clusters are longer
- edgeLength += (edge.to.clusterSize + edge.from.clusterSize - 2) * this.constants.clustering.edgeGrowth;
+ if (this.constants.hierarchicalLayout.direction == "RL" || this.constants.hierarchicalLayout.direction == "LR") {
+ if (this.constants.smoothCurves.enabled == true) {
+ this.constants.smoothCurves.type = "vertical";
+ }
+ }
+ else {
+ if (this.constants.smoothCurves.enabled == true) {
+ this.constants.smoothCurves.type = "horizontal";
+ }
+ }
+ // get the size of the largest hubs and check if the user has defined a level for a node.
+ var hubsize = 0;
+ var node, nodeId;
+ var definedLevel = false;
+ var undefinedLevel = false;
- dx = (edge.from.x - edge.to.x);
- dy = (edge.from.y - edge.to.y);
- distance = Math.sqrt(dx * dx + dy * dy);
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ node = this.nodes[nodeId];
+ if (node.level != -1) {
+ definedLevel = true;
+ }
+ else {
+ undefinedLevel = true;
+ }
+ if (hubsize < node.edges.length) {
+ hubsize = node.edges.length;
+ }
+ }
+ }
- if (distance == 0) {
- distance = 0.01;
- }
+ // if the user defined some levels but not all, alert and run without hierarchical layout
+ if (undefinedLevel == true && definedLevel == true) {
+ alert("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");
+ this.zoomExtent(true,this.constants.clustering.enabled);
+ if (!this.constants.clustering.enabled) {
+ this.start();
+ }
+ }
+ else {
+ // setup the system to use hierarchical method.
+ this._changeConstants();
- // the 1/distance is so the fx and fy can be calculated without sine or cosine.
- springForce = this.constants.physics.springConstant * (edgeLength - distance) / distance;
+ // define levels if undefined by the users. Based on hubsize
+ if (undefinedLevel == true) {
+ this._determineLevels(hubsize);
+ }
+ // check the distribution of the nodes per level.
+ var distribution = this._getDistribution();
- fx = dx * springForce;
- fy = dy * springForce;
+ // place the nodes on the canvas. This also stablilizes the system.
+ this._placeNodesByHierarchy(distribution);
- edge.from.fx += fx;
- edge.from.fy += fy;
- edge.to.fx -= fx;
- edge.to.fy -= fy;
- }
- }
+ // start the simulation.
+ this.start();
}
}
};
-
-
/**
- * This function calculates the springforces on the nodes, accounting for the support nodes.
+ * This function places the nodes on the canvas based on the hierarchial distribution.
*
+ * @param {Object} distribution | obtained by the function this._getDistribution()
* @private
*/
- exports._calculateSpringForcesWithSupport = function () {
- var edgeLength, edge, edgeId, combinedClusterSize;
- var edges = this.edges;
-
- // forces caused by the edges, modelled as springs
- for (edgeId in edges) {
- if (edges.hasOwnProperty(edgeId)) {
- edge = edges[edgeId];
- if (edge.connected) {
- // only calculate forces if nodes are in the same sector
- if (this.nodes.hasOwnProperty(edge.toId) && this.nodes.hasOwnProperty(edge.fromId)) {
- if (edge.via != null) {
- var node1 = edge.to;
- var node2 = edge.via;
- var node3 = edge.from;
+ exports._placeNodesByHierarchy = function(distribution) {
+ var nodeId, node;
- edgeLength = edge.customLength ? edge.length : this.constants.physics.springLength;
+ // start placing all the level 0 nodes first. Then recursively position their branches.
+ for (nodeId in distribution[0].nodes) {
+ if (distribution[0].nodes.hasOwnProperty(nodeId)) {
+ node = distribution[0].nodes[nodeId];
+ if (this.constants.hierarchicalLayout.direction == "UD" || this.constants.hierarchicalLayout.direction == "DU") {
+ if (node.xFixed) {
+ node.x = distribution[0].minPos;
+ node.xFixed = false;
- combinedClusterSize = node1.clusterSize + node3.clusterSize - 2;
+ distribution[0].minPos += distribution[0].nodeSpacing;
+ }
+ }
+ else {
+ if (node.yFixed) {
+ node.y = distribution[0].minPos;
+ node.yFixed = false;
- // this implies that the edges between big clusters are longer
- edgeLength += combinedClusterSize * this.constants.clustering.edgeGrowth;
- this._calculateSpringForce(node1, node2, 0.5 * edgeLength);
- this._calculateSpringForce(node2, node3, 0.5 * edgeLength);
- }
+ distribution[0].minPos += distribution[0].nodeSpacing;
}
}
+ this._placeBranchNodes(node.edges,node.id,distribution,node.level);
}
}
+
+ // stabilize the system after positioning. This function calls zoomExtent.
+ this._stabilize();
};
/**
- * This is the code actually performing the calculation for the function above. It is split out to avoid repetition.
+ * This function get the distribution of levels based on hubsize
*
- * @param node1
- * @param node2
- * @param edgeLength
+ * @returns {Object}
* @private
*/
- exports._calculateSpringForce = function (node1, node2, edgeLength) {
- var dx, dy, fx, fy, springForce, distance;
-
- dx = (node1.x - node2.x);
- dy = (node1.y - node2.y);
- distance = Math.sqrt(dx * dx + dy * dy);
+ exports._getDistribution = function() {
+ var distribution = {};
+ var nodeId, node, level;
- if (distance == 0) {
- distance = 0.01;
+ // we fix Y because the hierarchy is vertical, we fix X so we do not give a node an x position for a second time.
+ // the fix of X is removed after the x value has been set.
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ node = this.nodes[nodeId];
+ node.xFixed = true;
+ node.yFixed = true;
+ if (this.constants.hierarchicalLayout.direction == "UD" || this.constants.hierarchicalLayout.direction == "DU") {
+ node.y = this.constants.hierarchicalLayout.levelSeparation*node.level;
+ }
+ else {
+ node.x = this.constants.hierarchicalLayout.levelSeparation*node.level;
+ }
+ if (!distribution.hasOwnProperty(node.level)) {
+ distribution[node.level] = {amount: 0, nodes: {}, minPos:0, nodeSpacing:0};
+ }
+ distribution[node.level].amount += 1;
+ distribution[node.level].nodes[node.id] = node;
+ }
}
- // the 1/distance is so the fx and fy can be calculated without sine or cosine.
- springForce = this.constants.physics.springConstant * (edgeLength - distance) / distance;
-
- fx = dx * springForce;
- fy = dy * springForce;
-
- node1.fx += fx;
- node1.fy += fy;
- node2.fx -= fx;
- node2.fy -= fy;
- };
-
-
- /**
- * Load the HTML for the physics config and bind it
- * @private
- */
- exports._loadPhysicsConfiguration = function () {
- if (this.physicsConfiguration === undefined) {
- this.backupConstants = {};
- util.deepExtend(this.backupConstants,this.constants);
-
- var hierarchicalLayoutDirections = ["LR", "RL", "UD", "DU"];
- this.physicsConfiguration = document.createElement('div');
- this.physicsConfiguration.className = "PhysicsConfiguration";
- this.physicsConfiguration.innerHTML = '' +
- '
Simulation Mode:
' +
- '
' +
- '
Barnes Hut
' +
- '
Repulsion
' +
- '
Hierarchical
' +
- '
' +
- '
' +
- '
' +
- '
Barnes Hut
' +
- '
' +
- '
gravitationalConstant
0
-20000
' +
- '
' +
- '
' +
- '
centralGravity
0
3
' +
- '
' +
- '
' +
- '
springLength
0
500
' +
- '
' +
- '
' +
- '
springConstant
0
0.5
' +
- '
' +
- '
' +
- '
damping
0
0.3
' +
- '
' +
- '
' +
- '
' +
- '
Repulsion
' +
- '
' +
- '
nodeDistance
0
300
' +
- '
' +
- '
' +
- '
centralGravity
0
3
' +
- '
' +
- '
' +
- '
springLength
0
500
' +
- '
' +
- '
' +
- '
springConstant
0
0.5
' +
- '
' +
- '
' +
- '
damping
0
0.3
' +
- '
' +
- '
' +
- '
' +
- '
Hierarchical
' +
- '
' +
- '
nodeDistance
0
300
' +
- '
' +
- '
' +
- '
centralGravity
0
3
' +
- '
' +
- '
' +
- '
springLength
0
500
' +
- '
' +
- '
' +
- '
springConstant
0
0.5
' +
- '
' +
- '
' +
- '
damping
0
0.3
' +
- '
' +
- '
' +
- '
direction
1
4
' +
- '
' +
- '
' +
- '
levelSeparation
1
500
' +
- '
' +
- '
' +
- '
nodeSpacing
1
500
' +
- '
' +
- '
' +
- '
Options:
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
' +
- '
'
- this.containerElement.parentElement.insertBefore(this.physicsConfiguration, this.containerElement);
- this.optionsDiv = document.createElement("div");
- this.optionsDiv.style.fontSize = "14px";
- this.optionsDiv.style.fontFamily = "verdana";
- this.containerElement.parentElement.insertBefore(this.optionsDiv, this.containerElement);
+ // determine the largest amount of nodes of all levels
+ var maxCount = 0;
+ for (level in distribution) {
+ if (distribution.hasOwnProperty(level)) {
+ if (maxCount < distribution[level].amount) {
+ maxCount = distribution[level].amount;
+ }
+ }
+ }
- var rangeElement;
- rangeElement = document.getElementById('graph_BH_gc');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_gc', -1, "physics_barnesHut_gravitationalConstant");
- rangeElement = document.getElementById('graph_BH_cg');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_cg', 1, "physics_centralGravity");
- rangeElement = document.getElementById('graph_BH_sc');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_sc', 1, "physics_springConstant");
- rangeElement = document.getElementById('graph_BH_sl');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_sl', 1, "physics_springLength");
- rangeElement = document.getElementById('graph_BH_damp');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_damp', 1, "physics_damping");
+ // set the initial position and spacing of each nodes accordingly
+ for (level in distribution) {
+ if (distribution.hasOwnProperty(level)) {
+ distribution[level].nodeSpacing = (maxCount + 1) * this.constants.hierarchicalLayout.nodeSpacing;
+ distribution[level].nodeSpacing /= (distribution[level].amount + 1);
+ distribution[level].minPos = distribution[level].nodeSpacing - (0.5 * (distribution[level].amount + 1) * distribution[level].nodeSpacing);
+ }
+ }
- rangeElement = document.getElementById('graph_R_nd');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_nd', 1, "physics_repulsion_nodeDistance");
- rangeElement = document.getElementById('graph_R_cg');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_cg', 1, "physics_centralGravity");
- rangeElement = document.getElementById('graph_R_sc');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_sc', 1, "physics_springConstant");
- rangeElement = document.getElementById('graph_R_sl');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_sl', 1, "physics_springLength");
- rangeElement = document.getElementById('graph_R_damp');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_damp', 1, "physics_damping");
+ return distribution;
+ };
- rangeElement = document.getElementById('graph_H_nd');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_nd', 1, "physics_hierarchicalRepulsion_nodeDistance");
- rangeElement = document.getElementById('graph_H_cg');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_cg', 1, "physics_centralGravity");
- rangeElement = document.getElementById('graph_H_sc');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_sc', 1, "physics_springConstant");
- rangeElement = document.getElementById('graph_H_sl');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_sl', 1, "physics_springLength");
- rangeElement = document.getElementById('graph_H_damp');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_damp', 1, "physics_damping");
- rangeElement = document.getElementById('graph_H_direction');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_direction', hierarchicalLayoutDirections, "hierarchicalLayout_direction");
- rangeElement = document.getElementById('graph_H_levsep');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_levsep', 1, "hierarchicalLayout_levelSeparation");
- rangeElement = document.getElementById('graph_H_nspac');
- rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_nspac', 1, "hierarchicalLayout_nodeSpacing");
- var radioButton1 = document.getElementById("graph_physicsMethod1");
- var radioButton2 = document.getElementById("graph_physicsMethod2");
- var radioButton3 = document.getElementById("graph_physicsMethod3");
- radioButton2.checked = true;
- if (this.constants.physics.barnesHut.enabled) {
- radioButton1.checked = true;
+ /**
+ * this function allocates nodes in levels based on the recursive branching from the largest hubs.
+ *
+ * @param hubsize
+ * @private
+ */
+ exports._determineLevels = function(hubsize) {
+ var nodeId, node;
+
+ // determine hubs
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ node = this.nodes[nodeId];
+ if (node.edges.length == hubsize) {
+ node.level = 0;
+ }
}
- if (this.constants.hierarchicalLayout.enabled) {
- radioButton3.checked = true;
+ }
+
+ // branch from hubs
+ for (nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ node = this.nodes[nodeId];
+ if (node.level == 0) {
+ this._setLevel(1,node.edges,node.id);
+ }
}
+ }
+ };
- var graph_toggleSmooth = document.getElementById("graph_toggleSmooth");
- var graph_repositionNodes = document.getElementById("graph_repositionNodes");
- var graph_generateOptions = document.getElementById("graph_generateOptions");
- graph_toggleSmooth.onclick = graphToggleSmoothCurves.bind(this);
- graph_repositionNodes.onclick = graphRepositionNodes.bind(this);
- graph_generateOptions.onclick = graphGenerateOptions.bind(this);
- if (this.constants.smoothCurves == true && this.constants.dynamicSmoothCurves == false) {
- graph_toggleSmooth.style.background = "#A4FF56";
+ /**
+ * Since hierarchical layout does not support:
+ * - smooth curves (based on the physics),
+ * - clustering (based on dynamic node counts)
+ *
+ * We disable both features so there will be no problems.
+ *
+ * @private
+ */
+ exports._changeConstants = function() {
+ this.constants.clustering.enabled = false;
+ this.constants.physics.barnesHut.enabled = false;
+ this.constants.physics.hierarchicalRepulsion.enabled = true;
+ this._loadSelectedForceSolver();
+ if (this.constants.smoothCurves.enabled == true) {
+ this.constants.smoothCurves.dynamic = false;
+ }
+ this._configureSmoothCurves();
+ };
+
+
+ /**
+ * This is a recursively called function to enumerate the branches from the largest hubs and place the nodes
+ * on a X position that ensures there will be no overlap.
+ *
+ * @param edges
+ * @param parentId
+ * @param distribution
+ * @param parentLevel
+ * @private
+ */
+ exports._placeBranchNodes = function(edges, parentId, distribution, parentLevel) {
+ for (var i = 0; i < edges.length; i++) {
+ var childNode = null;
+ if (edges[i].toId == parentId) {
+ childNode = edges[i].from;
}
else {
- graph_toggleSmooth.style.background = "#FF8532";
+ childNode = edges[i].to;
}
+ // if a node is conneceted to another node on the same level (or higher (means lower level))!, this is not handled here.
+ var nodeMoved = false;
+ if (this.constants.hierarchicalLayout.direction == "UD" || this.constants.hierarchicalLayout.direction == "DU") {
+ if (childNode.xFixed && childNode.level > parentLevel) {
+ childNode.xFixed = false;
+ childNode.x = distribution[childNode.level].minPos;
+ nodeMoved = true;
+ }
+ }
+ else {
+ if (childNode.yFixed && childNode.level > parentLevel) {
+ childNode.yFixed = false;
+ childNode.y = distribution[childNode.level].minPos;
+ nodeMoved = true;
+ }
+ }
- switchConfigurations.apply(this);
-
- radioButton1.onchange = switchConfigurations.bind(this);
- radioButton2.onchange = switchConfigurations.bind(this);
- radioButton3.onchange = switchConfigurations.bind(this);
+ if (nodeMoved == true) {
+ distribution[childNode.level].minPos += distribution[childNode.level].nodeSpacing;
+ if (childNode.edges.length > 1) {
+ this._placeBranchNodes(childNode.edges,childNode.id,distribution,childNode.level);
+ }
+ }
}
};
+
/**
- * This overwrites the this.constants.
+ * this function is called recursively to enumerate the barnches of the largest hubs and give each node a level.
*
- * @param constantsVariableName
- * @param value
+ * @param level
+ * @param edges
+ * @param parentId
* @private
*/
- exports._overWriteGraphConstants = function (constantsVariableName, value) {
- var nameArray = constantsVariableName.split("_");
- if (nameArray.length == 1) {
- this.constants[nameArray[0]] = value;
- }
- else if (nameArray.length == 2) {
- this.constants[nameArray[0]][nameArray[1]] = value;
+ exports._setLevel = function(level, edges, parentId) {
+ for (var i = 0; i < edges.length; i++) {
+ var childNode = null;
+ if (edges[i].toId == parentId) {
+ childNode = edges[i].from;
+ }
+ else {
+ childNode = edges[i].to;
+ }
+ if (childNode.level == -1 || childNode.level > level) {
+ childNode.level = level;
+ if (edges.length > 1) {
+ this._setLevel(level+1, childNode.edges, childNode.id);
+ }
+ }
}
- else if (nameArray.length == 3) {
- this.constants[nameArray[0]][nameArray[1]][nameArray[2]] = value;
+ };
+
+
+ /**
+ * Unfix nodes
+ *
+ * @private
+ */
+ exports._restoreNodes = function() {
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ this.nodes[nodeId].xFixed = false;
+ this.nodes[nodeId].yFixed = false;
+ }
}
};
- /**
- * this function is bound to the toggle smooth curves button. That is also why it is not in the prototype.
- */
- function graphToggleSmoothCurves () {
- this.constants.smoothCurves.enabled = !this.constants.smoothCurves.enabled;
- var graph_toggleSmooth = document.getElementById("graph_toggleSmooth");
- if (this.constants.smoothCurves.enabled == true) {graph_toggleSmooth.style.background = "#A4FF56";}
- else {graph_toggleSmooth.style.background = "#FF8532";}
+/***/ },
+/* 49 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /*! Hammer.JS - v1.0.5 - 2013-04-07
+ * http://eightmedia.github.com/hammer.js
+ *
+ * Copyright (c) 2013 Jorik Tangelder ;
+ * Licensed under the MIT license */
+
+ (function(window, undefined) {
+ 'use strict';
+
+ /**
+ * Hammer
+ * use this to create instances
+ * @param {HTMLElement} element
+ * @param {Object} options
+ * @returns {Hammer.Instance}
+ * @constructor
+ */
+ var Hammer = function(element, options) {
+ return new Hammer.Instance(element, options || {});
+ };
+
+ // default settings
+ Hammer.defaults = {
+ // add styles and attributes to the element to prevent the browser from doing
+ // its native behavior. this doesnt prevent the scrolling, but cancels
+ // the contextmenu, tap highlighting etc
+ // set to false to disable this
+ stop_browser_behavior: {
+ // this also triggers onselectstart=false for IE
+ userSelect: 'none',
+ // this makes the element blocking in IE10 >, you could experiment with the value
+ // see for more options this issue; https://github.com/EightMedia/hammer.js/issues/241
+ touchAction: 'none',
+ touchCallout: 'none',
+ contentZooming: 'none',
+ userDrag: 'none',
+ tapHighlightColor: 'rgba(0,0,0,0)'
+ }
+
+ // more settings are defined per gesture at gestures.js
+ };
+
+ // detect touchevents
+ Hammer.HAS_POINTEREVENTS = navigator.pointerEnabled || navigator.msPointerEnabled;
+ Hammer.HAS_TOUCHEVENTS = ('ontouchstart' in window);
+
+ // dont use mouseevents on mobile devices
+ Hammer.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
+ Hammer.NO_MOUSEEVENTS = Hammer.HAS_TOUCHEVENTS && navigator.userAgent.match(Hammer.MOBILE_REGEX);
+
+ // eventtypes per touchevent (start, move, end)
+ // are filled by Hammer.event.determineEventTypes on setup
+ Hammer.EVENT_TYPES = {};
+
+ // direction defines
+ Hammer.DIRECTION_DOWN = 'down';
+ Hammer.DIRECTION_LEFT = 'left';
+ Hammer.DIRECTION_UP = 'up';
+ Hammer.DIRECTION_RIGHT = 'right';
+
+ // pointer type
+ Hammer.POINTER_MOUSE = 'mouse';
+ Hammer.POINTER_TOUCH = 'touch';
+ Hammer.POINTER_PEN = 'pen';
+
+ // touch event defines
+ Hammer.EVENT_START = 'start';
+ Hammer.EVENT_MOVE = 'move';
+ Hammer.EVENT_END = 'end';
+
+ // hammer document where the base events are added at
+ Hammer.DOCUMENT = document;
+
+ // plugins namespace
+ Hammer.plugins = {};
- this._configureSmoothCurves(false);
- }
+ // if the window events are set...
+ Hammer.READY = false;
/**
- * this function is used to scramble the nodes
- *
+ * setup events to detect gestures on the document
*/
- function graphRepositionNodes () {
- for (var nodeId in this.calculationNodes) {
- if (this.calculationNodes.hasOwnProperty(nodeId)) {
- this.calculationNodes[nodeId].vx = 0; this.calculationNodes[nodeId].vy = 0;
- this.calculationNodes[nodeId].fx = 0; this.calculationNodes[nodeId].fy = 0;
+ function setup() {
+ if(Hammer.READY) {
+ return;
}
- }
- if (this.constants.hierarchicalLayout.enabled == true) {
- this._setupHierarchicalLayout();
- }
- else {
- this.repositionNodes();
- }
- this.moving = true;
- this.start();
+
+ // find what eventtypes we add listeners to
+ Hammer.event.determineEventTypes();
+
+ // Register all gestures inside Hammer.gestures
+ for(var name in Hammer.gestures) {
+ if(Hammer.gestures.hasOwnProperty(name)) {
+ Hammer.detection.register(Hammer.gestures[name]);
+ }
+ }
+
+ // Add touch events on the document
+ Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);
+ Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);
+
+ // Hammer is ready...!
+ Hammer.READY = true;
}
/**
- * this is used to generate an options file from the playing with physics system.
+ * create new hammer instance
+ * all methods should return the instance itself, so it is chainable.
+ * @param {HTMLElement} element
+ * @param {Object} [options={}]
+ * @returns {Hammer.Instance}
+ * @constructor
*/
- function graphGenerateOptions () {
- var options = "No options are required, default values used.";
- var optionsSpecific = [];
- var radioButton1 = document.getElementById("graph_physicsMethod1");
- var radioButton2 = document.getElementById("graph_physicsMethod2");
- if (radioButton1.checked == true) {
- if (this.constants.physics.barnesHut.gravitationalConstant != this.backupConstants.physics.barnesHut.gravitationalConstant) {optionsSpecific.push("gravitationalConstant: " + this.constants.physics.barnesHut.gravitationalConstant);}
- if (this.constants.physics.centralGravity != this.backupConstants.physics.barnesHut.centralGravity) {optionsSpecific.push("centralGravity: " + this.constants.physics.centralGravity);}
- if (this.constants.physics.springLength != this.backupConstants.physics.barnesHut.springLength) {optionsSpecific.push("springLength: " + this.constants.physics.springLength);}
- if (this.constants.physics.springConstant != this.backupConstants.physics.barnesHut.springConstant) {optionsSpecific.push("springConstant: " + this.constants.physics.springConstant);}
- if (this.constants.physics.damping != this.backupConstants.physics.barnesHut.damping) {optionsSpecific.push("damping: " + this.constants.physics.damping);}
- if (optionsSpecific.length != 0) {
- options = "var options = {";
- options += "physics: {barnesHut: {";
- for (var i = 0; i < optionsSpecific.length; i++) {
- options += optionsSpecific[i];
- if (i < optionsSpecific.length - 1) {
- options += ", "
- }
- }
- options += '}}'
- }
- if (this.constants.smoothCurves.enabled != this.backupConstants.smoothCurves.enabled) {
- if (optionsSpecific.length == 0) {options = "var options = {";}
- else {options += ", "}
- options += "smoothCurves: " + this.constants.smoothCurves.enabled;
- }
- if (options != "No options are required, default values used.") {
- options += '};'
+ Hammer.Instance = function(element, options) {
+ var self = this;
+
+ // setup HammerJS window events and register all gestures
+ // this also sets up the default options
+ setup();
+
+ this.element = element;
+
+ // start/stop detection option
+ this.enabled = true;
+
+ // merge options
+ this.options = Hammer.utils.extend(
+ Hammer.utils.extend({}, Hammer.defaults),
+ options || {});
+
+ // add some css to the element to prevent the browser from doing its native behavoir
+ if(this.options.stop_browser_behavior) {
+ Hammer.utils.stopDefaultBrowserBehavior(this.element, this.options.stop_browser_behavior);
}
- }
- else if (radioButton2.checked == true) {
- options = "var options = {";
- options += "physics: {barnesHut: {enabled: false}";
- if (this.constants.physics.repulsion.nodeDistance != this.backupConstants.physics.repulsion.nodeDistance) {optionsSpecific.push("nodeDistance: " + this.constants.physics.repulsion.nodeDistance);}
- if (this.constants.physics.centralGravity != this.backupConstants.physics.repulsion.centralGravity) {optionsSpecific.push("centralGravity: " + this.constants.physics.centralGravity);}
- if (this.constants.physics.springLength != this.backupConstants.physics.repulsion.springLength) {optionsSpecific.push("springLength: " + this.constants.physics.springLength);}
- if (this.constants.physics.springConstant != this.backupConstants.physics.repulsion.springConstant) {optionsSpecific.push("springConstant: " + this.constants.physics.springConstant);}
- if (this.constants.physics.damping != this.backupConstants.physics.repulsion.damping) {optionsSpecific.push("damping: " + this.constants.physics.damping);}
- if (optionsSpecific.length != 0) {
- options += ", repulsion: {";
- for (var i = 0; i < optionsSpecific.length; i++) {
- options += optionsSpecific[i];
- if (i < optionsSpecific.length - 1) {
- options += ", "
+
+ // start detection on touchstart
+ Hammer.event.onTouch(element, Hammer.EVENT_START, function(ev) {
+ if(self.enabled) {
+ Hammer.detection.startDetect(self, ev);
}
- }
- options += '}}'
- }
- if (optionsSpecific.length == 0) {options += "}"}
- if (this.constants.smoothCurves != this.backupConstants.smoothCurves) {
- options += ", smoothCurves: " + this.constants.smoothCurves;
- }
- options += '};'
- }
- else {
- options = "var options = {";
- if (this.constants.physics.hierarchicalRepulsion.nodeDistance != this.backupConstants.physics.hierarchicalRepulsion.nodeDistance) {optionsSpecific.push("nodeDistance: " + this.constants.physics.hierarchicalRepulsion.nodeDistance);}
- if (this.constants.physics.centralGravity != this.backupConstants.physics.hierarchicalRepulsion.centralGravity) {optionsSpecific.push("centralGravity: " + this.constants.physics.centralGravity);}
- if (this.constants.physics.springLength != this.backupConstants.physics.hierarchicalRepulsion.springLength) {optionsSpecific.push("springLength: " + this.constants.physics.springLength);}
- if (this.constants.physics.springConstant != this.backupConstants.physics.hierarchicalRepulsion.springConstant) {optionsSpecific.push("springConstant: " + this.constants.physics.springConstant);}
- if (this.constants.physics.damping != this.backupConstants.physics.hierarchicalRepulsion.damping) {optionsSpecific.push("damping: " + this.constants.physics.damping);}
- if (optionsSpecific.length != 0) {
- options += "physics: {hierarchicalRepulsion: {";
- for (var i = 0; i < optionsSpecific.length; i++) {
- options += optionsSpecific[i];
- if (i < optionsSpecific.length - 1) {
- options += ", ";
+ });
+
+ // return instance
+ return this;
+ };
+
+
+ Hammer.Instance.prototype = {
+ /**
+ * bind events to the instance
+ * @param {String} gesture
+ * @param {Function} handler
+ * @returns {Hammer.Instance}
+ */
+ on: function onEvent(gesture, handler){
+ var gestures = gesture.split(' ');
+ for(var t=0; t;
- * Licensed under the MIT license */
- (function(window, undefined) {
- 'use strict';
+ /**
+ * touch events with mouse fallback
+ * @param {HTMLElement} element
+ * @param {String} eventType like Hammer.EVENT_MOVE
+ * @param {Function} handler
+ */
+ onTouch: function onTouch(element, eventType, handler) {
+ var self = this;
- /**
- * Hammer
- * use this to create instances
- * @param {HTMLElement} element
- * @param {Object} options
- * @returns {Hammer.Instance}
- * @constructor
- */
- var Hammer = function(element, options) {
- return new Hammer.Instance(element, options || {});
- };
+ this.bindDom(element, Hammer.EVENT_TYPES[eventType], function bindDomOnTouch(ev) {
+ var sourceEventType = ev.type.toLowerCase();
- // default settings
- Hammer.defaults = {
- // add styles and attributes to the element to prevent the browser from doing
- // its native behavior. this doesnt prevent the scrolling, but cancels
- // the contextmenu, tap highlighting etc
- // set to false to disable this
- stop_browser_behavior: {
- // this also triggers onselectstart=false for IE
- userSelect: 'none',
- // this makes the element blocking in IE10 >, you could experiment with the value
- // see for more options this issue; https://github.com/EightMedia/hammer.js/issues/241
- touchAction: 'none',
- touchCallout: 'none',
- contentZooming: 'none',
- userDrag: 'none',
- tapHighlightColor: 'rgba(0,0,0,0)'
- }
+ // onmouseup, but when touchend has been fired we do nothing.
+ // this is for touchdevices which also fire a mouseup on touchend
+ if(sourceEventType.match(/mouse/) && touch_triggered) {
+ return;
+ }
- // more settings are defined per gesture at gestures.js
- };
+ // mousebutton must be down or a touch event
+ else if( sourceEventType.match(/touch/) || // touch events are always on screen
+ sourceEventType.match(/pointerdown/) || // pointerevents touch
+ (sourceEventType.match(/mouse/) && ev.which === 1) // mouse is pressed
+ ){
+ enable_detect = true;
+ }
- // detect touchevents
- Hammer.HAS_POINTEREVENTS = navigator.pointerEnabled || navigator.msPointerEnabled;
- Hammer.HAS_TOUCHEVENTS = ('ontouchstart' in window);
+ // we are in a touch event, set the touch triggered bool to true,
+ // this for the conflicts that may occur on ios and android
+ if(sourceEventType.match(/touch|pointer/)) {
+ touch_triggered = true;
+ }
- // dont use mouseevents on mobile devices
- Hammer.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
- Hammer.NO_MOUSEEVENTS = Hammer.HAS_TOUCHEVENTS && navigator.userAgent.match(Hammer.MOBILE_REGEX);
+ // count the total touches on the screen
+ var count_touches = 0;
- // eventtypes per touchevent (start, move, end)
- // are filled by Hammer.event.determineEventTypes on setup
- Hammer.EVENT_TYPES = {};
+ // when touch has been triggered in this detection session
+ // and we are now handling a mouse event, we stop that to prevent conflicts
+ if(enable_detect) {
+ // update pointerevent
+ if(Hammer.HAS_POINTEREVENTS && eventType != Hammer.EVENT_END) {
+ count_touches = Hammer.PointerEvent.updatePointer(eventType, ev);
+ }
+ // touch
+ else if(sourceEventType.match(/touch/)) {
+ count_touches = ev.touches.length;
+ }
+ // mouse
+ else if(!touch_triggered) {
+ count_touches = sourceEventType.match(/up/) ? 0 : 1;
+ }
- // direction defines
- Hammer.DIRECTION_DOWN = 'down';
- Hammer.DIRECTION_LEFT = 'left';
- Hammer.DIRECTION_UP = 'up';
- Hammer.DIRECTION_RIGHT = 'right';
+ // if we are in a end event, but when we remove one touch and
+ // we still have enough, set eventType to move
+ if(count_touches > 0 && eventType == Hammer.EVENT_END) {
+ eventType = Hammer.EVENT_MOVE;
+ }
+ // no touches, force the end event
+ else if(!count_touches) {
+ eventType = Hammer.EVENT_END;
+ }
- // pointer type
- Hammer.POINTER_MOUSE = 'mouse';
- Hammer.POINTER_TOUCH = 'touch';
- Hammer.POINTER_PEN = 'pen';
+ // because touchend has no touches, and we often want to use these in our gestures,
+ // we send the last move event as our eventData in touchend
+ if(!count_touches && last_move_event !== null) {
+ ev = last_move_event;
+ }
+ // store the last move event
+ else {
+ last_move_event = ev;
+ }
- // touch event defines
- Hammer.EVENT_START = 'start';
- Hammer.EVENT_MOVE = 'move';
- Hammer.EVENT_END = 'end';
+ // trigger the handler
+ handler.call(Hammer.detection, self.collectEventData(element, eventType, ev));
- // hammer document where the base events are added at
- Hammer.DOCUMENT = document;
+ // remove pointerevent from list
+ if(Hammer.HAS_POINTEREVENTS && eventType == Hammer.EVENT_END) {
+ count_touches = Hammer.PointerEvent.updatePointer(eventType, ev);
+ }
+ }
- // plugins namespace
- Hammer.plugins = {};
+ //debug(sourceEventType +" "+ eventType);
- // if the window events are set...
- Hammer.READY = false;
+ // on the end we reset everything
+ if(!count_touches) {
+ last_move_event = null;
+ enable_detect = false;
+ touch_triggered = false;
+ Hammer.PointerEvent.reset();
+ }
+ });
+ },
+
+
+ /**
+ * we have different events for each device/browser
+ * determine what we need and set them in the Hammer.EVENT_TYPES constant
+ */
+ determineEventTypes: function determineEventTypes() {
+ // determine the eventtype we want to set
+ var types;
+
+ // pointerEvents magic
+ if(Hammer.HAS_POINTEREVENTS) {
+ types = Hammer.PointerEvent.getEvents();
+ }
+ // on Android, iOS, blackberry, windows mobile we dont want any mouseevents
+ else if(Hammer.NO_MOUSEEVENTS) {
+ types = [
+ 'touchstart',
+ 'touchmove',
+ 'touchend touchcancel'];
+ }
+ // for non pointer events browsers and mixed browsers,
+ // like chrome on windows8 touch laptop
+ else {
+ types = [
+ 'touchstart mousedown',
+ 'touchmove mousemove',
+ 'touchend touchcancel mouseup'];
+ }
- /**
- * setup events to detect gestures on the document
- */
- function setup() {
- if(Hammer.READY) {
- return;
- }
+ Hammer.EVENT_TYPES[Hammer.EVENT_START] = types[0];
+ Hammer.EVENT_TYPES[Hammer.EVENT_MOVE] = types[1];
+ Hammer.EVENT_TYPES[Hammer.EVENT_END] = types[2];
+ },
- // find what eventtypes we add listeners to
- Hammer.event.determineEventTypes();
- // Register all gestures inside Hammer.gestures
- for(var name in Hammer.gestures) {
- if(Hammer.gestures.hasOwnProperty(name)) {
- Hammer.detection.register(Hammer.gestures[name]);
+ /**
+ * create touchlist depending on the event
+ * @param {Object} ev
+ * @param {String} eventType used by the fakemultitouch plugin
+ */
+ getTouchList: function getTouchList(ev/*, eventType*/) {
+ // get the fake pointerEvent touchlist
+ if(Hammer.HAS_POINTEREVENTS) {
+ return Hammer.PointerEvent.getTouchList();
}
- }
+ // get the touchlist
+ else if(ev.touches) {
+ return ev.touches;
+ }
+ // make fake touchlist from mouse position
+ else {
+ return [{
+ identifier: 1,
+ pageX: ev.pageX,
+ pageY: ev.pageY,
+ target: ev.target
+ }];
+ }
+ },
- // Add touch events on the document
- Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_MOVE, Hammer.detection.detect);
- Hammer.event.onTouch(Hammer.DOCUMENT, Hammer.EVENT_END, Hammer.detection.detect);
- // Hammer is ready...!
- Hammer.READY = true;
- }
+ /**
+ * collect event data for Hammer js
+ * @param {HTMLElement} element
+ * @param {String} eventType like Hammer.EVENT_MOVE
+ * @param {Object} eventData
+ */
+ collectEventData: function collectEventData(element, eventType, ev) {
+ var touches = this.getTouchList(ev, eventType);
- /**
- * create new hammer instance
- * all methods should return the instance itself, so it is chainable.
- * @param {HTMLElement} element
- * @param {Object} [options={}]
- * @returns {Hammer.Instance}
- * @constructor
- */
- Hammer.Instance = function(element, options) {
- var self = this;
+ // find out pointerType
+ var pointerType = Hammer.POINTER_TOUCH;
+ if(ev.type.match(/mouse/) || Hammer.PointerEvent.matchType(Hammer.POINTER_MOUSE, ev)) {
+ pointerType = Hammer.POINTER_MOUSE;
+ }
- // setup HammerJS window events and register all gestures
- // this also sets up the default options
- setup();
+ return {
+ center : Hammer.utils.getCenter(touches),
+ timeStamp : new Date().getTime(),
+ target : ev.target,
+ touches : touches,
+ eventType : eventType,
+ pointerType : pointerType,
+ srcEvent : ev,
- this.element = element;
+ /**
+ * prevent the browser default actions
+ * mostly used to disable scrolling of the browser
+ */
+ preventDefault: function() {
+ if(this.srcEvent.preventManipulation) {
+ this.srcEvent.preventManipulation();
+ }
- // start/stop detection option
- this.enabled = true;
+ if(this.srcEvent.preventDefault) {
+ this.srcEvent.preventDefault();
+ }
+ },
- // merge options
- this.options = Hammer.utils.extend(
- Hammer.utils.extend({}, Hammer.defaults),
- options || {});
+ /**
+ * stop bubbling the event up to its parents
+ */
+ stopPropagation: function() {
+ this.srcEvent.stopPropagation();
+ },
- // add some css to the element to prevent the browser from doing its native behavoir
- if(this.options.stop_browser_behavior) {
- Hammer.utils.stopDefaultBrowserBehavior(this.element, this.options.stop_browser_behavior);
+ /**
+ * immediately stop gesture detection
+ * might be useful after a swipe was detected
+ * @return {*}
+ */
+ stopDetect: function() {
+ return Hammer.detection.stopDetect();
+ }
+ };
}
-
- // start detection on touchstart
- Hammer.event.onTouch(element, Hammer.EVENT_START, function(ev) {
- if(self.enabled) {
- Hammer.detection.startDetect(self, ev);
- }
- });
-
- // return instance
- return this;
};
+ Hammer.PointerEvent = {
+ /**
+ * holds all pointers
+ * @type {Object}
+ */
+ pointers: {},
- Hammer.Instance.prototype = {
/**
- * bind events to the instance
- * @param {String} gesture
- * @param {Function} handler
- * @returns {Hammer.Instance}
+ * get a list of pointers
+ * @returns {Array} touchlist
*/
- on: function onEvent(gesture, handler){
- var gestures = gesture.split(' ');
- for(var t=0; t 0 && eventType == Hammer.EVENT_END) {
- eventType = Hammer.EVENT_MOVE;
- }
- // no touches, force the end event
- else if(!count_touches) {
- eventType = Hammer.EVENT_END;
- }
+ for(var t= 0,len=touches.length; t= y) {
+ return touch1.pageX - touch2.pageX > 0 ? Hammer.DIRECTION_LEFT : Hammer.DIRECTION_RIGHT;
}
- // for non pointer events browsers and mixed browsers,
- // like chrome on windows8 touch laptop
else {
- types = [
- 'touchstart mousedown',
- 'touchmove mousemove',
- 'touchend touchcancel mouseup'];
+ return touch1.pageY - touch2.pageY > 0 ? Hammer.DIRECTION_UP : Hammer.DIRECTION_DOWN;
}
+ },
- Hammer.EVENT_TYPES[Hammer.EVENT_START] = types[0];
- Hammer.EVENT_TYPES[Hammer.EVENT_MOVE] = types[1];
- Hammer.EVENT_TYPES[Hammer.EVENT_END] = types[2];
+
+ /**
+ * calculate the distance between two touches
+ * @param {Touch} touch1
+ * @param {Touch} touch2
+ * @returns {Number} distance
+ */
+ getDistance: function getDistance(touch1, touch2) {
+ var x = touch2.pageX - touch1.pageX,
+ y = touch2.pageY - touch1.pageY;
+ return Math.sqrt((x*x) + (y*y));
},
/**
- * create touchlist depending on the event
- * @param {Object} ev
- * @param {String} eventType used by the fakemultitouch plugin
+ * calculate the scale factor between two touchLists (fingers)
+ * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
+ * @param {Array} start
+ * @param {Array} end
+ * @returns {Number} scale
*/
- getTouchList: function getTouchList(ev/*, eventType*/) {
- // get the fake pointerEvent touchlist
- if(Hammer.HAS_POINTEREVENTS) {
- return Hammer.PointerEvent.getTouchList();
- }
- // get the touchlist
- else if(ev.touches) {
- return ev.touches;
+ getScale: function getScale(start, end) {
+ // need two fingers...
+ if(start.length >= 2 && end.length >= 2) {
+ return this.getDistance(end[0], end[1]) /
+ this.getDistance(start[0], start[1]);
}
- // make fake touchlist from mouse position
- else {
- return [{
- identifier: 1,
- pageX: ev.pageX,
- pageY: ev.pageY,
- target: ev.target
- }];
+ return 1;
+ },
+
+
+ /**
+ * calculate the rotation degrees between two touchLists (fingers)
+ * @param {Array} start
+ * @param {Array} end
+ * @returns {Number} rotation
+ */
+ getRotation: function getRotation(start, end) {
+ // need two fingers
+ if(start.length >= 2 && end.length >= 2) {
+ return this.getAngle(end[1], end[0]) -
+ this.getAngle(start[1], start[0]);
}
+ return 0;
},
/**
- * collect event data for Hammer js
- * @param {HTMLElement} element
- * @param {String} eventType like Hammer.EVENT_MOVE
- * @param {Object} eventData
+ * boolean if the direction is vertical
+ * @param {String} direction
+ * @returns {Boolean} is_vertical
+ */
+ isVertical: function isVertical(direction) {
+ return (direction == Hammer.DIRECTION_UP || direction == Hammer.DIRECTION_DOWN);
+ },
+
+
+ /**
+ * stop browser default behavior with css props
+ * @param {HtmlElement} element
+ * @param {Object} css_props
*/
- collectEventData: function collectEventData(element, eventType, ev) {
- var touches = this.getTouchList(ev, eventType);
+ stopDefaultBrowserBehavior: function stopDefaultBrowserBehavior(element, css_props) {
+ var prop,
+ vendors = ['webkit','khtml','moz','ms','o',''];
- // find out pointerType
- var pointerType = Hammer.POINTER_TOUCH;
- if(ev.type.match(/mouse/) || Hammer.PointerEvent.matchType(Hammer.POINTER_MOUSE, ev)) {
- pointerType = Hammer.POINTER_MOUSE;
+ if(!css_props || !element.style) {
+ return;
}
- return {
- center : Hammer.utils.getCenter(touches),
- timeStamp : new Date().getTime(),
- target : ev.target,
- touches : touches,
- eventType : eventType,
- pointerType : pointerType,
- srcEvent : ev,
+ // with css properties for modern browsers
+ for(var i = 0; i < vendors.length; i++) {
+ for(var p in css_props) {
+ if(css_props.hasOwnProperty(p)) {
+ prop = p;
- /**
- * prevent the browser default actions
- * mostly used to disable scrolling of the browser
- */
- preventDefault: function() {
- if(this.srcEvent.preventManipulation) {
- this.srcEvent.preventManipulation();
- }
+ // vender prefix at the property
+ if(vendors[i]) {
+ prop = vendors[i] + prop.substring(0, 1).toUpperCase() + prop.substring(1);
+ }
- if(this.srcEvent.preventDefault) {
- this.srcEvent.preventDefault();
+ // set the style
+ element.style[prop] = css_props[p];
}
- },
-
- /**
- * stop bubbling the event up to its parents
- */
- stopPropagation: function() {
- this.srcEvent.stopPropagation();
- },
-
- /**
- * immediately stop gesture detection
- * might be useful after a swipe was detected
- * @return {*}
- */
- stopDetect: function() {
- return Hammer.detection.stopDetect();
}
- };
+ }
+
+ // also the disable onselectstart
+ if(css_props.userSelect == 'none') {
+ element.onselectstart = function() {
+ return false;
+ };
+ }
}
};
- Hammer.PointerEvent = {
- /**
- * holds all pointers
- * @type {Object}
- */
- pointers: {},
+ Hammer.detection = {
+ // contains all registred Hammer.gestures in the correct order
+ gestures: [],
+
+ // data of the current Hammer.gesture detection session
+ current: null,
+
+ // the previous Hammer.gesture session data
+ // is a full clone of the previous gesture.current object
+ previous: null,
+
+ // when this becomes true, no gestures are fired
+ stopped: false,
+
/**
- * get a list of pointers
- * @returns {Array} touchlist
+ * start Hammer.gesture detection
+ * @param {Hammer.Instance} inst
+ * @param {Object} eventData
*/
- getTouchList: function() {
- var self = this;
- var touchlist = [];
+ startDetect: function startDetect(inst, eventData) {
+ // already busy with a Hammer.gesture detection on an element
+ if(this.current) {
+ return;
+ }
- // we can use forEach since pointerEvents only is in IE10
- Object.keys(self.pointers).sort().forEach(function(id) {
- touchlist.push(self.pointers[id]);
- });
- return touchlist;
+ this.stopped = false;
+
+ this.current = {
+ inst : inst, // reference to HammerInstance we're working for
+ startEvent : Hammer.utils.extend({}, eventData), // start eventData for distances, timing etc
+ lastEvent : false, // last eventData
+ name : '' // current gesture we're in/detected, can be 'tap', 'hold' etc
+ };
+
+ this.detect(eventData);
},
+
/**
- * update the position of a pointer
- * @param {String} type Hammer.EVENT_END
- * @param {Object} pointerEvent
+ * Hammer.gesture detection
+ * @param {Object} eventData
+ * @param {Object} eventData
*/
- updatePointer: function(type, pointerEvent) {
- if(type == Hammer.EVENT_END) {
- this.pointers = {};
+ detect: function detect(eventData) {
+ if(!this.current || this.stopped) {
+ return;
}
- else {
- pointerEvent.identifier = pointerEvent.pointerId;
- this.pointers[pointerEvent.pointerId] = pointerEvent;
+
+ // extend event data with calculations about scale, distance etc
+ eventData = this.extendEventData(eventData);
+
+ // instance options
+ var inst_options = this.current.inst.options;
+
+ // call Hammer.gesture handlers
+ for(var g=0,len=this.gestures.length; g b.index) {
+ return 1;
+ }
+ return 0;
+ });
- /**
- * calculate the velocity between two points
- * @param {Number} delta_time
- * @param {Number} delta_x
- * @param {Number} delta_y
- * @returns {Object} velocity
- */
- getVelocity: function getVelocity(delta_time, delta_x, delta_y) {
- return {
- x: Math.abs(delta_x / delta_time) || 0,
- y: Math.abs(delta_y / delta_time) || 0
- };
- },
+ return this.gestures;
+ }
+ };
- /**
- * calculate the angle between two coordinates
- * @param {Touch} touch1
- * @param {Touch} touch2
- * @returns {Number} angle
- */
- getAngle: function getAngle(touch1, touch2) {
- var y = touch2.pageY - touch1.pageY,
- x = touch2.pageX - touch1.pageX;
- return Math.atan2(y, x) * 180 / Math.PI;
- },
+ Hammer.gestures = Hammer.gestures || {};
+ /**
+ * Custom gestures
+ * ==============================
+ *
+ * Gesture object
+ * --------------------
+ * The object structure of a gesture:
+ *
+ * { name: 'mygesture',
+ * index: 1337,
+ * defaults: {
+ * mygesture_option: true
+ * }
+ * handler: function(type, ev, inst) {
+ * // trigger gesture event
+ * inst.trigger(this.name, ev);
+ * }
+ * }
- /**
- * angle to direction define
- * @param {Touch} touch1
- * @param {Touch} touch2
- * @returns {String} direction constant, like Hammer.DIRECTION_LEFT
- */
- getDirection: function getDirection(touch1, touch2) {
- var x = Math.abs(touch1.pageX - touch2.pageX),
- y = Math.abs(touch1.pageY - touch2.pageY);
+ * @param {String} name
+ * this should be the name of the gesture, lowercase
+ * it is also being used to disable/enable the gesture per instance config.
+ *
+ * @param {Number} [index=1000]
+ * the index of the gesture, where it is going to be in the stack of gestures detection
+ * like when you build an gesture that depends on the drag gesture, it is a good
+ * idea to place it after the index of the drag gesture.
+ *
+ * @param {Object} [defaults={}]
+ * the default settings of the gesture. these are added to the instance settings,
+ * and can be overruled per instance. you can also add the name of the gesture,
+ * but this is also added by default (and set to true).
+ *
+ * @param {Function} handler
+ * this handles the gesture detection of your custom gesture and receives the
+ * following arguments:
+ *
+ * @param {Object} eventData
+ * event data containing the following properties:
+ * timeStamp {Number} time the event occurred
+ * target {HTMLElement} target element
+ * touches {Array} touches (fingers, pointers, mouse) on the screen
+ * pointerType {String} kind of pointer that was used. matches Hammer.POINTER_MOUSE|TOUCH
+ * center {Object} center position of the touches. contains pageX and pageY
+ * deltaTime {Number} the total time of the touches in the screen
+ * deltaX {Number} the delta on x axis we haved moved
+ * deltaY {Number} the delta on y axis we haved moved
+ * velocityX {Number} the velocity on the x
+ * velocityY {Number} the velocity on y
+ * angle {Number} the angle we are moving
+ * direction {String} the direction we are moving. matches Hammer.DIRECTION_UP|DOWN|LEFT|RIGHT
+ * distance {Number} the distance we haved moved
+ * scale {Number} scaling of the touches, needs 2 touches
+ * rotation {Number} rotation of the touches, needs 2 touches *
+ * eventType {String} matches Hammer.EVENT_START|MOVE|END
+ * srcEvent {Object} the source event, like TouchStart or MouseDown *
+ * startEvent {Object} contains the same properties as above,
+ * but from the first touch. this is used to calculate
+ * distances, deltaTime, scaling etc
+ *
+ * @param {Hammer.Instance} inst
+ * the instance we are doing the detection for. you can get the options from
+ * the inst.options object and trigger the gesture event by calling inst.trigger
+ *
+ *
+ * Handle gestures
+ * --------------------
+ * inside the handler you can get/set Hammer.detection.current. This is the current
+ * detection session. It has the following properties
+ * @param {String} name
+ * contains the name of the gesture we have detected. it has not a real function,
+ * only to check in other gestures if something is detected.
+ * like in the drag gesture we set it to 'drag' and in the swipe gesture we can
+ * check if the current gesture is 'drag' by accessing Hammer.detection.current.name
+ *
+ * @readonly
+ * @param {Hammer.Instance} inst
+ * the instance we do the detection for
+ *
+ * @readonly
+ * @param {Object} startEvent
+ * contains the properties of the first gesture detection in this session.
+ * Used for calculations about timing, distance, etc.
+ *
+ * @readonly
+ * @param {Object} lastEvent
+ * contains all the properties of the last gesture detect in this session.
+ *
+ * after the gesture detection session has been completed (user has released the screen)
+ * the Hammer.detection.current object is copied into Hammer.detection.previous,
+ * this is usefull for gestures like doubletap, where you need to know if the
+ * previous gesture was a tap
+ *
+ * options that have been set by the instance can be received by calling inst.options
+ *
+ * You can trigger a gesture event by calling inst.trigger("mygesture", event).
+ * The first param is the name of your gesture, the second the event argument
+ *
+ *
+ * Register gestures
+ * --------------------
+ * When an gesture is added to the Hammer.gestures object, it is auto registered
+ * at the setup of the first Hammer instance. You can also call Hammer.detection.register
+ * manually and pass your gesture object as a param
+ *
+ */
- if(x >= y) {
- return touch1.pageX - touch2.pageX > 0 ? Hammer.DIRECTION_LEFT : Hammer.DIRECTION_RIGHT;
- }
- else {
- return touch1.pageY - touch2.pageY > 0 ? Hammer.DIRECTION_UP : Hammer.DIRECTION_DOWN;
- }
+ /**
+ * Hold
+ * Touch stays at the same place for x time
+ * @events hold
+ */
+ Hammer.gestures.Hold = {
+ name: 'hold',
+ index: 10,
+ defaults: {
+ hold_timeout : 500,
+ hold_threshold : 1
},
+ timer: null,
+ handler: function holdGesture(ev, inst) {
+ switch(ev.eventType) {
+ case Hammer.EVENT_START:
+ // clear any running timers
+ clearTimeout(this.timer);
+ // set the gesture so we can check in the timeout if it still is
+ Hammer.detection.current.name = this.name;
- /**
- * calculate the distance between two touches
- * @param {Touch} touch1
- * @param {Touch} touch2
- * @returns {Number} distance
- */
- getDistance: function getDistance(touch1, touch2) {
- var x = touch2.pageX - touch1.pageX,
- y = touch2.pageY - touch1.pageY;
- return Math.sqrt((x*x) + (y*y));
- },
+ // set timer and if after the timeout it still is hold,
+ // we trigger the hold event
+ this.timer = setTimeout(function() {
+ if(Hammer.detection.current.name == 'hold') {
+ inst.trigger('hold', ev);
+ }
+ }, inst.options.hold_timeout);
+ break;
+
+ // when you move or end we clear the timer
+ case Hammer.EVENT_MOVE:
+ if(ev.distance > inst.options.hold_threshold) {
+ clearTimeout(this.timer);
+ }
+ break;
+
+ case Hammer.EVENT_END:
+ clearTimeout(this.timer);
+ break;
+ }
+ }
+ };
- /**
- * calculate the scale factor between two touchLists (fingers)
- * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
- * @param {Array} start
- * @param {Array} end
- * @returns {Number} scale
- */
- getScale: function getScale(start, end) {
- // need two fingers...
- if(start.length >= 2 && end.length >= 2) {
- return this.getDistance(end[0], end[1]) /
- this.getDistance(start[0], start[1]);
- }
- return 1;
+ /**
+ * Tap/DoubleTap
+ * Quick touch at a place or double at the same place
+ * @events tap, doubletap
+ */
+ Hammer.gestures.Tap = {
+ name: 'tap',
+ index: 100,
+ defaults: {
+ tap_max_touchtime : 250,
+ tap_max_distance : 10,
+ tap_always : true,
+ doubletap_distance : 20,
+ doubletap_interval : 300
},
+ handler: function tapGesture(ev, inst) {
+ if(ev.eventType == Hammer.EVENT_END) {
+ // previous gesture, for the double tap since these are two different gesture detections
+ var prev = Hammer.detection.previous,
+ did_doubletap = false;
+ // when the touchtime is higher then the max touch time
+ // or when the moving distance is too much
+ if(ev.deltaTime > inst.options.tap_max_touchtime ||
+ ev.distance > inst.options.tap_max_distance) {
+ return;
+ }
- /**
- * calculate the rotation degrees between two touchLists (fingers)
- * @param {Array} start
- * @param {Array} end
- * @returns {Number} rotation
- */
- getRotation: function getRotation(start, end) {
- // need two fingers
- if(start.length >= 2 && end.length >= 2) {
- return this.getAngle(end[1], end[0]) -
- this.getAngle(start[1], start[0]);
+ // check if double tap
+ if(prev && prev.name == 'tap' &&
+ (ev.timeStamp - prev.lastEvent.timeStamp) < inst.options.doubletap_interval &&
+ ev.distance < inst.options.doubletap_distance) {
+ inst.trigger('doubletap', ev);
+ did_doubletap = true;
+ }
+
+ // do a single tap
+ if(!did_doubletap || inst.options.tap_always) {
+ Hammer.detection.current.name = 'tap';
+ inst.trigger(Hammer.detection.current.name, ev);
+ }
}
- return 0;
- },
+ }
+ };
- /**
- * boolean if the direction is vertical
- * @param {String} direction
- * @returns {Boolean} is_vertical
- */
- isVertical: function isVertical(direction) {
- return (direction == Hammer.DIRECTION_UP || direction == Hammer.DIRECTION_DOWN);
+ /**
+ * Swipe
+ * triggers swipe events when the end velocity is above the threshold
+ * @events swipe, swipeleft, swiperight, swipeup, swipedown
+ */
+ Hammer.gestures.Swipe = {
+ name: 'swipe',
+ index: 40,
+ defaults: {
+ // set 0 for unlimited, but this can conflict with transform
+ swipe_max_touches : 1,
+ swipe_velocity : 0.7
},
+ handler: function swipeGesture(ev, inst) {
+ if(ev.eventType == Hammer.EVENT_END) {
+ // max touches
+ if(inst.options.swipe_max_touches > 0 &&
+ ev.touches.length > inst.options.swipe_max_touches) {
+ return;
+ }
+ // when the distance we moved is too small we skip this gesture
+ // or we can be already in dragging
+ if(ev.velocityX > inst.options.swipe_velocity ||
+ ev.velocityY > inst.options.swipe_velocity) {
+ // trigger swipe events
+ inst.trigger(this.name, ev);
+ inst.trigger(this.name + ev.direction, ev);
+ }
+ }
+ }
+ };
- /**
- * stop browser default behavior with css props
- * @param {HtmlElement} element
- * @param {Object} css_props
- */
- stopDefaultBrowserBehavior: function stopDefaultBrowserBehavior(element, css_props) {
- var prop,
- vendors = ['webkit','khtml','moz','ms','o',''];
- if(!css_props || !element.style) {
+ /**
+ * Drag
+ * Move with x fingers (default 1) around on the page. Blocking the scrolling when
+ * moving left and right is a good practice. When all the drag events are blocking
+ * you disable scrolling on that area.
+ * @events drag, drapleft, dragright, dragup, dragdown
+ */
+ Hammer.gestures.Drag = {
+ name: 'drag',
+ index: 50,
+ defaults: {
+ drag_min_distance : 10,
+ // set 0 for unlimited, but this can conflict with transform
+ drag_max_touches : 1,
+ // prevent default browser behavior when dragging occurs
+ // be careful with it, it makes the element a blocking element
+ // when you are using the drag gesture, it is a good practice to set this true
+ drag_block_horizontal : false,
+ drag_block_vertical : false,
+ // drag_lock_to_axis keeps the drag gesture on the axis that it started on,
+ // It disallows vertical directions if the initial direction was horizontal, and vice versa.
+ drag_lock_to_axis : false,
+ // drag lock only kicks in when distance > drag_lock_min_distance
+ // This way, locking occurs only when the distance has become large enough to reliably determine the direction
+ drag_lock_min_distance : 25
+ },
+ triggered: false,
+ handler: function dragGesture(ev, inst) {
+ // current gesture isnt drag, but dragged is true
+ // this means an other gesture is busy. now call dragend
+ if(Hammer.detection.current.name != this.name && this.triggered) {
+ inst.trigger(this.name +'end', ev);
+ this.triggered = false;
return;
}
- // with css properties for modern browsers
- for(var i = 0; i < vendors.length; i++) {
- for(var p in css_props) {
- if(css_props.hasOwnProperty(p)) {
- prop = p;
+ // max touches
+ if(inst.options.drag_max_touches > 0 &&
+ ev.touches.length > inst.options.drag_max_touches) {
+ return;
+ }
- // vender prefix at the property
- if(vendors[i]) {
- prop = vendors[i] + prop.substring(0, 1).toUpperCase() + prop.substring(1);
+ switch(ev.eventType) {
+ case Hammer.EVENT_START:
+ this.triggered = false;
+ break;
+
+ case Hammer.EVENT_MOVE:
+ // when the distance we moved is too small we skip this gesture
+ // or we can be already in dragging
+ if(ev.distance < inst.options.drag_min_distance &&
+ Hammer.detection.current.name != this.name) {
+ return;
+ }
+
+ // we are dragging!
+ Hammer.detection.current.name = this.name;
+
+ // lock drag to axis?
+ if(Hammer.detection.current.lastEvent.drag_locked_to_axis || (inst.options.drag_lock_to_axis && inst.options.drag_lock_min_distance<=ev.distance)) {
+ ev.drag_locked_to_axis = true;
+ }
+ var last_direction = Hammer.detection.current.lastEvent.direction;
+ if(ev.drag_locked_to_axis && last_direction !== ev.direction) {
+ // keep direction on the axis that the drag gesture started on
+ if(Hammer.utils.isVertical(last_direction)) {
+ ev.direction = (ev.deltaY < 0) ? Hammer.DIRECTION_UP : Hammer.DIRECTION_DOWN;
}
+ else {
+ ev.direction = (ev.deltaX < 0) ? Hammer.DIRECTION_LEFT : Hammer.DIRECTION_RIGHT;
+ }
+ }
- // set the style
- element.style[prop] = css_props[p];
+ // first time, trigger dragstart event
+ if(!this.triggered) {
+ inst.trigger(this.name +'start', ev);
+ this.triggered = true;
}
- }
- }
- // also the disable onselectstart
- if(css_props.userSelect == 'none') {
- element.onselectstart = function() {
- return false;
- };
- }
- }
- };
+ // trigger normal event
+ inst.trigger(this.name, ev);
- Hammer.detection = {
- // contains all registred Hammer.gestures in the correct order
- gestures: [],
+ // direction event, like dragdown
+ inst.trigger(this.name + ev.direction, ev);
- // data of the current Hammer.gesture detection session
- current: null,
+ // block the browser events
+ if( (inst.options.drag_block_vertical && Hammer.utils.isVertical(ev.direction)) ||
+ (inst.options.drag_block_horizontal && !Hammer.utils.isVertical(ev.direction))) {
+ ev.preventDefault();
+ }
+ break;
- // the previous Hammer.gesture session data
- // is a full clone of the previous gesture.current object
- previous: null,
+ case Hammer.EVENT_END:
+ // trigger dragend
+ if(this.triggered) {
+ inst.trigger(this.name +'end', ev);
+ }
- // when this becomes true, no gestures are fired
- stopped: false,
+ this.triggered = false;
+ break;
+ }
+ }
+ };
- /**
- * start Hammer.gesture detection
- * @param {Hammer.Instance} inst
- * @param {Object} eventData
- */
- startDetect: function startDetect(inst, eventData) {
- // already busy with a Hammer.gesture detection on an element
- if(this.current) {
+ /**
+ * Transform
+ * User want to scale or rotate with 2 fingers
+ * @events transform, pinch, pinchin, pinchout, rotate
+ */
+ Hammer.gestures.Transform = {
+ name: 'transform',
+ index: 45,
+ defaults: {
+ // factor, no scale is 1, zoomin is to 0 and zoomout until higher then 1
+ transform_min_scale : 0.01,
+ // rotation in degrees
+ transform_min_rotation : 1,
+ // prevent default browser behavior when two touches are on the screen
+ // but it makes the element a blocking element
+ // when you are using the transform gesture, it is a good practice to set this true
+ transform_always_block : false
+ },
+ triggered: false,
+ handler: function transformGesture(ev, inst) {
+ // current gesture isnt drag, but dragged is true
+ // this means an other gesture is busy. now call dragend
+ if(Hammer.detection.current.name != this.name && this.triggered) {
+ inst.trigger(this.name +'end', ev);
+ this.triggered = false;
return;
}
- this.stopped = false;
-
- this.current = {
- inst : inst, // reference to HammerInstance we're working for
- startEvent : Hammer.utils.extend({}, eventData), // start eventData for distances, timing etc
- lastEvent : false, // last eventData
- name : '' // current gesture we're in/detected, can be 'tap', 'hold' etc
- };
-
- this.detect(eventData);
- },
-
-
- /**
- * Hammer.gesture detection
- * @param {Object} eventData
- * @param {Object} eventData
- */
- detect: function detect(eventData) {
- if(!this.current || this.stopped) {
+ // atleast multitouch
+ if(ev.touches.length < 2) {
return;
}
- // extend event data with calculations about scale, distance etc
- eventData = this.extendEventData(eventData);
+ // prevent default when two fingers are on the screen
+ if(inst.options.transform_always_block) {
+ ev.preventDefault();
+ }
- // instance options
- var inst_options = this.current.inst.options;
+ switch(ev.eventType) {
+ case Hammer.EVENT_START:
+ this.triggered = false;
+ break;
- // call Hammer.gesture handlers
- for(var g=0,len=this.gestures.length; g inst.options.transform_min_rotation) {
+ inst.trigger('rotate', ev);
+ }
- /**
- * clear the Hammer.gesture vars
- * this is called on endDetect, but can also be used when a final Hammer.gesture has been detected
- * to stop other Hammer.gestures from being fired
- */
- stopDetect: function stopDetect() {
- // clone current data to the store as the previous gesture
- // used for the double tap gesture, since this is an other gesture detect session
- this.previous = Hammer.utils.extend({}, this.current);
+ // trigger pinch event
+ if(scale_threshold > inst.options.transform_min_scale) {
+ inst.trigger('pinch', ev);
+ inst.trigger('pinch'+ ((ev.scale < 1) ? 'in' : 'out'), ev);
+ }
+ break;
- // reset the current
- this.current = null;
+ case Hammer.EVENT_END:
+ // trigger dragend
+ if(this.triggered) {
+ inst.trigger(this.name +'end', ev);
+ }
- // stopped!
- this.stopped = true;
- },
+ this.triggered = false;
+ break;
+ }
+ }
+ };
- /**
- * extend eventData for Hammer.gestures
- * @param {Object} ev
- * @returns {Object} ev
- */
- extendEventData: function extendEventData(ev) {
- var startEv = this.current.startEvent;
+ /**
+ * Touch
+ * Called as first, tells the user has touched the screen
+ * @events touch
+ */
+ Hammer.gestures.Touch = {
+ name: 'touch',
+ index: -Infinity,
+ defaults: {
+ // call preventDefault at touchstart, and makes the element blocking by
+ // disabling the scrolling of the page, but it improves gestures like
+ // transforming and dragging.
+ // be careful with using this, it can be very annoying for users to be stuck
+ // on the page
+ prevent_default: false,
- // if the touches change, set the new touches over the startEvent touches
- // this because touchevents don't have all the touches on touchstart, or the
- // user must place his fingers at the EXACT same time on the screen, which is not realistic
- // but, sometimes it happens that both fingers are touching at the EXACT same time
- if(startEv && (ev.touches.length != startEv.touches.length || ev.touches === startEv.touches)) {
- // extend 1 level deep to get the touchlist with the touch objects
- startEv.touches = [];
- for(var i=0,len=ev.touches.length; i b.index) {
- return 1;
- }
- return 0;
- });
+ this.constants.physics.centralGravity = this.constants.physics.hierarchicalRepulsion.centralGravity;
+ this.constants.physics.springLength = this.constants.physics.hierarchicalRepulsion.springLength;
+ this.constants.physics.springConstant = this.constants.physics.hierarchicalRepulsion.springConstant;
+ this.constants.physics.damping = this.constants.physics.hierarchicalRepulsion.damping;
- return this.gestures;
- }
- };
+ this._loadMixin(HierarchialRepulsionMixin);
+ }
+ else {
+ this._clearMixin(BarnesHutMixin);
+ this._clearMixin(HierarchialRepulsionMixin);
+ this.barnesHutTree = undefined;
+ this.constants.physics.centralGravity = this.constants.physics.repulsion.centralGravity;
+ this.constants.physics.springLength = this.constants.physics.repulsion.springLength;
+ this.constants.physics.springConstant = this.constants.physics.repulsion.springConstant;
+ this.constants.physics.damping = this.constants.physics.repulsion.damping;
- Hammer.gestures = Hammer.gestures || {};
+ this._loadMixin(RepulsionMixin);
+ }
+ };
/**
- * Custom gestures
- * ==============================
- *
- * Gesture object
- * --------------------
- * The object structure of a gesture:
- *
- * { name: 'mygesture',
- * index: 1337,
- * defaults: {
- * mygesture_option: true
- * }
- * handler: function(type, ev, inst) {
- * // trigger gesture event
- * inst.trigger(this.name, ev);
- * }
- * }
-
- * @param {String} name
- * this should be the name of the gesture, lowercase
- * it is also being used to disable/enable the gesture per instance config.
- *
- * @param {Number} [index=1000]
- * the index of the gesture, where it is going to be in the stack of gestures detection
- * like when you build an gesture that depends on the drag gesture, it is a good
- * idea to place it after the index of the drag gesture.
- *
- * @param {Object} [defaults={}]
- * the default settings of the gesture. these are added to the instance settings,
- * and can be overruled per instance. you can also add the name of the gesture,
- * but this is also added by default (and set to true).
- *
- * @param {Function} handler
- * this handles the gesture detection of your custom gesture and receives the
- * following arguments:
- *
- * @param {Object} eventData
- * event data containing the following properties:
- * timeStamp {Number} time the event occurred
- * target {HTMLElement} target element
- * touches {Array} touches (fingers, pointers, mouse) on the screen
- * pointerType {String} kind of pointer that was used. matches Hammer.POINTER_MOUSE|TOUCH
- * center {Object} center position of the touches. contains pageX and pageY
- * deltaTime {Number} the total time of the touches in the screen
- * deltaX {Number} the delta on x axis we haved moved
- * deltaY {Number} the delta on y axis we haved moved
- * velocityX {Number} the velocity on the x
- * velocityY {Number} the velocity on y
- * angle {Number} the angle we are moving
- * direction {String} the direction we are moving. matches Hammer.DIRECTION_UP|DOWN|LEFT|RIGHT
- * distance {Number} the distance we haved moved
- * scale {Number} scaling of the touches, needs 2 touches
- * rotation {Number} rotation of the touches, needs 2 touches *
- * eventType {String} matches Hammer.EVENT_START|MOVE|END
- * srcEvent {Object} the source event, like TouchStart or MouseDown *
- * startEvent {Object} contains the same properties as above,
- * but from the first touch. this is used to calculate
- * distances, deltaTime, scaling etc
- *
- * @param {Hammer.Instance} inst
- * the instance we are doing the detection for. you can get the options from
- * the inst.options object and trigger the gesture event by calling inst.trigger
- *
- *
- * Handle gestures
- * --------------------
- * inside the handler you can get/set Hammer.detection.current. This is the current
- * detection session. It has the following properties
- * @param {String} name
- * contains the name of the gesture we have detected. it has not a real function,
- * only to check in other gestures if something is detected.
- * like in the drag gesture we set it to 'drag' and in the swipe gesture we can
- * check if the current gesture is 'drag' by accessing Hammer.detection.current.name
- *
- * @readonly
- * @param {Hammer.Instance} inst
- * the instance we do the detection for
- *
- * @readonly
- * @param {Object} startEvent
- * contains the properties of the first gesture detection in this session.
- * Used for calculations about timing, distance, etc.
- *
- * @readonly
- * @param {Object} lastEvent
- * contains all the properties of the last gesture detect in this session.
- *
- * after the gesture detection session has been completed (user has released the screen)
- * the Hammer.detection.current object is copied into Hammer.detection.previous,
- * this is usefull for gestures like doubletap, where you need to know if the
- * previous gesture was a tap
- *
- * options that have been set by the instance can be received by calling inst.options
- *
- * You can trigger a gesture event by calling inst.trigger("mygesture", event).
- * The first param is the name of your gesture, the second the event argument
- *
- *
- * Register gestures
- * --------------------
- * When an gesture is added to the Hammer.gestures object, it is auto registered
- * at the setup of the first Hammer instance. You can also call Hammer.detection.register
- * manually and pass your gesture object as a param
+ * Before calculating the forces, we check if we need to cluster to keep up performance and we check
+ * if there is more than one node. If it is just one node, we dont calculate anything.
*
+ * @private
*/
+ exports._initializeForceCalculation = function () {
+ // stop calculation if there is only one node
+ if (this.nodeIndices.length == 1) {
+ this.nodes[this.nodeIndices[0]]._setForce(0, 0);
+ }
+ else {
+ // if there are too many nodes on screen, we cluster without repositioning
+ if (this.nodeIndices.length > this.constants.clustering.clusterThreshold && this.constants.clustering.enabled == true) {
+ this.clusterToFit(this.constants.clustering.reduceToNodes, false);
+ }
+
+ // we now start the force calculation
+ this._calculateForces();
+ }
+ };
+
/**
- * Hold
- * Touch stays at the same place for x time
- * @events hold
+ * Calculate the external forces acting on the nodes
+ * Forces are caused by: edges, repulsing forces between nodes, gravity
+ * @private
*/
- Hammer.gestures.Hold = {
- name: 'hold',
- index: 10,
- defaults: {
- hold_timeout : 500,
- hold_threshold : 1
- },
- timer: null,
- handler: function holdGesture(ev, inst) {
- switch(ev.eventType) {
- case Hammer.EVENT_START:
- // clear any running timers
- clearTimeout(this.timer);
+ exports._calculateForces = function () {
+ // Gravity is required to keep separated groups from floating off
+ // the forces are reset to zero in this loop by using _setForce instead
+ // of _addForce
- // set the gesture so we can check in the timeout if it still is
- Hammer.detection.current.name = this.name;
+ this._calculateGravitationalForces();
+ this._calculateNodeForces();
- // set timer and if after the timeout it still is hold,
- // we trigger the hold event
- this.timer = setTimeout(function() {
- if(Hammer.detection.current.name == 'hold') {
- inst.trigger('hold', ev);
- }
- }, inst.options.hold_timeout);
- break;
+ if (this.constants.springConstant > 0) {
+ if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
+ this._calculateSpringForcesWithSupport();
+ }
+ else {
+ if (this.constants.physics.hierarchicalRepulsion.enabled == true) {
+ this._calculateHierarchicalSpringForces();
+ }
+ else {
+ this._calculateSpringForces();
+ }
+ }
+ }
+ };
- // when you move or end we clear the timer
- case Hammer.EVENT_MOVE:
- if(ev.distance > inst.options.hold_threshold) {
- clearTimeout(this.timer);
- }
- break;
- case Hammer.EVENT_END:
- clearTimeout(this.timer);
- break;
+ /**
+ * Smooth curves are created by adding invisible nodes in the center of the edges. These nodes are also
+ * handled in the calculateForces function. We then use a quadratic curve with the center node as control.
+ * This function joins the datanodes and invisible (called support) nodes into one object.
+ * We do this so we do not contaminate this.nodes with the support nodes.
+ *
+ * @private
+ */
+ exports._updateCalculationNodes = function () {
+ if (this.constants.smoothCurves.enabled == true && this.constants.smoothCurves.dynamic == true) {
+ this.calculationNodes = {};
+ this.calculationNodeIndices = [];
+
+ for (var nodeId in this.nodes) {
+ if (this.nodes.hasOwnProperty(nodeId)) {
+ this.calculationNodes[nodeId] = this.nodes[nodeId];
+ }
+ }
+ var supportNodes = this.sectors['support']['nodes'];
+ for (var supportNodeId in supportNodes) {
+ if (supportNodes.hasOwnProperty(supportNodeId)) {
+ if (this.edges.hasOwnProperty(supportNodes[supportNodeId].parentEdgeId)) {
+ this.calculationNodes[supportNodeId] = supportNodes[supportNodeId];
+ }
+ else {
+ supportNodes[supportNodeId]._setForce(0, 0);
}
+ }
+ }
+
+ for (var idx in this.calculationNodes) {
+ if (this.calculationNodes.hasOwnProperty(idx)) {
+ this.calculationNodeIndices.push(idx);
+ }
}
+ }
+ else {
+ this.calculationNodes = this.nodes;
+ this.calculationNodeIndices = this.nodeIndices;
+ }
};
/**
- * Tap/DoubleTap
- * Quick touch at a place or double at the same place
- * @events tap, doubletap
+ * this function applies the central gravity effect to keep groups from floating off
+ *
+ * @private
*/
- Hammer.gestures.Tap = {
- name: 'tap',
- index: 100,
- defaults: {
- tap_max_touchtime : 250,
- tap_max_distance : 10,
- tap_always : true,
- doubletap_distance : 20,
- doubletap_interval : 300
- },
- handler: function tapGesture(ev, inst) {
- if(ev.eventType == Hammer.EVENT_END) {
- // previous gesture, for the double tap since these are two different gesture detections
- var prev = Hammer.detection.previous,
- did_doubletap = false;
-
- // when the touchtime is higher then the max touch time
- // or when the moving distance is too much
- if(ev.deltaTime > inst.options.tap_max_touchtime ||
- ev.distance > inst.options.tap_max_distance) {
- return;
- }
+ exports._calculateGravitationalForces = function () {
+ var dx, dy, distance, node, i;
+ var nodes = this.calculationNodes;
+ var gravity = this.constants.physics.centralGravity;
+ var gravityForce = 0;
- // check if double tap
- if(prev && prev.name == 'tap' &&
- (ev.timeStamp - prev.lastEvent.timeStamp) < inst.options.doubletap_interval &&
- ev.distance < inst.options.doubletap_distance) {
- inst.trigger('doubletap', ev);
- did_doubletap = true;
- }
+ for (i = 0; i < this.calculationNodeIndices.length; i++) {
+ node = nodes[this.calculationNodeIndices[i]];
+ node.damping = this.constants.physics.damping; // possibly add function to alter damping properties of clusters.
+ // gravity does not apply when we are in a pocket sector
+ if (this._sector() == "default" && gravity != 0) {
+ dx = -node.x;
+ dy = -node.y;
+ distance = Math.sqrt(dx * dx + dy * dy);
- // do a single tap
- if(!did_doubletap || inst.options.tap_always) {
- Hammer.detection.current.name = 'tap';
- inst.trigger(Hammer.detection.current.name, ev);
- }
- }
+ gravityForce = (distance == 0) ? 0 : (gravity / distance);
+ node.fx = dx * gravityForce;
+ node.fy = dy * gravityForce;
+ }
+ else {
+ node.fx = 0;
+ node.fy = 0;
}
+ }
};
+
+
/**
- * Swipe
- * triggers swipe events when the end velocity is above the threshold
- * @events swipe, swipeleft, swiperight, swipeup, swipedown
+ * this function calculates the effects of the springs in the case of unsmooth curves.
+ *
+ * @private
*/
- Hammer.gestures.Swipe = {
- name: 'swipe',
- index: 40,
- defaults: {
- // set 0 for unlimited, but this can conflict with transform
- swipe_max_touches : 1,
- swipe_velocity : 0.7
- },
- handler: function swipeGesture(ev, inst) {
- if(ev.eventType == Hammer.EVENT_END) {
- // max touches
- if(inst.options.swipe_max_touches > 0 &&
- ev.touches.length > inst.options.swipe_max_touches) {
- return;
- }
+ exports._calculateSpringForces = function () {
+ var edgeLength, edge, edgeId;
+ var dx, dy, fx, fy, springForce, distance;
+ var edges = this.edges;
- // when the distance we moved is too small we skip this gesture
- // or we can be already in dragging
- if(ev.velocityX > inst.options.swipe_velocity ||
- ev.velocityY > inst.options.swipe_velocity) {
- // trigger swipe events
- inst.trigger(this.name, ev);
- inst.trigger(this.name + ev.direction, ev);
- }
+ // forces caused by the edges, modelled as springs
+ for (edgeId in edges) {
+ if (edges.hasOwnProperty(edgeId)) {
+ edge = edges[edgeId];
+ if (edge.connected) {
+ // only calculate forces if nodes are in the same sector
+ if (this.nodes.hasOwnProperty(edge.toId) && this.nodes.hasOwnProperty(edge.fromId)) {
+ edgeLength = edge.customLength ? edge.length : this.constants.physics.springLength;
+ // this implies that the edges between big clusters are longer
+ edgeLength += (edge.to.clusterSize + edge.from.clusterSize - 2) * this.constants.clustering.edgeGrowth;
+
+ dx = (edge.from.x - edge.to.x);
+ dy = (edge.from.y - edge.to.y);
+ distance = Math.sqrt(dx * dx + dy * dy);
+
+ if (distance == 0) {
+ distance = 0.01;
+ }
+
+ // the 1/distance is so the fx and fy can be calculated without sine or cosine.
+ springForce = this.constants.physics.springConstant * (edgeLength - distance) / distance;
+
+ fx = dx * springForce;
+ fy = dy * springForce;
+
+ edge.from.fx += fx;
+ edge.from.fy += fy;
+ edge.to.fx -= fx;
+ edge.to.fy -= fy;
}
+ }
}
+ }
};
+
+
/**
- * Drag
- * Move with x fingers (default 1) around on the page. Blocking the scrolling when
- * moving left and right is a good practice. When all the drag events are blocking
- * you disable scrolling on that area.
- * @events drag, drapleft, dragright, dragup, dragdown
+ * This function calculates the springforces on the nodes, accounting for the support nodes.
+ *
+ * @private
*/
- Hammer.gestures.Drag = {
- name: 'drag',
- index: 50,
- defaults: {
- drag_min_distance : 10,
- // set 0 for unlimited, but this can conflict with transform
- drag_max_touches : 1,
- // prevent default browser behavior when dragging occurs
- // be careful with it, it makes the element a blocking element
- // when you are using the drag gesture, it is a good practice to set this true
- drag_block_horizontal : false,
- drag_block_vertical : false,
- // drag_lock_to_axis keeps the drag gesture on the axis that it started on,
- // It disallows vertical directions if the initial direction was horizontal, and vice versa.
- drag_lock_to_axis : false,
- // drag lock only kicks in when distance > drag_lock_min_distance
- // This way, locking occurs only when the distance has become large enough to reliably determine the direction
- drag_lock_min_distance : 25
- },
- triggered: false,
- handler: function dragGesture(ev, inst) {
- // current gesture isnt drag, but dragged is true
- // this means an other gesture is busy. now call dragend
- if(Hammer.detection.current.name != this.name && this.triggered) {
- inst.trigger(this.name +'end', ev);
- this.triggered = false;
- return;
- }
-
- // max touches
- if(inst.options.drag_max_touches > 0 &&
- ev.touches.length > inst.options.drag_max_touches) {
- return;
- }
+ exports._calculateSpringForcesWithSupport = function () {
+ var edgeLength, edge, edgeId, combinedClusterSize;
+ var edges = this.edges;
- switch(ev.eventType) {
- case Hammer.EVENT_START:
- this.triggered = false;
- break;
+ // forces caused by the edges, modelled as springs
+ for (edgeId in edges) {
+ if (edges.hasOwnProperty(edgeId)) {
+ edge = edges[edgeId];
+ if (edge.connected) {
+ // only calculate forces if nodes are in the same sector
+ if (this.nodes.hasOwnProperty(edge.toId) && this.nodes.hasOwnProperty(edge.fromId)) {
+ if (edge.via != null) {
+ var node1 = edge.to;
+ var node2 = edge.via;
+ var node3 = edge.from;
- case Hammer.EVENT_MOVE:
- // when the distance we moved is too small we skip this gesture
- // or we can be already in dragging
- if(ev.distance < inst.options.drag_min_distance &&
- Hammer.detection.current.name != this.name) {
- return;
- }
+ edgeLength = edge.customLength ? edge.length : this.constants.physics.springLength;
- // we are dragging!
- Hammer.detection.current.name = this.name;
+ combinedClusterSize = node1.clusterSize + node3.clusterSize - 2;
- // lock drag to axis?
- if(Hammer.detection.current.lastEvent.drag_locked_to_axis || (inst.options.drag_lock_to_axis && inst.options.drag_lock_min_distance<=ev.distance)) {
- ev.drag_locked_to_axis = true;
- }
- var last_direction = Hammer.detection.current.lastEvent.direction;
- if(ev.drag_locked_to_axis && last_direction !== ev.direction) {
- // keep direction on the axis that the drag gesture started on
- if(Hammer.utils.isVertical(last_direction)) {
- ev.direction = (ev.deltaY < 0) ? Hammer.DIRECTION_UP : Hammer.DIRECTION_DOWN;
- }
- else {
- ev.direction = (ev.deltaX < 0) ? Hammer.DIRECTION_LEFT : Hammer.DIRECTION_RIGHT;
- }
- }
+ // this implies that the edges between big clusters are longer
+ edgeLength += combinedClusterSize * this.constants.clustering.edgeGrowth;
+ this._calculateSpringForce(node1, node2, 0.5 * edgeLength);
+ this._calculateSpringForce(node2, node3, 0.5 * edgeLength);
+ }
+ }
+ }
+ }
+ }
+ };
- // first time, trigger dragstart event
- if(!this.triggered) {
- inst.trigger(this.name +'start', ev);
- this.triggered = true;
- }
- // trigger normal event
- inst.trigger(this.name, ev);
+ /**
+ * This is the code actually performing the calculation for the function above. It is split out to avoid repetition.
+ *
+ * @param node1
+ * @param node2
+ * @param edgeLength
+ * @private
+ */
+ exports._calculateSpringForce = function (node1, node2, edgeLength) {
+ var dx, dy, fx, fy, springForce, distance;
- // direction event, like dragdown
- inst.trigger(this.name + ev.direction, ev);
+ dx = (node1.x - node2.x);
+ dy = (node1.y - node2.y);
+ distance = Math.sqrt(dx * dx + dy * dy);
- // block the browser events
- if( (inst.options.drag_block_vertical && Hammer.utils.isVertical(ev.direction)) ||
- (inst.options.drag_block_horizontal && !Hammer.utils.isVertical(ev.direction))) {
- ev.preventDefault();
- }
- break;
+ if (distance == 0) {
+ distance = 0.01;
+ }
- case Hammer.EVENT_END:
- // trigger dragend
- if(this.triggered) {
- inst.trigger(this.name +'end', ev);
- }
+ // the 1/distance is so the fx and fy can be calculated without sine or cosine.
+ springForce = this.constants.physics.springConstant * (edgeLength - distance) / distance;
- this.triggered = false;
- break;
- }
- }
+ fx = dx * springForce;
+ fy = dy * springForce;
+
+ node1.fx += fx;
+ node1.fy += fy;
+ node2.fx -= fx;
+ node2.fy -= fy;
};
/**
- * Transform
- * User want to scale or rotate with 2 fingers
- * @events transform, pinch, pinchin, pinchout, rotate
+ * Load the HTML for the physics config and bind it
+ * @private
*/
- Hammer.gestures.Transform = {
- name: 'transform',
- index: 45,
- defaults: {
- // factor, no scale is 1, zoomin is to 0 and zoomout until higher then 1
- transform_min_scale : 0.01,
- // rotation in degrees
- transform_min_rotation : 1,
- // prevent default browser behavior when two touches are on the screen
- // but it makes the element a blocking element
- // when you are using the transform gesture, it is a good practice to set this true
- transform_always_block : false
- },
- triggered: false,
- handler: function transformGesture(ev, inst) {
- // current gesture isnt drag, but dragged is true
- // this means an other gesture is busy. now call dragend
- if(Hammer.detection.current.name != this.name && this.triggered) {
- inst.trigger(this.name +'end', ev);
- this.triggered = false;
- return;
- }
+ exports._loadPhysicsConfiguration = function () {
+ if (this.physicsConfiguration === undefined) {
+ this.backupConstants = {};
+ util.deepExtend(this.backupConstants,this.constants);
- // atleast multitouch
- if(ev.touches.length < 2) {
- return;
- }
+ var hierarchicalLayoutDirections = ["LR", "RL", "UD", "DU"];
+ this.physicsConfiguration = document.createElement('div');
+ this.physicsConfiguration.className = "PhysicsConfiguration";
+ this.physicsConfiguration.innerHTML = '' +
+ '
Simulation Mode:
' +
+ '
' +
+ '
Barnes Hut
' +
+ '
Repulsion
' +
+ '
Hierarchical
' +
+ '
' +
+ '
' +
+ '
' +
+ '
Barnes Hut
' +
+ '
' +
+ '
gravitationalConstant
0
-20000
' +
+ '
' +
+ '
' +
+ '
centralGravity
0
3
' +
+ '
' +
+ '
' +
+ '
springLength
0
500
' +
+ '
' +
+ '
' +
+ '
springConstant
0
0.5
' +
+ '
' +
+ '
' +
+ '
damping
0
0.3
' +
+ '
' +
+ '
' +
+ '
' +
+ '
Repulsion
' +
+ '
' +
+ '
nodeDistance
0
300
' +
+ '
' +
+ '
' +
+ '
centralGravity
0
3
' +
+ '
' +
+ '
' +
+ '
springLength
0
500
' +
+ '
' +
+ '
' +
+ '
springConstant
0
0.5
' +
+ '
' +
+ '
' +
+ '
damping
0
0.3
' +
+ '
' +
+ '
' +
+ '
' +
+ '
Hierarchical
' +
+ '
' +
+ '
nodeDistance
0
300
' +
+ '
' +
+ '
' +
+ '
centralGravity
0
3
' +
+ '
' +
+ '
' +
+ '
springLength
0
500
' +
+ '
' +
+ '
' +
+ '
springConstant
0
0.5
' +
+ '
' +
+ '
' +
+ '
damping
0
0.3
' +
+ '
' +
+ '
' +
+ '
direction
1
4
' +
+ '
' +
+ '
' +
+ '
levelSeparation
1
500
' +
+ '
' +
+ '
' +
+ '
nodeSpacing
1
500
' +
+ '
' +
+ '
' +
+ '
Options:
' +
+ '
' +
+ '
' +
+ '
' +
+ '
' +
+ '
' +
+ '
'
+ this.containerElement.parentElement.insertBefore(this.physicsConfiguration, this.containerElement);
+ this.optionsDiv = document.createElement("div");
+ this.optionsDiv.style.fontSize = "14px";
+ this.optionsDiv.style.fontFamily = "verdana";
+ this.containerElement.parentElement.insertBefore(this.optionsDiv, this.containerElement);
- // prevent default when two fingers are on the screen
- if(inst.options.transform_always_block) {
- ev.preventDefault();
- }
+ var rangeElement;
+ rangeElement = document.getElementById('graph_BH_gc');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_gc', -1, "physics_barnesHut_gravitationalConstant");
+ rangeElement = document.getElementById('graph_BH_cg');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_cg', 1, "physics_centralGravity");
+ rangeElement = document.getElementById('graph_BH_sc');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_sc', 1, "physics_springConstant");
+ rangeElement = document.getElementById('graph_BH_sl');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_sl', 1, "physics_springLength");
+ rangeElement = document.getElementById('graph_BH_damp');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_BH_damp', 1, "physics_damping");
- switch(ev.eventType) {
- case Hammer.EVENT_START:
- this.triggered = false;
- break;
+ rangeElement = document.getElementById('graph_R_nd');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_nd', 1, "physics_repulsion_nodeDistance");
+ rangeElement = document.getElementById('graph_R_cg');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_cg', 1, "physics_centralGravity");
+ rangeElement = document.getElementById('graph_R_sc');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_sc', 1, "physics_springConstant");
+ rangeElement = document.getElementById('graph_R_sl');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_sl', 1, "physics_springLength");
+ rangeElement = document.getElementById('graph_R_damp');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_R_damp', 1, "physics_damping");
- case Hammer.EVENT_MOVE:
- var scale_threshold = Math.abs(1-ev.scale);
- var rotation_threshold = Math.abs(ev.rotation);
+ rangeElement = document.getElementById('graph_H_nd');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_nd', 1, "physics_hierarchicalRepulsion_nodeDistance");
+ rangeElement = document.getElementById('graph_H_cg');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_cg', 1, "physics_centralGravity");
+ rangeElement = document.getElementById('graph_H_sc');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_sc', 1, "physics_springConstant");
+ rangeElement = document.getElementById('graph_H_sl');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_sl', 1, "physics_springLength");
+ rangeElement = document.getElementById('graph_H_damp');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_damp', 1, "physics_damping");
+ rangeElement = document.getElementById('graph_H_direction');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_direction', hierarchicalLayoutDirections, "hierarchicalLayout_direction");
+ rangeElement = document.getElementById('graph_H_levsep');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_levsep', 1, "hierarchicalLayout_levelSeparation");
+ rangeElement = document.getElementById('graph_H_nspac');
+ rangeElement.onchange = showValueOfRange.bind(this, 'graph_H_nspac', 1, "hierarchicalLayout_nodeSpacing");
- // when the distance we moved is too small we skip this gesture
- // or we can be already in dragging
- if(scale_threshold < inst.options.transform_min_scale &&
- rotation_threshold < inst.options.transform_min_rotation) {
- return;
- }
+ var radioButton1 = document.getElementById("graph_physicsMethod1");
+ var radioButton2 = document.getElementById("graph_physicsMethod2");
+ var radioButton3 = document.getElementById("graph_physicsMethod3");
+ radioButton2.checked = true;
+ if (this.constants.physics.barnesHut.enabled) {
+ radioButton1.checked = true;
+ }
+ if (this.constants.hierarchicalLayout.enabled) {
+ radioButton3.checked = true;
+ }
- // we are transforming!
- Hammer.detection.current.name = this.name;
+ var graph_toggleSmooth = document.getElementById("graph_toggleSmooth");
+ var graph_repositionNodes = document.getElementById("graph_repositionNodes");
+ var graph_generateOptions = document.getElementById("graph_generateOptions");
- // first time, trigger dragstart event
- if(!this.triggered) {
- inst.trigger(this.name +'start', ev);
- this.triggered = true;
- }
+ graph_toggleSmooth.onclick = graphToggleSmoothCurves.bind(this);
+ graph_repositionNodes.onclick = graphRepositionNodes.bind(this);
+ graph_generateOptions.onclick = graphGenerateOptions.bind(this);
+ if (this.constants.smoothCurves == true && this.constants.dynamicSmoothCurves == false) {
+ graph_toggleSmooth.style.background = "#A4FF56";
+ }
+ else {
+ graph_toggleSmooth.style.background = "#FF8532";
+ }
- inst.trigger(this.name, ev); // basic transform event
- // trigger rotate event
- if(rotation_threshold > inst.options.transform_min_rotation) {
- inst.trigger('rotate', ev);
- }
+ switchConfigurations.apply(this);
- // trigger pinch event
- if(scale_threshold > inst.options.transform_min_scale) {
- inst.trigger('pinch', ev);
- inst.trigger('pinch'+ ((ev.scale < 1) ? 'in' : 'out'), ev);
- }
- break;
+ radioButton1.onchange = switchConfigurations.bind(this);
+ radioButton2.onchange = switchConfigurations.bind(this);
+ radioButton3.onchange = switchConfigurations.bind(this);
+ }
+ };
+
+ /**
+ * This overwrites the this.constants.
+ *
+ * @param constantsVariableName
+ * @param value
+ * @private
+ */
+ exports._overWriteGraphConstants = function (constantsVariableName, value) {
+ var nameArray = constantsVariableName.split("_");
+ if (nameArray.length == 1) {
+ this.constants[nameArray[0]] = value;
+ }
+ else if (nameArray.length == 2) {
+ this.constants[nameArray[0]][nameArray[1]] = value;
+ }
+ else if (nameArray.length == 3) {
+ this.constants[nameArray[0]][nameArray[1]][nameArray[2]] = value;
+ }
+ };
- case Hammer.EVENT_END:
- // trigger dragend
- if(this.triggered) {
- inst.trigger(this.name +'end', ev);
- }
- this.triggered = false;
- break;
- }
- }
- };
+ /**
+ * this function is bound to the toggle smooth curves button. That is also why it is not in the prototype.
+ */
+ function graphToggleSmoothCurves () {
+ this.constants.smoothCurves.enabled = !this.constants.smoothCurves.enabled;
+ var graph_toggleSmooth = document.getElementById("graph_toggleSmooth");
+ if (this.constants.smoothCurves.enabled == true) {graph_toggleSmooth.style.background = "#A4FF56";}
+ else {graph_toggleSmooth.style.background = "#FF8532";}
+ this._configureSmoothCurves(false);
+ }
/**
- * Touch
- * Called as first, tells the user has touched the screen
- * @events touch
+ * this function is used to scramble the nodes
+ *
*/
- Hammer.gestures.Touch = {
- name: 'touch',
- index: -Infinity,
- defaults: {
- // call preventDefault at touchstart, and makes the element blocking by
- // disabling the scrolling of the page, but it improves gestures like
- // transforming and dragging.
- // be careful with using this, it can be very annoying for users to be stuck
- // on the page
- prevent_default: false,
+ function graphRepositionNodes () {
+ for (var nodeId in this.calculationNodes) {
+ if (this.calculationNodes.hasOwnProperty(nodeId)) {
+ this.calculationNodes[nodeId].vx = 0; this.calculationNodes[nodeId].vy = 0;
+ this.calculationNodes[nodeId].fx = 0; this.calculationNodes[nodeId].fy = 0;
+ }
+ }
+ if (this.constants.hierarchicalLayout.enabled == true) {
+ this._setupHierarchicalLayout();
+ }
+ else {
+ this.repositionNodes();
+ }
+ this.moving = true;
+ this.start();
+ }
- // disable mouse events, so only touch (or pen!) input triggers events
- prevent_mouseevents: false
- },
- handler: function touchGesture(ev, inst) {
- if(inst.options.prevent_mouseevents && ev.pointerType == Hammer.POINTER_MOUSE) {
- ev.stopDetect();
- return;
+ /**
+ * this is used to generate an options file from the playing with physics system.
+ */
+ function graphGenerateOptions () {
+ var options = "No options are required, default values used.";
+ var optionsSpecific = [];
+ var radioButton1 = document.getElementById("graph_physicsMethod1");
+ var radioButton2 = document.getElementById("graph_physicsMethod2");
+ if (radioButton1.checked == true) {
+ if (this.constants.physics.barnesHut.gravitationalConstant != this.backupConstants.physics.barnesHut.gravitationalConstant) {optionsSpecific.push("gravitationalConstant: " + this.constants.physics.barnesHut.gravitationalConstant);}
+ if (this.constants.physics.centralGravity != this.backupConstants.physics.barnesHut.centralGravity) {optionsSpecific.push("centralGravity: " + this.constants.physics.centralGravity);}
+ if (this.constants.physics.springLength != this.backupConstants.physics.barnesHut.springLength) {optionsSpecific.push("springLength: " + this.constants.physics.springLength);}
+ if (this.constants.physics.springConstant != this.backupConstants.physics.barnesHut.springConstant) {optionsSpecific.push("springConstant: " + this.constants.physics.springConstant);}
+ if (this.constants.physics.damping != this.backupConstants.physics.barnesHut.damping) {optionsSpecific.push("damping: " + this.constants.physics.damping);}
+ if (optionsSpecific.length != 0) {
+ options = "var options = {";
+ options += "physics: {barnesHut: {";
+ for (var i = 0; i < optionsSpecific.length; i++) {
+ options += optionsSpecific[i];
+ if (i < optionsSpecific.length - 1) {
+ options += ", "
}
-
- if(inst.options.prevent_default) {
- ev.preventDefault();
+ }
+ options += '}}'
+ }
+ if (this.constants.smoothCurves.enabled != this.backupConstants.smoothCurves.enabled) {
+ if (optionsSpecific.length == 0) {options = "var options = {";}
+ else {options += ", "}
+ options += "smoothCurves: " + this.constants.smoothCurves.enabled;
+ }
+ if (options != "No options are required, default values used.") {
+ options += '};'
+ }
+ }
+ else if (radioButton2.checked == true) {
+ options = "var options = {";
+ options += "physics: {barnesHut: {enabled: false}";
+ if (this.constants.physics.repulsion.nodeDistance != this.backupConstants.physics.repulsion.nodeDistance) {optionsSpecific.push("nodeDistance: " + this.constants.physics.repulsion.nodeDistance);}
+ if (this.constants.physics.centralGravity != this.backupConstants.physics.repulsion.centralGravity) {optionsSpecific.push("centralGravity: " + this.constants.physics.centralGravity);}
+ if (this.constants.physics.springLength != this.backupConstants.physics.repulsion.springLength) {optionsSpecific.push("springLength: " + this.constants.physics.springLength);}
+ if (this.constants.physics.springConstant != this.backupConstants.physics.repulsion.springConstant) {optionsSpecific.push("springConstant: " + this.constants.physics.springConstant);}
+ if (this.constants.physics.damping != this.backupConstants.physics.repulsion.damping) {optionsSpecific.push("damping: " + this.constants.physics.damping);}
+ if (optionsSpecific.length != 0) {
+ options += ", repulsion: {";
+ for (var i = 0; i < optionsSpecific.length; i++) {
+ options += optionsSpecific[i];
+ if (i < optionsSpecific.length - 1) {
+ options += ", "
}
-
- if(ev.eventType == Hammer.EVENT_START) {
- inst.trigger(this.name, ev);
+ }
+ options += '}}'
+ }
+ if (optionsSpecific.length == 0) {options += "}"}
+ if (this.constants.smoothCurves != this.backupConstants.smoothCurves) {
+ options += ", smoothCurves: " + this.constants.smoothCurves;
+ }
+ options += '};'
+ }
+ else {
+ options = "var options = {";
+ if (this.constants.physics.hierarchicalRepulsion.nodeDistance != this.backupConstants.physics.hierarchicalRepulsion.nodeDistance) {optionsSpecific.push("nodeDistance: " + this.constants.physics.hierarchicalRepulsion.nodeDistance);}
+ if (this.constants.physics.centralGravity != this.backupConstants.physics.hierarchicalRepulsion.centralGravity) {optionsSpecific.push("centralGravity: " + this.constants.physics.centralGravity);}
+ if (this.constants.physics.springLength != this.backupConstants.physics.hierarchicalRepulsion.springLength) {optionsSpecific.push("springLength: " + this.constants.physics.springLength);}
+ if (this.constants.physics.springConstant != this.backupConstants.physics.hierarchicalRepulsion.springConstant) {optionsSpecific.push("springConstant: " + this.constants.physics.springConstant);}
+ if (this.constants.physics.damping != this.backupConstants.physics.hierarchicalRepulsion.damping) {optionsSpecific.push("damping: " + this.constants.physics.damping);}
+ if (optionsSpecific.length != 0) {
+ options += "physics: {hierarchicalRepulsion: {";
+ for (var i = 0; i < optionsSpecific.length; i++) {
+ options += optionsSpecific[i];
+ if (i < optionsSpecific.length - 1) {
+ options += ", ";
}
+ }
+ options += '}},';
}
- };
+ options += 'hierarchicalLayout: {';
+ optionsSpecific = [];
+ if (this.constants.hierarchicalLayout.direction != this.backupConstants.hierarchicalLayout.direction) {optionsSpecific.push("direction: " + this.constants.hierarchicalLayout.direction);}
+ if (Math.abs(this.constants.hierarchicalLayout.levelSeparation) != this.backupConstants.hierarchicalLayout.levelSeparation) {optionsSpecific.push("levelSeparation: " + this.constants.hierarchicalLayout.levelSeparation);}
+ if (this.constants.hierarchicalLayout.nodeSpacing != this.backupConstants.hierarchicalLayout.nodeSpacing) {optionsSpecific.push("nodeSpacing: " + this.constants.hierarchicalLayout.nodeSpacing);}
+ if (optionsSpecific.length != 0) {
+ for (var i = 0; i < optionsSpecific.length; i++) {
+ options += optionsSpecific[i];
+ if (i < optionsSpecific.length - 1) {
+ options += ", "
+ }
+ }
+ options += '}'
+ }
+ else {
+ options += "enabled:true}";
+ }
+ options += '};'
+ }
+ this.optionsDiv.innerHTML = options;
+ }
+
/**
- * Release
- * Called as last, tells the user has released the screen
- * @events release
+ * this is used to switch between barnesHut, repulsion and hierarchical.
+ *
*/
- Hammer.gestures.Release = {
- name: 'release',
- index: Infinity,
- handler: function releaseGesture(ev, inst) {
- if(ev.eventType == Hammer.EVENT_END) {
- inst.trigger(this.name, ev);
- }
+ function switchConfigurations () {
+ var ids = ["graph_BH_table", "graph_R_table", "graph_H_table"];
+ var radioButton = document.querySelector('input[name="graph_physicsMethod"]:checked').value;
+ var tableId = "graph_" + radioButton + "_table";
+ var table = document.getElementById(tableId);
+ table.style.display = "block";
+ for (var i = 0; i < ids.length; i++) {
+ if (ids[i] != tableId) {
+ table = document.getElementById(ids[i]);
+ table.style.display = "none";
}
- };
-
- // node export
- if(typeof module === 'object' && typeof module.exports === 'object'){
- module.exports = Hammer;
+ }
+ this._restoreNodes();
+ if (radioButton == "R") {
+ this.constants.hierarchicalLayout.enabled = false;
+ this.constants.physics.hierarchicalRepulsion.enabled = false;
+ this.constants.physics.barnesHut.enabled = false;
+ }
+ else if (radioButton == "H") {
+ if (this.constants.hierarchicalLayout.enabled == false) {
+ this.constants.hierarchicalLayout.enabled = true;
+ this.constants.physics.hierarchicalRepulsion.enabled = true;
+ this.constants.physics.barnesHut.enabled = false;
+ this.constants.smoothCurves.enabled = false;
+ this._setupHierarchicalLayout();
+ }
+ }
+ else {
+ this.constants.hierarchicalLayout.enabled = false;
+ this.constants.physics.hierarchicalRepulsion.enabled = false;
+ this.constants.physics.barnesHut.enabled = true;
+ }
+ this._loadSelectedForceSolver();
+ var graph_toggleSmooth = document.getElementById("graph_toggleSmooth");
+ if (this.constants.smoothCurves.enabled == true) {graph_toggleSmooth.style.background = "#A4FF56";}
+ else {graph_toggleSmooth.style.background = "#FF8532";}
+ this.moving = true;
+ this.start();
}
- // just window export
- else {
- window.Hammer = Hammer;
- // requireJS module definition
- if(typeof window.define === 'function' && window.define.amd) {
- window.define('hammer', [], function() {
- return Hammer;
- });
- }
+
+ /**
+ * this generates the ranges depending on the iniital values.
+ *
+ * @param id
+ * @param map
+ * @param constantsVariableName
+ */
+ function showValueOfRange (id,map,constantsVariableName) {
+ var valueId = id + "_value";
+ var rangeValue = document.getElementById(id).value;
+
+ if (map instanceof Array) {
+ document.getElementById(valueId).value = map[parseInt(rangeValue)];
+ this._overWriteGraphConstants(constantsVariableName,map[parseInt(rangeValue)]);
+ }
+ else {
+ document.getElementById(valueId).value = parseInt(map) * parseFloat(rangeValue);
+ this._overWriteGraphConstants(constantsVariableName, parseInt(map) * parseFloat(rangeValue));
+ }
+
+ if (constantsVariableName == "hierarchicalLayout_direction" ||
+ constantsVariableName == "hierarchicalLayout_levelSeparation" ||
+ constantsVariableName == "hierarchicalLayout_nodeSpacing") {
+ this._setupHierarchicalLayout();
+ }
+ this.moving = true;
+ this.start();
}
- })(this);
+
/***/ },
/* 51 */
diff --git a/dist/vis.map b/dist/vis.map
index 8a922d24..8caf28f0 100644
--- a/dist/vis.map
+++ b/dist/vis.map
@@ -1 +1 @@
-{"version":3,"file":"vis.map","sources":["./dist/vis.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","util","DOMutil","DataSet","DataView","Graph3d","Timeline","Graph2d","timeline","DataStep","Range","stack","TimeStep","components","items","Item","ItemBox","ItemPoint","ItemRange","Component","CurrentTime","CustomTime","DataAxis","GraphGroup","Group","ItemSet","Legend","LineGraph","TimeAxis","Network","network","Edge","Groups","Images","Node","Popup","dotparser","Graph","Error","Hammer","moment","isNumber","object","Number","isString","String","isDate","Date","match","ASPDateRegex","exec","isNaN","parse","isDataTable","google","visualization","DataTable","randomUUID","S4","Math","floor","random","toString","extend","a","i","len","arguments","length","other","prop","hasOwnProperty","selectiveExtend","props","Array","isArray","selectiveDeepExtend","b","TypeError","constructor","Object","undefined","deepExtend","equalArray","convert","type","Boolean","valueOf","isMoment","toDate","getType","toISOString","value","getAbsoluteLeft","elem","doc","document","documentElement","body","left","offsetLeft","e","offsetParent","scrollLeft","getAbsoluteTop","top","offsetTop","scrollTop","getPageY","event","pageY","clientY","targetTouches","clientTop","getPageX","pageX","clientX","clientLeft","addClassName","className","classes","split","indexOf","push","join","removeClassName","index","splice","forEach","callback","toArray","array","updateProperty","key","addEventListener","element","action","listener","useCapture","navigator","userAgent","attachEvent","removeEventListener","detachEvent","getTarget","window","target","srcElement","nodeType","parentNode","fakeGesture","eventType","gesture","collectEventData","center","option","asBoolean","defaultValue","asNumber","asString","asSize","asElement","GiveDec","Hex","Value","eval","GiveHex","Dec","parseColor","color","isValidHex","hsv","hexToHSV","lighterColorHSV","h","s","v","min","darkerColorHSV","darkerColorHex","HSVToHex","lighterColorHex","background","border","highlight","hover","hexToRGB","hex","replace","toUpperCase","substring","d","f","r","g","RGBToHex","red","green","blue","RGBToHSV","minRGB","maxRGB","max","hue","saturation","HSVToRGB","q","t","rgb","isOk","test","selectiveBridgeObject","fields","referenceObject","objectTo","create","bridgeObject","mergeOptions","mergeTarget","options","enabled","binarySearch","orderedItems","range","field","field2","found","end","start","low","high","newLow","newHigh","guess","isVisible","binarySearchGeneric","sidePreference","newGuess","prevValue","nextValue","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","removeChild","getSVGElement","svgContainer","shift","createElementNS","appendChild","getDOMElement","DOMContainer","createElement","drawPoint","x","y","group","point","drawPoints","style","setAttributeNS","size","drawBar","width","height","rect","data","_options","_data","_fieldId","fieldId","_type","_subscribers","add","prototype","on","subscribers","subscribe","off","filter","unsubscribe","_trigger","params","senderId","concat","subscriber","addedIds","me","_addItem","columns","_getColumnNames","row","rows","getNumberOfRows","item","col","cols","getValue","update","updatedIds","addOrUpdate","_updateItem","get","ids","firstType","returnType","itemId","_getItem","order","_sort","_filterFields","_appendRow","getIds","getDataSet","map","mappedItems","filteredItem","name","sort","av","bv","remove","removedId","removedIds","_remove","clear","keys","maxField","itemField","minField","distinct","values","fieldType","count","exists","types","raw","converted","JSON","stringify","dataTable","getNumberOfColumns","getColumnId","getColumnLabel","addRow","setValue","_ids","_onEvent","apply","setData","viewOptions","getArguments","defaultFilter","dataSet","added","updated","removed","container","SyntaxError","containerElement","margin","defaultXCenter","defaultYCenter","xLabel","yLabel","zLabel","filterLabel","legendLabel","STYLE","DOT","showPerspective","showGrid","keepAspectRatio","showShadow","showGrayBottom","showTooltip","verticalRatio","animationInterval","animationPreload","camera","Camera","eye","Point3d","dataPoints","colX","colY","colZ","colValue","colFilter","xMin","xStep","xMax","yMin","yStep","yMax","zMin","zStep","zMax","valueMin","valueMax","xBarWidth","yBarWidth","colorAxis","colorGrid","colorDot","colorDotBorder","setOptions","Slider","visible","frame","position","prev","play","next","bar","borderRadius","MozBorderRadius","backgroundColor","slide","onmousedown","_onMouseDown","onclick","togglePlay","onChangeCallback","playTimeout","playInterval","playLoop","Emitter","Point2d","Filter","StepNumber","armLocation","armRotation","horizontal","vertical","armLength","cameraLocation","cameraRotation","PI","calculateCameraOrientation","setArmLocation","z","setArmRotation","getArmRotation","rot","setArmLength","getArmLength","getCameraLocation","getCameraRotation","sin","cos","_setScale","scale","xCenter","yCenter","zCenter","_convert3Dto2D","point3d","translation","_convertPointToTranslation","_convertTranslationToScreen","ax","ay","az","cx","cy","cz","sinTx","cosTx","sinTy","cosTy","sinTz","cosTz","dx","dy","dz","bx","by","ex","ey","ez","xcenter","canvas","clientWidth","ycenter","_setBackgroundColor","fill","stroke","strokeWidth","borderColor","borderWidth","borderStyle","BAR","BARCOLOR","BARSIZE","DOTLINE","DOTCOLOR","DOTSIZE","GRID","LINE","SURFACE","_getStyleNumber","styleName","_determineColumnIndexes","counter","column","getDistinctValues","distinctValues","getColumnRange","minMax","_dataInitialize","rawData","_onChange","dataFilter","setOnLoadCallback","redraw","withBars","defaultXBarWidth","dataX","defaultYBarWidth","dataY","xRange","defaultXMin","defaultXMax","defaultXStep","yRange","defaultYMin","defaultYMax","defaultYStep","zRange","defaultZMin","defaultZMax","defaultZStep","valueRange","defaultValueMin","defaultValueMax","_getDataPoints","sortNumber","obj","dataMatrix","xIndex","yIndex","trans","screen","bottom","pointRight","pointTop","pointCross","hasChildNodes","firstChild","overflow","noCanvas","fontWeight","padding","innerHTML","ontouchstart","_onTouchStart","onmousewheel","_onWheel","ontooltip","_onTooltip","G3DaddEventListener","onkeydown","setSize","_resizeCanvas","clientHeight","animationStart","slider","animationStop","stop","_resizeCenter","charAt","parseFloat","setCameraPosition","pos","distance","getCameraPosition","_readData","_redrawFilter","animationAutoStart","cameraPosition","styleNumber","tooltip","showAnimationControls","_redrawSlider","_redrawClear","_redrawAxis","_redrawDataGrid","_redrawDataLine","_redrawDataBar","_redrawDataDot","_redrawInfo","_redrawLegend","ctx","getContext","clearRect","widthMin","widthMax","dotSize","right","lineWidth","font","ymin","ymax","_hsv2rgb","strokeStyle","beginPath","moveTo","lineTo","strokeRect","fillStyle","closePath","gridLineLen","step","getCurrent","textAlign","textBaseline","fillText","label","setValues","setPlayInterval","onchange","getIndex","selectValue","setOnChangeCallback","lineStyle","getLabel","getSelectedValue","from","to","prettyStep","text","xText","yText","zText","offset","xOffset","yOffset","xMin2d","xMax2d","gridLenX","gridLenY","textMargin","armAngle","H","S","V","R","G","B","C","Hi","X","abs","parseInt","cross","topSideVisible","zAvg","transBottom","dist","sortDepth","aDiff","subtract","bDiff","crossproduct","crossProduct","radius","arc","j","surface","corners","xWidth","yWidth","surfaces","avg","transCenter","diff","leftButtonDown","_onMouseUp","which","button","touchDown","startMouseX","getMouseX","startMouseY","getMouseY","startStart","startEnd","startArmRotation","cursor","onmousemove","_onMouseMove","onmouseup","G3DpreventDefault","diffX","diffY","horizontalNew","verticalNew","snapAngle","snapValue","round","parameters","emit","G3DremoveEventListener","delay","mouseX","mouseY","tooltipTimeout","clearTimeout","_hideTooltip","dataPoint","_dataPointFromXY","_showTooltip","setTimeout","ontouchmove","_onTouchMove","ontouchend","_onTouchEnd","delta","wheelDelta","detail","oldLength","newLength","_insideTriangle","triangle","sign","as","bs","cs","distMax","closestDataPoint","closestDist","triangle1","triangle2","distX","distY","sqrt","content","line","dot","dom","boxShadow","borderLeft","contentWidth","offsetWidth","contentHeight","offsetHeight","lineHeight","dotWidth","dotHeight","G3DstopPropagation","stopPropagation","cancelBubble","preventDefault","returnValue","setIndex","playNext","interval","clearInterval","getPlayInterval","setPlayLoop","doLoop","onChange","indexToLeft","startClientX","startSlideX","leftToIndex","defaultOptions","autoResize","orientation","maxHeight","minHeight","_create","domProps","emitter","bind","snap","toScreen","_toScreen","toGlobalScreen","_toGlobalScreen","toTime","_toTime","toGlobalTime","_toGlobalTime","timeAxis","currentTime","customTime","itemSet","itemsData","groupsData","setItems","backgroundVertical","backgroundHorizontal","centerContainer","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","_onTouch","_onPinch","_onDragStart","_onDrag","hammer","prevent_default","listeners","events","args","slice","scrollTopMin","touch","destroy","_stopAutoResize","component","_initAutoResize","setCustomTime","time","getCustomTime","newDataSet","initialLoad","fit","setWindow","setGroups","groups","what","dataRange","getItemRange","setRange","dataset","minItem","maxStartItem","maxEndItem","setSelection","getSelection","getWindow","getRange","resized","borderRootHeight","borderRootWidth","autoHeight","containerHeight","centerWidth","_updateScrollTop","visibilityTop","visibilityBottom","visibility","repaint","conversion","_startAutoResize","_onResize","lastWidth","lastHeight","watchTimer","setInterval","allowDragging","initialScrollTop","deltaY","oldScrollTop","_getScrollTop","newScrollTop","_setScrollTop","linegraph","backgroundHorizontalContainer","minimumStep","forcedStepSize","current","autoScale","stepIndex","marginStart","marginEnd","majorSteps","minorSteps","_start","_end","setMinimumStep","setFirst","safeSize","minimumStepValue","orderOfMagnitude","log","LN10","minorStepIdx","magnitudefactor","pow","solutionFound","stepSize","first","niceStart","niceEnd","roundToMinor","marginRange","rounded","hasNext","previous","toPrecision","isMajor","now","hours","minutes","seconds","milliseconds","clone","direction","moveable","zoomable","zoomMin","zoomMax","_onDragEnd","_onHold","_onMouseWheel","validateDirection","getPointer","changed","_applyRange","newStart","newEnd","deltaX","diffRange","pointer","pointerDate","_pointerToDate","zoom","touches","initDate","move","EPSILON","orderByStart","orderByEnd","aTime","bTime","force","iMax","axis","collidingItem","jj","collision","nostack","SCALE","DAY","MILLISECOND","SECOND","MINUTE","HOUR","WEEKDAY","MONTH","YEAR","setFullYear","getFullYear","setMonth","setDate","setHours","setMinutes","setSeconds","setMilliseconds","getMilliseconds","getSeconds","getMinutes","getHours","getDate","getMonth","setScale","newScale","newStep","setAutoScale","enable","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","stepMillisecond","date","year","getLabelMinor","format","getLabelMajor","_isResized","_previousWidth","_previousHeight","showCurrentTime","parent","title","currentTimeTimer","showCustomTime","eventParams","drag","dragging","svg","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","linegraphSVG","DOMelements","lines","labels","conversionFactor","minWidth","stepPixels","stepPixelsForced","lineOffset","master","svgElements","amountOfGroups","addGroup","graphOptions","updateGroup","removeGroup","hide","show","lineContainer","display","_redrawGroupIcons","iconHeight","iconOffset","groupId","drawIcon","changeCalled","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","minorLineWidth","minorLineHeight","majorLineWidth","majorLineHeight","_redrawLabels","amountOfSteps","stepDifference","valueAtZero","marginStartPos","maxLabelSize","_redrawLabel","_redrawLine","characterHeight","largestWidth","majorCharWidth","minorCharWidth","convertValue","invertedValue","convertedValue","textMinor","createTextNode","measureCharMinor","textMajor","measureCharMajor","groupsUsingDefaultStyles","usingDefaultStyle","zeroPosition","setZeroPosition","catmullRom","parametrization","alpha","SVGcontainer","path","fillPath","fillHeight","outline","shaded","barWidth","bar1Height","bar2Height","visibleItems","byStart","byEnd","inner","foreground","marker","Element","getLabelWidth","restack","_updateVisibleItems","markerHeight","lastMarkerHeight","dirty","displayed","ii","repositionY","labelSet","setParent","_checkIfVisible","removeFromDataSet","removeItem","_constructByEndArray","endArray","initialPosByStart","newVisibleItems","initialPosByEnd","_checkIfInvisible","repositionX","align","groupOrder","selectable","editable","updateTime","onAdd","onUpdate","onMove","onRemove","itemOptions","itemListeners","_onAdd","_onUpdate","_onRemove","groupListeners","_onAddGroups","_onUpdateGroups","_onRemoveGroups","groupIds","selection","stackDirty","touchParams","UNGROUPED","box","_updateUngrouped","_onSelectItem","_onMultiSelectItem","_onAddItem","addCallback","fn","Function","markDirty","unselect","select","_deselect","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","groupResized","firstGroupIndex","firstGroupId","ungrouped","getLabelSet","oldItemsData","getItems","_order","getGroups","itemData","_removeItem","groupData","groupOptions","oldGroupId","oldGroup","itemFromTarget","selected","dragLeftItem","dragRightItem","itemProps","groupFromTarget","changes","ctrlKey","srcEvent","shiftKey","oldSelection","newSelection","xAbs","newItem","itemSetFromTarget","side","iconSize","iconSpacing","textArea","drawLegendIcons","getComputedStyle","paddingTop","yAxisOrientation","defaultGroup","sampling","graphHeight","barChart","dataAxis","legend","lastStart","rangePerPixelInv","_updateGraph","yAxisLeft","yAxisRight","legendLeft","legendRight","_updateAllGroupData","_updateGroup","groupsContent","ungroupedCounter","preprocessedGroup","preprocessedGroupData","processedGroupData","groupRanges","minDate","maxDate","_preprocessData","_updateYAxis","_convertYvalues","_drawLineGraph","_drawBarGraph","minVal","maxVal","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","_toggleAxisVisiblity","drawIcons","axisUsed","coreDistance","_drawPoints","svgHeight","_catmullRom","_linear","dFill","datapoints","xValue","yValue","extractedData","increment","amountOfPoints","xDistance","pointsPerPixel","ceil","_catmullRomUniform","p0","p1","p2","p3","bp1","bp2","normalization","d1","d2","d3","A","N","M","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","majorLines","majorTexts","minorLines","minorTexts","lineTop","parentChanged","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","insertBefore","xFirstMajorLabel","cur","_repaintMinorText","_repaintMajorText","_repaintMajorLine","_repaintMinorLine","leftTime","leftText","widthText","arr","pop","childNodes","nodeValue","_repaintDeleteButton","anchor","deleteButton","itemSetHeight","marginLeft","baseClassName","_repaintDragLeft","_repaintDragRight","contentLeft","parentWidth","boxWidth","dragLeft","dragRight","_initializeMixinLoaders","renderRefreshRate","renderTimestep","renderTime","maxPhysicsTicksPerRender","physicsDiscreteStepsize","stabilize","initializing","triggerFunctions","edit","editEdge","connect","del","constants","nodes","radiusMin","radiusMax","shape","image","fixed","fontColor","fontSize","fontFace","level","highlightColor","edges","widthSelectionMultiplier","hoverWidth","fontFill","arrowScaleFactor","dash","gap","altLength","configurePhysics","physics","barnesHut","theta","gravitationalConstant","centralGravity","springLength","springConstant","damping","repulsion","nodeDistance","hierarchicalRepulsion","clustering","initialMaxNodes","clusterThreshold","reduceToNodes","chainThreshold","clusterEdgeThreshold","sectorThreshold","screenSizeThreshold","fontSizeMultiplier","maxFontSize","forceAmplification","distanceAmplification","edgeGrowth","nodeScaling","maxNodeSizeIncrements","activeAreaBoxSize","clusterLevelDifference","navigation","keyboard","speed","dataManipulation","initiallyVisible","hierarchicalLayout","levelSeparation","nodeSpacing","freezeForStabilization","smoothCurves","maxVelocity","minVelocity","stabilizationIterations","link","editNode","back","addDescription","linkDescription","editEdgeDescription","addError","linkError","editError","editBoundError","deleteError","deleteClusterError","dragNetwork","dragNodes","hoverObj","images","setOnloadCallback","_redraw","xIncrement","yIncrement","zoomIncrement","_loadPhysicsSystem","_loadSectorSystem","_loadClusterSystem","_loadSelectionSystem","_loadHierarchySystem","_setTranslation","freezeSimulation","cachedFunctions","calculationNodes","calculationNodeIndices","nodeIndices","canvasTopLeft","canvasBottomRight","pointerPosition","areaCenter","previousScale","nodesData","edgesData","nodesListeners","_addNodes","_updateNodes","_removeNodes","edgesListeners","_addEdges","_updateEdges","_removeEdges","moving","timer","_setupHierarchicalLayout","zoomExtent","startWithClustering","mousetrap","MixinLoader","_getScriptPath","scripts","getElementsByTagName","src","_getRange","node","minY","maxY","minX","maxX","nodeId","_findCenter","_centerNetwork","initialZoom","disableStart","zoomLevel","numberOfNodes","factor","yDistance","xZoomLevel","yZoomLevel","_updateNodeIndexList","_clearNodeIndexList","idx","dotData","DOTToGraph","_setNodes","_setEdges","_putDataInSector","_stabilize","dragGraph","onEdit","onEditEdge","onConnect","onDelete","editMode","groupname","_loadNavigationControls","_loadManipulationSystem","_configureSmoothCurves","_createKeyBinds","pinch","_onTap","_onDoubleTap","_onRelease","_onMouseMoveTitle","reset","_moveUp","_yStopMoving","_moveDown","_moveLeft","_xStopMoving","_moveRight","_zoomIn","_stopZoom","_zoomOut","_createManipulatorBar","_deleteSelected","_getPointer","pinched","_getScale","_handleTouch","_handleDragStart","_getNodeAt","_getTranslation","isSelected","_selectObject","objectId","selectionObj","xFixed","yFixed","_handleOnDrag","_XconvertDOMtoCanvas","_XconvertCanvasToDOM","_YconvertDOMtoCanvas","_YconvertCanvasToDOM","_handleTap","_handleDoubleTap","_handleOnHold","_handleOnRelease","_zoom","scaleOld","scaleFrac","tx","ty","updateClustersDefault","popupObj","_checkHidePopup","checkShow","_checkShowPopup","popupTimer","edgeId","_getEdgeAt","_hoverObject","_blurObject","lastPopupNode","getTitle","isOverlappingWith","edge","connected","popup","setPosition","setText","manipulationDiv","navigationDivs","oldNodesData","_updateSelection","angle","_resetLevels","_updateCalculationNodes","_reconnectEdges","_updateValueRange","updateLabels","setProperties","properties","oldEdgesData","oldEdge","disconnect","showInternalIds","_createBezierNodes","via","sectors","setValueRange","w","save","translate","_doInAllSectors","restore","offsetX","offsetY","canvasToDOM","DOMtoCanvas","_drawNodes","alwaysShow","setScaleAndPos","inArea","draw","sMax","_drawEdges","_drawControlNodes","_freezeDefinedNodes","_physicsTick","_restoreFrozenNodes","iterations","fixedData","_isMoving","vmin","isMoving","_discreteStepNodes","nodesPresent","discreteStepLimited","discreteStep","vminCorrected","_doInAllActiveSectors","_doInSupportSector","_animationStep","_handleNavigation","calculationTime","maxSteps","timeRequired","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","ua","toLowerCase","requiresTimeout","toggleFreeze","smooth","mass","internalMultiplier","parentEdgeId","positionBezierNode","mixin","storePosition","dataArray","allowedToMoveX","allowedToMoveY","focusOnNode","nodePosition","requiredScale","canvasCenter","distanceFromCenter","console","fromId","toId","widthSelected","customLength","originalFromId","originalToId","widthFixed","lengthFixed","controlNodesEnabled","controlNodes","positions","connectedNode","_drawLine","_drawArrow","_drawArrowCenter","_drawDashLine","attachEdge","detachEdge","xFrom","yFrom","xTo","yTo","xObj","yObj","_getDistanceToEdge","_getLineWidth","_line","midpointX","midpointY","_pointOnLine","_label","resize","_circle","_pointOnCircle","networkScaleInv","quadraticCurveTo","measureText","fillRect","mozDash","setLineDash","pattern","lineDashOffset","mozDashOffset","lineCap","dashedLine","percentage","atan2","arrow","edgeSegmentLength","fromBorderDist","distanceToBorder","fromBorderPoint","toBorderDist","toBorderPoint","x1","y1","x2","y2","x3","y3","minDistance","px","py","something","u","nodeIdFrom","nodeIdTo","getControlNodePositions","_enableControlNodes","_disableControlNodes","_getSelectedControlNode","fromDistance","toDistance","_restoreControlNodes","defaultIndex","DEFAULT","load","url","img","Image","onload","imagelist","grouplist","dynamicEdges","reroutedEdges","fontDrawThreshold","horizontalAlignLeft","verticalAlignTop","baseRadiusValue","radiusFixed","preassignedLevel","fx","fy","vx","vy","minForce","resetCluster","dynamicEdgesLength","clusterSession","clusterSizeWidthFactor","clusterSizeHeightFactor","clusterSizeRadiusFactor","growthIndicator","networkScale","formationScale","clusterSize","containedNodes","containedEdges","clusterSessions","originalLabel","triggerFunction","groupObj","imageObj","_drawDatabase","_resizeDatabase","_drawBox","_resizeBox","_drawCircle","_resizeCircle","_drawEllipse","_resizeEllipse","_drawImage","_resizeImage","_drawText","_resizeText","_drawDot","_resizeShape","_drawSquare","_drawTriangle","_drawTriangleDown","_drawStar","_reset","clearSizeCache","_setForce","_addForce","isFixed","getDistance","globalAlpha","drawImage","textSize","getTextSize","clusterLineWidth","selectionLineWidth","roundRect","database","diameter","circle","defaultSize","ellipse","_drawShape","radiusMultiplier","baseline","labelUnderNode","lineCount","yLine","inView","clearVelocity","updateVelocity","massBeforeClustering","energyBefore","styleAttr","fontFamily","WebkitBorderRadius","whiteSpace","maxWidth","parseDOT","parseGraph","nextPreview","isAlphaNumeric","regexAlphaNumeric","merge","o","addNode","graph","graphs","attr","addEdge","createEdge","getToken","tokenType","TOKENTYPE","NULL","token","isComment","DELIMITER","c2","DELIMITERS","IDENTIFIER","newSyntaxError","UNKNOWN","chop","strict","parseStatements","parseStatement","subgraph","parseSubgraph","parseEdge","parseAttributeStatement","parseNodeStatement","subgraphs","parseAttributeList","message","maxLength","substr","forEach2","array1","array2","elem1","elem2","convertEdge","dotEdge","graphEdge","graphData","dotNode","graphNode","subEdge","{","}","[","]",";","=",",","->","--","sub","sum","onLoadCallback","loadInBackground","isLoaded","getLoadedProgress","getColumn","getValues","dataView","progress","_step","precision","_current","setStep","calculatePrettyStep","log10","step1","step2","step5","getStep","CanvasRenderingContext2D","square","s2","ir","triangleDown","star","n","r2d","kappa","ox","oy","xe","ye","xm","ym","bezierCurveTo","wEllipse","hEllipse","ymb","yeb","xt","yt","xi","yi","xl","yl","xr","yr","dashArray","dashLength","dashCount","slope","distRemaining","dashIndex","PhysicsMixin","ClusterMixin","SectorsMixin","SelectionMixin","ManipulationMixin","NavigationMixin","HierarchicalLayoutMixin","_loadMixin","sourceVariable","mixinFunction","_clearMixin","_loadSelectedForceSolver","_loadPhysicsConfiguration","hubThreshold","activeSector","drawingNode","blockConnectingEdgeSelection","forceAppendSelection","editModeDiv","closeDiv","_cleanNavigation","_loadNavigationElements","_callbacks","once","self","removeListener","removeAllListeners","callbacks","cb","hasListeners","_addEvent","_characterFromEvent","fromCharCode","_MAP","_KEYCODE_MAP","_stop","tag_name","tagName","contentEditable","_modifiersMatch","modifiers1","modifiers2","_resetSequences","do_not_reset","active_sequences","_sequence_levels","_inside_sequence","_getMatches","character","modifiers","combination","matches","_isModifier","seq","combo","_eventModifiers","altKey","metaKey","_fireCallback","_handleCharacter","processed_sequence_callback","_handleKey","keyCode","_ignore_next_keyup","_resetSequenceTimer","_reset_timer","_getReverseMap","_REVERSE_MAP","_pickBestAction","_bindSequence","_increaseSequence","_callbackAndReset","_bindSingle","sequence_name","sequence","_SPECIAL_ALIASES","_SHIFT_MAP","_bindMultiple","combinations",8,9,13,16,17,18,20,27,32,33,34,35,36,37,38,39,40,45,46,91,93,224,106,107,109,110,111,186,187,188,189,190,191,192,219,220,221,222,"~","!","@","#","$","%","^","&","*","(",")","_","+",":","\"","<",">","?","|","command","return","escape","_direct_map","unbind","trigger","clusterToFit","maxNumberOfNodes","reposition","maxLevels","forceAggregateHubs","normalizeClusterLevels","increaseClusterLevel","repositionNodes","openCluster","isMovingBeforeClustering","_nodeInActiveArea","_sector","_addSector","decreaseClusterLevel","_expandClusterNode","_updateDynamicEdges","updateClusters","zoomDirection","recursive","doNotStart","amountOfNodes","_collapseSector","_formClusters","_openClusters","_openClustersBySize","_aggregateHubs","handleChains","chainPercentage","_getChainFraction","_reduceAmountOfChains","_getHubSize","_formClustersByHub","openAll","containedNodeId","childNode","_expelChildFromParent","_unselectAll","_releaseContainedEdges","_connectEdgeBackToChild","_validateEdges","othersPresent","childNodeId","_repositionBezierNodes","_formClustersByZoom","_forceClustersByZoom","minLength","_addToCluster","_clusterToSmallestNeighbour","smallestNeighbour","smallestNeighbourNode","neighbour","onlyEqual","_formClusterFromHub","hubNode","absorptionSizeOffset","allowCluster","edgesIdarray","amountOfInitialEdges","_addToContainedEdges","_connectEdgeToCluster","_containCircularEdgesFromNode","massBefore","correction","edgeToId","edgeFromId","k","_addToReroutedEdges","maxLevel","minLevel","clusterLevel","targetLevel","average","averageSquared","hubCounter","largestHub","variance","standardDeviation","fraction","reduceAmount","chains","total","_switchToSector","sectorId","sectorType","_switchToActiveSector","_switchToFrozenSector","_switchToSupportSector","_loadLatestSector","_previousSector","_setActiveSector","newId","_forgetLastSector","_createNewSector","_deleteActiveSector","_deleteFrozenSector","_freezeSector","_activateSector","_mergeThisWithFrozen","_collapseThisToSingleCluster","sector","unqiueIdentifier","previousSector","runFunction","argument","_doInAllFrozenSectors","_drawSectorNodes","_drawAllSectorNodes","_getNodesOverlappingWith","overlappingNodes","_getAllNodesOverlappingWith","_pointerToPositionObject","positionObject","_getEdgesOverlappingWith","overlappingEdges","_getAllEdgesOverlappingWith","_addToSelection","_addToHover","_removeFromSelection","doNotTrigger","_unselectClusters","_getSelectedNodeCount","_getSelectedNode","_getSelectedEdge","_getSelectedEdgeCount","_getSelectedObjectCount","_selectionIsEmpty","_clusterInSelection","_selectConnectedEdges","_hoverConnectedEdges","_unselectConnectedEdges","append","highlightEdges","nodeIds","getSelectedNodes","edgeIds","getSelectedEdges","idArray","RangeError","selectNodes","selectEdges","_clearManipulatorBar","_restoreOverloadedFunctions","functionName","_toggleEditMode","toolbar","getElementById","boundFunction","edgeBeingEdited","selectedControlNode","addNodeButton","_createAddNodeToolbar","addEdgeButton","_createAddEdgeToolbar","editButton","_editNode","_createEditEdgeToolbar","editModeButton","backButton","_addNode","_handleConnect","_finishConnect","_selectControlNode","_controlNodeDrag","_releaseControlNode","newNode","_editEdge","alert","connectFromId","_createEdge","defaultData","finalizedData","sourceNodeId","targetNodeId","selectedNodes","selectedEdges","wrapper","navigationDivActions","_stopMovement","_preventDefault","hubsize","definedLevel","undefinedLevel","_changeConstants","_determineLevels","distribution","_getDistribution","_placeNodesByHierarchy","minPos","_placeBranchNodes","amount","maxCount","_setLevel","parentId","parentLevel","nodeMoved","_restoreNodes","setup","READY","determineEventTypes","gestures","detection","register","onTouch","DOCUMENT","EVENT_MOVE","detect","EVENT_END","Instance","defaults","stop_browser_behavior","userSelect","touchAction","touchCallout","contentZooming","userDrag","tapHighlightColor","HAS_POINTEREVENTS","pointerEnabled","msPointerEnabled","HAS_TOUCHEVENTS","MOBILE_REGEX","NO_MOUSEEVENTS","EVENT_TYPES","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_UP","DIRECTION_RIGHT","POINTER_MOUSE","POINTER_TOUCH","POINTER_PEN","EVENT_START","plugins","utils","stopDefaultBrowserBehavior","ev","startDetect","handler","eventData","createEvent","initEvent","hasParent","dispatchEvent","state","last_move_event","enable_detect","touch_triggered","bindDom","sourceEventType","count_touches","PointerEvent","updatePointer","getEvents","getTouchList","identifier","pointerType","matchType","getCenter","timeStamp","getTime","preventManipulation","stopDetect","pointers","touchlist","pointerEvent","pointerId","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_TOUCH","MSPOINTER_TYPE_PEN","dest","valuesX","valuesY","getVelocity","delta_time","delta_x","delta_y","getAngle","touch1","touch2","getDirection","getScale","getRotation","isVertical","css_props","vendors","onselectstart","stopped","inst","startEvent","lastEvent","extendEventData","inst_options","startEv","velocity","deltaTime","velocityX","velocityY","rotation","Hold","hold_timeout","hold_threshold","Tap","tap_max_touchtime","tap_max_distance","tap_always","doubletap_distance","doubletap_interval","did_doubletap","Swipe","swipe_max_touches","swipe_velocity","Drag","drag_min_distance","drag_max_touches","drag_block_horizontal","drag_block_vertical","drag_lock_to_axis","drag_lock_min_distance","triggered","drag_locked_to_axis","last_direction","Transform","transform_min_scale","transform_min_rotation","transform_always_block","scale_threshold","rotation_threshold","Touch","Infinity","prevent_mouseevents","Release","graphToggleSmoothCurves","graph_toggleSmooth","graphRepositionNodes","graphGenerateOptions","optionsSpecific","radioButton1","radioButton2","checked","backupConstants","optionsDiv","switchConfigurations","radioButton","querySelector","tableId","table","showValueOfRange","constantsVariableName","valueId","rangeValue","_overWriteGraphConstants","RepulsionMixin","HierarchialRepulsionMixin","BarnesHutMixin","_toggleBarnesHut","barnesHutTree","_initializeForceCalculation","_calculateForces","_calculateGravitationalForces","_calculateNodeForces","_calculateSpringForcesWithSupport","_calculateHierarchicalSpringForces","_calculateSpringForces","supportNodes","supportNodeId","gravity","gravityForce","edgeLength","springForce","combinedClusterSize","node1","node2","node3","_calculateSpringForce","physicsConfiguration","hierarchicalLayoutDirections","parentElement","rangeElement","radioButton3","graph_repositionNodes","graph_generateOptions","nameArray","__WEBPACK_AMD_DEFINE_RESULT__","global","dfl","defaultParsingFlags","empty","unusedTokens","unusedInput","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","iso","deprecate","msg","printMsg","suppressDeprecationWarnings","warn","firstTime","padToken","func","leftZeroFill","ordinalizeToken","period","lang","ordinal","Language","Moment","config","checkOverflow","Duration","duration","normalizedInput","normalizeObjectUnits","years","quarters","quarter","months","month","weeks","week","days","day","hour","minute","second","millisecond","_milliseconds","_days","_months","_bubble","cloneMoment","result","momentProperties","absRound","number","targetLength","forceSign","output","addOrSubtractDurationFromMoment","mom","isAdding","updateOffset","_d","setTime","rawSetter","rawGetter","rawMonthSetter","input","compareArrays","dontConvert","lengthDiff","diffs","toInt","normalizeUnits","units","lowered","unitAliases","camelFunctions","inputObject","normalizedProp","makeList","setter","getter","method","_lang","results","utc","set","argumentForCoercion","coercedNumber","isFinite","daysInMonth","UTC","getUTCDate","weeksInYear","dow","doy","weekOfYear","daysInYear","isLeapYear","_a","_pf","DATE","_overflowDayOfYear","isValid","_isValid","_strict","normalizeLanguage","makeAs","model","_isUTC","zone","_offset","local","loadLang","abbr","languages","unloadLang","getLangDefinition","hasModule","removeFormattingTokens","makeFormatFunction","formattingTokens","formatTokenFunctions","formatMoment","expandFormat","formatFunctions","invalidDate","replaceLongDateFormatTokens","longDateFormat","localFormattingTokens","lastIndex","getParseRegexForToken","parseTokenOneDigit","parseTokenThreeDigits","parseTokenFourDigits","parseTokenOneToFourDigits","parseTokenSignedNumber","parseTokenSixDigits","parseTokenOneToSixDigits","parseTokenTwoDigits","parseTokenOneToThreeDigits","parseTokenWord","_l","_meridiemParse","parseTokenTimestampMs","parseTokenTimezone","parseTokenT","parseTokenDigits","parseTokenOneOrTwoDigits","parseTokenOrdinal","RegExp","regexpEscape","unescapeFormat","timezoneMinutesFromString","string","possibleTzMatches","tzChunk","parts","parseTimezoneChunker","addTimeToArrayFromToken","datePartArray","monthsParse","_dayOfYear","parseTwoDigitYear","_isPm","isPM","_useUTC","_tzm","weekdaysParse","_w","invalidWeekday","dayOfYearFromWeekInfo","weekYear","weekday","temp","GG","W","E","_week","gg","dayOfYearFromWeeks","dayOfYear","dateFromConfig","currentDate","yearToUse","currentDateArray","makeUTCDate","getUTCMonth","makeDate","setUTCMinutes","getUTCMinutes","dateFromObject","_i","getUTCFullYear","makeDateFromStringAndFormat","_f","ISO_8601","parseISO","parsedInput","tokens","skipped","stringLength","totalParsedInputLength","matched","p4","makeDateFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","NaN","score","l","isoRegex","isoDates","isoTimes","makeDateFromString","createFromInputFallback","makeDateFromInput","aspNetJsonRegex","ms","setUTCFullYear","parseWeekday","language","substituteTimeAgo","withoutSuffix","isFuture","relativeTime","relativeTimeThresholds","dd","dm","firstDayOfWeek","firstDayOfWeekOfYear","adjustedMoment","daysToDayOfWeek","daysToAdd","getUTCDay","makeMoment","invalid","preparse","pickBy","moments","res","dayOfMonth","unit","makeAccessor","keepTime","makeDurationGetter","makeDurationAsGetter","makeGlobal","shouldDeprecate","ender","oldGlobalMoment","globalScope","VERSION","_isAMomentObject","aspNetTimeSpanJsonRegex","isoDurationRegex","isoFormat","unitMillisecondFactors","Milliseconds","Seconds","Minutes","Hours","Days","Months","Years","D","Q","DDD","dayofyear","isoweekday","isoweek","weekyear","isoweekyear","ordinalizeTokens","paddedTokens","MMM","monthsShort","MMMM","weekdaysMin","ddd","weekdaysShort","dddd","weekdays","isoWeek","YY","YYYY","YYYYY","YYYYYY","gggg","ggggg","isoWeekYear","GGGG","GGGGG","isoWeekday","meridiem","SS","SSS","SSSS","Z","ZZ","zoneAbbr","zz","zoneName","unix","lists","DDDD","_monthsShort","monthName","regex","_monthsParse","_weekdays","_weekdaysShort","_weekdaysMin","weekdayName","_weekdaysParse","_longDateFormat","LT","L","LL","LLL","LLLL","val","isLower","_calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","calendar","_relativeTime","future","past","mm","hh","MM","yy","pastFuture","_ordinal","postformat","_invalidDate","ret","parseIso","isDuration","inp","version","defaultFormat","relativeTimeThreshold","threshold","limit","_abbr","langData","flags","parseZone","isDSTShifted","parsingFlags","invalidAt","inputString","dur","asFloat","that","zoneDiff","startOf","humanize","fromNow","sod","isDST","getDay","endOf","isAfter","isBefore","isSame","getTimezoneOffset","_changeInProgress","hasAlignedHourOffset","isoWeeksInYear","weekInfo","dates","isoWeeks","toJSON","withSuffix","difference","toIsoString","asSeconds","asMonths","require","noGlobal","repulsingForce","a_base","minimumDistance","nodeCount","_formBarnesHutTree","_getForceContribution","children","NW","NE","SW","SE","parentBranch","childrenCount","centerOfMass","calcSize","MAX_VALUE","sizeDiff","minimumTreeSize","rootSize","halfRootSize","centerX","centerY","_splitBranch","_placeInTree","_updateBranchMass","totalMass","totalMassInv","biggestSize","skipMassUpdate","_placeInRegion","region","containedNode","_insertRegion","childSize","_drawTree","_drawBranch","branch","webpackContext","req","webpackContextResolve","./ar","./ar-ma","./ar-ma.js","./ar-sa","./ar-sa.js","./ar.js","./az","./az.js","./bg","./bg.js","./bn","./bn.js","./br","./br.js","./bs","./bs.js","./ca","./ca.js","./cs","./cs.js","./cv","./cv.js","./cy","./cy.js","./da","./da.js","./de","./de-at","./de-at.js","./de.js","./el","./el.js","./en-au","./en-au.js","./en-ca","./en-ca.js","./en-gb","./en-gb.js","./eo","./eo.js","./es","./es.js","./et","./et.js","./eu","./eu.js","./fa","./fa.js","./fi","./fi.js","./fo","./fo.js","./fr","./fr-ca","./fr-ca.js","./fr.js","./gl","./gl.js","./he","./he.js","./hi","./hi.js","./hr","./hr.js","./hu","./hu.js","./hy-am","./hy-am.js","./id","./id.js","./is","./is.js","./it","./it.js","./ja","./ja.js","./ka","./ka.js","./km","./km.js","./ko","./ko.js","./lb","./lb.js","./lt","./lt.js","./lv","./lv.js","./mk","./mk.js","./ml","./ml.js","./mr","./mr.js","./ms-my","./ms-my.js","./nb","./nb.js","./ne","./ne.js","./nl","./nl.js","./nn","./nn.js","./pl","./pl.js","./pt","./pt-br","./pt-br.js","./pt.js","./ro","./ro.js","./ru","./ru.js","./sk","./sk.js","./sl","./sl.js","./sq","./sq.js","./sr","./sr-cyrl","./sr-cyrl.js","./sr.js","./sv","./sv.js","./ta","./ta.js","./th","./th.js","./tl-ph","./tl-ph.js","./tr","./tr.js","./tzm","./tzm-latn","./tzm-latn.js","./tzm.js","./uk","./uk.js","./uz","./uz.js","./vi","./vi.js","./zh-cn","./zh-cn.js","./zh-tw","./zh-tw.js","resolve","__WEBPACK_AMD_DEFINE_ARRAY__","symbolMap","1","2","3","4","5","6","7","0","numberMap","١","٢","٣","٤","٥","٦","٧","٨","٩","٠","suffixes",70,80,50,100,10,30,60,90,"lastDigit","last2Digits","১","২","৩","৪","৫","৬","৭","৮","৯","০","relativeTimeWithMutation","mutation","specialMutationForYears","lastNumber","softMutation","mutationTable","plural","affix","lookup","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","_monthsNominativeEl","calendarEl","_calendarEl","monthsShortDot","ll","lll","llll","۱","۲","۳","۴","۵","۶","۷","۸","۹","۰","verbalNumber","numbersFuture","numbersPast","str","१","२","३","४","५","६","७","८","९","०","num","weekEndings","monthsCaseReplace","nominative","accusative","nounCase","monthsShortCaseReplace","weekdaysCaseReplace","ss","meridiemParse","processFutureTime","eifelerRegelAppliesToNumber","processPastTime","processLastWeek","eifelerRegelAppliesToWeekday","firstDigit","translateSeconds","translateSingular","forms","special","relativeWeekDay","weekDay","weekDays","word","relativeTimeWithPlural","monthsShortWithDots","monthsShortWithoutDots","monthsNominative","monthsSubjective","separator","translator","words","correctGrammaticalCase","wordKey","lastWeekDays","genitive","processHoursFunction","hm","startOfWeek","prefix","webpackPolyfill","paths"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAyBA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,IACQ,kBAAXG,SAAyBA,OAAOC,IAC9CD,OAAOH,GACmB,gBAAZC,SACdA,QAAa,IAAID,IAEjBD,EAAU,IAAIC,KACbK,KAAM,WACT,MAAgB,UAAUC,GAKhB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUP,OAGnC,IAAIC,GAASO,EAAiBD,IAC7BP,WACAS,GAAIF,EACJG,QAAQ,EAUT,OANAL,GAAQE,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOS,QAAS,EAGTT,EAAOD,QAvBf,GAAIQ,KAqCJ,OATAF,GAAoBM,EAAIP,EAGxBC,EAAoBO,EAAIL,EAGxBF,EAAoBQ,EAAI,GAGjBR,EAAoB,KAK/B,SAASL,EAAQD,EAASM,GAG9BN,EAAQe,KAAOT,EAAoB,GACnCN,EAAQgB,QAAUV,EAAoB,GAGtCN,EAAQiB,QAAUX,EAAoB,GACtCN,EAAQkB,SAAWZ,EAAoB,GAGvCN,EAAQmB,QAAUb,EAAoB,GAGtCN,EAAQoB,SAAWd,EAAoB,GACvCN,EAAQqB,QAAUf,EAAoB,GACtCN,EAAQsB,UACNC,SAAUjB,EAAoB,GAC9BkB,MAAOlB,EAAoB,GAC3BmB,MAAOnB,EAAoB,IAC3BoB,SAAUpB,EAAoB,IAE9BqB,YACEC,OACEC,KAAMvB,EAAoB,IAC1BwB,QAASxB,EAAoB,IAC7ByB,UAAWzB,EAAoB,IAC/B0B,UAAW1B,EAAoB,K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AK,MACD,MAAOgC,GAAS,GACpB,KAAK,IACD,MAAOA,GAAS,GACpB,KAAK,IACL,IAAK,IACD,MAAOA,GAAS,GACpB,SACI,MAAOA,KAGf8K,cACI2G,OAAS,MACTC,KAAO,MACP5gF,EAAI,KACJjL,EAAI,MACJ8rF,GAAK,OACL9gF,EAAI,MACJ+gF,GAAK,OACL9/E,EAAI,KACJk5E,GAAK,MACL92C,EAAI,MACJ29C,GAAK,OACL77E,EAAI,KACJ87E,GAAK,YAQb,SAAS5sF,GAEbA,EAAOD,QAAU,SAASC,GAQzB,MAPIA,GAAO2jG,kBACV3jG,EAAOo4E,UAAY,aACnBp4E,EAAO4jG,SAEP5jG,EAAOqwF,YACPrwF,EAAO2jG,gBAAkB,GAEnB3jG"}
\ No newline at end of file
+{"version":3,"file":"vis.map","sources":["./dist/vis.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","util","DOMutil","DataSet","DataView","Graph3d","Timeline","Graph2d","timeline","DataStep","Range","stack","TimeStep","components","items","Item","ItemBox","ItemPoint","ItemRange","Component","CurrentTime","CustomTime","DataAxis","GraphGroup","Group","ItemSet","Legend","LineGraph","TimeAxis","Network","network","Edge","Groups","Images","Node","Popup","dotparser","Graph","Error","Hammer","moment","isNumber","object","Number","isString","String","isDate","Date","match","ASPDateRegex","exec","isNaN","parse","isDataTable","google","visualization","DataTable","randomUUID","S4","Math","floor","random","toString","extend","a","i","len","arguments","length","other","prop","hasOwnProperty","selectiveExtend","props","Array","isArray","selectiveDeepExtend","b","TypeError","constructor","Object","undefined","deepExtend","equalArray","convert","type","Boolean","valueOf","isMoment","toDate","getType","toISOString","value","getAbsoluteLeft","elem","doc","document","documentElement","body","left","offsetLeft","e","offsetParent","scrollLeft","getAbsoluteTop","top","offsetTop","scrollTop","getPageY","event","pageY","clientY","targetTouches","clientTop","getPageX","pageX","clientX","clientLeft","addClassName","className","classes","split","indexOf","push","join","removeClassName","index","splice","forEach","callback","toArray","array","updateProperty","key","addEventListener","element","action","listener","useCapture","navigator","userAgent","attachEvent","removeEventListener","detachEvent","getTarget","window","target","srcElement","nodeType","parentNode","fakeGesture","eventType","gesture","collectEventData","center","option","asBoolean","defaultValue","asNumber","asString","asSize","asElement","GiveDec","Hex","Value","eval","GiveHex","Dec","parseColor","color","isValidHex","hsv","hexToHSV","lighterColorHSV","h","s","v","min","darkerColorHSV","darkerColorHex","HSVToHex","lighterColorHex","background","border","highlight","hover","hexToRGB","hex","replace","toUpperCase","substring","d","f","r","g","RGBToHex","red","green","blue","RGBToHSV","minRGB","maxRGB","max","hue","saturation","HSVToRGB","q","t","rgb","isOk","test","selectiveBridgeObject","fields","referenceObject","objectTo","create","bridgeObject","mergeOptions","mergeTarget","options","enabled","binarySearch","orderedItems","range","field","field2","found","low","high","newLow","newHigh","guess","isVisible","start","binarySearchGeneric","sidePreference","newGuess","prevValue","nextValue","prepareElements","JSONcontainer","elementType","redundant","used","cleanupElements","removeChild","getSVGElement","svgContainer","shift","createElementNS","appendChild","getDOMElement","DOMContainer","createElement","drawPoint","x","y","group","point","drawPoints","style","setAttributeNS","size","drawBar","width","height","rect","data","_options","_data","_fieldId","fieldId","_type","_subscribers","add","prototype","on","subscribers","subscribe","off","filter","unsubscribe","_trigger","params","senderId","concat","subscriber","addedIds","me","_addItem","columns","_getColumnNames","row","rows","getNumberOfRows","item","col","cols","getValue","update","updatedIds","addOrUpdate","_updateItem","get","ids","firstType","returnType","itemId","_getItem","order","_sort","_filterFields","_appendRow","getIds","getDataSet","map","mappedItems","filteredItem","name","sort","av","bv","remove","removedId","removedIds","_remove","clear","keys","maxField","itemField","minField","distinct","values","fieldType","count","exists","types","raw","converted","JSON","stringify","dataTable","getNumberOfColumns","getColumnId","getColumnLabel","addRow","setValue","_ids","_onEvent","apply","setData","viewOptions","getArguments","defaultFilter","dataSet","added","updated","removed","container","SyntaxError","containerElement","margin","defaultXCenter","defaultYCenter","xLabel","yLabel","zLabel","filterLabel","legendLabel","STYLE","DOT","showPerspective","showGrid","keepAspectRatio","showShadow","showGrayBottom","showTooltip","verticalRatio","animationInterval","animationPreload","camera","Camera","eye","Point3d","dataPoints","colX","colY","colZ","colValue","colFilter","xMin","xStep","xMax","yMin","yStep","yMax","zMin","zStep","zMax","valueMin","valueMax","xBarWidth","yBarWidth","colorAxis","colorGrid","colorDot","colorDotBorder","setOptions","Slider","visible","frame","position","prev","play","next","bar","borderRadius","MozBorderRadius","backgroundColor","slide","onmousedown","_onMouseDown","onclick","togglePlay","onChangeCallback","playTimeout","playInterval","playLoop","Emitter","Point2d","Filter","StepNumber","armLocation","armRotation","horizontal","vertical","armLength","cameraLocation","cameraRotation","PI","calculateCameraOrientation","setArmLocation","z","setArmRotation","getArmRotation","rot","setArmLength","getArmLength","getCameraLocation","getCameraRotation","sin","cos","_setScale","scale","xCenter","yCenter","zCenter","_convert3Dto2D","point3d","translation","_convertPointToTranslation","_convertTranslationToScreen","ax","ay","az","cx","cy","cz","sinTx","cosTx","sinTy","cosTy","sinTz","cosTz","dx","dy","dz","bx","by","ex","ey","ez","xcenter","canvas","clientWidth","ycenter","_setBackgroundColor","fill","stroke","strokeWidth","borderColor","borderWidth","borderStyle","BAR","BARCOLOR","BARSIZE","DOTLINE","DOTCOLOR","DOTSIZE","GRID","LINE","SURFACE","_getStyleNumber","styleName","_determineColumnIndexes","counter","column","getDistinctValues","distinctValues","getColumnRange","minMax","_dataInitialize","rawData","_onChange","dataFilter","setOnLoadCallback","redraw","withBars","defaultXBarWidth","dataX","defaultYBarWidth","dataY","xRange","defaultXMin","defaultXMax","defaultXStep","yRange","defaultYMin","defaultYMax","defaultYStep","zRange","defaultZMin","defaultZMax","defaultZStep","valueRange","defaultValueMin","defaultValueMax","_getDataPoints","sortNumber","obj","dataMatrix","xIndex","yIndex","trans","screen","bottom","pointRight","pointTop","pointCross","hasChildNodes","firstChild","overflow","noCanvas","fontWeight","padding","innerHTML","ontouchstart","_onTouchStart","onmousewheel","_onWheel","ontooltip","_onTooltip","G3DaddEventListener","onkeydown","setSize","_resizeCanvas","clientHeight","animationStart","slider","animationStop","stop","_resizeCenter","charAt","parseFloat","setCameraPosition","pos","distance","getCameraPosition","_readData","_redrawFilter","animationAutoStart","cameraPosition","styleNumber","tooltip","showAnimationControls","_redrawSlider","_redrawClear","_redrawAxis","_redrawDataGrid","_redrawDataLine","_redrawDataBar","_redrawDataDot","_redrawInfo","_redrawLegend","ctx","getContext","clearRect","widthMin","widthMax","dotSize","right","lineWidth","font","ymin","ymax","_hsv2rgb","strokeStyle","beginPath","moveTo","lineTo","strokeRect","fillStyle","closePath","gridLineLen","step","getCurrent","end","textAlign","textBaseline","fillText","label","setValues","setPlayInterval","onchange","getIndex","selectValue","setOnChangeCallback","lineStyle","getLabel","getSelectedValue","from","to","prettyStep","text","xText","yText","zText","offset","xOffset","yOffset","xMin2d","xMax2d","gridLenX","gridLenY","textMargin","armAngle","H","S","V","R","G","B","C","Hi","X","abs","parseInt","cross","topSideVisible","zAvg","transBottom","dist","sortDepth","aDiff","subtract","bDiff","crossproduct","crossProduct","radius","arc","j","surface","corners","xWidth","yWidth","surfaces","avg","transCenter","diff","leftButtonDown","_onMouseUp","which","button","touchDown","startMouseX","getMouseX","startMouseY","getMouseY","startStart","startEnd","startArmRotation","cursor","onmousemove","_onMouseMove","onmouseup","G3DpreventDefault","diffX","diffY","horizontalNew","verticalNew","snapAngle","snapValue","round","parameters","emit","G3DremoveEventListener","delay","mouseX","mouseY","tooltipTimeout","clearTimeout","_hideTooltip","dataPoint","_dataPointFromXY","_showTooltip","setTimeout","ontouchmove","_onTouchMove","ontouchend","_onTouchEnd","delta","wheelDelta","detail","oldLength","newLength","_insideTriangle","triangle","sign","as","bs","cs","distMax","closestDataPoint","closestDist","triangle1","triangle2","distX","distY","sqrt","content","line","dot","dom","boxShadow","borderLeft","contentWidth","offsetWidth","contentHeight","offsetHeight","lineHeight","dotWidth","dotHeight","G3DstopPropagation","stopPropagation","cancelBubble","preventDefault","returnValue","setIndex","playNext","interval","clearInterval","getPlayInterval","setPlayLoop","doLoop","onChange","indexToLeft","startClientX","startSlideX","leftToIndex","defaultOptions","autoResize","orientation","maxHeight","minHeight","_create","domProps","emitter","bind","snap","toScreen","_toScreen","toGlobalScreen","_toGlobalScreen","toTime","_toTime","toGlobalTime","_toGlobalTime","timeAxis","currentTime","customTime","itemSet","itemsData","groupsData","setItems","backgroundVertical","backgroundHorizontal","centerContainer","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","_onTouch","_onPinch","_onDragStart","_onDrag","hammer","prevent_default","listeners","events","args","slice","scrollTopMin","touch","destroy","_stopAutoResize","component","_initAutoResize","setCustomTime","time","getCustomTime","newDataSet","initialLoad","fit","setWindow","setGroups","groups","what","dataRange","getItemRange","setRange","dataset","minItem","maxStartItem","maxEndItem","setSelection","getSelection","getWindow","getRange","resized","borderRootHeight","borderRootWidth","autoHeight","containerHeight","centerWidth","_updateScrollTop","visibilityTop","visibilityBottom","visibility","repaint","conversion","_startAutoResize","_onResize","lastWidth","lastHeight","watchTimer","setInterval","allowDragging","initialScrollTop","deltaY","oldScrollTop","_getScrollTop","newScrollTop","_setScrollTop","linegraph","backgroundHorizontalContainer","minimumStep","forcedStepSize","current","autoScale","stepIndex","marginStart","marginEnd","majorSteps","minorSteps","_start","_end","setMinimumStep","setFirst","safeSize","minimumStepValue","orderOfMagnitude","log","LN10","minorStepIdx","magnitudefactor","pow","solutionFound","stepSize","first","niceStart","niceEnd","roundToMinor","marginRange","rounded","hasNext","previous","toPrecision","isMajor","now","hours","minutes","seconds","milliseconds","clone","direction","moveable","zoomable","zoomMin","zoomMax","_onDragEnd","_onHold","_onMouseWheel","validateDirection","getPointer","changed","_applyRange","newStart","newEnd","deltaX","diffRange","pointer","pointerDate","_pointerToDate","zoom","touches","initDate","move","EPSILON","orderByStart","orderByEnd","aTime","bTime","force","iMax","axis","collidingItem","jj","collision","nostack","SCALE","DAY","MILLISECOND","SECOND","MINUTE","HOUR","WEEKDAY","MONTH","YEAR","setFullYear","getFullYear","setMonth","setDate","setHours","setMinutes","setSeconds","setMilliseconds","getMilliseconds","getSeconds","getMinutes","getHours","getDate","getMonth","setScale","newScale","newStep","setAutoScale","enable","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","stepMillisecond","date","year","getLabelMinor","format","getLabelMajor","_isResized","_previousWidth","_previousHeight","showCurrentTime","parent","title","currentTimeTimer","showCustomTime","eventParams","drag","dragging","svg","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","linegraphSVG","DOMelements","lines","labels","conversionFactor","minWidth","stepPixels","stepPixelsForced","lineOffset","master","svgElements","amountOfGroups","addGroup","graphOptions","updateGroup","removeGroup","hide","show","lineContainer","display","_redrawGroupIcons","iconHeight","iconOffset","groupId","drawIcon","changeCalled","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","minorLineWidth","minorLineHeight","majorLineWidth","majorLineHeight","_redrawLabels","amountOfSteps","stepDifference","valueAtZero","marginStartPos","maxLabelSize","_redrawLabel","_redrawLine","characterHeight","largestWidth","majorCharWidth","minorCharWidth","convertValue","invertedValue","convertedValue","textMinor","createTextNode","measureCharMinor","textMajor","measureCharMajor","groupsUsingDefaultStyles","usingDefaultStyle","zeroPosition","setZeroPosition","catmullRom","parametrization","alpha","SVGcontainer","path","fillPath","fillHeight","outline","shaded","barWidth","bar1Height","bar2Height","visibleItems","byStart","byEnd","inner","foreground","marker","Element","getLabelWidth","restack","_updateVisibleItems","markerHeight","lastMarkerHeight","dirty","displayed","ii","repositionY","labelSet","setParent","_checkIfVisible","removeFromDataSet","removeItem","_constructByEndArray","endArray","initialPosByStart","newVisibleItems","initialPosByEnd","_checkIfInvisible","repositionX","align","groupOrder","selectable","editable","updateTime","onAdd","onUpdate","onMove","onRemove","itemOptions","itemListeners","_onAdd","_onUpdate","_onRemove","groupListeners","_onAddGroups","_onUpdateGroups","_onRemoveGroups","groupIds","selection","stackDirty","touchParams","UNGROUPED","box","_updateUngrouped","_onSelectItem","_onMultiSelectItem","_onAddItem","addCallback","fn","Function","markDirty","unselect","select","_deselect","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","groupResized","firstGroupIndex","firstGroupId","ungrouped","getLabelSet","oldItemsData","getItems","_order","getGroups","itemData","_removeItem","groupData","groupOptions","oldGroupId","oldGroup","itemFromTarget","selected","dragLeftItem","dragRightItem","itemProps","groupFromTarget","changes","ctrlKey","srcEvent","shiftKey","oldSelection","newSelection","xAbs","newItem","itemSetFromTarget","side","iconSize","iconSpacing","textArea","drawLegendIcons","getComputedStyle","paddingTop","yAxisOrientation","defaultGroup","sampling","graphHeight","barChart","dataAxis","legend","lastStart","rangePerPixelInv","_updateGraph","yAxisLeft","yAxisRight","legendLeft","legendRight","_updateAllGroupData","_updateGroup","groupsContent","ungroupedCounter","preprocessedGroup","preprocessedGroupData","processedGroupData","groupRanges","minDate","maxDate","_preprocessData","_updateYAxis","_convertYvalues","_drawLineGraph","_drawBarGraph","minVal","maxVal","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","_toggleAxisVisiblity","drawIcons","axisUsed","coreDistance","_drawPoints","svgHeight","_catmullRom","_linear","dFill","datapoints","xValue","yValue","extractedData","increment","amountOfPoints","xDistance","pointsPerPixel","ceil","_catmullRomUniform","p0","p1","p2","p3","bp1","bp2","normalization","d1","d2","d3","A","N","M","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","majorLines","majorTexts","minorLines","minorTexts","lineTop","parentChanged","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","insertBefore","xFirstMajorLabel","cur","_repaintMinorText","_repaintMajorText","_repaintMajorLine","_repaintMinorLine","leftTime","leftText","widthText","arr","pop","childNodes","nodeValue","_repaintDeleteButton","anchor","deleteButton","itemSetHeight","marginLeft","baseClassName","_repaintDragLeft","_repaintDragRight","contentLeft","parentWidth","boxWidth","dragLeft","dragRight","_initializeMixinLoaders","renderRefreshRate","renderTimestep","renderTime","maxPhysicsTicksPerRender","physicsDiscreteStepsize","stabilize","initializing","triggerFunctions","edit","editEdge","connect","del","constants","nodes","radiusMin","radiusMax","shape","image","fixed","fontColor","fontSize","fontFace","level","highlightColor","edges","widthSelectionMultiplier","hoverWidth","fontFill","arrowScaleFactor","dash","gap","altLength","inheritColor","configurePhysics","physics","barnesHut","theta","gravitationalConstant","centralGravity","springLength","springConstant","damping","repulsion","nodeDistance","hierarchicalRepulsion","clustering","initialMaxNodes","clusterThreshold","reduceToNodes","chainThreshold","clusterEdgeThreshold","sectorThreshold","screenSizeThreshold","fontSizeMultiplier","maxFontSize","forceAmplification","distanceAmplification","edgeGrowth","nodeScaling","maxNodeSizeIncrements","activeAreaBoxSize","clusterLevelDifference","navigation","keyboard","speed","dataManipulation","initiallyVisible","hierarchicalLayout","levelSeparation","nodeSpacing","freezeForStabilization","smoothCurves","dynamic","roundness","dynamicSmoothCurves","maxVelocity","minVelocity","stabilizationIterations","link","editNode","back","addDescription","linkDescription","editEdgeDescription","addError","linkError","editError","editBoundError","deleteError","deleteClusterError","dragNetwork","dragNodes","hideEdgesOnDrag","hideNodesOnDrag","hoverObj","controlNodesActive","images","setOnloadCallback","_redraw","xIncrement","yIncrement","zoomIncrement","_loadPhysicsSystem","_loadSectorSystem","_loadClusterSystem","_loadSelectionSystem","_loadHierarchySystem","_setTranslation","freezeSimulation","cachedFunctions","calculationNodes","calculationNodeIndices","nodeIndices","canvasTopLeft","canvasBottomRight","pointerPosition","areaCenter","previousScale","nodesData","edgesData","nodesListeners","_addNodes","_updateNodes","_removeNodes","edgesListeners","_addEdges","_updateEdges","_removeEdges","moving","timer","_setupHierarchicalLayout","zoomExtent","startWithClustering","mousetrap","MixinLoader","_getScriptPath","scripts","getElementsByTagName","src","_getRange","node","minY","maxY","minX","maxX","nodeId","_findCenter","_centerNetwork","initialZoom","disableStart","zoomLevel","numberOfNodes","factor","yDistance","xZoomLevel","yZoomLevel","_updateNodeIndexList","_clearNodeIndexList","idx","dotData","DOTToGraph","_setNodes","_setEdges","_putDataInSector","_stabilize","dragGraph","onEdit","onEditEdge","onConnect","onDelete","editMode","groupname","_loadNavigationControls","_loadManipulationSystem","_configureSmoothCurves","_createKeyBinds","pinch","_onTap","_onDoubleTap","_onRelease","_onMouseMoveTitle","reset","_moveUp","_yStopMoving","_moveDown","_moveLeft","_xStopMoving","_moveRight","_zoomIn","_stopZoom","_zoomOut","_createManipulatorBar","_deleteSelected","_getPointer","pinched","_getScale","_handleTouch","_handleDragStart","_getNodeAt","_getTranslation","isSelected","_selectObject","objectId","selectionObj","xFixed","yFixed","_handleOnDrag","_XconvertDOMtoCanvas","_XconvertCanvasToDOM","_YconvertDOMtoCanvas","_YconvertCanvasToDOM","_handleTap","_handleDoubleTap","_handleOnHold","_handleOnRelease","_zoom","scaleOld","scaleFrac","tx","ty","updateClustersDefault","popupObj","_checkHidePopup","checkShow","_checkShowPopup","popupTimer","edgeId","_getEdgeAt","_hoverObject","_blurObject","lastPopupNode","getTitle","isOverlappingWith","edge","connected","popup","setPosition","setText","manipulationDiv","navigationDivs","oldNodesData","_updateSelection","angle","_resetLevels","_updateCalculationNodes","_reconnectEdges","_updateValueRange","updateLabels","setProperties","properties","oldEdgesData","oldEdge","disconnect","showInternalIds","_createBezierNodes","via","sectors","setValueRange","w","save","translate","_doInAllSectors","restore","offsetX","offsetY","canvasToDOM","DOMtoCanvas","_drawNodes","alwaysShow","setScaleAndPos","inArea","draw","sMax","_drawEdges","_drawControlNodes","_freezeDefinedNodes","_physicsTick","_restoreFrozenNodes","iterations","fixedData","_isMoving","vmin","isMoving","_discreteStepNodes","nodesPresent","discreteStepLimited","discreteStep","vminCorrected","_doInAllActiveSectors","_doInSupportSector","_animationStep","_handleNavigation","calculationTime","maxSteps","timeRequired","requestAnimationFrame","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","ua","toLowerCase","requiresTimeout","toggleFreeze","smooth","mass","internalMultiplier","parentEdgeId","positionBezierNode","mixin","storePosition","dataArray","allowedToMoveX","allowedToMoveY","focusOnNode","nodePosition","requiredScale","canvasCenter","distanceFromCenter","console","fromId","toId","widthSelected","customLength","originalFromId","originalToId","widthFixed","lengthFixed","controlNodesEnabled","controlNodes","positions","connectedNode","_drawLine","_drawArrow","_drawArrowCenter","_drawDashLine","attachEdge","detachEdge","xFrom","yFrom","xTo","yTo","xObj","yObj","_getDistanceToEdge","_getColor","colorObj","_getLineWidth","_line","midpointX","midpointY","_pointOnLine","_label","resize","_circle","_pointOnCircle","networkScaleInv","_getViaCoordinates","xVia","yVia","quadraticCurveTo","measureText","fillRect","mozDash","setLineDash","pattern","lineDashOffset","mozDashOffset","lineCap","dashedLine","percentage","atan2","arrow","edgeSegmentLength","fromBorderDist","distanceToBorder","fromBorderPoint","toBorderDist","toBorderPoint","x1","y1","x2","y2","x3","y3","minDistance","px","py","something","u","nodeIdFrom","nodeIdTo","getControlNodePositions","_enableControlNodes","_disableControlNodes","_getSelectedControlNode","fromDistance","toDistance","_restoreControlNodes","defaultIndex","DEFAULT","load","url","img","Image","onload","imagelist","grouplist","dynamicEdges","reroutedEdges","fontDrawThreshold","horizontalAlignLeft","verticalAlignTop","baseRadiusValue","radiusFixed","preassignedLevel","fx","fy","vx","vy","minForce","resetCluster","dynamicEdgesLength","clusterSession","clusterSizeWidthFactor","clusterSizeHeightFactor","clusterSizeRadiusFactor","growthIndicator","networkScale","formationScale","clusterSize","containedNodes","containedEdges","clusterSessions","originalLabel","triggerFunction","groupObj","imageObj","_drawDatabase","_resizeDatabase","_drawBox","_resizeBox","_drawCircle","_resizeCircle","_drawEllipse","_resizeEllipse","_drawImage","_resizeImage","_drawText","_resizeText","_drawDot","_resizeShape","_drawSquare","_drawTriangle","_drawTriangleDown","_drawStar","_reset","clearSizeCache","_setForce","_addForce","isFixed","getDistance","globalAlpha","drawImage","textSize","getTextSize","clusterLineWidth","selectionLineWidth","roundRect","database","diameter","circle","defaultSize","ellipse","_drawShape","radiusMultiplier","baseline","labelUnderNode","lineCount","yLine","inView","clearVelocity","updateVelocity","massBeforeClustering","energyBefore","styleAttr","fontFamily","WebkitBorderRadius","whiteSpace","maxWidth","parseDOT","parseGraph","nextPreview","isAlphaNumeric","regexAlphaNumeric","merge","o","addNode","graph","graphs","attr","addEdge","createEdge","getToken","tokenType","TOKENTYPE","NULL","token","isComment","DELIMITER","c2","DELIMITERS","IDENTIFIER","newSyntaxError","UNKNOWN","chop","strict","parseStatements","parseStatement","subgraph","parseSubgraph","parseEdge","parseAttributeStatement","parseNodeStatement","subgraphs","parseAttributeList","message","maxLength","substr","forEach2","array1","array2","elem1","elem2","convertEdge","dotEdge","graphEdge","graphData","dotNode","graphNode","subEdge","{","}","[","]",";","=",",","->","--","sub","sum","onLoadCallback","loadInBackground","isLoaded","getLoadedProgress","getColumn","getValues","dataView","progress","_step","precision","_current","setStep","calculatePrettyStep","log10","step1","step2","step5","getStep","CanvasRenderingContext2D","square","s2","ir","triangleDown","star","n","r2d","kappa","ox","oy","xe","ye","xm","ym","bezierCurveTo","wEllipse","hEllipse","ymb","yeb","xt","yt","xi","yi","xl","yl","xr","yr","dashArray","dashLength","dashCount","slope","distRemaining","dashIndex","PhysicsMixin","ClusterMixin","SectorsMixin","SelectionMixin","ManipulationMixin","NavigationMixin","HierarchicalLayoutMixin","_loadMixin","sourceVariable","mixinFunction","_clearMixin","_loadSelectedForceSolver","_loadPhysicsConfiguration","hubThreshold","activeSector","drawingNode","blockConnectingEdgeSelection","forceAppendSelection","editModeDiv","closeDiv","_cleanNavigation","_loadNavigationElements","_callbacks","once","self","removeListener","removeAllListeners","callbacks","cb","hasListeners","_addEvent","_characterFromEvent","fromCharCode","_MAP","_KEYCODE_MAP","_stop","tag_name","tagName","contentEditable","_modifiersMatch","modifiers1","modifiers2","_resetSequences","do_not_reset","active_sequences","_sequence_levels","_inside_sequence","_getMatches","character","modifiers","combination","matches","_isModifier","seq","combo","_eventModifiers","altKey","metaKey","_fireCallback","_handleCharacter","processed_sequence_callback","_handleKey","keyCode","_ignore_next_keyup","_resetSequenceTimer","_reset_timer","_getReverseMap","_REVERSE_MAP","_pickBestAction","_bindSequence","_increaseSequence","_callbackAndReset","_bindSingle","sequence_name","sequence","_SPECIAL_ALIASES","_SHIFT_MAP","_bindMultiple","combinations",8,9,13,16,17,18,20,27,32,33,34,35,36,37,38,39,40,45,46,91,93,224,106,107,109,110,111,186,187,188,189,190,191,192,219,220,221,222,"~","!","@","#","$","%","^","&","*","(",")","_","+",":","\"","<",">","?","|","command","return","escape","_direct_map","unbind","trigger","clusterToFit","maxNumberOfNodes","reposition","maxLevels","forceAggregateHubs","normalizeClusterLevels","increaseClusterLevel","repositionNodes","openCluster","isMovingBeforeClustering","_nodeInActiveArea","_sector","_addSector","decreaseClusterLevel","_expandClusterNode","_updateDynamicEdges","updateClusters","zoomDirection","recursive","doNotStart","amountOfNodes","_collapseSector","_formClusters","_openClusters","_openClustersBySize","_aggregateHubs","handleChains","chainPercentage","_getChainFraction","_reduceAmountOfChains","_getHubSize","_formClustersByHub","openAll","containedNodeId","childNode","_expelChildFromParent","_unselectAll","_releaseContainedEdges","_connectEdgeBackToChild","_validateEdges","othersPresent","childNodeId","_repositionBezierNodes","_formClustersByZoom","_forceClustersByZoom","minLength","_addToCluster","_clusterToSmallestNeighbour","smallestNeighbour","smallestNeighbourNode","neighbour","onlyEqual","_formClusterFromHub","hubNode","absorptionSizeOffset","allowCluster","edgesIdarray","amountOfInitialEdges","_addToContainedEdges","_connectEdgeToCluster","_containCircularEdgesFromNode","massBefore","correction","edgeToId","edgeFromId","k","_addToReroutedEdges","maxLevel","minLevel","clusterLevel","targetLevel","average","averageSquared","hubCounter","largestHub","variance","standardDeviation","fraction","reduceAmount","chains","total","_switchToSector","sectorId","sectorType","_switchToActiveSector","_switchToFrozenSector","_switchToSupportSector","_loadLatestSector","_previousSector","_setActiveSector","newId","_forgetLastSector","_createNewSector","_deleteActiveSector","_deleteFrozenSector","_freezeSector","_activateSector","_mergeThisWithFrozen","_collapseThisToSingleCluster","sector","unqiueIdentifier","previousSector","runFunction","argument","_doInAllFrozenSectors","_drawSectorNodes","_drawAllSectorNodes","_getNodesOverlappingWith","overlappingNodes","_getAllNodesOverlappingWith","_pointerToPositionObject","positionObject","_getEdgesOverlappingWith","overlappingEdges","_getAllEdgesOverlappingWith","_addToSelection","_addToHover","_removeFromSelection","doNotTrigger","_unselectClusters","_getSelectedNodeCount","_getSelectedNode","_getSelectedEdge","_getSelectedEdgeCount","_getSelectedObjectCount","_selectionIsEmpty","_clusterInSelection","_selectConnectedEdges","_hoverConnectedEdges","_unselectConnectedEdges","append","highlightEdges","nodeIds","getSelectedNodes","edgeIds","getSelectedEdges","idArray","RangeError","selectNodes","selectEdges","_clearManipulatorBar","_restoreOverloadedFunctions","functionName","_toggleEditMode","toolbar","getElementById","boundFunction","edgeBeingEdited","selectedControlNode","addNodeButton","_createAddNodeToolbar","addEdgeButton","_createAddEdgeToolbar","editButton","_editNode","_createEditEdgeToolbar","editModeButton","backButton","_addNode","_handleConnect","_finishConnect","_selectControlNode","_controlNodeDrag","_releaseControlNode","newNode","_editEdge","alert","connectFromId","_createEdge","defaultData","finalizedData","sourceNodeId","targetNodeId","selectedNodes","selectedEdges","wrapper","navigationDivActions","_stopMovement","_preventDefault","hubsize","definedLevel","undefinedLevel","_changeConstants","_determineLevels","distribution","_getDistribution","_placeNodesByHierarchy","minPos","_placeBranchNodes","amount","maxCount","_setLevel","parentId","parentLevel","nodeMoved","_restoreNodes","setup","READY","determineEventTypes","gestures","detection","register","onTouch","DOCUMENT","EVENT_MOVE","detect","EVENT_END","Instance","defaults","stop_browser_behavior","userSelect","touchAction","touchCallout","contentZooming","userDrag","tapHighlightColor","HAS_POINTEREVENTS","pointerEnabled","msPointerEnabled","HAS_TOUCHEVENTS","MOBILE_REGEX","NO_MOUSEEVENTS","EVENT_TYPES","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_UP","DIRECTION_RIGHT","POINTER_MOUSE","POINTER_TOUCH","POINTER_PEN","EVENT_START","plugins","utils","stopDefaultBrowserBehavior","ev","startDetect","handler","eventData","createEvent","initEvent","hasParent","dispatchEvent","state","last_move_event","enable_detect","touch_triggered","bindDom","sourceEventType","count_touches","PointerEvent","updatePointer","getEvents","getTouchList","identifier","pointerType","matchType","getCenter","timeStamp","getTime","preventManipulation","stopDetect","pointers","touchlist","pointerEvent","pointerId","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_TOUCH","MSPOINTER_TYPE_PEN","dest","valuesX","valuesY","getVelocity","delta_time","delta_x","delta_y","getAngle","touch1","touch2","getDirection","getScale","getRotation","isVertical","css_props","vendors","onselectstart","stopped","inst","startEvent","lastEvent","extendEventData","inst_options","startEv","velocity","deltaTime","velocityX","velocityY","rotation","Hold","hold_timeout","hold_threshold","Tap","tap_max_touchtime","tap_max_distance","tap_always","doubletap_distance","doubletap_interval","did_doubletap","Swipe","swipe_max_touches","swipe_velocity","Drag","drag_min_distance","drag_max_touches","drag_block_horizontal","drag_block_vertical","drag_lock_to_axis","drag_lock_min_distance","triggered","drag_locked_to_axis","last_direction","Transform","transform_min_scale","transform_min_rotation","transform_always_block","scale_threshold","rotation_threshold","Touch","Infinity","prevent_mouseevents","Release","graphToggleSmoothCurves","graph_toggleSmooth","graphRepositionNodes","graphGenerateOptions","optionsSpecific","radioButton1","radioButton2","checked","backupConstants","optionsDiv","switchConfigurations","radioButton","querySelector","tableId","table","showValueOfRange","constantsVariableName","valueId","rangeValue","_overWriteGraphConstants","RepulsionMixin","HierarchialRepulsionMixin","BarnesHutMixin","_toggleBarnesHut","barnesHutTree","_initializeForceCalculation","_calculateForces","_calculateGravitationalForces","_calculateNodeForces","_calculateSpringForcesWithSupport","_calculateHierarchicalSpringForces","_calculateSpringForces","supportNodes","supportNodeId","gravity","gravityForce","edgeLength","springForce","combinedClusterSize","node1","node2","node3","_calculateSpringForce","physicsConfiguration","hierarchicalLayoutDirections","parentElement","rangeElement","radioButton3","graph_repositionNodes","graph_generateOptions","nameArray","__WEBPACK_AMD_DEFINE_RESULT__","global","dfl","defaultParsingFlags","empty","unusedTokens","unusedInput","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","iso","deprecate","msg","printMsg","suppressDeprecationWarnings","warn","firstTime","padToken","func","leftZeroFill","ordinalizeToken","period","lang","ordinal","Language","Moment","config","checkOverflow","Duration","duration","normalizedInput","normalizeObjectUnits","years","quarters","quarter","months","month","weeks","week","days","day","hour","minute","second","millisecond","_milliseconds","_days","_months","_bubble","cloneMoment","result","momentProperties","absRound","number","targetLength","forceSign","output","addOrSubtractDurationFromMoment","mom","isAdding","updateOffset","_d","setTime","rawSetter","rawGetter","rawMonthSetter","input","compareArrays","dontConvert","lengthDiff","diffs","toInt","normalizeUnits","units","lowered","unitAliases","camelFunctions","inputObject","normalizedProp","makeList","setter","getter","method","_lang","results","utc","set","argumentForCoercion","coercedNumber","isFinite","daysInMonth","UTC","getUTCDate","weeksInYear","dow","doy","weekOfYear","daysInYear","isLeapYear","_a","_pf","DATE","_overflowDayOfYear","isValid","_isValid","_strict","normalizeLanguage","makeAs","model","_isUTC","zone","_offset","local","loadLang","abbr","languages","unloadLang","getLangDefinition","hasModule","removeFormattingTokens","makeFormatFunction","formattingTokens","formatTokenFunctions","formatMoment","expandFormat","formatFunctions","invalidDate","replaceLongDateFormatTokens","longDateFormat","localFormattingTokens","lastIndex","getParseRegexForToken","parseTokenOneDigit","parseTokenThreeDigits","parseTokenFourDigits","parseTokenOneToFourDigits","parseTokenSignedNumber","parseTokenSixDigits","parseTokenOneToSixDigits","parseTokenTwoDigits","parseTokenOneToThreeDigits","parseTokenWord","_l","_meridiemParse","parseTokenTimestampMs","parseTokenTimezone","parseTokenT","parseTokenDigits","parseTokenOneOrTwoDigits","parseTokenOrdinal","RegExp","regexpEscape","unescapeFormat","timezoneMinutesFromString","string","possibleTzMatches","tzChunk","parts","parseTimezoneChunker","addTimeToArrayFromToken","datePartArray","monthsParse","_dayOfYear","parseTwoDigitYear","_isPm","isPM","_useUTC","_tzm","weekdaysParse","_w","invalidWeekday","dayOfYearFromWeekInfo","weekYear","weekday","temp","GG","W","E","_week","gg","dayOfYearFromWeeks","dayOfYear","dateFromConfig","currentDate","yearToUse","currentDateArray","makeUTCDate","getUTCMonth","makeDate","setUTCMinutes","getUTCMinutes","dateFromObject","_i","getUTCFullYear","makeDateFromStringAndFormat","_f","ISO_8601","parseISO","parsedInput","tokens","skipped","stringLength","totalParsedInputLength","matched","p4","makeDateFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","NaN","score","l","isoRegex","isoDates","isoTimes","makeDateFromString","createFromInputFallback","makeDateFromInput","aspNetJsonRegex","ms","setUTCFullYear","parseWeekday","language","substituteTimeAgo","withoutSuffix","isFuture","relativeTime","relativeTimeThresholds","dd","dm","firstDayOfWeek","firstDayOfWeekOfYear","adjustedMoment","daysToDayOfWeek","daysToAdd","getUTCDay","makeMoment","invalid","preparse","pickBy","moments","res","dayOfMonth","unit","makeAccessor","keepTime","makeDurationGetter","makeDurationAsGetter","makeGlobal","shouldDeprecate","ender","oldGlobalMoment","globalScope","VERSION","_isAMomentObject","aspNetTimeSpanJsonRegex","isoDurationRegex","isoFormat","unitMillisecondFactors","Milliseconds","Seconds","Minutes","Hours","Days","Months","Years","D","Q","DDD","dayofyear","isoweekday","isoweek","weekyear","isoweekyear","ordinalizeTokens","paddedTokens","MMM","monthsShort","MMMM","weekdaysMin","ddd","weekdaysShort","dddd","weekdays","isoWeek","YY","YYYY","YYYYY","YYYYYY","gggg","ggggg","isoWeekYear","GGGG","GGGGG","isoWeekday","meridiem","SS","SSS","SSSS","Z","ZZ","zoneAbbr","zz","zoneName","unix","lists","DDDD","_monthsShort","monthName","regex","_monthsParse","_weekdays","_weekdaysShort","_weekdaysMin","weekdayName","_weekdaysParse","_longDateFormat","LT","L","LL","LLL","LLLL","val","isLower","_calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","calendar","_relativeTime","future","past","mm","hh","MM","yy","pastFuture","_ordinal","postformat","_invalidDate","ret","parseIso","isDuration","inp","version","defaultFormat","relativeTimeThreshold","threshold","limit","_abbr","langData","flags","parseZone","isDSTShifted","parsingFlags","invalidAt","inputString","dur","asFloat","that","zoneDiff","startOf","humanize","fromNow","sod","isDST","getDay","endOf","isAfter","isBefore","isSame","getTimezoneOffset","_changeInProgress","hasAlignedHourOffset","isoWeeksInYear","weekInfo","dates","isoWeeks","toJSON","withSuffix","difference","toIsoString","asSeconds","asMonths","require","noGlobal","repulsingForce","a_base","minimumDistance","nodeCount","_formBarnesHutTree","_getForceContribution","children","NW","NE","SW","SE","parentBranch","childrenCount","centerOfMass","calcSize","MAX_VALUE","sizeDiff","minimumTreeSize","rootSize","halfRootSize","centerX","centerY","_splitBranch","_placeInTree","_updateBranchMass","totalMass","totalMassInv","biggestSize","skipMassUpdate","_placeInRegion","region","containedNode","_insertRegion","childSize","_drawTree","_drawBranch","branch","webpackContext","req","webpackContextResolve","./ar","./ar-ma","./ar-ma.js","./ar-sa","./ar-sa.js","./ar.js","./az","./az.js","./bg","./bg.js","./bn","./bn.js","./br","./br.js","./bs","./bs.js","./ca","./ca.js","./cs","./cs.js","./cv","./cv.js","./cy","./cy.js","./da","./da.js","./de","./de-at","./de-at.js","./de.js","./el","./el.js","./en-au","./en-au.js","./en-ca","./en-ca.js","./en-gb","./en-gb.js","./eo","./eo.js","./es","./es.js","./et","./et.js","./eu","./eu.js","./fa","./fa.js","./fi","./fi.js","./fo","./fo.js","./fr","./fr-ca","./fr-ca.js","./fr.js","./gl","./gl.js","./he","./he.js","./hi","./hi.js","./hr","./hr.js","./hu","./hu.js","./hy-am","./hy-am.js","./id","./id.js","./is","./is.js","./it","./it.js","./ja","./ja.js","./ka","./ka.js","./km","./km.js","./ko","./ko.js","./lb","./lb.js","./lt","./lt.js","./lv","./lv.js","./mk","./mk.js","./ml","./ml.js","./mr","./mr.js","./ms-my","./ms-my.js","./nb","./nb.js","./ne","./ne.js","./nl","./nl.js","./nn","./nn.js","./pl","./pl.js","./pt","./pt-br","./pt-br.js","./pt.js","./ro","./ro.js","./ru","./ru.js","./sk","./sk.js","./sl","./sl.js","./sq","./sq.js","./sr","./sr-cyrl","./sr-cyrl.js","./sr.js","./sv","./sv.js","./ta","./ta.js","./th","./th.js","./tl-ph","./tl-ph.js","./tr","./tr.js","./tzm","./tzm-latn","./tzm-latn.js","./tzm.js","./uk","./uk.js","./uz","./uz.js","./vi","./vi.js","./zh-cn","./zh-cn.js","./zh-tw","./zh-tw.js","resolve","__WEBPACK_AMD_DEFINE_ARRAY__","symbolMap","1","2","3","4","5","6","7","0","numberMap","١","٢","٣","٤","٥","٦","٧","٨","٩","٠","suffixes",70,80,50,100,10,30,60,90,"lastDigit","last2Digits","১","২","৩","৪","৫","৬","৭","৮","৯","০","relativeTimeWithMutation","mutation","specialMutationForYears","lastNumber","softMutation","mutationTable","plural","affix","lookup","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","_monthsNominativeEl","calendarEl","_calendarEl","monthsShortDot","ll","lll","llll","۱","۲","۳","۴","۵","۶","۷","۸","۹","۰","verbalNumber","numbersFuture","numbersPast","str","१","२","३","४","५","६","७","८","९","०","num","weekEndings","monthsCaseReplace","nominative","accusative","nounCase","monthsShortCaseReplace","weekdaysCaseReplace","ss","meridiemParse","processFutureTime","eifelerRegelAppliesToNumber","processPastTime","processLastWeek","eifelerRegelAppliesToWeekday","firstDigit","translateSeconds","translateSingular","forms","special","relativeWeekDay","weekDay","weekDays","word","relativeTimeWithPlural","monthsShortWithDots","monthsShortWithoutDots","monthsNominative","monthsSubjective","separator","translator","words","correctGrammaticalCase","wordKey","lastWeekDays","genitive","processHoursFunction","hm","startOfWeek","prefix","webpackPolyfill","paths"],"mappings":";;;;;;;;;;;;;;;;;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AaC,CACtB,OAAS,KAALqpB,EACO,KACK,KAALA,EACA,KACK,KAALA,EACA,KACK,KAALA,EACA,KAEA,MAGfnX,UACIN,QAAU,SACVC,QAAU,SACVC,SAAW,YACXC,QAAU,SACVC,SAAW,YACXC,SAAW,KAEfpT,QAAU,SAAU8B,EAAQhC,GACxB,OAAQA,GACR,IAAK,IACL,IAAK,IACL,IAAK,MACD,MAAOgC,GAAS,GACpB,KAAK,IACD,MAAOA,GAAS,GACpB,KAAK,IACL,IAAK,IACD,MAAOA,GAAS,GACpB,SACI,MAAOA,KAGf8K,cACI2G,OAAS,MACTC,KAAO,MACPxhF,EAAI,KACJjL,EAAI,MACJ0sF,GAAK,OACL1hF,EAAI,MACJ2hF,GAAK,OACL1gF,EAAI,KACJ85E,GAAK,MACL13C,EAAI,MACJu+C,GAAK,OACL18E,EAAI,KACJ28E,GAAK,YAQb,SAASxtF,GAEbA,EAAOD,QAAU,SAASC,GAQzB,MAPIA,GAAOukG,kBACVvkG,EAAOg5E,UAAY,aACnBh5E,EAAOwkG,SAEPxkG,EAAOixF,YACPjxF,EAAOukG,gBAAkB,GAEnBvkG"}
\ No newline at end of file
diff --git a/dist/vis.min.js b/dist/vis.min.js
index 8933e740..9b4faa5e 100644
--- a/dist/vis.min.js
+++ b/dist/vis.min.js
@@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library.
*
* @version 3.0.1-SNAPSHOT
- * @date 2014-07-10
+ * @date 2014-07-15
*
* @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com
@@ -22,19 +22,19 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.vis=e():t.vis=e()}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){e.util=i(1),e.DOMutil=i(2),e.DataSet=i(3),e.DataView=i(4),e.Graph3d=i(5),e.Timeline=i(6),e.Graph2d=i(7),e.timeline={DataStep:i(8),Range:i(9),stack:i(10),TimeStep:i(11),components:{items:{Item:i(22),ItemBox:i(23),ItemPoint:i(24),ItemRange:i(25)},Component:i(12),CurrentTime:i(13),CustomTime:i(14),DataAxis:i(15),GraphGroup:i(16),Group:i(17),ItemSet:i(18),Legend:i(19),LineGraph:i(20),TimeAxis:i(21)}},e.Network=i(26),e.network={Edge:i(27),Groups:i(28),Images:i(29),Node:i(30),Popup:i(31),dotparser:i(32)},e.Graph=function(){throw new Error("Graph is renamed to Network. Please create a graph as new vis.Network(...)")}},function(module,exports,__webpack_require__){var Hammer=__webpack_require__(38),moment=__webpack_require__(39);exports.isNumber=function(t){return t instanceof Number||"number"==typeof t},exports.isString=function(t){return t instanceof String||"string"==typeof t},exports.isDate=function(t){if(t instanceof Date)return!0;if(exports.isString(t)){var e=ASPDateRegex.exec(t);if(e)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},exports.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},exports.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},exports.extend=function(t){for(var e=1,i=arguments.length;i>e;e++){var s=arguments[e];for(var n in s)s.hasOwnProperty(n)&&(t[n]=s[n])}return t},exports.selectiveExtend=function(t,e){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(var i=2;ii;i++)if(t[i]!=e[i])return!1;return!0},exports.convert=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 new Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t.valueOf());case"string":case"String":return String(t);case"Date":if(exports.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(moment.isMoment(t))return new Date(t.valueOf());if(exports.isString(t))return i=ASPDateRegex.exec(t),i?new Date(Number(i[1])):moment(t).toDate();throw new Error("Cannot convert object of type "+exports.getType(t)+" to type Date");case"Moment":if(exports.isNumber(t))return moment(t);if(t instanceof Date)return moment(t.valueOf());if(moment.isMoment(t))return moment(t);if(exports.isString(t))return i=ASPDateRegex.exec(t),moment(i?Number(i[1]):t);throw new Error("Cannot convert object of type "+exports.getType(t)+" to type Date");case"ISODate":if(exports.isNumber(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(moment.isMoment(t))return t.toDate().toISOString();if(exports.isString(t))return i=ASPDateRegex.exec(t),i?new Date(Number(i[1])).toISOString():new Date(t).toISOString();throw new Error("Cannot convert object of type "+exports.getType(t)+" to type ISODate");case"ASPDate":if(exports.isNumber(t))return"/Date("+t+")/";if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(exports.isString(t)){i=ASPDateRegex.exec(t);var s;return s=i?new Date(Number(i[1])).valueOf():new Date(t).valueOf(),"/Date("+s+")/"}throw new Error("Cannot convert object of type "+exports.getType(t)+" to type ASPDate");default:throw new Error('Unknown type "'+e+'"')}};var ASPDateRegex=/^\/?Date\((\-?\d+)/i;exports.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},exports.getAbsoluteLeft=function(t){for(var e=document.documentElement,i=document.body,s=t.offsetLeft,n=t.offsetParent;null!=n&&n!=i&&n!=e;)s+=n.offsetLeft,s-=n.scrollLeft,n=n.offsetParent;return s},exports.getAbsoluteTop=function(t){for(var e=document.documentElement,i=document.body,s=t.offsetTop,n=t.offsetParent;null!=n&&n!=i&&n!=e;)s+=n.offsetTop,s-=n.scrollTop,n=n.offsetParent;return s},exports.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,s=document.body;return e+(i&&i.scrollTop||s&&s.scrollTop||0)-(i&&i.clientTop||s&&s.clientTop||0)},exports.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,s=document.body;return e+(i&&i.scrollLeft||s&&s.scrollLeft||0)-(i&&i.clientLeft||s&&s.clientLeft||0)},exports.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},exports.removeClassName=function(t,e){var i=t.className.split(" "),s=i.indexOf(e);-1!=s&&(i.splice(s,1),t.className=i.join(" "))},exports.forEach=function(t,e){var i,s;if(t instanceof Array)for(i=0,s=t.length;s>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},exports.toArray=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},exports.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},exports.addEventListener=function(t,e,i,s){t.addEventListener?(void 0===s&&(s=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,s)):t.attachEvent("on"+e,i)},exports.removeEventListener=function(t,e,i,s){t.removeEventListener?(void 0===s&&(s=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,s)):t.detachEvent("on"+e,i)},exports.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},exports.fakeGesture=function(t,e){var i=null,s=Hammer.event.collectEventData(this,i,e);return isNaN(s.center.pageX)&&(s.center.pageX=e.pageX),isNaN(s.center.pageY)&&(s.center.pageY=e.pageY),s},exports.option={},exports.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},exports.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},exports.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?String(t):e||null},exports.option.asSize=function(t,e){return"function"==typeof t&&(t=t()),exports.isString(t)?t:exports.isNumber(t)?t+"px":e||null},exports.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},exports.GiveDec=function(Hex){var Value;return Value="A"==Hex?10:"B"==Hex?11:"C"==Hex?12:"D"==Hex?13:"E"==Hex?14:"F"==Hex?15:eval(Hex)},exports.GiveHex=function(t){var e;return e=10==t?"A":11==t?"B":12==t?"C":13==t?"D":14==t?"E":15==t?"F":""+t},exports.parseColor=function(t){var e;if(exports.isString(t))if(exports.isValidHex(t)){var i=exports.hexToHSV(t),s={h:i.h,s:.45*i.s,v:Math.min(1,1.05*i.v)},n={h:i.h,s:Math.min(1,1.25*i.v),v:.6*i.v},o=exports.HSVToHex(n.h,n.h,n.v),a=exports.HSVToHex(s.h,s.s,s.v);e={background:t,border:o,highlight:{background:a,border:o},hover:{background:a,border:o}}}else e={background:t,border:t,highlight:{background:t,border:t},hover:{background:t,border:t}};else e={},e.background=t.background||"white",e.border=t.border||e.background,exports.isString(t.highlight)?e.highlight={border:t.highlight,background:t.highlight}:(e.highlight={},e.highlight.background=t.highlight&&t.highlight.background||e.background,e.highlight.border=t.highlight&&t.highlight.border||e.border),exports.isString(t.hover)?e.hover={border:t.hover,background:t.hover}:(e.hover={},e.hover.background=t.hover&&t.hover.background||e.background,e.hover.border=t.hover&&t.hover.border||e.border);return e},exports.hexToRGB=function(t){t=t.replace("#","").toUpperCase();var e=exports.GiveDec(t.substring(0,1)),i=exports.GiveDec(t.substring(1,2)),s=exports.GiveDec(t.substring(2,3)),n=exports.GiveDec(t.substring(3,4)),o=exports.GiveDec(t.substring(4,5)),a=exports.GiveDec(t.substring(5,6)),r=16*e+i,h=16*s+n,i=16*o+a;return{r:r,g:h,b:i}},exports.RGBToHex=function(t,e,i){var s=exports.GiveHex(Math.floor(t/16)),n=exports.GiveHex(t%16),o=exports.GiveHex(Math.floor(e/16)),a=exports.GiveHex(e%16),r=exports.GiveHex(Math.floor(i/16)),h=exports.GiveHex(i%16),d=s+n+o+a+r+h;return"#"+d},exports.RGBToHSV=function(t,e,i){t/=255,e/=255,i/=255;var s=Math.min(t,Math.min(e,i)),n=Math.max(t,Math.max(e,i));if(s==n)return{h:0,s:0,v:s};var o=t==s?e-i:i==s?t-e:i-t,a=t==s?3:i==s?1:5,r=60*(a-o/(n-s))/360,h=(n-s)/n,d=n;return{h:r,s:h,v:d}},exports.HSVToRGB=function(t,e,i){var s,n,o,a=Math.floor(6*t),r=6*t-a,h=i*(1-e),d=i*(1-r*e),l=i*(1-(1-r)*e);switch(a%6){case 0:s=i,n=l,o=h;break;case 1:s=d,n=i,o=h;break;case 2:s=h,n=i,o=l;break;case 3:s=h,n=d,o=i;break;case 4:s=l,n=h,o=i;break;case 5:s=i,n=h,o=d}return{r:Math.floor(255*s),g:Math.floor(255*n),b:Math.floor(255*o)}},exports.HSVToHex=function(t,e,i){var s=exports.HSVToRGB(t,e,i);return exports.RGBToHex(s.r,s.g,s.b)},exports.hexToHSV=function(t){var e=exports.hexToRGB(t);return exports.RGBToHSV(e.r,e.g,e.b)},exports.isValidHex=function(t){var e=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);return e},exports.selectiveBridgeObject=function(t,e){if("object"==typeof e){for(var i=Object.create(e),s=0;so&&a>e||e>a&&r>e?(d=!0,a!=e&&("before"==s?e>o&&a>e&&(m=Math.max(0,m-1)):e>a&&r>e&&(m=Math.min(h.length-1,m+1)))):(e>a?l=Math.floor(.5*(c+l)):c=Math.floor(.5*(c+l)),n=Math.floor(.5*(c+l)),l==u&&c==p?(m=-1,d=!0):(c=p,l=u,m=Math.floor(.5*(c+l))));return m}},function(t,e){e.prepareElements=function(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])},e.cleanupElements=function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i0?(s=e[t].redundant[0],e[t].redundant.shift()):(s=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(s)):(s=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(s)),e[t].used.push(s),s},e.getDOMElement=function(t,e,i){var s;return e.hasOwnProperty(t)?e[t].redundant.length>0?(s=e[t].redundant[0],e[t].redundant.shift()):(s=document.createElement(t),i.appendChild(s)):(s=document.createElement(t),e[t]={used:[],redundant:[]},i.appendChild(s)),e[t].used.push(s),s},e.drawPoint=function(t,i,s,n,o){var a;return"circle"==s.options.drawPoints.style?(a=e.getSVGElement("circle",n,o),a.setAttributeNS(null,"cx",t),a.setAttributeNS(null,"cy",i),a.setAttributeNS(null,"r",.5*s.options.drawPoints.size),a.setAttributeNS(null,"class",s.className+" point")):(a=e.getSVGElement("rect",n,o),a.setAttributeNS(null,"x",t-.5*s.options.drawPoints.size),a.setAttributeNS(null,"y",i-.5*s.options.drawPoints.size),a.setAttributeNS(null,"width",s.options.drawPoints.size),a.setAttributeNS(null,"height",s.options.drawPoints.size),a.setAttributeNS(null,"class",s.className+" point")),a},e.drawBar=function(t,i,s,n,o,a,r){var h=e.getSVGElement("rect",a,r);h.setAttributeNS(null,"x",t-.5*s),h.setAttributeNS(null,"y",i),h.setAttributeNS(null,"width",s),h.setAttributeNS(null,"height",n),h.setAttributeNS(null,"class",o)}},function(t,e,i){function s(t,e){if(!t||Array.isArray(t)||n.isDataTable(t)||(e=t,t=null),this._options=e||{},this._data={},this._fieldId=this._options.fieldId||"id",this._type={},this._options.type)for(var i in this._options.type)if(this._options.type.hasOwnProperty(i)){var s=this._options.type[i];this._type[i]="Date"==s||"ISODate"==s||"ASPDate"==s?"Date":s}if(this._options.convert)throw new Error('Option "convert" is deprecated. Use "type" instead.');this._subscribers={},t&&this.add(t)}var n=i(1);s.prototype.on=function(t,e){var i=this._subscribers[t];i||(i=[],this._subscribers[t]=i),i.push({callback:e})},s.prototype.subscribe=s.prototype.on,s.prototype.off=function(t,e){var i=this._subscribers[t];i&&(this._subscribers[t]=i.filter(function(t){return t.callback!=e}))},s.prototype.unsubscribe=s.prototype.off,s.prototype._trigger=function(t,e,i){if("*"==t)throw new Error("Cannot trigger event *");var s=[];t in this._subscribers&&(s=s.concat(this._subscribers[t])),"*"in this._subscribers&&(s=s.concat(this._subscribers["*"]));for(var n=0;na;a++)i=o._addItem(t[a]),s.push(i);else if(n.isDataTable(t))for(var h=this._getColumnNames(t),d=0,l=t.getNumberOfRows();l>d;d++){for(var c={},u=0,p=h.length;p>u;u++){var m=h[u];c[m]=t.getValue(d,u)}i=o._addItem(c),s.push(i)}else{if(!(t instanceof Object))throw new Error("Unknown dataType");i=o._addItem(t),s.push(i)}return s.length&&this._trigger("add",{items:s},e),s},s.prototype.update=function(t,e){var i=[],s=[],o=this,a=o._fieldId,r=function(t){var e=t[a];o._data[e]?(e=o._updateItem(t),s.push(e)):(e=o._addItem(t),i.push(e))};if(Array.isArray(t))for(var h=0,d=t.length;d>h;h++)r(t[h]);else if(n.isDataTable(t))for(var l=this._getColumnNames(t),c=0,u=t.getNumberOfRows();u>c;c++){for(var p={},m=0,_=l.length;_>m;m++){var f=l[m];p[f]=t.getValue(c,m)}r(p)}else{if(!(t instanceof Object))throw new Error("Unknown dataType");r(t)}return i.length&&this._trigger("add",{items:i},e),s.length&&this._trigger("update",{items:s},e),i.concat(s)},s.prototype.get=function(){var t,e,i,s,o=this,a=n.getType(arguments[0]);"String"==a||"Number"==a?(t=arguments[0],i=arguments[1],s=arguments[2]):"Array"==a?(e=arguments[0],i=arguments[1],s=arguments[2]):(i=arguments[0],s=arguments[1]);var r;if(i&&i.returnType){if(r="DataTable"==i.returnType?"DataTable":"Array",s&&r!=n.getType(s))throw new Error('Type of parameter "data" ('+n.getType(s)+") does not correspond with specified options.type ("+i.type+")");if("DataTable"==r&&!n.isDataTable(s))throw new Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else r=s&&"DataTable"==n.getType(s)?"DataTable":"Array";var h,d,l,c,u=i&&i.type||this._options.type,p=i&&i.filter,m=[];if(void 0!=t)h=o._getItem(t,u),p&&!p(h)&&(h=null);else if(void 0!=e)for(l=0,c=e.length;c>l;l++)h=o._getItem(e[l],u),(!p||p(h))&&m.push(h);else for(d in this._data)this._data.hasOwnProperty(d)&&(h=o._getItem(d,u),(!p||p(h))&&m.push(h));if(i&&i.order&&void 0==t&&this._sort(m,i.order),i&&i.fields){var _=i.fields;if(void 0!=t)h=this._filterFields(h,_);else for(l=0,c=m.length;c>l;l++)m[l]=this._filterFields(m[l],_)}if("DataTable"==r){var f=this._getColumnNames(s);if(void 0!=t)o._appendRow(s,f,h);else for(l=0,c=m.length;c>l;l++)o._appendRow(s,f,m[l]);return s}if(void 0!=t)return h;if(s){for(l=0,c=m.length;c>l;l++)s.push(m[l]);return s}return m},s.prototype.getIds=function(t){var e,i,s,n,o,a=this._data,r=t&&t.filter,h=t&&t.order,d=t&&t.type||this._options.type,l=[];if(r)if(h){o=[];for(s in a)a.hasOwnProperty(s)&&(n=this._getItem(s,d),r(n)&&o.push(n));for(this._sort(o,h),e=0,i=o.length;i>e;e++)l[e]=o[e][this._fieldId]}else for(s in a)a.hasOwnProperty(s)&&(n=this._getItem(s,d),r(n)&&l.push(n[this._fieldId]));else if(h){o=[];for(s in a)a.hasOwnProperty(s)&&o.push(a[s]);for(this._sort(o,h),e=0,i=o.length;i>e;e++)l[e]=o[e][this._fieldId]}else for(s in a)a.hasOwnProperty(s)&&(n=a[s],l.push(n[this._fieldId]));return l},s.prototype.getDataSet=function(){return this},s.prototype.forEach=function(t,e){var i,s,n=e&&e.filter,o=e&&e.type||this._options.type,a=this._data;if(e&&e.order)for(var r=this.get(e),h=0,d=r.length;d>h;h++)i=r[h],s=i[this._fieldId],t(i,s);else for(s in a)a.hasOwnProperty(s)&&(i=this._getItem(s,o),(!n||n(i))&&t(i,s))},s.prototype.map=function(t,e){var i,s=e&&e.filter,n=e&&e.type||this._options.type,o=[],a=this._data;for(var r in a)a.hasOwnProperty(r)&&(i=this._getItem(r,n),(!s||s(i))&&o.push(t(i,r)));return e&&e.order&&this._sort(o,e.order),o},s.prototype._filterFields=function(t,e){var i={};for(var s in t)t.hasOwnProperty(s)&&-1!=e.indexOf(s)&&(i[s]=t[s]);return i},s.prototype._sort=function(t,e){if(n.isString(e)){var i=e;t.sort(function(t,e){var s=t[i],n=e[i];return s>n?1:n>s?-1:0})}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}},s.prototype.remove=function(t,e){var i,s,n,o=[];if(Array.isArray(t))for(i=0,s=t.length;s>i;i++)n=this._remove(t[i]),null!=n&&o.push(n);else n=this._remove(t),null!=n&&o.push(n);return o.length&&this._trigger("remove",{items:o},e),o},s.prototype._remove=function(t){if(n.isNumber(t)||n.isString(t)){if(this._data[t])return delete this._data[t],t}else if(t instanceof Object){var e=t[this._fieldId];if(e&&this._data[e])return delete this._data[e],e}return null},s.prototype.clear=function(t){var e=Object.keys(this._data);return this._data={},this._trigger("remove",{items:e},t),e},s.prototype.max=function(t){var e=this._data,i=null,s=null;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n],a=o[t];null!=a&&(!i||a>s)&&(i=o,s=a)}return i},s.prototype.min=function(t){var e=this._data,i=null,s=null;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n],a=o[t];null!=a&&(!i||s>a)&&(i=o,s=a)}return i},s.prototype.distinct=function(t){var e,i=this._data,s=[],o=this._options.type&&this._options.type[t]||null,a=0;for(var r in i)if(i.hasOwnProperty(r)){var h=i[r],d=h[t],l=!1;for(e=0;a>e;e++)if(s[e]==d){l=!0;break}l||void 0===d||(s[a]=d,a++)}if(o)for(e=0;ei;i++)e[i]=t.getColumnId(i)||t.getColumnLabel(i);return e},s.prototype._appendRow=function(t,e,i){for(var s=t.addRow(),n=0,o=e.length;o>n;n++){var a=e[n];t.setValue(s,n,i[a])}},t.exports=s},function(t,e,i){function s(t,e){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)}var n=i(1),o=i(3);s.prototype.setData=function(t){var e,i,s;if(this._data){this._data.unsubscribe&&this._data.unsubscribe("*",this.listener),e=[];for(var n in this._ids)this._ids.hasOwnProperty(n)&&e.push(n);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,s=e.length;s>i;i++)n=e[i],this._ids[n]=!0;this._trigger("add",{items:e}),this._data.on&&this._data.on("*",this.listener)}},s.prototype.get=function(){var t,e,i,s=this,o=n.getType(arguments[0]);"String"==o||"Number"==o||"Array"==o?(t=arguments[0],e=arguments[1],i=arguments[2]):(e=arguments[0],i=arguments[1]);var a=n.extend({},this._options,e);this._options.filter&&e&&e.filter&&(a.filter=function(t){return s._options.filter(t)&&e.filter(t)});var r=[];return void 0!=t&&r.push(t),r.push(a),r.push(i),this._data&&this._data.get.apply(this._data,r)},s.prototype.getIds=function(t){var e;if(this._data){var i,s=this._options.filter;i=t&&t.filter?s?function(e){return s(e)&&t.filter(e)}:t.filter:s,e=this._data.getIds({filter:i,order:t&&t.order})}else e=[];return e},s.prototype.getDataSet=function(){for(var t=this;t instanceof s;)t=t._data;return t||null},s.prototype._onEvent=function(t,e,i){var s,n,o,a,r=e&&e.items,h=this._data,d=[],l=[],c=[];if(r&&h){switch(t){case"add":for(s=0,n=r.length;n>s;s++)o=r[s],a=this.get(o),a&&(this._ids[o]=!0,d.push(o));break;case"update":for(s=0,n=r.length;n>s;s++)o=r[s],a=this.get(o),a?this._ids[o]?l.push(o):(this._ids[o]=!0,d.push(o)):this._ids[o]&&(delete this._ids[o],c.push(o));break;case"remove":for(s=0,n=r.length;n>s;s++)o=r[s],this._ids[o]&&(delete this._ids[o],c.push(o))}d.length&&this._trigger("add",{items:d},i),l.length&&this._trigger("update",{items:l},i),c.length&&this._trigger("remove",{items:c},i)}},s.prototype.on=o.prototype.on,s.prototype.off=o.prototype.off,s.prototype._trigger=o.prototype._trigger,s.prototype.subscribe=s.prototype.on,s.prototype.unsubscribe=s.prototype.off,t.exports=s},function(t,e,i){function s(t,e,i){if(!(this instanceof s))throw new SyntaxError("Constructor must be called with the new operator");this.containerElement=t,this.width="400px",this.height="400px",this.margin=10,this.defaultXCenter="55%",this.defaultYCenter="50%",this.xLabel="x",this.yLabel="y",this.zLabel="z",this.filterLabel="time",this.legendLabel="value",this.style=s.STYLE.DOT,this.showPerspective=!0,this.showGrid=!0,this.keepAspectRatio=!0,this.showShadow=!1,this.showGrayBottom=!1,this.showTooltip=!1,this.verticalRatio=.5,this.animationInterval=1e3,this.animationPreload=!1,this.camera=new s.Camera,this.eye=new h(0,0,-1),this.dataTable=null,this.dataPoints=null,this.colX=void 0,this.colY=void 0,this.colZ=void 0,this.colValue=void 0,this.colFilter=void 0,this.xMin=0,this.xStep=void 0,this.xMax=1,this.yMin=0,this.yStep=void 0,this.yMax=1,this.zMin=0,this.zStep=void 0,this.zMax=1,this.valueMin=0,this.valueMax=1,this.xBarWidth=1,this.yBarWidth=1,this.colorAxis="#4D4D4D",this.colorGrid="#D3D3D3",this.colorDot="#7DC1FF",this.colorDotBorder="#3267D2",this.create(),this.setOptions(i),e&&this.setData(e)}function n(t,e){if(void 0===t)throw"Error: No container element defined";if(this.container=t,this.visible=e&&void 0!=e.visible?e.visible:!0,this.visible){this.frame=document.createElement("DIV"),this.frame.style.width="100%",this.frame.style.position="relative",this.container.appendChild(this.frame),this.frame.prev=document.createElement("INPUT"),this.frame.prev.type="BUTTON",this.frame.prev.value="Prev",this.frame.appendChild(this.frame.prev),this.frame.play=document.createElement("INPUT"),this.frame.play.type="BUTTON",this.frame.play.value="Play",this.frame.appendChild(this.frame.play),this.frame.next=document.createElement("INPUT"),this.frame.next.type="BUTTON",this.frame.next.value="Next",this.frame.appendChild(this.frame.next),this.frame.bar=document.createElement("INPUT"),this.frame.bar.type="BUTTON",this.frame.bar.style.position="absolute",this.frame.bar.style.border="1px solid red",this.frame.bar.style.width="100px",this.frame.bar.style.height="6px",this.frame.bar.style.borderRadius="2px",this.frame.bar.style.MozBorderRadius="2px",this.frame.bar.style.border="1px solid #7F7F7F",this.frame.bar.style.backgroundColor="#E5E5E5",this.frame.appendChild(this.frame.bar),this.frame.slide=document.createElement("INPUT"),this.frame.slide.type="BUTTON",this.frame.slide.style.margin="0px",this.frame.slide.value=" ",this.frame.slide.style.position="relative",this.frame.slide.style.left="-100px",this.frame.appendChild(this.frame.slide);var i=this;this.frame.slide.onmousedown=function(t){i._onMouseDown(t)},this.frame.prev.onclick=function(t){i.prev(t)},this.frame.play.onclick=function(t){i.togglePlay(t)},this.frame.next.onclick=function(t){i.next(t)}}this.onChangeCallback=void 0,this.values=[],this.index=void 0,this.playTimeout=void 0,this.playInterval=1e3,this.playLoop=!0}var o=i(41),a=i(3),r=i(4),h=i(33),d=i(34),l=i(35),c=i(36);o(s.prototype),s.Camera=function(){this.armLocation=new h,this.armRotation={},this.armRotation.horizontal=0,this.armRotation.vertical=0,this.armLength=1.7,this.cameraLocation=new h,this.cameraRotation=new h(.5*Math.PI,0,0),this.calculateCameraOrientation()},s.Camera.prototype.setArmLocation=function(t,e,i){this.armLocation.x=t,this.armLocation.y=e,this.armLocation.z=i,this.calculateCameraOrientation()},s.Camera.prototype.setArmRotation=function(t,e){void 0!==t&&(this.armRotation.horizontal=t),void 0!==e&&(this.armRotation.vertical=e,this.armRotation.vertical<0&&(this.armRotation.vertical=0),this.armRotation.vertical>.5*Math.PI&&(this.armRotation.vertical=.5*Math.PI)),(void 0!==t||void 0!==e)&&this.calculateCameraOrientation()},s.Camera.prototype.getArmRotation=function(){var t={};return t.horizontal=this.armRotation.horizontal,t.vertical=this.armRotation.vertical,t},s.Camera.prototype.setArmLength=function(t){void 0!==t&&(this.armLength=t,this.armLength<.71&&(this.armLength=.71),this.armLength>5&&(this.armLength=5),this.calculateCameraOrientation())},s.Camera.prototype.getArmLength=function(){return this.armLength},s.Camera.prototype.getCameraLocation=function(){return this.cameraLocation},s.Camera.prototype.getCameraRotation=function(){return this.cameraRotation},s.Camera.prototype.calculateCameraOrientation=function(){this.cameraLocation.x=this.armLocation.x-this.armLength*Math.sin(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.y=this.armLocation.y-this.armLength*Math.cos(this.armRotation.horizontal)*Math.cos(this.armRotation.vertical),this.cameraLocation.z=this.armLocation.z+this.armLength*Math.sin(this.armRotation.vertical),this.cameraRotation.x=Math.PI/2-this.armRotation.vertical,this.cameraRotation.y=0,this.cameraRotation.z=-this.armRotation.horizontal},s.prototype._setScale=function(){this.scale=new h(1/(this.xMax-this.xMin),1/(this.yMax-this.yMin),1/(this.zMax-this.zMin)),this.keepAspectRatio&&(this.scale.x3&&(this.colFilter=3);else{if(this.style!==s.STYLE.DOTCOLOR&&this.style!==s.STYLE.DOTSIZE&&this.style!==s.STYLE.BARCOLOR&&this.style!==s.STYLE.BARSIZE)throw'Unknown style "'+this.style+'"';this.colX=0,this.colY=1,this.colZ=2,this.colValue=3,t.getNumberOfColumns()>4&&(this.colFilter=4)}},s.prototype.getNumberOfRows=function(t){return t.length},s.prototype.getNumberOfColumns=function(t){var e=0;for(var i in t[0])t[0].hasOwnProperty(i)&&e++;return e},s.prototype.getDistinctValues=function(t,e){for(var i=[],s=0;st[s][e]&&(i.min=t[s][e]),i.maxt;t++){var _=(t-p)/(m-p),f=240*_,g=this._hsv2rgb(f,1,1);u.strokeStyle=g,u.beginPath(),u.moveTo(h,a+t),u.lineTo(r,a+t),u.stroke()}u.strokeStyle=this.colorAxis,u.strokeRect(h,a,i,o)}if(this.style===s.STYLE.DOTSIZE&&(u.strokeStyle=this.colorAxis,u.fillStyle=this.colorDot,u.beginPath(),u.moveTo(h,a),u.lineTo(r,a),u.lineTo(r-i+e,d),u.lineTo(h,d),u.closePath(),u.fill(),u.stroke()),this.style===s.STYLE.DOTCOLOR||this.style===s.STYLE.DOTSIZE){var y=5,v=new c(this.valueMin,this.valueMax,(this.valueMax-this.valueMin)/5,!0);for(v.start(),v.getCurrent()0?this.yMin:this.yMax,n=this._convert3Dto2D(new h(b,a,this.zMin)),Math.cos(2*M)>0?(f.textAlign="center",f.textBaseline="top",n.y+=v):Math.sin(2*M)<0?(f.textAlign="right",f.textBaseline="middle"):(f.textAlign="left",f.textBaseline="middle"),f.fillStyle=this.colorAxis,f.fillText(" "+i.getCurrent()+" ",n.x,n.y),i.next()}for(f.lineWidth=1,s=void 0===this.defaultYStep,i=new c(this.yMin,this.yMax,this.yStep,s),i.start(),i.getCurrent()0?this.xMin:this.xMax,n=this._convert3Dto2D(new h(o,i.getCurrent(),this.zMin)),Math.cos(2*M)<0?(f.textAlign="center",f.textBaseline="top",n.y+=v):Math.sin(2*M)>0?(f.textAlign="right",f.textBaseline="middle"):(f.textAlign="left",f.textBaseline="middle"),f.fillStyle=this.colorAxis,f.fillText(" "+i.getCurrent()+" ",n.x,n.y),i.next();for(f.lineWidth=1,s=void 0===this.defaultZStep,i=new c(this.zMin,this.zMax,this.zStep,s),i.start(),i.getCurrent()0?this.xMin:this.xMax,a=Math.sin(M)<0?this.yMin:this.yMax;!i.end();)t=this._convert3Dto2D(new h(o,a,i.getCurrent())),f.strokeStyle=this.colorAxis,f.beginPath(),f.moveTo(t.x,t.y),f.lineTo(t.x-v,t.y),f.stroke(),f.textAlign="right",f.textBaseline="middle",f.fillStyle=this.colorAxis,f.fillText(i.getCurrent()+" ",t.x-5,t.y),i.next();f.lineWidth=1,t=this._convert3Dto2D(new h(o,a,this.zMin)),e=this._convert3Dto2D(new h(o,a,this.zMax)),f.strokeStyle=this.colorAxis,f.beginPath(),f.moveTo(t.x,t.y),f.lineTo(e.x,e.y),f.stroke(),f.lineWidth=1,p=this._convert3Dto2D(new h(this.xMin,this.yMin,this.zMin)),m=this._convert3Dto2D(new h(this.xMax,this.yMin,this.zMin)),f.strokeStyle=this.colorAxis,f.beginPath(),f.moveTo(p.x,p.y),f.lineTo(m.x,m.y),f.stroke(),p=this._convert3Dto2D(new h(this.xMin,this.yMax,this.zMin)),m=this._convert3Dto2D(new h(this.xMax,this.yMax,this.zMin)),f.strokeStyle=this.colorAxis,f.beginPath(),f.moveTo(p.x,p.y),f.lineTo(m.x,m.y),f.stroke(),f.lineWidth=1,t=this._convert3Dto2D(new h(this.xMin,this.yMin,this.zMin)),e=this._convert3Dto2D(new h(this.xMin,this.yMax,this.zMin)),f.strokeStyle=this.colorAxis,f.beginPath(),f.moveTo(t.x,t.y),f.lineTo(e.x,e.y),f.stroke(),t=this._convert3Dto2D(new h(this.xMax,this.yMin,this.zMin)),e=this._convert3Dto2D(new h(this.xMax,this.yMax,this.zMin)),f.strokeStyle=this.colorAxis,f.beginPath(),f.moveTo(t.x,t.y),f.lineTo(e.x,e.y),f.stroke();var w=this.xLabel;w.length>0&&(u=.1/this.scale.y,o=(this.xMin+this.xMax)/2,a=Math.cos(M)>0?this.yMin-u:this.yMax+u,n=this._convert3Dto2D(new h(o,a,this.zMin)),Math.cos(2*M)>0?(f.textAlign="center",f.textBaseline="top"):Math.sin(2*M)<0?(f.textAlign="right",f.textBaseline="middle"):(f.textAlign="left",f.textBaseline="middle"),f.fillStyle=this.colorAxis,f.fillText(w,n.x,n.y));var L=this.yLabel;L.length>0&&(l=.1/this.scale.x,o=Math.sin(M)>0?this.xMin-l:this.xMax+l,a=(this.yMin+this.yMax)/2,n=this._convert3Dto2D(new h(o,a,this.zMin)),Math.cos(2*M)<0?(f.textAlign="center",f.textBaseline="top"):Math.sin(2*M)>0?(f.textAlign="right",f.textBaseline="middle"):(f.textAlign="left",f.textBaseline="middle"),f.fillStyle=this.colorAxis,f.fillText(L,n.x,n.y));var x=this.zLabel;x.length>0&&(d=30,o=Math.cos(M)>0?this.xMin:this.xMax,a=Math.sin(M)<0?this.yMin:this.yMax,r=(this.zMin+this.zMax)/2,n=this._convert3Dto2D(new h(o,a,r)),f.textAlign="right",f.textBaseline="middle",f.fillStyle=this.colorAxis,f.fillText(x,n.x-d,n.y))},s.prototype._hsv2rgb=function(t,e,i){var s,n,o,a,r,h;switch(a=i*e,r=Math.floor(t/60),h=a*(1-Math.abs(t/60%2-1)),r){case 0:s=a,n=h,o=0;break;case 1:s=h,n=a,o=0;break;case 2:s=0,n=a,o=h;break;case 3:s=0,n=h,o=a;break;case 4:s=h,n=0,o=a;break;case 5:s=a,n=0,o=h;break;default:s=0,n=0,o=0}return"RGB("+parseInt(255*s)+","+parseInt(255*n)+","+parseInt(255*o)+")"},s.prototype._redrawDataGrid=function(){var t,e,i,n,o,a,r,d,l,c,u,p,m,_=this.frame.canvas,f=_.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(o=0;o0}else a=!0;a?(m=(t.point.z+e.point.z+i.point.z+n.point.z)/4,c=240*(1-(m-this.zMin)*this.scale.z/this.verticalRatio),u=1,this.showShadow?(p=Math.min(1+L.x/x/2,1),r=this._hsv2rgb(c,u,p),d=r):(p=1,r=this._hsv2rgb(c,u,p),d=this.colorAxis)):(r="gray",d=this.colorAxis),l=.5,f.lineWidth=l,f.fillStyle=r,f.strokeStyle=d,f.beginPath(),f.moveTo(t.screen.x,t.screen.y),f.lineTo(e.screen.x,e.screen.y),f.lineTo(n.screen.x,n.screen.y),f.lineTo(i.screen.x,i.screen.y),f.closePath(),f.fill(),f.stroke()}}else for(o=0;ou&&(u=0);var p,m,_;this.style===s.STYLE.DOTCOLOR?(p=240*(1-(d.point.value-this.valueMin)*this.scale.value),m=this._hsv2rgb(p,1,1),_=this._hsv2rgb(p,1,.8)):this.style===s.STYLE.DOTSIZE?(m=this.colorDot,_=this.colorDotBorder):(p=240*(1-(d.point.z-this.zMin)*this.scale.z/this.verticalRatio),m=this._hsv2rgb(p,1,1),_=this._hsv2rgb(p,1,.8)),i.lineWidth=1,i.strokeStyle=_,i.fillStyle=m,i.beginPath(),i.arc(d.screen.x,d.screen.y,u,0,2*Math.PI,!0),i.fill(),i.stroke()}}},s.prototype._redrawDataBar=function(){var t,e,i,n,o=this.frame.canvas,a=o.getContext("2d");if(!(void 0===this.dataPoints||this.dataPoints.length<=0)){for(t=0;t0&&(t=this.dataPoints[0],s.lineWidth=1,s.strokeStyle="blue",s.beginPath(),s.moveTo(t.screen.x,t.screen.y)),e=1;e0&&s.stroke()}},s.prototype._onMouseDown=function(t){if(t=t||window.event,this.leftButtonDown&&this._onMouseUp(t),this.leftButtonDown=t.which?1===t.which:1===t.button,this.leftButtonDown||this.touchDown){this.startMouseX=getMouseX(t),this.startMouseY=getMouseY(t),this.startStart=new Date(this.start),this.startEnd=new Date(this.end),this.startArmRotation=this.camera.getArmRotation(),this.frame.style.cursor="move";var e=this;this.onmousemove=function(t){e._onMouseMove(t)},this.onmouseup=function(t){e._onMouseUp(t)},G3DaddEventListener(document,"mousemove",e.onmousemove),G3DaddEventListener(document,"mouseup",e.onmouseup),G3DpreventDefault(t)}},s.prototype._onMouseMove=function(t){t=t||window.event;var e=parseFloat(getMouseX(t))-this.startMouseX,i=parseFloat(getMouseY(t))-this.startMouseY,s=this.startArmRotation.horizontal+e/200,n=this.startArmRotation.vertical+i/200,o=4,a=Math.sin(o/360*2*Math.PI);Math.abs(Math.sin(s))0?1:0>t?-1:0}var s=e[0],n=e[1],o=e[2],a=i((n.x-s.x)*(t.y-s.y)-(n.y-s.y)*(t.x-s.x)),r=i((o.x-n.x)*(t.y-n.y)-(o.y-n.y)*(t.x-n.x)),h=i((s.x-o.x)*(t.y-o.y)-(s.y-o.y)*(t.x-o.x));return!(0!=a&&0!=r&&a!=r||0!=r&&0!=h&&r!=h||0!=a&&0!=h&&a!=h)},s.prototype._dataPointFromXY=function(t,e){var i,n=100,o=null,a=null,r=null,h=new d(t,e);if(this.style===s.STYLE.BAR||this.style===s.STYLE.BARCOLOR||this.style===s.STYLE.BARSIZE)for(i=this.dataPoints.length-1;i>=0;i--){o=this.dataPoints[i];var l=o.surfaces;if(l)for(var c=l.length-1;c>=0;c--){var u=l[c],p=u.corners,m=[p[0].screen,p[1].screen,p[2].screen],_=[p[2].screen,p[3].screen,p[0].screen];if(this._insideTriangle(h,m)||this._insideTriangle(h,_))return o}}else for(i=0;iv)&&n>v&&(r=v,a=o)}}return a},s.prototype._showTooltip=function(t){var e,i,s;this.tooltip?(e=this.tooltip.dom.content,i=this.tooltip.dom.line,s=this.tooltip.dom.dot):(e=document.createElement("div"),e.style.position="absolute",e.style.padding="10px",e.style.border="1px solid #4d4d4d",e.style.color="#1a1a1a",e.style.background="rgba(255,255,255,0.7)",e.style.borderRadius="2px",e.style.boxShadow="5px 5px 10px rgba(128,128,128,0.5)",i=document.createElement("div"),i.style.position="absolute",i.style.height="40px",i.style.width="0",i.style.borderLeft="1px solid #4d4d4d",s=document.createElement("div"),s.style.position="absolute",s.style.height="0",s.style.width="0",s.style.border="5px solid #4d4d4d",s.style.borderRadius="5px",this.tooltip={dataPoint:null,dom:{content:e,line:i,dot:s}}),this._hideTooltip(),this.tooltip.dataPoint=t,e.innerHTML="function"==typeof this.showTooltip?this.showTooltip(t.point):"