Open
Conversation
Given a continuous scale, returns a rounding function that snaps values to the coarsest precision that still distinguishes neighboring pixels. For temporal scales, this means utc or time intervals; for numeric scales, “nice” values = 10^x * {1, 2, 5}. For non-linear scales (log, pow, symlog, etc.) we compute precision locally.
This is a separate branch needed by both the dataless brush and the dataless crosshair
This was referenced Feb 24, 2026
Draft
Open
mbostock
reviewed
Mar 3, 2026
| import type {ScaleType} from "./scales.js"; | ||
|
|
||
| /** Internal d3 scale with type, as produced by createScaleFunctions. */ | ||
| export interface MaterializedScale { |
Member
There was a problem hiding this comment.
InternalScale or InternalScaleFunction is probably a better name here, since the existing Scale interface is already a “materialized” scale’s public representation, and what is unique about this interface is that it is the private internal representation (that we don’t want to expose publicly and that ideally we’d get rid of).
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.
Given a continuous scale, returns a rounding function that snaps values to the coarsest precision that still distinguishes neighboring pixels. For temporal scales, this means utc or time intervals; for numeric scales, “nice” values = 10^x * {1, 2, 5}. For non-linear scales (log, pow, symlog, etc.) we compute precision locally.
This is a separate branch needed by both the dataless brush and the dataless crosshair. We wouldn't necessarily merge it directly since it's not doing anything on its own, but it can be easier to review independently.