Skip to content

Commit 63f43ce

Browse files
authored
feat: Annotation plugin; fix: combo and drag-node with heap maximum p… (#3911)
* feat: Annotation plugin; fix: combo and drag-node with heap maximum problem, closes: #3886; fix: combo and graph re-read problem, closes: 3902; fix: d3 force layout with default animate; perf: bundling plugin ts problem, closes: #3904; * chore: refine * chore: refine
1 parent 594106e commit 63f43ce

File tree

20 files changed

+914
-40
lines changed

20 files changed

+914
-40
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# ChangeLog
22

3+
#### 4.7.1
4+
5+
- feat: Annotation plugin;
6+
- fix: combo and drag-node with heap maximum problem, closes: #3886;
7+
- fix: combo and graph re-read problem, closes: 3902;
8+
- fix: d3 force layout with default animate;
9+
- perf: bundling plugin ts problem, closes: #3904;
10+
311
#### 4.7.0
412

513
- fix: combo collapsed edge problems, closes: #3839;

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g6-core",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "A Graph Visualization Framework in JavaScript",
55
"keywords": [
66
"antv",

packages/core/src/global.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const colorSet = {
6464
};
6565

6666
export default {
67-
version: '0.7.0',
67+
version: '0.7.1',
6868
rootContainerClassName: 'root-container',
6969
nodeContainerClassName: 'node-container',
7070
edgeContainerClassName: 'edge-container',

packages/core/src/graph/controller/layout.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default abstract class LayoutController {
203203
layoutMethods?.forEach((layoutMethod: any, index: number) => {
204204
const currentCfg = layoutCfg[index] || layoutCfg;
205205
start = start.then(() => {
206-
const relayoutPromise = this.execLayoutMethod(layoutMethod, currentCfg);
206+
const relayoutPromise = this.execLayoutMethod(currentCfg, index);
207207
if (index === layoutMethods.length - 1) {
208208
layoutCfg.onAllLayoutEnd?.();
209209
}

packages/core/src/graph/graph.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,7 @@ export default abstract class AbstractGraph extends EventEmitter implements IAbs
24382438
this.initGroups();
24392439

24402440
// 清空画布时同时清除数据
2441-
this.set({ itemMap: {}, nodes: [], edges: [], groups: [], combos: [], comboTrees: [] });
2441+
this.set({ itemMap: {}, nodes: [], edges: [], vedges: [], groups: [], combos: [], comboTrees: [] });
24422442
if (!avoidEmit) this.emit('afterrender');
24432443
return this;
24442444
}

packages/element/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g6-element",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "A Graph Visualization Framework in JavaScript",
55
"keywords": [
66
"antv",
@@ -61,7 +61,7 @@
6161
},
6262
"dependencies": {
6363
"@antv/g-base": "^0.5.1",
64-
"@antv/g6-core": "0.7.0",
64+
"@antv/g6-core": "0.7.1",
6565
"@antv/util": "~2.0.5"
6666
},
6767
"devDependencies": {

packages/g6/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g6",
3-
"version": "4.7.0",
3+
"version": "4.7.1",
44
"description": "A Graph Visualization Framework in JavaScript",
55
"keywords": [
66
"antv",
@@ -66,7 +66,7 @@
6666
]
6767
},
6868
"dependencies": {
69-
"@antv/g6-pc": "0.7.0"
69+
"@antv/g6-pc": "0.7.1"
7070
},
7171
"devDependencies": {
7272
"@babel/core": "^7.7.7",

packages/g6/src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import G6 from '@antv/g6-pc';
22

3-
G6.version = '4.7.0';
3+
G6.version = '4.7.1';
44

55
export * from '@antv/g6-pc';
66
export default G6;
7-
export const version = '4.7.0';
7+
export const version = '4.7.1';

packages/pc/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g6-pc",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "A Graph Visualization Framework in JavaScript",
55
"keywords": [
66
"antv",
@@ -75,9 +75,9 @@
7575
"@antv/g-canvas": "^0.5.2",
7676
"@antv/g-math": "^0.1.1",
7777
"@antv/g-svg": "^0.5.1",
78-
"@antv/g6-core": "0.7.0",
79-
"@antv/g6-element": "0.7.0",
80-
"@antv/g6-plugin": "0.7.0",
78+
"@antv/g6-core": "0.7.1",
79+
"@antv/g6-element": "0.7.1",
80+
"@antv/g6-plugin": "0.7.1",
8181
"@antv/hierarchy": "^0.6.7",
8282
"@antv/layout": "^0.3.0",
8383
"@antv/matrix-util": "^3.1.0-beta.3",

packages/pc/src/global.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const textColor = 'rgb(0, 0, 0)';
77
const colorSet = getColorsWithSubjectColor(subjectColor, backColor);
88

99
export default {
10-
version: '0.7.0',
10+
version: '0.7.1',
1111
rootContainerClassName: 'root-container',
1212
nodeContainerClassName: 'node-container',
1313
edgeContainerClassName: 'edge-container',

packages/pc/src/graph/controller/layout.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,12 @@ export default class LayoutController extends AbstractLayout {
132132
const isForce = layoutType === 'force' || layoutType === 'g6force' || layoutType === 'gForce' || layoutType === 'force2';
133133
if (isForce) {
134134
const { onTick, animate } = layoutCfg;
135+
const d3ForceAnimate = animate === undefined && layoutType === 'force'
135136
const tick = () => {
136137
if (onTick) {
137138
onTick();
138139
}
139-
if (animate) graph.refreshPositions();
140+
if (animate || d3ForceAnimate) graph.refreshPositions();
140141
};
141142
layoutCfg.tick = tick;
142143
} else if (layoutType === 'comboForce' || layoutType === 'comboCombined') {

packages/pc/src/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import './element';
2020
import './behavior';
2121

2222
type IAlgorithm = typeof AlgorithmSync | typeof AlgorithmAsync;
23-
const Algorithm: IAlgorithm = { ...AlgorithmSync, ... AlgorithmAsync };
23+
const Algorithm: IAlgorithm = { ...AlgorithmSync, ...AlgorithmAsync };
2424

2525
const Grid = Plugin.Grid;
2626
const Minimap = Plugin.Minimap;
@@ -34,6 +34,7 @@ const ImageMinimap = Plugin.ImageMinimap;
3434
const EdgeFilterLens = Plugin.EdgeFilterLens;
3535
const SnapLine = Plugin.SnapLine;
3636
const Legend = Plugin.Legend;
37+
const Annotation = Plugin.Annotation;
3738

3839
export * from '@antv/g6-core';
3940
export * from './types';
@@ -60,6 +61,7 @@ export {
6061
EdgeFilterLens,
6162
SnapLine,
6263
Legend,
64+
Annotation,
6365
Arrow,
6466
Marker,
6567
Shape,
@@ -94,6 +96,7 @@ export default {
9496
Fisheye,
9597
ImageMinimap,
9698
EdgeFilterLens,
99+
Annotation,
97100
Algorithm,
98101
Arrow,
99102
Marker,

packages/pc/tests/unit/combo-collapse-layout-spec.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ const data = {
99
{
1010
"id": "ccc",
1111
"label": "ccc",
12-
"collapsed": true
12+
"collapsed": true,
13+
parentId: 'd'
14+
},
15+
{
16+
"id": "d",
17+
"label": "d",
1318
}
1419
],
1520
"edges": [
@@ -28,7 +33,6 @@ const data = {
2833
}
2934
]
3035
};
31-
3236
describe('combo layout with collapsed', () => {
3337
it('combo layout with collapsed', (done) => {
3438
const graph = new G6.Graph({

packages/plugin/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@antv/g6-plugin",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "G6 Plugin",
55
"main": "lib/index.js",
66
"module": "es/index.js",
@@ -22,8 +22,8 @@
2222
"@antv/g-base": "^0.5.1",
2323
"@antv/g-canvas": "^0.5.2",
2424
"@antv/g-svg": "^0.5.2",
25-
"@antv/g6-core": "0.7.0",
26-
"@antv/g6-element": "0.7.0",
25+
"@antv/g6-core": "0.7.1",
26+
"@antv/g6-element": "0.7.1",
2727
"@antv/matrix-util": "^3.1.0-beta.3",
2828
"@antv/scale": "^0.3.4",
2929
"@antv/util": "^2.0.9",

0 commit comments

Comments
 (0)