2020-06-27 11:24:49 +02:00
|
|
|
// Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
2020-11-05 02:01:30 +01:00
|
|
|
import { setupI18n } from "anki/i18n";
|
|
|
|
import GraphsPage from "./GraphsPage.svelte";
|
|
|
|
import { checkNightMode } from "anki/nightmode";
|
2020-06-27 11:24:49 +02:00
|
|
|
|
2020-12-22 22:06:12 +01:00
|
|
|
export { default as IntervalsGraph } from "./IntervalsGraph.svelte";
|
|
|
|
export { default as EaseGraph } from "./EaseGraph.svelte";
|
|
|
|
export { default as AddedGraph } from "./AddedGraph.svelte";
|
|
|
|
export { default as TodayStats } from "./TodayStats.svelte";
|
|
|
|
export { default as ButtonsGraph } from "./ButtonsGraph.svelte";
|
|
|
|
export { default as CardCounts } from "./CardCounts.svelte";
|
|
|
|
export { default as HourGraph } from "./HourGraph.svelte";
|
|
|
|
export { default as FutureDue } from "./FutureDue.svelte";
|
|
|
|
export { default as ReviewsGraph } from "./ReviewsGraph.svelte";
|
|
|
|
export { default as CalendarGraph } from "./CalendarGraph.svelte";
|
|
|
|
|
2020-12-22 22:25:47 +01:00
|
|
|
export function graphs(
|
|
|
|
target: HTMLDivElement,
|
|
|
|
graphs: any[], {
|
|
|
|
search = "deck:current",
|
|
|
|
days = 31,
|
2020-12-22 22:36:39 +01:00
|
|
|
withRangeBox = true,
|
2020-12-22 22:25:47 +01:00
|
|
|
} = {},
|
|
|
|
): void {
|
2020-12-22 22:06:12 +01:00
|
|
|
const nightMode = checkNightMode();
|
|
|
|
|
2020-06-27 11:24:49 +02:00
|
|
|
setupI18n().then((i18n) => {
|
|
|
|
new GraphsPage({
|
|
|
|
target,
|
2020-12-22 22:06:12 +01:00
|
|
|
props: {
|
|
|
|
i18n,
|
|
|
|
graphs,
|
|
|
|
nightMode,
|
2020-12-22 22:25:47 +01:00
|
|
|
search,
|
|
|
|
days,
|
2020-12-22 22:36:39 +01:00
|
|
|
withRangeBox,
|
2020-12-22 22:06:12 +01:00
|
|
|
},
|
2020-06-27 11:24:49 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|