Before I start with an implementation, I would like to discuss with you the best approach. I would like to add support to show polygons. I've the following data and I'm trying to plot the Choropleth Viz using Mapbox Jupyter: data= Īm I missing something when plotting in Mapbox?Īny help would be appreciated. I'm using mapboxgl 0.5.1 installed with pip 9.0.1 in Python 3.4 and latest JupyterLab. # Generate data breaks and color stops from colorBrewerĬolor_stops = create_color_stops(color_breaks, colors='YlGnBu') # Create a geojson file export from a Pandas dataframeĭf_to_geojson(df, filename='points.geojson', This is the result:Īnd this is the code: import pandas as pd I tried to reproduce the example given in the README with an OpenMapTiles style but the data does not show, I only see the tiles. Install the python library locally with pip: # Create the viz from the dataframe viz = CircleViz( 'points.geojson',Ĭolor_property = "Avg Medicare Payments", # Generate data breaks and color stops from colorBrewer color_breaks = Ĭolor_stops = create_color_stops( color_breaks, colors = 'YlGnBu') # Create a geojson file export from a Pandas dataframe df_to_geojson( df, filename = 'points.geojson', # Must be a public token, starting with `pk` token = os. viz import CircleViz # Load data from sample csv data_url = '' df = pd. utils import create_color_stops, df_to_geojson from mapboxgl. Import os import pandas as pd from mapboxgl.
0 Comments
Leave a Reply. |