Source File
position.go
Belonging Package
github.com/d2lang/dagro
package dagro// position assigns coordinates to the leaf nodes in g. Compound container// nodes are positioned later from their border nodes, as in Dagre 3.1.1.func position( *Graph) {= asNonCompoundGraph()positionY()for , := range positionX() {asAttrs(.Node())["x"] =}}func positionY( *Graph) {:= buildLayerMatrix():= num(asAttrs(.Graph()), "ranksep"):= float64(0)for , := range {:= float64(0)for , := range {:= asAttrs(.Node()):= float64(0)if has(, "height") {= num(, "height")}if !( > ) {=}}for , := range {asAttrs(.Node())["y"] = + /2}+= +}}
![]() |
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. |