Export Mind Map as Image
DocumentsExport Mind Map as Image is an Agent Skill for documents published in the SSShooter/mind-elixir-core repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Guide for exporting mind maps as images using `@zumer/snapdom`.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/SSShooter/mind-elixir-core/blob/HEAD/skills/export-mindmap-image/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/export-mind-map-as-image, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Export Mind Map as Image
Mind Elixir recommends using @zumer/snapdom for high-quality image exports. This tool allows you to convert the SVG nodes directly into image formats.
1. Installation
Install @zumer/snapdom as a dependency.
npm install @zumer/snapdom
2. Usage
Use the snapdom function to capture the mind map nodes and download them.
import { snapdom } from '@zumer/snapdom'
// Assuming `mind` is your MindElixir instance
const downloadImage = async () => {
// 1. Capture the nodes
const result = await snapdom(mind.nodes)
// 2. Download as JPG or PNG
await result.download({
format: 'jpg', // or 'png'
filename: 'mind-map-export',
})
}
3. Creating a Trigger
You can add a button to your UI to trigger this function.
<button id="export-btn">Export Image</button>
<script>
document.getElementById('export-btn').addEventListener('click', downloadImage)
</script>
Note: The built-in
mind.exportSvg()method is deprecated. Please use the method above for new projects.