Skip to content

setOffset for tests#2376

Open
mbostock wants to merge 2 commits intomainfrom
mbostock/simpler-offset
Open

setOffset for tests#2376
mbostock wants to merge 2 commits intomainfrom
mbostock/simpler-offset

Conversation

@mbostock
Copy link
Member

@mbostock mbostock commented Mar 7, 2026

Instead of having a typeof it === "undefined" check, use the new setOffset so that we it’s more explicit what offset is used for testing. This should make it easier to adopt Vitest and/or change the offset used for testing in the future.

This also fixes explicitly passes Plot’s offset to axis.offset where we use d3-axis. But this currently has no effect on tests since d3-axis defaults to an offset of 0.5 in a headless environment, which is the same offset we use for Plot tests, even though Plot now defaults to an offset of 0 in a headless environment.

@mbostock mbostock requested a review from Fil March 7, 2026 16:51
@mbostock mbostock enabled auto-merge (squash) March 7, 2026 17:03
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.

2 participants