johnandersen777.bsky.social/knotless
git that lives in your Atmosphere account
Forked from chadtmiller.com/knotless
0
0
<script lang="ts">
/** A small line of `values`, oldest first, scaled to the largest, said in words as `label`. */
let { values, label }: { values: number[]; label: string } = $props();
const W = 96;
const H = 24;
const points = $derived.by(() => {
const most = Math.max(1, ...values);
const step = W / Math.max(1, values.length - 1);
return values
.map((v, i) => `${(i * step).toFixed(1)},${(H - 1 - (v / most) * (H - 4)).toFixed(1)}`)
.join(' ');
});
</script>
<svg class="spark" width={W} height={H} viewBox="0 0 {W} {H}" role="img" aria-label={label}
><polygon class="area" points="0,{H} {points} {W},{H}" /><polyline {points} /></svg
>