Skip to content

pixelRound#2371

Open
Fil wants to merge 1 commit intomainfrom
fil/pixel-round
Open

pixelRound#2371
Fil wants to merge 1 commit intomainfrom
fil/pixel-round

Conversation

@Fil
Copy link
Contributor

@Fil Fil commented Feb 24, 2026

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.

@Fil Fil requested a review from mbostock February 24, 2026 13:03
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
@Fil Fil marked this pull request as ready for review February 24, 2026 13:53
@Fil Fil requested a review from allisonhorst February 24, 2026 17:24
import type {ScaleType} from "./scales.js";

/** Internal d3 scale with type, as produced by createScaleFunctions. */
export interface MaterializedScale {
Copy link
Member

@mbostock mbostock Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

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