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-12-26 18:24:24 +01:00
|
|
|
import type { SvelteComponent } from "svelte/internal";
|
2020-12-26 14:40:55 +01:00
|
|
|
|
2021-04-22 19:55:26 +02:00
|
|
|
import { setupI18n, ModuleName } from "lib/i18n";
|
|
|
|
import { checkNightMode } from "lib/nightmode";
|
2020-12-26 14:40:55 +01:00
|
|
|
|
2021-03-21 13:47:52 +01:00
|
|
|
import GraphsPage from "./GraphsPage.svelte";
|
|
|
|
|
2020-12-26 18:24:24 +01:00
|
|
|
export { default as RangeBox } from "./RangeBox.svelte";
|
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-23 16:15:46 +01:00
|
|
|
export { RevlogRange } from "./graph-helpers";
|
2020-12-22 22:06:12 +01:00
|
|
|
|
2020-12-22 22:25:47 +01:00
|
|
|
export function graphs(
|
|
|
|
target: HTMLDivElement,
|
2020-12-26 18:24:24 +01:00
|
|
|
graphs: SvelteComponent[],
|
2021-03-21 13:47:52 +01:00
|
|
|
{
|
|
|
|
search = "deck:current",
|
|
|
|
days = 365,
|
|
|
|
controller = null as SvelteComponent | null,
|
|
|
|
} = {}
|
2020-12-22 22:25:47 +01:00
|
|
|
): void {
|
2020-12-22 22:06:12 +01:00
|
|
|
const nightMode = checkNightMode();
|
|
|
|
|
2021-03-26 12:22:37 +01:00
|
|
|
setupI18n({ modules: [ModuleName.STATISTICS, ModuleName.SCHEDULING] }).then(() => {
|
2020-06-27 11:24:49 +02:00
|
|
|
new GraphsPage({
|
|
|
|
target,
|
2020-12-22 22:06:12 +01:00
|
|
|
props: {
|
|
|
|
graphs,
|
|
|
|
nightMode,
|
2021-03-22 00:04:24 +01:00
|
|
|
initialSearch: search,
|
|
|
|
initialDays: days,
|
2020-12-26 14:40:55 +01:00
|
|
|
controller,
|
2020-12-22 22:06:12 +01:00
|
|
|
},
|
2020-06-27 11:24:49 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|