adilyalcin / Keshif

Keshif - Data Made Explorable (Prototype)
https://keshif.me
BSD 3-Clause "New" or "Revised" License
457 stars 123 forks source link

refresh browser after deleting records? #158

Open magneticnorth opened 8 years ago

magneticnorth commented 8 years ago

Greetings. If I create a feature that deletes elements from the array browser.records (in my case based on isWanted), what APIs need to be called to get the browser correctly updated? I've tried: browser.clearFilters_All(); browser.update_Records_Wanted_Count(); browser.updateAfterFilter(); browser.onReady(); but my date summary still shows the original data in the background. Other aggregates actually look OK.

adilyalcin commented 8 years ago

Great question that steps into uncharted territories!

I do not have an answer off the top of my head. I never thought of the case where records would be removed. I have been mostly assuming data is static after it's loaded, but things may slowly change with specific use cases like you suggested.

Sometime later this week, I may take a look at it and provide a simple API entry point. It should be relatively easy to develop, but the internals of Keshif is not well documented especially for outside use (sorry!). Also, I need to figure out how to do this effectively. Removing one item would be different than removing multiple or refreshing all of the data. Also, making such changes persistent is another challenge: When you reload the page, you need to remove these items from the data again. Keshif would not be able to handle that now, since it does not have persistent storage on the client or some extra data storage on the cloud. You'd need to take care of the removed data at some other location, and re-delete them on page load if you want some persistency.

@magneticnorth , let me know if you have other comments or questions, and if you'd like me to take a look at this later this week.

magneticnorth commented 8 years ago

Adil, of course I would be delighted if you can make any time to look at this. I did try loadCharts(), which threw a lot of warnings about aggregates that had already been defined, but seemed to possible do The Right Thing. The use case is that the operator wishes to cut down the number of records to make subsequent operations more efficient. (If you try running the configuration tool on a data set with tens of thousands of records and dozens of columns, you'll notice the data browser sometimes goes off for a while to talk to itself and think hard, which may be frustrating to some people.) Best wishes and thank you!