From 77cf6df50b0e6072200ce4cca49b5a536a88bc7c Mon Sep 17 00:00:00 2001 From: yotamberk Date: Thu, 29 Jun 2017 10:27:54 +0300 Subject: [PATCH 1/2] Fix subgroup collision (#3200) * Fix redraw order * Fix error when option is not defined * Allow template labels * Add .travis.yml file * Add experiment travis code * Fix react example * created a checklist for the release process * unchecked everything * added make github release * Fix colliding subgroups when having same end-start times * Remove npm-debug logs --- .../items/expectedVsActualTimesItems.html | 21 ++++++++++++++++++- lib/timeline/component/Group.js | 8 +++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/examples/timeline/items/expectedVsActualTimesItems.html b/examples/timeline/items/expectedVsActualTimesItems.html index eda66556..7a5facca 100644 --- a/examples/timeline/items/expectedVsActualTimesItems.html +++ b/examples/timeline/items/expectedVsActualTimesItems.html @@ -85,13 +85,32 @@ group:'group1', subgroup:'sg_2' }, - { + { id: 4, content: 'item 2 (actual time)', start: '2014-01-14T12:00:00', end: '2014-01-17T12:00:00', group:'group1', subgroup:'sg_2' + }, + + // subgroup 3 + { + id: 5, + content: 'item 3 (expected time)', + className: 'expected', + start: '2014-01-17T12:00:00', + end: '2014-01-19T12:00:00', + group:'group1', + subgroup:'sg_3' + }, + { + id: 6, + content: 'item 3 (actual time)', + start: '2014-01-17T12:00:00', + end: '2014-01-18T12:00:00', + group:'group1', + subgroup:'sg_3' } ]); diff --git a/lib/timeline/component/Group.js b/lib/timeline/component/Group.js index 2a6d550b..79ccf60d 100644 --- a/lib/timeline/component/Group.js +++ b/lib/timeline/component/Group.js @@ -246,6 +246,7 @@ Group.prototype.redraw = function(range, margin, forceRestack) { var restack = forceRestack || this.stackDirty || (this.isVisible && !lastIsVisible); + this._updateSubgroupsSizes(); // if restacking, reposition visible items vertically if(restack) { if (typeof this.itemSet.options.order === 'function') { @@ -285,9 +286,6 @@ Group.prototype.redraw = function(range, margin, forceRestack) { this.stackDirty = false; } - - this._updateSubgroupsSizes(); - // recalculate the height of the group var height = this._calculateHeight(margin); @@ -486,7 +484,7 @@ Group.prototype._updateSubgroupsSizes = function () { if (me.subgroups) { for (var subgroup in me.subgroups) { var newStart = me.subgroups[subgroup].items[0].data.start; - var newEnd = me.subgroups[subgroup].items[0].data.end; + var newEnd = me.subgroups[subgroup].items[0].data.end - 1; me.subgroups[subgroup].items.forEach(function(item) { if (new Date(item.data.start) < new Date(newStart)) { @@ -498,7 +496,7 @@ Group.prototype._updateSubgroupsSizes = function () { }) me.subgroups[subgroup].start = newStart; - me.subgroups[subgroup].end = newEnd; + me.subgroups[subgroup].end = new Date(newEnd - 1) // -1 to compensate for colliding end to start subgroups; } } From 9a95266f69f98ce5721475d9aee3348630d99aca Mon Sep 17 00:00:00 2001 From: yotamberk Date: Sun, 2 Jul 2017 22:48:04 +0300 Subject: [PATCH 2/2] V4.20.1 (#3224) * Fix redraw order * Fix error when option is not defined * Allow template labels * Add .travis.yml file * Add experiment travis code * Fix react example * created a checklist for the release process * unchecked everything * added make github release * Remove npm-debug logs * Release v4.20.1 * Update HISTORY.md Fix indents * Update HISTORY.md * Update HISTORY.md move - FEAT #3154 to timeline --- HISTORY.md | 37 +++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 5cacd289..f1de6a72 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,6 +1,43 @@ # vis.js history http://visjs.org + +## 2017-07-01, version 4.20.1 + +### General +- Added Release checklist +- Added collapsible items for objects in graph3d doc + +### Network +- FIX #3203: Set dimensions properly of images on initialization +- FIX #3198: Small fix on ref usage in DataGroup +- FIX #3170: Refactoring of Node Drawing +- FIX #3108: Reverse nodes returned with 'from' and 'to' directions +- FIX #3122: Refactored line drawing for Bezier edges +- FIX #3121: Refactoring of `BezierEdgeStatic._getViaCoordinates()` +- FIX #3088: Consolidate code for determining the pixel ratio +- FIX #3036: Smooth type 'dynamic' adjusted for node-specific option in hierarchical +- FIX #1105: Fix usage of clustering with hierarchical networks +- FIX #3133: Protect Network from zero and negative mass values +- FIX #3163: Prevent crashes from invalid id's in `Clustering.findNode()` +- FIX #3106: Ensure start and end of stabilization progress events is sent +- FIX #3015: Properly handle newline escape sequences in strings for DOT +- FIX Refactoring of LayoutEngine +- FIX #2990: Edge labels turn bold on select and hover +- FIX #2959: Changed order of (de)select events for network +- FIX #3091: Added param 'direction' to Network.getConnectedNodes() +- FIX #3085: Add prefix to cancelAnimationFrame() + +### Graph3D +- FIX #2804: Add data group class to Graph3d + +### Timeline +- FIX #3172: Fix stacking when setting option +- FIX #3183: Fixes a race condition that set an item's group to be set to undefined +- FEAT #3154: Caching to Range getMillisecondsPerPixel function +- FIX #3105: Adjusting timeline TimeStep.roundToMinor +- FEAT #3107: Allow overriding `align` per item + ## 2017-05-21, version 4.20.0 ### General diff --git a/package.json b/package.json index e1d285ee..7d050a94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vis", - "version": "4.20.1-SNAPSHOT", + "version": "4.20.1", "description": "A dynamic, browser-based visualization library.", "homepage": "http://visjs.org/", "license": "(Apache-2.0 OR MIT)",