Skip to content

Commit

Permalink
fix: loop edge position for custom rect node, closes: #4236; (#4240)
Browse files Browse the repository at this point in the history
* fix: loop edge position for custom rect node, closes: #4236;

* fix: drag-node should be ended after data changed;

* chore: upgrade version num
  • Loading branch information
Yanyan-Wang authored Feb 20, 2023
1 parent 38188aa commit 5617873
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 70 deletions.
27 changes: 15 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog

### 4.8.6

- fix: loop edge position for custom rect node, closes: #4236;
- fix: drag-node should be ended after data changed;

### 4.8.5

- fix: combo with size and fixSize setting;
Expand Down Expand Up @@ -114,8 +119,8 @@
- fix: image lost while updating the size for an image node, closes: #3938;

### 4.7.7
- feat: getContentPlaceholder and getTitlePlaceholder for Annotation plugin;

- feat: getContentPlaceholder and getTitlePlaceholder for Annotation plugin;

### 4.7.6

Expand All @@ -126,9 +131,9 @@

- perf: Annotation support updating positions for outside cards by calling updateOutsideCards;

### 4.7.4
- perf: Annotation min-width and input width;
### 4.7.4

- perf: Annotation min-width and input width;

### 4.7.3

Expand Down Expand Up @@ -225,7 +230,7 @@

- fix: destroyLayout error, closes: #3727;
- fix: drag combo with stack problem, closes: #3699;
- fix: updateLayout does not take effect if update layout with same type as graph instance configuration, closes: #3706;
- fix: updateLayout does not take effect if update layout with same type as graph instance configuration, closes: #3706;
- fix: legendStateStyles typo, closes: #3705;
- perf: zoom-canvas take the maximum and minimum values instead of return directly;
- perf: minimap cursor move;
Expand All @@ -238,7 +243,6 @@
- chore: improve the types of graph events;
- fix: position animate considers origin attributes;


#### 4.6.3

- feat: shouldDeselect param for lasso-select;
Expand Down Expand Up @@ -283,18 +287,17 @@

- feat: translate graph with animation;
- feat: zoom graph with animation;
- feat: timebar supports filterItemTypes to configure the types of the graph items to be filtered; only nodes can be filtered before;
- feat: timebar supports filterItemTypes to configure the types of the graph items to be filtered; only nodes can be filtered before;
- feat: timebar supports to configure the rotate of the tick labels by tickLabelStyle[dot]rotate;
- feat: timebar supports container CSS configuration by containerCSS;
- feat: timebar supports a function getDate to returns the date value according to each node or edge by user;
- feat: timebar supports afunction getValue to returns the value (for trend line of trend timebar) according to each node or edge by user;
- feat: timebar supports afunction getValue to returns the value (for trend line of trend timebar) according to each node or edge by user;
- feat: timebar supports to configure a boolean changeData to control the filter way, true means filters by graph[dot]changeData, false means filters by graph[dot]showItem and graph[dot]hideItem;
- feat: timebar supports to configure a function shouldIgnore to return true or false by user to decide whether the node or the edge should be ignored while filtering;
- fix: simple timebar silder text position strategy and expand the lineAppendWidth for the slider;
- fix: edge label padding bug, closes: #3346;
- fix: update node with iconfont icon, the icon is updated to a wrong position, closes: #3348;


#### 4.5.0

- fix: add item type to the parameter of afterremoveitem event;
Expand Down Expand Up @@ -345,7 +348,6 @@
- fix: update node position with wrong position;
- feat: enableStack for drag-node behavior, closes: #3128;


#### 4.3.5

- fix: drag a node without comboId by drag-node with onlyChangeComboSize;
Expand All @@ -359,7 +361,7 @@
- fix: when select a node with click-select, selected combos should be deselected;
- fix: contextmenu with click trigger does not show the menu up, closes: #2982;
- fix: layout with collapsed combo, closes: #2988;
- fix: zoom-canvas with optimizeZoom, drag-canvas shows the node shapes hiden by zoom-canvas optimizeZoom, closes: #2996;
- fix: zoom-canvas with optimizeZoom, drag-canvas shows the node shapes hiden by zoom-canvas optimizeZoom, closes: #2996;

