Skip to content

Instantly share code, notes, and snippets.

@yosiat
Created December 3, 2013 20:44
Show Gist options
  • Save yosiat/7777168 to your computer and use it in GitHub Desktop.
Save yosiat/7777168 to your computer and use it in GitHub Desktop.
crossfilter replace POC
function replace(newData) {
var nindex = crossfilter_range(newData.length);
// Update indexes.
removeDataListeners.forEach(function(l) {
l(nindex);
});
// Remove all matching records from groups.
filterListeners.forEach(function(l) {
l(0, [], data);
});
var oldDataLength = data.length;
data = newData;
n = newData.length;
filters = crossfilter_array8(n);
dataListeners.forEach(function(l) {
l(newData, oldDataLength, n);
});
return crossfilter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment