ABSTRACT

Integrated maps leverage plotly.js’s built-in support for rendering a basemap layer. Currently there are two supported ways of making integrated maps: either via Mapbox or via an integrated d3.js powered basemap. This chapter demonstrates how to create an integrated plotly.js dropdown menu to control the basemap style via the layout.updatemenus attribute. Choroplethmapbox is more powerful because we can fully specify the feature collection using GeoJavaScript Object Notation, but the choropleth trace can be a bit easier to use if it fits our use case. Cartograms distort the size of geo-spatial polygons to encode a numeric variable other than the land size.