🏠 back to Observable

vega-lite API won't render geoshape spec

I have a simple Vega-lite choropleth spec using the geoshape mark. It renders
well in my notebook using the standard cell definition but when i use the same features in the.vl.markGeoshape call it does not render. I copied the code from Jo Wood’s and Jeff Heer’s tutorial examples: can anyone tell me what I am doing wrong?

Maybe fetch your data for that cell like you do some of the others: in a separate named cell, and then refer to that? That get’s you out of having to deal with promises, etc. I think.

@drlynb Are you referring to the dot map example of US zipcodes? (“Here I am testing the typical vega-lite dot map example of the US zipcodes. For some reason this renders in the editor but not here???”) The reason that doesn’t load is the data is specified as a relative path:

"data": {
  "url": "data/zipcodes.csv"
}

Outside of the Vega Editor, you need to specify an absolute URL:

"data": {
  "url": "https://vega.github.io/editor/data/zipcodes.csv"
}

Happy to take another look if you were referring to a different error (and sorry for the delayed response!).

1 Like