antvis / antvis/G6

[Bug]: 当节点类型为图片时,创建边的时候,点击图片,报错: TypeError: Cannot read properties of undefined (reading 'src')

Open
#7,312 0 comments 0 reactions 0 assignees View on GitHub
bug 🐛
Dominant language
TypeScript
Stars
12.3k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

当节点类型为图片时,创建边的时候,点击图片,报错: TypeError: Cannot read properties of undefined (reading 'src')
节点定义
```js
{
nodes: [
{
id: 'node-1',
style: { x: 50, y: 100, labelText: '路由器1', src: '/xxx.png'}
},
{
id: 'node-2',
style: { x: 150, y: 100, labelText: '路由器2', src: '/yyy.png }
}
],
edges: [{ id: 'edge-1', source: 'node-1', target: 'node-2' }]
}
```

### Reproduction link / 复现链接

_No response_

### Steps to Reproduce the Bug or Issue / 重现步骤

_No response_

### Version / 版本

Please select / 请选择

### OS / 操作系统

- [ ] macOS
- [x] Windows
- [ ] Linux
- [ ] Others / 其他

### Browser / 浏览器

- [ ] Chrome
- [ ] Edge
- [ ] Firefox
- [ ] Safari (Limited support / 有限支持)
- [ ] IE (Nonsupport / 不支持)
- [ ] Others / 其他

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the supplied graph with image nodes and trace edge creation when an image is clicked, using the reported undefined `src` error as the failure signal. No file, test, reproduction link, version, or acceptance condition is provided; confirm the affected entry point and add coverage so image-node edge creation completes without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.