8
8
import xyzservices
9
9
from datetime import date , timedelta
10
10
from math import isnan
11
- from branca .colormap import linear , ColorMap
11
+ from branca .colormap import linear , LinearColormap , ColorMap
12
12
from IPython .display import display
13
13
import warnings
14
14
@@ -799,8 +799,16 @@ class Heatmap(RasterLayer):
799
799
Radius of the data points.
800
800
blur: float, default 15.
801
801
Blurring intensity.
802
- gradient: dict, default {0.4: 'blue', 0.6: 'cyan', 0.7: 'lime', 0.8: 'yellow', 1.0: 'red'}
802
+ values : list, default [0.4, 0.6, 0.7, 0.8, 1.0]
803
+ list of values to define the gradient
804
+ colors : list, default ['blue', 'cyan', 'lime', 'yellow', 'red']
805
+ list of colors to define the gradient
806
+ dict: dict, default built from values (keys) and colors lists (values)
807
+ dictionnary mapping value to colors.
808
+ gradient : Dict, default built from dict
803
809
Colors used for the color-mapping from low to high heatmap intensity.
810
+ colormap: branca.colormap.LinearColorMap instance
811
+ The colormap used for displaying the HeatMap data, defined with the same min and max values and colors than the gradient.
804
812
"""
805
813
806
814
_view_name = Unicode ('LeafletHeatmapView' ).tag (sync = True )
@@ -815,6 +823,15 @@ class Heatmap(RasterLayer):
815
823
radius = Float (25.0 ).tag (sync = True , o = True )
816
824
blur = Float (15.0 ).tag (sync = True , o = True )
817
825
gradient = Dict ({0.4 : 'blue' , 0.6 : 'cyan' , 0.7 : 'lime' , 0.8 : 'yellow' , 1.0 : 'red' }).tag (sync = True , o = True )
826
+ colors = ['blue' , 'cyan' , 'lime' , 'yellow' , 'red' ]
827
+ values = [0.4 , 0.6 , 0.7 , 0.8 , 1.0 ]
828
+ dict = {}
829
+ for i in range (len (values )):
830
+ dict [values [i ]] = colors [i ]
831
+ vmin = values [0 ]
832
+ vmax = values [len (values )- 1 ]
833
+ gradient = Dict (dict ).tag (sync = True , o = True )
834
+ colormap = LinearColormap (colors , vmin = vmin , vmax = vmax )
818
835
819
836
820
837
class VectorTileLayer (Layer ):
0 commit comments