try
This commit is contained in:
parent
fd8d01dfe6
commit
f37193a2c6
1 changed files with 263 additions and 263 deletions
|
|
@ -42,7 +42,7 @@ func Layout(ctx context.Context, g *d2graph.Graph, layout d2graph.LayoutGraph) e
|
|||
// calculateRadius computes a radius ensuring that the circular layout does not overlap.
|
||||
// For each object we compute the half-diagonal (i.e. the radius of the minimal enclosing circle),
|
||||
// then ensure the chord between two adjacent centers (2*radius*sin(π/n)) is at least
|
||||
// 2*(maxHalfDiagonal + PADDING). We also add a safety factor (1.2) to avoid floating-point issues.
|
||||
// 2*(maxHalfDiag + PADDING). We also add a safety factor (1.2) to avoid floating-point issues.
|
||||
func calculateRadius(objects []*d2graph.Object) float64 {
|
||||
if len(objects) < 2 {
|
||||
return MIN_RADIUS
|
||||
|
|
|
|||
Loading…
Reference in a new issue