force

package
v2.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package force is a force-directed Layout: edges are springs, nodes push apart at short range, and each group drifts towards its own place on a ring, so the same kinds gather and a node sits between what it connects. Repulsion only looks at neighbours in a grid of cells, so a step costs the number of nodes, not its square. Deterministic: no randomness, and the same input is always placed the same way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layout

type Layout struct{}

Layout is the force layout.

func New

func New() Layout

New returns the force layout.

func (Layout) Place

func (Layout) Place(nodes []layout.Node, edges []layout.Edge) []layout.Point

Place runs the layout until it is nearly still.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL