package core
Import Path
github.com/d2lang/elk-go/internal/core (on go.dev)
Dependency Relation
imports 9 packages, and imported by 18 packages
Involved Source Files
codec.go
engine.go
options.go
Package core implements ELK metadata, JSON conversion, and recursive layout.
topdown.go
Package-Level Type Names (total 12)
Create func() LayoutProvider
Features GraphFeature
ID string
KnownOptions []string
func (*AlgorithmRegistry).Algorithms() []*AlgorithmData
func (*AlgorithmRegistry).ByID(id string) *AlgorithmData
func (*AlgorithmRegistry).BySuffix(suffix string) *AlgorithmData
func (*AlgorithmRegistry).Register(algorithm AlgorithmData) error
(*AlgorithmRegistry) Algorithms() []*AlgorithmData
(*AlgorithmRegistry) ByID(id string) *AlgorithmData
(*AlgorithmRegistry) BySuffix(suffix string) *AlgorithmData
(*AlgorithmRegistry) Register(algorithm AlgorithmData) error
func NewAlgorithmRegistry() *AlgorithmRegistry
func NewEngine(options *OptionRegistry, algorithms *AlgorithmRegistry) *Engine
func github.com/d2lang/elk-go/internal/basic.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/box.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/builtins.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/fixed.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/force.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/layeredlayout.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/mrtree.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/radial.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/random.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/rectpacking.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/spore.Register(registry *AlgorithmRegistry) error
func github.com/d2lang/elk-go/internal/stress.Register(registry *AlgorithmRegistry) error
Codec imports ELK JSON into the algorithm graph and transfers computed
layout back into the same public graph objects.
Options *OptionRegistry
Import validates graph references and constructs the native arena.
TransferLayout copies all layout output into the public objects imported by
the most recent Import call.
func NewCodec(options *OptionRegistry) *Codec
Engine applies registered providers recursively across graph hierarchy.
Algorithms *AlgorithmRegistry
Monitor ProgressMonitor
Options *OptionRegistry
(*Engine) Layout(model *graph.Model) error
func NewEngine(options *OptionRegistry, algorithms *AlgorithmRegistry) *Engine
( GraphFeature) Has(feature GraphFeature) bool
func GraphFeature.Has(feature GraphFeature) bool
const FeatureClusters
const FeatureCompound
const FeatureDisconnected
const FeatureEdgeLabels
const FeatureHyperedges
const FeatureInsideSelfLoops
const FeatureMultiEdges
const FeaturePorts
const FeatureSelfLoops
LayoutProvider lays out one parent node and its children.
( LayoutProvider) Layout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
*github.com/d2lang/elk-go/internal/box.Provider
*github.com/d2lang/elk-go/internal/fixed.Provider
*github.com/d2lang/elk-go/internal/force.Provider
*github.com/d2lang/elk-go/internal/layeredlayout.Provider
*github.com/d2lang/elk-go/internal/mrtree.Provider
*github.com/d2lang/elk-go/internal/radial.Provider
*github.com/d2lang/elk-go/internal/random.Provider
*github.com/d2lang/elk-go/internal/rectpacking.Provider
*github.com/d2lang/elk-go/internal/stress.Provider
OptionData describes one layout option and how its JSON spelling is parsed.
EnumValues []string
Format func(any) string
Group string
ID string
Kind OptionKind
LegacyIDs []string
MetadataOnly marks UI or programmatic metadata that the headless JSON
layout engine preserves but does not interpret during layout.
Parse func(string) (any, error)
Targets Targets
(*OptionData) FormatValue(value any) string
(*OptionData) ParseValue(value string) (any, bool)
func (*OptionRegistry).ByID(id string) *OptionData
func (*OptionRegistry).BySuffix(suffix string) *OptionData
func (*OptionRegistry).Options() []*OptionData
func (*OptionRegistry).Register(option OptionData) error
const BooleanOption
const DoubleOption
const EnumOption
const EnumSetOption
const IntegerOption
const ObjectOption
const StringOption
const UndefinedOption
OptionRegistry is insertion ordered and performs ELK's unique dot-boundary
suffix lookup.
(*OptionRegistry) ByID(id string) *OptionData
(*OptionRegistry) BySuffix(suffix string) *OptionData
(*OptionRegistry) Options() []*OptionData
(*OptionRegistry) Register(option OptionData) error
func NewOptionRegistry() *OptionRegistry
func NewCodec(options *OptionRegistry) *Codec
func NewEngine(options *OptionRegistry, algorithms *AlgorithmRegistry) *Engine
func RegisterCoreOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/basic.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/basicoptions.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/builtins.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/force.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/layered.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/mrtree.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/radial.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/rectpacking.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/spore.RegisterOptions(registry *OptionRegistry)
func github.com/d2lang/elk-go/internal/stress.RegisterOptions(registry *OptionRegistry)
ProgressMonitor is deliberately small; providers can report work while
callers that do not need progress use NullProgressMonitor.
( ProgressMonitor) Begin(task string, totalWork float64)
( ProgressMonitor) Canceled() bool
( ProgressMonitor) Done()
( ProgressMonitor) Subtask(work float64) ProgressMonitor
( ProgressMonitor) Worked(work float64)
func ProgressMonitor.Subtask(work float64) ProgressMonitor
func LayoutProvider.Layout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
func github.com/d2lang/elk-go/internal/box.(*Provider).Layout(model *graph.Model, parent graph.NodeID, _ ProgressMonitor) error
func github.com/d2lang/elk-go/internal/fixed.(*Provider).Layout(model *graph.Model, parent graph.NodeID, _ ProgressMonitor) error
func github.com/d2lang/elk-go/internal/force.InitialLayout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
func github.com/d2lang/elk-go/internal/force.(*Provider).Layout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
func github.com/d2lang/elk-go/internal/layeredlayout.(*Provider).Layout(model *basegraph.Model, parent basegraph.NodeID, monitor ProgressMonitor) error
func github.com/d2lang/elk-go/internal/mrtree.(*Provider).Layout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
func github.com/d2lang/elk-go/internal/radial.(*Provider).Layout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
func github.com/d2lang/elk-go/internal/random.(*Provider).Layout(model *graph.Model, parent graph.NodeID, _ ProgressMonitor) error
func github.com/d2lang/elk-go/internal/rectpacking.(*Provider).Layout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
func github.com/d2lang/elk-go/internal/stress.(*Provider).Layout(model *graph.Model, parent graph.NodeID, monitor ProgressMonitor) error
var NullProgressMonitor
Package-Level Functions (total 7)
func NewCodec(options *OptionRegistry) *Codec func NewEngine(options *OptionRegistry, algorithms *AlgorithmRegistry) *Engine func NewOptionRegistry() *OptionRegistry func RegisterCoreOptions(registry *OptionRegistry)
TranslateSection moves every point in a section by offset.
Package-Level Variables (total 60)
Headless elkjs exposes these UI and programmatic options through
knownLayoutOptions, but they do not affect native layout execution.
var AnimationFactor graph.Property[...] var AspectRatio graph.Property[...] var ChildAreaHeight graph.Property[...] var ChildAreaWidth graph.Property[...]
Core graph semantics consumed by ELK Layered and node micro-layout.
var ContentAlignment graph.Property[...] var HierarchyHandling graph.Property[...] var InsideSelfLoopsActivate graph.Property[...] var InsideSelfLoopsEdge graph.Property[...] var InteractiveLayout graph.Property[...] var JSONEdgeCoords graph.Property[...] var JSONShapeCoords graph.Property[...] var JunctionPoints graph.Property[...] var LabelManager graph.Property[...] var LayoutAncestors graph.Property[...] var MaxAnimationTime graph.Property[...] var MinAnimationTime graph.Property[...] var NodeSizeConstraints graph.Property[...] var NodeSizeMinimum graph.Property[...] var PartitioningActivate graph.Property[...] var PartitioningPartition graph.Property[...] var PortAlignmentEast graph.Property[...] var PortAlignmentNorth graph.Property[...] var PortAlignmentSouth graph.Property[...] var PortAlignmentWest graph.Property[...] var PortAnchor graph.Property[...] var PortConstraints graph.Property[...] var PortLabelsNextToPortIfPossible graph.Property[...] var PortLabelsTreatAsGroup graph.Property[...] var ProgressBar graph.Property[...] var ResolvedAlgorithm graph.Property[...] var ScaleFactor graph.Property[...] var SoftwrappingFuzziness graph.Property[...] var SpacingCommentComment graph.Property[...] var SpacingCommentNode graph.Property[...] var SpacingIndividual graph.Property[...] var SpacingNodeNode graph.Property[...] var TopdownHierarchicalNodeWidth graph.Property[...] var TopdownLayout graph.Property[...] var TopdownNodeType graph.Property[...] var TopdownScaleCap graph.Property[...] var TopdownScaleFactor graph.Property[...] var TopdownSizeApproximator graph.Property[...] var TopdownSizeCategories graph.Property[...] var ValidateGraph graph.Property[...] var ValidateOptions graph.Property[...]
Package-Level Constants (total 23)
const BooleanOption OptionKind = 1 const DefaultAlgorithmID = "org.eclipse.elk.layered" const DoubleOption OptionKind = 3 const EnumOption OptionKind = 4 const EnumSetOption OptionKind = 5 const FeatureClusters GraphFeature = 64 const FeatureCompound GraphFeature = 32 const FeatureDisconnected GraphFeature = 128 const FeatureEdgeLabels GraphFeature = 8 const FeatureHyperedges GraphFeature = 256 const FeatureInsideSelfLoops GraphFeature = 2 const FeatureMultiEdges GraphFeature = 4 const FeaturePorts GraphFeature = 16 const FeatureSelfLoops GraphFeature = 1 const IntegerOption OptionKind = 2 const ObjectOption OptionKind = 6 const StringOption OptionKind = 0 const UndefinedOption OptionKind = 7
![]() |
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. |