reduce maximum lightness in added/interval graphs
This commit is contained in:
parent
15c50e68eb
commit
ddfd6511bf
@ -68,7 +68,10 @@ export function buildHistogram(
|
||||
return [null, []];
|
||||
}
|
||||
|
||||
const colourScale = scaleSequential(interpolateBlues).domain([xMin!, xMax]);
|
||||
const adjustedRange = scaleLinear().range([0.7, 0.3]);
|
||||
const colourScale = scaleSequential((n) =>
|
||||
interpolateBlues(adjustedRange(n))
|
||||
).domain([xMax!, xMin!]);
|
||||
|
||||
const totalInPeriod = sum(bins, (bin) => bin.length);
|
||||
const cardsPerDay = Math.round(mean(bins, (bin) => bin.length) ?? 0);
|
||||
|
@ -67,7 +67,6 @@ export function prepareIntervalData(
|
||||
return [null, []];
|
||||
}
|
||||
|
||||
const total = allIntervals.length;
|
||||
const [_xMinOrig, origXMax] = extent(allIntervals);
|
||||
let xMax = origXMax;
|
||||
|
||||
@ -102,9 +101,10 @@ export function prepareIntervalData(
|
||||
return [null, []];
|
||||
}
|
||||
|
||||
// start slightly darker
|
||||
const shiftedMin = xMin! - Math.round((xMax - xMin!) / 10);
|
||||
const colourScale = scaleSequential(interpolateBlues).domain([shiftedMin, xMax]);
|
||||
const adjustedRange = scaleLinear().range([0.7, 0.3]);
|
||||
const colourScale = scaleSequential((n) =>
|
||||
interpolateBlues(adjustedRange(n))
|
||||
).domain([xMax!, xMin!]);
|
||||
|
||||
function hoverText(
|
||||
data: HistogramData,
|
||||
|
Loading…
Reference in New Issue
Block a user