mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-29 21:16:57 -06:00
Upstream ce1c7b7 ("Charts: axis number formats, automatic major unit,
hidden axes") replaced the value-axis scaling this branch changed, and
already draws #144's chart as 0-45 in steps of 5. Take its structure and
API as they are (axis_scale with fixed bounds/unit and a room-based
interval count, Chart::axis_scale(secondary, max_intervals), axis_range,
combo charts' secondary axis) and drop this branch's auto_scale.
On top of it, the Office rules upstream lacked:
- Automatic minimum: zero only when every value is >= 0 and the smallest
is below 5/6 of the largest; otherwise the first major unit at or below
min - (max - min)/20. All-negative data mirrors it (the axis ends at
zero only when the largest is above 5/6 of the smallest). Headroom is
5 % of the data range, as documented. Chart::axis_scale feeds it the
plotted extremes (stacked sums still count from zero, 100 % series are
0-1); axis_range and value_range keep returning zero-inclusive ranges.
- A fixed limit beyond the data makes the automatic end give way instead
of producing an inverted axis.
- The renderer stops values past the axis limits at the plot edge, on
both value axes.
The model tests from this branch are ported to the new signature with
ten intervals of room.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>