Fix various filtering/sorting bugs

This commit is contained in:
Sj-Si 2024-04-22 14:01:19 -04:00
parent 42e61d5d90
commit 7c2446c73c
5 changed files with 81 additions and 66 deletions

View file

@ -198,16 +198,8 @@ class Clusterize {
this.#max_items = max_items;
return this.#max_items !== max_items;
}
if (this.#max_items === max_items) {
// No change. do nothing.
return false;
}
// If the number of items changed, we need to update the cluster.
this.#max_items = max_items;
await this.refresh();
// Apply sort to the updated data.
await this.sortData();
return true;
}
// ==== PRIVATE FUNCTIONS ====
@ -266,6 +258,8 @@ class Clusterize {
// Filter is applied to entire dataset.
const max_items = await this.options.callbacks.filterData();
await this.setMaxItems(max_items);
await this.refresh(true);
await this.sortData();
}
#exploreEnvironment(rows, cache) {