     showError(error.message || 'Failed to load mind map');
                }
            }

            async function renderMindMap(markdown) {
                const {Markmap, Transformer} = window.markmap;
                const transformer = new Transformer();
                const svg = document.querySelector('#mindmap');
                const viewerContent = document.querySelector('.viewer-content');

                svg.innerHTML = '';
                svg.style.width = viewerContent.offsetWidth + 'px'