Skip to content

Rail ticks sit at observation INSTANTS while chart bars sit at period START (up to 0.61 day apart) #58

Description

@HichemMokni

Residual after #57

The scale error is gone. Measured on the deployed build (eeb7406), rail label centre vs
the bar centre for the same date:

before #55/#57 now
un-zoomed max 190.3 px 1.33 px
un-zoomed mean 110.12 px 0.90 px
zoomed max 50.0 px 5.52 px
zoomed mean 25.15 px 5.51 px

What remains under zoom is a constant offset, not a scale error: every sampled label is
5.51 px to the right of its bar — mean equals max to two decimals. Un-zoomed the same
measurement gives 0.90 px.

Why it is not simply my measurement

The labels are all 5 characters (MM-DD), so a text-centring artifact would produce the
SAME constant in both states. It does not: 0.90 un-zoomed vs 5.51 zoomed. Something in the
zoomed path contributes a fixed shift.

Both published halves look correct in that state: the band is [431, 1821] (matches the
plot rect exactly) and the domain is [2025-08-30, 2026-01-31], which is post-.nice() as
intended.

Worth checking when picking this up

  • Effect ordering: the domain is published in a layout effect while doZoom re-positions
    the bars in a passive effect, so within one commit the rail can lay out against a
    domain the bars have not yet been re-x'd for. Un-zoomed the bars are positioned during
    render instead, which would explain why the residual appears only under zoom.
  • Whether .nice() applied to a zoomed scale shifts the origin in a way the rail then
    reproduces faithfully while the bars are drawn from the pre-nice zoom transform.

Low priority: 5.5 px on a 1390 px band is ~0.4%, and the reported symptom (drift growing
across the axis, up to 190 px) is resolved.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions