Repository navigation
Ignore invalid points in mixed addAll batches - #52
Merged
mbostock merged 1 commit intoNov 3, 2026
Merged
Conversation
Fil
approved these changes
Nov 2, 2026
mbostock
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
addAllskips invalid coordinates during extent calculation, but the skipped slots in itsFloat64Arraycoordinate buffers remain zero. When the batch contains at least one valid point, the insertion pass therefore adds those invalid data as though their coordinates were(0, 0).For example:
Adding the same data individually ignores the invalid point. This is inconsistent with the existing ignore-NaN behavior and the documented relationship between
addAlland repeatedaddcalls.This stores a NaN marker in the skipped x-coordinate slot, so the existing
addguard ignores it during insertion. It does not allocate another buffer or re-evaluate accessors. Valid-coordinate handling, extent calculation, input order, and short-circuiting the y accessor for an invalid x are unchanged.Six additional tests cover mixed invalid x/y coordinates, an invalid point before a valid point, iterables, appending to an existing tree, accessor short-circuiting, and preservation of valid coerced-zero/coincident points. No generated distributions, versions, lockfiles, or dependencies are changed.
Local validation
With the existing
yarn.lockinstalled using Yarn 1.22.22,--frozen-lockfile, and installation scripts disabled, on Node 24.19.0:npm test: 70 passing, ESLint passes (locked Mocha 8.4.0 and ESLint 7.28.0).git diff --check: passes.These are local results, not a claim that upstream CI has passed. The workflow's Node 14 matrix was not run locally.
AI assistance
This change and its tests were prepared with AI assistance on behalf of the account owner. It has not received an independent human review.