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

longitude latitude channel makes the browser snap .. sometimes #9457

Open
mattijn opened this issue Oct 18, 2024 · 1 comment
Open

longitude latitude channel makes the browser snap .. sometimes #9457

mattijn opened this issue Oct 18, 2024 · 1 comment
Labels

Comments

@mattijn
Copy link
Contributor

mattijn commented Oct 18, 2024

Originally reported at SO: https://stackoverflow.com/questions/79101599/how-to-solve-strange-plotting-error-in-altair

One of the weirdest bugs I've seen lately..

This specification gives a sad-face (Open the Chart in the Vega Editor):

{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
  "data": {"name": "ref"},
  "mark": {"type": "circle", "size": 500},
  "encoding": {
    "latitude": {"field": "lat", "type": "quantitative"},
    "longitude": {"field": "lon", "type": "quantitative"}
  },
  "datasets": {
    "ref": [
      {"lat": 51.4, "lon": 1.1},
      {"lat": 51.5, "lon": 1.2},
      {"lat": 51.31, "lon": 1.3},
      {"lat": null, "lon": null}
    ]
  }
}

Image

When rounding the latitude value 51.31 to 51.3 there is no sad-face anymore, but only a very large white space (Open the Chart in the Vega Editor):

Image

Removing the rows that contain null values can resolve the issue (Open the Chart in the Vega Editor):
Image

Or by changing the latitude value 51.4 to a lower value like 51.2 and keep the null values in the dataset (Open the Chart in the Vega Editor):
Image

But then there is again a strange white space area on the left. Weird, weird.

@PBI-David
Copy link
Contributor

I see a few differences from what you observe.

Your first spec in Chrome with canvas render shows sad face. Switching to SVG render shows the dots.

Your first spec in FF with canvas render shows no sad face and just white space. Switching to SVG render shows the dots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants