Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The map transform should maybe apply maybeApplyInterval? #1842

Open
Fil opened this issue Aug 31, 2023 · 0 comments · May be fixed by #1846
Open

The map transform should maybe apply maybeApplyInterval? #1842

Fil opened this issue Aug 31, 2023 · 0 comments · May be fixed by #1846
Labels
bug Something isn’t working

Comments

@Fil
Copy link
Contributor

Fil commented Aug 31, 2023

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.)

@Fil Fil added the bug Something isn’t working label Aug 31, 2023
@Fil Fil mentioned this issue Aug 31, 2023
Fil added a commit that referenced this issue Sep 1, 2023
@Fil Fil linked a pull request Sep 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant