Browse Source

Merge remote-tracking branch 'origin/develop' into develop

Conflicts:
	dist/vis.js
v3_develop
Alex de Mulder 10 years ago
parent
commit
eed0edd5d3
20 changed files with 999 additions and 895 deletions
  1. +1
    -0
      .gitignore
  2. +8
    -3
      HISTORY.md
  3. +1
    -1
      bower.json
  4. +1
    -1
      dist/vis.css
  5. +939
    -851
      dist/vis.js
  6. +1
    -1
      dist/vis.map
  7. +1
    -1
      dist/vis.min.css
  8. +14
    -14
      dist/vis.min.js
  9. +2
    -2
      lib/graph3d/Camera.js
  10. +6
    -6
      lib/graph3d/Graph3d.js
  11. +2
    -2
      lib/graph3d/Point2d.js
  12. +2
    -0
      lib/header.js
  13. +1
    -1
      lib/network/Network.js
  14. +1
    -1
      lib/network/dotparser.js
  15. +2
    -2
      lib/network/mixins/NavigationMixin.js
  16. +1
    -1
      lib/timeline/Range.js
  17. +1
    -1
      lib/timeline/component/css/item.css
  18. +13
    -5
      lib/timeline/component/item/RangeItem.js
  19. +1
    -1
      package.json
  20. +1
    -1
      test/timeline.html

+ 1
- 0
.gitignore View File

@ -1,4 +1,5 @@
.idea .idea
.c9
*.iml *.iml
node_modules node_modules
.project .project

+ 8
- 3
HISTORY.md View File

@ -2,7 +2,12 @@
http://visjs.org http://visjs.org
## not yet released, version 3.7.1
## not yet released, version 3.7.2-SNAPSHOT
## 2014-11-28, version 3.7.1
### Timeline ### Timeline
@ -19,14 +24,14 @@ http://visjs.org
- Added `alignZeros` option to dataAxis with default value true. - Added `alignZeros` option to dataAxis with default value true.
- Fixed bug with points drawn on bargraphs - Fixed bug with points drawn on bargraphs
- Fixed docs - Fixed docs
- Fixed height increase on scolling if only graphHeight is defined.
- Fixed height increase on scrolling if only `graphHeight` is defined.
### Network ### Network
- dragEnd event now does not give the selected nodes if only the viewport has been dragged #453 - dragEnd event now does not give the selected nodes if only the viewport has been dragged #453
- merged high DPI fix by @crubier, thanks! - merged high DPI fix by @crubier, thanks!
## 2014-11-14, version 3.7.0 ## 2014-11-14, version 3.7.0
### Graph2D ### Graph2D

+ 1
- 1
bower.json View File

@ -1,6 +1,6 @@
{ {
"name": "vis", "name": "vis",
"version": "3.7.1-SNAPSHOT",
"version": "3.7.2-SNAPSHOT",
"main": ["dist/vis.min.js", "dist/vis.min.css"], "main": ["dist/vis.min.js", "dist/vis.min.css"],
"description": "A dynamic, browser-based visualization library.", "description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/", "homepage": "http://visjs.org/",

+ 1
- 1
dist/vis.css View File

@ -214,7 +214,6 @@
border-style: solid; border-style: solid;
border-radius: 2px; border-radius: 2px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden;
} }
.vis.timeline .item.background { .vis.timeline .item.background {
@ -229,6 +228,7 @@
.vis.timeline .item.range .content { .vis.timeline .item.range .content {
position: relative; position: relative;
display: inline-block; display: inline-block;
max-width: 100%;
overflow: hidden; overflow: hidden;
} }

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


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


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


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


+ 2
- 2
lib/graph3d/Camera.js View File

@ -10,7 +10,7 @@ var Point3d = require('./Point3d');
* Documentation: * Documentation:
* http://en.wikipedia.org/wiki/3D_projection * http://en.wikipedia.org/wiki/3D_projection
*/ */
Camera = function () {
function Camera() {
this.armLocation = new Point3d(); this.armLocation = new Point3d();
this.armRotation = {}; this.armRotation = {};
this.armRotation.horizontal = 0; this.armRotation.horizontal = 0;
@ -21,7 +21,7 @@ Camera = function () {
this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0); this.cameraRotation = new Point3d(0.5*Math.PI, 0, 0);
this.calculateCameraOrientation(); this.calculateCameraOrientation();
};
}
/** /**
* Set the location (origin) of the arm * Set the location (origin) of the arm

+ 6
- 6
lib/graph3d/Graph3d.js View File

@ -525,9 +525,9 @@ Graph3d.prototype._getDataPoints = function (data) {
} }
} }
function sortNumber(a, b) {
var sortNumber = function (a, b) {
return a - b; return a - b;
}
};
dataX.sort(sortNumber); dataX.sort(sortNumber);
dataY.sort(sortNumber); dataY.sort(sortNumber);
@ -2260,19 +2260,19 @@ Graph3d.prototype._hideTooltip = function () {
* @param {Event} event * @param {Event} event
* @return {Number} mouse x * @return {Number} mouse x
*/ */
getMouseX = function(event) {
function getMouseX (event) {
if ('clientX' in event) return event.clientX; if ('clientX' in event) return event.clientX;
return event.targetTouches[0] && event.targetTouches[0].clientX || 0; return event.targetTouches[0] && event.targetTouches[0].clientX || 0;
};
}
/** /**
* Get the vertical mouse position from a mouse event * Get the vertical mouse position from a mouse event
* @param {Event} event * @param {Event} event
* @return {Number} mouse y * @return {Number} mouse y
*/ */
getMouseY = function(event) {
function getMouseY (event) {
if ('clientY' in event) return event.clientY; if ('clientY' in event) return event.clientY;
return event.targetTouches[0] && event.targetTouches[0].clientY || 0; return event.targetTouches[0] && event.targetTouches[0].clientY || 0;
};
}
module.exports = Graph3d; module.exports = Graph3d;

+ 2
- 2
lib/graph3d/Point2d.js View File

@ -3,9 +3,9 @@
* @param {Number} [x] * @param {Number} [x]
* @param {Number} [y] * @param {Number} [y]
*/ */
Point2d = function (x, y) {
function Point2d (x, y) {
this.x = x !== undefined ? x : 0; this.x = x !== undefined ? x : 0;
this.y = y !== undefined ? y : 0; this.y = y !== undefined ? y : 0;
};
}
module.exports = Point2d; module.exports = Point2d;

+ 2
- 0
lib/header.js View File

@ -22,3 +22,5 @@
* *
* Vis.js may be distributed under either license. * Vis.js may be distributed under either license.
*/ */
"use strict";

+ 1
- 1
lib/network/Network.js View File

@ -219,7 +219,7 @@ function Network (container, data, options) {
this.hoverObj = {nodes:{},edges:{}}; this.hoverObj = {nodes:{},edges:{}};
this.controlNodesActive = false; this.controlNodesActive = false;
this.navigationHammers = {existing:[], new: []};
this.navigationHammers = {existing:[], _new: []};
// animation properties // animation properties
this.animationSpeed = 1/this.renderRefreshRate; this.animationSpeed = 1/this.renderRefreshRate;

+ 1
- 1
lib/network/dotparser.js View File

@ -761,7 +761,7 @@ function DOTToGraph (data) {
* @param {Object} dotEdge * @param {Object} dotEdge
* @returns {Object} graphEdge * @returns {Object} graphEdge
*/ */
function convertEdge(dotEdge) {
var convertEdge = function (dotEdge) {
var graphEdge = { var graphEdge = {
from: dotEdge.from, from: dotEdge.from,
to: dotEdge.to to: dotEdge.to

+ 2
- 2
lib/network/mixins/NavigationMixin.js View File

@ -43,12 +43,12 @@ exports._loadNavigationElements = function() {
var hammer = Hammer(this.navigationDivs[navigationDivs[i]], {prevent_default: true}); var hammer = Hammer(this.navigationDivs[navigationDivs[i]], {prevent_default: true});
hammer.on('touch', this[navigationDivActions[i]].bind(this)); hammer.on('touch', this[navigationDivActions[i]].bind(this));
this.navigationHammers.new.push(hammer);
this.navigationHammers._new.push(hammer);
} }
this._navigationReleaseOverload = this._stopMovement; this._navigationReleaseOverload = this._stopMovement;
this.navigationHammers.existing = this.navigationHammers.new;
this.navigationHammers.existing = this.navigationHammers._new;
}; };

+ 1
- 1
lib/timeline/Range.js View File

@ -127,7 +127,7 @@ Range.prototype.setRange = function(start, end, animate) {
var initTime = new Date().valueOf(); var initTime = new Date().valueOf();
var anyChanged = false; var anyChanged = false;
function next() {
var next = function () {
if (!me.props.touch.dragging) { if (!me.props.touch.dragging) {
var now = new Date().valueOf(); var now = new Date().valueOf();
var time = now - initTime; var time = now - initTime;

+ 1
- 1
lib/timeline/component/css/item.css View File

@ -47,7 +47,6 @@
border-style: solid; border-style: solid;
border-radius: 2px; border-radius: 2px;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden;
} }
.vis.timeline .item.background { .vis.timeline .item.background {
@ -62,6 +61,7 @@
.vis.timeline .item.range .content { .vis.timeline .item.range .content {
position: relative; position: relative;
display: inline-block; display: inline-block;
max-width: 100%;
overflow: hidden; overflow: hidden;
} }

+ 13
- 5
lib/timeline/component/item/RangeItem.js View File

@ -103,8 +103,12 @@ RangeItem.prototype.redraw = function() {
this.overflow = window.getComputedStyle(dom.content).overflow !== 'hidden'; this.overflow = window.getComputedStyle(dom.content).overflow !== 'hidden';
// recalculate size // recalculate size
// turn off max-width to be able to calculate the real width
// this causes an extra browser repaint/reflow, but so be it
this.dom.content.style.maxWidth = 'none';
this.props.content.width = this.dom.content.offsetWidth; this.props.content.width = this.dom.content.offsetWidth;
this.height = this.dom.box.offsetHeight; this.height = this.dom.box.offsetHeight;
this.dom.content.style.maxWidth = '';
this.dirty = false; this.dirty = false;
} }
@ -175,7 +179,7 @@ RangeItem.prototype.repositionX = function() {
else { else {
this.left = start; this.left = start;
this.width = boxWidth; this.width = boxWidth;
contentWidth = Math.min(end - start, this.props.content.width);
contentWidth = Math.min(end - start - 2 * this.options.padding, this.props.content.width);
} }
this.dom.box.style.left = this.left + 'px'; this.dom.box.style.left = this.left + 'px';
@ -195,15 +199,19 @@ RangeItem.prototype.repositionX = function() {
break; break;
default: // 'auto' default: // 'auto'
// when range exceeds left of the window, position the contents at the left of the visible area
if (this.overflow) { if (this.overflow) {
// when range exceeds left of the window, position the contents at the left of the visible area
contentLeft = Math.max(-start, 0);
if (end > 0) {
contentLeft = Math.max(-start, 0);
}
else {
contentLeft = -contentWidth; // ensure it's not visible anymore
}
} }
else { else {
// when range exceeds left of the window, position the contents at the left of the visible area
if (start < 0) { if (start < 0) {
contentLeft = Math.min(-start, contentLeft = Math.min(-start,
(end - start - this.props.content.width - 2 * this.options.padding));
(end - start - contentWidth - 2 * this.options.padding));
// TODO: remove the need for options.padding. it's terrible. // TODO: remove the need for options.padding. it's terrible.
} }
else { else {

+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{ {
"name": "vis", "name": "vis",
"version": "3.7.1-SNAPSHOT",
"version": "3.7.2-SNAPSHOT",
"description": "A dynamic, browser-based visualization library.", "description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/", "homepage": "http://visjs.org/",
"repository": { "repository": {

+ 1
- 1
test/timeline.html View File

@ -75,7 +75,7 @@
'<div onclick="alert(\'you clicked a div\'); ">Click here! (div)</div>', start: now.clone().add(-2, 'days').toDate() }, '<div onclick="alert(\'you clicked a div\'); ">Click here! (div)</div>', start: now.clone().add(-2, 'days').toDate() },
{_id: 3, content: 'item 3', start: now.clone().add(2, 'days').toDate(), style: 'color: red;'}, {_id: 3, content: 'item 3', start: now.clone().add(2, 'days').toDate(), style: 'color: red;'},
{ {
_id: 4, content: 'item 4 ',
_id: 4, content: 'item 4 foo bar foo bar foo bar foo bar foo bar',
start: now.clone().add(0, 'days').toDate(), start: now.clone().add(0, 'days').toDate(),
end: now.clone().add(7, 'days').toDate(), end: now.clone().add(7, 'days').toDate(),
title: 'hello title!' title: 'hello title!'

Loading…
Cancel
Save