spikes: architecture diagram nodes repel from each other
This commit is contained in:
parent
6004ca61b8
commit
1149f7e6c8
@ -29,9 +29,10 @@ var svg = d3.select('svg'),
|
|||||||
var color = d3.scaleOrdinal(d3.schemeCategory20);
|
var color = d3.scaleOrdinal(d3.schemeCategory20);
|
||||||
|
|
||||||
var simulation = d3.forceSimulation()
|
var simulation = d3.forceSimulation()
|
||||||
|
.force('charge', d3.forceManyBody().strength(() => -50).distanceMin(() => 30))
|
||||||
.force('link', d3.forceLink().distance(() => 200).id(function(d) { return d.id; }))
|
.force('link', d3.forceLink().distance(() => 200).id(function(d) { return d.id; }))
|
||||||
.force('charge', d3.forceManyBody())
|
.force('collide', d3.forceCollide().radius(function(d) { return 128 + 0.5; }).iterations(2))
|
||||||
.force('center', d3.forceCenter(width / 2, height / 2));
|
.force('center', d3.forceCenter(width / 2, height / 2))
|
||||||
|
|
||||||
function rightRoundedRect(x, y, width, height, radius) {
|
function rightRoundedRect(x, y, width, height, radius) {
|
||||||
return 'M' + x + ',' + y // Move to (absolute)
|
return 'M' + x + ',' + y // Move to (absolute)
|
||||||
|
Loading…
Reference in New Issue
Block a user