observablehq / observablehq/plot

The box mark could use bin/rect instead of group/bar for quantitative data

Open
#1,330 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

As an approximation:

Plot.plot({
  marks: [
    Plot.ruleX(data, Plot.binX({y1: loqr1, y2: hiqr2}, {x, y})),
    Plot.rectY(data, Plot.binX({y1: "p25", y2: "p75"}, {x, y, fill: "#ccc"})),
    Plot.ruleY(data, Plot.binX({y: "p50"}, {x, y, strokeWidth: 2})),
    Plot.dot(data, Plot.map({y: oqr}, {x, y, z: ???}))
  ]
})

I couldn’t figure out how to compute the per-bin outliers, though. Maybe we need a Plot.binmapX transform where z can be imputed by binning x? Or maybe there’s a way to compose the bin and map transform? 🤔

Ref. https://talk.observablehq.com/t/how-to-label-a-boxplot-with-dates-format-axis/7739/3

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 reviewing the box mark entry point and the existing Plot.binX and Plot.map transforms referenced in the issue. Determine whether the requested behavior should use bin/rect for quantitative data and how per-bin outliers would be represented; the work is done when the intended box-mark behavior and supporting API are implemented and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.