package spore
import (
"github.com/d2lang/elk-go/internal/core"
"github.com/d2lang/elk-go/internal/geometry"
"github.com/d2lang/elk-go/internal/graph"
)
const (
OverlapAlgorithmID = "org.eclipse.elk.sporeOverlap"
CompactionAlgorithmID = "org.eclipse.elk.sporeCompaction"
StructureDelaunay = "DELAUNAY_TRIANGULATION"
TreeMinimum = "MINIMUM_SPANNING_TREE"
TreeMaximum = "MAXIMUM_SPANNING_TREE"
CostCenterDistance = "CENTER_DISTANCE"
CostCircleUnderlap = "CIRCLE_UNDERLAP"
CostRectangleUnderlap = "RECTANGLE_UNDERLAP"
CostInvertedOverlap = "INVERTED_OVERLAP"
CostMinimumRootDistance = "MINIMUM_ROOT_DISTANCE"
RootFixed = "FIXED"
RootCenter = "CENTER_NODE"
CompactionDepthFirst = "DEPTH_FIRST"
)
var (
UnderlyingLayoutAlgorithm = graph .NewProperty [string ]("org.eclipse.elk.underlyingLayoutAlgorithm" )
Padding = graph .CloneablePropertyWithDefault ("org.eclipse.elk.padding" , func () geometry .Spacing { return geometry .UniformSpacing (8 ) })
SpacingNodeNode = graph .PropertyWithDefault ("org.eclipse.elk.spacing.nodeNode" , func () float64 { return 8 })
StructureExtraction = graph .PropertyWithDefault ("org.eclipse.elk.structure.structureExtractionStrategy" , func () string { return StructureDelaunay })
TreeConstruction = graph .PropertyWithDefault ("org.eclipse.elk.processingOrder.treeConstruction" , func () string { return TreeMinimum })
SpanningTreeCost = graph .PropertyWithDefault ("org.eclipse.elk.processingOrder.spanningTreeCostFunction" , func () string { return CostCircleUnderlap })
PreferredRoot = graph .NewProperty [string ]("org.eclipse.elk.processingOrder.preferredRoot" )
RootSelection = graph .PropertyWithDefault ("org.eclipse.elk.processingOrder.rootSelection" , func () string { return RootCenter })
Compaction = graph .PropertyWithDefault ("org.eclipse.elk.compaction.compactionStrategy" , func () string { return CompactionDepthFirst })
Orthogonal = graph .PropertyWithDefault ("org.eclipse.elk.compaction.orthogonal" , func () bool { return false })
MaxIterations = graph .PropertyWithDefault ("org.eclipse.elk.overlapRemoval.maxIterations" , func () int { return 64 })
RunScanline = graph .PropertyWithDefault ("org.eclipse.elk.overlapRemoval.runScanline" , func () bool { return true })
DebugMode = graph .PropertyWithDefault ("org.eclipse.elk.debugMode" , func () bool { return false })
)
func RegisterOptions (registry *core .OptionRegistry ) {
if registry == nil {
return
}
options := []core .OptionData {
{ID : UnderlyingLayoutAlgorithm .ID , Kind : core .StringOption , Targets : core .Parents },
{ID : StructureExtraction .ID , Group : "structure" , Kind : core .EnumOption , Targets : core .Parents , EnumValues : []string {StructureDelaunay }},
{ID : TreeConstruction .ID , Group : "processingOrder" , Kind : core .EnumOption , Targets : core .Parents , EnumValues : []string {TreeMinimum , TreeMaximum }},
{ID : SpanningTreeCost .ID , Group : "processingOrder" , Kind : core .EnumOption , Targets : core .Parents , EnumValues : []string {CostCenterDistance , CostCircleUnderlap , CostRectangleUnderlap , CostInvertedOverlap , CostMinimumRootDistance }},
{ID : PreferredRoot .ID , Group : "processingOrder" , Kind : core .StringOption , Targets : core .Parents },
{ID : RootSelection .ID , Group : "processingOrder" , Kind : core .EnumOption , Targets : core .Parents , EnumValues : []string {RootFixed , RootCenter }},
{ID : Compaction .ID , Group : "compaction" , Kind : core .EnumOption , Targets : core .Parents , EnumValues : []string {CompactionDepthFirst }},
{ID : Orthogonal .ID , Group : "compaction" , Kind : core .BooleanOption , Targets : core .Parents },
{ID : MaxIterations .ID , Group : "overlapRemoval" , Kind : core .IntegerOption , Targets : core .Parents },
{ID : RunScanline .ID , Group : "overlapRemoval" , Kind : core .BooleanOption , Targets : core .Parents },
{ID : DebugMode .ID , Kind : core .BooleanOption , Targets : core .Parents },
}
for _ , option := range options {
if registry .ByID (option .ID ) != nil {
continue
}
if err := registry .Register (option ); err != nil {
panic (err )
}
}
}
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 .