Skip to content

refresh snapshots#2365

Closed
Fil wants to merge 5 commits intomainfrom
fil/refresh-snapshots
Closed

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

Conversation

@Fil
Copy link
Copy Markdown
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 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
Copy Markdown
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
Fil added 5 commits March 3, 2026 15:10
…ndefined (older browser), or <= 1 (actual low-res screen)
- removes translate(0, 0.5)
- uses lower-precision numbers (#2270, #2234)

closes #1445
@Fil Fil force-pushed the fil/refresh-snapshots branch from 7384d08 to dae56cb Compare March 3, 2026 14:14
@Fil
Copy link
Copy Markdown
Contributor Author

Fil commented Mar 3, 2026

rebased

@Fil Fil enabled auto-merge (squash) March 3, 2026 14:15
@mbostock
Copy link
Copy Markdown
Member

mbostock commented Apr 1, 2026

Duplicate of #2375 now? Or obsolete after #2373? We could use setOffset(0) in our tests but I think it’s nice to test against 0.5 because otherwise we won’t really have any tests for the offset being implemented correctly…

@Fil
Copy link
Copy Markdown
Contributor Author

Fil commented Apr 1, 2026

obsolete after #2373

@Fil Fil closed this Apr 1, 2026
auto-merge was automatically disabled April 1, 2026 07:58

Pull request was closed

@Fil Fil deleted the fil/refresh-snapshots branch April 1, 2026 07:58
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

2 participants