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
		}
		 +=  + 
	}
}