Giter Site home page Giter Site logo

mapboxgl-jupyter's Introduction

mapboxgl-jupyter

Build Status Coverage Status PyPI version

Create Mapbox GL JS data visualizations natively in your Jupyter Notebook workflows with Python, GeoJSON and Pandas dataframes. Mapboxgl aims to be a data visualization focused mapping library built on top of the Mapbox GL JS SDK, similar to Folium built on top of Leaflet.

Currently supported map visualization types:

  1. Circles
  2. Graduated Circles
  3. Heatmaps

image

Installation

pip install mapboxgl

Development

Install the python library locally with pip:

pip install -e .

To run tests use pytest:

pytest

To run the jupiter examples,

  1. cd examples
  2. pip install jupyter
  3. jupyter notebook

Usage

mapboxgl visualizations take GeoJSON data as input. You can convert pandas dataframes to a GeoJSON feature collection:

data = df_to_geojson(df, ['Avg Total Payments'],
                     lat='latitude', lon='longitude')

Using the CircleViz visualization to view the data with a color ramp for the total payment column. Within a Jupyter notebook:

viz = CircleViz(data,
                color_property='Avg Total Payments',
                color_stops=color_stops,
                access_token=YOUR_PUBLIC_ACCESS_TOKEN)
viz.show()

The examples/ directory contains Jupyter notebooks demonstrating more advanced usage.

Status

Under heavy development. As we move towards a 1.0 release, expect API changes. If you're interested in contributing and are curious about the direction of the project, check out ROADMAP.md.

Running the Examples

  1. Install Python3.4+
  2. pip install mapboxgl
  3. cd to /example directory of mapboxgl-jupyter repo
  4. Open the test-python.ipynb workbook
  5. Put your Mapbox GL Access Token (it's free for developers!) into the notebook, cell 4.
  6. Run all cells in the notebook and enjoy the interactive maps.

mapboxgl-jupyter's People

Contributors

ryanbaumann avatar perrygeo avatar ustroetz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.