Layout Grid
pbir_layout_gridCompute a deterministic grid layout for a Power BI report page, handling margins, gaps, and remaining space. Use instead of multiple visual placement calls to build a page from scratch.
Instructions
Compute a deterministic rows×cols grid; server owns margin/gap/remainder math. Use this INSTEAD of N pbir_add_visual calls when building a page from scratch. planOnly:true (default) returns the plan; planOnly:false validates bindings+layout then writes in one call. See guide('wireframes') for grid-shape selection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cols | Yes | ||
| gaps | No | Px between cells, both directions (default 5). | |
| rows | Yes | ||
| cells | Yes | Empty slots allowed — don't need to fill every cell. | |
| pageId | No | Auto-resolved when only one page exists. | |
| margins | No | Default canonical (L=15, R=15, T=0, B=6). | |
| planOnly | No | true (default) = plan only; false = validate + write. | |
| includeTypes | No | Return full {visualId,visualType,slotRef,x,y,width,height} per cell instead of slim ids. | |
| strictLayout | No | true=strict (default), false=warn. Omit for env default. | |
| strictBindings | No | Commit-mode only (ignored when planOnly:true). true=strict (default), false=warn. Omit for env default. | |
| reserveBannerRow | No | Start grid at y=57, leaving top 52px for a banner shape (add separately via pbir_add_visual). |