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

1

6

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.

Oxidation answered 24/7, 2018 at 15:45 Comment(0)
S
6

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

Snuffy answered 27/7, 2018 at 21:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.