@@ -45,6 +45,7 @@ import {
4545 reduceIdentity ,
4646 reduceZ
4747} from "./group.js" ;
48+ import { maybeIdentityX , maybeIdentityY } from "./identity.js" ;
4849import { maybeInsetX , maybeInsetY } from "./inset.js" ;
4950
5051// Group on {z, fill, stroke}, then optionally on y, then bin x.
@@ -78,12 +79,12 @@ function maybeDenseInterval(bin, k, options = {}) {
7879 return bin ( outputs , options ) ;
7980}
8081
81- export function maybeDenseIntervalX ( { y = identity , x = indexOf , ...options } = { } ) {
82- return maybeDenseInterval ( binX , "y" , withTip ( { x, y , ...options } , "x" ) ) ;
82+ export function maybeDenseIntervalX ( { x = indexOf , ...options } = { } ) {
83+ return maybeDenseInterval ( binX , "y" , withTip ( { x, ...maybeIdentityY ( options ) } , "x" ) ) ;
8384}
8485
85- export function maybeDenseIntervalY ( { x = identity , y = indexOf , ...options } = { } ) {
86- return maybeDenseInterval ( binY , "x" , withTip ( { x , y, ...options } , "y" ) ) ;
86+ export function maybeDenseIntervalY ( { y = indexOf , ...options } = { } ) {
87+ return maybeDenseInterval ( binY , "x" , withTip ( { y, ...maybeIdentityX ( options ) } , "y" ) ) ;
8788}
8889
8990function binn (
0 commit comments