Skip to content

The map transform should maybe apply maybeApplyInterval? #1842

Open
@Fil

Description

@Fil

The map transform groups by y and not by intervaled y. If you replace y: (d) => ((d.height * 10) | 0) / 10 below by y: "height", the box plot shows too many outliers (the outliers are using a map transform).

Here's a test with the correct outliers:

export async function boxplotXInterval() {
  const olympians = await d3.csv<any>("data/athletes.csv", d3.autoType);
  return Plot.plot({
    y: {interval: 0.1, reverse: true},
    marks: [
      Plot.boxX(
        olympians.filter((d) => d.height),
        {x: "weight", y: "height", z: (d) => Math.floor(d.height * 10)}
      )
    ]
  });
}

correct

now, remove the z specified above, and you get this incorrect chart, where you have "outliers" inside the q1-q3 band:

incorrect

(excerpted from #1839; note that I've updated the code slightly to add y: {reverse: true}, for when we create the actual unit test.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions