mapbox-gl-js-jupyter Documentation

Mapbox

Apr 19, 2021

Contents:

1 Installation 3

2 Documentation 5

3 Usage 7

4 Development 9

5 Release process 11

6 Indices and tables 39

Python Module Index 41

Index 43

i ii mapbox-gl-js-jupyter Documentation

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 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 1. Categorical points 2. All visualization types 3. Choropleth Visualization types 4. Image Visualization types 5. Raster Tile Visualization types

Contents: 1 mapbox-gl-js-jupyter Documentation

2 Contents: CHAPTER 1

Installation

$ pip install mapboxgl

3 mapbox-gl-js-jupyter Documentation

4 Chapter 1. Installation CHAPTER 2

Documentation

Documentation is on Read The Docs at https://mapbox-mapboxgl-jupyter.readthedocs-hosted.com/en/latest/.

5 mapbox-gl-js-jupyter Documentation

6 Chapter 2. Documentation CHAPTER 3

Usage

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), (continues on next page)

7 mapbox-gl-js-jupyter Documentation

(continued from previous page) zoom=3, below_layer='waterway-label' ) viz.show()

8 Chapter 3. Usage CHAPTER 4

Development

Install the python library locally with pip:

$ pip install -e .

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.

9 mapbox-gl-js-jupyter Documentation

10 Chapter 4. Development CHAPTER 5

Release process

