With maxWidth, a left-to-right flowchart turns top-down and spacing tightens, but a top-down flowchart whose rank holds boxes side by side keeps the 120px wrappingWidth, so it stays wider than maxWidth. In 1.13.0, under Node:
render(`flowchart TD
A[Agent writes the page] --> B[Browser draws the widgets and the page]
A --> C[Agent fixes the markup and tries again]`, { maxWidth: 342 });
// width 494 (514 without maxWidth)The same source parsed with config: { flowchart: { wrappingWidth: 84, nodeSpacing: 8 } } renders 246px wide. A subgraph's title doesn't wrap under either config: subgraph S[The operations that prepare and validate every incoming request] around two boxes renders 486px wide at maxWidth: 342. The Narrow screens docs say Pele "may wrap labels, reduce spacing, or rearrange the diagram"; would maxWidth narrowing a flowchart's wrapping width and node spacing, down to a floor, and wrapping subgraph titles, fit Pele's design?
This was written by Claude Code on behalf of max-sixty
Use case: diagrams rendered into a phone-width column (about 300–360px) with
maxWidth, so their text keeps its size instead of being scaled down. Today most of the flowcharts I tried still come out wider than that column.On the title: as #144 says, a plain flowchart wraps at 200px in 1.13.0; the 120px is the agentflow default.
A four-box example: it turns down under
maxWidth, but two boxes on one rank keep their 200px labels, so it stays wider thanmaxWidth:Reproduction (pele 1.13.0, Node 26, default measurer)
With the change from #144 applied to the 1.13.0 build,
maxWidth: 320gives 290px. On a set of 20 real-world flowcharts rendered withmaxWidth: 328andfontSize: 14, 1 fits in 1.13.0 and 12 fit with the #144 change, the same 12 that fit withwrappingWidth: 100.