Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Me and my developer are trying to get the force parameters right as to create this awesome visualisation, but we are having a hard time.

The visualisation should look like this:

Desired

But it currently looks like this:

Status quo

Do you guys have some ideas on how we can solve this?

We are currently using these parameters, with the grey node being the central node:

.force('collide', d3.forceCollide().strength(1).radius((d: any) => {
if (d.labels[0] === "Basis") {
return 80;
} else if (d.labels[0] === "Thema") {
return 70;
} else if (d.labels[0] === "Onderneming") {
return 70;
} else {
return options.nodeRadius * 1.3;
}
}))
var linkForce = d3.forceLink(relationships).id((d: any) => d.id).distance((d: any) => {
if (d.type === "WERKT_AAN") {
return 120;
} else if (d.type === "DRAAGT_BIJ_AAN") {
return 100;
} else if (d.type === "DRAAGT_BIJ_MET") {
return 90;
} else {
return 90;
}
}
).iterations(2);
simulation.force('link', linkForce);

and anchor central node to center of the screen

question from:https://stackoverflow.com/questions/65935376/configuring-force-parameters-in-d3-so-that-all-layers-run-in-ellipsis-circles

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
821 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...