Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: use SvelteMap instead of Map for svelte reactivity lint rule
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
  • Loading branch information
2 people authored and gka committed Apr 8, 2026
commit db6e263163ba50b710b3ca3faf3c483ec75a043b
3 changes: 2 additions & 1 deletion src/routes/examples/force/force-bubble.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
</script>

<script lang="ts">
import { SvelteMap } from 'svelte/reactivity';
import { Plot, Dot } from 'svelteplot';
import { forceLayout } from 'svelteplot/transforms';
let {
graph
}: { graph: { nodes: any[]; links: any[] } } = $props();

const layout = $derived.by(() => {
const degree = new Map<string, number>();
const degree = new SvelteMap<string, number>();
for (const l of graph.links) {
degree.set(
l.source,
Expand Down
3 changes: 2 additions & 1 deletion src/routes/examples/force/force-graph-degree.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
</script>

<script lang="ts">
import { SvelteMap } from 'svelte/reactivity';
import { Plot, Arrow, Dot } from 'svelteplot';
import { forceLayout } from 'svelteplot/transforms';
let {
graph
}: { graph: { nodes: any[]; links: any[] } } = $props();

const layout = $derived.by(() => {
const degree = new Map<string, number>();
const degree = new SvelteMap<string, number>();
for (const l of graph.links) {
degree.set(
l.source,
Expand Down
3 changes: 2 additions & 1 deletion src/routes/examples/force/force-graph-hover.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</script>

<script lang="ts">
import { SvelteMap } from 'svelte/reactivity';
import {
Plot,
Arrow,
Expand All @@ -28,7 +29,7 @@

// Pre-compute adjacency set for O(1) hover lookups
const neighbors = $derived.by(() => {
const m = new Map<string, Set<string>>();
const m = new SvelteMap<string, Set<string>>();
for (const n of nodes) m.set(n.id, new Set());
for (const l of links) {
m.get(l.source.id)!.add(l.target.id);
Expand Down
Loading