Skip to content

FEA: Draw cells with categorical rows and occupancy matrices - #165

Merged
thclark merged 1 commit into
bars-and-histogramsfrom
cells-and-occupancy
Oct 26, 2026
Merged

thclark merged 1 commit into
bars-and-histogramsfrom
cells-and-occupancy

Conversation

@thclark

@thclark thclark commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Stage 4 of the bars and histograms epic. It delivers the occupancy matrices of #74, except for the margin table of counts, which is left to the table chart type (#121).

Cells

  • Cells are drawn one rectangle each between their edges, unit or explicit, increasing or decreasing. The gap is measured on the page, so it stays symmetric on logarithmic and reversed axes.
  • Colours come through the cells' colour scale, with the scale's out-of-range policies. NaN padding draws nothing, and a strict policy leaves the whole artist out, as for a scalar image.
  • The alpha array and the face and edge opacities multiply the colour, and an automatic or colormapped edge takes its cell's colour.
  • Limits are tight at the outer edges, and the legend sample is the scale's sweep, as for a scalar image.
  • A 100 × 100 grid compiles in a time comparable to a surface of as many faces.
  • New Tip::Cell datatips report the row and column, the value (category, index or value, as for pixels) and the row and column category names. They appear on the native canvas and on the web.

Facade

  • New calls cells and occupancy. occupancy pads ragged rows with NaN, uses gaps of 0.2 and hides the x axis.
  • New category helpers xcategories, ycategories (first category at the top) and ycategory_groups. The last returns a CategoryRows that places data in grouped rows under \textbf headers.

Supporting changes

  • \textbf{…} is set in the bundled bold face.
  • Rectangle insets and category-name lookups are shared with bars.
  • The getting-started guide, the colour guide, the viewer guide, the equivalent-functions reference, the architecture reference and the figure schema are updated.

Existing gallery figures render byte-identically.

Draw cells between their edges with gaps measured on the page, coloured
through their scale with alpha and opacities, and give them tight
limits, legend sweeps, hits and datatips that name their row and column
categories. Add cells, occupancy and the x and y category helpers,
including grouped rows under bold headers, and set \textbf arguments in
the bundled bold face. Share rectangle and category code with bars.
@thclark
thclark merged commit 348e680 into bars-and-histograms Oct 26, 2026
7 checks passed
thclark added a commit that referenced this pull request Oct 26, 2026
Draw cells between their edges with gaps measured on the page, coloured
through their scale with alpha and opacities, and give them tight
limits, legend sweeps, hits and datatips that name their row and column
categories. Add cells, occupancy and the x and y category helpers,
including grouped rows under bold headers, and set \textbf arguments in
the bundled bold face. Share rectangle and category code with bars.
@thclark
thclark deleted the cells-and-occupancy branch October 26, 2026 14:42
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