diff --git a/src/components/KnowledgeGraph.astro b/src/components/KnowledgeGraph.astro index 9c0a669..e795ffc 100644 --- a/src/components/KnowledgeGraph.astro +++ b/src/components/KnowledgeGraph.astro @@ -2,9 +2,6 @@ // src/components/KnowledgeGraph.astro // Interactive visualization of content connections using Cytoscape.js -// Assuming Cytoscape is loaded via CDN in BaseLayout or globally -// If not, you might need: import cytoscape from 'cytoscape'; - export interface GraphNode { id: string; label: string; @@ -34,7 +31,7 @@ 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 = { /* Colors from previous step */ +const predefinedColors = { 'Kubernetes': '#326CE5', 'Docker': '#2496ED', 'DevOps': '#FF6F61', 'Homelab': '#06B6D4', 'Networking': '#9333EA', 'Infrastructure': '#10B981', 'Automation': '#F59E0B', 'Security': '#EF4444', 'Monitoring': '#6366F1', @@ -67,8 +64,11 @@ graphData.nodes.forEach(node => { }); --- + + +
- {/* Loading Animation */} +
@@ -78,10 +78,10 @@ graphData.nodes.forEach(node => {
Initializing Knowledge Graph...
- {/* Cytoscape Container */} +
- {/* Node Details Panel */} +

Node Title

@@ -96,19 +96,19 @@ graphData.nodes.forEach(node => {
Tags:
- {/* Tags populated by JS */} +
Connections:
    - {/* Connections populated by JS */} +
Read Article
- {/* Graph Controls */} +
@@ -129,7 +129,7 @@ graphData.nodes.forEach(node => {
- {/* Graph Legend */} +
Legend
@@ -141,18 +141,14 @@ graphData.nodes.forEach(node => { ))}
-
-{/* Include Cytoscape via CDN - Ensure this is loaded, perhaps in BaseLayout */} -{/* */} - +