observablehq / observablehq/plot

Spatial interpolator reducers

Open
#2,034 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The default spatial interpolator applies the current value to the current position, resulting in a "last" binning reducer. We could implement others (thinking out loud for now):

  • "first" is the easiest: just don't overwrite if a value is already present
  • "sum" is easy too (though it applies only to quantitative values), with a caveat that the color domain will have to be set by hand as it will almost always be wrong (it's based on the input values sent to the interpolator); the contours should work directly
  • "random sample" and "mean" can be done by keeping a separate track of the count; ("mean" expects the value to be quantitative)
  • "median" (and any other reducers, including custom functions) need to keep track of all the values, so that's probably not going to be great performance-wise, unless we can have iterative reducers

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

No implementation files, tests, or entry points are named. Start by locating the spatial interpolator and define the supported reducer scope, including quantitative constraints, color-domain behavior, contours, and performance. Done means the reducer API and its behavior are specified and implemented with coverage for the selected cases.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.