Skip to content

Commit 942fdfd

Browse files
committed
TODO: implement {reduce: ƒ, scale}
1 parent d021459 commit 942fdfd

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

test/plots/reducers.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,28 @@ export async function reducerGroupScale() {
245245
]
246246
});
247247
}
248+
249+
// TODO: implement {reduce: ƒ, scale}
250+
/*
251+
export async function reducerGroupScaleFunction() {
252+
const penguins = await d3.csv<any>("data/penguins.csv", d3.autoType);
253+
return Plot.plot({
254+
color: {scheme: "greys"},
255+
marks: [
256+
Plot.barY(
257+
penguins,
258+
Plot.groupX(
259+
{
260+
y: "count",
261+
fill: {
262+
reduce: (index: number[], values: any[]) => d3.mode(index, (i) => values[i]),
263+
scale: true
264+
}
265+
},
266+
{x: "species", fill: (d) => (d.island === "Biscoe" ? "orange" : "green"), fy: "sex"}
267+
)
268+
)
269+
]
270+
});
271+
}
272+
*/

0 commit comments

Comments
 (0)