ee9af871b7
* Include base styles in graphs-base.scss This includes the custom scrollbar styles, which were missing on the stats page. * Set responsive grid layout on GraphsPage, use TitledContainer component + use global button style, tweak input appearance and other small changes * Improve margins on GraphsPage
70 lines
1.7 KiB
Svelte
70 lines
1.7 KiB
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import TitledContainer from "../components/TitledContainer.svelte";
|
|
|
|
export let title: string;
|
|
export let subtitle: string | null = null;
|
|
</script>
|
|
|
|
<TitledContainer {title}>
|
|
<div class="graph">
|
|
{#if subtitle}
|
|
<div class="subtitle">{subtitle}</div>
|
|
{/if}
|
|
<slot />
|
|
</div>
|
|
</TitledContainer>
|
|
|
|
<style lang="scss">
|
|
@use "sass/elevation" as *;
|
|
.graph {
|
|
page-break-inside: avoid;
|
|
|
|
/* See graph-styles.ts for constants referencing global styles */
|
|
: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;
|
|
}
|
|
}
|
|
|
|
&:focus {
|
|
outline: 0;
|
|
}
|
|
}
|
|
|
|
.subtitle {
|
|
text-align: center;
|
|
margin-bottom: 1em;
|
|
}
|
|
</style>
|