diff --git a/src/lib/navigator/EventNetwork/index.svelte b/src/lib/navigator/EventNetwork/index.svelte index 099ba6f..8c91334 100644 --- a/src/lib/navigator/EventNetwork/index.svelte +++ b/src/lib/navigator/EventNetwork/index.svelte @@ -75,7 +75,8 @@ onclear = () => {}, onTagExpansionChange, onFetchMissing = () => {}, - profileStats = { totalFetched: 0, displayLimit: 50 } + profileStats = { totalFetched: 0, displayLimit: 50 }, + allEventCounts = {} } = $props<{ events?: NDKEvent[]; followListEvents?: NDKEvent[]; @@ -85,6 +86,7 @@ onTagExpansionChange?: (depth: number, tags: string[]) => void; onFetchMissing?: (ids: string[]) => void; profileStats?: { totalFetched: number; displayLimit: number }; + allEventCounts?: { [kind: number]: number }; }>(); // Error state @@ -1216,7 +1218,7 @@ {onclear} {onFetchMissing} bind:starVisualization - {eventCounts} + eventCounts={allEventCounts} {profileStats} /> diff --git a/src/routes/visualize/+page.svelte b/src/routes/visualize/+page.svelte index 9ceaba9..cad8ef8 100644 --- a/src/routes/visualize/+page.svelte +++ b/src/routes/visualize/+page.svelte @@ -63,6 +63,17 @@ totalFetched: 0, displayLimit: 50 }); + + // Event counts from all events (not just filtered) + let allEventCounts = $derived.by(() => { + const counts: { [kind: number]: number } = {}; + allEvents.forEach((event: NDKEvent) => { + if (event.kind !== undefined) { + counts[event.kind] = (counts[event.kind] || 0) + 1; + } + }); + return counts; + }); /** * Fetches follow lists (kind 3) with depth expansion @@ -1038,6 +1049,7 @@ onTagExpansionChange={handleTagExpansion} onFetchMissing={fetchMissingEvents} {profileStats} + {allEventCounts} /> {/if}