From 41c9986da88aeb079da91b22706245cca294d1d9 Mon Sep 17 00:00:00 2001 From: limina1 Date: Sun, 24 Aug 2025 09:22:14 -0400 Subject: [PATCH] reinstate old tag styles and Invert Selection component --- src/lib/navigator/EventNetwork/Legend.svelte | 32 ++++++++++++++------ src/lib/navigator/EventNetwork/index.svelte | 14 +++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/lib/navigator/EventNetwork/Legend.svelte b/src/lib/navigator/EventNetwork/Legend.svelte index 12a68da..8dd5bb7 100644 --- a/src/lib/navigator/EventNetwork/Legend.svelte +++ b/src/lib/navigator/EventNetwork/Legend.svelte @@ -77,7 +77,7 @@ function invertTagSelection() { // Invert selection - toggle all tags one by one - const allTagIds = tagAnchors.map((anchor: any) => `${anchor.type}-${anchor.label}`); + const allTagIds = tagAnchors.map((anchor: any) => anchor.value); // Process all tags allTagIds.forEach((tagId: string) => { @@ -330,6 +330,16 @@ Alphabetical + + +
@@ -337,22 +347,26 @@ {@const tagId = `${tag.type}-${tag.label}`} {@const isDisabled = disabledTags.has(tagId)} {/each}
diff --git a/src/lib/navigator/EventNetwork/index.svelte b/src/lib/navigator/EventNetwork/index.svelte index 98ad74a..aea8c8a 100644 --- a/src/lib/navigator/EventNetwork/index.svelte +++ b/src/lib/navigator/EventNetwork/index.svelte @@ -168,6 +168,7 @@ let totalPersonCount = $state(0); let displayedPersonCount = $state(0); let hasInitializedPersons = $state(false); + let hasInitializedTags = $state(false); // Update dimensions when container changes @@ -298,9 +299,22 @@ label: n.title, count: n.connectedNodes?.length || 0, color: getTagAnchorColor(n.tagType || ""), + value: `${n.tagType}-${n.title}`, // Use the correct tag ID format for toggling })); + + // Auto-disable all tag anchors by default (only on first time showing) + if (!hasInitializedTags && tagAnchors.length > 0) { + tagAnchorInfo.forEach(anchor => { + disabledTags.add(anchor.value); + }); + hasInitializedTags = true; + } } else { tagAnchorInfo = []; + // Reset initialization flag when tag anchors are hidden + if (hasInitializedTags && tagAnchorInfo.length === 0) { + hasInitializedTags = false; + } } // Add person nodes if enabled