anki/ts/graphs/NoDataOverlay.svelte
2021-03-26 19:13:30 +10:00

26 lines
605 B
Svelte

<script lang="typescript">
import type { I18n } from "anki/i18n";
import type { GraphBounds } from "./graph-helpers";
export let bounds: GraphBounds;
export let i18n: I18n;
const noData = i18n.statisticsNoData();
</script>
<style lang="scss">
.no-data {
rect {
fill: var(--window-bg);
}
text {
text-anchor: middle;
fill: grey;
}
}
</style>
<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>
</g>