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
6 changes: 5 additions & 1 deletion src/scales/quantitative.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function Scheme(scheme) {
export function ScaleQ(key, scale, channels, {
nice,
clamp,
domain = inferDomain(channels),
domain = (registry.get(key) === radius ? inferRadialDomain : inferDomain)(channels),
round,
range = registry.get(key) === radius ? inferRadialRange(channels, domain) : undefined,
scheme,
Expand Down Expand Up @@ -219,6 +219,10 @@ function inferDomain(channels) {
];
}

function inferRadialDomain(channels) {
return [0, max(channels, ({value}) => value === undefined ? value : max(value))];
}

// We don’t want the upper bound of the radial domain to be zero, as this would
// be degenerate, so we ignore nonpositive values.
function inferRadialRange(channels, domain) {
Expand Down
Loading