Skip to content

Commit 9ed1365

Browse files
Fix a bug in defining rgb_str in velocity.py.
1 parent 164b7c7 commit 9ed1365

File tree

2 files changed

+11
-32
lines changed

2 files changed

+11
-32
lines changed

examples/Velocity_with_colormap.ipynb

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
{
2929
"cell_type": "code",
30-
"execution_count": 1,
30+
"execution_count": null,
3131
"metadata": {},
3232
"outputs": [],
3333
"source": [
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"cell_type": "code",
42-
"execution_count": 2,
42+
"execution_count": null,
4343
"metadata": {},
4444
"outputs": [],
4545
"source": [
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "code",
58-
"execution_count": 3,
58+
"execution_count": null,
5959
"metadata": {},
6060
"outputs": [],
6161
"source": [
@@ -73,7 +73,7 @@
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": 4,
76+
"execution_count": null,
7777
"metadata": {},
7878
"outputs": [],
7979
"source": [
@@ -82,7 +82,7 @@
8282
},
8383
{
8484
"cell_type": "code",
85-
"execution_count": 5,
85+
"execution_count": null,
8686
"metadata": {},
8787
"outputs": [],
8888
"source": [
@@ -91,7 +91,7 @@
9191
},
9292
{
9393
"cell_type": "code",
94-
"execution_count": 6,
94+
"execution_count": null,
9595
"metadata": {},
9696
"outputs": [],
9797
"source": [
@@ -115,24 +115,9 @@
115115
},
116116
{
117117
"cell_type": "code",
118-
"execution_count": 7,
118+
"execution_count": null,
119119
"metadata": {},
120-
"outputs": [
121-
{
122-
"data": {
123-
"application/vnd.jupyter.widget-view+json": {
124-
"model_id": "935083f2ac9046bb822298214e4f541d",
125-
"version_major": 2,
126-
"version_minor": 0
127-
},
128-
"text/plain": [
129-
"Map(center=[44.33956524809713, -130.60546875000003], controls=(ZoomControl(options=['position', 'zoom_in_text'…"
130-
]
131-
},
132-
"metadata": {},
133-
"output_type": "display_data"
134-
}
135-
],
120+
"outputs": [],
136121
"source": [
137122
"colormap_control = ipyleaflet.ColormapControl(\n",
138123
" caption='Unemployment rate',\n",
@@ -143,15 +128,9 @@
143128
" transparent_bg=False\n",
144129
")\n",
145130
"m.add(wind)\n",
146-
"m.add(colormap_control)"
131+
"m.add(colormap_control)\n",
132+
"m"
147133
]
148-
},
149-
{
150-
"cell_type": "code",
151-
"execution_count": null,
152-
"metadata": {},
153-
"outputs": [],
154-
"source": []
155134
}
156135
],
157136
"metadata": {

ipyleaflet/velocity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _default_color_scale(self):
7676

7777
for color in self.colormap.colors:
7878
rgb_tuple = tuple(int(x * 256) for x in color[:3])
79-
rgb_str = f'rgb({" , ".join(rgb_tuple)})'
79+
rgb_str = f'rgb{str(rgb_tuple)}'
8080
self.color_scale.append(rgb_str)
8181

8282
return self.color_scale

0 commit comments

Comments
 (0)