dev 2.0.1

This commit is contained in:
TomHuangCN 2018-06-11 16:30:08 +08:00
parent 1cf0714c77
commit 98783300f7
9 changed files with 37 additions and 7 deletions

View File

@ -4,6 +4,15 @@
## v2.0.0
`2018-06-11`
* fix: reDraw edge after layout
* feat: add beforelayout && afterlayout event
* chore: .travis.yml add add Node.js
* chore: .travis.yml cache node_modules
## v2.0.0
`2018-06-06`
* refactor: 重构架构 && 代码

13
bin/version.js Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const cPath = path.join(process.cwd(), './package.json');
const version = require('../src/version');
const pk = JSON.parse(fs.readFileSync(cPath, 'utf8'));
pk.version = version;
fs.writeFile(cPath, JSON.stringify(pk, null, ' '), function(err) {
if (err) {
return console.error(err);
}
});

View File

@ -1,6 +1,6 @@
{
"name": "@antv/g6",
"version": "2.0.0",
"version": "2.0.1-beta",
"description": "graph visualization frame work",
"main": "lib/index.js",
"browser": "build/g6.js",
@ -89,12 +89,12 @@
"coverage-viewer": "torch-coverage",
"demos": "electron ./demos/app.js",
"demos-web": "node ./demos/app.js --web --port 2046",
"dev": "npm run watch & npm run demos-web",
"dev": "npm run demos-web & npm run watch",
"dist": "npm run mkdir-dist && npm run build && npm run copy",
"lint": "eslint --ext .js ./src",
"lint-fix": "eslint --ext .html,.js --fix ./",
"mkdir-dist": "node ./bin/mkdir-dist.js",
"prepublishOnly": "npm run build-lib && npm run dist",
"prepublishOnly": "npm run build-lib && npm run dist && node ./bin/version.js",
"screenshot": "node ./bin/screenshot.js",
"start": "npm run dev",
"test": "torch --compile --renderer --recursive ./test/unit",
@ -121,4 +121,4 @@
"engines": {
"node": ">=8.9.0"
}
}
}

View File

@ -56,6 +56,7 @@ class Controller extends Base {
layout() {
const graph = this.graph;
const processer = this.processer;
graph.emit('beforelayout');
const nodes = graph.getNodes()
.filter(node => {
return node.isVisible();
@ -72,6 +73,7 @@ class Controller extends Base {
});
graph._executeLayout(processer, nodes, edges);
graph.updateNodePosition();
graph.emit('afterlayout');
}
getLayoutProcesser() {
return this.processer;

View File

@ -2,6 +2,7 @@
* @fileOverview global config
* @author huangtonger@aliyun.com
*/
const version = require('./version');
module.exports = {
trackable: true,
@ -26,5 +27,5 @@ module.exports = {
updateEasing: 'easeQuadOut',
enterEasing: 'easeQuadOut',
leaveEasing: 'easeQuadOut',
version: '____G6_VERSION____'
version
};

View File

@ -5,6 +5,7 @@
const Shape = require('./shape/');
const Handler = require('./handler');
const Global = require('./global');
const version = require('./version');
const G6 = {
Graph: require('./graph'),
@ -20,7 +21,7 @@ const G6 = {
registerGroup: Shape.registerGroup,
registerGuide: Shape.registerGuide,
registerBehaviour: Handler.registerBehaviour,
version: Global.version
version
};
G6.track = function(enable) {

View File

@ -67,6 +67,8 @@ class Edge extends Item {
const keyShape = this.keyShape;
const shapeObj = this.shapeObj;
keyShape.attr('path', shapeObj.getPath(this));
} else {
this.draw();
}
this._afterDraw();
}

View File

@ -4,6 +4,7 @@
*/
const Global = require('./global');
const SERVER_URL = 'https://kcart.alipay.com/web/bi.do';
const version = require('./version');
// 延迟发送请求
setTimeout(function() {
@ -13,7 +14,7 @@ setTimeout(function() {
pg: document.URL,
r: new Date().getTime(),
g6: true,
version: Global.version,
version,
page_type: 'syslog'
};
const d = encodeURIComponent(JSON.stringify([ newObj ]));

1
src/version.js Normal file
View File

@ -0,0 +1 @@
module.exports = '2.0.1-beta';