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