antvis / antvis/F6

TreeGraph在微信小程序上如果数据层级超过2似乎会报错,无法绘制

Open
#169 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
147
Forks
24
PR merge metrics
No merged PRs in 30d

Description

我是用的uniapp来开发微信小程序

当我给graph传入这样的数据时,可以成功绘制
```javascript
graph = new F6.TreeGraph({/*...*/})
// ...
// rootNode, deviceNode是我自己定义的节点类型,用的F6.registerNode()
graph.data({
id: 'root',
type: 'rootNode',
children: [
{
id: '111',
type: 'deviceNode',
},{
id: '222',
type: 'deviceNode',
}
]
})
```

当我给graph传入这样的数据时,会出现TypeError: Cannot read property 'index' of null,无法绘制树图
```javascript
graph = new F6.TreeGraph({/*...*/})
// ...
graph.data({
id: 'root',
type: 'rootNode',
children: [
{
id: '111',
type: 'deviceNode',
children: [
{
id: '333',
type: 'deviceNode'
}
]
},{
id: '222',
type: 'deviceNode',
}
]
})
```
请问是不是我哪里写的有问题

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the nested-children example with F6.TreeGraph, custom rootNode/deviceNode types, and uni-app on a WeChat mini program. Compare it with the working two-level example and trace the TypeError about reading index from null. Done means a tree with a child at the third level renders without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.