antvis / antvis/X6

autoResize 为 true 时,修改 edge 的颜色, 也会导致 manhattan 路由重绘

Open
#3,980 4 comments 0 reactions 0 assignees View on GitHub
bug 🐛 good first issue oscp
Dominant language
TypeScript
Stars
6.7k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

autoResize 为 true 时,修改 edge 的颜色, 也会导致 manhattan 路由重绘。

### 重现链接

https://x6.antv.antgroup.com/zh/examples/edge/router/#manhattan

### 重现步骤

```
const graph = new Graph({
container: document.getElementById('container'),
grid: true,
autoResize: true,
})

graph.on('edge:mouseenter', ({ edge }) => {
edge.prop('attrs/line/stroke', 'blue')
})

graph.on('edge:mouseleave', ({ edge }) => {
edge.prop('attrs/line/stroke', 'red')
})

```

### 预期行为

修改颜色,为什么与 路由 计算有关系?

### 平台

- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox ...]
- X6 版本: [2.11.1 ...]

### 屏幕截图或视频(可选)

![20231018144302_rec_](https://github.com/antvis/X6/assets/21686182/783c4c17-291e-45b9-8ee3-47cfb36b340f)

### 补充说明(可选)

简单的 hover 修改颜色,导致大图画布因为 manhattan 重绘,性能卡顿

Contributor guide

Open the contributing guide

Research direction

Start with the Manhattan router example at the provided reproduction link and reproduce the issue using the autoResize configuration and edge hover color updates shown in the report. Trace the edge property update into Manhattan route recalculation and verify that changing only the edge color no longer redraws the route or causes canvas-wide performance degradation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.