We found our mistakes and maybe it could help someone.(我们发现了错误,也许可以对某人有所帮助。)
This...(这个...)
const simulation = d3.forceSimulation(companyNodes)
.force("link", d3.forceLink(links))
...had to be changed to this:(...必须更改为:)
const simulation = d3.forceSimulation(companyNodes)
.force("link", d3.forceLink(links).id(d => d.company_id)) //company_id is the identifier for one specific company we have in companyNodes
And the other thing was that we had to rename every from_id
to source
and to_id
to target
because it seems like d3
is only working with source
and target
(另一件事是,我们必须将每个from_id
重命名为source
并将to_id
重命名为target
因为d3
似乎仅适用于source
和target
) 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…