From 5195eb18d6cc682df934571660c4a6f5c686b842 Mon Sep 17 00:00:00 2001 From: limina1 Date: Mon, 23 Jun 2025 15:15:15 -0400 Subject: [PATCH] Add tag display improvements and sorting controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change minEventCount to 1 to display all tags regardless of occurrence count - Add radio buttons to sort tags by count (default) or alphabetically - Add "Invert Selection" checkbox to toggle all tags at once - Fix tag sorting implementation with proper Svelte @const placement These changes provide better control over tag visibility and organization, making it easier to explore and filter the visualization by tags. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/navigator/EventNetwork/Legend.svelte | 52 ++++++++++++++++++- .../EventNetwork/utils/tagNetworkBuilder.ts | 5 +- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/lib/navigator/EventNetwork/Legend.svelte b/src/lib/navigator/EventNetwork/Legend.svelte index 9bc6a8d..38cec1b 100644 --- a/src/lib/navigator/EventNetwork/Legend.svelte +++ b/src/lib/navigator/EventNetwork/Legend.svelte @@ -56,6 +56,7 @@ let tagAnchorsExpanded = $state(true); let tagControlsExpanded = $state(true); let personVisualizerExpanded = $state(true); + let tagSortMode = $state<'count' | 'alphabetical'>('count'); $effect(() => { if (collapsedOnInteraction) { @@ -244,16 +245,65 @@ {#if tagAnchorsExpanded} + {@const sortedAnchors = tagSortMode === 'count' + ? [...tagAnchors].sort((a, b) => b.count - a.count) + : [...tagAnchors].sort((a, b) => a.label.localeCompare(b.label)) + } {#if autoDisabledTags}
Note: All {tagAnchors.length} tags were auto-disabled to prevent graph overload. Click individual tags below to enable them.
{/if} + + +
+
+ Sort by: + + +
+ + +
+
- {#each tagAnchors as anchor} + {#each sortedAnchors as anchor} {@const tagId = `${anchor.type}-${anchor.label}`} {@const isDisabled = disabledTags.has(tagId)}