package d2grid

Import Path
	oss.terrastruct.com/d2/d2layouts/d2grid (on go.dev)

Dependency Relation
	imports 10 packages, and imported by one package

Involved Source Files constants.go grid_diagram.go layout.go
Package-Level Functions (total 2)
generate a grid of objects from the given cut indices each cut index applies after the object at that index e.g. [0 1 2 3 4 5 6 7] with cutIndices [0, 2, 6] => [[0], [1, 2], [3,4,5,6], [7]]
Layout runs the grid layout on containers with rows/columns Note: children are not allowed edges or descendants 1. Run grid layout on the graph root 2. Set the resulting dimensions to the graph root
Package-Level Constants (total 8)
const ATTEMPT_LIMIT = 100000
const CONTAINER_PADDING = 60
const DEFAULT_GAP = 40
const SKIP_LIMIT = 10000000
don't consider layouts with rows longer than targetSize*1.2 or shorter than targetSize/1.2
next try layouts with a 25% larger threshold