@gui-chat-plugin/mindmap

中文文档
2.1.0发布于 2026/10/18MITTypeScriptESM + CJS近 30 天下载 4979

Interactive mind map plugin for visual brainstorming

原始使用文档
文档目录13 节
  1. Features
  2. Installation
  3. Usage
  4. Vue Integration
  5. React Integration
  6. Core-only Usage
  7. API
  8. MindMapArgs
  9. Actions
  10. Test Prompts
  11. Development
  12. License
  13. Related

@gui-chat-plugin/mindmap

npm version scoria

Interactive mind map plugin for GUI Chat applications. Create visual mind maps for brainstorming and idea organization.

Features

  • Create mind maps with central idea and branching nodes
  • Add, delete, and connect nodes interactively
  • Auto-layout with rebalance functionality
  • Export to PNG and PDF
  • Vue and React support

Installation

yarn add @gui-chat-plugin/mindmap gui-chat-protocol

gui-chat-protocol is a peer dependency — install it alongside the plugin; the host application provides the runtime and this plugin only declares the compatible range.

Usage

Vue Integration

// In src/tools/index.ts
import MindMapPlugin from "@gui-chat-plugin/mindmap/vue";

const pluginList = [
  // ... other plugins
  MindMapPlugin,
];

// In src/main.ts
import "@gui-chat-plugin/mindmap/style.css";

React Integration

import MindMapPlugin from "@gui-chat-plugin/mindmap/react";
import "@gui-chat-plugin/mindmap/style.css";

Core-only Usage

import { executeMindMap, TOOL_DEFINITION } from "@gui-chat-plugin/mindmap";

// Create a mind map
const result = await executeMindMap(context, {
  action: "create",
  title: "Project Ideas",
  centralIdea: "New Product",
  ideas: ["Feature A", "Feature B", "Feature C"],
});

// Nest `ideas` to build every level in one call — the only way to get a
// multi-level map on hosts that keep no mind map state between calls
const tree = await executeMindMap(context, {
  action: "create",
  title: "Revenue",
  centralIdea: "Revenue",
  ideas: [
    { text: "Marketing", children: [{ text: "SNS", children: [{ text: "X" }] }, { text: "Ads" }] },
    "Sales",
  ],
});

context may be null / undefined — a host without client-side state (an MCP/server bridge) can call executeMindMap with no context. Actions that need an existing map then look at existingMap in the args, and return an error result if there is nothing to edit.

API

MindMapArgs

// A branch: a plain label, or a label with nested branches (any depth)
type IdeaInput = string | { text: string; children?: IdeaInput[] };

interface MindMapArgs {
  action: "create" | "add_node" | "delete_node" | "connect" | "update" | "rebalance";
  title?: string;           // Title of the mind map
  centralIdea?: string;     // Central idea for new mind map
  ideas?: IdeaInput[];      // Branches of the central idea, nestable
  parentNodeId?: string;    // Parent node for add_node — node ID or label text
  newIdea?: string;         // New idea text for add_node
  nodeIdToDelete?: string;  // Node to delete — node ID or label text
  fromNodeId?: string;      // Source node for connection — node ID or label text
  toNodeId?: string;        // Target node for connection — node ID or label text
  connectionLabel?: string; // Label for connection
}

Node references accept either the generated node ID or the node's label. A label is matched case-insensitively: exact text first, then substring. If it matches nothing — or several nodes — the call returns an error result listing the map's labels and leaves the map untouched.

Actions

ActionDescription
createCreate a new mind map with central idea and branches (nested ideas build the whole hierarchy)
add_nodeAdd a new node as child of existing node
delete_nodeDelete a node and its children
connectCreate a connection between two nodes
updateUpdate existing mind map
rebalanceAuto-arrange nodes for better layout

Test Prompts

Try these prompts to test the plugin:

  1. "Create a mind map about project planning"
  2. "Add a new idea about marketing to the mind map"
  3. "Connect the design and development nodes"

Development

# Install dependencies
yarn install

# Run Vue demo
yarn dev

# Run React demo
yarn dev:react

# Build
yarn build

# Lint
yarn lint

# Test
yarn test

License

MIT

版本与发布记录

@gui-chat-plugin/mindmap 共发布 12 个版本,首次发布于 2026/01/25;过去 12 个月发布了 12 个版本。

版本发布日期距今
2.1.0latest2026/10/1830 天前
2.0.02026/08/033 个月前
1.2.12026/08/033 个月前
1.2.02026/08/033 个月前
1.1.02026/07/243 个月前
1.0.02026/07/233 个月前

关于 @gui-chat-plugin/mindmap 的常见问题

@gui-chat-plugin/mindmap 是什么?

Interactive mind map plugin for visual brainstorming

如何安装 @gui-chat-plugin/mindmap?

在项目目录运行 npm install @gui-chat-plugin/mindmap,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:gui-chat-protocol(^2.3.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gui-chat-plugin/mindmap 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gui-chat-plugin/mindmap 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gui-chat-plugin/mindmap 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@gui-chat-plugin/mindmap 可以商用吗?

@gui-chat-plugin/mindmap 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gui-chat-plugin/mindmap 的下载量有多少?

根据 npm 官方下载统计,@gui-chat-plugin/mindmap 在 2026/10/17 – 2026/11/15 这 30 天内被下载 4,979 次,日均约 166 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gui-chat-plugin/mindmap 还在维护吗?

最新版本 2.1.0 发布于 2026/10/18(30 天前);至今共发布 12 个版本,其中过去 12 个月发布了 12 个;首次发布于 2026/01/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。