2021-04-13 11:02:41 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2021-10-26 00:43:02 +02:00
|
|
|
<script lang="ts">
|
2022-11-02 09:23:08 +01:00
|
|
|
import TitledContainer from "../components/TitledContainer.svelte";
|
|
|
|
|
2021-03-21 13:47:52 +01:00
|
|
|
export let title: string;
|
|
|
|
export let subtitle: string | null = null;
|
|
|
|
</script>
|
|
|
|
|
2022-12-01 07:33:52 +01:00
|
|
|
<TitledContainer class="d-flex flex-column" {title}>
|
|
|
|
<div class="graph d-flex flex-grow-1 flex-column justify-content-center">
|
2022-11-02 09:23:08 +01:00
|
|
|
{#if subtitle}
|
|
|
|
<div class="subtitle">{subtitle}</div>
|
|
|
|
{/if}
|
|
|
|
<slot />
|
|
|
|
</div>
|
|
|
|
</TitledContainer>
|
2021-05-26 01:21:33 +02:00
|
|
|
|
2021-03-21 13:47:52 +01:00
|
|
|
<style lang="scss">
|
2022-11-02 09:23:08 +01:00
|
|
|
@use "sass/elevation" as *;
|
2021-03-21 13:47:52 +01:00
|
|
|
.graph {
|
2021-03-21 16:04:38 +01:00
|
|
|
/* See graph-styles.ts for constants referencing global styles */
|
2021-03-21 15:59:11 +01:00
|
|
|
:global(.graph-element-clickable) {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Customizing the standard x and y tick markers and text on the graphs.
|
|
|
|
* The `tick` class is automatically added by d3. */
|
|
|
|
:global(.tick) {
|
|
|
|
:global(line) {
|
|
|
|
opacity: 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(text) {
|
|
|
|
opacity: 0.5;
|
|
|
|
font-size: 10px;
|
|
|
|
|
|
|
|
@media only screen and (max-width: 800px) {
|
|
|
|
font-size: 13px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media only screen and (max-width: 600px) {
|
|
|
|
font-size: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.tick-odd) {
|
|
|
|
@media only screen and (max-width: 600px) {
|
|
|
|
/* on small screens, hide every second row on graphs that have
|
|
|
|
* marked the ticks as odd */
|
|
|
|
display: none;
|
|
|
|
}
|
2021-03-22 01:44:07 +01:00
|
|
|
}
|
2021-03-21 22:09:34 +01:00
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: 0;
|
2021-03-21 15:59:11 +01:00
|
|
|
}
|
2021-03-21 13:47:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.subtitle {
|
|
|
|
text-align: center;
|
|
|
|
margin-bottom: 1em;
|
|
|
|
}
|
|
|
|
</style>
|