Auto commit: 2026-03-13T10:27:31.944Z

This commit is contained in:
Flatlogic Bot 2026-03-13 10:27:31 +00:00
parent 4bea8583e5
commit 027f4dd35b

View File

@ -17,6 +17,7 @@
<div class="card-header bg-white d-flex justify-content-between align-items-center flex-shrink-0" style="border-bottom: 1px solid rgba(0,0,0,0.05);">
<h5 class="mb-0 fw-bold">Interactive Mind Map</h5>
<div>
<button class="btn btn-sm btn-outline-success me-2" onclick="exportMap()">Export to Image</button>
<form method="POST" action="{% url 'regenerate_mindmap' project.pk %}" class="d-inline" onsubmit="return confirm('Are you sure you want to regenerate the entire map? This will delete all current nodes.');">
{% csrf_token %}
<button type="submit" class="btn btn-sm btn-outline-danger me-2">Regenerate</button>
@ -213,6 +214,18 @@
network.fit({ animation: { duration: 1000, easingFunction: 'easeInOutQuad' } });
}
// Export Map function
function exportMap() {
const canvas = document.querySelector('canvas');
if (!canvas) return;
const image = canvas.toDataURL("image/png");
const link = document.createElement('a');
link.download = 'mindmap.png';
link.href = image;
link.click();
}
// Handle clicks to show details in the sidebar
network.on("click", function (params) {
const detailsPanel = document.getElementById('node-details');