Add CountMethodRadios and CardCountMethod enum

This commit is contained in:
Henrik Giesel 2021-01-04 12:21:30 +01:00
parent 94fe1f898f
commit 47551df2f9
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<script lang="typescript">
import type { I18n } from "anki/i18n";
import { CardCountMethod } from "./graph-helpers";
export let i18n: I18n;
export let cardCountMethod: CardCountMethod;
const byType = "By card type";
const byQueue = "By scheduling Queue";
</script>
<label>
<input type="radio" bind:group={cardCountMethod} value={CardCountMethod.ByType} />
{byType}
</label>
<label>
<input type="radio" bind:group={cardCountMethod} value={CardCountMethod.ByQueue} />
{byQueue}
</label>

View File

@ -33,6 +33,12 @@ export enum GraphRange {
AllTime = 3,
}
// how card should be counted
export enum CardCountMethod {
ByType = 0,
ByQueue = 1,
}
export interface GraphsContext {
cards: pb.BackendProto.Card[];
revlog: pb.BackendProto.RevlogEntry[];