package force
Import Path
github.com/d2lang/elk-go/internal/force (on go.dev)
Dependency Relation
imports 9 packages, and imported by 2 packages
Involved Source Files
components.go
graph.go
importer.go
model.go
Package force is a native Go port of org.eclipse.elk.force targeting ELK.js
0.12.0. Its source-shaped names and iteration order retain the historical
ELK 0.8.1 translation where that behavior remains observable in 0.12.0.
provider.go
Package-Level Type Names (total 8)
Edge *FEdge
Particle Particle
Particle.Displacement geometry.Point
Particle.Position geometry.Point
Particle.Priority int
Particle.Size geometry.Point
(*FBendpoint) Radius() float64
Bendpoints []*FBendpoint
Labels []*FLabel
Origin graph.EdgeID
Priority int
RepulsivePower int
Source *FNode
Target *FNode
(*FEdge) DistributeBendpoints()
(*FEdge) SourcePoint() geometry.Point
(*FEdge) TargetPoint() geometry.Point
Adjacency [][]int
AspectRatio float64
BBLowRight geometry.Point
BBUpLeft geometry.Point
Bendpoints []*FBendpoint
Edges []*FEdge
Interactive bool
Iterations int
Labels []*FLabel
Model string
Nodes []*FNode
Origin graph.NodeID
Padding geometry.Spacing
Priority int
Random *javacompat.Random
Repulsion float64
SeparateConnectedComponents bool
SpacingNodeNode float64
Temperature float64
(*FGraph) CalcAdjacency()
(*FGraph) Connection(forcer *Particle, forcee *Particle) int
(*FGraph) Particles() []*Particle
func Recombine(components []*FGraph) *FGraph
func Split(fgraph *FGraph) []*FGraph
func (*Importer).ImportGraph() (*FGraph, error)
func Recombine(components []*FGraph) *FGraph
func Split(fgraph *FGraph) []*FGraph
func (*Importer).ApplyLayout(fgraph *FGraph)
func github.com/d2lang/elk-go/internal/stress.(*Majorization).Initialize(model *graph.Model, fgraph *FGraph)
Edge *FEdge
Inline bool
Origin graph.LabelID
Particle Particle
Particle.Displacement geometry.Point
Particle.Position geometry.Point
Particle.Priority int
Particle.Size geometry.Point
Spacing float64
Text string
(*FLabel) Radius() float64
(*FLabel) RefreshPosition()
ID int
Origin graph.NodeID
Particle Particle
Particle.Displacement geometry.Point
Particle.Position geometry.Point
Particle.Priority int
Particle.Size geometry.Point
(*FNode) Radius() float64
Importer is the Go counterpart of ELK 0.8.1's ElkGraphImporter. It retains
arena IDs rather than Java origin-object properties.
ApplyLayout transfers FGraph coordinates back to the core graph, preserving
ELK's mutation order (nodes are offset before edge endpoints are clipped).
(*Importer) ImportGraph() (*FGraph, error)
func NewImporter(model *graph.Model, parent graph.NodeID) *Importer
Particle is ELK's FParticle. Position is a center for nodes and the
top-left corner for labels, matching the Java implementation.
Displacement geometry.Point
Position geometry.Point
Priority int
Size geometry.Point
(*Particle) Radius() float64
func (*FGraph).Particles() []*Particle
func (*FGraph).Connection(forcer *Particle, forcee *Particle) int
func (*FGraph).Connection(forcer *Particle, forcee *Particle) int
(*Provider) Layout(model *graph.Model, parent graph.NodeID, monitor core.ProgressMonitor) error
*Provider : github.com/d2lang/elk-go/internal/core.LayoutProvider
Package-Level Functions (total 6)
InitialLayout runs the exact force initialization used by ELK Stress when
interactive mode is disabled. It is exported only to the sibling stress
package within this module.
Recombine mirrors ComponentsProcessor.recombine.
func Register(registry *core.AlgorithmRegistry) error
RegisterOptions adds the ForceOptions metadata supported by ELK 0.12.0.
Shared core options may already be present, so registration is idempotent.
Split mirrors ComponentsProcessor.split, including its source-shaped DFS
edge append behavior on cyclic components.
Package-Level Variables (total 16)
var AspectRatio graph.Property[...] var EdgeLabelsInline graph.Property[...] var Interactive graph.Property[...] var Iterations graph.Property[...] var NodeSizeFixedGraphSize graph.Property[...] var OmitNodeMicroLayout graph.Property[...] var RandomSeed graph.Property[...] var RepulsivePower graph.Property[...] var SeparateConnectedComponents graph.Property[...] var SpacingEdgeLabel graph.Property[...] var SpacingNodeNode graph.Property[...] var Temperature graph.Property[...]
Package-Level Constants (total 2)
const ModelEades = "EADES" const ModelFruchtermanReingold = "FRUCHTERMAN_REINGOLD"
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |