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">
|
2020-06-23 11:07:47 +02:00
|
|
|
import AxisTicks from "./AxisTicks.svelte";
|
2021-03-21 10:50:35 +01:00
|
|
|
import CumulativeOverlay from "./CumulativeOverlay.svelte";
|
2022-02-04 09:36:34 +01:00
|
|
|
import { defaultGraphBounds } from "./graph-helpers";
|
2021-03-21 13:47:52 +01:00
|
|
|
import type { HistogramData } from "./histogram-graph";
|
|
|
|
import { histogramGraph } from "./histogram-graph";
|
2022-02-04 09:36:34 +01:00
|
|
|
import HoverColumns from "./HoverColumns.svelte";
|
|
|
|
import NoDataOverlay from "./NoDataOverlay.svelte";
|
2020-06-23 11:07:47 +02:00
|
|
|
|
|
|
|
export let data: HistogramData | null = null;
|
|
|
|
|
2022-02-04 09:36:34 +01:00
|
|
|
const bounds = defaultGraphBounds();
|
2020-06-23 11:07:47 +02:00
|
|
|
let svg = null as HTMLElement | SVGElement | null;
|
|
|
|
|
2020-07-06 06:01:49 +02:00
|
|
|
$: histogramGraph(svg as SVGElement, bounds, data);
|
2020-06-23 11:07:47 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<svg bind:this={svg} viewBox={`0 0 ${bounds.width} ${bounds.height}`}>
|
|
|
|
<g class="bars" />
|
2021-03-21 10:58:39 +01:00
|
|
|
<HoverColumns />
|
2021-03-21 10:50:35 +01:00
|
|
|
<CumulativeOverlay />
|
2020-06-23 11:07:47 +02:00
|
|
|
<AxisTicks {bounds} />
|
2021-03-26 11:23:43 +01:00
|
|
|
<NoDataOverlay {bounds} />
|
2020-06-23 11:07:47 +02:00
|
|
|
</svg>
|