observablehq / observablehq/plot

Inconsistent type definition of _scale_._transform_

Open Beginner friendly
#2,451 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
HTML
Stars
5.4k
Forks
244
PR merge metrics
No merged PRs in 30d

Description

When specifying scale.interval, scale.transform is automatically set. (See related discussion 2450 with an example).

In order to disable the implicit transform, we need to set it to null. However, the corresponding TypeScript definition specifies:

https://github.com/observablehq/plot/blob/356f579b1d947ee05a914420eddff0f29cee300a/src/scales.d.ts#L440

So null is not assignable here.

Related: #2423

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/scales.d.ts around line 440 and compare the declaration with the runtime behavior described in discussion 2450. Confirm that the type definition permits the documented way to disable the implicit transform, and check related issue #2423 for context. Done means the declaration matches the supported API without rejecting that configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.