Skip to content

Preserve missing values in deviation normalization - #2483

Open
peterolkhov wants to merge 1 commit into
observablehq:mainfrom
peterolkhov:codex/preserve-missing-deviation-values
Open

peterolkhov wants to merge 1 commit into
observablehq:mainfrom
peterolkhov:codex/preserve-missing-deviation-values

Conversation

@peterolkhov

Copy link
Copy Markdown

Deviation normalization turns NaN and undefined into valid zeros when the non-missing series is constant. For example, normalizing [2, 2, NaN] draws three dots instead of two; an entirely missing series can also produce invented observations.

Use the existing defined check before the zero-deviation fallback. Valid constant values still normalize to zero, while missing values stay missing. Added x/y, single-valid, all-missing and grouped regressions.

Validation: all 405 native test files pass (1,355 tests, two skipped), including snapshots and types; whole-library lint, standalone TypeScript, formatting and all four release bundles pass. Independent Chromium replay passes 26 cases, including original facets and typed arrays, plus the 14 focused tests. The extra docs build is blocked by the same GitHub-star fetch on pristine and patched source under network denial.

Fixes #2482.

This branch has not been deployed

No deployments
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.

Deviation normalization renders missing values as zeros for constant series

1 participant