Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update_graph_1(jsonified_data, overlay_choice, year_choice):
gdf = gpd.read_file(jsonified_data)
tmp = map_layout.copy()
gdf[gdf['year'] == year_choice]
gdf = gdf.assign(
cl=mapclassify.Equal_Interval(gdf[overlay_choice], k=6).yb)
# Create a layer for each region colored by LEP value
gdf = gdf[['geoid', 'cl', 'geometry']]
layers = []
for i, lyr in enumerate(precomputed_color_ranges):
example = {
'name': 'Layer name',
'source': json.loads(gdf[gdf.cl == i].to_json()),
'sourcetype': 'geojson',
'type': 'fill',
'opacity': 0.8,
'color': lyr
}
layers.append(example)