Step curve could allow NaN x or y for discontinuities.

Open
#65 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
d3, javascript

Research direction

Read the step curve implementation and the line and area curve tests to see how undefined values are handled. The issue proposes symmetric handling for NaN x and y, including limiting extension to one missing point in a row; determine the expected behavior from the linked d3/d3#2832 discussion. Done means the curve behavior and tests cover these discontinuities consistently.

Written by the indexing model from the issue text.

Description

From d3/d3#2832: if the y-value is NaN, we can still extend the line using the previous x-value. But we’d have to make sure that it’s symmetric for x and y rather than only supporting undefined y. This would be an alternative to using line.defined and area.defined for missing data.

Presumably we’d only want to extend the previous value for a single data point, however? Like if you get two points in a row with NaN y, you’d want to extend a horizontal line from the previous x to the first x with undefined y, but not the second x.

Dominant language
JavaScript
Stars
2.5k
Forks
307
Avg merge
4h 16m
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-shape

All issues in d3/d3-shape

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.