mcpField
E
Export Mind Map as Image

Export Mind Map as Image

github.com/ssshooterDevelopment3.2k65 installsUpdated 1w ago
Repository

About Export Mind Map as Image

A guide to exporting Mind Elixir mind maps as images with `@mind-elixir/export-mindmap`. It covers PNG, JPEG, and WEBP downloads, URL-based handling, and DOM capture with SCST.

Key features

  1. 01Download maps as PNG, JPEG, or WEBP
  2. 02Export images as URLs
  3. 03Capture DOM elements with SCST
  4. 04Create blobs, data URLs, and object URLs

Use cases

  1. 01Downloading a mind map image
  2. 02Previewing or handling an exported image by URL
  3. 03Capturing another DOM element as an image

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ssshooter/mind-elixir-core --skill export-mind-map-as-image

After installing, type/export-mind-map-as-imagein Claude Code to confirm it loaded.

Details

From the project README

Export Mind Map as Image

Mind Elixir exports images through the built-in SCST engine from @mind-elixir/export-mindmap. SCST is a lightweight, high-performance DOM-to-image library based on SVG <foreignObject> + Canvas, with zero third-party screenshot dependencies.

1. Installation

Install @mind-elixir/export-mindmap as a dependency.

npm install @mind-elixir/export-mindmap

2. Usage

Use the downloadImage / exportImage functions to capture the mind map nodes and download them.

import { downloadImage, exportImage } from '@mind-elixir/export-mindmap'
// Assuming `mind` is your MindElixir instance

// Download as PNG / JPEG / WEBP
await downloadImage(mind, 'png') // format: 'png' | 'jpeg' | 'webp'

// Or get the URL for preview / custom handling instead of downloading
const url = await exportImage(mind, 'png')

3. Using SCST directly

SCST is also exported from the package and can be used to screenshot any DOM element.

import { domToBlob, domToDataURL, domToObjectURL } from '@mind-elixir/export-mindmap'

const blob = await domToBlob(element, 'png', options)
const dataUrl = await domToDataURL(element, 'jpeg', options)
const objectUrl = await domToObjectURL(element, 'webp', options) // most memory-efficient for downloads

Note: The built-in mind.exportSvg() method is deprecated. Please use the method above for new projects.

Comments

Markdown supported