Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/transforms/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
reduceIdentity,
reduceZ
} from "./group.js";
import {maybeIdentityX, maybeIdentityY} from "./identity.js";
import {maybeInsetX, maybeInsetY} from "./inset.js";

// Group on {z, fill, stroke}, then optionally on y, then bin x.
Expand Down Expand Up @@ -78,12 +79,12 @@ function maybeDenseInterval(bin, k, options = {}) {
return bin(outputs, options);
}

export function maybeDenseIntervalX({y = identity, x = indexOf, ...options} = {}) {
return maybeDenseInterval(binX, "y", withTip({x, y, ...options}, "x"));
export function maybeDenseIntervalX({x = indexOf, ...options} = {}) {
return maybeDenseInterval(binX, "y", withTip({x, ...maybeIdentityY(options)}, "x"));
}

export function maybeDenseIntervalY({x = identity, y = indexOf, ...options} = {}) {
return maybeDenseInterval(binY, "x", withTip({x, y, ...options}, "y"));
export function maybeDenseIntervalY({y = indexOf, ...options} = {}) {
return maybeDenseInterval(binY, "x", withTip({y, ...maybeIdentityX(options)}, "y"));
}

function binn(
Expand Down
Loading