Skip to content

Commit 1f70b72

Browse files
committed
binned replaces input
1 parent 4bcabf0 commit 1f70b72

File tree

2 files changed

+43
-31
lines changed

2 files changed

+43
-31
lines changed

src/transforms/bin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function binn(
7777
// Greedily materialize the z, fill, and stroke channels (if channels and not
7878
// constants) so that we can reference them for subdividing groups without
7979
// computing them more than once.
80-
const {z, fill, stroke, ...options} = inputs;
80+
const {x, y, z, fill, stroke, ...options} = inputs;
8181
const [GZ, setGZ] = maybeLazyChannel(z);
8282
const [vfill] = maybeColor(fill);
8383
const [vstroke] = maybeColor(stroke);
@@ -89,9 +89,9 @@ function binn(
8989
fill: GF,
9090
stroke: GS,
9191
...options,
92+
...BX1 ? {x1: BX1, x2: BX2} : {x},
93+
...BY1 ? {y1: BY1, y2: BY2} : {y},
9294
...GK && {[gk]: GK},
93-
...BX1 && {x1: BX1, x2: BX2},
94-
...BY1 && {y1: BY1, y2: BY2},
9595
...Object.fromEntries(outputs.map(({name, output}) => [name, output])),
9696
transform: maybeTransform(options, (data, facets) => {
9797
const K = valueof(data, k);

test/output/penguinMassSpecies.svg

Lines changed: 40 additions & 28 deletions
Loading

0 commit comments

Comments
 (0)