From 427de224adbb5dcafa42f1dcfe215195a70b8e03 Mon Sep 17 00:00:00 2001 From: wimrijnders Date: Tue, 20 Jun 2017 19:23:33 +0200 Subject: [PATCH 1/5] Reverse nodes returned with 'from' and 'to' directions (#3186) The returned node id's were exactly the wrong way around; 'to' returned the parents, 'from' returned the children. This fix swaps the tests for determining which to return. --- lib/network/modules/NodesHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/network/modules/NodesHandler.js b/lib/network/modules/NodesHandler.js index e7e918d5..85a00c9c 100644 --- a/lib/network/modules/NodesHandler.js +++ b/lib/network/modules/NodesHandler.js @@ -425,13 +425,13 @@ class NodesHandler { let nodeObj = {}; // used to quickly check if node already exists for (let i = 0; i < node.edges.length; i++) { let edge = node.edges[i]; - if (direction !== 'from' && edge.toId == node.id) { // these are double equals since ids can be numeric or string + if (direction !== 'to' && edge.toId == node.id) { // these are double equals since ids can be numeric or string if (nodeObj[edge.fromId] === undefined) { nodeList.push(edge.fromId); nodeObj[edge.fromId] = true; } } - else if (direction !== 'to' && edge.fromId == node.id) { // these are double equals since ids can be numeric or string + else if (direction !== 'from' && edge.fromId == node.id) { // these are double equals since ids can be numeric or string if (nodeObj[edge.toId] === undefined) { nodeList.push(edge.toId); nodeObj[edge.toId] = true; From 13ef7eeb63487badc144b15191e4c177c78f9e82 Mon Sep 17 00:00:00 2001 From: Joshua Walsh Date: Wed, 21 Jun 2017 03:25:14 +1000 Subject: [PATCH 2/5] Fixed #3183 (#3184) Fixes a race condition that set an item's group to be set to undefined if it was dropped and then dragged again without a redraw happening in between. --- lib/timeline/component/ItemSet.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 0aa845b9..e5e168a3 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -1342,6 +1342,12 @@ ItemSet.prototype._onDragStart = function (event) { this.touchParams.itemProps = [props]; } else { + if(this.groupIds.length < 1) { + // Mitigates a race condition if _onDragStart() is + // called after markDirty() without redraw() being called between. + this.redraw(); + } + var baseGroupIndex = this._getGroupIndex(item.data.group); var itemsToDrag = (this.options.itemsAlwaysDraggable.item && !item.selected) ? [item.id] : this.getSelection(); From a820ec4b77bf0106eb0b602e291db4d4d2ef135f Mon Sep 17 00:00:00 2001 From: wimrijnders Date: Tue, 20 Jun 2017 19:28:53 +0200 Subject: [PATCH 3/5] Refactoring of Node Drawing (#3170) * Consolidated common code for drawing in nodes * Consolidated updateBoundingBox(), default version * Setting bounding box margin in separate method --- .../modules/components/nodes/shapes/Box.js | 37 +-------- .../modules/components/nodes/shapes/Circle.js | 6 -- .../components/nodes/shapes/Database.js | 39 +--------- .../components/nodes/shapes/Ellipse.js | 40 +--------- .../modules/components/nodes/shapes/Image.js | 22 +----- .../modules/components/nodes/shapes/Text.js | 12 --- .../components/nodes/util/CircleImageBase.js | 26 +------ .../modules/components/nodes/util/NodeBase.js | 77 +++++++++++++++++++ .../components/nodes/util/ShapeBase.js | 27 +------ 9 files changed, 92 insertions(+), 194 deletions(-) diff --git a/lib/network/modules/components/nodes/shapes/Box.js b/lib/network/modules/components/nodes/shapes/Box.js index 5b3eb7a3..3b6ff973 100644 --- a/lib/network/modules/components/nodes/shapes/Box.js +++ b/lib/network/modules/components/nodes/shapes/Box.js @@ -22,33 +22,9 @@ class Box extends NodeBase { this.left = x - this.width / 2; this.top = y - this.height / 2; - ctx.strokeStyle = values.borderColor; - ctx.lineWidth = values.borderWidth; - ctx.lineWidth /= this.body.view.scale; - ctx.lineWidth = Math.min(this.width, ctx.lineWidth); - - ctx.fillStyle = values.color; - + this.initContextForDraw(ctx, values); ctx.roundRect(this.left, this.top, this.width, this.height, values.borderRadius); - - // draw shadow if enabled - this.enableShadow(ctx, values); - // draw the background - ctx.fill(); - // disable shadows for other elements. - this.disableShadow(ctx, values); - - //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. - ctx.save(); - // if borders are zero width, they will be drawn with width 1 by default. This prevents that - if (values.borderWidth > 0) { - this.enableBorderDashes(ctx, values); - //draw the border - ctx.stroke(); - //disable dashed border for other elements - this.disableBorderDashes(ctx, values); - } - ctx.restore(); + this.performFill(ctx, values); this.updateBoundingBox(x, y, ctx, selected, hover); this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, @@ -56,15 +32,10 @@ class Box extends NodeBase { } updateBoundingBox(x, y, ctx, selected, hover) { - this.resize(ctx, selected, hover); - this.left = x - this.width / 2; - this.top = y - this.height / 2; + this._updateBoundingBox(x, y, ctx, selected, hover); let borderRadius = this.options.shapeProperties.borderRadius; // only effective for box - this.boundingBox.left = this.left - borderRadius; - this.boundingBox.top = this.top - borderRadius; - this.boundingBox.bottom = this.top + this.height + borderRadius; - this.boundingBox.right = this.left + this.width + borderRadius; + this._addBoundingBoxMargin(borderRadius); } distanceToBorder(ctx, angle) { diff --git a/lib/network/modules/components/nodes/shapes/Circle.js b/lib/network/modules/components/nodes/shapes/Circle.js index 764d7340..710c2e2e 100644 --- a/lib/network/modules/components/nodes/shapes/Circle.js +++ b/lib/network/modules/components/nodes/shapes/Circle.js @@ -28,12 +28,6 @@ class Circle extends CircleImageBase { this._drawRawCircle(ctx, x, y, values); - // TODO: values overwritten by updateBoundingBox(); is this bit necessary? - this.boundingBox.top = y - values.size; - this.boundingBox.left = x - values.size; - this.boundingBox.right = x + values.size; - this.boundingBox.bottom = y + values.size; - this.updateBoundingBox(x,y); this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, y, selected, hover); diff --git a/lib/network/modules/components/nodes/shapes/Database.js b/lib/network/modules/components/nodes/shapes/Database.js index efc6493c..91843a7f 100644 --- a/lib/network/modules/components/nodes/shapes/Database.js +++ b/lib/network/modules/components/nodes/shapes/Database.js @@ -23,50 +23,15 @@ class Database extends NodeBase { this.left = x - this.width / 2; this.top = y - this.height / 2; - var borderWidth = values.borderWidth / this.body.view.scale; - ctx.lineWidth = Math.min(this.width, borderWidth); - - ctx.strokeStyle = values.borderColor; - - ctx.fillStyle = values.color; + this.initContextForDraw(ctx, values); ctx.database(x - this.width / 2, y - this.height / 2, this.width, this.height); - - // draw shadow if enabled - this.enableShadow(ctx, values); - // draw the background - ctx.fill(); - // disable shadows for other elements. - this.disableShadow(ctx, values); - - //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. - ctx.save(); - // if borders are zero width, they will be drawn with width 1 by default. This prevents that - if (borderWidth > 0) { - this.enableBorderDashes(ctx, values); - //draw the border - ctx.stroke(); - //disable dashed border for other elements - this.disableBorderDashes(ctx, values); - } - ctx.restore(); + this.performFill(ctx, values); this.updateBoundingBox(x, y, ctx, selected, hover); this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover); } - updateBoundingBox(x, y, ctx, selected, hover) { - this.resize(ctx, selected, hover); - - this.left = x - this.width * 0.5; - this.top = y - this.height * 0.5; - - this.boundingBox.left = this.left; - this.boundingBox.top = this.top; - this.boundingBox.bottom = this.top + this.height; - this.boundingBox.right = this.left + this.width; - } - distanceToBorder(ctx, angle) { return this._distanceToBorder(ctx,angle); } diff --git a/lib/network/modules/components/nodes/shapes/Ellipse.js b/lib/network/modules/components/nodes/shapes/Ellipse.js index d993efe3..d36b4b7b 100644 --- a/lib/network/modules/components/nodes/shapes/Ellipse.js +++ b/lib/network/modules/components/nodes/shapes/Ellipse.js @@ -22,50 +22,14 @@ class Ellipse extends NodeBase { this.left = x - this.width * 0.5; this.top = y - this.height * 0.5; - var borderWidth = values.borderWidth / this.body.view.scale; - ctx.lineWidth = Math.min(this.width, borderWidth); - - ctx.strokeStyle = values.borderColor; - - ctx.fillStyle = values.color; + this.initContextForDraw(ctx, values); ctx.ellipse_vis(this.left, this.top, this.width, this.height); - - // draw shadow if enabled - this.enableShadow(ctx, values); - // draw the background - ctx.fill(); - // disable shadows for other elements. - this.disableShadow(ctx, values); - - //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. - ctx.save(); - - // if borders are zero width, they will be drawn with width 1 by default. This prevents that - if (borderWidth > 0) { - this.enableBorderDashes(ctx, values); - //draw the border - ctx.stroke(); - //disable dashed border for other elements - this.disableBorderDashes(ctx, values); - } - - ctx.restore(); + this.performFill(ctx, values); this.updateBoundingBox(x, y, ctx, selected, hover); this.labelModule.draw(ctx, x, y, selected, hover); } - updateBoundingBox(x, y, ctx, selected, hover) { - this.resize(ctx, selected, hover); // just in case - - this.left = x - this.width * 0.5; - this.top = y - this.height * 0.5; - - this.boundingBox.left = this.left; - this.boundingBox.top = this.top; - this.boundingBox.bottom = this.top + this.height; - this.boundingBox.right = this.left + this.width; - } distanceToBorder(ctx, angle) { this.resize(ctx); diff --git a/lib/network/modules/components/nodes/shapes/Image.js b/lib/network/modules/components/nodes/shapes/Image.js index ab1e7135..5905f462 100644 --- a/lib/network/modules/components/nodes/shapes/Image.js +++ b/lib/network/modules/components/nodes/shapes/Image.js @@ -42,18 +42,8 @@ class Image extends CircleImageBase { this.height + ctx.lineWidth); ctx.fill(); - //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. - ctx.save(); - // if borders are zero width, they will be drawn with width 1 by default. This prevents that - if (borderWidth > 0) { - this.enableBorderDashes(ctx, values); - //draw the border - ctx.stroke(); - //disable dashed border for other elements - this.disableBorderDashes(ctx, values); - } - ctx.restore(); - + this.performStroke(ctx, values); + ctx.closePath(); } @@ -66,13 +56,7 @@ class Image extends CircleImageBase { updateBoundingBox(x,y) { this.resize(); - this.left = x - this.width / 2; - this.top = y - this.height / 2; - - this.boundingBox.top = this.top; - this.boundingBox.left = this.left; - this.boundingBox.right = this.left + this.width; - this.boundingBox.bottom = this.top + this.height; + this._updateBoundingBox(x, y); if (this.options.label !== undefined && this.labelModule.size.width > 0) { this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left); diff --git a/lib/network/modules/components/nodes/shapes/Text.js b/lib/network/modules/components/nodes/shapes/Text.js index f2b1ae40..34483e45 100644 --- a/lib/network/modules/components/nodes/shapes/Text.js +++ b/lib/network/modules/components/nodes/shapes/Text.js @@ -33,18 +33,6 @@ class Text extends NodeBase { this.updateBoundingBox(x, y, ctx, selected, hover); } - updateBoundingBox(x, y, ctx, selected, hover) { - this.resize(ctx, selected, hover); - - this.left = x - this.width / 2; - this.top = y - this.height / 2; - - this.boundingBox.top = this.top; - this.boundingBox.left = this.left; - this.boundingBox.right = this.left + this.width; - this.boundingBox.bottom = this.top + this.height; - } - distanceToBorder(ctx, angle) { return this._distanceToBorder(ctx,angle); } diff --git a/lib/network/modules/components/nodes/util/CircleImageBase.js b/lib/network/modules/components/nodes/util/CircleImageBase.js index 4209260e..2fcd81ba 100644 --- a/lib/network/modules/components/nodes/util/CircleImageBase.js +++ b/lib/network/modules/components/nodes/util/CircleImageBase.js @@ -109,31 +109,9 @@ class CircleImageBase extends NodeBase { } _drawRawCircle(ctx, x, y, values) { - var borderWidth = values.borderWidth / this.body.view.scale; - ctx.lineWidth = Math.min(this.width, borderWidth); - - ctx.strokeStyle = values.borderColor; - ctx.fillStyle = values.color; + this.initContextForDraw(ctx, values); ctx.circle(x, y, values.size); - - // draw shadow if enabled - this.enableShadow(ctx, values); - // draw the background - ctx.fill(); - // disable shadows for other elements. - this.disableShadow(ctx, values); - - //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. - ctx.save(); - // if borders are zero width, they will be drawn with width 1 by default. This prevents that - if (borderWidth > 0) { - this.enableBorderDashes(ctx, values); - //draw the border - ctx.stroke(); - //disable dashed border for other elements - this.disableBorderDashes(ctx, values); - } - ctx.restore(); + this.performFill(ctx, values); } _drawImageAtPosition(ctx, values) { diff --git a/lib/network/modules/components/nodes/util/NodeBase.js b/lib/network/modules/components/nodes/util/NodeBase.js index 1f7aaf03..92127adb 100644 --- a/lib/network/modules/components/nodes/util/NodeBase.js +++ b/lib/network/modules/components/nodes/util/NodeBase.js @@ -107,6 +107,83 @@ class NodeBase { return (this.width === undefined) || (this.labelModule.differentState(selected, hover)); } + + + initContextForDraw(ctx, values) { + var borderWidth = values.borderWidth / this.body.view.scale; + + ctx.lineWidth = Math.min(this.width, borderWidth); + ctx.strokeStyle = values.borderColor; + ctx.fillStyle = values.color; + } + + + performStroke(ctx, values) { + var borderWidth = values.borderWidth / this.body.view.scale; + + //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. + ctx.save(); + // if borders are zero width, they will be drawn with width 1 by default. This prevents that + if (borderWidth > 0) { + this.enableBorderDashes(ctx, values); + //draw the border + ctx.stroke(); + //disable dashed border for other elements + this.disableBorderDashes(ctx, values); + } + ctx.restore(); + } + + + performFill(ctx, values) { + // draw shadow if enabled + this.enableShadow(ctx, values); + // draw the background + ctx.fill(); + // disable shadows for other elements. + this.disableShadow(ctx, values); + + this.performStroke(ctx, values); + } + + + _addBoundingBoxMargin(margin) { + this.boundingBox.left -= margin; + this.boundingBox.top -= margin; + this.boundingBox.bottom += margin; + this.boundingBox.right += margin; + } + + + /** + * Actual implementation of this method call. + * + * Doing it like this makes it easier to override + * in the child classes. + */ + _updateBoundingBox(x, y, ctx, selected, hover) { + if (ctx !== undefined) { + this.resize(ctx, selected, hover); + } + + this.left = x - this.width / 2; + this.top = y - this.height/ 2; + + this.boundingBox.left = this.left; + this.boundingBox.top = this.top; + this.boundingBox.bottom = this.top + this.height; + this.boundingBox.right = this.left + this.width; + } + + + /** + * Default implementation of this method call. + * + * This acts as a stub which can be overridden. + */ + updateBoundingBox(x, y, ctx, selected, hover) { + this._updateBoundingBox(x, y, ctx, selected, hover); + } } export default NodeBase; diff --git a/lib/network/modules/components/nodes/util/ShapeBase.js b/lib/network/modules/components/nodes/util/ShapeBase.js index 6c2e14e3..578c4c13 100644 --- a/lib/network/modules/components/nodes/util/ShapeBase.js +++ b/lib/network/modules/components/nodes/util/ShapeBase.js @@ -17,35 +17,12 @@ class ShapeBase extends NodeBase { _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values) { this.resize(ctx, selected, hover, values); - this.left = x - this.width / 2; this.top = y - this.height / 2; - var borderWidth = values.borderWidth / this.body.view.scale; - ctx.lineWidth = Math.min(this.width, borderWidth); - - ctx.strokeStyle = values.borderColor; - ctx.fillStyle = values.color; + this.initContextForDraw(ctx, values); ctx[shape](x, y, values.size); - - // draw shadow if enabled - this.enableShadow(ctx, values); - // draw the background - ctx.fill(); - // disable shadows for other elements. - this.disableShadow(ctx, values); - - //draw dashed border if enabled, save and restore is required for firefox not to crash on unix. - ctx.save(); - // if borders are zero width, they will be drawn with width 1 by default. This prevents that - if (borderWidth > 0) { - this.enableBorderDashes(ctx, values); - //draw the border - ctx.stroke(); - //disable dashed border for other elements - this.disableBorderDashes(ctx, values); - } - ctx.restore(); + this.performFill(ctx, values); if (this.options.label !== undefined) { // Need to call following here in order to ensure value for `this.labelModule.size.height` From 2eb4bbc2d9e5e2edd6144b342af3a81851549f1a Mon Sep 17 00:00:00 2001 From: Alexander Wunschik Date: Tue, 20 Jun 2017 19:29:18 +0200 Subject: [PATCH 4/5] Release checklist (#3084) * created a checklist for the release process * unchecked everything * added make github release * Fix typoes --- misc/RELEASE_CHECKLIST_TEMPLATE.md | 83 +++++++++++++++++++++++++ misc/how_to_publish.md | 97 ------------------------------ 2 files changed, 83 insertions(+), 97 deletions(-) create mode 100644 misc/RELEASE_CHECKLIST_TEMPLATE.md delete mode 100644 misc/how_to_publish.md diff --git a/misc/RELEASE_CHECKLIST_TEMPLATE.md b/misc/RELEASE_CHECKLIST_TEMPLATE.md new file mode 100644 index 00000000..dda85691 --- /dev/null +++ b/misc/RELEASE_CHECKLIST_TEMPLATE.md @@ -0,0 +1,83 @@ +# Release Checklist + +## Communication +- [ ] Create a new issue and copy&paste this checklist into it (Yeah! First Step done!) +- [ ] Talk to the team: Who should make the release? +- [ ] Announce a "Code-Freeze". No new Pull-Request until the release is done! +- [ ] Checkout if we have MAJOR or MINOR changes. If not we do a PATCH release. +- [ ] The new version will be: `vX.Y.Z` +- [ ] Identify open BUGS and add them to the next PATCH milestone (optional). +- [ ] Identify MINOR issues and add them to the next MINOR milestone (optional). + +## Update to the newest version +- [ ] Update to the current version: `git checkout develop && git pull`. +- [ ] Create a new release branch. (`git checkout -b vX.Y.Z develop`) + +## Build & Test +- [ ] Update the version number of the library in `package.json` (remove the "SNAPSHOT"). +- [ ] Build the library: `npm prune && rm -rf node_modules && npm install && npm run build && npm run test` +- [ ] Open some of the examples in your browser and visually check if it works as expected! (*We need automated tests for this!*) + +## History +(*THIS IS A LOT OF WORK! WE SHOULD TRY TO automate this in the future!!*) + +- [ ] Get all commits since the last release: ```git log `git describe --tags --abbrev=0`..HEAD --oneline > .commits.tmp``` +- [ ] Open ".commity.tmp". and remove all commit before the last release. +- [ ] Open every commit in GitHub and move every issue/pull-request to the current milestone. +- [ ] Transfer all Commit-Messages/issues to "HISTORY.md" starting at the button. + - Keep the order of the commits. Older commits are lower newers are higher. + - Bug-Fixes start with `FIX #issue:` + - New Features start with `FEAT #issue:` + +## Commit +- [ ] Commit the new version: `git commit -am "Release vX.Y.Z"` +- [ ] Push the release branch: `git push` +- [ ] Open a Pull-Request for the release-branch to the develop-branch. +- [ ] Wait until somebody of the team looked over your changes and merges the Pull-Request. + +### Update Master +We don't merge the development branch to the master because the master branch is different to the develop-Branch. The master branch has a dist and test folder and does not generate Source-Maps. + +If we would merge the development branch would overwrite this. To solve this we use rebase instead: + +- [ ] Update: `git fetch && git checkout develop && git pull` +- [ ] Rebase the `master` branch on the `develop` branch: `git checkout master && git rebase develop` +- [ ] Generate new dist files: `npm prune && rm -rf node_modules && npm install && npm run build && npm run test && git commit -am "generated dist files for vX.Y.Z" +- [ ] Create a version tag: `git tag "vX.Y.Z"` +- [ ] [Remove the protection](https://github.com/almende/vis/settings/branches/master) from `master`. +- [ ] FORCE-Push the branches to github: `git push --force && git push --tag` +- [ ] [Re-Enable branch protection](https://github.com/almende/vis/settings/branches/master) (enable ALL checkboxes) for `master`. +- [ ] Publish with npm: `npm publish` (check [npmjs.com](https://www.npmjs.com/package/vis)) +- [ ] Create a [new Release](https://github.com/almende/vis/releases/new) with the tang and the name "vX.Y.Z" and copy the data vom [HISTORY.md](../HISTORY.md) into the body. + + +## Test +- [ ] Go to a temp directory (e.g. "vis_vX.Y.Z"): `cd .. && mkdir vis_vX.Y.Z && cd vis_vX.Y.Z` +- [ ] Install the library from npm: `npm init -f && npm install vis` +- [ ] Verify if it installs the just released version, and verify if it works: `cd node_modules/vis/ +- [ ] Install the library via bower: `cd ../.. && bower install vis` +- [ ] Verify if it installs the just released version, and verify if it works: `cd bower_components/vis/` +- [ ] Clone the master from github: `cd ../.. && git clone git@github.com:almende/vis.git`. +- [ ] Verify if it installs the just released version, and verify if it works. `cd vis` + +## Update website +- [ ] update the gh-pages branch: `git checkout gh-pages && git pull && git checkout -b "gh-pages_vX.Y.Z"` +- [ ] Copy the `dist` folder from the `master` branch to the `github-pages` branch in another directory, overwriting existing files: `cp -rf ../vis_vX.Y.Z/vis/dist .` +- [ ] Copy the `docs` folder from the `master` branch to the `github-pages` branch in another directory, overwriting existing files: `cp -rf ../vis_vX.Y.Z/vis/docs .` +- [ ] Copy the `examples` folder from the `master` branch to the `github-pages` branch in another directory, overwriting existing files: `cp -rf ../vis_vX.Y.Z/vis/examples .` +- [ ] Check if there are new or updated examples, and update the gallery screenshots accordingly. +- [ ] Update the library version number in the `index.html` page. +- [ ] Update the CDN links at the download section of index.html AND the CDN link at the top. (search-replace all!!) +- [ ] Commit the changes: `git add -A && git commit -m "updates for vX.Y.Z"` +- [ ] Push the changes `git push --set-upstream origin gh-pages_vX.Y.Z` + +## Prepare next version +- [ ] Switch to the "develop" branch: `git checkout develop`. +- [ ] Change version numbers in "package.json" to a snapshot version `X.X.Z-SNAPSHOT`. +- [ ] Commit and push: `git commit -am "changed version to vX.X.Z-SNAPSHOT"` +- [ ] Create new tag: `git tag vX.X.Z-SNAPSHOT`. +- [ ] [Remove the protection](https://github.com/almende/vis/settings/branches/develop) from `develop`. +- [ ] FORCE-Push the branches to github: `git push --force && git push --tag` +- [ ] [Re-Enable branch protection](https://github.com/almende/vis/settings/branches/develop) (enable ALL checkboxes) for `develop`. + +DONE! diff --git a/misc/how_to_publish.md b/misc/how_to_publish.md deleted file mode 100644 index e5adde14..00000000 --- a/misc/how_to_publish.md +++ /dev/null @@ -1,97 +0,0 @@ -# How to publish vis.js - -This document describes how to publish vis.js. - - -## Build - -- Change the version number of the library in `package.json`. - - npm version major|minor|patch - git commit -m "bumped package.json version to X.XX.X" - -- Open `HISTORY.md`, write down the changes, version number, and release date. - (Changes since last release: `git log \`git describe --tags --abbrev=0\`..HEAD --oneline`) - -- Update external dependencies - - npm install -g npm-check-updates - npm-check-updates -u - git commit -a -m "updated external dependencies" - -- Build the library by running: - - npm prune - npm update - npm run build - -## Test - -- Test the library: - - npm test - -- Open some of the examples in your browser and visually check if it works as expected. - - -## Commit - -- Commit the changes to the `develop` branch. -- Merge the `develop` branch into the `master` branch. -- Push the branches to github -- Create a version tag (with the new version number) and push it to github: - - git tag v3.1.0 - git push --tags - - -## Publish - -- Publish at npm: - - npm publish - -- Test the published library: - - Go to a temp directory - - Install the library from npm: - - npm install vis - - Verify if it installs the just released version, and verify if it works. - - - Install the library via bower: - - bower install vis - - Verify if it installs the just released version, and verify if it works. - - - Verify within a day or so whether vis.js is updated on http://cdnjs.com/ - - -## Update website - -- Copy the `dist` folder from the `master` branch to the `github-pages` branch. -- Copy the `docs` folder from the `master` branch to the `github-pages` branch. -- Copy the `examples` folder from the `master` branch to the `github-pages` branch. -- Create a packaged version of vis.js. Go to the `master` branch and run: - - zip vis.zip dist docs examples README.md HISTORY.md CONTRIBUTING.md LICENSE* NOTICE -r - -- Move the created zip file `vis.zip` to the `download` folder in the - `github-pages` branch. TODO: this should be automated. - -- Check if there are new or updated examples, and update the gallery screenshots - accordingly. - -- Update the library version number in the index.html page. - -- Update the CDN links at the download section of index.html AND the CDN link at the top. (replace all) - -- Commit the changes in the `gh-pages` branch. - - -## Prepare next version - -- Switch to the `develop` branch. -- Change version numbers in `package.json` to a snapshot - version like `0.4.0-SNAPSHOT`. From d8458a90da0bfc68940e90c9dad396950e893687 Mon Sep 17 00:00:00 2001 From: wimrijnders Date: Thu, 22 Jun 2017 19:05:53 +0200 Subject: [PATCH 5/5] Small fix on ref usage in DataGroup (#3198) --- lib/graph3d/DataGroup.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/graph3d/DataGroup.js b/lib/graph3d/DataGroup.js index 8f2a615b..6b2093b6 100644 --- a/lib/graph3d/DataGroup.js +++ b/lib/graph3d/DataGroup.js @@ -36,8 +36,6 @@ function DataGroup() { * @param {Number} style Style Number */ DataGroup.prototype.initializeData = function(graph3d, rawData, style) { - var me = this; - // unsubscribe from the dataTable if (this.dataSet) { this.dataSet.off('*', this._onChange); @@ -65,8 +63,9 @@ DataGroup.prototype.initializeData = function(graph3d, rawData, style) { this.dataTable = data; // subscribe to changes in the dataset + var me = this; this._onChange = function () { - me.setData(me.dataSet); + graph3d.setData(me.dataSet); }; this.dataSet.on('*', this._onChange);