allow null scale transform (#2451) - #2461
Open
cpruijsen wants to merge 1 commit into
Open
Conversation
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.
When scale.interval (or percent) is set, Plot applies an implicit scale transform. The documented way to keep interval domain alignment without that floor is
transform: null(discussion 2450). Runtime already treats null as "no transform";ScaleOptions.transformdid not allow it, so the assignment failed understrictNullChecks.This allows
nullonScaleOptions.transform, matching other nullable scale options, and notes the escape hatch in the JSDoc and scale docs.Decision: allow
nullon the existing option (same shape astype?: ScaleType | null). Alternative: a new interval flag meaning "align domain, don't floor values." Runtime already implements null, so widening the type is the smallest change.A runtime unit test locks the existing
transform: null+intervalcontract. Ats-morphtest enablesstrictNullChecks(this repo's tsconfig does not) so the assignment is actually checked. Happy to drop the docs sentences or that type harness if you'd rather keep this types-only.Fixes #2451
Related: #2423, discussion #2450