From 47551df2f95e892fad01abf40c42c4d9c181bec8 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 4 Jan 2021 12:21:30 +0100 Subject: [PATCH 1/9] Add CountMethodRadios and CardCountMethod enum --- ts/graphs/CountMethodRadios.svelte | 19 +++++++++++++++++++ ts/graphs/graph-helpers.ts | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 ts/graphs/CountMethodRadios.svelte diff --git a/ts/graphs/CountMethodRadios.svelte b/ts/graphs/CountMethodRadios.svelte new file mode 100644 index 000000000..cbb3c1304 --- /dev/null +++ b/ts/graphs/CountMethodRadios.svelte @@ -0,0 +1,19 @@ + + + + diff --git a/ts/graphs/graph-helpers.ts b/ts/graphs/graph-helpers.ts index bed36f6d1..121809042 100644 --- a/ts/graphs/graph-helpers.ts +++ b/ts/graphs/graph-helpers.ts @@ -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[]; From ecbb08e4c51313eac9345216f064de2126fb8c54 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Mon, 4 Jan 2021 14:04:51 +0100 Subject: [PATCH 2/9] Add gatherByQueue and gatherByCtype methods --- ts/graphs/CardCounts.svelte | 11 +++- ts/graphs/CountMethodRadios.svelte | 3 +- ts/graphs/card-counts.ts | 82 +++++++++++++++++++++++------- ts/lib/cards.ts | 7 +++ 4 files changed, 82 insertions(+), 21 deletions(-) diff --git a/ts/graphs/CardCounts.svelte b/ts/graphs/CardCounts.svelte index b31794c22..9af5137d5 100644 --- a/ts/graphs/CardCounts.svelte +++ b/ts/graphs/CardCounts.svelte @@ -1,13 +1,15 @@