Skip to content

Commit 20c1bdd

Browse files
committed
Remove workaround for mosaic client updates
The manual listener for `filterBy` changes is no longer needed with the latest mosaic. The coordinator now properly handles `Selection` updates and triggers query/queryResult calls when filterBy is updated.
1 parent 247070f commit 20c1bdd

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

lib/clients/ValueCounts.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,6 @@ export class ValueCounts extends MosaicClient {
4343
this.#table = options.table;
4444
this.#column = options.field.name;
4545
this.#field = options.field;
46-
47-
// FIXME: There is some issue with the mosaic client or the query we
48-
// are using here. Updates to the Selection (`filterBy`) seem to be
49-
// missed by the coordinator, and query/queryResult are not called
50-
// by the coordinator when the filterBy is updated.
51-
//
52-
// Here we manually listen for the changes to filterBy and update this
53-
// client internally. It _should_ go through the coordinator.
54-
options.filterBy.addEventListener("value", async () => {
55-
if (!this.#plot || !this.coordinator) {
56-
return;
57-
}
58-
let filters = options.filterBy.predicate(this);
59-
assert(
60-
isExprNodeArray(filters),
61-
`Filter is not expression array: ${filters}`,
62-
);
63-
let query = this.query(filters);
64-
let data = await this.coordinator.query(query);
65-
assert(isFlechetteTable(data), "Expected a flechette table.");
66-
this.#plot.data.value = data;
67-
});
6846
}
6947

7048
override query(filter: Array<ExprNode> = []): Query {

0 commit comments

Comments
 (0)