Skip to content

Commit

Permalink
fix(core): use JSON.stringify in facetCoords InternMap
Browse files Browse the repository at this point in the history
Duplicate entries were recorded.
  • Loading branch information
tuner committed Feb 16, 2024
1 parent a1e6a0e commit e0e195a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class View {
*
* @type {Map<any, import("./layout/rectangle.js").default>}
*/
facetCoords = new InternMap();
facetCoords = new InternMap([], JSON.stringify);

/**
*
Expand Down Expand Up @@ -493,6 +493,8 @@ export default class View {
* @type {import("../types/rendering.js").RenderMethod}
*/
render(context, coords, options = {}) {
// TODO: When using sample faceting, all facets have the same coords.
// It would be better to save only single coords with an `undefined` facetId.
if (options.firstFacet) {
this.facetCoords.clear();
}
Expand Down

0 comments on commit e0e195a

Please sign in to comment.