observablehq / observablehq/plot

The differenceY mark should support the interval option

Open
#2,084 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

Because it doesn’t, it doesn’t align with areaY and lineY…

untitled - 2024-06-13T214957 786

Plot.plot({
  marks: [
    Plot.lineY(data, { x: "year", y: "value", interval: 1 }),
    Plot.differenceY(data, { x: "year", y: "value", interval: 1 }),
    Plot.areaY(data, { x: "year", y: "value", interval: 1, fillOpacity: 0.2 })
  ]
})
data = [{"year":1995,"value":0.2},{"year":1996,"value":-0.5},{"year":1997,"value":-0.6},{"year":1998,"value":0.9},{"year":1999,"value":0},{"year":2000,"value":-0.6},{"year":2001,"value":0.1},{"year":2002,"value":0.4},{"year":2003,"value":0.6},{"year":2004,"value":-0.1},{"year":2005,"value":0.7},{"year":2006,"value":-0.4},{"year":2007,"value":0.7},{"year":2008,"value":-0.6},{"year":2009,"value":-0.3},{"year":2010,"value":0.3},{"year":2011,"value":-0.4},{"year":2012,"value":-0.2},{"year":2013,"value":0.8},{"year":2014,"value":0}]

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 by reproducing the supplied Plot.plot example with interval: 1, then compare how differenceY handles the option with areaY and lineY. The work is done when differenceY supports interval and aligns with the other marks in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.