2020-06-26 02:42:10 +02:00
|
|
|
<script lang="typescript">
|
|
|
|
import { gatherData, TodayData } from "./today";
|
2020-06-27 11:24:49 +02:00
|
|
|
import { studiedToday } from "../time";
|
2020-06-26 02:42:10 +02:00
|
|
|
import pb from "../backend/proto";
|
2020-06-27 11:24:49 +02:00
|
|
|
import { I18n } from "../i18n";
|
2020-06-26 02:42:10 +02:00
|
|
|
|
|
|
|
export let sourceData: pb.BackendProto.GraphsOut | null = null;
|
2020-06-27 11:24:49 +02:00
|
|
|
export let i18n: I18n;
|
2020-06-26 02:42:10 +02:00
|
|
|
|
|
|
|
let todayData: TodayData | null = null;
|
|
|
|
$: if (sourceData) {
|
2020-06-27 11:24:49 +02:00
|
|
|
todayData = gatherData(sourceData, i18n);
|
2020-06-26 02:42:10 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-06-27 11:24:49 +02:00
|
|
|
{#if todayData}
|
|
|
|
<div class="graph">
|
2020-06-27 12:31:33 +02:00
|
|
|
<h1>{todayData.title}</h1>
|
2020-06-27 11:24:49 +02:00
|
|
|
|
2020-06-27 12:31:33 +02:00
|
|
|
<div class="legend-outer">
|
|
|
|
{#each todayData.lines as line}
|
|
|
|
<div>{line}</div>
|
|
|
|
{/each}
|
|
|
|
</div>
|
2020-06-27 11:24:49 +02:00
|
|
|
</div>
|
|
|
|
{/if}
|