Skip to content

Pack document cells without a grid, and fix nested layout heights - #2

Merged
Mapika merged 9 commits into
masterfrom
fix-nested-heights
Sep 29, 2026
Merged

Mapika merged 9 commits into
masterfrom
fix-nested-heights

Conversation

@Mapika

@Mapika Mapika commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Layout work for 5.0 (dense journal figures), driven by rebuilding the Cell dimorphism page with no hand placement.

  • Nested subfigures and fixed page heights keep their natural row heights; side margins are shared only among stacked plots.
  • choose() alternatives are picked by the page; letters can anchor to cells; font lists resolve.
  • Experimental document(pack=True) packs cells into side-by-side groups and stacks, in reading order, for the shortest page.
  • Keys on one side of a plot share a column; packed plots stay near their authored shape.
  • Fixes: pie labels and breakout connectors, same-rank graph edges, crowded network rings, keys beside line-end labels, text color and lint on pages.

See CHANGELOG "Unreleased (5.0)". The full suite passes except test_docs_site, which already failed before this branch.

🤖 Generated with Claude Code

Mapika and others added 9 commits September 29, 2026 13:19
A fixed page or parent-cell height now starts from the natural rows and
gives surplus height to plot rows in proportion to their data heights;
text and fixed artwork keep their size. Rows shrink proportionally down
to their minima when space is short.

- subfigure(stretch=False) keeps a nested grid's natural rows and
  positions it with the cell's align
- add(..., grow=False) holds a row at its natural height
- share_plot_margins=True shares top/bottom furniture per row in fixed
  and automatic heights alike
- plot cells default to a 5 mm min_height
- tolerate float error in the 5 mm data-size check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plots on the same grid line (or column span, without share_plot_margins)
now share left and right margins only when their rows touch, directly or
through other plots on that line. Previously a key beside one plot
narrowed every plot on the line anywhere on the page and could leave a
distant plot with no data width. share_plot_margins='all' is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A disc label that does not fit its slice at 0.62 of the radius now moves
towards the centre before going outside, so "85.5%" on a small pie stays
inside its large slice. Breakout connectors for slices covering more than
half the pie leave from the rim's tangent points instead of crossing the
disc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- i.choose() lays out each alternative for a cell and keeps the shortest
  page; layout_report() names the rows' setters and the chosen alternatives.
- letters(anchor='cell') sets panel letters at their cells' corners.
- Fixed artwork reserves its measured width.
- Font lists resolve family by family and prefer TrueType substitutes;
  tests tuned to Noto metrics are updated.
- Tabular figures are not kerned between digits; fit() never overshoots
  its target; icicle counts are one two-line label; title(align=) accepts
  left/right and rejects unknown values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…center

- Graph edges take same_rank=True: both ends share a rank of a layered
  drawing, source first, so a decision flow's "yes" can run across while
  its "no" runs down. Each same-rank chain is solved as one block centered
  on the members its other edges attach to, so columns stay aligned beside
  row labels of any width; a labeled same-rank edge keeps room for its label.
- A pie label too wide for its slice's center line is tried beside the
  slice's straight edges before it goes outside.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
legend(corner='best'), corner='auto' and keys beside the plot now place
label_lines() and label_points() labels provisionally before choosing a
spot, so a key no longer sits on a line's end label. With those labels in
view, corner='auto' may find nothing clear and raises, as it does for data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- document(pack=True) packs cells in reading order into the shortest page
  of side-by-side groups and stacks; responsive cells get their box height.
- A text's own fill keeps its color inside a document.
- Lint measures ink-bounded text by its ink and alpha images by their
  opaque pixels, and flags labels set on a raster scatter's points.
- A crowded circular network shrinks its nodes to clear their neighbors.
- breakout(title_side="gap") sets the title between the pie and the bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keys set outside a plot on the same side share one column (or row),
centered together, while they fit the plot area. The packer charges plot
width past 1.25 times authored as empty area, and a plot beside a taller
neighbor grows to at most 1.5 times its height, keeping the top of its box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mapika
Mapika merged commit 42a68a9 into master Sep 29, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant