Compare commits

..

2 Commits

Author SHA1 Message Date
ec50886145 es wird spät 2025-05-06 22:47:08 +01:00
c888dcc452 feat: enhance mindmap update functionality in update_mindmap.js 2025-05-06 22:26:28 +01:00

View File

@@ -47,7 +47,7 @@ document.addEventListener('DOMContentLoaded', function() {
console.log('Initialisiere Cytoscape...'); console.log('Initialisiere Cytoscape...');
// Initialisiere Cytoscape mit großen Daten // Initialisiere Cytoscape mit einfachem, stabilem Design
window.cy = cytoscape({ window.cy = cytoscape({
container: cyContainer, container: cyContainer,
elements: elements, elements: elements,
@@ -66,17 +66,23 @@ document.addEventListener('DOMContentLoaded', function() {
'font-size': 18, 'font-size': 18,
'width': 40, 'width': 40,
'height': 40, 'height': 40,
'border-width': 4, 'border-width': 2,
'border-color': '#a78bfa', 'border-color': '#fff',
'shadow-blur': 20, 'overlay-padding': 4,
'shadow-color': '#a78bfa', 'z-index': 10
'shadow-opacity': 0.7, }
},
{
selector: 'node:selected',
style: {
'border-color': '#f59e42',
'border-width': 4
} }
}, },
{ {
selector: 'edge', selector: 'edge',
style: { style: {
'width': 4, 'width': 3,
'line-color': '#a78bfa', 'line-color': '#a78bfa',
'target-arrow-color': '#a78bfa', 'target-arrow-color': '#a78bfa',
'target-arrow-shape': 'triangle', 'target-arrow-shape': 'triangle',
@@ -87,6 +93,17 @@ document.addEventListener('DOMContentLoaded', function() {
'text-background-color': '#222a', 'text-background-color': '#222a',
'text-background-opacity': 0.7, 'text-background-opacity': 0.7,
'text-background-padding': '2px', 'text-background-padding': '2px',
'opacity': 0.8,
'line-style': 'solid'
}
},
{
selector: 'edge:selected',
style: {
'width': 5,
'line-color': '#f59e42',
'target-arrow-color': '#f59e42',
'opacity': 1
} }
} }
], ],
@@ -268,12 +285,7 @@ function updateMindmap() {
label: node.label, label: node.label,
category: node.category, category: node.category,
description: node.description, description: node.description,
color: categoryColors[node.category] || '#60a5fa', color: categoryColors[node.category] || '#60a5fa'
neuronSize: Math.floor(Math.random() * 8) + 3,
neuronActivity: Math.random() * 0.7 + 0.3,
pulseFrequency: Math.random() * 4 + 2,
refractionPeriod: Math.random() * 300 + 700,
threshold: Math.random() * 0.3 + 0.6
} }
}); });
}); });
@@ -285,15 +297,12 @@ function updateMindmap() {
data: { data: {
source: edge.source, source: edge.source,
target: edge.target, target: edge.target,
label: edge.label, label: edge.label
strength: Math.random() * 0.6 + 0.2,
conductionVelocity: Math.random() * 0.5 + 0.3,
latency: Math.random() * 100 + 50
} }
}); });
}); });
// Neuronales Netzwerk-Styling anwenden // Nur einfaches, klares Styling - KEINE Schatten, KEIN Glow, KEINE dynamischen Styles!
cy.style([ cy.style([
{ {
selector: 'node', selector: 'node',
@@ -309,67 +318,50 @@ function updateMindmap() {
'text-outline-width': 1.5, 'text-outline-width': 1.5,
'text-outline-opacity': 0.9, 'text-outline-opacity': 0.9,
'text-margin-y': 7, 'text-margin-y': 7,
'width': 'mapData(neuronSize, 3, 10, 15, 40)', 'width': 40,
'height': 'mapData(neuronSize, 3, 10, 15, 40)', 'height': 40,
'background-color': 'data(color)', 'background-color': 'data(color)',
'background-opacity': 0.85, 'background-opacity': 0.85,
'border-width': 0, 'border-width': 2,
'shape': 'ellipse', 'shape': 'ellipse',
'shadow-blur': 'mapData(neuronActivity, 0.3, 1, 5, 15)',
'shadow-color': 'data(color)',
'shadow-opacity': 0.6,
'shadow-offset-x': 0,
'shadow-offset-y': 0,
'text-background-color': 'rgba(24, 28, 45, 0.7)', 'text-background-color': 'rgba(24, 28, 45, 0.7)',
'text-background-opacity': 0.8, 'text-background-opacity': 0.8,
'text-background-shape': 'roundrectangle', 'text-background-shape': 'roundrectangle',
'text-background-padding': '4px', 'text-background-padding': '4px'
'transition-property': 'background-color, shadow-blur, shadow-opacity, background-opacity',
'transition-duration': '0.5s'
} }
}, },
{ {
selector: 'edge', selector: 'edge',
style: { style: {
'width': 'mapData(strength, 0.2, 0.8, 0.7, 2)', 'width': 3,
'curve-style': 'bezier', 'curve-style': 'bezier',
'line-color': '#8a8aaa', 'line-color': '#8a8aaa',
'line-opacity': 'mapData(strength, 0.2, 0.8, 0.4, 0.7)', 'line-opacity': 0.7,
'line-style': function(ele) { 'line-style': 'solid',
const strength = ele.data('strength'); 'target-arrow-shape': 'triangle',
if (strength <= 0.4) return 'dotted'; 'target-arrow-color': '#8a8aaa',
if (strength <= 0.6) return 'dashed'; 'label': 'data(label)',
return 'solid'; 'font-size': 12,
}, 'color': '#fff',
'target-arrow-shape': 'none', 'text-background-color': '#222a',
'source-endpoint': '0% 50%', 'text-background-opacity': 0.7,
'target-endpoint': '100% 50%', 'text-background-padding': '2px'
'transition-property': 'line-color, width, line-style, line-opacity',
'transition-duration': '0.4s'
} }
}, },
{ {
selector: ':selected', selector: 'node:selected',
style: { style: {
'background-color': '#f59e0b', 'border-color': '#f59e42',
'shadow-blur': 32, 'border-width': 4
'shadow-color': '#f59e0b',
'shadow-opacity': 1,
'border-width': 4,
'border-color': '#fff'
} }
}, },
{ {
selector: '.highlighted', selector: 'edge:selected',
style: { style: {
'background-color': '#10b981', 'width': 5,
'shadow-blur': 28, 'line-color': '#f59e42',
'shadow-color': '#10b981', 'target-arrow-color': '#f59e42',
'shadow-opacity': 1, 'opacity': 1
'line-color': '#10b981',
'target-arrow-color': '#10b981',
'transition-property': 'background-color, shadow-blur, shadow-opacity, line-color',
'transition-duration': '0.3s'
} }
} }
]); ]);
@@ -380,31 +372,8 @@ function updateMindmap() {
animate: true, animate: true,
animationDuration: 1800, animationDuration: 1800,
nodeDimensionsIncludeLabels: true, nodeDimensionsIncludeLabels: true,
padding: 100, padding: 100
spacingFactor: 1.8,
randomize: false,
fit: true,
componentSpacing: 100,
nodeRepulsion: 8000,
edgeElasticity: 100,
nestingFactor: 1.2,
gravity: 80
}).run(); }).run();
// Pulsierende Soma-Effekte starten
if (window.pulseInterval) clearInterval(window.pulseInterval);
window.pulseInterval = setInterval(() => {
cy.nodes().forEach(node => {
const baseBlur = 18;
const pulse = 0.7 + 0.3 * Math.sin(Date.now() / 400 + node.id().charCodeAt(0));
node.style('shadow-blur', baseBlur * pulse);
node.style('shadow-opacity', 0.6 + 0.3 * pulse);
node.style('background-opacity', 0.85 + 0.1 * pulse);
});
}, 80);
// Neuronale Aktivität simulieren
startNeuralActivitySimulation(cy);
} }
/** /**