@@ -4,23 +4,23 @@ import {offset} from "../style.js";
44import { maybeGroup , maybeOutputs , maybeReduce , maybeSubgroup , reduceIdentity } from "./group.js" ;
55
66// Group on {z, fill, stroke}, then optionally on y, then bin x.
7- export function binX ( outputs , { inset, insetLeft, insetRight, ...options } = { } ) {
7+ export function binX ( outputs = { y : "count" } , { inset, insetLeft, insetRight, ...options } = { } ) {
88 let { x, y} = options ;
99 x = maybeBinValue ( x , options , identity ) ;
1010 ( [ insetLeft , insetRight ] = maybeInset ( inset , insetLeft , insetRight ) ) ;
1111 return binn ( x , null , null , y , outputs , { inset, insetLeft, insetRight, ...options } ) ;
1212}
1313
1414// Group on {z, fill, stroke}, then optionally on x, then bin y.
15- export function binY ( outputs , { inset, insetTop, insetBottom, ...options } = { } ) {
15+ export function binY ( outputs = { x : "count" } , { inset, insetTop, insetBottom, ...options } = { } ) {
1616 let { x, y} = options ;
1717 y = maybeBinValue ( y , options , identity ) ;
1818 ( [ insetTop , insetBottom ] = maybeInset ( inset , insetTop , insetBottom ) ) ;
1919 return binn ( null , y , x , null , outputs , { inset, insetTop, insetBottom, ...options } ) ;
2020}
2121
2222// Group on {z, fill, stroke}, then bin on x and y.
23- export function bin ( outputs , { inset, insetTop, insetRight, insetBottom, insetLeft, ...options } = { } ) {
23+ export function bin ( outputs = { fill : "count" } , { inset, insetTop, insetRight, insetBottom, insetLeft, ...options } = { } ) {
2424 const { x, y} = maybeBinValueTuple ( options ) ;
2525 ( [ insetTop , insetBottom ] = maybeInset ( inset , insetTop , insetBottom ) ) ;
2626 ( [ insetLeft , insetRight ] = maybeInset ( inset , insetLeft , insetRight ) ) ;
0 commit comments