Merge pull request #907 from hgiesel/easegraph

Include many more cards in the ease graph
This commit is contained in:
Damien Elmes 2021-01-09 09:22:42 +10:00 committed by GitHub
commit 1731f71998
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@
import type pb from "anki/backend_proto"; import type pb from "anki/backend_proto";
import { extent, histogram, sum } from "d3-array"; import { extent, histogram, sum } from "d3-array";
import { scaleLinear, scaleSequential } from "d3-scale"; import { scaleLinear, scaleSequential } from "d3-scale";
import { CardQueue } from "anki/cards"; import { CardType } from "anki/cards";
import type { HistogramData } from "./histogram-graph"; import type { HistogramData } from "./histogram-graph";
import { interpolateRdYlGn } from "d3-scale-chromatic"; import { interpolateRdYlGn } from "d3-scale-chromatic";
import type { I18n } from "anki/i18n"; import type { I18n } from "anki/i18n";
@ -21,7 +21,7 @@ export interface GraphData {
export function gatherData(data: pb.BackendProto.GraphsOut): GraphData { export function gatherData(data: pb.BackendProto.GraphsOut): GraphData {
const eases = (data.cards as pb.BackendProto.Card[]) const eases = (data.cards as pb.BackendProto.Card[])
.filter((c) => c.queue == CardQueue.Review) .filter((c) => [CardType.Review, CardType.Relearn].includes(c.ctype))
.map((c) => c.easeFactor / 10); .map((c) => c.easeFactor / 10);
return { eases }; return { eases };
} }