Skip to content

Commit 17fc93a

Browse files
authored
Choropleth: Fix infinite callback loop (#523)
1 parent f9a6a22 commit 17fc93a

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

examples/Choropleth.ipynb

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,7 @@
7272
"metadata": {},
7373
"outputs": [],
7474
"source": [
75-
"layer.style_callback = compute_style"
76-
]
77-
},
78-
{
79-
"cell_type": "code",
80-
"execution_count": null,
81-
"metadata": {},
82-
"outputs": [],
83-
"source": [
84-
"m.add_layer(layer_callback)\n",
85-
"m"
75+
"layer.style_callback=compute_style"
8676
]
8777
},
8878
{

ipyleaflet/leaflet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def _validate_style_callback(self, proposal):
547547
raise TraitError('style_callback should be callable (functor/function/lambda)')
548548
return proposal.value
549549

550-
@observe('data', 'style', 'style_callback')
550+
@observe('style', 'style_callback')
551551
def _update_data(self, change):
552552
self.data = self._get_data()
553553

0 commit comments

Comments
 (0)