refactor: rename state.svelte.ts to graph-state.svelte.ts
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 1m59s

This commit is contained in:
2025-12-09 20:00:52 +01:00
parent 3565a18364
commit d068828b68
16 changed files with 270 additions and 256 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
export let points: number[];
const { points }: { points: number[] } = $props();
function constructPath() {
const path = $derived.by(() => {
const max = Math.max(...points);
const min = Math.min(...points);
return points
@@ -11,13 +11,11 @@
return `${x},${y}`;
})
.join(" ");
}
});
</script>
<svg preserveAspectRatio="none" viewBox="0 0 100 100">
{#key points}
<polyline vector-effect="non-scaling-stroke" points={constructPath()} />
{/key}
<polyline vector-effect="non-scaling-stroke" points={path} />
</svg>
<style>