erver.observe(section);
    });

    function downloadMindmap(format) {
        try {
            const mindmapContainer = document.getElementById('viewer-content');
            const svg = mindmapContainer.querySelector('svg');

            if (!svg) {
                alert("No mind map available to export.");
                return;
            }

            const svgCopy = svg.cloneNode(true);
            const bbox = svg.getBBox();
            const padding = 20;

            const width = bbox.width +