Error message, as shown in the figure:
![](https://img-blog.csdnimg.cn/img_convert/af097b749d4b6864b2918c48b0989f70.png)
ask
nodes: [
{
id: 1, // Change it to id: '1' and it will be solved
label: 'Initiated by Beijing and Hangzhou'
}
],
edges: [
{
id: 'edge1',
target: 'node2',
source: 'node1'
}
]
The fundamental point of the question is that the Id in nides and edges must be of type String
![](https://img-blog.csdnimg.cn/img_convert/8bb166a252f3c0f9d2e1b5e6d5c61e56.png)
Does it feel very simple? Or should you read more API documentation?