File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 20
20
" # Set up for JupyterLite\n " ,
21
21
" try:\n " ,
22
22
" import piplite\n " ,
23
- " await piplite.install([ 'ipyleaflet')\n " ,
23
+ " await piplite.install('ipyleaflet')\n " ,
24
24
" except ImportError:\n " ,
25
25
" pass"
26
26
]
Original file line number Diff line number Diff line change @@ -68,7 +68,25 @@ class Velocity(Layer):
68
68
max_velocity = Float (10 ).tag (sync = True , o = True )
69
69
velocity_scale = Float (0.005 ).tag (sync = True , o = True )
70
70
colormap = Any (linear .YlOrRd_04 )
71
- color_scale = List ([]).tag (sync = True , o = True )
71
+ #color_scale = List([]).tag(sync=True, o=True)
72
+ colors = [
73
+ "rgb(36,104, 180)" ,
74
+ "rgb(60,157, 194)" ,
75
+ "rgb(128,205,193)" ,
76
+ "rgb(151,218,168)" ,
77
+ "rgb(198,231,181)" ,
78
+ "rgb(238,247,217)" ,
79
+ "rgb(255,238,159)" ,
80
+ "rgb(252,217,125)" ,
81
+ "rgb(255,182,100)" ,
82
+ "rgb(252,150,75)" ,
83
+ "rgb(250,112,52)" ,
84
+ "rgb(245,64,32)" ,
85
+ "rgb(237,45,28)" ,
86
+ "rgb(220,24,32)" ,
87
+ "rgb(180,0,35)"
88
+ ]
89
+ color_scale = List (colors ).tag (sync = True , o = True )
72
90
73
91
@default ('color_scale' )
74
92
def _default_color_scale (self ):
@@ -80,3 +98,14 @@ def _default_color_scale(self):
80
98
self .color_scale .append (rgb_str )
81
99
82
100
return self .color_scale
101
+
102
+ @default ('colormap' )
103
+ def _default_colormap (self ):
104
+
105
+
106
+ for color in self .colormap .colors :
107
+ rgb_tuple = tuple (int (x * 256 ) for x in color [:3 ])
108
+ rgb_str = f"rgb{ rgb_tuple } "
109
+ self .color_scale .append (rgb_str )
110
+
111
+ return self .color_scale
You can’t perform that action at this time.
0 commit comments