Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
Hi @Regina Henschel,
After investigating the SmartArt diagram layout rendering I found the explanation below for why the layout jumps around.
TLDR:
- SmartArt computes composite size two ways: (1) fit to full diagram height, derive width via aspect ratio; (2) fit to available width, derive height via aspect ratio. It picks whichever fits without overflowing - solution 2 can only be ≤ solution 1.
- At 6.21cm the height-driven width still fits -> solution 1 (full height) wins. At 6.22cm it just barely doesn't -> solver flips to solution 2 (width-driven, shorter height, hence margins + tighter spacing). It's a hard branch switch (
min()of two functions), not a gradual blend, so the change looks abrupt even for a 0.01cm difference. - The 1 -> 2 column jump works the same way but for column count: it's an integer choice, so as soon as the available width crosses the exact point where 2 columns (+ spacing) first fit, it snaps discretely - no gradual transition possible.
Full answer:
Why 6.21cm vs 6.22cm flips behavior
The solver evaluates two competing solutions for the composite node size and picks whichever one satisfies all constraints (doesn't exceed available bounds):
- Height-driven solution: composite height = parent (
ch) height derived from diagram height (per yourtype="h"refType="h"constraint). Composite width is then derived from that height via the node's fixed aspect ratio (ar). This is the "primary" solution the layout prefers. - Width-driven fallback: if the height-driven composite's width would exceed the width actually available in the column, the solver instead pins composite width to the available column width and derives composite height from that via the same
ar. This always produces an equal or smaller height than solution 1 (that's mathematically why fitting to width instead of height can only shrink it, not grow it).
At 6.21cm the height-driven width still fits inside the (slightly larger) available column width, so solution 1 wins - full height used, spacing (sp / sibTrans, pegged at 0.1× the composite/parent height) is at its "full" value, drawing touches all four edges.
At 6.22cm the increment is tiny, but it's just enough that the available width now barely exceeds what's needed - except floating-point/rounding in the solver flips which branch is feasible, or more likely: your 6.21cm case was actually already width-constrained by a hair and rounding masked it, and 6.22 is the first value where the width-derived (smaller) composite is unambiguously chosen. Because the switch between "solution 1" and "solution 2" is a discrete branch selection (min of two piecewise-continuous functions), not a continuous blend, there's a visible kink exactly at the crossover width - hence margins appearing suddenly and spacing shrinking (since sp / sibTrans are fact="0.1" of whatever height solution 2 now computes, which is smaller than solution 1's height).
This matches your own diagnosis - you had it right. The "surprise" is simply that the solver's branch choice is a hard min(), not a smooth interpolation, so there's no continuum where "extra space appears left/right while height stays maxed" - once width becomes the binding constraint, height must drop to satisfy ar, even by a hair.
14.40 -> 14.41cm column jump
That threshold is the diagram-level dgm:choose / dgm:if logic (evaluated on the overall available width vs. the space needed for N columns + (N-1)× spacing at the minimum viable per-item height). I don't have your layout.xml file, so I can't give you the exact val= threshold, but the mechanism is: the algorithm computes, for each candidate column count, the resulting per-item height under that arrangement, checks it against a minimum ar /minimum-size floor, and picks the highest column count that still satisfies the floor and fits the width. The jump is sharp (not gradual) because column count is an integer choice - there's no "3.9 columns" - so as available width crosses the exact point where 2 columns' total required width (2×item-width-at-min-height + 1×spacing) first fits, the layout snaps discretely from 1 -> 2 columns.
Let me know if that answers your question.
Best regards,
Michael Bowen
Sr. Escalation Engineer - Microsoft® Corporation