2020-06-26 11:25:02 +02:00
|
|
|
<script lang="typescript">
|
2020-06-27 14:10:56 +02:00
|
|
|
import { I18n } from "../i18n";
|
2020-06-26 11:25:02 +02:00
|
|
|
import { HistogramData } from "./histogram-graph";
|
2020-07-22 06:11:22 +02:00
|
|
|
import { GraphRange, RevlogRange } from "./graphs";
|
2020-07-17 05:46:06 +02:00
|
|
|
import { gatherData, GraphData, buildHistogram } from "./future-due";
|
2020-06-26 11:25:02 +02:00
|
|
|
import pb from "../backend/proto";
|
|
|
|
import HistogramGraph from "./HistogramGraph.svelte";
|
2020-07-17 05:46:06 +02:00
|
|
|
import GraphRangeRadios from "./GraphRangeRadios.svelte";
|
2020-06-26 11:25:02 +02:00
|
|
|
|
|
|
|
export let sourceData: pb.BackendProto.GraphsOut | null = null;
|
2020-06-27 14:10:56 +02:00
|
|
|
export let i18n: I18n;
|
|
|
|
|
2020-06-26 11:25:02 +02:00
|
|
|
let graphData = null as GraphData | null;
|
|
|
|
let histogramData = null as HistogramData | null;
|
2020-06-28 11:34:19 +02:00
|
|
|
let backlog: boolean = true;
|
2020-07-17 05:46:06 +02:00
|
|
|
let graphRange: GraphRange = GraphRange.Month;
|
2020-06-26 11:25:02 +02:00
|
|
|
|
|
|
|
$: if (sourceData) {
|
|
|
|
graphData = gatherData(sourceData);
|
|
|
|
}
|
|
|
|
|
|
|
|
$: if (graphData) {
|
2020-07-17 05:46:06 +02:00
|
|
|
histogramData = buildHistogram(graphData, graphRange, backlog, i18n);
|
2020-06-26 11:25:02 +02:00
|
|
|
}
|
2020-06-27 14:10:56 +02:00
|
|
|
|
2020-06-28 06:21:31 +02:00
|
|
|
const title = i18n.tr(i18n.TR.STATISTICS_FUTURE_DUE_TITLE);
|
2020-06-28 09:44:51 +02:00
|
|
|
const subtitle = i18n.tr(i18n.TR.STATISTICS_FUTURE_DUE_SUBTITLE);
|
2020-06-28 11:34:19 +02:00
|
|
|
const backlogLabel = i18n.tr(i18n.TR.STATISTICS_BACKLOG_CHECKBOX);
|
2020-06-26 11:25:02 +02:00
|
|
|
</script>
|
|
|
|
|
2020-07-16 20:44:21 +02:00
|
|
|
<div class="graph" id="graph-future-due">
|
2020-07-06 06:01:49 +02:00
|
|
|
<h1>{title}</h1>
|
2020-06-26 11:25:02 +02:00
|
|
|
|
2020-07-06 06:01:49 +02:00
|
|
|
<div class="range-box-inner">
|
|
|
|
<label>
|
|
|
|
<input type="checkbox" bind:checked={backlog} />
|
|
|
|
{backlogLabel}
|
|
|
|
</label>
|
2020-06-26 11:25:02 +02:00
|
|
|
|
2020-07-17 05:46:06 +02:00
|
|
|
<GraphRangeRadios bind:graphRange {i18n} revlogRange={RevlogRange.All} />
|
2020-07-06 06:01:49 +02:00
|
|
|
</div>
|
2020-06-26 11:25:02 +02:00
|
|
|
|
2020-07-06 06:01:49 +02:00
|
|
|
<div class="subtitle">{subtitle}</div>
|
2020-06-28 09:44:51 +02:00
|
|
|
|
2020-07-06 06:01:49 +02:00
|
|
|
<HistogramGraph data={histogramData} {i18n} />
|
2020-06-26 11:25:02 +02:00
|
|
|
|
2020-07-06 06:01:49 +02:00
|
|
|
</div>
|