Skip to content

Spatial interpolator reducers #2034

Open
@Fil

Description

@Fil
Contributor

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

Activity

added
enhancementNew feature or request
geoMaps and projections
on Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgeoMaps and projections

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Fil

        Issue actions

          Spatial interpolator reducers · Issue #2034 · observablehq/plot