mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -05:00
update graph so that the tooltip day label uses integer day boundaries
and removed earlier fix which didnt work
This commit is contained in:
parent
dda192f24c
commit
26e5ae2f67
2 changed files with 5 additions and 4 deletions
|
|
@ -255,6 +255,7 @@ Ranjit Odedra <ranjitodedra.dev@gmail.com>
|
|||
Eltaurus <https://github.com/Eltaurus-Lt>
|
||||
jariji
|
||||
Francisco Esteva <fr.esteva@duocuc.cl>
|
||||
Junia Mannervik <junia.mannervik@gmail.com>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
|||
|
|
@ -111,9 +111,7 @@ export function renderReviews(
|
|||
const desiredBars = Math.min(70, Math.abs(xMin!));
|
||||
|
||||
const x = scaleLinear().domain([xMin!, xMax]);
|
||||
if (range === GraphRange.AllTime) {
|
||||
x.nice(desiredBars);
|
||||
}
|
||||
|
||||
|
||||
const sourceMap = showTime ? sourceData.reviewTime : sourceData.reviewCount;
|
||||
const bins = bin()
|
||||
|
|
@ -212,7 +210,9 @@ export function renderReviews(
|
|||
}
|
||||
|
||||
function tooltipText(d: BinType, cumulative: number): string {
|
||||
const day = dayLabel(d.x0!, d.x1!);
|
||||
const startDay = Math.trunc(d.x0!);
|
||||
const endDay = Math.trunc(d.x1!);
|
||||
const day = dayLabel(startDay, endDay);
|
||||
const totals = totalsForBin(d);
|
||||
const dayTotal = valueLabel(sum(totals));
|
||||
let buf = `<table><tr><td>${day}</td><td align=end>${dayTotal}</td></tr>`;
|
||||
|
|
|
|||
Loading…
Reference in a new issue