{"id":13605164,"url":"https://github.com/mapbox/mapboxgl-jupyter","last_synced_at":"2025-10-21T20:52:57.948Z","repository":{"id":45069821,"uuid":"99706219","full_name":"mapbox/mapboxgl-jupyter","owner":"mapbox","description":"Use Mapbox GL JS to visualize data in a Python Jupyter notebook","archived":false,"fork":false,"pushed_at":"2022-01-11T05:18:07.000Z","size":10375,"stargazers_count":665,"open_issues_count":42,"forks_count":137,"subscribers_count":132,"default_branch":"master","last_synced_at":"2024-10-01T22:08:46.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapbox.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-08T15:10:51.000Z","updated_at":"2024-09-26T16:13:44.000Z","dependencies_parsed_at":"2022-09-26T17:20:39.307Z","dependency_job_id":null,"html_url":"https://github.com/mapbox/mapboxgl-jupyter","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fmapboxgl-jupyter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fmapboxgl-jupyter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fmapboxgl-jupyter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Fmapboxgl-jupyter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapbox","download_url":"https://codeload.github.com/mapbox/mapboxgl-jupyter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223489748,"owners_count":17153822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:00:55.330Z","updated_at":"2025-10-21T20:52:52.908Z","avatar_url":"https://github.com/mapbox.png","language":"Python","readme":"=========================================================\nLocation Data Visualization library for Jupyter Notebooks\n=========================================================\n\n.. image:: https://travis-ci.org/mapbox/mapboxgl-jupyter.svg?branch=master\n   :target: https://travis-ci.org/mapbox/mapboxgl-jupyter\n   :alt: Build Status\n\n.. image:: https://coveralls.io/repos/github/mapbox/mapboxgl-jupyter/badge.svg?branch=master\n   :target: https://coveralls.io/github/mapbox/mapboxgl-jupyter?branch=master\n   :alt: Coverage Status\n\n.. image:: https://badge.fury.io/py/mapboxgl.svg\n   :target: https://badge.fury.io/py/mapboxgl\n   :alt: PyPI version\n\n\nLibrary documentation at https://mapbox-mapboxgl-jupyter.readthedocs-hosted.com/en/latest/.\n\nCreate `Mapbox GL JS \u003chttps://www.mapbox.com/mapbox-gl-js/api/\u003e`__ data\nvisualizations natively in Jupyter Notebooks with Python and Pandas. *mapboxgl*\nis a high-performance, interactive, WebGL-based data visualization tool that\ndrops directly into Jupyter. *mapboxgl* is similar to `Folium\n\u003chttps://github.com/python-visualization/folium\u003e`__ built on top of the raster\n`Leaflet \u003chttp://leafletjs.com/\u003e`__ map library, but with much higher\nperformance for large data sets using WebGL and Mapbox Vector Tiles.\n\n.. image:: https://cl.ly/3a0K2m1o2j1A/download/Image%202018-02-22%20at%207.16.58%20PM.png\n\nTry out the interactive map example notebooks from the /examples directory in\nthis repository\n\n1. `Categorical points \u003chttps://nbviewer.jupyter.org/github/mapbox/mapboxgl-jupyter/blob/master/examples/notebooks/point-viz-categorical-example.ipynb\u003e`__\n2. `All visualization types \u003chttps://nbviewer.jupyter.org/github/mapbox/mapboxgl-jupyter/blob/master/examples/notebooks/point-viz-types-example.ipynb\u003e`__\n3. `Choropleth Visualization types \u003chttps://nbviewer.jupyter.org/github/mapbox/mapboxgl-jupyter/blob/master/examples/notebooks/choropleth-viz-example.ipynb\u003e`__\n4. `Image Visualization types \u003chttps://nbviewer.jupyter.org/github/mapbox/mapboxgl-jupyter/blob/master/examples/notebooks/image-vis-type-example.ipynb\u003e`__\n5. `Raster Tile Visualization types \u003chttps://nbviewer.jupyter.org/github/mapbox/mapboxgl-jupyter/blob/master/examples/notebooks/rastertile-viz-type-example.ipynb\u003e`__\n\nInstallation\n============\n\n.. code-block:: bash\n\n   $ pip install mapboxgl\n\nDocumentation\n=============\n\nDocumentation is on Read The Docs at https://mapbox-mapboxgl-jupyter.readthedocs-hosted.com/en/latest/.\n\nUsage\n=====\n\nThe ``examples`` directory contains sample Jupyter notebooks demonstrating usage.\n\n.. code-block:: python\n\n    import os\n\n    import pandas as pd\n\n    from mapboxgl.utils import create_color_stops, df_to_geojson\n    from mapboxgl.viz import CircleViz\n\n\n    # Load data from sample csv\n    data_url = 'https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/data/points.csv'\n    df = pd.read_csv(data_url)\n\n    # Must be a public token, starting with `pk`\n    token = os.getenv('MAPBOX_ACCESS_TOKEN')\n\n    # Create a geojson file export from a Pandas dataframe\n    df_to_geojson(df, filename='points.geojson',\n                  properties=['Avg Medicare Payments', 'Avg Covered Charges', 'date'],\n                  lat='lat', lon='lon', precision=3)\n\n    # Generate data breaks and color stops from colorBrewer\n    color_breaks = [0,10,100,1000,10000]\n    color_stops = create_color_stops(color_breaks, colors='YlGnBu')\n\n    # Create the viz from the dataframe\n    viz = CircleViz('points.geojson',\n                    access_token=token,\n                    height='400px',\n                    color_property = \"Avg Medicare Payments\",\n                    color_stops = color_stops,\n                    center = (-95, 40),\n                    zoom = 3,\n                    below_layer = 'waterway-label'\n                  )\n    viz.show()\n\nDevelopment\n===========\n\nInstall the python library locally with pip:\n\n.. code-block:: console\n\n   $ pip install -e .\n\nTo run tests use pytest:\n\n.. code-block:: console\n\n   $ pip install mock pytest\n   $ python -m pytest\n\nTo run the Jupyter examples,\n\n.. code-block:: console\n\n   $ cd examples\n   $ pip install jupyter\n   $ jupyter notebook\n\nWe follow the `PEP8 style guide for Python \u003chttp://www.python.org/dev/peps/pep-0008/\u003e`__ for all Python code.\n\nRelease process\n===============\n\n- After merging all relevant PRs for the upcoming release, pull the master branch\n    * ``git checkout master``\n    * ``git pull``\n- Update the version number in ``mapboxgl/__init__.py`` and push directly to master.\n- Tag the release\n    * ``git tag \u003cversion\u003e``\n    * ``git push --tags``\n- Setup for pypi (one time only)\n    * You'll need to ``pip install twine`` and set up your credentials in a `~/.pypirc \u003chttps://docs.python.org/2/distutils/packageindex.html#pypirc\u003e`__ `file \u003chttps://docs.python.org/2/distutils/packageindex.html#pypirc\u003e`__.\n- Create the release files\n    * ``rm dist/*``  # clean out old releases if they exist\n    * ``python setup.py sdist bdist_wheel``\n- Upload the release files\n    * ``twine upload dist/mapboxgl-*``\n","funding_links":[],"categories":["地理Geo处理","Python","Interactive Widgets \u0026 Visualization","Geospatial Library","交互式小部件和可视化"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fmapboxgl-jupyter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapbox%2Fmapboxgl-jupyter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Fmapboxgl-jupyter/lists"}