Hey there 2017

We've been working on this problem in a new Python Library, `mapboxgl`. Check it out here! https://github.com/mapbox/mapboxgl-jupyter

Now back to the old Jupyter + Mapboxgl Python blog post...

Problem

When analyzing data in the excellent Jupyter Notebook programming IDE, I often find myself wanting to make a map. While some of the existing libraries make this possible - namely Python's Folium library, which uses Leaflet.js under the hood - I always come away wanting more flexibility.

Enter embedded Mapbox-gl.js visualizations right in the Jupyter notebook - allowing for interactive, fully realized map visuals.

Here are the steps to make it happen. The same technique can be applied to embed any javascript library, such as D3.js for more visualization and charting options.

Goal to Create

Below is our target visualization - an interactive segment exploration map of Strava segments. The data is constantly fetched from the Strava API, and cached locally so that the user can build up a list of all of the segments in a given lat/long bounds.