Weighted band scales?

Open
#202 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 linked Observable notebook to understand the proposed weighted band behavior, then inspect the existing band scale implementation and its tests in d3-scale. The issue notes the prototype may have broken uniform band scales and would need rewriting; define and verify the desired weighted behavior while preserving uniform scales.

Written by the indexing model from the issue text.

Description

https://observablehq.com/d/29c9777318a8d5d5 shows how we could extend d3.scaleBand with a .weights() method allowing to set variable band widths (instead of uniform).

Capture d’écran 2020-01-20 à 21 34 51

I might be missing something though.
Note that I fiddled with the code quite a bit so I'm not sure it's still valid for uniform band scales, but if we want to integrate this I would rewrite that part.

[EDITED] changed widths to weights, which is an accessor.

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.