Doc: update

This commit is contained in:
街角小林
2024-03-07 09:40:50 +08:00
parent 4bf43ff338
commit 0b049c5294
22 changed files with 346 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "simple-mind-map",
"version": "0.9.7",
"version": "0.9.8",
"description": "一个简单的web在线思维导图",
"authors": [
{

View File

@@ -1,5 +1,45 @@
# Changelog
## 0.9.8
Fix:
> 1.Fix the issue of incorrect calculation function of mind maps within the canvas and scroll bar positions when the canvas size changes;
>
> 2.Fix the issue of errors when importing some old version xmind files;
>
> 3.Fix the issue where the highlight box of the collapsed node does not disappear when searching for highlighted nodes in read-only mode;
>
> 4.Fix the issue where data changes during search and search results are not updated in certain situations;
>
> 5.Fix the issue of deleting adjacent nodes when deleting nodes that are currently being edited;
>
> 6.Fix the issue of rendering only the root node when expand: false is set to the root node in the node data;
>
> 7.Fix the collaborative editing plugin: When a node is selected and then folded, the activation status of the node disappears, but the selected status of the node still exists in other clients;
New:
> 1.The commands such as INSERTNODE will not overwrite custom UIDs;
>
> 2.Methods for adding and removing highlighting for node instances; Adjust the way read-only mode searches for highlighted nodes;
>
> 3.Add configuration for searching all nodes (including those that have been folded); Search defaults to searching all nodes;
>
> 4.Add configuration options that cannot be selected by multiple people on the same node during collaborative editing;
>
> 5.Add lifecycle function configuration options before synchronizing collaborative editing node operations;
>
> 6.Add UID field to the summary node;
Demo:
> 1.Fix the issue where shortcut keys become invalid after opening label pop ups and note pop ups and clicking on the mask to close them;
>
> 2.Modify the association logic between themes and dark colors;
>
> 3.Support reading local directories;
## 0.9.7
Fix:

View File

@@ -1,6 +1,32 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.9.8</h2>
<p>Fix:</p>
<blockquote>
<p>1.Fix the issue of incorrect calculation function of mind maps within the canvas and scroll bar positions when the canvas size changes;</p>
<p>2.Fix the issue of errors when importing some old version xmind files;</p>
<p>3.Fix the issue where the highlight box of the collapsed node does not disappear when searching for highlighted nodes in read-only mode;</p>
<p>4.Fix the issue where data changes during search and search results are not updated in certain situations;</p>
<p>5.Fix the issue of deleting adjacent nodes when deleting nodes that are currently being edited;</p>
<p>6.Fix the issue of rendering only the root node when expand: false is set to the root node in the node data;</p>
<p>7.Fix the collaborative editing plugin: When a node is selected and then folded, the activation status of the node disappears, but the selected status of the node still exists in other clients;</p>
</blockquote>
<p>New:</p>
<blockquote>
<p>1.The commands such as INSERTNODE will not overwrite custom UIDs;</p>
<p>2.Methods for adding and removing highlighting for node instances; Adjust the way read-only mode searches for highlighted nodes;</p>
<p>3.Add configuration for searching all nodes (including those that have been folded); Search defaults to searching all nodes;</p>
<p>4.Add configuration options that cannot be selected by multiple people on the same node during collaborative editing;</p>
<p>5.Add lifecycle function configuration options before synchronizing collaborative editing node operations;</p>
<p>6.Add UID field to the summary node;</p>
</blockquote>
<p>Demo:</p>
<blockquote>
<p>1.Fix the issue where shortcut keys become invalid after opening label pop ups and note pop ups and clicking on the mask to close them;</p>
<p>2.Modify the association logic between themes and dark colors;</p>
<p>3.Support reading local directories;</p>
</blockquote>
<h2>0.9.7</h2>
<p>Fix:</p>
<blockquote>

View File

@@ -110,7 +110,10 @@ const mindMap = new MindMap({
| isLimitMindMapInCanvasWhenHasScrollbarv0.9.2+ | Boolean | true | When registering the Scrollbar plugin, will the mind map be limited to the canvas and the isLimitMindMapInCanvas configuration no longer work | |
| associativeLineInitPointsPositionv0.9.5+ | null / { from, to } | { from: '', to: '' } | By default, the position of the two endpoints of a newly created association line is calculated based on the relative position of the center points of the two nodes. If you want to fix the position, you can configure it through this option. If neither from nor to is transmitted, they will be automatically calculated. If only one is transmitted, the other will be automatically calculated. from and to optional values
left、top、bottom、right | |
| enableAdjustAssociativeLinePointsv0.9.5+ | Boolean | true | Is it allowed to adjust the position of the two endpoints of the associated line |
| enableAdjustAssociativeLinePointsv0.9.5+ | Boolean | true | Is it allowed to adjust the position of the two endpoints of the associated line | |
| isOnlySearchCurrentRenderNodesv0.9.8+ | Boolean | false | Is it necessary to only search for the current rendered node, and nodes that have been collapsed will not be searched for | |
| onlyOneEnableActiveNodeOnCooperatev0.9.8+ | Boolean | false | During collaborative editing, the same node cannot be selected by multiple people at the same time | |
| beforeCooperateUpdatev0.9.8+ | Function、null | null | During collaborative editing, node operations are about to be updated to the lifecycle functions of other clients. The function takes an object as a parameter:{ type: 【createOrUpdateCreate or update nodes、deleteDelete node】, data: 【1.When type=createOrUpdate, it represents the node data that has been created or updated, which will be synchronized to other clients, so you can modify the data; 2.When type=delete, represents the deleted node data】 } | |
### Data structure
@@ -533,7 +536,7 @@ redo. All commands are as follows:
| SET_NODE_CUSTOM_POSITION (v0.2.0+) | Set a custom position for a node | node (the node to set), left (custom x coordinate, default is undefined), top (custom y coordinate, default is undefined) |
| RESET_LAYOUT (v0.2.0+) | Arrange layout with one click | |
| SET_NODE_SHAPE (v0.2.4+) | Set the shape of a node | node (the node to set), shape (the shape, all shapes: [Shape.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/render/node/Shape.js)) |
| GO_TARGET_NODEv0.6.7+ | Navigate to a node, and if the node is collapsed, it will automatically expand to that node | nodeNode instance or node uid to locate、callbackv0.6.9+, Callback function after positioning completion |
| GO_TARGET_NODEv0.6.7+ | Navigate to a node, and if the node is collapsed, it will automatically expand to that node | nodeNode instance or node uid to locate、callbackv0.6.9+, Callback function after positioning completion, v0.9.8+receives a parameter representing the target node instance |
| INSERT_MULTI_NODEv0.7.2+ | Insert multiple sibling nodes into the specified node at the same time, with the operating node being the currently active node or the specified node | appointNodesOptional, specify nodes, specify multiple nodes to pass an array, nodeListData list of newly inserted nodes, array type |
| INSERT_MULTI_CHILD_NODEv0.7.2+ | Insert multiple child nodes into the specified node simultaneously, with the operation node being the currently active node or the specified node | appointNodesOptional, specify nodes, specify multiple nodes to pass an array, childListData list of newly inserted nodes, array type |
| INSERT_FORMULAv0.7.2+ | Insert mathematical formulas into nodes, operate on the currently active node or specified node | formulaMathematical formula to insert, LaTeX syntax, appointNodesOptional, specify the node to insert the formula into. Multiple nodes can be passed as arrays, otherwise it defaults to the currently active node |

View File

@@ -637,6 +637,27 @@
<td>Is it allowed to adjust the position of the two endpoints of the associated line</td>
<td></td>
</tr>
<tr>
<td>isOnlySearchCurrentRenderNodesv0.9.8+</td>
<td>Boolean</td>
<td>false</td>
<td>Is it necessary to only search for the current rendered node, and nodes that have been collapsed will not be searched for</td>
<td></td>
</tr>
<tr>
<td>onlyOneEnableActiveNodeOnCooperatev0.9.8+</td>
<td>Boolean</td>
<td>false</td>
<td>During collaborative editing, the same node cannot be selected by multiple people at the same time</td>
<td></td>
</tr>
<tr>
<td>beforeCooperateUpdatev0.9.8+</td>
<td>Function、null</td>
<td>null</td>
<td>During collaborative editing, node operations are about to be updated to the lifecycle functions of other clients. The function takes an object as a parameter:{ type: 【createOrUpdateCreate or update nodes、deleteDelete node】, data: 【1.When type=createOrUpdate, it represents the node data that has been created or updated, which will be synchronized to other clients, so you can modify the data; 2.When type=delete, represents the deleted node data】 }</td>
<td></td>
</tr>
</tbody>
</table>
<h3>Data structure</h3>
@@ -1363,7 +1384,7 @@ redo. All commands are as follows:</p>
<tr>
<td>GO_TARGET_NODEv0.6.7+</td>
<td>Navigate to a node, and if the node is collapsed, it will automatically expand to that node</td>
<td>nodeNode instance or node uid to locate、callbackv0.6.9+, Callback function after positioning completion</td>
<td>nodeNode instance or node uid to locate、callbackv0.6.9+, Callback function after positioning completion, v0.9.8+receives a parameter representing the target node instance</td>
</tr>
<tr>
<td>INSERT_MULTI_NODEv0.7.2+</td>

View File

@@ -20,6 +20,14 @@
- [x] Provide rich configurations to meet various scenarios and usage habits
- [x] Support collaborative editing
> Features that will not be implemented:
>
> 1.Free nodes, i.e. multiple root nodes;
>
> 2.Continue adding nodes after the summary node;
>
> If you need the above features, this library may not meet your needs.
## Repository Catalog Introduction
1.`simple-mind-map`

View File

@@ -8,18 +8,24 @@
</blockquote>
<h2>Features</h2>
<ul>
<li><input type="checkbox" id="checkbox16" checked="true" /><label for="checkbox16">Pluggable architecture, in addition to core functions, other functions are provided as plugins, which can be used as needed to reduce packaging volume</label></li>
<li><input type="checkbox" id="checkbox17" checked="true" /><label for="checkbox17">Support logical structure chart, mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
<li><input type="checkbox" id="checkbox18" checked="true" /><label for="checkbox18">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
<li><input type="checkbox" id="checkbox19" checked="true" /><label for="checkbox19">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
<li><input type="checkbox" id="checkbox20" checked="true" /><label for="checkbox20">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, and fully customize node content using DDM</label></li>
<li><input type="checkbox" id="checkbox21" checked="true" /><label for="checkbox21">Support canvas dragging and scaling</label></li>
<li><input type="checkbox" id="checkbox22" checked="true" /><label for="checkbox22">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
<li><input type="checkbox" id="checkbox23" checked="true" /><label for="checkbox23">Supoorts to export as </label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>, support import from <code>json</code><code>xmind</code><code>markdown</code></li>
<li><input type="checkbox" id="checkbox24" checked="true" /><label for="checkbox24">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, and scrollbar</label></li>
<li><input type="checkbox" id="checkbox25" checked="true" /><label for="checkbox25">Provide rich configurations to meet various scenarios and usage habits</label></li>
<li><input type="checkbox" id="checkbox26" checked="true" /><label for="checkbox26">Support collaborative editing</label></li>
<li><input type="checkbox" id="checkbox80" checked="true" /><label for="checkbox80">Pluggable architecture, in addition to core functions, other functions are provided as plugins, which can be used as needed to reduce packaging volume</label></li>
<li><input type="checkbox" id="checkbox81" checked="true" /><label for="checkbox81">Support logical structure chart, mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures</label></li>
<li><input type="checkbox" id="checkbox82" checked="true" /><label for="checkbox82">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
<li><input type="checkbox" id="checkbox83" checked="true" /><label for="checkbox83">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
<li><input type="checkbox" id="checkbox84" checked="true" /><label for="checkbox84">Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, and fully customize node content using DDM</label></li>
<li><input type="checkbox" id="checkbox85" checked="true" /><label for="checkbox85">Support canvas dragging and scaling</label></li>
<li><input type="checkbox" id="checkbox86" checked="true" /><label for="checkbox86">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
<li><input type="checkbox" id="checkbox87" checked="true" /><label for="checkbox87">Supoorts to export as </label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>, support import from <code>json</code><code>xmind</code><code>markdown</code></li>
<li><input type="checkbox" id="checkbox88" checked="true" /><label for="checkbox88">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, and scrollbar</label></li>
<li><input type="checkbox" id="checkbox89" checked="true" /><label for="checkbox89">Provide rich configurations to meet various scenarios and usage habits</label></li>
<li><input type="checkbox" id="checkbox90" checked="true" /><label for="checkbox90">Support collaborative editing</label></li>
</ul>
<blockquote>
<p>Features that will not be implemented:</p>
<p>1.Free nodes, i.e. multiple root nodes;</p>
<p>2.Continue adding nodes after the summary node;</p>
<p>If you need the above features, this library may not meet your needs.</p>
</blockquote>
<h2>Repository Catalog Introduction</h2>
<p>1.<code>simple-mind-map</code></p>
<p>This is a mind map library that is framework-agnostic and can be used with
@@ -28,16 +34,16 @@ frameworks such as Vue and React, or without a framework.</p>
<p>This is an online mind map built using the <code>simple-mind-map</code> library and based
on <code>Vue2.x</code> and <code>ElementUI</code>. Features include:</p>
<ul>
<li><input type="checkbox" id="checkbox27" checked="true" /><label for="checkbox27">Toolbar, which supports inserting and deleting nodes, and editing node</label>
<li><input type="checkbox" id="checkbox91" checked="true" /><label for="checkbox91">Toolbar, which supports inserting and deleting nodes, and editing node</label>
images, icons, hyperlinks, notes, tags, and summaries</li>
<li><input type="checkbox" id="checkbox28" checked="true" /><label for="checkbox28">Sidebar, with panels for basic style settings, node style settings,</label>
<li><input type="checkbox" id="checkbox92" checked="true" /><label for="checkbox92">Sidebar, with panels for basic style settings, node style settings,</label>
outline, theme selection, and structure selection</li>
<li><input type="checkbox" id="checkbox29" checked="true" /><label for="checkbox29">Import and export functionality; data is saved in the browser's local</label>
<li><input type="checkbox" id="checkbox93" checked="true" /><label for="checkbox93">Import and export functionality; data is saved in the browser's local</label>
storage by default, but it also supports creating, opening, and editing
local files on the computer directly</li>
<li><input type="checkbox" id="checkbox30" checked="true" /><label for="checkbox30">Right-click menu, which supports operations such as expanding, collapsing,</label>
<li><input type="checkbox" id="checkbox94" checked="true" /><label for="checkbox94">Right-click menu, which supports operations such as expanding, collapsing,</label>
and organizing layout</li>
<li><input type="checkbox" id="checkbox31" checked="true" /><label for="checkbox31">Bottom bar, which supports node and word count statistics, switching</label>
<li><input type="checkbox" id="checkbox95" checked="true" /><label for="checkbox95">Bottom bar, which supports node and word count statistics, switching</label>
between edit and read-only modes, zooming in and out, and switching to
full screen, support mini map</li>
</ul>

View File

@@ -56,6 +56,18 @@ Whether the node is currently being dragged
## Methods
### highlight()
> v0.9.8+
Highlight node.
### closeHighlight()
> v0.9.8+
Unhighlight node.
### getPureData(removeActiveState = true, removeId = false)
> v0.9.0+

View File

@@ -31,6 +31,16 @@
</blockquote>
<p>Whether the node is currently being dragged</p>
<h2>Methods</h2>
<h3>highlight()</h3>
<blockquote>
<p>v0.9.8+</p>
</blockquote>
<p>Highlight node.</p>
<h3>closeHighlight()</h3>
<blockquote>
<p>v0.9.8+</p>
</blockquote>
<p>Unhighlight node.</p>
<h3>getPureData(removeActiveState = true, removeId = false)</h3>
<blockquote>
<p>v0.9.0+</p>

View File

@@ -21,3 +21,9 @@ Register temporary shortcut keys, which means editing can be completed through t
- `node`Node instance to enter for editing
Manually enable node editing. By default, it will enter node editing when double clicking or pressing F2 on the node.
### getCurrentEditNode()
> v0.9.8+
Get the node instance currently being edited.

View File

@@ -14,6 +14,11 @@
<li><code>node</code>Node instance to enter for editing</li>
</ul>
<p>Manually enable node editing. By default, it will enter node editing when double clicking or pressing F2 on the node.</p>
<h3>getCurrentEditNode()</h3>
<blockquote>
<p>v0.9.8+</p>
</blockquote>
<p>Get the node instance currently being edited.</p>
</div>
</template>

View File

@@ -1,5 +1,45 @@
# Changelog
## 0.9.8
修复:
> 1.修复当画布大小改变后,限制思维导图在画布内和滚动条位置计算功能不正确的问题;
>
> 2.修复导入某些旧版xmind文件时报错的问题
>
> 3.修复只读模式搜索高亮节点时收起节点高亮框未消失的问题;
>
> 4.修复某些情况下搜索时数据改变,搜索结果没有更新的问题;
>
> 5.修复删除正在编辑中的节点时实际上删除的是相邻节点的问题;
>
> 6.修复节点数据中根节点设置了expand:false时只渲染根节点的问题
>
> 7.修复协同编辑插件:当选中一个节点时,再将该节点收起,该节点激活状态已消失,但其他客户端该节点的选中状态依旧存在的问题;
新增:
> 1.INSERT_NODE等命令不会覆盖自定义的uid
>
> 2.节点实例新增高亮和取消高亮的方法;调整只读模式搜索高亮节点的方式;
>
> 3.新增搜索所有节点(包含被收起的节点)的配置;搜索默认改为搜索所有节点;
>
> 4.增加协同编辑时同一节点不能多人选中的配置选项;
>
> 5.增加协同编辑节点操作同步前的生命周期函数配置选项;
>
> 6.概要节点增加uid字段
Demo
> 1.修复打开标签弹窗、备注弹窗后点击遮罩关闭弹窗后快捷键会失效的问题;
>
> 2.修改主题和暗色的关联逻辑;
>
> 3.支持读取本地目录;
## 0.9.7
修复:

View File

@@ -1,6 +1,32 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.9.8</h2>
<p>修复</p>
<blockquote>
<p>1.修复当画布大小改变后限制思维导图在画布内和滚动条位置计算功能不正确的问题</p>
<p>2.修复导入某些旧版xmind文件时报错的问题</p>
<p>3.修复只读模式搜索高亮节点时收起节点高亮框未消失的问题</p>
<p>4.修复某些情况下搜索时数据改变搜索结果没有更新的问题</p>
<p>5.修复删除正在编辑中的节点时实际上删除的是相邻节点的问题</p>
<p>6.修复节点数据中根节点设置了expand:false时只渲染根节点的问题</p>
<p>7.修复协同编辑插件当选中一个节点时再将该节点收起该节点激活状态已消失但其他客户端该节点的选中状态依旧存在的问题</p>
</blockquote>
<p>新增</p>
<blockquote>
<p>1.INSERT_NODE等命令不会覆盖自定义的uid</p>
<p>2.节点实例新增高亮和取消高亮的方法调整只读模式搜索高亮节点的方式</p>
<p>3.新增搜索所有节点包含被收起的节点的配置搜索默认改为搜索所有节点</p>
<p>4.增加协同编辑时同一节点不能多人选中的配置选项</p>
<p>5.增加协同编辑节点操作同步前的生命周期函数配置选项</p>
<p>6.概要节点增加uid字段</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.修复打开标签弹窗备注弹窗后点击遮罩关闭弹窗后快捷键会失效的问题</p>
<p>2.修改主题和暗色的关联逻辑</p>
<p>3.支持读取本地目录</p>
</blockquote>
<h2>0.9.7</h2>
<p>修复</p>
<blockquote>

View File

@@ -110,6 +110,9 @@ const mindMap = new MindMap({
| isLimitMindMapInCanvasWhenHasScrollbarv0.9.2+ | Boolean | true | 当注册了滚动条插件Scrollbar是否将思维导图限制在画布内isLimitMindMapInCanvas配置不再起作用 |
| associativeLineInitPointsPositionv0.9.5+ | null / { from, to } | { from: '', to: '' } | 默认情况下新创建的关联线两个端点的位置是根据两个节点中心点的相对位置来计算的如果你想固定位置可以通过这个选项来配置。from和to都不传则都自动计算如果只传一个另一个则会自动计算。from和to可选值left、top、bottom、right |
| enableAdjustAssociativeLinePointsv0.9.5+ | Boolean | true | 是否允许调整关联线两个端点的位置 |
| isOnlySearchCurrentRenderNodesv0.9.8+ | Boolean | false | 是否仅搜索当前渲染的节点,被收起的节点不会被搜索到 |
| onlyOneEnableActiveNodeOnCooperatev0.9.8+ | Boolean | false | 协同编辑时,同一个节点不能同时被多人选中 |
| beforeCooperateUpdatev0.9.8+ | Function、null | null | 协同编辑时,节点操作即将更新到其他客户端前的生命周期函数。函数接收一个对象作为参数:{ type: 【createOrUpdate创建节点或更新节点、delete删除节点】, data: 【1.当type=createOrUpdate时代表被创建或被更新的节点数据即将同步到其他客户端所以你可以修改该数据2.当type=delete时代表被删除的节点数据】 } |
### 数据结构
@@ -527,7 +530,7 @@ mindMap.updateConfig({
| SET_NODE_CUSTOM_POSITIONv0.2.0+ | 设置节点自定义位置 | node要设置的节点、 left自定义的x坐标默认为undefined、 top自定义的y坐标默认为undefined |
| RESET_LAYOUTv0.2.0+ | 一键整理布局 | |
| SET_NODE_SHAPEv0.2.4+ | 设置节点形状 | node要设置的节点、shape形状全部形状[Shape.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/render/node/Shape.js) |
| GO_TARGET_NODEv0.6.7+ | 定位到某个节点,如果该节点被收起,那么会自动展开到该节点 | node要定位到的节点实例或节点uid、callbackv0.6.9+,定位完成后的回调函数) |
| GO_TARGET_NODEv0.6.7+ | 定位到某个节点,如果该节点被收起,那么会自动展开到该节点 | node要定位到的节点实例或节点uid、callbackv0.6.9+,定位完成后的回调函数v0.9.8+接收一个参数,代表目标节点实例 |
| INSERT_MULTI_NODEv0.7.2+ | 给指定的节点同时插入多个同级节点,操作节点为当前激活的节点或指定节点 | appointNodes可选指定节点指定多个节点可以传一个数组, nodeList新插入节点的数据列表数组类型 |
| INSERT_MULTI_CHILD_NODEv0.7.2+ | 给指定的节点同时插入多个子节点,操作节点为当前激活的节点或指定节点 | appointNodes可选指定节点指定多个节点可以传一个数组, childList新插入节点的数据列表数组类型 |
| INSERT_FORMULAv0.7.2+ | 给节点插入数学公式,操作节点为当前激活的节点或指定节点 | formula要插入的数学公式LaTeX 语法), appointNodes可选指定要插入公式的节点多个节点可以传数组否则默认为当前激活的节点 |

View File

@@ -543,6 +543,24 @@
<td>true</td>
<td>是否允许调整关联线两个端点的位置</td>
</tr>
<tr>
<td>isOnlySearchCurrentRenderNodesv0.9.8+</td>
<td>Boolean</td>
<td>false</td>
<td>是否仅搜索当前渲染的节点被收起的节点不会被搜索到</td>
</tr>
<tr>
<td>onlyOneEnableActiveNodeOnCooperatev0.9.8+</td>
<td>Boolean</td>
<td>false</td>
<td>协同编辑时同一个节点不能同时被多人选中</td>
</tr>
<tr>
<td>beforeCooperateUpdatev0.9.8+</td>
<td>Functionnull</td>
<td>null</td>
<td>协同编辑时节点操作即将更新到其他客户端前的生命周期函数函数接收一个对象作为参数{ type: createOrUpdate创建节点或更新节点delete删除节点, data: 1.当type=createOrUpdate时代表被创建或被更新的节点数据即将同步到其他客户端所以你可以修改该数据2.当type=delete时代表被删除的节点数据 }</td>
</tr>
</tbody>
</table>
<h3>数据结构</h3>
@@ -1264,7 +1282,7 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
<tr>
<td>GO_TARGET_NODEv0.6.7+</td>
<td>定位到某个节点如果该节点被收起那么会自动展开到该节点</td>
<td>node要定位到的节点实例或节点uidcallbackv0.6.9+定位完成后的回调函数</td>
<td>node要定位到的节点实例或节点uidcallbackv0.6.9+定位完成后的回调函数v0.9.8+接收一个参数代表目标节点实例</td>
</tr>
<tr>
<td>INSERT_MULTI_NODEv0.7.2+</td>

View File

@@ -20,6 +20,14 @@
- [x] 提供丰富的配置,满足各种场景各种使用习惯
- [x] 支持协同编辑
> 不会实现的特性:
>
> 1.自由节点,即多个根节点;
>
> 2.概要节点后面继续添加节点;
>
> 如果你需要以上特性,那么本库可能无法满足你的需求。
## 仓库目录介绍
1.`simple-mind-map`

View File

@@ -8,29 +8,35 @@
</blockquote>
<h2>特性</h2>
<ul>
<li><input type="checkbox" id="checkbox0" checked="true" /><label for="checkbox0">插件化架构除核心功能外其他功能作为插件提供按需使用减小打包体积</label></li>
<li><input type="checkbox" id="checkbox1" checked="true" /><label for="checkbox1">支持逻辑结构图思维导图组织结构图目录组织图时间轴横向竖向鱼骨图等结构</label></li>
<li><input type="checkbox" id="checkbox2" checked="true" /><label for="checkbox2">内置多种主题允许高度自定义样式支持注册新主题</label></li>
<li><input type="checkbox" id="checkbox3" checked="true" /><label for="checkbox3">节点内容支持文本普通文本富文本图片图标超链接备注标签概要数学公式</label></li>
<li><input type="checkbox" id="checkbox4" checked="true" /><label for="checkbox4">节点支持拖拽拖拽移动自由调整多种节点形状支持使用 DDM 完全自定义节点内容</label></li>
<li><input type="checkbox" id="checkbox5" checked="true" /><label for="checkbox5">支持画布拖动缩放</label></li>
<li><input type="checkbox" id="checkbox6" checked="true" /><label for="checkbox6">支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式</label></li>
<li><input type="checkbox" id="checkbox7" checked="true" /><label for="checkbox7">支持导出为</label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>支持从<code>json</code><code>xmind</code><code>markdown</code>导入</li>
<li><input type="checkbox" id="checkbox8" checked="true" /><label for="checkbox8">支持快捷键前进后退关联线搜索替换小地图水印滚动条</label></li>
<li><input type="checkbox" id="checkbox9" checked="true" /><label for="checkbox9">提供丰富的配置满足各种场景各种使用习惯</label></li>
<li><input type="checkbox" id="checkbox10" checked="true" /><label for="checkbox10">支持协同编辑</label></li>
<li><input type="checkbox" id="checkbox64" checked="true" /><label for="checkbox64">插件化架构除核心功能外其他功能作为插件提供按需使用减小打包体积</label></li>
<li><input type="checkbox" id="checkbox65" checked="true" /><label for="checkbox65">支持逻辑结构图思维导图组织结构图目录组织图时间轴横向竖向鱼骨图等结构</label></li>
<li><input type="checkbox" id="checkbox66" checked="true" /><label for="checkbox66">内置多种主题允许高度自定义样式支持注册新主题</label></li>
<li><input type="checkbox" id="checkbox67" checked="true" /><label for="checkbox67">节点内容支持文本普通文本富文本图片图标超链接备注标签概要数学公式</label></li>
<li><input type="checkbox" id="checkbox68" checked="true" /><label for="checkbox68">节点支持拖拽拖拽移动自由调整多种节点形状支持使用 DDM 完全自定义节点内容</label></li>
<li><input type="checkbox" id="checkbox69" checked="true" /><label for="checkbox69">支持画布拖动缩放</label></li>
<li><input type="checkbox" id="checkbox70" checked="true" /><label for="checkbox70">支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式</label></li>
<li><input type="checkbox" id="checkbox71" checked="true" /><label for="checkbox71">支持导出为</label><code>json</code><code>png</code><code>svg</code><code>pdf</code><code>markdown</code><code>xmind</code>支持从<code>json</code><code>xmind</code><code>markdown</code>导入</li>
<li><input type="checkbox" id="checkbox72" checked="true" /><label for="checkbox72">支持快捷键前进后退关联线搜索替换小地图水印滚动条</label></li>
<li><input type="checkbox" id="checkbox73" checked="true" /><label for="checkbox73">提供丰富的配置满足各种场景各种使用习惯</label></li>
<li><input type="checkbox" id="checkbox74" checked="true" /><label for="checkbox74">支持协同编辑</label></li>
</ul>
<blockquote>
<p>不会实现的特性</p>
<p>1.自由节点即多个根节点</p>
<p>2.概要节点后面继续添加节点</p>
<p>如果你需要以上特性那么本库可能无法满足你的需求</p>
</blockquote>
<h2>仓库目录介绍</h2>
<p>1.<code>simple-mind-map</code></p>
<p>思维导图库框架无关<code>Vue</code><code>React</code>等框架或无框架都可以使用</p>
<p>2.<code>web</code></p>
<p>使用<code>simple-mind-map</code>基于<code>vue2.x</code><code>ElementUI</code>搭建的在线思维导图特性</p>
<ul>
<li><input type="checkbox" id="checkbox11" checked="true" /><label for="checkbox11">工具栏支持插入节点删除节点编辑节点图片图标超链接备注标签概要</label></li>
<li><input type="checkbox" id="checkbox12" checked="true" /><label for="checkbox12">侧边栏基础样式设置面板节点样式设置面板大纲面板主题选择面板结构选择面板</label></li>
<li><input type="checkbox" id="checkbox13" checked="true" /><label for="checkbox13">导入导出功能数据默认保存在浏览器本地存储也支持直接创建打开编辑电脑本地文件</label></li>
<li><input type="checkbox" id="checkbox14" checked="true" /><label for="checkbox14">右键菜单支持展开收起整理布局等操作</label></li>
<li><input type="checkbox" id="checkbox15" checked="true" /><label for="checkbox15">底部栏支持节点数量字数统计支持切换编辑和只读模式支持放大缩小支持全屏切换支持小地图</label></li>
<li><input type="checkbox" id="checkbox75" checked="true" /><label for="checkbox75">工具栏支持插入节点删除节点编辑节点图片图标超链接备注标签概要</label></li>
<li><input type="checkbox" id="checkbox76" checked="true" /><label for="checkbox76">侧边栏基础样式设置面板节点样式设置面板大纲面板主题选择面板结构选择面板</label></li>
<li><input type="checkbox" id="checkbox77" checked="true" /><label for="checkbox77">导入导出功能数据默认保存在浏览器本地存储也支持直接创建打开编辑电脑本地文件</label></li>
<li><input type="checkbox" id="checkbox78" checked="true" /><label for="checkbox78">右键菜单支持展开收起整理布局等操作</label></li>
<li><input type="checkbox" id="checkbox79" checked="true" /><label for="checkbox79">底部栏支持节点数量字数统计支持切换编辑和只读模式支持放大缩小支持全屏切换支持小地图</label></li>
</ul>
<p>提供文档页面服务</p>
<p>3.<code>dist</code></p>

View File

@@ -56,6 +56,18 @@
## 方法
### highlight()
> v0.9.8+
高亮节点。
### closeHighlight()
> v0.9.8+
取消高亮节点。
### getPureData(removeActiveState = true, removeId = false)
> v0.9.0+

View File

@@ -31,6 +31,16 @@
</blockquote>
<p>节点是否正在拖拽中</p>
<h2>方法</h2>
<h3>highlight()</h3>
<blockquote>
<p>v0.9.8+</p>
</blockquote>
<p>高亮节点</p>
<h3>closeHighlight()</h3>
<blockquote>
<p>v0.9.8+</p>
</blockquote>
<p>取消高亮节点</p>
<h3>getPureData(removeActiveState = true, removeId = false)</h3>
<blockquote>
<p>v0.9.0+</p>

View File

@@ -21,3 +21,9 @@
- `node`:要进入编辑的节点实例
手动开启节点编辑。默认会在节点双击、按 F2 时进入节点编辑。
### getCurrentEditNode()
> v0.9.8+
获取当前正在编辑中的节点实例。

View File

@@ -14,6 +14,11 @@
<li><code>node</code>要进入编辑的节点实例</li>
</ul>
<p>手动开启节点编辑默认会在节点双击 F2 时进入节点编辑</p>
<h3>getCurrentEditNode()</h3>
<blockquote>
<p>v0.9.8+</p>
</blockquote>
<p>获取当前正在编辑中的节点实例</p>
</div>
</template>

View File

@@ -96,7 +96,7 @@ MindMap.usePlugin(MiniMap)
.usePlugin(SearchPlugin)
.usePlugin(Painter)
.usePlugin(Formula)
// .usePlugin(Cooperate)// 协同插件
.usePlugin(Cooperate) // 协同插件
// 注册自定义主题
customThemeList.forEach(item => {
@@ -346,6 +346,23 @@ export default {
default:
break
}
},
beforeCooperateUpdate: ({ type, data }) => {
if (type === 'createOrUpdate') {
if (data.data.version === undefined) {
data.data.version = 0
}
const newVersion = data.data.version + 1
data.data.version = newVersion
const targetNode = this.mindMap.renderer.findNodeByUid(
data.data.uid
)
if (targetNode) {
targetNode.setData({
version: newVersion
})
}
}
}
// handleNodePasteImg: img => {
// console.log(img)
@@ -439,6 +456,24 @@ export default {
this.$bus.$emit(event, ...args)
})
})
this.mindMap.on('data_change_detail', actions => {
actions.forEach(({ action, oldData, data }) => {
console.log(action, oldData, data)
if (action === 'create') {
console.log('调新增接口', data)
} else if (action === 'update') {
const oldChildrenLength = oldData.children.length
const newChildrenLength = data.children.length
if (oldChildrenLength !== newChildrenLength) {
console.log('调移动接口', oldChildrenLength, newChildrenLength)
} else {
console.log('更新调接口')
}
} else if (action === 'delete') {
console.log('调删除节点', data)
}
})
})
this.bindSaveEvent()
this.testDynamicCreateNodes()
// 如果应用被接管,那么抛出事件传递思维导图实例
@@ -701,7 +736,7 @@ export default {
if (this.mindMap.cooperate && this.$route.query.userName) {
this.mindMap.cooperate.setProvider(null, {
roomName: 'demo-room',
signalingList: ['ws://192.168.3.125:4444']
signalingList: ['ws://10.16.83.11:4444']
})
this.mindMap.cooperate.setUserInfo({
id: Math.random(),