-
Notifications
You must be signed in to change notification settings - Fork 796
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
Move the geospatial section in the "Specifying data" page to the geoshape mark page #2740
Comments
I think we should keep the mark geoshape page about the mark geoshape options. But I also agree it would be good to have a section on defining spatial data. I really like the current structure of nested options below Marks and Transformations (although I wished they are not collapsed by default). I mentioned this before in this issue from a while ago:
There we can then have a section named Spatial Data and place these GeoPandas and Graticule/Sphere generator sections and info from this SO-answer and also some info how to use the But in this Specifying Data section I wish there also is a section how to use eg. Btw, I prefer the name Spatial Data over Geographical data, since there are many things spatially related but not necessarily geographical: import altair as alt
data = [
{"color": "#F3C14F", "geo": {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[1.45, 3.75], [1.45, 0], [0, 0], [1.45, 3.75]]]}}},
{"color": "#4098D7", "geo": {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[1.45, 0], [1.45, 3.75], [2.57, 3.75], [2.57, 0], [2.33, 0], [1.45, 0]]]}}},
{"color": "#66B4E2", "geo": {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2.33, 0], [2.33, 2.5], [3.47, 2.5], [3.47, 0], [3.2, 0], [2.57, 0], [2.33, 0]]]}}},
{"color": "#A9CDE0", "geo": {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[3.2, 0], [3.2, 1.25], [4.32, 1.25], [4.32, 0], [3.47, 0], [3.2, 0]]]}}},
]
source = alt.Data(values=data)
alt.Chart(source, title="Vega-Altair").mark_geoshape().encode(
shape="geo:G",
color=alt.Color("color:N", scale=None)
).project(type="identity", reflectY=True) |
That sounds like a great idea! Based on what I see on the VegaLite Data page, the relevant sections for Altair might be
Yes, that would be super useful!
That sounds more appropriate. Maybe also including that exxample you made somewhere as a basic intro? Would you be willing to take this on whenever you have time to work on it? |
I think we should move everything from the heading "Graticule generator" and down to the geoshape mark page. Although (some of) this section is technically about specifying data, I think it is more intuitive for readers to find all the info about how to work with geographical data in one place in the Altair documentation. The rest of the "Specifying data" page is relevant for almost all readers as they lay a foundation for how to use data with most marks in altair, but the geoparts are specific to just the geoshape and feels a bit out of place to me (and at the same time harder to find for readers who want to work with only geo data).
Possibly we could have a heading "Working with geographical data" which just links to the geoshape mark page so that we improve the discoverability of this page (which I think would be helpful since it is a little bit hidden under the "marks" section, I'm even considering a separate side bar item for geoviz like the Time side bar item we have now.).
@mattijn @binste Thoughts on this?
The text was updated successfully, but these errors were encountered: