Skip to content

Commit aee4469

Browse files
committed
fix reduceData on reindexed facets
1 parent 9508295 commit aee4469

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/facet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ export function expander({plan}, X) {
5050
return V;
5151
}
5252

53-
export function originals(facets) {
54-
return facets.plan ? facets.map((facet) => facet.map((i) => facets.plan[i])) : facets;
53+
export function originals({plan}, I) {
54+
return plan ? I.map((i) => plan[i]) : I;
5555
}

src/transforms/bin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function binn(
211211
const b = fy(bb);
212212
if (filter && !filter.reduce(b, extent)) continue;
213213
groupFacet.push(i++);
214-
groupData.push(reduceData.reduce(originals(b), data, extent));
214+
groupData.push(reduceData.reduce(originals(facets, b), data, extent));
215215
if (K) GK.push(k);
216216
if (Z) GZ.push(G === Z ? f : gZ(b[0]));
217217
if (F) GF.push(G === F ? f : gF(b[0]));

src/transforms/group.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function groupn(
181181
for (const [x, g] of maybeGroup(gg, eX)) {
182182
if (filter && !filter.reduce(g)) continue;
183183
groupFacet.push(i++);
184-
groupData.push(reduceData.reduce(originals(g), data));
184+
groupData.push(reduceData.reduce(originals(facets, g), data));
185185
if (X) GX.push(x);
186186
if (Y) GY.push(y);
187187
if (Z) GZ.push(G === Z ? f : gZ(g[0]));

0 commit comments

Comments
 (0)