from bokeh.io import show, output_notebook
from bokeh.models import GeoJSONDataSource, HoverTool, LinearColorMapper
from bokeh.plotting import figure
from bokeh.palettes import Viridis256
output_notebook()
with open(r'deps.geojson') as f:
geo_src = GeoJSONDataSource(geojson=f.read())
cmap = LinearColorMapper(palette=Viridis256)
TOOLS = "pan,wheel_zoom,box_zoom,reset,hover,save"
p = figure(title='France Département', tools=TOOLS, x_axis_location=None, y_axis_location=None, width=500, height=500)
p.grid.grid_line_color = None
p.patches('xs', 'ys', fill_alpha=0.7, fill_color={'field': 'CODE_DEPT', 'transform': cmap},
line_color='black', line_width=0.5, source=geo_src)
hover = p.select_one(HoverTool)
hover.point_policy = 'follow_mouse'
hover.tooltips = [('Département:', '@NOM_DEPT')]
show(p)