Skip to content

Commit

Permalink
fix: unexpected move with fitCenter with animation; fix: update model…
Browse files Browse the repository at this point in the history
…Rect with rendering error, closes: #4041; (#4042)
  • Loading branch information
Yanyan-Wang authored Nov 11, 2022
1 parent df07883 commit 142e9ea
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog

### 4.7.13

- fix: unexpected move with fitCenter with animation;
- fix: update modelRect with rendering error, closes: #4041;

### 4.7.12

- fix: drag-canvas incorrectly stopped by right click;
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.7.12",
"version": "0.7.13",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/element/shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ const ShapeFramework = {
/**
* 绘制
*/
drawShape(/* cfg, group */) {},
drawShape(/* cfg, group */) { },
/**
* 绘制完成后的操作,便于用户继承现有的节点、边
*/
afterDraw(/* cfg, group */) {},
afterDraw(/* cfg, group */) { },
// update(cfg, item) // 默认不定义
afterUpdate(/* cfg, item */) {},
afterUpdate(/* cfg, item */) { },
/**
* 设置节点、边状态
*/
setState(/* name, value, item */) {},
setState(/* name, value, item */) { },
/**
* 获取控制点
* @param {Object} cfg 节点、边的配置项
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.7.12',
version: '0.7.13',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/graph/controller/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default class ViewController {
public fitCenter(animate?: boolean, animateCfg?: GraphAnimateConfig) {
const { graph } = this;
const group: IGroup = graph.get('group');
group.resetMatrix();
const bbox = group.getCanvasBBox();
if (bbox.width === 0 || bbox.height === 0) return;
const viewCenter = this.getViewCenter();
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.7.12",
"version": "0.7.13",
"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.7.12",
"@antv/g6-core": "0.7.13",
"@antv/util": "~2.0.5"
},
"devDependencies": {
Expand Down
13 changes: 12 additions & 1 deletion packages/element/src/nodes/modelRect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mix, isString } from '@antv/util';
import { mix, isString, deepMix } from '@antv/util';
import { IGroup, IShape } from '@antv/g-base';
import {
registerNode,
Expand All @@ -7,6 +7,7 @@ import {
ShapeStyle,
ShapeOptions,
BaseGlobal as Global,
UpdateType,
} from '@antv/g6-core';

registerNode(
Expand Down Expand Up @@ -531,6 +532,16 @@ registerNode(

(this as any).updateLinkPoints(cfg, group);
},
getOptions(cfg: NodeConfig, updateType?: UpdateType): NodeConfig {
if (updateType === 'move') return cfg;
// different from baseShape, the config should be mixed when the updateType is not 'move'
return deepMix(
{},
this.options,
this.getCustomConfig(cfg) || {},
cfg,
);
},
},
'single-node',
);
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.7.12",
"version": "4.7.13",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down Expand Up @@ -66,7 +66,7 @@
]
},
"dependencies": {
"@antv/g6-pc": "0.7.12"
"@antv/g6-pc": "0.7.13"
},
"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.7.12';
G6.version = '4.7.13';

export * from '@antv/g6-pc';
export default G6;
export const version = '4.7.12';
export const version = '4.7.13';
8 changes: 4 additions & 4 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.7.12",
"version": "0.7.13",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down Expand Up @@ -75,9 +75,9 @@
"@antv/g-canvas": "^0.5.2",
"@antv/g-math": "^0.1.1",
"@antv/g-svg": "^0.5.1",
"@antv/g6-core": "0.7.12",
"@antv/g6-element": "0.7.12",
"@antv/g6-plugin": "0.7.12",
"@antv/g6-core": "0.7.13",
"@antv/g6-element": "0.7.13",
"@antv/g6-plugin": "0.7.13",
"@antv/hierarchy": "^0.6.7",
"@antv/layout": "^0.3.0",
"@antv/matrix-util": "^3.1.0-beta.3",
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.7.12',
version: '0.7.13',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',
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.7.12",
"version": "0.7.13",
"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.7.12",
"@antv/g6-element": "0.7.12",
"@antv/g6-core": "0.7.13",
"@antv/g6-element": "0.7.13",
"@antv/matrix-util": "^3.1.0-beta.3",
"@antv/scale": "^0.3.4",
"@antv/util": "^2.0.9",
Expand Down
4 changes: 2 additions & 2 deletions packages/site/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@antv/g6-site",
"version": "4.7.12",
"version": "4.7.13",
"description": "G6 sites deployed on gh-pages",
"keywords": [
"antv",
Expand Down Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"@ant-design/icons": "^4.0.6",
"@antv/chart-node-g6": "^0.0.3",
"@antv/g6": "4.7.12",
"@antv/g6": "4.7.13",
"@antv/gatsby-theme-antv": "1.1.15",
"@antv/util": "^2.0.9",
"@antv/vis-predict-engine": "^0.1.1",
Expand Down

0 comments on commit 142e9ea

Please sign in to comment.