Skip to content

FEA: Draw bars and stairs with datatips and facade calls - #164

Merged
thclark merged 1 commit into
bars-and-histogramsfrom
bars-and-stairs
Oct 25, 2026
Merged

thclark merged 1 commit into
bars-and-histogramsfrom
bars-and-stairs

Conversation

@thclark

@thclark thclark commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Stage 3 of the bars and histograms epic. It delivers the bar chart (#92) and the stairs chart (#99). Bar value labels wait for the text artist of #105.

Scene compiler

  • Bars are drawn by slot: a pitch, a constant width or per-bar widths. The gap is measured on the page, so it stays symmetric on logarithmic and reversed axes.
  • Bars have a constant or per-bar base. On a logarithmic value axis, a base that is not positive is drawn from the low edge of the plot.
  • Groups are matched by name. Grouped members touch within a cluster, and the gap falls between clusters. Stacks build positive and negative parts separately, and hidden or missing parts contribute nothing.
  • Bars take the colour order. Colour data maps through a colour scale of any kind, and the black 0.5 pt edge is the default.
  • Stairs take the edges form or the samples form (pre, post or mid). A stairs outline is open or closed to a base, and a fill closes along the base. A non-finite value breaks the outline.
  • Category limits end at the slot edges, or at the stairs' first and last edges. Value limits include the base and the stacked totals.
  • Legend samples: a swatch for bars, a sweep for colour-mapped bars, a line for open stairs and a patch for filled stairs.

Datatips

New Tip::Bar and Tip::Step tips report the value, the base, the stacked segment and the category name from text tick labels. They appear on the native canvas and in the web viewer.

Facade

New calls bar, barh, stairs and stairs_at, with the BarMut and StairsMut handles. colors([...]) builds an indexed colour scale for per-bar colours.

Documentation

The getting-started guide gains bar chart and stairs sections. The viewer guide, the equivalent-functions reference and the figure schema are updated, including the grouping and stacking rules.

Existing gallery figures render byte-identically.

Draw bars with their slots, gaps, bases, groups and stacks, colour
order, colour data and edges, and stairs with open or based outlines,
fills and step positions. Give both tight category limits, legend
samples, bar and step hits and datatips that name their categories.
Add bar, barh, stairs and stairs_at to the facade, with per-bar colours
built from an indexed colour scale, and document them.
@thclark
thclark merged commit c953686 into bars-and-histograms Oct 25, 2026
7 checks passed
thclark added a commit that referenced this pull request Oct 26, 2026
Draw bars with their slots, gaps, bases, groups and stacks, colour
order, colour data and edges, and stairs with open or based outlines,
fills and step positions. Give both tight category limits, legend
samples, bar and step hits and datatips that name their categories.
Add bar, barh, stairs and stairs_at to the facade, with per-bar colours
built from an indexed colour scale, and document them.
@thclark
thclark deleted the bars-and-stairs 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