antvis / antvis/G2Plot

🐛 [BUG] Treemap cannot read properties of undefined (reading replace)

Open
#3,741 0 comments 0 reactions 0 assignees View on GitHub
Bug
Dominant language
TypeScript
Stars
2.7k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

### 🐛 Bug description [Please make everyone to understand it]
数据: {"name":"root","children":[{"id":26,"name":"板房","group":"板房","value":102,"children":[{"groupId":26,"group":"板房","id":1,"name":"admin","value":69},{"groupId":26,"group":"板房","id":26,"name":"李xxx","value":33}]},{"id":6,"name":"管理部","group":"管理部","value":169,"children":[{"groupId":6,"group":"管理部","id":21,"name":"审版师","value":77},{"groupId":6,"group":"管理部","id":22,"name":"李222","value":62},{"groupId":6,"group":"管理部","id":24,"name":"33","value":30}]},{"id":27,"name":"职能","group":"职能","value":138,"children":[{"groupId":27,"group":"职能","id":23,"name":"分厂管理员","value":61},{"groupId":27,"group":"职能","id":27,"name":"分厂员工","value":77}]},{"id":30,"name":"6666部","group":"6666部","value":173,"children":[{"groupId":30,"group":"6666部","id":25,"name":"李7777","value":76},{"groupId":30,"group":"6666部","id":28,"name":"AAAA","value":73},{"groupId":30,"group":"6666部","id":29,"name":"张伟22","value":24}]}]}

配置:{ data: tree,
colorField: 'group',
valueField: 'value'}

> Please provide a link by forking these links [G2Plot](https://codesandbox.io/s/g2plot-issue-template-gzfdq?file=/index.ts) or GitHub repo, a minimal reproduction.

* _Required_ **Link to minimal reproduction**:

### 📷 Step to reproduce
image

### 🏞 Expected result

### 🚑 Any additional [like screenshots]

* **G2Plot Version**: 2.1.12
* **Platform**: web, nextjs, react

Contributor guide

Open the contributing guide

Research direction

Start with the supplied Treemap data and configuration using colorField and valueField; the issue does not name a source file or test. Reproduce the reported undefined replace error in the linked G2Plot issue template, then confirm the same data renders without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.