scale.nice should be sticky, like scale.round?

Open
#80 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Read the scale.nice and scale.round behavior discussed in the issue, then review the scale API and its tests to understand how domain changes are handled. The proposal is to remember the nice setting and apply it to new domains; decide how this should interact with the no-argument scale.nice() behavior and its backwards compatibility before implementation.

Written by the indexing model from the issue text.

Description

Currently, scale.nice only modifies the scale’s current domain; if you set a new domain, it won’t be niced. However, perhaps scale.nice should function more like scale.round, and remember the nice setting, such that any new domain that is set is automatically niced.

However, this would not be a backwards-compatible change, since it would affect the behavior of scale.nice() with no arguments: it would now return the current nice count, which would default to undefined indicating that the scale is not niced.

Dominant language
JavaScript
Stars
1.6k
Forks
288
Avg merge
6h 41m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from d3/d3-scale

All issues in d3/d3-scale

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.