diff --git a/ts/graphs/FutureDue.svelte b/ts/graphs/FutureDue.svelte index 984707a09..a10560b8f 100644 --- a/ts/graphs/FutureDue.svelte +++ b/ts/graphs/FutureDue.svelte @@ -53,7 +53,7 @@ - + diff --git a/ts/graphs/future-due.ts b/ts/graphs/future-due.ts index 1ae73c0bf..085a987e6 100644 --- a/ts/graphs/future-due.ts +++ b/ts/graphs/future-due.ts @@ -145,6 +145,24 @@ export function buildHistogram( return `${days}:
${cards}
${totalLabel}: ${cumulative}`; } + function makeQuery( + data: HistogramData, + binIdx: number, + ): string { + const bin = data.bins[binIdx]; + const start = bin.x0!; + const end = bin.x1! - 1; + + if (start === end) { + return `"prop:due=${start}"` + } + + const fromQuery = `"prop:due>=${start}"` + const tillQuery = `"prop:due<=${end}"` + + return `${fromQuery} AND ${tillQuery}` + } + const periodDays = xMax! - xMin!; const tableData = [ { @@ -171,6 +189,7 @@ export function buildHistogram( bins, total, hoverText, + makeQuery, showArea: true, colourScale, binValue,