diff --git a/src/components/KnowledgeGraph.astro b/src/components/KnowledgeGraph.astro index e795ffc..56079d0 100644 --- a/src/components/KnowledgeGraph.astro +++ b/src/components/KnowledgeGraph.astro @@ -28,26 +28,13 @@ interface Props { const { graphData, height = "60vh" } = Astro.props; -// Generate colors based on categories for nodes -const uniqueCategories = [...new Set(graphData.nodes.map(node => node.category || 'Uncategorized'))]; -const categoryColors = {}; -const predefinedColors = { - 'Kubernetes': '#326CE5', 'Docker': '#2496ED', 'DevOps': '#FF6F61', - 'Homelab': '#06B6D4', 'Networking': '#9333EA', 'Infrastructure': '#10B981', - 'Automation': '#F59E0B', 'Security': '#EF4444', 'Monitoring': '#6366F1', - 'Storage': '#8B5CF6', 'Obsidian': '#7C3AED', 'Tutorial': '#3B82F6', - 'Uncategorized': '#A0AEC0' +// Define fixed colors for node types +const nodeTypeColors = { + post: 'var(--accent-secondary)', // Blue for posts + tag: 'var(--accent-primary)' // Cyan for tags }; -uniqueCategories.forEach((category, index) => { - if (predefinedColors[category]) { - categoryColors[category] = predefinedColors[category]; - } else { - const hue = (index * 137.5) % 360; - categoryColors[category] = `hsl(${hue}, 70%, 60%)`; - } -}); -// Calculate node sizes +// Calculate node sizes (Keep this logic) const nodeSizes = {}; const minSize = 20; const maxSize = 40; const degreeMap = new Map(); @@ -108,14 +95,9 @@ graphData.nodes.forEach(node => { Read Article - +