{"_id":"@apigo.cc/mindmap","_rev":"3-977bc80368dbed1ab3ee2232c5b031ba","name":"@apigo.cc/mindmap","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@apigo.cc/mindmap","version":"1.0.0","_id":"@apigo.cc/mindmap@1.0.0","maintainers":[{"name":"star3s","email":"isstar3@126.com"}],"dist":{"shasum":"cbc6de34481d31816b707632b021792244ef07b9","tarball":"https://registry.npmjs.org/@apigo.cc/mindmap/-/mindmap-1.0.0.tgz","fileCount":4,"integrity":"sha512-g84HPdmguiuPI04nv/M0wiDGujpZq9rFMfVggjVeB94AxvtH52kxgi4bNB18VVzOOu0zsZ0XeloVyKO2OaaYVQ==","signatures":[{"sig":"MEUCIASJKj1xcfZUwyy/YC1PyRUi0jHaEnLdypVJ0pEcLWfyAiEAmUC7J9OdS6IX9mDxW/QQj/XQ6agtd6nPvL7HwSQFmLA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13334},"main":"dist/mindmap.js","type":"module","module":"dist/mindmap.js","gitHead":"70b6009bf18da0f3d1fc370669c77e54e38d39e1","scripts":{"dev":"vite","pub":"node scripts/publish.js","test":"playwright test","build":"vite build"},"_npmUser":{"name":"star3s","email":"isstar3@126.com"},"_npmVersion":"10.7.0","description":"类 Xmind 体验的思维导图引擎，专注于展示逻辑分支。","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","terser":"^5.47.1","@playwright/test":"^1.40.0","@rollup/plugin-terser":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mindmap_1.0.0_1780404886809_0.7834721767254773","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@apigo.cc/mindmap","version":"1.0.1","_id":"@apigo.cc/mindmap@1.0.1","maintainers":[{"name":"star3s","email":"isstar3@126.com"}],"dist":{"shasum":"4836d645e8ffe71a69053991852f7ed73cec6f76","tarball":"https://registry.npmjs.org/@apigo.cc/mindmap/-/mindmap-1.0.1.tgz","fileCount":4,"integrity":"sha512-pJgWZyL27i+qwiXR/VBCpOB5i1/qbZ9SStnDGmNdm08b9gkZ+Aun5oNLMlqpCLPjXrHi4JBJSrw/LPRdf8zfRg==","signatures":[{"sig":"MEQCIGgdHrNtSN+d+bQ8aTnfxM03tbFYRPtmtrXGujNS5a8eAiAR53257uQVplGNCbC7XvkJPztKMbCXR6Ge62vlJhZy/Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13344},"main":"dist/mindmap.js","type":"module","module":"dist/mindmap.js","gitHead":"85c2dd983d18a40d59072584780f35c136c982e3","scripts":{"dev":"vite","pub":"node scripts/publish.js","test":"playwright test","build":"vite build"},"_npmUser":{"name":"star3s","email":"isstar3@126.com"},"_npmVersion":"10.7.0","description":"类 Xmind 体验的思维导图引擎，专注于展示逻辑分支。","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.0.0","terser":"^5.47.1","@playwright/test":"^1.40.0","@rollup/plugin-terser":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/mindmap_1.0.1_1780572437891_0.5767368237083756","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@apigo.cc/mindmap","version":"1.0.2","type":"module","main":"dist/mindmap.js","scripts":{"dev":"vite","build":"vite build","test":"playwright test","pub":"node scripts/publish.js"},"devDependencies":{"@playwright/test":"^1.40.0","@rollup/plugin-terser":"^1.0.0","terser":"^5.47.1","vite":"^5.0.0"},"_id":"@apigo.cc/mindmap@1.0.2","gitHead":"264911d49538edabb29759d665bbdcbc29bb7ffd","description":"原生 JS 编写的思维导图引擎。支持无限层级、缩放平移、节点折叠及动态增删。","_nodeVersion":"20.15.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-daQ5qLc3TbNtD40qfGVqwelnlM5nkz4BLgQBB4CKC7ohUUCgOtDmwQLi5P+S8/uzdpLHJKdcbw+qhOPzhmcZAA==","shasum":"9be6da1920fc3bc1dfffb4d1dedfe75293d0ad6c","tarball":"https://registry.npmjs.org/@apigo.cc/mindmap/-/mindmap-1.0.2.tgz","fileCount":4,"unpackedSize":16046,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB4o47Dh2tkC3zmDa9U3z9Gjlk9FfMJFk9/LBTvSoo6CAiEA8ABJmQca4mu2uc4k0hHOor/onabIm3kbGLB0Y/Pz9dg="}]},"_npmUser":{"name":"star3s","email":"isstar3@126.com"},"directories":{},"maintainers":[{"name":"star3s","email":"isstar3@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mindmap_1.0.2_1782127571903_0.829326400655225"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T12:54:46.685Z","modified":"2026-06-22T11:26:12.173Z","1.0.0":"2026-06-02T12:54:46.943Z","1.0.1":"2026-06-04T11:27:18.040Z","1.0.2":"2026-06-22T11:26:12.060Z"},"description":"原生 JS 编写的思维导图引擎。支持无限层级、缩放平移、节点折叠及动态增删。","maintainers":[{"name":"star3s","email":"isstar3@126.com"}],"readme":"# @apigo.cc/mindmap API 手册\n\n原生 JS 编写的思维导图引擎。支持无限层级、缩放平移、节点折叠及动态增删。\n\n---\n\n## 1. 引入方式 (UMD 优先)\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@apigo.cc/mindmap@1.0.1/dist/mindmap.min.js\"></script>\n\n<script>\n    // 直接使用全局 Mindmap 类\n    const mm = new Mindmap(config);\n</script>\n```\n\n---\n\n## 2. 核心用法\n\n### 组件化用法 (推荐)\n直接在 HTML 中使用 `<Mindmap>` 标签，通过 `state` 进行数据绑定。\n\n```html\n<div $data=\"{ \n    myMind: { id: 'root', text: '根节点', children: [{ text: '子节点 1' }] }\n}\">\n    <Mindmap $.state.data=\"myMind\" style=\"height:500px\"></Mindmap>\n</div>\n```\n\n### JS 调用方式 (兼容)\n...\n---\n\n## 3. API 参考\n\n### `new Mindmap(options)`\n- **`container`**: 挂载元素。\n- **`data`**: 格式为 `{ id, text, children, _collapsed }` 的对象。\n- **`nodeWidth / nodeHeight`**: 节点尺寸。\n- **`hGap / vGap`**: 间距。\n\n### 实例方法\n- **`addNode(parentId, text)`**: 动态添加节点。\n- **`removeNode(nodeId)`**: 动态删除节点。\n- **`render()`**: 强制重新布局与重绘。\n\n---\n\n## 开发者提示 (AI 必读)\n1. **全局变量**: UMD 模式下，`Mindmap` 类自动挂载到 `window`。\n2. **唯一 ID**: 每个节点必须拥有全局唯一的 `id`。\n3. **数据响应**: 修改 `mm.data` 属性后必须手动执行 `mm.render()`。\n","readmeFilename":"README.md"}