Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to dynamically add to a dataset in kepler.gl

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.

like image 453
Ali Avatar asked Jul 24 '18 15:07

Ali


1 Answers

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

like image 196
Keldon Avatar answered Sep 28 '22 00:09

Keldon