anki/ts/graphs/NoDataOverlay.svelte

25 lines
570 B
Svelte
Raw Normal View History

2020-07-06 06:01:49 +02:00
<script lang="typescript">
import type { GraphBounds } from "./graph-helpers";
2020-07-06 06:01:49 +02:00
export let bounds: GraphBounds;
import * as tr from "anki/i18n";
const noData = tr.statisticsNoData();
2020-07-06 06:01:49 +02:00
</script>
<style lang="scss">
.no-data {
rect {
fill: var(--window-bg);
}
text {
text-anchor: middle;
fill: grey;
}
}
</style>
2020-07-06 06:01:49 +02:00
<g class="no-data">
<rect x="0" y="0" width={bounds.width} height={bounds.height} />
<text x="{bounds.width / 2}," y={bounds.height / 2}>{noData}</text>
2020-07-06 06:01:49 +02:00
</g>