From ab461c1e27681c7a9db0966470f0ba172f93a474 Mon Sep 17 00:00:00 2001 From: Yanyan Wang Date: Mon, 7 Aug 2023 16:13:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20layout=20supports=20relayoutAtChangeDat?= =?UTF-8?q?a=20config=20to=20disable=20relayout=E2=80=A6=20(#4796)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: layout supports relayoutAtChangeData config to disable relayout while changeData of graph is called; * chore: update build script --- CHANGELOG.md | 4 ++++ packages/core/package.json | 2 +- packages/core/src/global.ts | 2 +- packages/core/src/graph/graph.ts | 3 ++- packages/element/package.json | 4 ++-- packages/g6/package.json | 4 ++-- packages/g6/src/index.ts | 4 ++-- packages/pc/package.json | 8 ++++---- packages/pc/src/global.ts | 2 +- packages/plugin/package.json | 6 +++--- 10 files changed, 22 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31a03ee3d53..00d282b49c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # ChangeLog +### 4.8.21 + +- feat: layout supports relayoutAtChangeData config to disable relayout while changeData of graph is called; + ### 4.8.20 - fix: parent combo size problem, closes: #4734; diff --git a/packages/core/package.json b/packages/core/package.json index 74552e168a5..e8709cd851a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g6-core", - "version": "0.8.20", + "version": "0.8.21", "description": "A Graph Visualization Framework in JavaScript", "keywords": [ "antv", diff --git a/packages/core/src/global.ts b/packages/core/src/global.ts index 648b207c1fc..f86ee2ca574 100644 --- a/packages/core/src/global.ts +++ b/packages/core/src/global.ts @@ -64,7 +64,7 @@ const colorSet = { }; export default { - version: '0.8.20', + version: '0.8.21', rootContainerClassName: 'root-container', nodeContainerClassName: 'node-container', edgeContainerClassName: 'edge-container', diff --git a/packages/core/src/graph/graph.ts b/packages/core/src/graph/graph.ts index fa957b0ec93..d3d5f5afaf8 100644 --- a/packages/core/src/graph/graph.ts +++ b/packages/core/src/graph/graph.ts @@ -1703,8 +1703,9 @@ export default abstract class AbstractGraph extends EventEmitter implements IAbs this.set({ nodes: items.nodes, edges: items.edges }); + const { relayoutAtChangeData = true } = this.get('layout') || {}; const layoutController = this.get('layoutController'); - if (layoutController) { + if (relayoutAtChangeData && layoutController) { layoutController.changeData(() => { setTimeout(() => { self.getCombos()?.forEach(combo => { diff --git a/packages/element/package.json b/packages/element/package.json index e9d91e68fb2..03c0176e8e6 100644 --- a/packages/element/package.json +++ b/packages/element/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g6-element", - "version": "0.8.20", + "version": "0.8.21", "description": "A Graph Visualization Framework in JavaScript", "keywords": [ "antv", @@ -61,7 +61,7 @@ }, "dependencies": { "@antv/g-base": "^0.5.1", - "@antv/g6-core": "0.8.20", + "@antv/g6-core": "0.8.21", "@antv/util": "~2.0.5" }, "devDependencies": { diff --git a/packages/g6/package.json b/packages/g6/package.json index f54d9aef291..74996e3a394 100644 --- a/packages/g6/package.json +++ b/packages/g6/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g6", - "version": "4.8.20", + "version": "4.8.21", "description": "A Graph Visualization Framework in JavaScript", "keywords": [ "antv", @@ -66,7 +66,7 @@ ] }, "dependencies": { - "@antv/g6-pc": "0.8.20" + "@antv/g6-pc": "0.8.21" }, "devDependencies": { "@babel/core": "^7.7.7", diff --git a/packages/g6/src/index.ts b/packages/g6/src/index.ts index 199b0a1788f..284bc9f1990 100644 --- a/packages/g6/src/index.ts +++ b/packages/g6/src/index.ts @@ -1,7 +1,7 @@ import G6 from '@antv/g6-pc'; -G6.version = '4.8.20'; +G6.version = '4.8.21'; export * from '@antv/g6-pc'; export default G6; -export const version = '4.8.20'; +export const version = '4.8.21'; diff --git a/packages/pc/package.json b/packages/pc/package.json index f6b68814347..4dd8db0780b 100644 --- a/packages/pc/package.json +++ b/packages/pc/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g6-pc", - "version": "0.8.20", + "version": "0.8.21", "description": "A Graph Visualization Framework in JavaScript", "keywords": [ "antv", @@ -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.8.20", - "@antv/g6-element": "0.8.20", - "@antv/g6-plugin": "0.8.20", + "@antv/g6-core": "0.8.21", + "@antv/g6-element": "0.8.21", + "@antv/g6-plugin": "0.8.21", "@antv/hierarchy": "^0.6.10", "@antv/layout": "^0.3.0", "@antv/matrix-util": "^3.1.0-beta.3", diff --git a/packages/pc/src/global.ts b/packages/pc/src/global.ts index 3b3b0447a13..36e48578a79 100644 --- a/packages/pc/src/global.ts +++ b/packages/pc/src/global.ts @@ -7,7 +7,7 @@ const textColor = 'rgb(0, 0, 0)'; const colorSet = getColorsWithSubjectColor(subjectColor, backColor); export default { - version: '0.8.20', + version: '0.8.21', rootContainerClassName: 'root-container', nodeContainerClassName: 'node-container', edgeContainerClassName: 'edge-container', diff --git a/packages/plugin/package.json b/packages/plugin/package.json index cd4f1aa09cc..79bb9769f58 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g6-plugin", - "version": "0.8.20", + "version": "0.8.21", "description": "G6 Plugin", "main": "lib/index.js", "module": "es/index.js", @@ -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.20", - "@antv/g6-element": "0.8.20", + "@antv/g6-core": "0.8.21", + "@antv/g6-element": "0.8.21", "@antv/matrix-util": "^3.1.0-beta.3", "@antv/scale": "^0.3.4", "@antv/util": "^2.0.9",