Comments (2)
FWIW, I think this would be a really useful feature to add to @anywidget/react (as in a new hook or extending the existing hook).
from lonboard.
@kylebarron I see what you're trying to do in #113 - yea, the debounce
is not going to work defined where you have it - I think there's roughly two options here if we want to try with this approach:
- Put the debounce where you have the callback for
onViewStateChange
: https://github.com/developmentseed/lonboard/pull/113/files#diff-c2f8ec75103ae661341f239c22352142d1d5e965cad55b19cfb978902500106cR77 . But you don't want to do that because you want to update the state and have a single source of truth - here I still think what we could have is auseModelState
anduseModelStateUnsynced
or so - where callinguseModelStateUnsynced
just never calls themodel.save_changes()
method. And that should be okay? (And then be more intentional about when you calluseModelState
to actually sync with python). I can try sketching this out. - If you really want something like a
useModelStateDebounced
where that method "debounces" the calls to.save_changes()
, you'd need to have a way within that function to store state of when the last call to.save_changes()
had been made, and conditionally make that call - if this was a traditional REST API, I'd imagine one could create some queue system and be intelligent about it based on the response callback from the server, and cancel previous calls, etc. Would have to think about this, but could also potentially sketch something out.
@kylebarron do you know if this all works if you comment out the model.save_changes()
line? I'll probably try and fix up your branch and give this a whirl - we should definitely be able to get this to work.
from lonboard.
Related Issues (20)
- Google Colab crashes for large datasets HOT 4
- Understanding fly_to() and set_view_state() HOT 3
- Automated widget testing
- [BUG] Error in reprojection from GeoArrow stream with non-WGS84 crs and non-nullable coords HOT 1
- Add test for fixed GeoArrow reprojection with GeoPandas 1.0
- [BUG] None default get_line_color in PolygonLayer not respected HOT 4
- [EPIC] Support for ColumnLayer (extruded point values) HOT 3
- feature: add support to zoom into a specific layer HOT 2
- [BUG] Layer Attribution Option HOT 2
- Rename "other args" to "keyword args" in docstrings
- Move griffe-inherited-docstrings into pyproject.toml docs section HOT 1
- Add CI check for mkdocs build without warning
- Add layer control to permit opacity control
- [BUG] Maps not displaying in jupyter notebook HOT 1
- Why "Input being reprojected to EPSG:4326 CRS"? HOT 2
- Add ESLint HOT 4
- Easier deck.gl debugging for Lonboard issues
- Add ColumnLayer example
- Remove pyarrow as hard dependency HOT 2
- Tooltip viewer can be too crowded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lonboard.