#### 4.3.3

Expand Down Expand Up @@ -439,6 +441,7 @@
- feat: tooltip with trigger configuration, supports mouseenter and click;

#### 4.2.0

#### 4.1.14

- fix: combo edge link position problem;
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.5",
"version": "0.8.6",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down
11 changes: 6 additions & 5 deletions 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.5',
version: '0.8.6',
rootContainerClassName: 'root-container',
nodeContainerClassName: 'node-container',
edgeContainerClassName: 'edge-container',
Expand Down Expand Up @@ -249,8 +249,9 @@ export default {
strokeOpacity: 0.9,
lineDash: [5, 5],
},
windowFontFamily: typeof window !== 'undefined' && window.getComputedStyle && document.body
? window.getComputedStyle(document.body, null).getPropertyValue('font-family') ||
'Arial, sans-serif'
: 'Arial, sans-serif'
windowFontFamily:
typeof window !== 'undefined' && window.getComputedStyle && document.body
? window.getComputedStyle(document.body, null).getPropertyValue('font-family') ||
'Arial, sans-serif'
: 'Arial, sans-serif',
};
10 changes: 5 additions & 5 deletions packages/core/src/util/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ export const getLoopCfgs = (cfg: EdgeData): EdgeData => {
if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];

const keyShape: IShapeBase = item.getKeyShape();
const bbox: IBBox = keyShape.getBBox();
const bbox: IBBox = keyShape.getCanvasBBox();

const loopCfg = cfg.loopCfg || {};
// 距离keyShape边的最高距离
const dist: number = loopCfg.dist || Math.max(bbox.width, bbox.height) * 2;
// 自环边与keyShape的相对位置关系
const position: string = loopCfg.position || Global.defaultLoopPosition;

// 中心取group上真实位置
const center = [containerMatrix[6], containerMatrix[7]];
// 中心取 keyShape canvasBBox 的中心位置
const center = [(bbox.minX + bbox.maxX) / 2, (bbox.minY + bbox.maxY) / 2];
let startPoint = [cfg.startPoint.x, cfg.startPoint.y];
let endPoint = [cfg.endPoint.x, cfg.endPoint.y];

Expand Down Expand Up @@ -688,8 +688,8 @@ export const getComboBBox = (
const comboModel = combo?.getModel();
const { x, y, fixSize, collapsed, fixCollapseSize } = comboModel || {};
const useFixSize = collapsed ? fixCollapseSize : fixSize;
const [ width, height ] = isArray(useFixSize) ? useFixSize : [useFixSize, useFixSize];
const halfSize = [ width / 2, height / 2 ];
const [width, height] = isArray(useFixSize) ? useFixSize : [useFixSize, useFixSize];
const halfSize = [width / 2, height / 2];
return {
minX: x - halfSize[0],
minY: y - halfSize[1],
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.5",
"version": "0.8.6",
"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.5",
"@antv/g6-core": "0.8.6",
"@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.5",
"version": "4.8.6",
"description": "A Graph Visualization Framework in JavaScript",
"keywords": [
"antv",
Expand Down Expand Up @@ -66,7 +66,7 @@
]
},
"dependencies": {
"@antv/g6-pc": "0.8.5"
"@antv/g6-pc": "0.8.6"
},
"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.5';
G6.version = '4.8.6';

export * from '@antv/g6-pc';
export default G6;
export const version = '4.8.5';
export const version = '4.8.6';
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.8.5",
"version": "0.8.6",
"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.8.5",
"@antv/g6-element": "0.8.5",
"@antv/g6-plugin": "0.8.5",
"@antv/g6-core": "0.8.6",
"@antv/g6-element": "0.8.6",
"@antv/g6-plugin": "0.8.6",
"@antv/hierarchy": "^0.6.7",
"@antv/layout": "^0.3.0",
"@antv/matrix-util": "^3.1.0-beta.3",
Expand Down
Loading

0 comments on commit 5617873

Please sign in to comment.