1"""
2US Income by State: Wrapped Facet
3---------------------------------
4This example shows how to create a map of income in the US by state,
5faceted over income brackets
6"""
7# category: maps
8
9import altair as alt
10from vega_datasets import data
11
12states = alt.topo_feature(data.us_10m.url, 'states')
13source = data.income.url
14
15alt.Chart(source).mark_geoshape().encode(
16    shape='geo:G',
17    color='pct:Q',
18    tooltip=['name:N', 'pct:Q'],
19    facet=alt.Facet('group:N', columns=2),
20).transform_lookup(
21    lookup='id',
22    from_=alt.LookupData(data=states, key='id'),
23    as_='geo'
24).properties(
25    width=300,
26    height=175,
27).project(
28    type='albersUsa'
29)