• After merging all relevant PRs for the upcoming release, pull the master branch – git checkout master – git pull • Update the version number in mapboxgl/__init__.py and push directly to master. • Tag the release – git tag – git push --tags • Setup for pypi (one time only) – You’ll need to pip install twine and set up your credentials in a ~/.pypirc file. • Create the release files – rm dist/* # clean out old releases if they exist – python setup.py sdist bdist_wheel • Upload the release files – twine upload dist/mapboxgl-*

5.1 row_to_geojson

Convert a pandas dataframe row to a geojson format object. Converts all datetimes to epoch seconds by default, ISO format, or formatted date/datetime strings.

5.1.1 Params row_to_geojson(row, lon, lat)

11 mapbox-gl-js-jupyter Documentation

Parameter | Description –|– row | Pandas dataframe row. lon | Name of dataframe column containing latitude values. lat | Name of dataframe column containing longitude values. precision | Number of decimal points for latitude and longitude values. date_format | string date format for serialization of date/datetime objects to GeoJSON (ex: ‘epoch’, ‘iso’, ‘%Y-%m-%d’)

5.2 df_to_geojson

Convert a Pandas dataframe to a geojson format Python dictionary or as a line-delimited geojson file.

5.2.1 Params

df_to_geojson(df, properties=None, lat=’lat’, lon=’lon’, precision=None, date_format=’epoch’, filename=None) Parameter | Description –|– df | Pandas dataframe properties | List of dataframe columns to include as object properties. Does not accept lat or lon as a valid property. lon | Name of dataframe column containing latitude values. lat | Name of dataframe column containing longitude values. precision | Accuracy of lat/lon values. Values are rounded to the desired precision. date_format | Date format for date and datetime data columns. Compatible with all Python datetime string formats or ‘epoch’, ‘iso’. Default is epoch seconds. filename | Name of file for writing geojson data. Data is stored as an object if filename is not provided.

5.2.2 Usage

import pandas as pd from mapboxgl.utils import *

# Load gage data from sample csv data_url="https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/

˓→cdec.csv" df= pd.read_csv(data_url)

# Convert Elevation series to float df['Elevation (feet)']= df['Elevation (feet)'].astype(float)

# Clean up by dropping null rows df.dropna(axis=1, how='all', inplace=True)

# Create geojson file output df_to_geojson( df.fillna(''), filename="cdec.geojson", properties=['CDEC ID','CNRFC ID','Gage Type','Elevation (feet)'], precision=4 ) >>>{'feature_count': 2353,'filename':'cdec.geojson','type':'file'}

# Create geojson FeatureCollection python dict saved to a variable named data data= df_to_geojson( df.fillna(''), properties=['CDEC ID','CNRFC ID','Gage Type','Elevation (feet)'], precision=4 )

12 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

5.3 geojson_to_dict_list

Convert data passed as GeoJSON object, filename, URL to a Python list of dictionaries representing the join data from each feature.

5.3.1 Params geojson_to_dict_list(data) Parameter | Description –|– data | GeoJSON join-data for use with vector tiles

5.4 convert_date_columns

Convert datetime dataframe columns to JSON-serializable format (epoch seconds, ISO format, or Python strftime format, filename); returns dataframe with updated columns.

5.4.1 Params convert_date_columns(df, date_format=’epoch’) Parameter | Description –|– df | Pandas dataframe date_format | Python datetime format string or one of epoch, iso

5.5 scale_between

Scale a minimum and maximum value to an equal interval domain list, with numStops values in in the list.

5.5.1 Params scale_between(minval, maxval, numStops) Parameter | Description –|– minval | minimum value maxval | maximum value numStops | number of intervals

5.6 create_radius_stops

Convert a Python list of a data domain (such as [0, 1, 5, 100, 10000]) into a radius ramp between a minimum and maxium radius value.

5.6.1 Params create_radius_stops(breaks, min_radius, max_radius) Parameter | Description –|– breaks | List of float values min_radius | Minimum radius value max_radius | Maximum radius value

5.3. geojson_to_dict_list 13 mapbox-gl-js-jupyter Documentation

5.7 create_weight_stops

Convert a Python list of a data domain (such as [0, 1, 5, 100, 10000]) into a weight-ramp for a heatmap.

5.7.1 Params create_weight_stops(breaks) Parameter | Description –|– breaks | List of float values

5.8 create_numeric_stops

Convert a Python list of a data domain (such as [0, 1, 5, 100, 10000]) into a generic numeric ramp between a minimum and maximum value, as in for a heatmap, choropleth 3-D extrusions, etc.

5.8.1 Params create_numeric_stops(breaks, min_value, max_value) Parameter | Description –|– breaks | List of float values min_value | Minimum ramp value max_value | Maximum ramp value

5.9 create_color_stops

Convert a Python list of a data domain (such as [0, 1, 5, 100, 10000]) into color ramp stops. Color ramps can be from colorBrewer, or a custom list of color values.

5.9.1 Params create_color_stops(breaks, colors=’RdYlGn’) Parameter | Description –|– breaks | List of float values colors | String value for color ramp OR a list of colors as hex, RGB, or RGBA strings.

5.9.2 Color Options

Multi-Hue | Single Hue | Diverging | Qualitative –|–|–|– YlGn | Blues | BrBG | Accent YlGnB | Greens | PiYG | Dark2 BuGn | Greys | PRGn | Paired BuPu | Oranges | PuOr | Pastel1 GnBu | Purples | RdBu | Pastel2 OrRd | Reds | RdGy | Set1 PuBu | | RdYlBu | Set2 PuBuGn | | RdYlGn | Set3 PuRd | | Spectral | RdPu | | | YlGn | | | YlOrBr | | | YlOrRd | | |

5.9.3 Usage

14 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

from mapboxgl.utils import * import pandas as pd

# Load data from sample csv data_url='https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/

˓→points.csv' df= pd.read_csv(data_url)

# Generate a new data domain breaks and a new color palette from colorBrewer2 color_breaks=[0,10,100,1000,10000] color_stops= create_color_stops(color_breaks, colors='YlOrRd')

5.10 rgb_tuple_from_str

Convert color represented as a string in format ‘rgb(RRR,GGG,BBB)’, ‘rgba(RRR,GGG,BBB,alpha)’, ‘#RRGGBB’ or limited English color name (eg ‘red’) to tuple of integers from 0 to 255, (RRR, GGG, BBB).

5.10.1 Params

rgb_tuple_from_str(rgb_string) Parameter | Description –|– rgb_string | color represented as string in form ‘rgb(RRR,GGG,BBB)’, ‘rgba(RRR,GGG,BBB,alpha)’, ‘#RRGGBB’, or limited HTML color names (eg ‘red’)

5.10.2 Usage

from mapboxgl.utils import rgb_tuple_from_str

# convert color string to tuple of integers rgb_tuple_from_str('rgb(255,143,17')

5.11 color_map

Convert color represented as a string in format ‘rgb(RRR,GGG,BBB)’ to tuple of integers from 0 to 255, (RRR, GGG, BBB).

5.11.1 Params

color_map(lookup, color_stops, default_color=’rgb(122,122,122)’) Parameter | Description –|– lookup | value is numeric for interpolated colors or string for categorical color stops color_stops | color ramp stops generated from create_color_stops, or custom list of numeric or categorical stops with paired colors default_color | representation of color as hex, RGB, or RGBA strings

5.10. rgb_tuple_from_str 15 mapbox-gl-js-jupyter Documentation

5.11.2 Usage from mapboxgl.utils import create_color_stops, color_map

# interpolate color for numeric color_stops color_stops= create_color_stops([0, 50, 100, 500, 1500], colors='YlOrRd') color= color_map(73, color_stops)

# categorical look up match_color_stops=[ ['Massachusetts','rgb(46,204,113)'], ['Utah','rgb(231,76,60)'], ['California','rgb(142,68,173)'], ] color= color_map('California', match_color_stops, default_color='grey)')

5.12 height_map

Return a height value (in meters) interpolated from given height_stops; for use with vector-based visualizations using fill-extrusion layers.

5.12.1 Params height_map(lookup, height_stops, default_height=10.0) Parameter | Description –|– lookup | value is numeric for interpolated heights or string for categorical height stops height_stops | height ramp stops generated from create_numeric_stops, or custom list of numeric or categorical stops with paired heights default_height | height, in meters, for display of 3-D extrusion on map

5.12.2 Usage from mapboxgl.utils import create_numeric_stops, height_map

# interpolate height height_stops= create_numeric_stops([0, 50, 100, 500, 1500],0, 150000) height= height_map(117, height_stops)

5.13 Quick start

1. Signup for a Mapbox Account. • If you already have an account, grab your access token from the account dashboard.

16 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

tokens 1. Install dependencies:pip install mapboxgl pandas jupyter • If you are using a hosted jupyter notebook environment, install libraries from Jupyter using the ! command in a cell: – !pip install mapboxgl pandas jupyter 1. Open a jupyter notebook by calling jupyter notebook from your command prompt or terminal. If your browser does not open automatically, navigate to http://localhost:8888/ in your browser window. 2. Import mapboxgl-jupyter into your notebook: • from mapboxgl.utils import * • from mapboxgl.viz import * 1. Create a visualization using the examples and documentation below. You’ll need your Mapbox token from the first step. Here is an example workbook

5.14 class MapViz

The MapViz class is the parent class of the various mapboxgl-jupyter visualizations. You can use this class to set default values for all visualizations rather than calling them directly from the other visualization objects.

5.14.1 Params

MapViz(data, vector_url=None, vector_layer_name=None, vector_join_property=None, data_join_property=None, disable_data_join=False, access_token=None, center=(0, 0), below_layer=”, opacity=1, div_id=’map’, height=’500px’, style=’mapbox://styles/mapbox/light-v9?optimize=true’, label_property=None, la- bel_size=8, label_color=’#131516’, label_halo_color=’white’, label_halo_width=1, width=’100%’, zoom=0, min_zoom=0, max_zoom=24, pitch=0, bearing=0, box_zoom_on=True, double_click_zoom_on=True, scroll_zoom_on=True, touch_zoom_on=True, legend=True, legend_layout=’vertical’, legend_function=’color’, leg- end_gradient=False, legend_style=”, legend_fill=’white’, legend_header_fill=’white’, legend_text_color=’#6e6e6e’, legend_text_numeric_precision=None, legend_title_halo_color=’white’, legend_key_shape=’square’, legend_key_borders_on=True, scale=False, scale_unit_system=’metric’, scale_position=’bottom- left’, scale_border_color=’#6e6e6e’, scale_background_color=’white’, scale_text_color=’#131516’, popup_open_action=’hover’, add_snapshot_links=False)

5.14. class MapViz 17 mapbox-gl-js-jupyter Documentation

Parameter | Description | Example –|–|– data | GeoJSON Feature Collection or JSON Join-Data | ‘points.geojson’ vector_url | optional property to define vector data source (supported for basic MapViz, CircleViz, GraduatedCircleViz, HeatmapViz, ChoroplethViz, LinestringViz) | ‘mapbox://mapbox.mapbox-terrain-v2’ vector_layer_name | property to define target layer of vector source | ‘contour’ vector_join_property | property of features in vector tile data to use as link to joined json data | ‘ele’ data_join_property | property of json data to use as link to vector features | ‘elevation’ disable_data_join | optional property to switch off default data-join technique using vector layer and JSON join- data; also determines if a layer filter based on joined data is applied to features in vector layer | False access_token | Mapbox GL JS access token. | ‘pk.abc123’ center | map center point | (-95, 40) below_layer | specify the layer under which to put current data layer | ‘waterway-label’ style | url to mapbox style or stylesheet as a Python dictionary in JSON format | ‘mapbox://styles/mapbox/light-v9?optimize=true’ div_id | The HTML div of the map container in the viz | ‘map’ width | The CSS width of the HTML div id in % or pixels. | ‘100%’ height | The CSS height of the HTML map div in % or pixels. | ‘300px’ zoom | starting zoom level for map | 3 min_zoom | min zoom level for displaying data layer on map | 0 max_zoom | max zoom level for displaying data layer on map | 24 opacity | opacity of map data layer | 0.75 pitch | starting pitch (in degrees) for map | 0 bearing | starting bearing (in degrees) for map | 0 box_zoom_on | boolean indicating if map can be zoomed to a region by dragging a bounding box | True double_click_zoom_on | boolean indicating if map can be zoomed with double-click | True scroll_zoom_on | boolean indicating if map can be zoomed with the scroll wheel | True scroll_wheel_zoom_on | boolean indicating if map can be zoomed with the scroll wheel | True touch_zoom_on | boolean indicating if map can be zoomed with two-finger touch gestures | True label_property | property to use for marker label. No labels will be shown if omitted | None label_size | size of text labels | 8 label_color | color of text labels | ‘#131516’ label_halo_color | color of text halo outline | ‘white’ label_halo_width | width (in pixels) of text halo outline | 1 legend | controls visibility of map legend | True legend_layout | controls orientation of map legend | ‘horizontal’ legend_function | controls whether legend is color or radius-based | ‘color’ legend_style | reserved for future custom CSS loading | ‘’ legend_gradient | boolean to determine appearance of legend keys; takes precedent over legend_key_shape | False legend_fill | string background color for legend | ‘white’ legend_header_fill | string background color for legend header (in vertical layout) | ‘white’ legend_text_color | string color for legend text | ‘#6e6e6e’ legend_text_numeric_precision | decimal precision for numeric legend values | 0 legend_title_halo_color | color of legend title text halo | ‘white’ legend_key_shape | shape of the legend item keys, default varies by viz type; one of square, contiguous_bar, rounded-square, circle, line | ‘square’ legend_key_borders_on | boolean for whether to show/hide legend key borders | True scale | boolean controlling visibility of map control scale bar | False scale_unit_system | choose units for scale display ( one of ‘metric’, ‘nautical’ or ‘imperial’) | ‘metric’ scale_position | location of the scale annotation | ‘bottom-left’ scale_border_color | border color of the scale annotation | ‘#eee’ scale_background_color | fill color of the scale annotation | ‘white’ scale_text_color | text color the scale annotation | ‘#6e6e6e’ popup_open_action | setting for popup behavior; one of ‘hover’ or ‘click’ | ‘hover’ add_snapshot_links | boolean switch for adding buttons to download screen captures of map or legend | False

5.14.2 Methods

as_iframe(self, html_data)Return the MapViz HTML representation in an iframe container using the srcdoc iframe attribute. show(self, **kwargs)Display the visual in an iframe result cell of a Jupyter Notebook. create_html(self )Build the HTML text representation of the visual. The output of this is a valid HTML document containing the visual object.

5.15 class VectorMixin

The VectorMixin class is a parent class of the various mapboxgl-jupyter visualizations supporting vector source data that provides methods for developing the vector color, weight, height, line-width or intensity mapping for use with the data-join technique. CircleViz, GraduatedCircleViz, HeatmapViz, ChoroplethViz, and LinestringViz support using a vector data source.

18 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

5.15.1 Methods generate_vector_color_map(self )Generate color stops array for use with match expression in mapbox template. generate_vector_numeric_map(self, numeric_property)Generate stops array for use with match expression in map- box template. check_vector_template(self )Determines if features are defined as vector source based on MapViz arguments.

5.16 class CircleViz

The CircleViz class handles the creation of a circle map and is built on top of the MapViz class.

5.16.1 Params

CircleViz(data, radius=1, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, stroke_color=’grey’, stroke_width=0.1, *args, **kwargs) Parameter | Description –|– data | name of GeoJson file or object or JSON join-data color_property | property to determine circle color color_stops | property to determine circle color color_default | color of circle to use if no lookup value matches the property value. Only used for the match color_function_type. color_function_type | property to determine type used by Mapbox to assign color. One of ‘interpolate’ or ‘match’. Default is interpolate stroke_color | color of circle outline stroke stroke_width | width (in pixels) of circle outline stroke View options

5.16.2 Usage import pandas as pd import os from mapboxgl.utils import * from mapboxgl.viz import *

# Load data from sample csv data_url='https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/

˓→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 Feature Collection export from a Pandas dataframe points= df_to_geojson(df, 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, access_token=token, (continues on next page)

5.16. class CircleViz 19 mapbox-gl-js-jupyter Documentation

(continued from previous page) height='400px', color_property='Avg Medicare Payments', color_stops=color_stops, label_property='Avg Medicare Payments', stroke_color='black', center=(-95, 40), zoom=3, below_layer='waterway-label') viz.show()

CircleViz

5.17 class ClusteredCircleViz

The ClusteredCircleViz object handles the creation of a clustered circle map and is built on top of the MapViz class. Cluster radius and color are keyed on point density. Vector data source is not supported for ClusteredCircleViz.

5.17.1 Params

ClusteredCircleViz(data, color_stops=None, radius_stops=None, cluster_radius=30, cluster_maxzoom=14, ra- dius_default=2, color_default=’black’, stroke_color=’grey’, stroke_width=0.1, *args, **kwargs) Parameter | Description –|– data | name of GeoJson file or object color_stops | property to determine circle color radius_stops | property to determine circle radius cluster_radius | property to determine radius of each cluster when clustering points cluster_maxzoom | property to determine the max zoom to use for clustering points radius_default | Radius of points not contained in a cluster color_default | Color of points not contained in a cluster stroke_color | Color of stroke outline on circles stroke_width | Width of stroke outline on circles View options

5.17.2 Usage

20 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

import pandas as pd import os from mapboxgl.utils import * from mapboxgl.viz import *

# Load data from sample csv data_url='https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/

˓→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 Feature Collection export from a Pandas dataframe points= df_to_geojson(df, properties=['Avg Medicare Payments','Avg Covered Charges',

˓→'date'], lat='lat', lon='lon', precision=3)

#Create a clustered circle map color_stops= create_color_stops([1,10,50,100], colors='BrBG') viz= ClusteredCircleViz(points, access_token=token, color_stops=color_stops, radius_stops=[[1,5], [10, 10], [50, 15], [100, 20]], radius_default=2, cluster_maxzoom=10, cluster_radius=30, label_size=12, opacity=0.9, center=(-95, 40), zoom=3) viz.show()

ClusteredCircleViz

5.17. class ClusteredCircleViz 21 mapbox-gl-js-jupyter Documentation

5.18 class GraduatedCircleViz

The GraduatedCircleViz object handles the creation of a graduated map and is built on top of the MapViz class.

5.18.1 Params

GraduatedCircleViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, stroke_color=’grey’, stroke_width=0.1, radius_property=None, ra- dius_stops=None, radius_default=2, radius_function_type=’interpolate’, *args, **kwargs) Parameter | Description –|– data | name of GeoJson file or object or JSON join-data color_property | property to determine circle color. color_stops | property to determine circle color. color_default | color of the circle to use if no lookup value matches the property value. Only used for the match color_function_type. color_function_type | property to determine type used by Mapbox to assign color. One of “interpolate” or “match”. Default is in- terpolate. radius_property | property to determine circle radius. radius_stops | property to determine circle radius. radius_default | radius of the circle to use if no lookup value matches the property value. Only used for the match radius_function_type. radius_function_type | property to determine type used by Mapbox to assign radius size. One of “interpolate” or “match”. Default is interpolate. stroke_color | Color of stroke outline on circles stroke_width | Width of stroke outline on circles View options

5.18.2 Usage import pandas as pd import os from mapboxgl.utils import * from mapboxgl.viz import *

# Load data from sample csv data_url='https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/

˓→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 Feature Collection export from a Pandas dataframe points= df_to_geojson(df, properties=['Avg Medicare Payments','Avg Covered Charges',

˓→'date'], lat='lat', lon='lon', precision=3)

# Generate color stops from colorBrewer measure_color='Avg Covered Charges' color_breaks=[round(df[measure_color].quantile(q=x *0.1),2) for x in range(2, 10)] color_stops= create_color_stops(color_breaks, colors='Blues')

# Generate radius breaks from data domain and circle-radius range measure_radius='Avg Medicare Payments' radius_breaks=[round(df[measure_radius].quantile(q=x *0.1),2) for x in range(2,10)] radius_stops= create_radius_stops(radius_breaks, 0.5, 10)

(continues on next page)

22 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

(continued from previous page) # Create the viz viz= GraduatedCircleViz(points, access_token=token, color_property='Avg Covered Charges', color_stops=color_stops, radius_property='Avg Medicare Payments', stroke_color='black', stroke_width=0.5, radius_stops=radius_stops, center=(-95, 40), zoom=3, below_layer='waterway-label') viz.show()

GraduatedCircleViz

5.19 class HeatmapViz

The HeatmapViz object handles the creation of a heat map and is built on top of the MapViz class.

5.19.1 Params

HeatmapViz(data, weight_property=None, weight_stops=None, color_stops=None, radius_stops=None, inten- sity_stops=None, legend=False, *args, **kwargs) Parameter | Description | Example –|–|– data | name of GeoJson file or object or JSON join-data weight_property | property to determine heatmap weight. | “population” weight_stops | stops to determine heatmap weight. | [[10, 0], [100, 1]] color_stops | stops to determine heatmap color. | [[0, “red”], [0.5, “blue”], [1, “green”]] radius_stops | stops to determine heatmap radius based on zoom. | [[0, 1], [12, 30]] intensity_stops | stops to determine the heatmap intensity based on zoom. | [[0, 0.1], [20, 5]] legend | defaults to no legend for HeatmapViz | False View options

5.19. class HeatmapViz 23 mapbox-gl-js-jupyter Documentation

5.19.2 Usage import pandas as pd import os from mapboxgl.utils import * from mapboxgl.viz import *

# Load data from sample csv data_url='https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/

˓→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 Feature Collection export from a Pandas dataframe points= df_to_geojson(df, properties=['Avg Medicare Payments','Avg Covered Charges',

˓→'date'], lat='lat', lon='lon', precision=3)

#Create a heatmap heatmap_color_stops= create_color_stops([0.01,0.25,0.5,0.75,1], colors='RdPu') heatmap_radius_stops=[[0,1], [15, 40]] #increase radius with zoom color_breaks=[0,10,100,1000,10000] color_stops= create_color_stops(color_breaks, colors='Spectral') heatmap_weight_stops= create_weight_stops(color_breaks)

#Create a heatmap viz= HeatmapViz(points, access_token=token, weight_property='Avg Medicare Payments', weight_stops=heatmap_weight_stops, color_stops=heatmap_color_stops, radius_stops=heatmap_radius_stops, opacity=0.9, center=(-95, 40), zoom=3, below_layer='waterway-label') viz.show()

24 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

HeatmapViz

5.20 class ChoroplethViz

The ChoroplethViz object handles the creation of a choropleth map and inherits from the MapViz class. It applies a thematic map style to polygon features with color shading in proportion to the intensity of the data being displayed. Choropleth polygons can be initialized with geojson source or vector source styled using the data-join technique.

5.20.1 Params

ChoroplethViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, line_color=’white’, line_stroke=’solid’, line_width=1, line_opacity=1, height_property=None, height_stops=None, height_default=0.0, height_function_type=’interpolate’, *args, **kwargs) Parameter | Description | Example –|–|– data | can be either GeoJSON (containing polygon features) or JSON for data-join technique with vector polygons | ‘us-states.geojson’ label_property | property to use for marker label | ‘density’ color_property | property to determine fill color | ‘density’ color_stops | property to determine fill color | [[0, ‘red’], [0.5, ‘blue’], [1, ‘green’]] color_default | property to determine default fill color in match lookups | ‘#F0F0F0’ color_function_type | property to determine type of expression used by Mapbox to assign color | ‘interpo- late’ line_color | property to determine choropleth border line color | ‘#FFFFFF’ line_stroke | property to determine choropleth border line stroke (one of solid (-), dashed (–), dotted (:), dash dot (-.)) | ‘solid’ or ‘-’ line_width | prop- erty to determine choropleth border line width | 1 line_opacity | opacity of choropleth line layer | 1 height_property | feature property for determining polygon height in 3D extruded choropleth map | ‘density’ height_stops | property for determining 3D extrusion height | [[0, 0], [500, 50000], [1500, 150000]] height_default | default height (in meters) for 3D extruded polygons on map | 1500.0 height_function_type | property to determine type used by Mapbox to assign height | ‘interpolate’ View options

5.20. class ChoroplethViz 25 mapbox-gl-js-jupyter Documentation

5.20.2 Usage import os from mapboxgl.viz import * from mapboxgl.utils import *

# Must be a public token, starting with `pk` token= os.getenv('MAPBOX_ACCESS_TOKEN')

# Create Choropleth with GeoJSON Source viz= ChoroplethViz('https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/

˓→examples/data/us-states.geojson', color_property='density', color_stops=create_color_stops([0, 50, 100, 500, 1500], colors=

˓→'YlOrRd'), color_function_type='interpolate', line_stroke='--', line_color='rgb(128,0,38)', line_width=1, line_opacity=0.9, opacity=0.8, center=(-96, 37.8), zoom=3, below_layer='waterway-label') viz.show()

ChoroplethViz Complete example

5.21 class ImageViz

The ImageViz object handles the creation of a simple image visualization on map and is built on top of the MapViz class.

26 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

5.21.1 Params

ImageViz(image, coordinates, legend=False, *args, **kwargs_) Parameter | Description | Example –|–|– image | image url, path or numpy ndarray | ‘./my_image.png’ coordinates | property to image coordinates (UL, UR, LR, LL) | [[-80.425, 46.437], [-71.516, 46.437], [-71.516, 37.936], [-80.425, 37.936]] legend | no legend for ImageViz | False MapViz options

5.21.2 Usage from mapboxgl.viz import ImageViz img_url='https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/

˓→mosaic.jpg'

# Coordinates must be an array in the form of [UL, UR, LR, LL] coordinates=[[-123.40515640309, 38.534294809274336], [-115.92938988349292, 38.534294809274336], [-115.92938988349292, 32.08296982365502], [-123.40515640309, 32.08296982365502]]

# Create the viz viz= ImageViz(img_url, coordinates, access_token=token, height='600px', center=(-119, 35), zoom=5, below_layer='waterway-label') viz.show()

ImageViz

5.21. class ImageViz 27 mapbox-gl-js-jupyter Documentation

Complete example

5.22 class RasterTilesViz

The RasterTilesViz object handles the creation of a simple raster tiles visualization on map and is built on top of the MapViz class.

5.22.1 Params

RasterTilesViz(tiles_url, legend=False, *args, **kwargs) Parameter | Description | Example –|–|– tiles_url | tiles endpoint | ‘https://a.tile.openstreetmap.org/{z}/{x}/{y}.png’ tiles_size | mapbox-gl tiles size | 256 tiles_bounds | tiles endpoint bounds | [124.97480681619507, 10.876763902260592, 124.99391704636035, 10.888369402219947] tiles_minzoom | tiles endpoint min zoom | 0 tiles_maxzoom | tiles endpoint max zoom | 22 legend | no legend for RasterTilesViz | False MapViz options

5.22.2 Usage from mapboxgl.viz import RasterTilesViz tiles_url='https://cogeo.remotepixel.ca/tiles/ {z}/{x}/{y}.jpg?tile=256&nodata=0&

˓→url=http://oin-hotosm.s3.amazonaws.com/594ab0ba1b114600111194a3/0/d66720c4-148c-

˓→4e11-9d54-4ae2a6ba6351.tif'

# Define the tile endpoint bounds tiles_bounds=[124.97480681619507, 10.876763902260592, 124.99391704636035, 10.

˓→888369402219947] tiles_center=[124.9843619312777, 10.88256665224027] viz= RasterTilesViz(tiles_url, tiles_size=256, tiles_bounds=tiles_bounds, height='500px', center=tiles_center, tiles_minzoom=13, tiles_maxzoom=18, zoom=16) viz.show()

28 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

RasterTilesViz Complete example

Bring your own raster

Using rio-glui python module, you can create a local tiles server to explore your own file. Note: Your raster file has to be a cloud optimized geotiff (see cogeo.org or rio-cogeo). from rio_glui.server import TileServer from rio_glui.raster import RasterTiles from mapboxgl.viz import RasterTilesViz file='myfile.tif'

# Create raster tile object # More info: https://github.com/mapbox/rio-glui/blob/master/rio_glui/raster.py#L16-L44 raster= RasterTiles(file, indexes=(2,1,3))

# Create local tile server # More info: https://github.com/mapbox/rio-glui/blob/master/rio_glui/server.py#L21-L56 ts= TileServer(raster)

# Start tile server ts.start()

# Initialize RasterTiles Viz by passing our local tile server url `ts.get_tiles_url` viz= RasterTilesViz(ts.get_tiles_url(), tiles_bounds=ts.get_bounds(), center=ts.get_center(), height='1000px', zoom=13) viz.show()

5.22. class RasterTilesViz 29 mapbox-gl-js-jupyter Documentation

5.23 class LinestringViz

The LinestringViz object handles the creation of a vector or GeoJSON-based Linestring visualization and inherits from the MapViz class.

5.23.1 Params

LinestringViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, line_stroke=’solid’, line_width_property=None, line_width_stops=None, line_width_default=1, line_width_function_type=’interpolate’, *args, **kwargs) Parameter | Description | Example –|–|– data | can be either GeoJSON (containing polygon features) or JSON for data-join technique with vector polygons | color_property | property to determine line color | ‘elevation’ color_stops | property to determine line color | [[0, ‘red’], [0.5, ‘blue’], [1, ‘green’]] color_default | property to determine default line color if match lookup fails | ‘#F0F0F0’ color_function_type | property to determine type of expression used by Mapbox to assign color | ‘interpolate’ line_stroke | property to determine line stroke (one of solid (-), dashed (–), dotted (:), dash dot (-.)) | ‘solid’ or ‘-’ line_width_property | feature property for determining line width | ‘elevation’ line_width_stops | property to determine line width | [[0, 1], [50000, 2], [150000, 3]] line_width_default | property to determine default line width if match lookup fails | 1.0 line_width_function_type | property to determine type used by Mapbox to assign line width | ‘interpolate’ MapViz options

5.23.2 Usage import random import os from mapboxgl.viz import LinestringViz from mapboxgl.utils import create_color_stops

# Must be a public token, starting with `pk` token= os.getenv('MAPBOX_ACCESS_TOKEN')

# JSON join-data object data=[{"elevation": x,"weight": random.randint(0,100)} for x in range(0, 21000,

˓→10)] viz= LinestringViz(data, vector_url='mapbox://mapbox.mapbox-terrain-v2', vector_layer_name='contour', vector_join_property='ele', data_join_property='elevation', color_property='elevation', color_stops=create_color_stops([0, 25, 50, 75, 100], colors=

˓→'YlOrRd'), line_stroke='-', line_width_default=2, opacity=0.8, center=(-122.48, 37.83), zoom=16, below_layer='waterway-label') viz.show()

30 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

LinestringViz Complete example

5.24 mapboxgl package

5.24.1 Submodules

5.24.2 mapboxgl.colors module

5.24.3 mapboxgl.errors module exception mapboxgl.errors.DateConversionError Bases: mapboxgl.errors.ValueError exception mapboxgl.errors.LegendError Bases: mapboxgl.errors.ValueError exception mapboxgl.errors.SourceDataError Bases: mapboxgl.errors.ValueError exception mapboxgl.errors.TokenError Bases: ValueError exception mapboxgl.errors.ValueError Bases: ValueError

5.24. mapboxgl package 31 mapbox-gl-js-jupyter Documentation

5.24.4 mapboxgl.templates module

mapboxgl.templates.format(viz, **kwargs)

5.24.5 mapboxgl.utils module mapboxgl.utils.color_map(lookup, color_stops, default_color=’rgb(122, 122, 122)’) Return an rgb color value interpolated from given color_stops; assumes colors in color_stops provided as strings of form ‘rgb(RRR,GGG,BBB)’ or in hex: ‘#RRGGBB’ mapboxgl.utils.convert_date_columns(df, date_format=’epoch’) Convert dates/datetimes to preferred string format if specified i.e. ‘%Y-%m-%d’, ‘epoch’, ‘iso’

32 Chapter 5. Release process mapbox-gl-js-jupyter Documentation mapboxgl.utils.create_color_stops(breaks, colors=’RdYlGn’, color_ramps={’Accent’: {3: [’rgb(127,201,127)’, ’rgb(190,174,212)’, ’rgb(253,192,134)’], 4: [’rgb(127,201,127)’, ’rgb(190,174,212)’, ’rgb(253,192,134)’, ’rgb(255,255,153)’], 5: [’rgb(127,201,127)’, ’rgb(190,174,212)’, ’rgb(253,192,134)’, ’rgb(255,255,153)’, ’rgb(56,108,176)’], 6: [’rgb(127,201,127)’, ’rgb(190,174,212)’, ’rgb(253,192,134)’, ’rgb(255,255,153)’, ’rgb(56,108,176)’, ’rgb(240,2,127)’], 7: [’rgb(127,201,127)’, ’rgb(190,174,212)’, ’rgb(253,192,134)’, ’rgb(255,255,153)’, ’rgb(56,108,176)’, ’rgb(240,2,127)’, ’rgb(191,91,23)’], 8: [’rgb(127,201,127)’, ’rgb(190,174,212)’, ’rgb(253,192,134)’, ’rgb(255,255,153)’, ’rgb(56,108,176)’, ’rgb(240,2,127)’, ’rgb(191,91,23)’, ’rgb(102,102,102)’]}, ’Blues’: {3: [’rgb(222,235,247)’, ’rgb(158,202,225)’, ’rgb(49,130,189)’], 4: [’rgb(239,243,255)’, ’rgb(189,215,231)’, ’rgb(107,174,214)’, ’rgb(33,113,181)’], 5: [’rgb(239,243,255)’, ’rgb(189,215,231)’, ’rgb(107,174,214)’, ’rgb(49,130,189)’, ’rgb(8,81,156)’], 6: [’rgb(239,243,255)’, ’rgb(198,219,239)’, ’rgb(158,202,225)’, ’rgb(107,174,214)’, ’rgb(49,130,189)’, ’rgb(8,81,156)’], 7: [’rgb(239,243,255)’, ’rgb(198,219,239)’, ’rgb(158,202,225)’, ’rgb(107,174,214)’, ’rgb(66,146,198)’, ’rgb(33,113,181)’, ’rgb(8,69,148)’], 8: [’rgb(247,251,255)’, ’rgb(222,235,247)’, ’rgb(198,219,239)’, ’rgb(158,202,225)’, ’rgb(107,174,214)’, ’rgb(66,146,198)’, ’rgb(33,113,181)’, ’rgb(8,69,148)’], 9: [’rgb(247,251,255)’, ’rgb(222,235,247)’, ’rgb(198,219,239)’, ’rgb(158,202,225)’, ’rgb(107,174,214)’, ’rgb(66,146,198)’, ’rgb(33,113,181)’, ’rgb(8,81,156)’, ’rgb(8,48,107)’]}, ’BrBG’: {3: [’rgb(216,179,101)’, ’rgb(245,245,245)’, ’rgb(90,180,172)’], 4: [’rgb(166,97,26)’, ’rgb(223,194,125)’, ’rgb(128,205,193)’, ’rgb(1,133,113)’], 5: [’rgb(166,97,26)’, ’rgb(223,194,125)’, ’rgb(245,245,245)’, ’rgb(128,205,193)’, ’rgb(1,133,113)’], 6: [’rgb(140,81,10)’, ’rgb(216,179,101)’, ’rgb(246,232,195)’, ’rgb(199,234,229)’, ’rgb(90,180,172)’, ’rgb(1,102,94)’], 7: [’rgb(140,81,10)’, ’rgb(216,179,101)’, ’rgb(246,232,195)’, ’rgb(245,245,245)’, ’rgb(199,234,229)’, ’rgb(90,180,172)’, ’rgb(1,102,94)’], 8: [’rgb(140,81,10)’, ’rgb(191,129,45)’, ’rgb(223,194,125)’, ’rgb(246,232,195)’, ’rgb(199,234,229)’, ’rgb(128,205,193)’, ’rgb(53,151,143)’, ’rgb(1,102,94)’], 9: [’rgb(140,81,10)’, ’rgb(191,129,45)’, ’rgb(223,194,125)’, ’rgb(246,232,195)’, ’rgb(245,245,245)’, ’rgb(199,234,229)’, ’rgb(128,205,193)’, ’rgb(53,151,143)’, ’rgb(1,102,94)’], 10: [’rgb(84,48,5)’, ’rgb(140,81,10)’, ’rgb(191,129,45)’, ’rgb(223,194,125)’, ’rgb(246,232,195)’, ’rgb(199,234,229)’, ’rgb(128,205,193)’, ’rgb(53,151,143)’, ’rgb(1,102,94)’, ’rgb(0,60,48)’], 11: [’rgb(84,48,5)’, ’rgb(140,81,10)’, ’rgb(191,129,45)’, ’rgb(223,194,125)’, ’rgb(246,232,195)’, ’rgb(245,245,245)’, ’rgb(199,234,229)’, ’rgb(128,205,193)’, ’rgb(53,151,143)’, 5.24. mapboxgl package ’rgb(1,102,94)’, ’rgb(0,60,48)’]}, ’BuGn’: 33 {3: [’rgb(229,245,249)’, ’rgb(153,216,201)’, ’rgb(44,162,95)’], 4: [’rgb(237,248,251)’, ’rgb(178,226,226)’, ’rgb(102,194,164)’, ’rgb(35,139,69)’], 5: [’rgb(237,248,251)’, ’rgb(178,226,226)’, ’rgb(102,194,164)’, ’rgb(44,162,95)’, ’rgb(0,109,44)’], 6: [’rgb(237,248,251)’, ’rgb(204,236,230)’, ’rgb(153,216,201)’, ’rgb(102,194,164)’, ’rgb(44,162,95)’, ’rgb(0,109,44)’], 7: [’rgb(237,248,251)’, ’rgb(204,236,230)’, ’rgb(153,216,201)’, ’rgb(102,194,164)’, ’rgb(65,174,118)’, ’rgb(35,139,69)’, ’rgb(0,88,36)’], 8: [’rgb(247,252,253)’, ’rgb(229,245,249)’, ’rgb(204,236,230)’, ’rgb(153,216,201)’, ’rgb(102,194,164)’, ’rgb(65,174,118)’, ’rgb(35,139,69)’, ’rgb(0,88,36)’], 9: [’rgb(247,252,253)’, ’rgb(229,245,249)’, ’rgb(204,236,230)’, ’rgb(153,216,201)’, ’rgb(102,194,164)’, ’rgb(65,174,118)’, ’rgb(35,139,69)’, ’rgb(0,109,44)’, ’rgb(0,68,27)’]}, ’BuPu’: {3: [’rgb(224,236,244)’, ’rgb(158,188,218)’, ’rgb(136,86,167)’], 4: [’rgb(237,248,251)’, ’rgb(179,205,227)’, ’rgb(140,150,198)’, ’rgb(136,65,157)’], 5: [’rgb(237,248,251)’, ’rgb(179,205,227)’, ’rgb(140,150,198)’, ’rgb(136,86,167)’, ’rgb(129,15,124)’], 6: [’rgb(237,248,251)’, ’rgb(191,211,230)’, ’rgb(158,188,218)’, ’rgb(140,150,198)’, ’rgb(136,86,167)’, ’rgb(129,15,124)’], 7: [’rgb(237,248,251)’, ’rgb(191,211,230)’, ’rgb(158,188,218)’, ’rgb(140,150,198)’, ’rgb(140,107,177)’, ’rgb(136,65,157)’, ’rgb(110,1,107)’], 8: [’rgb(247,252,253)’, ’rgb(224,236,244)’, ’rgb(191,211,230)’, ’rgb(158,188,218)’, ’rgb(140,150,198)’, ’rgb(140,107,177)’, ’rgb(136,65,157)’, ’rgb(110,1,107)’], 9: [’rgb(247,252,253)’, ’rgb(224,236,244)’, ’rgb(191,211,230)’, ’rgb(158,188,218)’, ’rgb(140,150,198)’, ’rgb(140,107,177)’, ’rgb(136,65,157)’, ’rgb(129,15,124)’, ’rgb(77,0,75)’]}, ’Dark2’: {3: [’rgb(27,158,119)’, ’rgb(217,95,2)’, ’rgb(117,112,179)’], 4: [’rgb(27,158,119)’, ’rgb(217,95,2)’, ’rgb(117,112,179)’, ’rgb(231,41,138)’], 5: [’rgb(27,158,119)’, ’rgb(217,95,2)’, ’rgb(117,112,179)’, ’rgb(231,41,138)’, ’rgb(102,166,30)’], 6: [’rgb(27,158,119)’, ’rgb(217,95,2)’, ’rgb(117,112,179)’, ’rgb(231,41,138)’, ’rgb(102,166,30)’, ’rgb(230,171,2)’], 7: [’rgb(27,158,119)’, ’rgb(217,95,2)’, ’rgb(117,112,179)’, ’rgb(231,41,138)’, ’rgb(102,166,30)’, ’rgb(230,171,2)’, ’rgb(166,118,29)’], 8: [’rgb(27,158,119)’, ’rgb(217,95,2)’, ’rgb(117,112,179)’, ’rgb(231,41,138)’, ’rgb(102,166,30)’, ’rgb(230,171,2)’, ’rgb(166,118,29)’, ’rgb(102,102,102)’]}, ’GnBu’: {3: [’rgb(224,243,219)’, ’rgb(168,221,181)’, ’rgb(67,162,202)’], 4: [’rgb(240,249,232)’, ’rgb(186,228,188)’, ’rgb(123,204,196)’, ’rgb(43,140,190)’], 5: [’rgb(240,249,232)’, ’rgb(186,228,188)’, ’rgb(123,204,196)’, ’rgb(67,162,202)’, ’rgb(8,104,172)’], 6: [’rgb(240,249,232)’, ’rgb(204,235,197)’, ’rgb(168,221,181)’, ’rgb(123,204,196)’, ’rgb(67,162,202)’, ’rgb(8,104,172)’], 7: [’rgb(240,249,232)’, ’rgb(204,235,197)’, ’rgb(168,221,181)’, ’rgb(123,204,196)’, ’rgb(78,179,211)’, ’rgb(43,140,190)’, ’rgb(8,88,158)’], 8: [’rgb(247,252,240)’, ’rgb(224,243,219)’, ’rgb(204,235,197)’, ’rgb(168,221,181)’, ’rgb(123,204,196)’, ’rgb(78,179,211)’, ’rgb(43,140,190)’, ’rgb(8,88,158)’], 9: [’rgb(247,252,240)’, ’rgb(224,243,219)’, ’rgb(204,235,197)’, ’rgb(168,221,181)’, ’rgb(123,204,196)’, ’rgb(78,179,211)’, ’rgb(43,140,190)’, ’rgb(8,104,172)’, ’rgb(8,64,129)’]}, ’Greens’: {3: [’rgb(229,245,224)’, ’rgb(161,217,155)’, ’rgb(49,163,84)’], 4: [’rgb(237,248,233)’, ’rgb(186,228,179)’, ’rgb(116,196,118)’, ’rgb(35,139,69)’], 5: [’rgb(237,248,233)’, ’rgb(186,228,179)’, ’rgb(116,196,118)’, ’rgb(49,163,84)’, ’rgb(0,109,44)’], 6: [’rgb(237,248,233)’, ’rgb(199,233,192)’, ’rgb(161,217,155)’, ’rgb(116,196,118)’, ’rgb(49,163,84)’, ’rgb(0,109,44)’], 7: [’rgb(237,248,233)’, ’rgb(199,233,192)’, ’rgb(161,217,155)’, ’rgb(116,196,118)’, ’rgb(65,171,93)’, ’rgb(35,139,69)’, ’rgb(0,90,50)’], 8: [’rgb(247,252,245)’, ’rgb(229,245,224)’, ’rgb(199,233,192)’, ’rgb(161,217,155)’, ’rgb(116,196,118)’, ’rgb(65,171,93)’, ’rgb(35,139,69)’, ’rgb(0,90,50)’], 9: [’rgb(247,252,245)’, ’rgb(229,245,224)’, ’rgb(199,233,192)’, ’rgb(161,217,155)’, ’rgb(116,196,118)’, ’rgb(65,171,93)’, ’rgb(35,139,69)’, ’rgb(0,109,44)’, ’rgb(0,68,27)’]}, ’Greys’: {3: [’rgb(240,240,240)’, ’rgb(189,189,189)’, ’rgb(99,99,99)’], 4: [’rgb(247,247,247)’, ’rgb(204,204,204)’, ’rgb(150,150,150)’, ’rgb(82,82,82)’], 5: [’rgb(247,247,247)’, ’rgb(204,204,204)’, ’rgb(150,150,150)’, ’rgb(99,99,99)’, ’rgb(37,37,37)’], 6: [’rgb(247,247,247)’, ’rgb(217,217,217)’, ’rgb(189,189,189)’, ’rgb(150,150,150)’, ’rgb(99,99,99)’, ’rgb(37,37,37)’], 7: [’rgb(247,247,247)’, ’rgb(217,217,217)’, ’rgb(189,189,189)’, ’rgb(150,150,150)’, ’rgb(115,115,115)’, ’rgb(82,82,82)’, ’rgb(37,37,37)’], 8: [’rgb(255,255,255)’, ’rgb(240,240,240)’, ’rgb(217,217,217)’, ’rgb(189,189,189)’, ’rgb(150,150,150)’, ’rgb(115,115,115)’, ’rgb(82,82,82)’, ’rgb(37,37,37)’], 9: [’rgb(255,255,255)’, ’rgb(240,240,240)’, ’rgb(217,217,217)’, ’rgb(189,189,189)’, ’rgb(150,150,150)’, ’rgb(115,115,115)’, ’rgb(82,82,82)’, ’rgb(37,37,37)’, ’rgb(0,0,0)’]}, ’OrRd’: {3: [’rgb(254,232,200)’, ’rgb(253,187,132)’, ’rgb(227,74,51)’], 4: [’rgb(254,240,217)’, ’rgb(253,204,138)’, ’rgb(252,141,89)’, ’rgb(215,48,31)’], 5: [’rgb(254,240,217)’, ’rgb(253,204,138)’, ’rgb(252,141,89)’, ’rgb(227,74,51)’, ’rgb(179,0,0)’], 6: [’rgb(254,240,217)’, ’rgb(253,212,158)’, ’rgb(253,187,132)’, ’rgb(252,141,89)’, ’rgb(227,74,51)’, ’rgb(179,0,0)’], 7: [’rgb(254,240,217)’, ’rgb(253,212,158)’, ’rgb(253,187,132)’, ’rgb(252,141,89)’, ’rgb(239,101,72)’, ’rgb(215,48,31)’, ’rgb(153,0,0)’], 8: [’rgb(255,247,236)’, ’rgb(254,232,200)’, ’rgb(253,212,158)’, ’rgb(253,187,132)’, ’rgb(252,141,89)’, ’rgb(239,101,72)’, ’rgb(215,48,31)’, ’rgb(153,0,0)’], 9: [’rgb(255,247,236)’, ’rgb(254,232,200)’, ’rgb(253,212,158)’, ’rgb(253,187,132)’, ’rgb(252,141,89)’, ’rgb(239,101,72)’, ’rgb(215,48,31)’, ’rgb(179,0,0)’, ’rgb(127,0,0)’]}, ’Oranges’: {3: [’rgb(254,230,206)’, ’rgb(253,174,107)’, ’rgb(230,85,13)’], 4: [’rgb(254,237,222)’, ’rgb(253,190,133)’, ’rgb(253,141,60)’, ’rgb(217,71,1)’], 5: [’rgb(254,237,222)’, ’rgb(253,190,133)’, ’rgb(253,141,60)’, ’rgb(230,85,13)’, ’rgb(166,54,3)’], 6: [’rgb(254,237,222)’, ’rgb(253,208,162)’, ’rgb(253,174,107)’, ’rgb(253,141,60)’, ’rgb(230,85,13)’, ’rgb(166,54,3)’], 7: [’rgb(254,237,222)’, ’rgb(253,208,162)’, ’rgb(253,174,107)’, ’rgb(253,141,60)’, ’rgb(241,105,19)’, ’rgb(217,72,1)’, ’rgb(140,45,4)’], 8: [’rgb(255,245,235)’, ’rgb(254,230,206)’, ’rgb(253,208,162)’, ’rgb(253,174,107)’, ’rgb(253,141,60)’, ’rgb(241,105,19)’, ’rgb(217,72,1)’, ’rgb(140,45,4)’], 9: [’rgb(255,245,235)’, ’rgb(254,230,206)’, ’rgb(253,208,162)’, ’rgb(253,174,107)’, ’rgb(253,141,60)’, ’rgb(241,105,19)’, ’rgb(217,72,1)’, ’rgb(166,54,3)’, ’rgb(127,39,4)’]}, ’PRGn’: {3: [’rgb(175,141,195)’, ’rgb(247,247,247)’, ’rgb(127,191,123)’], 4: [’rgb(123,50,148)’, ’rgb(194,165,207)’, ’rgb(166,219,160)’, ’rgb(0,136,55)’], 5: [’rgb(123,50,148)’, ’rgb(194,165,207)’, ’rgb(247,247,247)’, ’rgb(166,219,160)’, ’rgb(0,136,55)’], 6: [’rgb(118,42,131)’, ’rgb(175,141,195)’, ’rgb(231,212,232)’, ’rgb(217,240,211)’, ’rgb(127,191,123)’, ’rgb(27,120,55)’], 7: [’rgb(118,42,131)’, ’rgb(175,141,195)’, ’rgb(231,212,232)’, ’rgb(247,247,247)’, ’rgb(217,240,211)’, ’rgb(127,191,123)’, ’rgb(27,120,55)’], 8: [’rgb(118,42,131)’, ’rgb(153,112,171)’, ’rgb(194,165,207)’, ’rgb(231,212,232)’, ’rgb(217,240,211)’, ’rgb(166,219,160)’, ’rgb(90,174,97)’, ’rgb(27,120,55)’], 9: [’rgb(118,42,131)’, ’rgb(153,112,171)’, ’rgb(194,165,207)’, ’rgb(231,212,232)’, ’rgb(247,247,247)’, ’rgb(217,240,211)’, ’rgb(166,219,160)’, ’rgb(90,174,97)’, ’rgb(27,120,55)’], 10: [’rgb(64,0,75)’, ’rgb(118,42,131)’, ’rgb(153,112,171)’, ’rgb(194,165,207)’, ’rgb(231,212,232)’, ’rgb(217,240,211)’, ’rgb(166,219,160)’, ’rgb(90,174,97)’, ’rgb(27,120,55)’, ’rgb(0,68,27)’], 11: [’rgb(64,0,75)’, ’rgb(118,42,131)’, ’rgb(153,112,171)’, ’rgb(194,165,207)’, ’rgb(231,212,232)’, ’rgb(247,247,247)’, ’rgb(217,240,211)’, ’rgb(166,219,160)’, ’rgb(90,174,97)’, ’rgb(27,120,55)’, ’rgb(0,68,27)’]}, ’Paired’: {3: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’], 4: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’], 5: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’], 6: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’, ’rgb(227,26,28)’], 7: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’, ’rgb(227,26,28)’, ’rgb(253,191,111)’], 8: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’, ’rgb(227,26,28)’, ’rgb(253,191,111)’, ’rgb(255,127,0)’], 9: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’, ’rgb(227,26,28)’, ’rgb(253,191,111)’, ’rgb(255,127,0)’, ’rgb(202,178,214)’], 10: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’, ’rgb(227,26,28)’, ’rgb(253,191,111)’, ’rgb(255,127,0)’, ’rgb(202,178,214)’, ’rgb(106,61,154)’], 11: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’, ’rgb(227,26,28)’, ’rgb(253,191,111)’, ’rgb(255,127,0)’, ’rgb(202,178,214)’, ’rgb(106,61,154)’, ’rgb(255,255,153)’], 12: [’rgb(166,206,227)’, ’rgb(31,120,180)’, ’rgb(178,223,138)’, ’rgb(51,160,44)’, ’rgb(251,154,153)’, ’rgb(227,26,28)’, ’rgb(253,191,111)’, ’rgb(255,127,0)’, ’rgb(202,178,214)’, ’rgb(106,61,154)’, ’rgb(255,255,153)’, ’rgb(177,89,40)’]}, ’Pastel1’: {3: [’rgb(251,180,174)’, ’rgb(179,205,227)’, ’rgb(204,235,197)’], 4: [’rgb(251,180,174)’, ’rgb(179,205,227)’, ’rgb(204,235,197)’, ’rgb(222,203,228)’], 5: [’rgb(251,180,174)’, ’rgb(179,205,227)’, ’rgb(204,235,197)’, ’rgb(222,203,228)’, ’rgb(254,217,166)’], 6: [’rgb(251,180,174)’, ’rgb(179,205,227)’, ’rgb(204,235,197)’, ’rgb(222,203,228)’, ’rgb(254,217,166)’, ’rgb(255,255,204)’], 7: [’rgb(251,180,174)’, ’rgb(179,205,227)’, ’rgb(204,235,197)’, ’rgb(222,203,228)’, ’rgb(254,217,166)’, ’rgb(255,255,204)’, ’rgb(229,216,189)’], 8: [’rgb(251,180,174)’, ’rgb(179,205,227)’, ’rgb(204,235,197)’, ’rgb(222,203,228)’, ’rgb(254,217,166)’, ’rgb(255,255,204)’, ’rgb(229,216,189)’, ’rgb(253,218,236)’], 9: [’rgb(251,180,174)’, ’rgb(179,205,227)’, ’rgb(204,235,197)’, ’rgb(222,203,228)’, ’rgb(254,217,166)’, ’rgb(255,255,204)’, ’rgb(229,216,189)’, ’rgb(253,218,236)’, ’rgb(242,242,242)’]}, ’Pastel2’: {3: [’rgb(179,226,205)’, ’rgb(253,205,172)’, ’rgb(203,213,232)’], 4: [’rgb(179,226,205)’, ’rgb(253,205,172)’, ’rgb(203,213,232)’, ’rgb(244,202,228)’], 5: [’rgb(179,226,205)’, ’rgb(253,205,172)’, ’rgb(203,213,232)’, ’rgb(244,202,228)’, ’rgb(230,245,201)’], 6: [’rgb(179,226,205)’, ’rgb(253,205,172)’, ’rgb(203,213,232)’, ’rgb(244,202,228)’, ’rgb(230,245,201)’, ’rgb(255,242,174)’], 7: [’rgb(179,226,205)’, ’rgb(253,205,172)’, ’rgb(203,213,232)’, ’rgb(244,202,228)’, ’rgb(230,245,201)’, ’rgb(255,242,174)’, ’rgb(241,226,204)’], 8: [’rgb(179,226,205)’, ’rgb(253,205,172)’, ’rgb(203,213,232)’, ’rgb(244,202,228)’, ’rgb(230,245,201)’, ’rgb(255,242,174)’, ’rgb(241,226,204)’, ’rgb(204,204,204)’]}, ’PiYG’: {3: [’rgb(233,163,201)’, ’rgb(247,247,247)’, ’rgb(161,215,106)’], 4: [’rgb(208,28,139)’, ’rgb(241,182,218)’, ’rgb(184,225,134)’, ’rgb(77,172,38)’], 5: [’rgb(208,28,139)’, ’rgb(241,182,218)’, ’rgb(247,247,247)’, ’rgb(184,225,134)’, ’rgb(77,172,38)’], 6: [’rgb(197,27,125)’, ’rgb(233,163,201)’, ’rgb(253,224,239)’, ’rgb(230,245,208)’, ’rgb(161,215,106)’, ’rgb(77,146,33)’], 7: [’rgb(197,27,125)’, ’rgb(233,163,201)’, ’rgb(253,224,239)’, ’rgb(247,247,247)’, ’rgb(230,245,208)’, ’rgb(161,215,106)’, ’rgb(77,146,33)’], 8: [’rgb(197,27,125)’, ’rgb(222,119,174)’, ’rgb(241,182,218)’, ’rgb(253,224,239)’, ’rgb(230,245,208)’, ’rgb(184,225,134)’, ’rgb(127,188,65)’, ’rgb(77,146,33)’], 9: [’rgb(197,27,125)’, ’rgb(222,119,174)’, ’rgb(241,182,218)’, ’rgb(253,224,239)’, ’rgb(247,247,247)’, ’rgb(230,245,208)’, ’rgb(184,225,134)’, ’rgb(127,188,65)’, ’rgb(77,146,33)’], 10: [’rgb(142,1,82)’, ’rgb(197,27,125)’, ’rgb(222,119,174)’, ’rgb(241,182,218)’, ’rgb(253,224,239)’, ’rgb(230,245,208)’, ’rgb(184,225,134)’, ’rgb(127,188,65)’, ’rgb(77,146,33)’, ’rgb(39,100,25)’], 11: [’rgb(142,1,82)’, ’rgb(197,27,125)’, ’rgb(222,119,174)’, ’rgb(241,182,218)’, ’rgb(253,224,239)’, ’rgb(247,247,247)’, ’rgb(230,245,208)’, ’rgb(184,225,134)’, ’rgb(127,188,65)’, ’rgb(77,146,33)’, ’rgb(39,100,25)’]}, ’PuBu’: {3: [’rgb(236,231,242)’, ’rgb(166,189,219)’, ’rgb(43,140,190)’], 4: [’rgb(241,238,246)’, ’rgb(189,201,225)’, ’rgb(116,169,207)’, ’rgb(5,112,176)’], 5: [’rgb(241,238,246)’, ’rgb(189,201,225)’, ’rgb(116,169,207)’, ’rgb(43,140,190)’, ’rgb(4,90,141)’], 6: [’rgb(241,238,246)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(116,169,207)’, ’rgb(43,140,190)’, ’rgb(4,90,141)’], 7: [’rgb(241,238,246)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(116,169,207)’, ’rgb(54,144,192)’, ’rgb(5,112,176)’, ’rgb(3,78,123)’], 8: [’rgb(255,247,251)’, ’rgb(236,231,242)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(116,169,207)’, ’rgb(54,144,192)’, ’rgb(5,112,176)’, ’rgb(3,78,123)’], 9: [’rgb(255,247,251)’, ’rgb(236,231,242)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(116,169,207)’, ’rgb(54,144,192)’, ’rgb(5,112,176)’, ’rgb(4,90,141)’, ’rgb(2,56,88)’]}, ’PuB- uGn’: {3: [’rgb(236,226,240)’, ’rgb(166,189,219)’, ’rgb(28,144,153)’], 4: [’rgb(246,239,247)’, ’rgb(189,201,225)’, ’rgb(103,169,207)’, ’rgb(2,129,138)’], 5: [’rgb(246,239,247)’, ’rgb(189,201,225)’, ’rgb(103,169,207)’, ’rgb(28,144,153)’, ’rgb(1,108,89)’], 6: [’rgb(246,239,247)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(103,169,207)’, ’rgb(28,144,153)’, ’rgb(1,108,89)’], 7: [’rgb(246,239,247)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(103,169,207)’, ’rgb(54,144,192)’, ’rgb(2,129,138)’, ’rgb(1,100,80)’], 8: [’rgb(255,247,251)’, ’rgb(236,226,240)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(103,169,207)’, ’rgb(54,144,192)’, ’rgb(2,129,138)’, ’rgb(1,100,80)’], 9: [’rgb(255,247,251)’, ’rgb(236,226,240)’, ’rgb(208,209,230)’, ’rgb(166,189,219)’, ’rgb(103,169,207)’, ’rgb(54,144,192)’, ’rgb(2,129,138)’, ’rgb(1,108,89)’, ’rgb(1,70,54)’]}, ’PuOr’: {3: [’rgb(241,163,64)’, ’rgb(247,247,247)’, ’rgb(153,142,195)’], 4: [’rgb(230,97,1)’, ’rgb(253,184,99)’, ’rgb(178,171,210)’, ’rgb(94,60,153)’], 5: [’rgb(230,97,1)’, ’rgb(253,184,99)’, ’rgb(247,247,247)’, ’rgb(178,171,210)’, ’rgb(94,60,153)’], 6: [’rgb(179,88,6)’, ’rgb(241,163,64)’, ’rgb(254,224,182)’, ’rgb(216,218,235)’, ’rgb(153,142,195)’, ’rgb(84,39,136)’], 7: [’rgb(179,88,6)’, ’rgb(241,163,64)’, ’rgb(254,224,182)’, ’rgb(247,247,247)’, ’rgb(216,218,235)’, ’rgb(153,142,195)’, ’rgb(84,39,136)’], 8: [’rgb(179,88,6)’, ’rgb(224,130,20)’, ’rgb(253,184,99)’, ’rgb(254,224,182)’, ’rgb(216,218,235)’, ’rgb(178,171,210)’, ’rgb(128,115,172)’, ’rgb(84,39,136)’], 9: [’rgb(179,88,6)’, ’rgb(224,130,20)’, ’rgb(253,184,99)’, ’rgb(254,224,182)’, ’rgb(247,247,247)’, ’rgb(216,218,235)’, ’rgb(178,171,210)’, ’rgb(128,115,172)’, ’rgb(84,39,136)’], 10: [’rgb(127,59,8)’, ’rgb(179,88,6)’, ’rgb(224,130,20)’, ’rgb(253,184,99)’, ’rgb(254,224,182)’, ’rgb(216,218,235)’, ’rgb(178,171,210)’, ’rgb(128,115,172)’, ’rgb(84,39,136)’, ’rgb(45,0,75)’], 11: [’rgb(127,59,8)’, ’rgb(179,88,6)’, ’rgb(224,130,20)’, ’rgb(253,184,99)’, ’rgb(254,224,182)’, ’rgb(247,247,247)’, ’rgb(216,218,235)’, ’rgb(178,171,210)’, ’rgb(128,115,172)’, ’rgb(84,39,136)’, ’rgb(45,0,75)’]}, ’PuRd’: {3: [’rgb(231,225,239)’, ’rgb(201,148,199)’, ’rgb(221,28,119)’], 4: [’rgb(241,238,246)’, ’rgb(215,181,216)’, ’rgb(223,101,176)’, ’rgb(206,18,86)’], 5: [’rgb(241,238,246)’, ’rgb(215,181,216)’, ’rgb(223,101,176)’, ’rgb(221,28,119)’, ’rgb(152,0,67)’], 6: [’rgb(241,238,246)’, ’rgb(212,185,218)’, ’rgb(201,148,199)’, ’rgb(223,101,176)’, ’rgb(221,28,119)’, ’rgb(152,0,67)’], 7: [’rgb(241,238,246)’, ’rgb(212,185,218)’, ’rgb(201,148,199)’, ’rgb(223,101,176)’, ’rgb(231,41,138)’, ’rgb(206,18,86)’, ’rgb(145,0,63)’], 8: [’rgb(247,244,249)’, ’rgb(231,225,239)’, ’rgb(212,185,218)’, ’rgb(201,148,199)’, ’rgb(223,101,176)’, ’rgb(231,41,138)’, ’rgb(206,18,86)’, ’rgb(145,0,63)’], 9: [’rgb(247,244,249)’, ’rgb(231,225,239)’, ’rgb(212,185,218)’, ’rgb(201,148,199)’, ’rgb(223,101,176)’, ’rgb(231,41,138)’, ’rgb(206,18,86)’, ’rgb(152,0,67)’, ’rgb(103,0,31)’]}, ’Pur- ples’: {3: [’rgb(239,237,245)’, ’rgb(188,189,220)’, ’rgb(117,107,177)’], 4: [’rgb(242,240,247)’, ’rgb(203,201,226)’, ’rgb(158,154,200)’, ’rgb(106,81,163)’], 5: [’rgb(242,240,247)’, ’rgb(203,201,226)’, ’rgb(158,154,200)’, ’rgb(117,107,177)’, ’rgb(84,39,143)’], 6: [’rgb(242,240,247)’, ’rgb(218,218,235)’, ’rgb(188,189,220)’, ’rgb(158,154,200)’, ’rgb(117,107,177)’, ’rgb(84,39,143)’], 7: [’rgb(242,240,247)’, ’rgb(218,218,235)’, ’rgb(188,189,220)’, ’rgb(158,154,200)’, ’rgb(128,125,186)’, ’rgb(106,81,163)’, ’rgb(74,20,134)’], 8: [’rgb(252,251,253)’, ’rgb(239,237,245)’, ’rgb(218,218,235)’, ’rgb(188,189,220)’, ’rgb(158,154,200)’, ’rgb(128,125,186)’, ’rgb(106,81,163)’, ’rgb(74,20,134)’], 9: [’rgb(252,251,253)’, ’rgb(239,237,245)’, ’rgb(218,218,235)’, ’rgb(188,189,220)’, ’rgb(158,154,200)’, ’rgb(128,125,186)’, ’rgb(106,81,163)’, ’rgb(84,39,143)’, ’rgb(63,0,125)’]}, ’RdBu’: {3: [’rgb(239,138,98)’, ’rgb(247,247,247)’, ’rgb(103,169,207)’], 4: [’rgb(202,0,32)’, ’rgb(244,165,130)’, ’rgb(146,197,222)’, ’rgb(5,113,176)’], 5: [’rgb(202,0,32)’, ’rgb(244,165,130)’, ’rgb(247,247,247)’, ’rgb(146,197,222)’, ’rgb(5,113,176)’], 6: [’rgb(178,24,43)’, ’rgb(239,138,98)’, ’rgb(253,219,199)’, ’rgb(209,229,240)’, ’rgb(103,169,207)’, ’rgb(33,102,172)’], 7: [’rgb(178,24,43)’, ’rgb(239,138,98)’, ’rgb(253,219,199)’, ’rgb(247,247,247)’, ’rgb(209,229,240)’, ’rgb(103,169,207)’, ’rgb(33,102,172)’], 8: [’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(209,229,240)’, ’rgb(146,197,222)’, ’rgb(67,147,195)’, ’rgb(33,102,172)’], 9: [’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(247,247,247)’, ’rgb(209,229,240)’, ’rgb(146,197,222)’, ’rgb(67,147,195)’, ’rgb(33,102,172)’], 10: [’rgb(103,0,31)’, ’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(209,229,240)’, ’rgb(146,197,222)’, ’rgb(67,147,195)’, ’rgb(33,102,172)’, ’rgb(5,48,97)’], 11: [’rgb(103,0,31)’, ’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(247,247,247)’, ’rgb(209,229,240)’, ’rgb(146,197,222)’, ’rgb(67,147,195)’, ’rgb(33,102,172)’, ’rgb(5,48,97)’]}, ’RdGy’: {3: [’rgb(239,138,98)’, ’rgb(255,255,255)’, ’rgb(153,153,153)’], 4: [’rgb(202,0,32)’, ’rgb(244,165,130)’, ’rgb(186,186,186)’, ’rgb(64,64,64)’], 5: [’rgb(202,0,32)’, ’rgb(244,165,130)’, ’rgb(255,255,255)’, ’rgb(186,186,186)’, ’rgb(64,64,64)’], 6: [’rgb(178,24,43)’, ’rgb(239,138,98)’, ’rgb(253,219,199)’, ’rgb(224,224,224)’, ’rgb(153,153,153)’, ’rgb(77,77,77)’], 7: [’rgb(178,24,43)’, ’rgb(239,138,98)’, ’rgb(253,219,199)’, ’rgb(255,255,255)’, ’rgb(224,224,224)’, ’rgb(153,153,153)’, ’rgb(77,77,77)’], 8: [’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(224,224,224)’, ’rgb(186,186,186)’, ’rgb(135,135,135)’, ’rgb(77,77,77)’], 9: [’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(255,255,255)’, ’rgb(224,224,224)’, ’rgb(186,186,186)’, ’rgb(135,135,135)’, ’rgb(77,77,77)’], 10: [’rgb(103,0,31)’, ’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(224,224,224)’, ’rgb(186,186,186)’, ’rgb(135,135,135)’, ’rgb(77,77,77)’, ’rgb(26,26,26)’], 11: [’rgb(103,0,31)’, ’rgb(178,24,43)’, ’rgb(214,96,77)’, ’rgb(244,165,130)’, ’rgb(253,219,199)’, ’rgb(255,255,255)’, ’rgb(224,224,224)’, ’rgb(186,186,186)’, ’rgb(135,135,135)’, ’rgb(77,77,77)’, ’rgb(26,26,26)’]}, ’RdPu’: {3: [’rgb(253,224,221)’, ’rgb(250,159,181)’, ’rgb(197,27,138)’], 4: [’rgb(254,235,226)’, ’rgb(251,180,185)’, ’rgb(247,104,161)’, ’rgb(174,1,126)’], 5: [’rgb(254,235,226)’, ’rgb(251,180,185)’, ’rgb(247,104,161)’, ’rgb(197,27,138)’, ’rgb(122,1,119)’], 6: [’rgb(254,235,226)’, ’rgb(252,197,192)’, ’rgb(250,159,181)’, ’rgb(247,104,161)’, ’rgb(197,27,138)’, ’rgb(122,1,119)’], 7: [’rgb(254,235,226)’, ’rgb(252,197,192)’, ’rgb(250,159,181)’, ’rgb(247,104,161)’, ’rgb(221,52,151)’, ’rgb(174,1,126)’, ’rgb(122,1,119)’], 8: [’rgb(255,247,243)’, ’rgb(253,224,221)’, ’rgb(252,197,192)’, ’rgb(250,159,181)’, ’rgb(247,104,161)’, ’rgb(221,52,151)’, ’rgb(174,1,126)’, ’rgb(122,1,119)’], 9: [’rgb(255,247,243)’, ’rgb(253,224,221)’, ’rgb(252,197,192)’, ’rgb(250,159,181)’, ’rgb(247,104,161)’, ’rgb(221,52,151)’, ’rgb(174,1,126)’, ’rgb(122,1,119)’, ’rgb(73,0,106)’]}, ’RdYlBu’: {3: [’rgb(252,141,89)’, ’rgb(255,255,191)’, ’rgb(145,191,219)’], 4: [’rgb(215,25,28)’, ’rgb(253,174,97)’, ’rgb(171,217,233)’, ’rgb(44,123,182)’], 5: [’rgb(215,25,28)’, ’rgb(253,174,97)’, ’rgb(255,255,191)’, ’rgb(171,217,233)’, ’rgb(44,123,182)’], 6: [’rgb(215,48,39)’, ’rgb(252,141,89)’, ’rgb(254,224,144)’, ’rgb(224,243,248)’, ’rgb(145,191,219)’, ’rgb(69,117,180)’], 7: [’rgb(215,48,39)’, ’rgb(252,141,89)’, ’rgb(254,224,144)’, ’rgb(255,255,191)’, ’rgb(224,243,248)’, ’rgb(145,191,219)’, ’rgb(69,117,180)’], 8: [’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,144)’, ’rgb(224,243,248)’, ’rgb(171,217,233)’, ’rgb(116,173,209)’, ’rgb(69,117,180)’], 9: [’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,144)’, ’rgb(255,255,191)’, ’rgb(224,243,248)’, ’rgb(171,217,233)’, ’rgb(116,173,209)’, ’rgb(69,117,180)’], 10: [’rgb(165,0,38)’, ’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,144)’, ’rgb(224,243,248)’, ’rgb(171,217,233)’, ’rgb(116,173,209)’, ’rgb(69,117,180)’, ’rgb(49,54,149)’], 11: [’rgb(165,0,38)’, ’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,144)’, ’rgb(255,255,191)’, ’rgb(224,243,248)’, ’rgb(171,217,233)’, ’rgb(116,173,209)’, ’rgb(69,117,180)’, ’rgb(49,54,149)’]}, ’RdYlGn’: {3: [’rgb(252,141,89)’, ’rgb(255,255,191)’, ’rgb(145,207,96)’], 4: [’rgb(215,25,28)’, ’rgb(253,174,97)’, ’rgb(166,217,106)’, ’rgb(26,150,65)’], 5: [’rgb(215,25,28)’, ’rgb(253,174,97)’, ’rgb(255,255,191)’, ’rgb(166,217,106)’, ’rgb(26,150,65)’], 6: [’rgb(215,48,39)’, ’rgb(252,141,89)’, ’rgb(254,224,139)’, ’rgb(217,239,139)’, ’rgb(145,207,96)’, ’rgb(26,152,80)’], 7: [’rgb(215,48,39)’, ’rgb(252,141,89)’, ’rgb(254,224,139)’, ’rgb(255,255,191)’, ’rgb(217,239,139)’, ’rgb(145,207,96)’, ’rgb(26,152,80)’], 8: [’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(217,239,139)’, ’rgb(166,217,106)’, ’rgb(102,189,99)’, ’rgb(26,152,80)’], 9: [’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(255,255,191)’, ’rgb(217,239,139)’, ’rgb(166,217,106)’, ’rgb(102,189,99)’, ’rgb(26,152,80)’], 10: [’rgb(165,0,38)’, ’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(217,239,139)’, ’rgb(166,217,106)’, ’rgb(102,189,99)’, ’rgb(26,152,80)’, ’rgb(0,104,55)’], 11: [’rgb(165,0,38)’, ’rgb(215,48,39)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(255,255,191)’, ’rgb(217,239,139)’, ’rgb(166,217,106)’, ’rgb(102,189,99)’, ’rgb(26,152,80)’, ’rgb(0,104,55)’]}, ’Reds’: {3: [’rgb(254,224,210)’, ’rgb(252,146,114)’, ’rgb(222,45,38)’], 4: [’rgb(254,229,217)’, ’rgb(252,174,145)’, ’rgb(251,106,74)’, ’rgb(203,24,29)’], 5: [’rgb(254,229,217)’, ’rgb(252,174,145)’, ’rgb(251,106,74)’, ’rgb(222,45,38)’, ’rgb(165,15,21)’], 6: [’rgb(254,229,217)’, ’rgb(252,187,161)’, ’rgb(252,146,114)’, ’rgb(251,106,74)’, ’rgb(222,45,38)’, ’rgb(165,15,21)’], 7: [’rgb(254,229,217)’, ’rgb(252,187,161)’, ’rgb(252,146,114)’, ’rgb(251,106,74)’, ’rgb(239,59,44)’, ’rgb(203,24,29)’, ’rgb(153,0,13)’], 8: [’rgb(255,245,240)’, ’rgb(254,224,210)’, ’rgb(252,187,161)’, ’rgb(252,146,114)’, ’rgb(251,106,74)’, ’rgb(239,59,44)’, ’rgb(203,24,29)’, ’rgb(153,0,13)’], 9: [’rgb(255,245,240)’, ’rgb(254,224,210)’, ’rgb(252,187,161)’, ’rgb(252,146,114)’, ’rgb(251,106,74)’, ’rgb(239,59,44)’, ’rgb(203,24,29)’, ’rgb(165,15,21)’, ’rgb(103,0,13)’]}, ’Set1’: {3: [’rgb(228,26,28)’, ’rgb(55,126,184)’, ’rgb(77,175,74)’], 4: [’rgb(228,26,28)’, ’rgb(55,126,184)’, ’rgb(77,175,74)’, ’rgb(152,78,163)’], 5: [’rgb(228,26,28)’, ’rgb(55,126,184)’, ’rgb(77,175,74)’, ’rgb(152,78,163)’, ’rgb(255,127,0)’], 6: [’rgb(228,26,28)’, ’rgb(55,126,184)’, ’rgb(77,175,74)’, ’rgb(152,78,163)’, ’rgb(255,127,0)’, ’rgb(255,255,51)’], 7: [’rgb(228,26,28)’, ’rgb(55,126,184)’, ’rgb(77,175,74)’, ’rgb(152,78,163)’, ’rgb(255,127,0)’, ’rgb(255,255,51)’, ’rgb(166,86,40)’], 8: [’rgb(228,26,28)’, ’rgb(55,126,184)’, ’rgb(77,175,74)’, ’rgb(152,78,163)’, ’rgb(255,127,0)’, ’rgb(255,255,51)’, ’rgb(166,86,40)’, ’rgb(247,129,191)’], 9: [’rgb(228,26,28)’, ’rgb(55,126,184)’, ’rgb(77,175,74)’, ’rgb(152,78,163)’, ’rgb(255,127,0)’, ’rgb(255,255,51)’, ’rgb(166,86,40)’, ’rgb(247,129,191)’, ’rgb(153,153,153)’]}, ’Set2’: {3: [’rgb(102,194,165)’, ’rgb(252,141,98)’, ’rgb(141,160,203)’], 4: [’rgb(102,194,165)’, ’rgb(252,141,98)’, ’rgb(141,160,203)’, ’rgb(231,138,195)’], 5: [’rgb(102,194,165)’, ’rgb(252,141,98)’, ’rgb(141,160,203)’, ’rgb(231,138,195)’, ’rgb(166,216,84)’], 6: [’rgb(102,194,165)’, ’rgb(252,141,98)’, ’rgb(141,160,203)’, ’rgb(231,138,195)’, ’rgb(166,216,84)’, ’rgb(255,217,47)’], 7: [’rgb(102,194,165)’, ’rgb(252,141,98)’, ’rgb(141,160,203)’, ’rgb(231,138,195)’, ’rgb(166,216,84)’, ’rgb(255,217,47)’, ’rgb(229,196,148)’], 8: [’rgb(102,194,165)’, ’rgb(252,141,98)’, ’rgb(141,160,203)’, ’rgb(231,138,195)’, ’rgb(166,216,84)’, ’rgb(255,217,47)’, ’rgb(229,196,148)’, ’rgb(179,179,179)’]}, ’Set3’: {3: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’], 4: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’], 5: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’], 6: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’, ’rgb(253,180,98)’], 7: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’, ’rgb(253,180,98)’, ’rgb(179,222,105)’], 8: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’, ’rgb(253,180,98)’, ’rgb(179,222,105)’, ’rgb(252,205,229)’], 9: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’, ’rgb(253,180,98)’, ’rgb(179,222,105)’, ’rgb(252,205,229)’, ’rgb(217,217,217)’], 10: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’, ’rgb(253,180,98)’, ’rgb(179,222,105)’, ’rgb(252,205,229)’, ’rgb(217,217,217)’, ’rgb(188,128,189)’], 11: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’, ’rgb(253,180,98)’, ’rgb(179,222,105)’, ’rgb(252,205,229)’, ’rgb(217,217,217)’, ’rgb(188,128,189)’, ’rgb(204,235,197)’], 12: [’rgb(141,211,199)’, ’rgb(255,255,179)’, ’rgb(190,186,218)’, ’rgb(251,128,114)’, ’rgb(128,177,211)’, ’rgb(253,180,98)’, ’rgb(179,222,105)’, ’rgb(252,205,229)’, ’rgb(217,217,217)’, ’rgb(188,128,189)’, ’rgb(204,235,197)’, ’rgb(255,237,111)’]}, ’Spectral’: {3: [’rgb(252,141,89)’, ’rgb(255,255,191)’, ’rgb(153,213,148)’], 4: [’rgb(215,25,28)’, ’rgb(253,174,97)’, ’rgb(171,221,164)’, ’rgb(43,131,186)’], 5: [’rgb(215,25,28)’, ’rgb(253,174,97)’, ’rgb(255,255,191)’, ’rgb(171,221,164)’, ’rgb(43,131,186)’], 6: [’rgb(213,62,79)’, ’rgb(252,141,89)’, ’rgb(254,224,139)’, ’rgb(230,245,152)’, ’rgb(153,213,148)’, ’rgb(50,136,189)’], 7: [’rgb(213,62,79)’, ’rgb(252,141,89)’, ’rgb(254,224,139)’, ’rgb(255,255,191)’, ’rgb(230,245,152)’, ’rgb(153,213,148)’, ’rgb(50,136,189)’], 8: [’rgb(213,62,79)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(230,245,152)’, ’rgb(171,221,164)’, ’rgb(102,194,165)’, ’rgb(50,136,189)’], 9: [’rgb(213,62,79)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(255,255,191)’, ’rgb(230,245,152)’, ’rgb(171,221,164)’, ’rgb(102,194,165)’, ’rgb(50,136,189)’], 10: [’rgb(158,1,66)’, ’rgb(213,62,79)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(230,245,152)’, ’rgb(171,221,164)’, ’rgb(102,194,165)’, ’rgb(50,136,189)’, ’rgb(94,79,162)’], 11: [’rgb(158,1,66)’, ’rgb(213,62,79)’, ’rgb(244,109,67)’, ’rgb(253,174,97)’, ’rgb(254,224,139)’, ’rgb(255,255,191)’, ’rgb(230,245,152)’, ’rgb(171,221,164)’, ’rgb(102,194,165)’, ’rgb(50,136,189)’, ’rgb(94,79,162)’]}, ’YlGn’: {3: [’rgb(247,252,185)’, ’rgb(173,221,142)’, ’rgb(49,163,84)’], 4: [’rgb(255,255,204)’, ’rgb(194,230,153)’, ’rgb(120,198,121)’, ’rgb(35,132,67)’], 5: [’rgb(255,255,204)’, ’rgb(194,230,153)’, ’rgb(120,198,121)’, ’rgb(49,163,84)’, ’rgb(0,104,55)’], 6: [’rgb(255,255,204)’, ’rgb(217,240,163)’, ’rgb(173,221,142)’, ’rgb(120,198,121)’, ’rgb(49,163,84)’, ’rgb(0,104,55)’], 7: [’rgb(255,255,204)’, ’rgb(217,240,163)’, ’rgb(173,221,142)’, ’rgb(120,198,121)’, ’rgb(65,171,93)’, ’rgb(35,132,67)’, ’rgb(0,90,50)’], 8: [’rgb(255,255,229)’, ’rgb(247,252,185)’, ’rgb(217,240,163)’, ’rgb(173,221,142)’, ’rgb(120,198,121)’, ’rgb(65,171,93)’, ’rgb(35,132,67)’, ’rgb(0,90,50)’], 9: [’rgb(255,255,229)’, ’rgb(247,252,185)’, ’rgb(217,240,163)’, ’rgb(173,221,142)’, ’rgb(120,198,121)’, ’rgb(65,171,93)’, ’rgb(35,132,67)’, ’rgb(0,104,55)’, ’rgb(0,69,41)’]}, ’YlGnBu’: {3: [’rgb(237,248,177)’, ’rgb(127,205,187)’, ’rgb(44,127,184)’], 4: [’rgb(255,255,204)’, ’rgb(161,218,180)’, ’rgb(65,182,196)’, ’rgb(34,94,168)’], 5: [’rgb(255,255,204)’, ’rgb(161,218,180)’, ’rgb(65,182,196)’, ’rgb(44,127,184)’, ’rgb(37,52,148)’], 6: [’rgb(255,255,204)’, ’rgb(199,233,180)’, ’rgb(127,205,187)’, ’rgb(65,182,196)’, ’rgb(44,127,184)’, ’rgb(37,52,148)’], 7: [’rgb(255,255,204)’, ’rgb(199,233,180)’, ’rgb(127,205,187)’, ’rgb(65,182,196)’, ’rgb(29,145,192)’, ’rgb(34,94,168)’, ’rgb(12,44,132)’], 8: [’rgb(255,255,217)’, ’rgb(237,248,177)’, ’rgb(199,233,180)’, ’rgb(127,205,187)’, ’rgb(65,182,196)’, ’rgb(29,145,192)’, ’rgb(34,94,168)’, ’rgb(12,44,132)’], 9: [’rgb(255,255,217)’, ’rgb(237,248,177)’, ’rgb(199,233,180)’, ’rgb(127,205,187)’, ’rgb(65,182,196)’, ’rgb(29,145,192)’, ’rgb(34,94,168)’, ’rgb(37,52,148)’, ’rgb(8,29,88)’]}, ’YlOrBr’: {3: [’rgb(255,247,188)’, ’rgb(254,196,79)’, ’rgb(217,95,14)’], 4: [’rgb(255,255,212)’, ’rgb(254,217,142)’, ’rgb(254,153,41)’, ’rgb(204,76,2)’], 5: [’rgb(255,255,212)’, ’rgb(254,217,142)’, ’rgb(254,153,41)’, ’rgb(217,95,14)’, ’rgb(153,52,4)’], 6: [’rgb(255,255,212)’, ’rgb(254,227,145)’, ’rgb(254,196,79)’, ’rgb(254,153,41)’, ’rgb(217,95,14)’, ’rgb(153,52,4)’], 7: [’rgb(255,255,212)’, ’rgb(254,227,145)’, ’rgb(254,196,79)’, ’rgb(254,153,41)’, ’rgb(236,112,20)’, ’rgb(204,76,2)’, ’rgb(140,45,4)’], 8: [’rgb(255,255,229)’, ’rgb(255,247,188)’, ’rgb(254,227,145)’, ’rgb(254,196,79)’, ’rgb(254,153,41)’, ’rgb(236,112,20)’, ’rgb(204,76,2)’, ’rgb(140,45,4)’], 9: [’rgb(255,255,229)’, ’rgb(255,247,188)’, ’rgb(254,227,145)’, ’rgb(254,196,79)’, ’rgb(254,153,41)’, ’rgb(236,112,20)’, ’rgb(204,76,2)’, ’rgb(153,52,4)’, ’rgb(102,37,6)’]}, ’YlOrRd’: {3: [’rgb(255,237,160)’, ’rgb(254,178,76)’, ’rgb(240,59,32)’], 4: [’rgb(255,255,178)’, ’rgb(254,204,92)’, ’rgb(253,141,60)’, ’rgb(227,26,28)’], 5: [’rgb(255,255,178)’, ’rgb(254,204,92)’, ’rgb(253,141,60)’, ’rgb(240,59,32)’, ’rgb(189,0,38)’], 6: [’rgb(255,255,178)’, ’rgb(254,217,118)’, ’rgb(254,178,76)’, ’rgb(253,141,60)’, ’rgb(240,59,32)’, ’rgb(189,0,38)’], 7: [’rgb(255,255,178)’, ’rgb(254,217,118)’, ’rgb(254,178,76)’, ’rgb(253,141,60)’, ’rgb(252,78,42)’, ’rgb(227,26,28)’, ’rgb(177,0,38)’], 8: [’rgb(255,255,204)’, ’rgb(255,237,160)’, ’rgb(254,217,118)’, ’rgb(254,178,76)’, ’rgb(253,141,60)’, ’rgb(252,78,42)’, ’rgb(227,26,28)’, ’rgb(177,0,38)’], 9: [’rgb(255,255,204)’, ’rgb(255,237,160)’, ’rgb(254,217,118)’, ’rgb(254,178,76)’, ’rgb(253,141,60)’, ’rgb(252,78,42)’, ’rgb(227,26,28)’, ’rgb(189,0,38)’, ’rgb(128,0,38)’]}}) mapbox-gl-js-jupyter Documentation

Convert a list of breaks into color stops using colors from colorBrewer or a custom list of color values in RGB, RGBA, HSL, CSS text, or HEX format. See www.colorbrewer2.org for a list of color options to pass mapboxgl.utils.create_numeric_stops(breaks, min_value, max_value) Convert data breaks into a general numeric ramp (height, radius, weight, etc.) mapboxgl.utils.create_radius_stops(breaks, min_radius, max_radius) Convert a data breaks into a radius ramp mapboxgl.utils.create_weight_stops(breaks) Convert data breaks into a heatmap-weight ramp mapboxgl.utils.df_to_geojson(df, properties=None, lat=’lat’, lon=’lon’, precision=6, date_format=’epoch’, filename=None) Serialize a Pandas dataframe to a geojson format Python dictionary / file mapboxgl.utils.gdf_to_geojson(gdf, date_format=’epoch’, properties=None, filename=None) Serialize a GeoPandas dataframe to a geojson format Python dictionary / file mapboxgl.utils.geojson_to_dict_list(data) Parse GeoJSON-formatted information in to list of Python dicts mapboxgl.utils.height_map(lookup, height_stops, default_height=0.0) Return a height value (in meters) interpolated from given height_stops; for use with vector-based visualizations using fill-extrusion layers mapboxgl.utils.img_encode(arr, **kwargs) Encode ndarray to base64 string image data arr: ndarray (rows, cols, depth) kwargs: passed directly to matplotlib.image.imsave mapboxgl.utils.numeric_map(lookup, numeric_stops, default=0.0) Return a number value interpolated from given numeric_stops mapboxgl.utils.rgb_tuple_from_str(color_string) Convert color in format ‘rgb(RRR,GGG,BBB)’, ‘rgba(RRR,GGG,BBB,alpha)’, ‘#RRGGBB’, or limited En- glish color name (eg ‘red’) to tuple (RRR, GGG, BBB) mapboxgl.utils.row_to_geojson(row, lon, lat, precision, date_format=’epoch’) Convert a pandas dataframe row to a geojson format object. Converts all datetimes to epoch seconds. mapboxgl.utils.scale_between(minval, maxval, numStops) Scale a min and max value to equal interval domain with numStops discrete values

5.24.6 mapboxgl.viz module class mapboxgl.viz.ChoroplethViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, line_color=’white’, line_stroke=’solid’, line_width=1, line_opacity=1, height_property=None, height_stops=None, height_default=0.0, height_function_type=’interpolate’, legend_key_shape=’rounded-square’, high- light_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a choropleth viz add_unique_template_variables(options) Update map template variables specific to heatmap visual

34 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

class mapboxgl.viz.CircleViz(data, radius=1, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, stroke_color=’grey’, stroke_width=0.1, legend_key_shape=’circle’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a circle map add_unique_template_variables(options) Update map template variables specific to circle visual class mapboxgl.viz.ClusteredCircleViz(data, color_stops=None, radius_stops=None, cluster_radius=30, cluster_maxzoom=14, radius_default=2, color_default=’black’, stroke_color=’grey’, stroke_width=0.1, leg- end_key_shape=’circle’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.MapViz Create a clustered circle map (geojson only) add_unique_template_variables(options) Update map template variables specific to a clustered circle visual class mapboxgl.viz.GraduatedCircleViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, stroke_color=’grey’, stroke_width=0.1, ra- dius_property=None, radius_stops=None, ra- dius_default=2, radius_function_type=’interpolate’, legend_key_shape=’circle’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a graduated circle map add_unique_template_variables(options) Update map template variables specific to graduated circle visual class mapboxgl.viz.HeatmapViz(data, weight_property=None, weight_stops=None, color_stops=None, radius_stops=None, intensity_stops=None, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a heatmap viz add_unique_template_variables(options) Update map template variables specific to heatmap visual generate_vector_numeric_map(numeric_property) Generate stops array for use with match expression in mapbox template class mapboxgl.viz.ImageViz(image, coordinates, legend=False, *args, **kwargs) Bases: mapboxgl.viz.MapViz Create a image viz add_unique_template_variables(options) Update map template variables specific to image visual

5.24. mapboxgl package 35 mapbox-gl-js-jupyter Documentation

class mapboxgl.viz.LinestringViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, line_stroke=’solid’, line_width_property=None, line_width_stops=None, line_width_default=1, line_width_function_type=’interpolate’, leg- end_key_shape=’line’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a linestring viz add_unique_template_variables(options) Update map template variables specific to linestring visual class mapboxgl.viz.MapViz(data, vector_url=None, vector_layer_name=None, vec- tor_join_property=None, data_join_property=None, dis- able_data_join=False, access_token=None, center=(0, 0), below_layer=”, opacity=1, div_id=’map’, height=’500px’, style=’mapbox://styles/mapbox/light-v10?optimize=true’, la- bel_property=None, label_size=8, label_color=’#131516’, la- bel_halo_color=’white’, label_halo_width=1, width=’100%’, zoom=0, min_zoom=0, max_zoom=24, pitch=0, bear- ing=0, box_zoom_on=True, double_click_zoom_on=True, scroll_zoom_on=True, touch_zoom_on=True, legend=True, legend_layout=’vertical’, legend_function=’color’, leg- end_gradient=False, legend_style=”, legend_fill=’white’, leg- end_header_fill=’white’, legend_text_color=’#6e6e6e’, leg- end_text_numeric_precision=None, legend_title_halo_color=’white’, legend_key_shape=’square’, legend_key_borders_on=True, scale=False, scale_unit_system=’metric’, scale_position=’bottom-left’, scale_border_color=’#6e6e6e’, scale_background_color=’white’, scale_text_color=’#131516’, popup_open_action=’hover’, add_snapshot_links=False) Bases: object add_unique_template_variables(options) as_iframe(html_data) Build the HTML representation for the mapviz. create_html(filename=None) Create a circle visual from a geojson data source show(**kwargs) class mapboxgl.viz.RasterTilesViz(tiles_url, tiles_size=256, tiles_bounds=None, tiles_minzoom=0, tiles_maxzoom=22, legend=False, *args, **kwargs) Bases: mapboxgl.viz.MapViz Create a rastertiles map add_unique_template_variables(options) Update map template variables specific to a raster visual class mapboxgl.viz.VectorMixin Bases: object check_vector_template() Determines if features are defined as vector source based on MapViz arguments.

36 Chapter 5. Release process mapbox-gl-js-jupyter Documentation

generate_vector_color_map() Generate color stops array for use with match expression in mapbox template generate_vector_numeric_map(numeric_property) Generate stops array for use with match expression in mapbox template

5.24.7 Module contents

class mapboxgl.CircleViz(data, radius=1, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, stroke_color=’grey’, stroke_width=0.1, legend_key_shape=’circle’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a circle map add_unique_template_variables(options) Update map template variables specific to circle visual class mapboxgl.GraduatedCircleViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, stroke_color=’grey’, stroke_width=0.1, ra- dius_property=None, radius_stops=None, ra- dius_default=2, radius_function_type=’interpolate’, legend_key_shape=’circle’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a graduated circle map add_unique_template_variables(options) Update map template variables specific to graduated circle visual class mapboxgl.HeatmapViz(data, weight_property=None, weight_stops=None, color_stops=None, radius_stops=None, intensity_stops=None, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a heatmap viz add_unique_template_variables(options) Update map template variables specific to heatmap visual generate_vector_numeric_map(numeric_property) Generate stops array for use with match expression in mapbox template class mapboxgl.ClusteredCircleViz(data, color_stops=None, radius_stops=None, clus- ter_radius=30, cluster_maxzoom=14, radius_default=2, color_default=’black’, stroke_color=’grey’, stroke_width=0.1, legend_key_shape=’circle’, high- light_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.MapViz Create a clustered circle map (geojson only) add_unique_template_variables(options) Update map template variables specific to a clustered circle visual class mapboxgl.ImageViz(image, coordinates, legend=False, *args, **kwargs) Bases: mapboxgl.viz.MapViz Create a image viz

5.24. mapboxgl package 37 mapbox-gl-js-jupyter Documentation

add_unique_template_variables(options) Update map template variables specific to image visual class mapboxgl.RasterTilesViz(tiles_url, tiles_size=256, tiles_bounds=None, tiles_minzoom=0, tiles_maxzoom=22, legend=False, *args, **kwargs) Bases: mapboxgl.viz.MapViz Create a rastertiles map add_unique_template_variables(options) Update map template variables specific to a raster visual class mapboxgl.ChoroplethViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, line_color=’white’, line_stroke=’solid’, line_width=1, line_opacity=1, height_property=None, height_stops=None, height_default=0.0, height_function_type=’interpolate’, legend_key_shape=’rounded-square’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a choropleth viz add_unique_template_variables(options) Update map template variables specific to heatmap visual class mapboxgl.LinestringViz(data, color_property=None, color_stops=None, color_default=’grey’, color_function_type=’interpolate’, line_stroke=’solid’, line_width_property=None, line_width_stops=None, line_width_default=1, line_width_function_type=’interpolate’, legend_key_shape=’line’, highlight_color=’black’, *args, **kwargs) Bases: mapboxgl.viz.VectorMixin, mapboxgl.viz.MapViz Create a linestring viz add_unique_template_variables(options) Update map template variables specific to linestring visual

5.25 mapboxgl

38 Chapter 5. Release process CHAPTER 6

Indices and tables

• genindex • modindex • search

39 mapbox-gl-js-jupyter Documentation

40 Chapter 6. Indices and tables Python Module Index

m mapboxgl, 37 mapboxgl.colors, 31 mapboxgl.errors, 31 mapboxgl.templates, 32 mapboxgl.utils, 32 mapboxgl.viz, 34

41 mapbox-gl-js-jupyter Documentation

42 Python Module Index Index

A boxgl.viz.VectorMixin method), 36 add_unique_template_variables() (map- ChoroplethViz (class in mapboxgl), 38 boxgl.ChoroplethViz method), 38 ChoroplethViz (class in mapboxgl.viz), 34 add_unique_template_variables() (map- CircleViz (class in mapboxgl), 37 boxgl.CircleViz method), 37 CircleViz (class in mapboxgl.viz), 34 add_unique_template_variables() (map- ClusteredCircleViz (class in mapboxgl), 37 boxgl.ClusteredCircleViz method), 37 ClusteredCircleViz (class in mapboxgl.viz), 35 add_unique_template_variables() (map- color_map() (in module mapboxgl.utils), 32 boxgl.GraduatedCircleViz method), 37 convert_date_columns() (in module map- add_unique_template_variables() (map- boxgl.utils), 32 boxgl.HeatmapViz method), 37 create_color_stops() (in module map- add_unique_template_variables() (map- boxgl.utils), 32 boxgl.ImageViz method), 37 create_html() (mapboxgl.viz.MapViz method), 36 add_unique_template_variables() (map- create_numeric_stops() (in module map- boxgl.LinestringViz method), 38 boxgl.utils), 34 add_unique_template_variables() (map- create_radius_stops() (in module map- boxgl.RasterTilesViz method), 38 boxgl.utils), 34 add_unique_template_variables() (map- create_weight_stops() (in module map- boxgl.viz.ChoroplethViz method), 34 boxgl.utils), 34 add_unique_template_variables() (map- boxgl.viz.CircleViz method), 35 D add_unique_template_variables() (map- DateConversionError, 31 boxgl.viz.ClusteredCircleViz method), 35 df_to_geojson() (in module mapboxgl.utils), 34 add_unique_template_variables() (map- boxgl.viz.GraduatedCircleViz method), 35 F add_unique_template_variables() (map- format() (in module mapboxgl.templates), 32 boxgl.viz.HeatmapViz method), 35 add_unique_template_variables() (map- G boxgl.viz.ImageViz method), 35 gdf_to_geojson() (in module mapboxgl.utils), 34 add_unique_template_variables() (map- generate_vector_color_map() (map- boxgl.viz.LinestringViz method), 36 boxgl.viz.VectorMixin method), 36 add_unique_template_variables() (map- generate_vector_numeric_map() (map- boxgl.viz.MapViz method), 36 boxgl.HeatmapViz method), 37 add_unique_template_variables() (map- generate_vector_numeric_map() (map- boxgl.viz.RasterTilesViz method), 36 boxgl.viz.HeatmapViz method), 35 as_iframe() (mapboxgl.viz.MapViz method), 36 generate_vector_numeric_map() (map- boxgl.viz.VectorMixin method), 37 C geojson_to_dict_list() (in module map- check_vector_template() (map- boxgl.utils), 34

43 mapbox-gl-js-jupyter Documentation

GraduatedCircleViz (class in mapboxgl), 37 GraduatedCircleViz (class in mapboxgl.viz), 35 H HeatmapViz (class in mapboxgl), 37 HeatmapViz (class in mapboxgl.viz), 35 height_map() (in module mapboxgl.utils), 34 I ImageViz (class in mapboxgl), 37 ImageViz (class in mapboxgl.viz), 35 img_encode() (in module mapboxgl.utils), 34 L LegendError, 31 LinestringViz (class in mapboxgl), 38 LinestringViz (class in mapboxgl.viz), 35 M mapboxgl (module), 37 mapboxgl.colors (module), 31 mapboxgl.errors (module), 31 mapboxgl.templates (module), 32 mapboxgl.utils (module), 32 mapboxgl.viz (module), 34 MapViz (class in mapboxgl.viz), 36 N numeric_map() (in module mapboxgl.utils), 34 R RasterTilesViz (class in mapboxgl), 38 RasterTilesViz (class in mapboxgl.viz), 36 rgb_tuple_from_str() (in module map- boxgl.utils), 34 row_to_geojson() (in module mapboxgl.utils), 34 S scale_between() (in module mapboxgl.utils), 34 show() (mapboxgl.viz.MapViz method), 36 SourceDataError, 31 T TokenError, 31 V ValueError, 31 VectorMixin (class in mapboxgl.viz), 36

44 Index