diff --git a/ts/src/stats/GraphsPage.svelte b/ts/src/stats/GraphsPage.svelte index d8333ace0..22649d14f 100644 --- a/ts/src/stats/GraphsPage.svelte +++ b/ts/src/stats/GraphsPage.svelte @@ -7,7 +7,7 @@ @@ -37,22 +51,26 @@ Time - - - - + {#if revlogRange >= RevlogRange.Year} + + + + {/if} + {#if revlogRange === RevlogRange.All} + + {/if} +
+ diff --git a/ts/src/stats/future-due.ts b/ts/src/stats/future-due.ts index 0ea76177f..a52ed3111 100644 --- a/ts/src/stats/future-due.ts +++ b/ts/src/stats/future-due.ts @@ -26,7 +26,7 @@ export enum FutureDueRange { export function gatherData(data: pb.BackendProto.GraphsOut): GraphData { const due = (data.cards as pb.BackendProto.Card[]) - .filter((c) => c.queue == CardQueue.Review) // && c.due >= data.daysElapsed) + .filter((c) => c.queue == CardQueue.Review && c.due >= data.daysElapsed) .map((c) => c.due - data.daysElapsed); const dueCounts = rollup( due, diff --git a/ts/src/stats/graphs.css b/ts/src/stats/graphs.css index 55db1b93e..9587fcecc 100644 --- a/ts/src/stats/graphs.css +++ b/ts/src/stats/graphs.css @@ -7,7 +7,7 @@ background-color: white; padding: 15px; border-radius: 5px; - font-size: 20px; + font-size: 15px; opacity: 0; pointer-events: none; transition: opacity 0.3s; @@ -48,6 +48,7 @@ .range-box { position: fixed; + z-index: 1; top: 0; width: 100%; height: 4em; @@ -85,6 +86,11 @@ pointer-events: all; } +.hoverzone rect:hover { + fill: grey; + opacity: 0.05; +} + @keyframes spin { 0% { -webkit-transform: rotate(0deg); @@ -108,3 +114,22 @@ opacity: 0.5; transition: opacity 1s; } + +.tooltip-area { + height: 4em; +} + +.tooltip-area > * { + flex: 1 100%; + justify-content: center; + display: flex; +} + +.legend-outer { + display: flex; + justify-content: center; +} + +.legend-outer div { + padding-left: 1em; +} diff --git a/ts/src/stats/graphs.ts b/ts/src/stats/graphs.ts index eb8e59267..c5ccfd0b3 100644 --- a/ts/src/stats/graphs.ts +++ b/ts/src/stats/graphs.ts @@ -34,7 +34,7 @@ export async function getGraphData( return pb.BackendProto.GraphsOut.decode(bytes); } -export enum GraphRange { +export enum RevlogRange { Month = 1, Year = 2, All = 3, diff --git a/ts/src/stats/reviews.ts b/ts/src/stats/reviews.ts index 1c4ad1b4f..c107da39a 100644 --- a/ts/src/stats/reviews.ts +++ b/ts/src/stats/reviews.ts @@ -106,19 +106,14 @@ function cumulativeBinValue(bin: BinType, idx: number): number { return sum(totalsForBin(bin).slice(0, idx + 1)); } -function tooltipText(d: BinType, cumulative: number): string { - return `bin: ${JSON.stringify(totalsForBin(d))}