I'm working in kepler.gl and loading in data from a database. I want to be able to dynamically update a dataset if the database is updated. Is there any way to add a row to a dataset and update the map?
I've tried removing the dataset (using removeDataset) and adding it back in with the updated data (addDataToMap), but this isn't efficient when it comes to larger datasets.
Thanks in advance.
thank you for using Kepler.gl. I work in in the team who built Kepler.
Currently we don't have a straight way to update an existing dataset. There is an existing issue on our github project: https://github.com/uber/kepler.gl/issues/176.
In the meanwhile, you can change your flow by skipping removeDataSet and call addDataToMap with your new data. Make sure the new dataset id that you are passing as addDataToMap call matches the existing one; by doing so you are going to override existing data with your new data.
Make sure you pass the same configuration that is currently in your kepler state as part of your addDataToMap call.
You can use KeplerGlSchema to export the configuration before you call addDataToMap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With