#612 Chart axes: steady under Ctrl-scroll, above the moments, more values, a balance readout under the mouse
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#612
- pull request
- state:merged
Fixes for the measure and balance chart axes (#610), from feedback on the debt timeline. **Ctrl and the wheel no longer change the axes** - A measure chart's rate is per the ruler's labelled step. That step was planned at the moments' current size, so making them larger moved the ruler to a longer step and rescaled the axis, for example from "Spending per 10 years" to "per 100 years". `rulerStep()` now plans it at the natural size. - The axes and the balance readout were positioned as if their layer were scaled with the moments, but it isn't, so they slid out of place too. **Above the moments.** The axes, the balance readout and the new tooltip are on the stage itself, above the moment cards, rather than in the backgrounds layer beneath them. **More values.** An axis has a value about every 36 pixels of the chart's height, with 2.5 joining 1, 2 and 5 as a step. The test's debt axis goes from `$1T $2T $3T` to `$500B $1T $1.5T … $3.5T`. **Balance under the mouse.** Over the charts (not over a moment), the readout shows: - a dashed line at the mouse's time; - a dot on each balance's line; - a box with the time, as precise as the view's labels, and each balance there exactly, in the measure's format. The value is `balanceAt()` in `src/background-chart.ts`: the same steps the chart draws. **Tests** - `test/measure-plugins.test.mjs`: `balanceAt`, and taller axes with the 2.5 step. - `test/chart-axes-browser.mjs`: Ctrl-scroll both ways keeps the titles, values and heights the same; the axes are on the stage after the moments' layers. Hovering gives a growing exact balance, and at the left edge it matches the readout's start; the tooltip goes when the mouse leaves. - Docs: `docs/plugins.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/pull/612
Related
- #610 Every measure chart is drawn, each with a value axis on the right
- #614 Every measure is charted on its own axis, in its own color
- #615 The follow test pauses its clock a second ahead
- #616 Separated tracks chart their own measures, each in its own row
- Merge pull request #612 from openchronology/fix/chart-rate-ui-scale
- The follow test pauses its clock a second ahead