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

non-numeric projection coordinates #1264

Closed
Fil opened this issue Feb 8, 2023 · 0 comments
Closed

non-numeric projection coordinates #1264

Fil opened this issue Feb 8, 2023 · 0 comments
Labels
geo Maps and projections

Comments

@Fil
Copy link
Contributor

Fil commented Feb 8, 2023

Plot.raster(lebron_shots, {
  x: "loc_x",
  y: "loc_y",
  fill: "shot_made_flag"
}).plot({
  width: 500,
  height: 600,
  projection: {
    type: "reflect-y",
    domain: {
      type: "MultiPoint",
      coordinates: lebron_shots.map((d) => [d.loc_x, d.loc_y])
    }
  }
})

This (on the dataset at https://observablehq.com/d/d280cb30053f69a9) shows a warning that loc_x or loc_y are not numeric. But in this case, since we have a projection, there is no ambiguity (and also no way to fix the warning), so we should avoid warning. (EDIT: my mistake, it was the color scale, so in fact the message is correct.)

A secondary issue is that the projection will no be fit correctly if we don't transform the coordinates with +d.loc_x, +d.loc_y. => The issue is with geoPath(projection).bounds, which returns strings in that case. d3/d3-geo#278

A third issue is that it's tedious to create the MultiPoint, and we could maybe use the x and y channels contents instead. (Might need to split this into 2 or 3 issues; only the first can be considered as a bug, the two others would be enhancements).

@Fil Fil added bug Something isn’t working geo Maps and projections and removed bug Something isn’t working labels Feb 8, 2023
@Fil Fil closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2023
@Fil Fil changed the title no need to warn that x or y is not numeric when using a projection non-numeric projection coordinates Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
geo Maps and projections
Projects
None yet
Development

No branches or pull requests

1 participant