mcpField
E
Export Mind Map as Image

Export Mind Map as Image

github.com/ssshooter開発3.2k65 回インストール1 週間前に更新
リポジトリ

Export Mind Map as Image について

`@mind-elixir/export-mindmap` を使って Mind Elixir のマインドマップを画像に書き出すガイドです。PNG、JPEG、WEBP のダウンロード、URL での扱い、SCST による DOM キャプチャを説明します。

主な機能

  1. 01PNG、JPEG、WEBP でのマップ保存
  2. 02URL としての画像書き出し
  3. 03SCST による DOM 要素のキャプチャ
  4. 04Blob、データ URL、オブジェクト URL の生成

活用シーン

  1. 01マインドマップ画像のダウンロード
  2. 02URL による書き出し画像のプレビューや処理
  3. 03別の DOM 要素の画像キャプチャ

インストール

コマンドをコピーしてターミナルで実行します。

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

インストール後、Claude Code で/export-mind-map-as-imageを入力して読み込まれたか確認します。

詳細

マインドマップを画像としてエクスポートする

Mind Elixir は、@mind-elixir/export-mindmap に組み込まれている SCST エンジンを使って画像をエクスポートします。SCST は SVG <foreignObject> と Canvas をベースにした、軽量で高性能な DOM 画像化ライブラリです。サードパーティ製のスクリーンショット依存関係はありません。

1. インストール

@mind-elixir/export-mindmap を依存関係としてインストールします。

npm install @mind-elixir/export-mindmap

2. 使い方

downloadImage / exportImage 関数を使ってマインドマップのノードをキャプチャし、ダウンロードします。

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. SCST を直接使用する

SCST はパッケージからもエクスポートされており、任意の DOM 要素のスクリーンショットに使用できます。

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

注:組み込みの mind.exportSvg() メソッドは非推奨です。新しいプロジェクトでは上記のメソッドを使用してください。

コメント