- if asource:
- y_min, y_max = get_y_limits (asource, data_dates[0+DATE_IGNORE], data_dates[days-1])
- range_delta = y_max * PLOT_RANGE_FACTOR
-
- # this thing alone prevents an interference from toggling the visibility of clines
- # and the scale of the plots; comment this line and you will see :-)
- # reference:
- # https://discourse.bokeh.org/t/autoscaling-of-axis-range-with-streaming-multiline-plot-with-bokeh-server/1284/2?u=comperem
- aplot.y_range=Range1d(y_min - range_delta , y_max + range_delta)
-
- def make_map_plot( data ):
-
- hover_string = [ ('County', '@NAME_2'), ('Incidence', '@incidence'), ]
-
- # According to the docs the colormap parameter of the plot_bokeh function:
- # "Defines the colors to plot. Can be either a list of colors or the name of a Bokeh color palette"
-
- # because our original palette has the colors in the wrong direction
- # and because of this https://github.com/bokeh/bokeh/issues/7297
- # we can't just invert the colormap_range or we loose the legend on the color bar
- # so we we are forced to reverse the palette manually