From 4bae5279e7b789d7fb16266d4a64b823dc87cc43 Mon Sep 17 00:00:00 2001 From: limina1 Date: Tue, 22 Jul 2025 15:42:11 -0400 Subject: [PATCH] eventConfig now Map --- src/lib/stores/visualizationConfig.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/lib/stores/visualizationConfig.ts b/src/lib/stores/visualizationConfig.ts index c748c32..bd10d05 100644 --- a/src/lib/stores/visualizationConfig.ts +++ b/src/lib/stores/visualizationConfig.ts @@ -9,11 +9,22 @@ export interface EventKindConfig { showAll?: boolean; // Only for content kinds (30041, 30818) - show all loaded content instead of limit } +/** + * VisualizationConfig now uses a Map for eventConfigs. + * The key is the event kind (number), and the value is a JSON stringified EventKindConfig. + * This allows O(1) retrieval of config by kind. + */ export interface VisualizationConfig { - // Event configurations with per-kind limits - eventConfigs: EventKindConfig[]; - - // Graph traversal + /** + * Event configurations with per-kind limits. + * Map key: event kind (number) + * Map value: JSON stringified EventKindConfig + */ + eventConfigs: Map; + + /** + * Whether to search through all fetched events during graph traversal. + */ searchThroughFetched: boolean; }