mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00

This prevents the page scrolling off screen on small devices. This is a quick fix, and further tweaks to the layout are welcome.
39 lines
1 KiB
Svelte
39 lines
1 KiB
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import type { GraphsResponse } from "@generated/anki/stats_pb";
|
|
import * as tr from "@generated/ftl";
|
|
|
|
import { renderTrueRetention } from "./true-retention";
|
|
import Graph from "./Graph.svelte";
|
|
import type { RevlogRange } from "./graph-helpers";
|
|
|
|
export let revlogRange: RevlogRange;
|
|
export let sourceData: GraphsResponse | null = null;
|
|
|
|
let trueRetentionHtml: string;
|
|
|
|
$: if (sourceData) {
|
|
trueRetentionHtml = renderTrueRetention(sourceData, revlogRange);
|
|
}
|
|
|
|
const title = tr.statisticsTrueRetentionTitle();
|
|
const subtitle = tr.statisticsTrueRetentionSubtitle();
|
|
</script>
|
|
|
|
<Graph {title} {subtitle}>
|
|
{#if trueRetentionHtml}
|
|
<div class="true-retention-table">
|
|
{@html trueRetentionHtml}
|
|
</div>
|
|
{/if}
|
|
</Graph>
|
|
|
|
<style>
|
|
.true-retention-table {
|
|
overflow-x: auto;
|
|
margin-top: 1rem;
|
|
}
|
|
</style>
|