August 2019
Beginner
482 pages
12h 56m
English
Now, let's reproduce the map. It is actually pretty straightforward. First, we need to specify the source for the boundaries dataset and the properties of the projection:
url = 'https://unpkg.com/world-atlas@1/world/50m.json'data_geo = alt.topo_feature(url, feature='countries')proj = {'center':[10, 52], 'type':'conicEquidistant', 'scale':800}
As you can see, Altair can be linked to the data source and will pull the data from the web during runtime. It is a nice feature, as we can similarly link it to the dataset we'll be constantly updating, hence getting a real-time data snapshot. We'll use that option in Chapter 17, Let's Build a Dashboard, to build a dashboard. Now, we will create another chart object, using projection ...
Read now
Unlock full access