Skip to content

refresh snapshots#2365

Open
Fil wants to merge 4 commits intomainfrom
fil/refresh-snapshots
Open

refresh snapshots#2365
Fil wants to merge 4 commits intomainfrom
fil/refresh-snapshots

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Feb 18, 2026

This defaults the snapshots (mocha) to use offset=0 (as a follow-up to #1442).

And we refresh all snapshots, which also benefit from the reduced precision in numbers (#2270, #2234)

closes #1445

Additionally, working on this revealed a bug, where the image generated when offset=0.5 was using a different origin for the hexes. As a result, the image produced was different when the DPI offset changed; two viewers using different screens would not see the same binning. The image now is the same independently of the DPI offset (but its coordinates are shifted by -0.5px and the path is translated by +0.5px). Note that the images in the test snapshots have changed, since offset=0 is now our baseline, but that's OK.

The bug is now fixed, but this reveals another issue: I've tried to create a new snapshot test that would show why we need ox=0.5 in hexbin.js, but I can't understand the logic any more, since what we gained on the right-hand-side by having the outer hexes be "inside" the frame, we lost on the left-hand side.

ox=0 ox=0.5
ox=0 ox= 5
bad on the rhs bad on the lhs

(A better solution would be to rescale around the center by a factor 0.999999999…? which I'm doing here #2367)

Fil added 2 commits February 18, 2026 12:43
…ndefined (older browser), or <= 1 (actual low-res screen)
- removes translate(0, 0.5)
- uses lower-precision numbers (#2270, #2234)

closes #1445
@Fil Fil requested a review from mbostock February 18, 2026 11:50
@Fil Fil enabled auto-merge (squash) February 18, 2026 11:50
@Fil Fil marked this pull request as draft February 18, 2026 12:21
auto-merge was automatically disabled February 18, 2026 12:21

Pull request was converted to draft

@Fil
Copy link
Contributor Author

Fil commented Feb 18, 2026

Investigating the 6 line difference that this caused in walmart.html, I see that because of a mix-up between offsets (the DPI offset and the hex offsets), we ended up having a different image with the DPI offset compared to without. This is a bug: while the rounding is obviously a bit arbitrary, the offset should only translate the rendering, not modify the binning.

@Fil Fil marked this pull request as ready for review February 18, 2026 13:01
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.

chore: refresh all snapshot tests after #1442

1 participant

Comments