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

geoshape with single point won't show #5318

Open
mattijn opened this issue Aug 21, 2019 · 1 comment
Open

geoshape with single point won't show #5318

mattijn opened this issue Aug 21, 2019 · 1 comment
Labels
Area - Visual Encoding Bug 🐛 P3 Should be fixed at some point

Comments

@mattijn
Copy link
Contributor

mattijn commented Aug 21, 2019

The following Vega-lite code with a single point:

{
  "data": {
    "values": [
      {
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            4.8885,
            52.4039
          ]
        }
      }    
    ]
  },
  "mark": {
    "type": "geoshape"
  }
}

renders empty:

image

But when there are two points:

{
  "data": {
    "values": [
      {
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            4.8885,
            52.4039
          ]
        }
      },
      {
        "type": "Feature",
        "geometry": {
          "type": "Point",
          "coordinates": [
            5.8885,
            53.4039
          ]
        }
      }      
    ]
  },
  "mark": {
    "type": "geoshape"
  }
}

they will both render:
image

It seems there is no extent computation of a single point.

@jheer
Copy link
Member

jheer commented Aug 21, 2019

I think this traces down to a d3-geo issue? Vega uses D3's projection fitting methods.

var p = d3.geoMercator();
p.fitExtent(
  [[0,0],[500,500]],
  {"type": "Feature", "geometry": {"type": "Point", "coordinates": [4.8885, 52.4039]}}
);

p.scale() // Infinity
p.translate() // [-Infinity, Infinity]

If you specify custom projection parameters in the VL spec, the map should work with a single point.

@kanitw kanitw added this to the x.x Visual Encoding milestone Sep 27, 2019
@kanitw kanitw added the P3 Should be fixed at some point label Sep 27, 2019
@kanitw kanitw removed this from the x.x Visual Encoding milestone Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Visual Encoding Bug 🐛 P3 Should be fixed at some point
Projects
None yet
Development

No branches or pull requests

3 participants