Skip to content

Commit

Permalink
fix: update layout from animate false to true; (#4453)
Browse files Browse the repository at this point in the history
* fix: update layout from animate false to true;

* chore: update version nums
  • Loading branch information
Yanyan-Wang authored Apr 23, 2023
1 parent a31c45d commit aab80cd
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

### 4.8.10

- fix: update layout from animate false to true;

### 4.8.9

- fix: type for draw function in elements, closes: #4395;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g6-core",
"version": "0.8.9",
"version": "0.8.10",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const colorSet = {
};

export default {
version: '0.8.9',
version: '0.8.10',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',
Expand Down
4 changes: 2 additions & 2 deletions packages/element/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g6-element",
"version": "0.8.9",
"version": "0.8.10",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down Expand Up @@ -61,7 +61,7 @@
},
"dependencies": {
"@antv/g-base": "^0.5.1",
"@antv/g6-core": "0.8.9",
"@antv/g6-core": "0.8.10",
"@antv/util": "~2.0.5"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/g6/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g6",
"version": "4.8.9",
"version": "4.8.10",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down Expand Up @@ -66,7 +66,7 @@
]
},
"dependencies": {
"@antv/g6-pc": "0.8.9"
"@antv/g6-pc": "0.8.10"
},
"devDependencies": {
"@babel/core": "^7.7.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/g6/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import G6 from '@antv/g6-pc';

G6.version = '4.8.9';
G6.version = '4.8.10';

export * from '@antv/g6-pc';
export default G6;
export const version = '4.8.9';
export const version = '4.8.10';
6 changes: 3 additions & 3 deletions packages/pc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g6-pc",
"version": "0.8.9",
"version": "0.8.10",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down Expand Up @@ -75,8 +75,8 @@
"@antv/g-canvas": "^0.5.2",
"@antv/g-math": "^0.1.1",
"@antv/g-svg": "^0.5.1",
"@antv/g6-core": "0.8.9",
"@antv/g6-element": "0.8.9",
"@antv/g6-core": "0.8.10",
"@antv/g6-element": "0.8.10",
"@antv/g6-plugin": "^0.8.7",
"@antv/hierarchy": "^0.6.10",
"@antv/layout": "^0.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/pc/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const textColor = 'rgb(0, 0, 0)';
const colorSet = getColorsWithSubjectColor(subjectColor, backColor);

export default {
version: '0.8.9',
version: '0.8.10',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',
Expand Down
10 changes: 10 additions & 0 deletions packages/pc/src/graph/controller/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ export default class LayoutController extends AbstractLayout {
reslove();
}

if (Util.isForce(layoutType)) {
const { onTick, animate } = layoutCfg;
const isDefaultAnimateLayout = animate === undefined && (layoutType === 'force' || layoutType === 'force2');
const tick = () => {
onTick?.();
if (animate || isDefaultAnimateLayout) graph.refreshPositions();
};
layoutCfg.tick = tick;
}

const layoutData = this.filterLayoutData(this.data, layoutCfg);
layoutMethod.init(layoutData);
layoutMethod.updateCfg(layoutCfg);
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g6-plugin",
"version": "0.8.9",
"version": "0.8.10",
"description": "G6 Plugin",
"main": "lib/index.js",
"module": "es/index.js",
Expand All @@ -22,8 +22,8 @@
"@antv/g-base": "^0.5.1",
"@antv/g-canvas": "^0.5.2",
"@antv/g-svg": "^0.5.2",
"@antv/g6-core": "0.8.9",
"@antv/g6-element": "0.8.9",
"@antv/g6-core": "0.8.10",
"@antv/g6-element": "0.8.10",
"@antv/matrix-util": "^3.1.0-beta.3",
"@antv/scale": "^0.3.4",
"@antv/util": "^2.0.9",
Expand Down

0 comments on commit aab80cd

Please sign in to comment.