🗑️ chore: remove unused database and routing scripts; update cached Python bytecode files in __pycache__ directories
This commit is contained in:
@@ -226,20 +226,74 @@ async function initializeMindmap() {
|
||||
];
|
||||
|
||||
// Bestehende Cytoscape-Instanz entfernen, falls vorhanden
|
||||
if (window.cy) {
|
||||
if (window.cy && typeof window.cy.destroy === 'function') {
|
||||
window.cy.destroy();
|
||||
}
|
||||
|
||||
const cyContainer = document.getElementById('cy');
|
||||
if (!cyContainer) {
|
||||
throw new Error('Mindmap-Container #cy nicht gefunden!');
|
||||
}
|
||||
|
||||
window.cy = cytoscape({
|
||||
container: document.getElementById('cy'),
|
||||
container: cyContainer,
|
||||
elements: elements,
|
||||
style: mindmapStyles,
|
||||
style: [
|
||||
{
|
||||
selector: 'node',
|
||||
style: mindmapStyles.node.base
|
||||
},
|
||||
{
|
||||
selector: 'node[isCenter]',
|
||||
style: mindmapStyles.node.center
|
||||
},
|
||||
{
|
||||
selector: 'node:selected',
|
||||
style: mindmapStyles.node.selected
|
||||
},
|
||||
{
|
||||
selector: 'edge',
|
||||
style: mindmapStyles.edge.base
|
||||
}
|
||||
],
|
||||
layout: mindmapStyles.layout.base
|
||||
});
|
||||
|
||||
// Füge neuronale Eigenschaften zu allen Knoten hinzu
|
||||
cy.nodes().forEach(node => {
|
||||
const data = node.data();
|
||||
// Verwende mindmapConfig für Kategorie-Farben oder einen Standardwert
|
||||
const categoryColor = data.category && mindmapConfig.categories[data.category]
|
||||
? mindmapConfig.categories[data.category].color
|
||||
: '#60a5fa';
|
||||
|
||||
node.data({
|
||||
...data,
|
||||
neuronSize: data.neuronSize || 8,
|
||||
neuronActivity: data.neuronActivity || 0.8,
|
||||
refractionPeriod: Math.random() * 300 + 700,
|
||||
threshold: Math.random() * 0.3 + 0.6,
|
||||
lastFired: 0,
|
||||
color: data.color || categoryColor
|
||||
});
|
||||
});
|
||||
|
||||
// Füge synaptische Eigenschaften zu allen Kanten hinzu
|
||||
cy.edges().forEach(edge => {
|
||||
const data = edge.data();
|
||||
edge.data({
|
||||
...data,
|
||||
strength: data.strength || 0.5,
|
||||
conductionVelocity: Math.random() * 0.5 + 0.3,
|
||||
latency: Math.random() * 100 + 50
|
||||
});
|
||||
});
|
||||
|
||||
// Event-Listener für Knoten-Klicks
|
||||
cy.on('tap', 'node', async function(evt) {
|
||||
const node = evt.target;
|
||||
console.log('Node clicked:', node.id(), 'hasChildren:', node.data('hasChildren'), 'expanded:', node.data('expanded'));
|
||||
|
||||
if (node.data('hasChildren') && !node.data('expanded')) {
|
||||
await loadSubthemes(node);
|
||||
}
|
||||
@@ -248,6 +302,12 @@ async function initializeMindmap() {
|
||||
// Layout ausführen
|
||||
cy.layout(mindmapStyles.layout.base).run();
|
||||
|
||||
// Starte neuronale Aktivitätssimulation
|
||||
startNeuralActivitySimulation(cy);
|
||||
|
||||
// Mindmap mit echten Daten befüllen (Styles, Farben etc.)
|
||||
updateMindmap();
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('Fehler bei der Mindmap-Initialisierung:', error);
|
||||
@@ -279,115 +339,25 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
console.log('Cytoscape ist verfügbar');
|
||||
|
||||
// Beispiel-Daten entfernt, stattdessen große Mindmap-Daten verwenden
|
||||
const elements = [
|
||||
// Knoten
|
||||
...mindmapData.nodes.map(node => ({
|
||||
data: {
|
||||
id: node.id,
|
||||
label: node.label,
|
||||
category: node.category,
|
||||
description: node.description,
|
||||
hasChildren: node.hasChildren,
|
||||
expanded: node.expanded,
|
||||
neuronSize: node.neuronSize,
|
||||
neuronActivity: node.neuronActivity,
|
||||
color: node.color,
|
||||
icon: node.icon,
|
||||
fontColor: node.fontColor,
|
||||
fontSize: node.fontSize
|
||||
// Initialisiere die Mindmap
|
||||
initializeMindmap()
|
||||
.then(success => {
|
||||
if (success) {
|
||||
console.log('Mindmap wurde erfolgreich initialisiert');
|
||||
// Event auslösen, damit andere Scripte reagieren können
|
||||
document.dispatchEvent(new Event('mindmap-loaded'));
|
||||
console.log('mindmap-loaded Event ausgelöst');
|
||||
} else {
|
||||
console.error('Mindmap-Initialisierung fehlgeschlagen');
|
||||
}
|
||||
})),
|
||||
// Kanten
|
||||
...mindmapData.edges.map(edge => ({
|
||||
data: {
|
||||
source: edge.source,
|
||||
target: edge.target,
|
||||
label: edge.label,
|
||||
strength: edge.strength
|
||||
}
|
||||
}))
|
||||
];
|
||||
|
||||
console.log('Initialisiere Cytoscape...');
|
||||
|
||||
// Initialisiere Cytoscape mit einem schlichten, modernen Design
|
||||
window.cy = cytoscape({
|
||||
container: cyContainer,
|
||||
elements: elements,
|
||||
style: [
|
||||
{
|
||||
selector: 'node',
|
||||
style: mindmapStyles.node.base
|
||||
},
|
||||
{
|
||||
selector: 'node[isCenter]',
|
||||
style: mindmapStyles.node.center
|
||||
},
|
||||
{
|
||||
selector: 'node:selected',
|
||||
style: mindmapStyles.node.selected
|
||||
},
|
||||
{
|
||||
selector: 'edge',
|
||||
style: mindmapStyles.edge.base
|
||||
}
|
||||
],
|
||||
layout: mindmapStyles.layout.base
|
||||
});
|
||||
|
||||
console.log('Cytoscape initialisiert');
|
||||
|
||||
// Füge neuronale Eigenschaften zu allen Knoten hinzu
|
||||
cy.nodes().forEach(node => {
|
||||
const data = node.data();
|
||||
node.data({
|
||||
...data,
|
||||
neuronSize: data.neuronSize || 8,
|
||||
neuronActivity: data.neuronActivity || 0.8,
|
||||
refractionPeriod: Math.random() * 300 + 700,
|
||||
threshold: Math.random() * 0.3 + 0.6,
|
||||
lastFired: 0,
|
||||
color: categoryColors[data.category] || '#60a5fa'
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Fehler bei der Mindmap-Initialisierung:', error);
|
||||
showUINotification({
|
||||
error: 'Mindmap konnte nicht initialisiert werden',
|
||||
details: error.message
|
||||
}, 'error');
|
||||
});
|
||||
});
|
||||
|
||||
// Füge synaptische Eigenschaften zu allen Kanten hinzu
|
||||
cy.edges().forEach(edge => {
|
||||
const data = edge.data();
|
||||
edge.data({
|
||||
...data,
|
||||
strength: data.strength || 0.5,
|
||||
conductionVelocity: Math.random() * 0.5 + 0.3,
|
||||
latency: Math.random() * 100 + 50
|
||||
});
|
||||
});
|
||||
|
||||
// Starte neuronale Aktivitätssimulation
|
||||
startNeuralActivitySimulation(cy);
|
||||
|
||||
// Mindmap mit echten Daten befüllen (Styles, Farben etc.)
|
||||
updateMindmap();
|
||||
|
||||
// Event auslösen, damit andere Scripte reagieren können
|
||||
document.dispatchEvent(new Event('mindmap-loaded'));
|
||||
console.log('mindmap-loaded Event ausgelöst');
|
||||
|
||||
// Event-Listener für Knoten-Klicks
|
||||
cy.on('tap', 'node', async function(evt) {
|
||||
const node = evt.target;
|
||||
console.log('Node clicked:', node.id(), 'hasChildren:', node.data('hasChildren'), 'expanded:', node.data('expanded'));
|
||||
|
||||
if (node.data('hasChildren') && !node.data('expanded')) {
|
||||
await loadSubthemes(node);
|
||||
}
|
||||
});
|
||||
|
||||
// Entferne den Icon-Overlay-Code
|
||||
setTimeout(() => {
|
||||
// Entferne alle existierenden Icon-Overlays
|
||||
document.querySelectorAll('.cy-node-icon').forEach(icon => icon.remove());
|
||||
}, 0);
|
||||
});
|
||||
|
||||
// Funktion zum Initialisieren des neuronalen Designs
|
||||
|
||||
Reference in New Issue
Block a user