Library documentation at https://mapbox-mapboxgl-jupyter.readthedocs-hosted.com/en/latest/.
Create Mapbox GL JS data visualizations natively in Jupyter Notebooks with Python and Pandas. mapboxgl is a high-performance, interactive, WebGL-based data visualization tool that drops directly into Jupyter. mapboxgl is similar to Folium built on top of the raster Leaflet map library, but with much higher performance for large data sets using WebGL and Mapbox Vector Tiles.
Try out the interactive map example notebooks from the /examples directory in this repository
Documentation is on Read The Docs at https://mapbox-mapboxgl-jupyter.readthedocs-hosted.com/en/latest/.
The examples
directory contains sample Jupyter notebooks demonstrating usage.
import os import pandas as pd from mapboxgl.utils import create_color_stops, df_to_geojson from mapboxgl.viz import CircleViz # Load data from sample csv data_url = 'https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/data/points.csv' df = pd.read_csv(data_url) # Must be a public token, starting with `pk` token = os.getenv('MAPBOX_ACCESS_TOKEN') # Create a geojson file export from a Pandas dataframe df_to_geojson(df, filename='points.geojson', properties=['Avg Medicare Payments', 'Avg Covered Charges', 'date'], lat='lat', lon='lon', precision=3) # Generate data breaks and color stops from colorBrewer color_breaks = [0,10,100,1000,10000] color_stops = create_color_stops(color_breaks, colors='YlGnBu') # Create the viz from the dataframe viz = CircleViz('points.geojson', access_token=token, height='400px', color_property = "Avg Medicare Payments", color_stops = color_stops, center = (-95, 40), zoom = 3, below_layer = 'waterway-label' ) viz.show()
Install the python library locally with pip:
To run tests use pytest:
$ pip install mock pytest $ python -m pytest
To run the Jupyter examples,
$ cd examples $ pip install jupyter $ jupyter notebook
We follow the PEP8 style guide for Python for all Python code.
git checkout master
git pull
mapboxgl/__init__.py
and push directly to master.git tag <version>
git push --tags
rm dist/*
# clean out old releases if they existpython setup.py sdist bdist_wheel
twine upload dist/mapboxgl-*
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4