Batch property updates fail
See original GitHub issuePython version: 3.8 ipyleaflet version: 0.13.1 used in a vanilla Jupyter notebook
A question, not a bug: I have a layer group of ~3000 polylines, which I need to re-style in response to user input. I’m only learning ipyleaflet, so I do it naïvely in a loop:
for obj_id, obj_data in data: # len(data) > 3000
line: ipyleaflet.Polyline = self._obj_lines[obj_id]
if obj_data["x"] > user_input:
line.color = 'red'
line.weight = 10
else:
line.color = 'black'
line.weight = 1
Sometimes (not always) these updates get stuck half-way (see the GIF; no line is supposed to stay blue) and nothing short of recreating the whole map object helps, certainly not re-executing the update code.
My guess is that this approach generates too many individual update messages between the kernel and the front-end which leads to some communication breakdown or state discrepancy. If that is correct, what are the better options from the Python side?
- is it possible to manually trigger “state synchronization” to ensure update completion?
- can/should I manually batch updates?
- should I switch to a GeoJSON layer? (GeoData doesn’t seem to support dynamic styling, if I’m correct)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
BatchUpdateException error occurred executing batch update ...
Errors "BatchUpdateException error occurred executing batch update of persistent properties" is seen in ApplicationLog. log after update of ...
Read more >Contact / Company Batch Update via API - with "ignore failing ...
Hello, we are trying to batch update our contacts & companies in Hubspot via the API. As it can happen that the values...
Read more >Batch request fail on updated metadata, despite ... - GitHub
Hi, We have an issue, in a business application, consuming an OData service, using Simple.OData.Client. The issue is, that our application ...
Read more >MySQL Bugs: #96623: batch update with ...
Bug #96623, batch update with rewriteBatchedStatements&useServerPrepStmts send fail request. Submitted: 22 Aug 2019 17:17, Modified: 23 Aug 2019 10:34.
Read more >Hibernate - Batch update returned unexpected row count from ...
I am unable to find the line which causes the issue since hibernate flush the session at the end of the transaction. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This looks like a different issue. Would you mind opening another issue and provide some code to reproduce?
This piece of code should work indeed. The following PR should fix it: #658. I tried locally and could see it working but if you have time to try it out too that would be greatly appreciated 😃