package basicoptions
import (
"github.com/d2lang/elk-go/internal/core"
"github.com/d2lang/elk-go/internal/geometry"
"github.com/d2lang/elk-go/internal/graph"
)
var (
FixedPadding = graph .CloneablePropertyWithDefault ("org.eclipse.elk.padding" , func () geometry .Spacing {
return geometry .UniformSpacing (15 )
})
BoxPadding = graph .CloneablePropertyWithDefault ("org.eclipse.elk.padding" , func () geometry .Spacing {
return geometry .UniformSpacing (15 )
})
RandomPadding = graph .CloneablePropertyWithDefault ("org.eclipse.elk.padding" , func () geometry .Spacing {
return geometry .UniformSpacing (15 )
})
Position = graph .NewProperty [geometry .Point ]("org.eclipse.elk.position" )
BendPoints = graph .NewProperty [geometry .Chain ]("org.eclipse.elk.bendPoints" )
EdgeRouting = graph .PropertyWithDefault ("org.eclipse.elk.edgeRouting" , func () string { return "UNDEFINED" })
NodeSizeFixedGraphSize = graph .PropertyWithDefault ("org.eclipse.elk.nodeSize.fixedGraphSize" , func () bool { return false })
NodeSizeOptions = graph .CloneablePropertyWithDefault ("org.eclipse.elk.nodeSize.options" , func () []string {
return []string {"DEFAULT_MINIMUM_SIZE" }
})
ExpandNodes = graph .PropertyWithDefault ("org.eclipse.elk.expandNodes" , func () bool { return false })
Interactive = graph .PropertyWithDefault ("org.eclipse.elk.interactive" , func () bool { return false })
Priority = graph .PropertyWithDefault ("org.eclipse.elk.priority" , func () int { return 0 })
PackingMode = graph .PropertyWithDefault ("org.eclipse.elk.box.packingMode" , func () string { return "SIMPLE" })
BoxAspectRatio = graph .PropertyWithDefault ("org.eclipse.elk.aspectRatio" , func () float64 {
return float64 (float32 (1.3 ))
})
RandomAspectRatio = graph .PropertyWithDefault ("org.eclipse.elk.aspectRatio" , func () float64 {
return float64 (float32 (1.6 ))
})
BoxSpacingNodeNode = graph .PropertyWithDefault ("org.eclipse.elk.spacing.nodeNode" , func () float64 { return 15 })
RandomSpacingNodeNode = graph .PropertyWithDefault ("org.eclipse.elk.spacing.nodeNode" , func () float64 { return 15 })
RandomSeed = graph .PropertyWithDefault ("org.eclipse.elk.randomSeed" , func () int { return 0 })
)
func RegisterOptions (registry *core .OptionRegistry ) {
if registry == nil {
return
}
options := []core .OptionData {
{ID : Position .ID , Kind : core .ObjectOption , Targets : core .Nodes | core .Ports | core .Labels ,
Parse : func (value string ) (any , error ) { return geometry .ParsePoint (value ) }},
{ID : BendPoints .ID , Kind : core .ObjectOption , Targets : core .Edges ,
Parse : func (value string ) (any , error ) { return geometry .ParseChain (value ) }},
{ID : EdgeRouting .ID , Kind : core .EnumOption , Targets : core .Parents ,
EnumValues : []string {"UNDEFINED" , "POLYLINE" , "ORTHOGONAL" , "SPLINES" }},
{ID : NodeSizeFixedGraphSize .ID , Kind : core .BooleanOption , Targets : core .Parents },
{ID : NodeSizeOptions .ID , Kind : core .EnumSetOption , Targets : core .Nodes ,
EnumValues : []string {"DEFAULT_MINIMUM_SIZE" , "MINIMUM_SIZE_ACCOUNTS_FOR_PADDING" , "COMPUTE_PADDING" , "OUTSIDE_NODE_LABELS_OVERHANG" , "PORTS_OVERHANG" , "UNIFORM_PORT_SPACING" , "SPACE_EFFICIENT_PORT_LABELS" , "FORCE_TABULAR_NODE_LABELS" , "ASYMMETRICAL" }},
{ID : ExpandNodes .ID , Kind : core .BooleanOption , Targets : core .Parents },
{ID : Interactive .ID , Kind : core .BooleanOption , Targets : core .Parents },
{ID : Priority .ID , Kind : core .IntegerOption , Targets : core .Nodes | core .Edges },
{ID : PackingMode .ID , Kind : core .EnumOption , Targets : core .Parents ,
EnumValues : []string {"SIMPLE" , "GROUP_DEC" , "GROUP_MIXED" , "GROUP_INC" }},
{ID : BoxAspectRatio .ID , Kind : core .DoubleOption , Targets : core .Parents },
{ID : RandomSeed .ID , Kind : core .IntegerOption , 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 .