mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
fix bar of wrong size
This commit is contained in:
parent
f072710f67
commit
cfc33815da
1 changed files with 5 additions and 1 deletions
|
@ -138,7 +138,7 @@ export function renderReviews(
|
||||||
}
|
}
|
||||||
const desiredBars = Math.min(70, Math.abs(xMin!));
|
const desiredBars = Math.min(70, Math.abs(xMin!));
|
||||||
|
|
||||||
const x = scaleLinear().domain([xMin!, xMax]);
|
const x = scaleLinear().domain([xMin!, xMax]).nice(desiredBars);
|
||||||
const sourceMap = showTime ? sourceData.reviewTime : sourceData.reviewCount;
|
const sourceMap = showTime ? sourceData.reviewTime : sourceData.reviewCount;
|
||||||
const bins = histogram()
|
const bins = histogram()
|
||||||
.value((m) => {
|
.value((m) => {
|
||||||
|
@ -347,6 +347,10 @@ export function renderReviews(
|
||||||
.attr("height", () => y(0) - y(yMax!))
|
.attr("height", () => y(0) - y(yMax!))
|
||||||
.on("mousemove", function (this: any, d: any, idx) {
|
.on("mousemove", function (this: any, d: any, idx) {
|
||||||
const [x, y] = mouse(document.body);
|
const [x, y] = mouse(document.body);
|
||||||
|
if (d.x0! >= 0) {
|
||||||
|
// don't show 'in x days' at the end of the graph
|
||||||
|
return;
|
||||||
|
}
|
||||||
showTooltip(tooltipText(d, areaData[idx + 1]), x, y);
|
showTooltip(tooltipText(d, areaData[idx + 1]), x, y);
|
||||||
})
|
})
|
||||||
.on("mouseout", hideTooltip);
|
.on("mouseout", hideTooltip);
|
||||||
|
|
Loading…
Reference in a new issue