mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Doc update
This commit is contained in:
parent
50f125471e
commit
464e57d019
@ -30,12 +30,12 @@ Github:[releases](https://github.com/wanglin2/mind-map/releases)。
|
||||
- [x] 插件化架构,除核心功能外,其他功能作为插件提供,按需使用,减小打包体积
|
||||
- [x] 支持逻辑结构图、思维导图、组织结构图、目录组织图、时间轴(横向、竖向)、鱼骨图等结构
|
||||
- [x] 内置多种主题,允许高度自定义样式,支持注册新主题
|
||||
- [x] 节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要
|
||||
- [x] 节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要、数学公式
|
||||
- [x] 节点支持拖拽(拖拽移动、自由调整)、多种节点形状,支持使用 DDM 完全自定义节点内容
|
||||
- [x] 支持画布拖动、缩放
|
||||
- [x] 支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式
|
||||
- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`,支持从`json`、`xmind`、`markdown`导入
|
||||
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印
|
||||
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条
|
||||
- [x] 提供丰富的配置,满足各种场景各种使用习惯
|
||||
|
||||
# 安装
|
||||
|
||||
@ -35,6 +35,7 @@ let APIList = [
|
||||
'search',
|
||||
'painter',
|
||||
'scrollbar',
|
||||
'formula',
|
||||
'xmind',
|
||||
'markdown',
|
||||
'utils'
|
||||
|
||||
@ -1,5 +1,43 @@
|
||||
# Changelog
|
||||
|
||||
## 0.7.2
|
||||
|
||||
Fix:
|
||||
|
||||
> 1.Fixed the issue of nodes not being selected when the selection area does not include node boundaries when multiple nodes are selected.
|
||||
>
|
||||
> 2.Fix the issue of errors when node text is not a string.
|
||||
>
|
||||
> 3.Fix the issue of some text disappearing when edited again when there are<>&characters in the text in non rich text mode.
|
||||
|
||||
New:
|
||||
|
||||
> 1.Supports inserting mathematical formulas.
|
||||
>
|
||||
> 2.Supports dragging and moving multiple nodes simultaneously.
|
||||
>
|
||||
> 3.Supports copying and cutting multiple nodes simultaneously.
|
||||
>
|
||||
> 4.The node label color has been changed to be generated based on the label content, meaning that the same label content will generate the same color.
|
||||
>
|
||||
> 5.Optimize the insertion of child nodes: 1. When inserting child nodes into multiple nodes simultaneously, do not enter the editing state; 2. The newly inserted child node automatically enters the active state.
|
||||
>
|
||||
> 6.Optimize the insertion of sibling nodes: 1. Support the simultaneous insertion of sibling nodes into multiple nodes; 2. When calling the command to insert sibling nodes on the root node, no child nodes will be created.
|
||||
>
|
||||
> 7.Add a command to simultaneously insert multiple peers and multiple child nodes.
|
||||
>
|
||||
> 8.Changing the unique identifier of nodes from id to uid mainly affects the associated lines, which may not display properly in previous versions.
|
||||
>
|
||||
> 9.Optimize the logic of icon merging and support the expansion of icons under the internal classification of the library.
|
||||
>
|
||||
> 10.Associate line: 1. Double click the associate line to enter associate line text editing mode; If the associated line text is the default text, it will not be saved; 3. When there are active nodes, clicking on the associated line can directly activate the associated line.
|
||||
|
||||
Demo:
|
||||
|
||||
> 1.Fixed an issue where multiple nodes in the Zhixi mind map cannot be pasted when copying.
|
||||
>
|
||||
> 2.Add a sidebar for formula editing.
|
||||
|
||||
## 0.7.1-fix.2
|
||||
|
||||
Fix: 1.Fix the issue of plugin registration method chain call reporting errors.
|
||||
|
||||
@ -1,6 +1,31 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Changelog</h1>
|
||||
<h2>0.7.2</h2>
|
||||
<p>Fix:</p>
|
||||
<blockquote>
|
||||
<p>1.Fixed the issue of nodes not being selected when the selection area does not include node boundaries when multiple nodes are selected.</p>
|
||||
<p>2.Fix the issue of errors when node text is not a string.</p>
|
||||
<p>3.Fix the issue of some text disappearing when edited again when there are<>&characters in the text in non rich text mode.</p>
|
||||
</blockquote>
|
||||
<p>New:</p>
|
||||
<blockquote>
|
||||
<p>1.Supports inserting mathematical formulas.</p>
|
||||
<p>2.Supports dragging and moving multiple nodes simultaneously.</p>
|
||||
<p>3.Supports copying and cutting multiple nodes simultaneously.</p>
|
||||
<p>4.The node label color has been changed to be generated based on the label content, meaning that the same label content will generate the same color.</p>
|
||||
<p>5.Optimize the insertion of child nodes: 1. When inserting child nodes into multiple nodes simultaneously, do not enter the editing state; 2. The newly inserted child node automatically enters the active state.</p>
|
||||
<p>6.Optimize the insertion of sibling nodes: 1. Support the simultaneous insertion of sibling nodes into multiple nodes; 2. When calling the command to insert sibling nodes on the root node, no child nodes will be created.</p>
|
||||
<p>7.Add a command to simultaneously insert multiple peers and multiple child nodes.</p>
|
||||
<p>8.Changing the unique identifier of nodes from id to uid mainly affects the associated lines, which may not display properly in previous versions.</p>
|
||||
<p>9.Optimize the logic of icon merging and support the expansion of icons under the internal classification of the library.</p>
|
||||
<p>10.Associate line: 1. Double click the associate line to enter associate line text editing mode; If the associated line text is the default text, it will not be saved; 3. When there are active nodes, clicking on the associated line can directly activate the associated line.</p>
|
||||
</blockquote>
|
||||
<p>Demo:</p>
|
||||
<blockquote>
|
||||
<p>1.Fixed an issue where multiple nodes in the Zhixi mind map cannot be pasted when copying.</p>
|
||||
<p>2.Add a sidebar for formula editing.</p>
|
||||
</blockquote>
|
||||
<h2>0.7.1-fix.2</h2>
|
||||
<p>Fix: 1.Fix the issue of plugin registration method chain call reporting errors.</p>
|
||||
<p>New:</p>
|
||||
|
||||
@ -90,6 +90,10 @@ const mindMap = new MindMap({
|
||||
| deleteNodeActive(v0.7.1+) | Boolean | true | Enable the function of automatically activating adjacent nodes or parent nodes after deleting nodes | |
|
||||
| autoMoveWhenMouseInEdgeOnDrag(v0.7.1+) | Boolean | true | Whether to enable automatic canvas movement when the mouse moves to the edge of the canvas while dragging nodes | |
|
||||
| fit(v0.7.1-fix.2+) | Boolean | false | Is the first rendering scaled to fit the canvas size | |
|
||||
| dragMultiNodeRectConfig(v0.7.2+) | Object | { width: 40, height: 20, fill: '' } | The style configuration of the schematic rectangle that moves with the mouse when dragging multiple nodes, passing an object, and the field meanings are the width, height, and fill color of the rectangle | |
|
||||
| dragPlaceholderRectFill(v0.7.2+) | String | | The filling color of the schematic rectangle for the new position when dragging nodes. If not transmitted, the default color for the connected line is used | |
|
||||
| dragOpacityConfig(v0.7.2+) | Object | { cloneNodeOpacity: 0.5, beingDragNodeOpacity: 0.3 } | The transparency configuration during node dragging, passing an object, and the field meanings are: the transparency of the cloned node or rectangle that follows the mouse movement, and the transparency of the dragged node | |
|
||||
| tagsColorMap(v0.7.2+) | Object | {} | The color of a custom node label can be transferred to an object, where key is the label content to be assigned a color, and value is the color of the label content. If not transferred internally, a corresponding color will be generated based on the label content | |
|
||||
|
||||
### Data structure
|
||||
|
||||
@ -381,7 +385,7 @@ redo. All commands are as follows:
|
||||
| SELECT_ALL | Select all | |
|
||||
| BACK | Go back a specified number of steps | step (the number of steps to go back, default is 1) |
|
||||
| FORWARD | Go forward a specified number of steps | step (the number of steps to go forward, default is 1) |
|
||||
| INSERT_NODE | Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective | openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`) 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) )、 appointChildren(v0.6.14+, Optional, Specify the child nodes of the newly created node, array type) |
|
||||
| INSERT_NODE | Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective(v0.7.2+Supports simultaneous insertion of sibling nodes into multiple active nodes) | openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`) 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) )、 appointChildren(v0.6.14+, Optional, Specify the child nodes of the newly created node, array type) |
|
||||
| INSERT_CHILD_NODE | Insert a child node, the active node or appoint node will be the operation node | openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`)、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) )、 appointChildren(v0.6.14+, Optional, Specify the child nodes of the newly created node, array type) |
|
||||
| UP_NODE | Move node up, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the first node in the list will be invalid | |
|
||||
| DOWN_NODE | Move node down, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the last node in the list will be invalid | |
|
||||
@ -402,15 +406,18 @@ redo. All commands are as follows:
|
||||
| SET_NODE_HYPERLINK | Set Node Hyperlink | node (node to set), link (hyperlink address), title (hyperlink name, optional) |
|
||||
| SET_NODE_NOTE | Set Node Note | node (node to set), note (note text) |
|
||||
| SET_NODE_TAG | Set Node Tag | node (node to set), tag (string array, built-in color information can be obtained in [constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js)) |
|
||||
| INSERT_AFTER (v0.1.5+) | Move Node to After Another Node | node (node to move), exist (target node) |
|
||||
| INSERT_BEFORE (v0.1.5+) | Move Node to Before Another Node | node (node to move), exist (target node) |
|
||||
| MOVE_NODE_TO (v0.1.5+) | Move a node as a child of another node | node (the node to move), toNode (the target node) |
|
||||
| INSERT_AFTER (v0.1.5+) | Move Node to After Another Node | node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node) |
|
||||
| INSERT_BEFORE (v0.1.5+) | Move Node to Before Another Node | node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node) |
|
||||
| MOVE_NODE_TO (v0.1.5+) | Move a node as a child of another node | node (the node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), toNode (the target node) |
|
||||
| ADD_GENERALIZATION (v0.2.0+) | Add a node summary | data (the data for the summary, in object format, all numerical fields of the node are supported, default is `{text: 'summary'}`) |
|
||||
| REMOVE_GENERALIZATION (v0.2.0+) | Remove a node summary | |
|
||||
| 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_NODE(v0.6.7+) | Navigate to a node, and if the node is collapsed, it will automatically expand to that node | node(Node instance or node uid to locate)、callback(v0.6.9+, Callback function after positioning completion) |
|
||||
| INSERT_MULTI_NODE(v0.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 | appointNodes(Optional, specify nodes, specify multiple nodes to pass an array), nodeList(Data list of newly inserted nodes, array type) |
|
||||
| INSERT_MULTI_CHILD_NODE(v0.7.2+) | Insert multiple child nodes into the specified node simultaneously, with the operation node being the currently active node or the specified node | appointNodes(Optional, specify nodes, specify multiple nodes to pass an array), childList(Data list of newly inserted nodes, array type) |
|
||||
| INSERT_FORMULA(v0.7.2+) | Insert mathematical formulas into nodes, operate on the currently active node or specified node | formula(Mathematical formula to insert, LaText syntax), appointNodes(Optional, specify the node to insert the formula into. Multiple nodes can be passed as arrays, otherwise it defaults to the currently active node) |
|
||||
|
||||
### setData(data)
|
||||
|
||||
|
||||
@ -490,6 +490,34 @@
|
||||
<td>Is the first rendering scaled to fit the canvas size</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dragMultiNodeRectConfig(v0.7.2+)</td>
|
||||
<td>Object</td>
|
||||
<td>{ width: 40, height: 20, fill: '' }</td>
|
||||
<td>The style configuration of the schematic rectangle that moves with the mouse when dragging multiple nodes, passing an object, and the field meanings are the width, height, and fill color of the rectangle</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dragPlaceholderRectFill(v0.7.2+)</td>
|
||||
<td>String</td>
|
||||
<td></td>
|
||||
<td>The filling color of the schematic rectangle for the new position when dragging nodes. If not transmitted, the default color for the connected line is used</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dragOpacityConfig(v0.7.2+)</td>
|
||||
<td>Object</td>
|
||||
<td>{ cloneNodeOpacity: 0.5, beingDragNodeOpacity: 0.3 }</td>
|
||||
<td>The transparency configuration during node dragging, passing an object, and the field meanings are: the transparency of the cloned node or rectangle that follows the mouse movement, and the transparency of the dragged node</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>tagsColorMap(v0.7.2+)</td>
|
||||
<td>Object</td>
|
||||
<td>{}</td>
|
||||
<td>The color of a custom node label can be transferred to an object, where key is the label content to be assigned a color, and value is the color of the label content. If not transferred internally, a corresponding color will be generated based on the label content</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Data structure</h3>
|
||||
@ -961,7 +989,7 @@ redo. All commands are as follows:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_NODE</td>
|
||||
<td>Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective</td>
|
||||
<td>Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective(v0.7.2+Supports simultaneous insertion of sibling nodes into multiple active nodes)</td>
|
||||
<td>openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is <code>true</code>) 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to <a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a> )、 appointChildren(v0.6.14+, Optional, Specify the child nodes of the newly created node, array type)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1067,17 +1095,17 @@ redo. All commands are as follows:</p>
|
||||
<tr>
|
||||
<td>INSERT_AFTER (v0.1.5+)</td>
|
||||
<td>Move Node to After Another Node</td>
|
||||
<td>node (node to move), exist (target node)</td>
|
||||
<td>node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_BEFORE (v0.1.5+)</td>
|
||||
<td>Move Node to Before Another Node</td>
|
||||
<td>node (node to move), exist (target node)</td>
|
||||
<td>node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MOVE_NODE_TO (v0.1.5+)</td>
|
||||
<td>Move a node as a child of another node</td>
|
||||
<td>node (the node to move), toNode (the target node)</td>
|
||||
<td>node (the node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), toNode (the target node)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ADD_GENERALIZATION (v0.2.0+)</td>
|
||||
@ -1109,6 +1137,21 @@ redo. All commands are as follows:</p>
|
||||
<td>Navigate to a node, and if the node is collapsed, it will automatically expand to that node</td>
|
||||
<td>node(Node instance or node uid to locate)、callback(v0.6.9+, Callback function after positioning completion)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_MULTI_NODE(v0.7.2+)</td>
|
||||
<td>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</td>
|
||||
<td>appointNodes(Optional, specify nodes, specify multiple nodes to pass an array), nodeList(Data list of newly inserted nodes, array type)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_MULTI_CHILD_NODE(v0.7.2+)</td>
|
||||
<td>Insert multiple child nodes into the specified node simultaneously, with the operation node being the currently active node or the specified node</td>
|
||||
<td>appointNodes(Optional, specify nodes, specify multiple nodes to pass an array), childList(Data list of newly inserted nodes, array type)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_FORMULA(v0.7.2+)</td>
|
||||
<td>Insert mathematical formulas into nodes, operate on the currently active node or specified node</td>
|
||||
<td>formula(Mathematical formula to insert, LaText syntax), appointNodes(Optional, specify the node to insert the formula into. Multiple nodes can be passed as arrays, otherwise it defaults to the currently active node)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>setData(data)</h3>
|
||||
|
||||
36
web/src/pages/Doc/en/formula/index.md
Normal file
36
web/src/pages/Doc/en/formula/index.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Formula plugin
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
> This plugin is only supported in rich text mode, so it needs to be used after registering the RichText plugin
|
||||
|
||||
This plugin is used to support inserting formulas into nodes.
|
||||
|
||||
## Register
|
||||
|
||||
```js
|
||||
import MindMap from 'simple-mind-map'
|
||||
import Formula from 'simple-mind-map/src/plugins/Formula.js'
|
||||
|
||||
MindMap.usePlugin(Formula)
|
||||
```
|
||||
|
||||
After registration and instantiation of `MindMap`, the instance can be obtained through `mindMap.formula`.
|
||||
|
||||
## Usage
|
||||
|
||||
After registering the plugin, you can use the command 'INSERT_FORMULA' to insert the specified formula for the node:
|
||||
|
||||
```js
|
||||
mindMap.execCommand('INSERT_FORMULA', 'a^2')
|
||||
```
|
||||
|
||||
The above command will insert the 'a^2' formula into the currently active node.
|
||||
|
||||
If you want to assign a formula to a node or nodes, you can pass the second parameter:
|
||||
|
||||
```js
|
||||
mindMap.execCommand('INSERT_FORMULA', 'a^2', [Node])
|
||||
```
|
||||
|
||||
Pass in the specified node instance through the second parameter.
|
||||
39
web/src/pages/Doc/en/formula/index.vue
Normal file
39
web/src/pages/Doc/en/formula/index.vue
Normal file
@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Formula plugin</h1>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>This plugin is only supported in rich text mode, so it needs to be used after registering the RichText plugin</p>
|
||||
</blockquote>
|
||||
<p>This plugin is used to support inserting formulas into nodes.</p>
|
||||
<h2>Register</h2>
|
||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map'</span>
|
||||
<span class="hljs-keyword">import</span> Formula <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/plugins/Formula.js'</span>
|
||||
|
||||
MindMap.usePlugin(Formula)
|
||||
</code></pre>
|
||||
<p>After registration and instantiation of <code>MindMap</code>, the instance can be obtained through <code>mindMap.formula</code>.</p>
|
||||
<h2>Usage</h2>
|
||||
<p>After registering the plugin, you can use the command 'INSERT_FORMULA' to insert the specified formula for the node:</p>
|
||||
<pre class="hljs"><code>mindMap.execCommand(<span class="hljs-string">'INSERT_FORMULA'</span>, <span class="hljs-string">'a^2'</span>)
|
||||
</code></pre>
|
||||
<p>The above command will insert the 'a^2' formula into the currently active node.</p>
|
||||
<p>If you want to assign a formula to a node or nodes, you can pass the second parameter:</p>
|
||||
<pre class="hljs"><code>mindMap.execCommand(<span class="hljs-string">'INSERT_FORMULA'</span>, <span class="hljs-string">'a^2'</span>, [Node])
|
||||
</code></pre>
|
||||
<p>Pass in the specified node instance through the second parameter.</p>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -11,12 +11,12 @@
|
||||
- [x] Pluggable architecture, in addition to core functions, other functions are provided as plugins, which can be used as needed to reduce packaging volume
|
||||
- [x] Support logical structure chart, mind map, Organizational chart, directory organization chart, timeline (horizontal and vertical), fishbone chart and other structures
|
||||
- [x] Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes
|
||||
- [x] Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, and summaries
|
||||
- [x] Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas
|
||||
- [x] Nodes support drag and drop (drag and move, freely adjust), multiple node shapes, and fully customize node content using DDM
|
||||
- [x] Support canvas dragging and scaling
|
||||
- [x] Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection
|
||||
- [x] Supoorts to export as `json`、`png`、`svg`、`pdf`、`markdown`、`xmind`, support import from `json`、`xmind`、`markdown`
|
||||
- [x] Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, and watermarks
|
||||
- [x] Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, and scrollbar
|
||||
- [x] Provide rich configurations to meet various scenarios and usage habits
|
||||
|
||||
## Repository Catalog Introduction
|
||||
@ -62,6 +62,8 @@ The folder containing the packaged resources for the `web` folder.
|
||||
|
||||
[My first Electron application](https://juejin.cn/post/7233012756314701884)
|
||||
|
||||
[Explore how to export HTML and SVG as images](https://juejin.cn/post/7276712861514170409)
|
||||
|
||||
## Special Note
|
||||
|
||||
This project can be used for learning and reference. Please deeply experience whether it can meet your needs when using it for actual projects.
|
||||
@ -70,7 +72,7 @@ This project may not have fully tested every function point, so there may be bug
|
||||
|
||||
If you have suggestions or find bugs, you can submit [issues](https://github.com/wanglin2/mind-map/issues) here.
|
||||
|
||||
The built-in themes and icons in the project come from:
|
||||
The built-in themes and icons in the project part come from:
|
||||
|
||||
[Baidu Mind Map](https://naotu.baidu.com/)
|
||||
|
||||
|
||||
@ -8,16 +8,16 @@
|
||||
</blockquote>
|
||||
<h2>Features</h2>
|
||||
<ul>
|
||||
<li><input type="checkbox" id="checkbox30" checked="true" /><label for="checkbox30">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="checkbox31" checked="true" /><label for="checkbox31">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="checkbox32" checked="true" /><label for="checkbox32">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
|
||||
<li><input type="checkbox" id="checkbox33" checked="true" /><label for="checkbox33">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, and summaries</label></li>
|
||||
<li><input type="checkbox" id="checkbox34" checked="true" /><label for="checkbox34">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="checkbox35" checked="true" /><label for="checkbox35">Support canvas dragging and scaling</label></li>
|
||||
<li><input type="checkbox" id="checkbox36" checked="true" /><label for="checkbox36">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
|
||||
<li><input type="checkbox" id="checkbox37" checked="true" /><label for="checkbox37">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="checkbox38" checked="true" /><label for="checkbox38">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, and watermarks</label></li>
|
||||
<li><input type="checkbox" id="checkbox39" checked="true" /><label for="checkbox39">Provide rich configurations to meet various scenarios and usage habits</label></li>
|
||||
<li><input type="checkbox" id="checkbox105" checked="true" /><label for="checkbox105">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="checkbox106" checked="true" /><label for="checkbox106">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="checkbox107" checked="true" /><label for="checkbox107">Built-in multiple themes, allowing for highly customizable styles, and supporting registration of new themes</label></li>
|
||||
<li><input type="checkbox" id="checkbox108" checked="true" /><label for="checkbox108">Node content supports text (regular text, rich text), images, icons, hyperlinks, notes, labels, summaries, and math formulas</label></li>
|
||||
<li><input type="checkbox" id="checkbox109" checked="true" /><label for="checkbox109">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="checkbox110" checked="true" /><label for="checkbox110">Support canvas dragging and scaling</label></li>
|
||||
<li><input type="checkbox" id="checkbox111" checked="true" /><label for="checkbox111">Supports two multi node selection methods: mouse button drag selection and Ctrl+left button selection</label></li>
|
||||
<li><input type="checkbox" id="checkbox112" checked="true" /><label for="checkbox112">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="checkbox113" checked="true" /><label for="checkbox113">Support shortcut keys, forward and backward, correlation lines, search and replacement, small maps, watermarks, and scrollbar</label></li>
|
||||
<li><input type="checkbox" id="checkbox114" checked="true" /><label for="checkbox114">Provide rich configurations to meet various scenarios and usage habits</label></li>
|
||||
</ul>
|
||||
<h2>Repository Catalog Introduction</h2>
|
||||
<p>1.<code>simple-mind-map</code></p>
|
||||
@ -27,16 +27,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="checkbox40" checked="true" /><label for="checkbox40">Toolbar, which supports inserting and deleting nodes, and editing node</label>
|
||||
<li><input type="checkbox" id="checkbox115" checked="true" /><label for="checkbox115">Toolbar, which supports inserting and deleting nodes, and editing node</label>
|
||||
images, icons, hyperlinks, notes, tags, and summaries</li>
|
||||
<li><input type="checkbox" id="checkbox41" checked="true" /><label for="checkbox41">Sidebar, with panels for basic style settings, node style settings,</label>
|
||||
<li><input type="checkbox" id="checkbox116" checked="true" /><label for="checkbox116">Sidebar, with panels for basic style settings, node style settings,</label>
|
||||
outline, theme selection, and structure selection</li>
|
||||
<li><input type="checkbox" id="checkbox42" checked="true" /><label for="checkbox42">Import and export functionality; data is saved in the browser's local</label>
|
||||
<li><input type="checkbox" id="checkbox117" checked="true" /><label for="checkbox117">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="checkbox43" checked="true" /><label for="checkbox43">Right-click menu, which supports operations such as expanding, collapsing,</label>
|
||||
<li><input type="checkbox" id="checkbox118" checked="true" /><label for="checkbox118">Right-click menu, which supports operations such as expanding, collapsing,</label>
|
||||
and organizing layout</li>
|
||||
<li><input type="checkbox" id="checkbox44" checked="true" /><label for="checkbox44">Bottom bar, which supports node and word count statistics, switching</label>
|
||||
<li><input type="checkbox" id="checkbox119" checked="true" /><label for="checkbox119">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>
|
||||
@ -49,11 +49,12 @@ full screen, support mini map</li>
|
||||
<p><a href="https://juejin.cn/post/7199666255883927612">When you press the direction key, how does the TV find the next focus</a></p>
|
||||
<p><a href="https://juejin.cn/post/7204854015463538744">How to simulate the background image style of css in canvas</a></p>
|
||||
<p><a href="https://juejin.cn/post/7233012756314701884">My first Electron application</a></p>
|
||||
<p><a href="https://juejin.cn/post/7276712861514170409">Explore how to export HTML and SVG as images</a></p>
|
||||
<h2>Special Note</h2>
|
||||
<p>This project can be used for learning and reference. Please deeply experience whether it can meet your needs when using it for actual projects.</p>
|
||||
<p>This project may not have fully tested every function point, so there may be bugs. In addition, when the number of nodes is very large, there may be some performance issues. Because everyone can accept different levels of congestion, you can test the maximum number of nodes yourself.</p>
|
||||
<p>If you have suggestions or find bugs, you can submit <a href="https://github.com/wanglin2/mind-map/issues">issues</a> here.</p>
|
||||
<p>The built-in themes and icons in the project come from:</p>
|
||||
<p>The built-in themes and icons in the project part come from:</p>
|
||||
<p><a href="https://naotu.baidu.com/">Baidu Mind Map</a></p>
|
||||
<p><a href="https://www.zhixi.com/">Zhixi Mind Map</a></p>
|
||||
<p>Respect the copyright, and do not use the theme and icons directly for commercial projects.</p>
|
||||
|
||||
@ -56,6 +56,26 @@ Whether the node is currently being dragged
|
||||
|
||||
## Methods
|
||||
|
||||
### setOpacity(val)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `val`: Opacity value,0-1
|
||||
|
||||
Set node transparency, including connecting lines and child nodes.
|
||||
|
||||
### hideChildren()
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
Hide subordinate nodes.
|
||||
|
||||
### showChildren()
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
Display subordinate nodes.
|
||||
|
||||
### hasCustomStyle()
|
||||
|
||||
> v0.6.2+
|
||||
|
||||
@ -31,6 +31,24 @@
|
||||
</blockquote>
|
||||
<p>Whether the node is currently being dragged</p>
|
||||
<h2>Methods</h2>
|
||||
<h3>setOpacity(val)</h3>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>val</code>: Opacity value,0-1</li>
|
||||
</ul>
|
||||
<p>Set node transparency, including connecting lines and child nodes.</p>
|
||||
<h3>hideChildren()</h3>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<p>Hide subordinate nodes.</p>
|
||||
<h3>showChildren()</h3>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<p>Display subordinate nodes.</p>
|
||||
<h3>hasCustomStyle()</h3>
|
||||
<blockquote>
|
||||
<p>v0.6.2+</p>
|
||||
|
||||
@ -250,6 +250,107 @@ Convert the wrapped text of `<br>` into node rich text content in the form of `<
|
||||
|
||||
Determine if it is a mobile environment.
|
||||
|
||||
#### getTopAncestorsFomNodeList(list)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `list`: Arrray, Node instance list.
|
||||
|
||||
Find the top-level node list from the node instance list.
|
||||
|
||||
#### checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
The parameter is the position of two rectangles.
|
||||
|
||||
Determine if two rectangles overlap.
|
||||
|
||||
#### focusInput(el)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `el`: DOM nodes, elements that can be focused, typically input box elements.
|
||||
|
||||
Focus on the specified input box.
|
||||
|
||||
#### selectAllInput(el)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `el`: DOM nodes, elements that can be focused, typically input box elements.
|
||||
|
||||
Focus and select all specified input boxes.
|
||||
|
||||
#### addDataToAppointNodes(appointNodes, data = {})
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `appointNodes`:Node instance list, array type.
|
||||
|
||||
- `data`:The data to be attached to all nodes in the specified node instance list tree.
|
||||
|
||||
Adding additional data to the specified node list tree data will modify the original data.
|
||||
|
||||
#### createUidForAppointNodes(appointNodes)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `appointNodes`:Node instance list, array type.
|
||||
|
||||
Adding a uid to the specified node list tree data (if the uid does not exist) will modify the original data.
|
||||
|
||||
#### getNodeIndex(node)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `node`:Node instance.
|
||||
|
||||
Gets the position index of a node within its peers.
|
||||
|
||||
#### mergerIconList(list)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `list`:The array of node icons to be merged into the library.
|
||||
|
||||
```js
|
||||
// const data = [
|
||||
// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },
|
||||
// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },
|
||||
// ];
|
||||
|
||||
// mergerIconList(data) result:
|
||||
|
||||
// [
|
||||
// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },
|
||||
// ]
|
||||
```
|
||||
|
||||
Merge icon arrays.
|
||||
|
||||
#### htmlEscape(str)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `str`:String.
|
||||
|
||||
Escape the incoming string, currently escaping the following three characters:
|
||||
|
||||
```
|
||||
& -> &
|
||||
< -> <
|
||||
> -> >
|
||||
```
|
||||
|
||||
#### generateColorByContent(str)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `str`:String.
|
||||
|
||||
Generate colors based on incoming content, and the same content will generate the same color.
|
||||
|
||||
## Simulate CSS background in Canvas
|
||||
|
||||
Import:
|
||||
|
||||
@ -179,6 +179,104 @@ and copying the <code>data</code> of the data object, example:</p>
|
||||
<p>v0.6.13+</p>
|
||||
</blockquote>
|
||||
<p>Determine if it is a mobile environment.</p>
|
||||
<h4>getTopAncestorsFomNodeList(list)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>list</code>: Arrray, Node instance list.</li>
|
||||
</ul>
|
||||
<p>Find the top-level node list from the node instance list.</p>
|
||||
<h4>checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<p>The parameter is the position of two rectangles.</p>
|
||||
<p>Determine if two rectangles overlap.</p>
|
||||
<h4>focusInput(el)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>el</code>: DOM nodes, elements that can be focused, typically input box elements.</li>
|
||||
</ul>
|
||||
<p>Focus on the specified input box.</p>
|
||||
<h4>selectAllInput(el)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>el</code>: DOM nodes, elements that can be focused, typically input box elements.</li>
|
||||
</ul>
|
||||
<p>Focus and select all specified input boxes.</p>
|
||||
<h4>addDataToAppointNodes(appointNodes, data = {})</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>appointNodes</code>:Node instance list, array type.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>data</code>:The data to be attached to all nodes in the specified node instance list tree.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Adding additional data to the specified node list tree data will modify the original data.</p>
|
||||
<h4>createUidForAppointNodes(appointNodes)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>appointNodes</code>:Node instance list, array type.</li>
|
||||
</ul>
|
||||
<p>Adding a uid to the specified node list tree data (if the uid does not exist) will modify the original data.</p>
|
||||
<h4>getNodeIndex(node)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>node</code>:Node instance.</li>
|
||||
</ul>
|
||||
<p>Gets the position index of a node within its peers.</p>
|
||||
<h4>mergerIconList(list)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>list</code>:The array of node icons to be merged into the library.</li>
|
||||
</ul>
|
||||
<pre class="hljs"><code><span class="hljs-comment">// const data = [</span>
|
||||
<span class="hljs-comment">// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },</span>
|
||||
<span class="hljs-comment">// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },</span>
|
||||
<span class="hljs-comment">// ];</span>
|
||||
|
||||
<span class="hljs-comment">// mergerIconList(data) result:</span>
|
||||
|
||||
<span class="hljs-comment">// [</span>
|
||||
<span class="hljs-comment">// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },</span>
|
||||
<span class="hljs-comment">// ]</span>
|
||||
</code></pre>
|
||||
<p>Merge icon arrays.</p>
|
||||
<h4>htmlEscape(str)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>str</code>:String.</li>
|
||||
</ul>
|
||||
<p>Escape the incoming string, currently escaping the following three characters:</p>
|
||||
<pre class="hljs"><code>& -> &amp;
|
||||
< -> &lt;
|
||||
> -> &gt;
|
||||
</code></pre>
|
||||
<h4>generateColorByContent(str)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>str</code>:String.</li>
|
||||
</ul>
|
||||
<p>Generate colors based on incoming content, and the same content will generate the same color.</p>
|
||||
<h2>Simulate CSS background in Canvas</h2>
|
||||
<p>Import:</p>
|
||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> drawBackgroundImageToCanvas <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'</span>
|
||||
|
||||
@ -56,6 +56,7 @@ export default [
|
||||
{ path: 'painter', title: 'Painter插件' },
|
||||
{ path: 'painter', title: 'Painter插件' },
|
||||
{ path: 'scrollbar', title: 'Scrollbar插件' },
|
||||
{ path: 'formula', title: 'Formula插件' },
|
||||
{ path: 'help1', title: '概要/关联线' },
|
||||
{ path: 'help2', title: '客户端' },
|
||||
{ path: 'help3', title: '打开预览在线文件' },
|
||||
@ -93,7 +94,8 @@ export default [
|
||||
{ path: 'nodeImgAdjust', title: 'NodeImgAdjust plugin' },
|
||||
{ path: 'search', title: 'Search plugin' },
|
||||
{ path: 'painter', title: 'Painter plugin' },
|
||||
{ path: 'scrollbar', title: 'Scrollbar plugin' }
|
||||
{ path: 'scrollbar', title: 'Scrollbar plugin' },
|
||||
{ path: 'formula', title: 'Formula plugin' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,5 +1,43 @@
|
||||
# Changelog
|
||||
|
||||
## 0.7.2
|
||||
|
||||
修复:
|
||||
|
||||
> 1.修复多选节点时选区未包含节点边界时节点不会被选中的问题。
|
||||
>
|
||||
> 2.修复节点文本不为字符串时报错的问题。
|
||||
>
|
||||
> 3.修复非富文本模式下文本中存在<>&字符时再次编辑时部分文本会消失的问题。
|
||||
|
||||
新增:
|
||||
|
||||
> 1.支持插入数学公式。
|
||||
>
|
||||
> 2.支持同时拖拽移动多个节点。
|
||||
>
|
||||
> 3.支持同时复制、剪切多个节点。
|
||||
>
|
||||
> 4.节点标签颜色改为根据标签内容生成,即同样的标签内容会生成相同的颜色。
|
||||
>
|
||||
> 5.优化子节点的插入:1.同时对多个节点插入子节点时,不进入编辑状态;2.新插入的子节点自动进入激活状态。
|
||||
>
|
||||
> 6.优化兄弟节点的插入:1.支持同时对多个节点插入兄弟节点;2.对根节点调用插入兄弟节点的命令时不再创建子节点。
|
||||
>
|
||||
> 7.新增同时插入多个同级节点、多个子节点的命令。
|
||||
>
|
||||
> 8.将节点唯一标识由id全部改为uid,主要影响关联线,之前版本的关联线可能无法正常显示。
|
||||
>
|
||||
> 9.优化图标合并逻辑,支持扩展库内部分类下的图标。
|
||||
>
|
||||
> 10.关联线:1.双击关联线进入关联线文本编辑模式;2.关联线文本为默认文本的话不保存;3.存在激活节点时点击关联线可直接激活关联线。
|
||||
|
||||
Demo:
|
||||
|
||||
> 1.修复复制知犀思维导图多个节点时无法粘贴的问题。
|
||||
>
|
||||
> 2.新增公式编辑的侧边栏。
|
||||
|
||||
## 0.7.1-fix.2
|
||||
|
||||
修复:1.修复插件注册方法链式调用报错的问题。
|
||||
|
||||
@ -1,6 +1,31 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Changelog</h1>
|
||||
<h2>0.7.2</h2>
|
||||
<p>修复:</p>
|
||||
<blockquote>
|
||||
<p>1.修复多选节点时选区未包含节点边界时节点不会被选中的问题。</p>
|
||||
<p>2.修复节点文本不为字符串时报错的问题。</p>
|
||||
<p>3.修复非富文本模式下文本中存在<>&字符时再次编辑时部分文本会消失的问题。</p>
|
||||
</blockquote>
|
||||
<p>新增:</p>
|
||||
<blockquote>
|
||||
<p>1.支持插入数学公式。</p>
|
||||
<p>2.支持同时拖拽移动多个节点。</p>
|
||||
<p>3.支持同时复制、剪切多个节点。</p>
|
||||
<p>4.节点标签颜色改为根据标签内容生成,即同样的标签内容会生成相同的颜色。</p>
|
||||
<p>5.优化子节点的插入:1.同时对多个节点插入子节点时,不进入编辑状态;2.新插入的子节点自动进入激活状态。</p>
|
||||
<p>6.优化兄弟节点的插入:1.支持同时对多个节点插入兄弟节点;2.对根节点调用插入兄弟节点的命令时不再创建子节点。</p>
|
||||
<p>7.新增同时插入多个同级节点、多个子节点的命令。</p>
|
||||
<p>8.将节点唯一标识由id全部改为uid,主要影响关联线,之前版本的关联线可能无法正常显示。</p>
|
||||
<p>9.优化图标合并逻辑,支持扩展库内部分类下的图标。</p>
|
||||
<p>10.关联线:1.双击关联线进入关联线文本编辑模式;2.关联线文本为默认文本的话不保存;3.存在激活节点时点击关联线可直接激活关联线。</p>
|
||||
</blockquote>
|
||||
<p>Demo:</p>
|
||||
<blockquote>
|
||||
<p>1.修复复制知犀思维导图多个节点时无法粘贴的问题。</p>
|
||||
<p>2.新增公式编辑的侧边栏。</p>
|
||||
</blockquote>
|
||||
<h2>0.7.1-fix.2</h2>
|
||||
<p>修复:1.修复插件注册方法链式调用报错的问题。</p>
|
||||
<p>新增:</p>
|
||||
|
||||
@ -22,74 +22,78 @@ const mindMap = new MindMap({
|
||||
|
||||
## 实例化选项
|
||||
|
||||
| 字段名称 | 类型 | 默认值 | 描述 | 是否必填 |
|
||||
| -------------------------------- | ------- | ---------------- | ------------------------------------------------------------ | -------- |
|
||||
| el | Element | | 容器元素,必须为DOM元素 | 是 |
|
||||
| data | Object | {} | 思维导图数据,可参考下方【数据结构】介绍 | |
|
||||
| layout | String | logicalStructure | 布局类型,可选列表:logicalStructure(逻辑结构图)、mindMap(思维导图)、catalogOrganization(目录组织图)、organizationStructure(组织结构图)、timeline(v0.5.4+,时间轴)、timeline2(v0.5.4+,上下交替型时间轴)、fishbone(v0.5.4+,鱼骨图) | |
|
||||
| fishboneDeg(v0.5.4+) | Number | 45 | 设置鱼骨结构图的斜线角度 | |
|
||||
| theme | String | default | 主题,可选列表:default(默认)、classic(脑图经典)、minions(小黄人)、pinkGrape(粉红葡萄)、mint(薄荷)、gold(金色vip)、vitalityOrange(活力橙)、greenLeaf(绿叶)、dark2(暗色2)、skyGreen(天清绿)、classic2(脑图经典2)、classic3(脑图经典3)、classic4(脑图经典4,v0.2.0+)、classicGreen(经典绿)、classicBlue(经典蓝)、blueSky(天空蓝)、brainImpairedPink(脑残粉)、dark(暗色)、earthYellow(泥土黄)、freshGreen(清新绿)、freshRed(清新红)、romanticPurple(浪漫紫)、simpleBlack(v0.5.4+简约黑)、courseGreen(v0.5.4+课程绿)、coffee(v0.5.4+咖啡)、redSpirit(v0.5.4+红色精神)、blackHumour(v0.5.4+黑色幽默)、lateNightOffice(v0.5.4+深夜办公室)、blackGold(v0.5.4+黑金)、avocado(v.5.10-fix.2+牛油果)、autumn(v.5.10-fix.2+秋天)、orangeJuice(v.5.10-fix.2+橙汁) | |
|
||||
| themeConfig | Object | {} | 主题配置,会和所选择的主题进行合并,可用字段可参考:[default.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js) | |
|
||||
| scaleRatio | Number | 0.1 | 放大缩小的增量比例 | |
|
||||
| maxTag | Number | 5 | 节点里最多显示的标签数量,多余的会被丢弃 | |
|
||||
| exportPadding | Number | 20 | 导出图片时的内边距 | |
|
||||
| imgTextMargin | Number | 5 | 节点里图片和文字的间距 | |
|
||||
| textContentMargin | Number | 2 | 节点里各种文字信息的间距,如图标和文字的间距 | |
|
||||
| selectTranslateStep | Number | 3 | 多选节点时鼠标移动到边缘时的画布移动偏移量 | |
|
||||
| selectTranslateLimit | Number | 20 | 多选节点时鼠标移动距边缘多少距离时开始偏移 | |
|
||||
| customNoteContentShow(v0.1.6+) | Object | null | 自定义节点备注内容显示,Object类型,结构为:{show: (noteContent, left, top) => {// 你的显示节点备注逻辑 }, hide: () => {// 你的隐藏节点备注逻辑 }} | |
|
||||
| readonly(v0.1.7+) | Boolean | false | 是否是只读模式 | |
|
||||
| enableFreeDrag(v0.2.4+) | Boolean | false | 是否开启节点自由拖拽 | |
|
||||
| watermarkConfig(v0.2.4+) | Object | | 水印配置,详细配置请参考下方表格【水印配置】 | |
|
||||
| textAutoWrapWidth(v0.3.4+) | Number | 500 | 节点内每行文本达到该宽度后自动换行 | |
|
||||
| customHandleMousewheel(v0.4.3+) | Function | null | 自定义鼠标滚轮事件处理,可以传一个函数,回调参数为事件对象 | |
|
||||
| mousewheelAction(v0.4.3+) | String | zoom | 鼠标滚轮的行为,`zoom`(放大缩小)、`move`(上下移动)。如果`customHandleMousewheel`传了自定义函数,这个属性不生效 | |
|
||||
| mousewheelMoveStep(v0.4.3+) | Number | 100 | 当`mousewheelAction`设为`move`时,可以通过该属性控制鼠标滚动一下视图移动的步长,单位`px` | |
|
||||
| mousewheelZoomActionReverse(v0.6.5+) | Boolean | false | 当mousewheelAction设为zoom时,默认向前滚动是缩小,向后滚动是放大,如果该属性设为true,那么会反过来 | |
|
||||
| defaultInsertSecondLevelNodeText(v0.4.7+) | String | 二级节点 | 默认插入的二级节点的文字 | |
|
||||
| defaultInsertBelowSecondLevelNodeText(v0.4.7+) | String | 分支主题 | 默认插入的二级以下节点的文字 | |
|
||||
| expandBtnStyle(v0.5.0+) | Object | { color: '#808080', fill: '#fff', fontSize: 13, strokeColor: '#333333' } | 展开收起按钮的颜色,(fontSize及strokeColor字段为0.7.0+版本新增的,用于设置收起时显示节点数量的文字样式) | |
|
||||
| expandBtnIcon(v0.5.0+) | Object | { open: '', close: '' } | 自定义展开收起按钮的图标,可以传图标的svg字符串 | |
|
||||
| expandBtnNumHandler(v0.7.0+) | Function | | 用于自定义收起时显示节点数量的内容,接收一个参数,代表收起的节点实例,需要返回一个数字或字符串,代表最终显示的内容,比如你可以当数量大于99时,显示99+ | |
|
||||
| isShowExpandNum(v0.7.0+) | Boolean | true | 节点收起时是否显示收起的数量 | |
|
||||
| enableShortcutOnlyWhenMouseInSvg(v0.5.1+) | Boolean | true | 是否只有当鼠标在画布内才响应快捷键事件 | |
|
||||
| enableNodeTransitionMove(v0.5.1+)(v0.6.7+已去除该特性) | Boolean | true | 是否开启节点动画过渡 | |
|
||||
| nodeTransitionMoveDuration(v0.5.1+)(v0.6.7+已去除该特性) | Number | 300 | 如果开启节点动画过渡,可以通过该属性设置过渡的时间,单位ms | |
|
||||
| initRootNodePosition(v0.5.3+) | Array | null | 初始根节点的位置,可传一个数组,默认为`['center', 'center']`,代表根节点处于画布中心位置,除了`center`,关键词还可以设置`left`、`top`、`right`、`bottom`,除了可以传关键词,数组的每项还可以传递一个数字,代表具体的像素,可以传递一个百分比字符串,比如`['40%', '60%']`,代表水平位置在画布宽度的`40%`的位置,垂直位置在画布高度的`60%`的位置 | |
|
||||
| exportPaddingX(v0.5.5+) | Number | 10 | 导出png、svg、pdf时的图形水平内边距 | |
|
||||
| exportPaddingY(v0.5.5+) | Number | 10 | 导出png、svg、pdf时的图形垂直内边距 | |
|
||||
| nodeTextEditZIndex(v0.5.5+) | Number | 3000 | 节点文本编辑框元素的z-index | |
|
||||
| nodeNoteTooltipZIndex(v0.5.5+) | Number | 3000 | 节点备注浮层元素的z-index | |
|
||||
| isEndNodeTextEditOnClickOuter(v0.5.5+) | Boolean | true | 是否在点击了画布外的区域时结束节点文本的编辑状态 | |
|
||||
| maxHistoryCount(v0.5.6+) | Number | 1000 | 最大历史记录数 | |
|
||||
| alwaysShowExpandBtn(v0.5.8+) | Boolean | false | 是否一直显示节点的展开收起按钮,默认为鼠标移上去和激活时才显示 | |
|
||||
| iconList(v0.5.8+) | Array | [] | 扩展节点可插入的图标,数组的每一项为一个对象,对象详细结构请参考下方【图标配置】表格 | |
|
||||
| maxNodeCacheCount(v0.5.10+) | Number | 1000 | 节点最大缓存数量。为了优化性能,内部会维护一个节点缓存池,用来复用节点,通过该属性可以指定池的最大缓存数量 | |
|
||||
| defaultAssociativeLineText(v0.5.11+) | String | 关联 | 关联线默认文字 | |
|
||||
| fitPadding(v0.6.0+) | Number | 50 | 思维导图适应画布大小时的内边距,单位:px | |
|
||||
| enableCtrlKeyNodeSelection(v0.6.0+) | Boolean | true | 是否开启按住ctrl键多选节点的功能 | |
|
||||
| useLeftKeySelectionRightKeyDrag(v0.6.0+) | Boolean | false | 设置为左键多选节点,右键拖动画布 | |
|
||||
| beforeTextEdit(v0.6.0+) | Function/null | null | 节点即将进入编辑前的回调方法,如果该方法返回true以外的值,那么将取消编辑,函数可以返回一个值,或一个Promise,回调参数为节点实例 | |
|
||||
| isUseCustomNodeContent(v0.6.3+) | Boolean | false | 是否自定义节点内容 | |
|
||||
| customCreateNodeContent(v0.6.3+) | Function/null | null | 如果`isUseCustomNodeContent`设为`true`,那么需要使用该选项传入一个方法,接收节点实例`node`为参数(如果要获取该节点的数据,可以通过`node.nodeData.data`),需要返回自定义节点内容元素,也就是DOM节点,如果某个节点不需要自定义,那么返回`null`即可 | |
|
||||
| mouseScaleCenterUseMousePosition(v0.6.4-fix.1+) | Boolean | true | 鼠标缩放是否以鼠标当前位置为中心点,否则以画布中心点 | |
|
||||
| customInnerElsAppendTo(v0.6.12+) | null/HTMLElement | null | 指定内部一些元素(节点文本编辑元素、节点备注显示元素、关联线文本编辑元素、节点图片调整按钮元素)添加到的位置,默认添加到document.body下 | |
|
||||
| nodeDragPlaceholderMaxSize(v0.6.12+) | Number | 20 | 拖拽元素时,指示元素新位置的块的最大高度 | |
|
||||
| enableCreateHiddenInput(v0.6.13+)(v0.6.14+版本已去除该特性) | Boolean | true | 是否允许创建一个隐藏的输入框,该输入框会在节点激活时聚焦,用于粘贴数据和自动进入文本编辑状态 | |
|
||||
| enableAutoEnterTextEditWhenKeydown(v0.6.13+) | Boolean | true | 是否在存在一个激活节点时,当按下中文、英文、数字按键时自动进入文本编辑模式 | |
|
||||
| richTextEditFakeInPlace(v0.6.13+) | Boolean | false | 设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果,需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果 | |
|
||||
| customHandleClipboardText(v0.6.14+) | Function | null | 自定义对剪贴板文本的处理。当按ctrl+v粘贴时会读取用户剪贴板中的文本和图片,默认只会判断文本是否是普通文本和simple-mind-map格式的节点数据,如果你想处理其他思维导图的数据,比如processon、zhixi等,那么可以传递一个函数,接受当前剪贴板中的文本为参数,返回处理后的数据,可以返回两种类型:1.返回一个纯文本,那么会直接以该文本创建一个子节点;2.返回一个节点对象,格式如下:{ simpleMindMap: true, data: { data: { text: '' }, children: [] } },代表是simple-mind-map格式的数据,节点数据同simple-mind-map节点数据格式,如果你的处理逻辑存在异步逻辑,也可以返回一个promise | |
|
||||
| errorHandler(v0.6.15+) | Function | | 自定义错误处理函数,目前只会抛出一些异步逻辑出错的情况。可以传递一个函数,会接收两个参数,第一个为错误的类型,第二个为错误对象 | |
|
||||
| disableMouseWheelZoom(v0.6.15+) | Boolean | false | 禁止鼠标滚轮缩放,你仍旧可以使用api进行缩放 | |
|
||||
| resetCss(v0.6.16+) | String | * { margin: 0; padding: 0; box-sizing: border-box; } | 设置导出图片和svg时,针对富文本节点内容,也就是嵌入到svg中的html节点的默认样式覆盖,如果不覆盖,节点内容会发生偏移 | |
|
||||
| enableDblclickReset(v0.6.17+) | Boolean | true(v0.7.0+改为false) | 开启鼠标双击复位思维导图位置及缩放 | |
|
||||
| minExportImgCanvasScale(v0.7.0+) | Number | 2 | 导出图片和pdf时canvas的缩放倍数,该配置会和window.devicePixelRatio值取最大值,用于提升图片清晰度 | |
|
||||
| hoverRectColor(v0.7.0+) | String | rgb(94, 200, 248) | 节点鼠标hover和激活时显示的矩形边框颜色,hover时会添加0.6的透明度 | |
|
||||
| hoverRectPadding(v0.7.0+) | Number | 2 | 节点鼠标hover和激活时显示的矩形边框距节点内容的距离 | |
|
||||
| selectTextOnEnterEditText(v0.7.0+) | Boolean | true | 双击节点进入节点文本编辑时是否默认选中文本,默认只在创建新节点时会选中 | |
|
||||
| deleteNodeActive(v0.7.1+) | Boolean | true | 是否开启删除节点后自动激活节点相邻节点或父节点的功能 | |
|
||||
| autoMoveWhenMouseInEdgeOnDrag(v0.7.1+) | Boolean | true | 拖拽节点时鼠标移动到画布边缘是否开启画布自动移动 | |
|
||||
| fit(v0.7.1-fix.2+) | Boolean | false | 首次渲染时是否缩放至适应画布大小 | |
|
||||
| 字段名称 | 类型 | 默认值 | 描述 |
|
||||
| -------------------------------- | ------- | ---------------- | ------------------------------------------------------------ |
|
||||
| el | Element | | 容器元素,必传,必须为DOM元素 |
|
||||
| data | Object | {} | 思维导图数据,可参考下方【数据结构】介绍 |
|
||||
| layout | String | logicalStructure | 布局类型,可选列表:logicalStructure(逻辑结构图)、mindMap(思维导图)、catalogOrganization(目录组织图)、organizationStructure(组织结构图)、timeline(v0.5.4+,时间轴)、timeline2(v0.5.4+,上下交替型时间轴)、fishbone(v0.5.4+,鱼骨图) |
|
||||
| fishboneDeg(v0.5.4+) | Number | 45 | 设置鱼骨结构图的斜线角度 |
|
||||
| theme | String | default | 主题,可选列表:default(默认)、classic(脑图经典)、minions(小黄人)、pinkGrape(粉红葡萄)、mint(薄荷)、gold(金色vip)、vitalityOrange(活力橙)、greenLeaf(绿叶)、dark2(暗色2)、skyGreen(天清绿)、classic2(脑图经典2)、classic3(脑图经典3)、classic4(脑图经典4,v0.2.0+)、classicGreen(经典绿)、classicBlue(经典蓝)、blueSky(天空蓝)、brainImpairedPink(脑残粉)、dark(暗色)、earthYellow(泥土黄)、freshGreen(清新绿)、freshRed(清新红)、romanticPurple(浪漫紫)、simpleBlack(v0.5.4+简约黑)、courseGreen(v0.5.4+课程绿)、coffee(v0.5.4+咖啡)、redSpirit(v0.5.4+红色精神)、blackHumour(v0.5.4+黑色幽默)、lateNightOffice(v0.5.4+深夜办公室)、blackGold(v0.5.4+黑金)、avocado(v.5.10-fix.2+牛油果)、autumn(v.5.10-fix.2+秋天)、orangeJuice(v.5.10-fix.2+橙汁) |
|
||||
| themeConfig | Object | {} | 主题配置,会和所选择的主题进行合并,可用字段可参考:[default.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js) |
|
||||
| scaleRatio | Number | 0.1 | 放大缩小的增量比例 |
|
||||
| maxTag | Number | 5 | 节点里最多显示的标签数量,多余的会被丢弃 |
|
||||
| exportPadding | Number | 20 | 导出图片时的内边距 |
|
||||
| imgTextMargin | Number | 5 | 节点里图片和文字的间距 |
|
||||
| textContentMargin | Number | 2 | 节点里各种文字信息的间距,如图标和文字的间距 |
|
||||
| selectTranslateStep | Number | 3 | 多选节点时鼠标移动到边缘时的画布移动偏移量 |
|
||||
| selectTranslateLimit | Number | 20 | 多选节点时鼠标移动距边缘多少距离时开始偏移 |
|
||||
| customNoteContentShow(v0.1.6+) | Object | null | 自定义节点备注内容显示,Object类型,结构为:{show: (noteContent, left, top) => {// 你的显示节点备注逻辑 }, hide: () => {// 你的隐藏节点备注逻辑 }} |
|
||||
| readonly(v0.1.7+) | Boolean | false | 是否是只读模式 |
|
||||
| enableFreeDrag(v0.2.4+) | Boolean | false | 是否开启节点自由拖拽 |
|
||||
| watermarkConfig(v0.2.4+) | Object | | 水印配置,详细配置请参考下方表格【水印配置】 |
|
||||
| textAutoWrapWidth(v0.3.4+) | Number | 500 | 节点内每行文本达到该宽度后自动换行 |
|
||||
| customHandleMousewheel(v0.4.3+) | Function | null | 自定义鼠标滚轮事件处理,可以传一个函数,回调参数为事件对象 |
|
||||
| mousewheelAction(v0.4.3+) | String | zoom | 鼠标滚轮的行为,`zoom`(放大缩小)、`move`(上下移动)。如果`customHandleMousewheel`传了自定义函数,这个属性不生效 |
|
||||
| mousewheelMoveStep(v0.4.3+) | Number | 100 | 当`mousewheelAction`设为`move`时,可以通过该属性控制鼠标滚动一下视图移动的步长,单位`px` |
|
||||
| mousewheelZoomActionReverse(v0.6.5+) | Boolean | false | 当mousewheelAction设为zoom时,默认向前滚动是缩小,向后滚动是放大,如果该属性设为true,那么会反过来 |
|
||||
| defaultInsertSecondLevelNodeText(v0.4.7+) | String | 二级节点 | 默认插入的二级节点的文字 |
|
||||
| defaultInsertBelowSecondLevelNodeText(v0.4.7+) | String | 分支主题 | 默认插入的二级以下节点的文字 |
|
||||
| expandBtnStyle(v0.5.0+) | Object | { color: '#808080', fill: '#fff', fontSize: 13, strokeColor: '#333333' } | 展开收起按钮的颜色,(fontSize及strokeColor字段为0.7.0+版本新增的,用于设置收起时显示节点数量的文字样式) |
|
||||
| expandBtnIcon(v0.5.0+) | Object | { open: '', close: '' } | 自定义展开收起按钮的图标,可以传图标的svg字符串 |
|
||||
| expandBtnNumHandler(v0.7.0+) | Function | | 用于自定义收起时显示节点数量的内容,接收一个参数,代表收起的节点实例,需要返回一个数字或字符串,代表最终显示的内容,比如你可以当数量大于99时,显示99+ |
|
||||
| isShowExpandNum(v0.7.0+) | Boolean | true | 节点收起时是否显示收起的数量 |
|
||||
| enableShortcutOnlyWhenMouseInSvg(v0.5.1+) | Boolean | true | 是否只有当鼠标在画布内才响应快捷键事件 |
|
||||
| enableNodeTransitionMove(v0.5.1+)(v0.6.7+已去除该特性) | Boolean | true | 是否开启节点动画过渡 |
|
||||
| nodeTransitionMoveDuration(v0.5.1+)(v0.6.7+已去除该特性) | Number | 300 | 如果开启节点动画过渡,可以通过该属性设置过渡的时间,单位ms |
|
||||
| initRootNodePosition(v0.5.3+) | Array | null | 初始根节点的位置,可传一个数组,默认为`['center', 'center']`,代表根节点处于画布中心位置,除了`center`,关键词还可以设置`left`、`top`、`right`、`bottom`,除了可以传关键词,数组的每项还可以传递一个数字,代表具体的像素,可以传递一个百分比字符串,比如`['40%', '60%']`,代表水平位置在画布宽度的`40%`的位置,垂直位置在画布高度的`60%`的位置 |
|
||||
| exportPaddingX(v0.5.5+) | Number | 10 | 导出png、svg、pdf时的图形水平内边距 |
|
||||
| exportPaddingY(v0.5.5+) | Number | 10 | 导出png、svg、pdf时的图形垂直内边距 |
|
||||
| nodeTextEditZIndex(v0.5.5+) | Number | 3000 | 节点文本编辑框元素的z-index |
|
||||
| nodeNoteTooltipZIndex(v0.5.5+) | Number | 3000 | 节点备注浮层元素的z-index |
|
||||
| isEndNodeTextEditOnClickOuter(v0.5.5+) | Boolean | true | 是否在点击了画布外的区域时结束节点文本的编辑状态 |
|
||||
| maxHistoryCount(v0.5.6+) | Number | 1000 | 最大历史记录数 |
|
||||
| alwaysShowExpandBtn(v0.5.8+) | Boolean | false | 是否一直显示节点的展开收起按钮,默认为鼠标移上去和激活时才显示 |
|
||||
| iconList(v0.5.8+) | Array | [] | 扩展节点可插入的图标,数组的每一项为一个对象,对象详细结构请参考下方【图标配置】表格 |
|
||||
| maxNodeCacheCount(v0.5.10+) | Number | 1000 | 节点最大缓存数量。为了优化性能,内部会维护一个节点缓存池,用来复用节点,通过该属性可以指定池的最大缓存数量 |
|
||||
| defaultAssociativeLineText(v0.5.11+) | String | 关联 | 关联线默认文字 |
|
||||
| fitPadding(v0.6.0+) | Number | 50 | 思维导图适应画布大小时的内边距,单位:px |
|
||||
| enableCtrlKeyNodeSelection(v0.6.0+) | Boolean | true | 是否开启按住ctrl键多选节点的功能 |
|
||||
| useLeftKeySelectionRightKeyDrag(v0.6.0+) | Boolean | false | 设置为左键多选节点,右键拖动画布 |
|
||||
| beforeTextEdit(v0.6.0+) | Function/null | null | 节点即将进入编辑前的回调方法,如果该方法返回true以外的值,那么将取消编辑,函数可以返回一个值,或一个Promise,回调参数为节点实例 |
|
||||
| isUseCustomNodeContent(v0.6.3+) | Boolean | false | 是否自定义节点内容 |
|
||||
| customCreateNodeContent(v0.6.3+) | Function/null | null | 如果`isUseCustomNodeContent`设为`true`,那么需要使用该选项传入一个方法,接收节点实例`node`为参数(如果要获取该节点的数据,可以通过`node.nodeData.data`),需要返回自定义节点内容元素,也就是DOM节点,如果某个节点不需要自定义,那么返回`null`即可 |
|
||||
| mouseScaleCenterUseMousePosition(v0.6.4-fix.1+) | Boolean | true | 鼠标缩放是否以鼠标当前位置为中心点,否则以画布中心点 |
|
||||
| customInnerElsAppendTo(v0.6.12+) | null/HTMLElement | null | 指定内部一些元素(节点文本编辑元素、节点备注显示元素、关联线文本编辑元素、节点图片调整按钮元素)添加到的位置,默认添加到document.body下 |
|
||||
| nodeDragPlaceholderMaxSize(v0.6.12+) | Number | 20 | 拖拽元素时,指示元素新位置的块的最大高度 |
|
||||
| enableCreateHiddenInput(v0.6.13+)(v0.6.14+版本已去除该特性) | Boolean | true | 是否允许创建一个隐藏的输入框,该输入框会在节点激活时聚焦,用于粘贴数据和自动进入文本编辑状态 |
|
||||
| enableAutoEnterTextEditWhenKeydown(v0.6.13+) | Boolean | true | 是否在存在一个激活节点时,当按下中文、英文、数字按键时自动进入文本编辑模式 |
|
||||
| richTextEditFakeInPlace(v0.6.13+) | Boolean | false | 设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果,需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果 |
|
||||
| customHandleClipboardText(v0.6.14+) | Function | null | 自定义对剪贴板文本的处理。当按ctrl+v粘贴时会读取用户剪贴板中的文本和图片,默认只会判断文本是否是普通文本和simple-mind-map格式的节点数据,如果你想处理其他思维导图的数据,比如processon、zhixi等,那么可以传递一个函数,接受当前剪贴板中的文本为参数,返回处理后的数据,可以返回两种类型:1.返回一个纯文本,那么会直接以该文本创建一个子节点;2.返回一个节点对象,格式如下:{ simpleMindMap: true, data: { data: { text: '' }, children: [] } },代表是simple-mind-map格式的数据,节点数据同simple-mind-map节点数据格式,如果你的处理逻辑存在异步逻辑,也可以返回一个promise |
|
||||
| errorHandler(v0.6.15+) | Function | | 自定义错误处理函数,目前只会抛出一些异步逻辑出错的情况。可以传递一个函数,会接收两个参数,第一个为错误的类型,第二个为错误对象 |
|
||||
| disableMouseWheelZoom(v0.6.15+) | Boolean | false | 禁止鼠标滚轮缩放,你仍旧可以使用api进行缩放 |
|
||||
| resetCss(v0.6.16+) | String | * { margin: 0; padding: 0; box-sizing: border-box; } | 设置导出图片和svg时,针对富文本节点内容,也就是嵌入到svg中的html节点的默认样式覆盖,如果不覆盖,节点内容会发生偏移 |
|
||||
| enableDblclickReset(v0.6.17+) | Boolean | true(v0.7.0+改为false) | 开启鼠标双击复位思维导图位置及缩放 |
|
||||
| minExportImgCanvasScale(v0.7.0+) | Number | 2 | 导出图片和pdf时canvas的缩放倍数,该配置会和window.devicePixelRatio值取最大值,用于提升图片清晰度 |
|
||||
| hoverRectColor(v0.7.0+) | String | rgb(94, 200, 248) | 节点鼠标hover和激活时显示的矩形边框颜色,hover时会添加0.6的透明度 |
|
||||
| hoverRectPadding(v0.7.0+) | Number | 2 | 节点鼠标hover和激活时显示的矩形边框距节点内容的距离 |
|
||||
| selectTextOnEnterEditText(v0.7.0+) | Boolean | true | 双击节点进入节点文本编辑时是否默认选中文本,默认只在创建新节点时会选中 |
|
||||
| deleteNodeActive(v0.7.1+) | Boolean | true | 是否开启删除节点后自动激活节点相邻节点或父节点的功能 |
|
||||
| autoMoveWhenMouseInEdgeOnDrag(v0.7.1+) | Boolean | true | 拖拽节点时鼠标移动到画布边缘是否开启画布自动移动 |
|
||||
| fit(v0.7.1-fix.2+) | Boolean | false | 首次渲染时是否缩放至适应画布大小 |
|
||||
| dragMultiNodeRectConfig(v0.7.2+) | Object | { width: 40, height: 20, fill: '' } | 拖拽多个节点时随鼠标移动的示意矩形的样式配置,传递一个对象,字段含义分别为矩形的宽、高、填充色 |
|
||||
| dragPlaceholderRectFill(v0.7.2+) | String | | 节点拖拽时新位置的示意矩形的填充颜色,如果不传默认使用连线的颜色 |
|
||||
| dragOpacityConfig(v0.7.2+) | Object | { cloneNodeOpacity: 0.5, beingDragNodeOpacity: 0.3 } | 节点拖拽时的透明度配置,传递一个对象,字段含义分别为:跟随鼠标移动的克隆节点或矩形的透明度、被拖拽节点的透明度 |
|
||||
| tagsColorMap(v0.7.2+) | Object | {} | 自定义节点标签的颜色,可传一个对象,key为要指定颜色的标签内容,value为该标签内容的颜色,如果不传内部会根据标签内容生成对应的颜色 |
|
||||
|
||||
### 数据结构
|
||||
|
||||
@ -373,7 +377,7 @@ mindMap.updateConfig({
|
||||
| SELECT_ALL | 全选 | |
|
||||
| BACK | 回退指定的步数 | step(要回退的步数,默认为1) |
|
||||
| FORWARD | 前进指定的步数 | step(要前进的步数,默认为1) |
|
||||
| INSERT_NODE | 插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效 | openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js))、 appointChildren(v0.6.14+,可选,指定新创建节点的子节点,数组类型) |
|
||||
| INSERT_NODE | 插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效(v0.7.2+支持对多个激活节点同时插入兄弟节点) | openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodes(v0.4.7+,可选,指定要插入兄弟节点的节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js))、 appointChildren(v0.6.14+,可选,指定新创建节点的子节点,数组类型) |
|
||||
| INSERT_CHILD_NODE | 插入子节点,操作节点为当前激活的节点或指定节点 | openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js))、 appointChildren(v0.6.14+,可选,指定新创建节点的子节点,数组类型) |
|
||||
| UP_NODE | 上移节点,操作节点为当前激活的节点,如果有多个激活节点,只会对第一个有效,对根节点或在列表里的第一个节点使用无效 | |
|
||||
| DOWN_NODE | 操作节点为当前激活的节点,如果有多个激活节点,只会对第一个有效,对根节点或在列表里的最后一个节点使用无效 | |
|
||||
@ -395,15 +399,18 @@ mindMap.updateConfig({
|
||||
| SET_NODE_HYPERLINK | 设置节点超链接 | node(要设置的节点)、link(超链接地址)、title(超链接名称,可选) |
|
||||
| SET_NODE_NOTE | 设置节点备注 | node(要设置的节点)、note(备注文字) |
|
||||
| SET_NODE_TAG | 设置节点标签 | node(要设置的节点)、tag(字符串数组,内置颜色信息可在[constant.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js)里获取到) |
|
||||
| INSERT_AFTER(v0.1.5+) | 将节点移动到另一个节点的后面 | node(要移动的节点)、 exist(目标节点) |
|
||||
| INSERT_BEFORE(v0.1.5+) | 将节点移动到另一个节点的前面 | node(要移动的节点)、 exist(目标节点) |
|
||||
| MOVE_NODE_TO(v0.1.5+) | 移动一个节点作为另一个节点的子节点 | node(要移动的节点)、 toNode(目标节点) |
|
||||
| INSERT_AFTER(v0.1.5+) | 将节点移动到另一个节点的后面 | node(要移动的节点,(v0.7.2+支持传递节点数组实现同时移动多个节点))、 exist(目标节点) |
|
||||
| INSERT_BEFORE(v0.1.5+) | 将节点移动到另一个节点的前面,(v0.7.2+支持传递节点数组实现同时移动多个节点) | node(要移动的节点)、 exist(目标节点) |
|
||||
| MOVE_NODE_TO(v0.1.5+) | 移动节点作为另一个节点的子节点,(v0.7.2+支持传递节点数组实现同时移动多个节点) | node(要移动的节点)、 toNode(目标节点) |
|
||||
| ADD_GENERALIZATION(v0.2.0+) | 添加节点概要 | data(概要的数据,对象格式,节点的数字段都支持,默认为{text: '概要'}) |
|
||||
| REMOVE_GENERALIZATION(v0.2.0+) | 删除节点概要 | |
|
||||
| SET_NODE_CUSTOM_POSITION(v0.2.0+) | 设置节点自定义位置 | node(要设置的节点)、 left(自定义的x坐标,默认为undefined)、 top(自定义的y坐标,默认为undefined) |
|
||||
| RESET_LAYOUT(v0.2.0+) | 一键整理布局 | |
|
||||
| SET_NODE_SHAPE(v0.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_NODE(v0.6.7+) | 定位到某个节点,如果该节点被收起,那么会自动展开到该节点 | node(要定位到的节点实例或节点uid)、callback(v0.6.9+,定位完成后的回调函数) |
|
||||
| INSERT_MULTI_NODE(v0.7.2+) | 给指定的节点同时插入多个同级节点,操作节点为当前激活的节点或指定节点 | appointNodes(可选,指定节点,指定多个节点可以传一个数组), nodeList(新插入节点的数据列表,数组类型) |
|
||||
| INSERT_MULTI_CHILD_NODE(v0.7.2+) | 给指定的节点同时插入多个子节点,操作节点为当前激活的节点或指定节点 | appointNodes(可选,指定节点,指定多个节点可以传一个数组), childList(新插入节点的数据列表,数组类型) |
|
||||
| INSERT_FORMULA(v0.7.2+) | 给节点插入数学公式,操作节点为当前激活的节点或指定节点 | formula(要插入的数学公式,LaText语法), appointNodes(可选,指定要插入公式的节点,多个节点可以传数组,否则默认为当前激活的节点) |
|
||||
|
||||
### setData(data)
|
||||
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
<th>类型</th>
|
||||
<th>默认值</th>
|
||||
<th>描述</th>
|
||||
<th>是否必填</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -32,463 +31,421 @@
|
||||
<td>el</td>
|
||||
<td>Element</td>
|
||||
<td></td>
|
||||
<td>容器元素,必须为DOM元素</td>
|
||||
<td>是</td>
|
||||
<td>容器元素,必传,必须为DOM元素</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>data</td>
|
||||
<td>Object</td>
|
||||
<td>{}</td>
|
||||
<td>思维导图数据,可参考下方【数据结构】介绍</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>layout</td>
|
||||
<td>String</td>
|
||||
<td>logicalStructure</td>
|
||||
<td>布局类型,可选列表:logicalStructure(逻辑结构图)、mindMap(思维导图)、catalogOrganization(目录组织图)、organizationStructure(组织结构图)、timeline(v0.5.4+,时间轴)、timeline2(v0.5.4+,上下交替型时间轴)、fishbone(v0.5.4+,鱼骨图)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fishboneDeg(v0.5.4+)</td>
|
||||
<td>Number</td>
|
||||
<td>45</td>
|
||||
<td>设置鱼骨结构图的斜线角度</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>theme</td>
|
||||
<td>String</td>
|
||||
<td>default</td>
|
||||
<td>主题,可选列表:default(默认)、classic(脑图经典)、minions(小黄人)、pinkGrape(粉红葡萄)、mint(薄荷)、gold(金色vip)、vitalityOrange(活力橙)、greenLeaf(绿叶)、dark2(暗色2)、skyGreen(天清绿)、classic2(脑图经典2)、classic3(脑图经典3)、classic4(脑图经典4,v0.2.0+)、classicGreen(经典绿)、classicBlue(经典蓝)、blueSky(天空蓝)、brainImpairedPink(脑残粉)、dark(暗色)、earthYellow(泥土黄)、freshGreen(清新绿)、freshRed(清新红)、romanticPurple(浪漫紫)、simpleBlack(v0.5.4+简约黑)、courseGreen(v0.5.4+课程绿)、coffee(v0.5.4+咖啡)、redSpirit(v0.5.4+红色精神)、blackHumour(v0.5.4+黑色幽默)、lateNightOffice(v0.5.4+深夜办公室)、blackGold(v0.5.4+黑金)、avocado(v.5.10-fix.2+牛油果)、autumn(v.5.10-fix.2+秋天)、orangeJuice(v.5.10-fix.2+橙汁)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>themeConfig</td>
|
||||
<td>Object</td>
|
||||
<td>{}</td>
|
||||
<td>主题配置,会和所选择的主题进行合并,可用字段可参考:<a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js">default.js</a></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>scaleRatio</td>
|
||||
<td>Number</td>
|
||||
<td>0.1</td>
|
||||
<td>放大缩小的增量比例</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maxTag</td>
|
||||
<td>Number</td>
|
||||
<td>5</td>
|
||||
<td>节点里最多显示的标签数量,多余的会被丢弃</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>exportPadding</td>
|
||||
<td>Number</td>
|
||||
<td>20</td>
|
||||
<td>导出图片时的内边距</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>imgTextMargin</td>
|
||||
<td>Number</td>
|
||||
<td>5</td>
|
||||
<td>节点里图片和文字的间距</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>textContentMargin</td>
|
||||
<td>Number</td>
|
||||
<td>2</td>
|
||||
<td>节点里各种文字信息的间距,如图标和文字的间距</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectTranslateStep</td>
|
||||
<td>Number</td>
|
||||
<td>3</td>
|
||||
<td>多选节点时鼠标移动到边缘时的画布移动偏移量</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectTranslateLimit</td>
|
||||
<td>Number</td>
|
||||
<td>20</td>
|
||||
<td>多选节点时鼠标移动距边缘多少距离时开始偏移</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>customNoteContentShow(v0.1.6+)</td>
|
||||
<td>Object</td>
|
||||
<td>null</td>
|
||||
<td>自定义节点备注内容显示,Object类型,结构为:{show: (noteContent, left, top) => {// 你的显示节点备注逻辑 }, hide: () => {// 你的隐藏节点备注逻辑 }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>readonly(v0.1.7+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>是否是只读模式</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enableFreeDrag(v0.2.4+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>是否开启节点自由拖拽</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>watermarkConfig(v0.2.4+)</td>
|
||||
<td>Object</td>
|
||||
<td></td>
|
||||
<td>水印配置,详细配置请参考下方表格【水印配置】</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>textAutoWrapWidth(v0.3.4+)</td>
|
||||
<td>Number</td>
|
||||
<td>500</td>
|
||||
<td>节点内每行文本达到该宽度后自动换行</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>customHandleMousewheel(v0.4.3+)</td>
|
||||
<td>Function</td>
|
||||
<td>null</td>
|
||||
<td>自定义鼠标滚轮事件处理,可以传一个函数,回调参数为事件对象</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mousewheelAction(v0.4.3+)</td>
|
||||
<td>String</td>
|
||||
<td>zoom</td>
|
||||
<td>鼠标滚轮的行为,<code>zoom</code>(放大缩小)、<code>move</code>(上下移动)。如果<code>customHandleMousewheel</code>传了自定义函数,这个属性不生效</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mousewheelMoveStep(v0.4.3+)</td>
|
||||
<td>Number</td>
|
||||
<td>100</td>
|
||||
<td>当<code>mousewheelAction</code>设为<code>move</code>时,可以通过该属性控制鼠标滚动一下视图移动的步长,单位<code>px</code></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mousewheelZoomActionReverse(v0.6.5+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>当mousewheelAction设为zoom时,默认向前滚动是缩小,向后滚动是放大,如果该属性设为true,那么会反过来</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>defaultInsertSecondLevelNodeText(v0.4.7+)</td>
|
||||
<td>String</td>
|
||||
<td>二级节点</td>
|
||||
<td>默认插入的二级节点的文字</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>defaultInsertBelowSecondLevelNodeText(v0.4.7+)</td>
|
||||
<td>String</td>
|
||||
<td>分支主题</td>
|
||||
<td>默认插入的二级以下节点的文字</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>expandBtnStyle(v0.5.0+)</td>
|
||||
<td>Object</td>
|
||||
<td>{ color: '#808080', fill: '#fff', fontSize: 13, strokeColor: '#333333' }</td>
|
||||
<td>展开收起按钮的颜色,(fontSize及strokeColor字段为0.7.0+版本新增的,用于设置收起时显示节点数量的文字样式)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>expandBtnIcon(v0.5.0+)</td>
|
||||
<td>Object</td>
|
||||
<td>{ open: '', close: '' }</td>
|
||||
<td>自定义展开收起按钮的图标,可以传图标的svg字符串</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>expandBtnNumHandler(v0.7.0+)</td>
|
||||
<td>Function</td>
|
||||
<td></td>
|
||||
<td>用于自定义收起时显示节点数量的内容,接收一个参数,代表收起的节点实例,需要返回一个数字或字符串,代表最终显示的内容,比如你可以当数量大于99时,显示99+</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>isShowExpandNum(v0.7.0+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>节点收起时是否显示收起的数量</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enableShortcutOnlyWhenMouseInSvg(v0.5.1+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>是否只有当鼠标在画布内才响应快捷键事件</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enableNodeTransitionMove(v0.5.1+)(v0.6.7+已去除该特性)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>是否开启节点动画过渡</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>nodeTransitionMoveDuration(v0.5.1+)(v0.6.7+已去除该特性)</td>
|
||||
<td>Number</td>
|
||||
<td>300</td>
|
||||
<td>如果开启节点动画过渡,可以通过该属性设置过渡的时间,单位ms</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>initRootNodePosition(v0.5.3+)</td>
|
||||
<td>Array</td>
|
||||
<td>null</td>
|
||||
<td>初始根节点的位置,可传一个数组,默认为<code>['center', 'center']</code>,代表根节点处于画布中心位置,除了<code>center</code>,关键词还可以设置<code>left</code>、<code>top</code>、<code>right</code>、<code>bottom</code>,除了可以传关键词,数组的每项还可以传递一个数字,代表具体的像素,可以传递一个百分比字符串,比如<code>['40%', '60%']</code>,代表水平位置在画布宽度的<code>40%</code>的位置,垂直位置在画布高度的<code>60%</code>的位置</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>exportPaddingX(v0.5.5+)</td>
|
||||
<td>Number</td>
|
||||
<td>10</td>
|
||||
<td>导出png、svg、pdf时的图形水平内边距</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>exportPaddingY(v0.5.5+)</td>
|
||||
<td>Number</td>
|
||||
<td>10</td>
|
||||
<td>导出png、svg、pdf时的图形垂直内边距</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>nodeTextEditZIndex(v0.5.5+)</td>
|
||||
<td>Number</td>
|
||||
<td>3000</td>
|
||||
<td>节点文本编辑框元素的z-index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>nodeNoteTooltipZIndex(v0.5.5+)</td>
|
||||
<td>Number</td>
|
||||
<td>3000</td>
|
||||
<td>节点备注浮层元素的z-index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>isEndNodeTextEditOnClickOuter(v0.5.5+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>是否在点击了画布外的区域时结束节点文本的编辑状态</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maxHistoryCount(v0.5.6+)</td>
|
||||
<td>Number</td>
|
||||
<td>1000</td>
|
||||
<td>最大历史记录数</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>alwaysShowExpandBtn(v0.5.8+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>是否一直显示节点的展开收起按钮,默认为鼠标移上去和激活时才显示</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>iconList(v0.5.8+)</td>
|
||||
<td>Array</td>
|
||||
<td>[]</td>
|
||||
<td>扩展节点可插入的图标,数组的每一项为一个对象,对象详细结构请参考下方【图标配置】表格</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maxNodeCacheCount(v0.5.10+)</td>
|
||||
<td>Number</td>
|
||||
<td>1000</td>
|
||||
<td>节点最大缓存数量。为了优化性能,内部会维护一个节点缓存池,用来复用节点,通过该属性可以指定池的最大缓存数量</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>defaultAssociativeLineText(v0.5.11+)</td>
|
||||
<td>String</td>
|
||||
<td>关联</td>
|
||||
<td>关联线默认文字</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fitPadding(v0.6.0+)</td>
|
||||
<td>Number</td>
|
||||
<td>50</td>
|
||||
<td>思维导图适应画布大小时的内边距,单位:px</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enableCtrlKeyNodeSelection(v0.6.0+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>是否开启按住ctrl键多选节点的功能</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>useLeftKeySelectionRightKeyDrag(v0.6.0+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>设置为左键多选节点,右键拖动画布</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>beforeTextEdit(v0.6.0+)</td>
|
||||
<td>Function/null</td>
|
||||
<td>null</td>
|
||||
<td>节点即将进入编辑前的回调方法,如果该方法返回true以外的值,那么将取消编辑,函数可以返回一个值,或一个Promise,回调参数为节点实例</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>isUseCustomNodeContent(v0.6.3+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>是否自定义节点内容</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>customCreateNodeContent(v0.6.3+)</td>
|
||||
<td>Function/null</td>
|
||||
<td>null</td>
|
||||
<td>如果<code>isUseCustomNodeContent</code>设为<code>true</code>,那么需要使用该选项传入一个方法,接收节点实例<code>node</code>为参数(如果要获取该节点的数据,可以通过<code>node.nodeData.data</code>),需要返回自定义节点内容元素,也就是DOM节点,如果某个节点不需要自定义,那么返回<code>null</code>即可</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mouseScaleCenterUseMousePosition(v0.6.4-fix.1+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>鼠标缩放是否以鼠标当前位置为中心点,否则以画布中心点</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>customInnerElsAppendTo(v0.6.12+)</td>
|
||||
<td>null/HTMLElement</td>
|
||||
<td>null</td>
|
||||
<td>指定内部一些元素(节点文本编辑元素、节点备注显示元素、关联线文本编辑元素、节点图片调整按钮元素)添加到的位置,默认添加到document.body下</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>nodeDragPlaceholderMaxSize(v0.6.12+)</td>
|
||||
<td>Number</td>
|
||||
<td>20</td>
|
||||
<td>拖拽元素时,指示元素新位置的块的最大高度</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enableCreateHiddenInput(v0.6.13+)(v0.6.14+版本已去除该特性)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>是否允许创建一个隐藏的输入框,该输入框会在节点激活时聚焦,用于粘贴数据和自动进入文本编辑状态</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enableAutoEnterTextEditWhenKeydown(v0.6.13+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>是否在存在一个激活节点时,当按下中文、英文、数字按键时自动进入文本编辑模式</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>richTextEditFakeInPlace(v0.6.13+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果,需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>customHandleClipboardText(v0.6.14+)</td>
|
||||
<td>Function</td>
|
||||
<td>null</td>
|
||||
<td>自定义对剪贴板文本的处理。当按ctrl+v粘贴时会读取用户剪贴板中的文本和图片,默认只会判断文本是否是普通文本和simple-mind-map格式的节点数据,如果你想处理其他思维导图的数据,比如processon、zhixi等,那么可以传递一个函数,接受当前剪贴板中的文本为参数,返回处理后的数据,可以返回两种类型:1.返回一个纯文本,那么会直接以该文本创建一个子节点;2.返回一个节点对象,格式如下:{ simpleMindMap: true, data: { data: { text: '' }, children: [] } },代表是simple-mind-map格式的数据,节点数据同simple-mind-map节点数据格式,如果你的处理逻辑存在异步逻辑,也可以返回一个promise</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>errorHandler(v0.6.15+)</td>
|
||||
<td>Function</td>
|
||||
<td></td>
|
||||
<td>自定义错误处理函数,目前只会抛出一些异步逻辑出错的情况。可以传递一个函数,会接收两个参数,第一个为错误的类型,第二个为错误对象</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>disableMouseWheelZoom(v0.6.15+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>禁止鼠标滚轮缩放,你仍旧可以使用api进行缩放</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>resetCss(v0.6.16+)</td>
|
||||
<td>String</td>
|
||||
<td>* { margin: 0; padding: 0; box-sizing: border-box; }</td>
|
||||
<td>设置导出图片和svg时,针对富文本节点内容,也就是嵌入到svg中的html节点的默认样式覆盖,如果不覆盖,节点内容会发生偏移</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>enableDblclickReset(v0.6.17+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true(v0.7.0+改为false)</td>
|
||||
<td>开启鼠标双击复位思维导图位置及缩放</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>minExportImgCanvasScale(v0.7.0+)</td>
|
||||
<td>Number</td>
|
||||
<td>2</td>
|
||||
<td>导出图片和pdf时canvas的缩放倍数,该配置会和window.devicePixelRatio值取最大值,用于提升图片清晰度</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>hoverRectColor(v0.7.0+)</td>
|
||||
<td>String</td>
|
||||
<td>rgb(94, 200, 248)</td>
|
||||
<td>节点鼠标hover和激活时显示的矩形边框颜色,hover时会添加0.6的透明度</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>hoverRectPadding(v0.7.0+)</td>
|
||||
<td>Number</td>
|
||||
<td>2</td>
|
||||
<td>节点鼠标hover和激活时显示的矩形边框距节点内容的距离</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>selectTextOnEnterEditText(v0.7.0+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>双击节点进入节点文本编辑时是否默认选中文本,默认只在创建新节点时会选中</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>deleteNodeActive(v0.7.1+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>是否开启删除节点后自动激活节点相邻节点或父节点的功能</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>autoMoveWhenMouseInEdgeOnDrag(v0.7.1+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>拖拽节点时鼠标移动到画布边缘是否开启画布自动移动</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fit(v0.7.1-fix.2+)</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>首次渲染时是否缩放至适应画布大小</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dragMultiNodeRectConfig(v0.7.2+)</td>
|
||||
<td>Object</td>
|
||||
<td>{ width: 40, height: 20, fill: '' }</td>
|
||||
<td>拖拽多个节点时随鼠标移动的示意矩形的样式配置,传递一个对象,字段含义分别为矩形的宽、高、填充色</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dragPlaceholderRectFill(v0.7.2+)</td>
|
||||
<td>String</td>
|
||||
<td></td>
|
||||
<td>节点拖拽时新位置的示意矩形的填充颜色,如果不传默认使用连线的颜色</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>dragOpacityConfig(v0.7.2+)</td>
|
||||
<td>Object</td>
|
||||
<td>{ cloneNodeOpacity: 0.5, beingDragNodeOpacity: 0.3 }</td>
|
||||
<td>节点拖拽时的透明度配置,传递一个对象,字段含义分别为:跟随鼠标移动的克隆节点或矩形的透明度、被拖拽节点的透明度</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>tagsColorMap(v0.7.2+)</td>
|
||||
<td>Object</td>
|
||||
<td>{}</td>
|
||||
<td>自定义节点标签的颜色,可传一个对象,key为要指定颜色的标签内容,value为该标签内容的颜色,如果不传内部会根据标签内容生成对应的颜色</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -951,8 +908,8 @@ mindMap.setTheme(<span class="hljs-string">'主题名称'</span>)
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_NODE</td>
|
||||
<td>插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效</td>
|
||||
<td>openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为<code>true</code>)、 appointNodes(v0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考<a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a>)、 appointChildren(v0.6.14+,可选,指定新创建节点的子节点,数组类型)</td>
|
||||
<td>插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效(v0.7.2+支持对多个激活节点同时插入兄弟节点)</td>
|
||||
<td>openEdit(v0.4.6+,是否激活新插入的节点并进入编辑模式,默认为<code>true</code>)、 appointNodes(v0.4.7+,可选,指定要插入兄弟节点的节点,指定多个节点可以传一个数组)、 appointData(可选,指定新创建节点的数据,比如{text: 'xxx', ...},详细结构可以参考<a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a>)、 appointChildren(v0.6.14+,可选,指定新创建节点的子节点,数组类型)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_CHILD_NODE</td>
|
||||
@ -1062,16 +1019,16 @@ mindMap.setTheme(<span class="hljs-string">'主题名称'</span>)
|
||||
<tr>
|
||||
<td>INSERT_AFTER(v0.1.5+)</td>
|
||||
<td>将节点移动到另一个节点的后面</td>
|
||||
<td>node(要移动的节点)、 exist(目标节点)</td>
|
||||
<td>node(要移动的节点,(v0.7.2+支持传递节点数组实现同时移动多个节点))、 exist(目标节点)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_BEFORE(v0.1.5+)</td>
|
||||
<td>将节点移动到另一个节点的前面</td>
|
||||
<td>将节点移动到另一个节点的前面,(v0.7.2+支持传递节点数组实现同时移动多个节点)</td>
|
||||
<td>node(要移动的节点)、 exist(目标节点)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MOVE_NODE_TO(v0.1.5+)</td>
|
||||
<td>移动一个节点作为另一个节点的子节点</td>
|
||||
<td>移动节点作为另一个节点的子节点,(v0.7.2+支持传递节点数组实现同时移动多个节点)</td>
|
||||
<td>node(要移动的节点)、 toNode(目标节点)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1104,6 +1061,21 @@ mindMap.setTheme(<span class="hljs-string">'主题名称'</span>)
|
||||
<td>定位到某个节点,如果该节点被收起,那么会自动展开到该节点</td>
|
||||
<td>node(要定位到的节点实例或节点uid)、callback(v0.6.9+,定位完成后的回调函数)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_MULTI_NODE(v0.7.2+)</td>
|
||||
<td>给指定的节点同时插入多个同级节点,操作节点为当前激活的节点或指定节点</td>
|
||||
<td>appointNodes(可选,指定节点,指定多个节点可以传一个数组), nodeList(新插入节点的数据列表,数组类型)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_MULTI_CHILD_NODE(v0.7.2+)</td>
|
||||
<td>给指定的节点同时插入多个子节点,操作节点为当前激活的节点或指定节点</td>
|
||||
<td>appointNodes(可选,指定节点,指定多个节点可以传一个数组), childList(新插入节点的数据列表,数组类型)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>INSERT_FORMULA(v0.7.2+)</td>
|
||||
<td>给节点插入数学公式,操作节点为当前激活的节点或指定节点</td>
|
||||
<td>formula(要插入的数学公式,LaText语法), appointNodes(可选,指定要插入公式的节点,多个节点可以传数组,否则默认为当前激活的节点)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>setData(data)</h3>
|
||||
|
||||
36
web/src/pages/Doc/zh/formula/index.md
Normal file
36
web/src/pages/Doc/zh/formula/index.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Formula 插件
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
> 该插件仅在富文本模式下支持,所以需要在注册了RichText插件的前提下使用
|
||||
|
||||
该插件用于支持给节点插入公式。
|
||||
|
||||
## 注册
|
||||
|
||||
```js
|
||||
import MindMap from 'simple-mind-map'
|
||||
import Formula from 'simple-mind-map/src/plugins/Formula.js'
|
||||
|
||||
MindMap.usePlugin(Formula)
|
||||
```
|
||||
|
||||
注册完且实例化`MindMap`后可通过`mindMap.formula`获取到该实例。
|
||||
|
||||
## 使用
|
||||
|
||||
注册了该插件后,可以使用命令`INSERT_FORMULA`来给节点插入指定公式:
|
||||
|
||||
```js
|
||||
mindMap.execCommand('INSERT_FORMULA', 'a^2')
|
||||
```
|
||||
|
||||
上述命令会给当前激活的节点插入`a^2`公式。
|
||||
|
||||
如果要指定给某个或某些节点插入公式,可以传递第二个参数:
|
||||
|
||||
```js
|
||||
mindMap.execCommand('INSERT_FORMULA', 'a^2', [Node])
|
||||
```
|
||||
|
||||
通过第二个参数传入指定的节点实例即可。
|
||||
39
web/src/pages/Doc/zh/formula/index.vue
Normal file
39
web/src/pages/Doc/zh/formula/index.vue
Normal file
@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>Formula 插件</h1>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>该插件仅在富文本模式下支持,所以需要在注册了RichText插件的前提下使用</p>
|
||||
</blockquote>
|
||||
<p>该插件用于支持给节点插入公式。</p>
|
||||
<h2>注册</h2>
|
||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map'</span>
|
||||
<span class="hljs-keyword">import</span> Formula <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/plugins/Formula.js'</span>
|
||||
|
||||
MindMap.usePlugin(Formula)
|
||||
</code></pre>
|
||||
<p>注册完且实例化<code>MindMap</code>后可通过<code>mindMap.formula</code>获取到该实例。</p>
|
||||
<h2>使用</h2>
|
||||
<p>注册了该插件后,可以使用命令<code>INSERT_FORMULA</code>来给节点插入指定公式:</p>
|
||||
<pre class="hljs"><code>mindMap.execCommand(<span class="hljs-string">'INSERT_FORMULA'</span>, <span class="hljs-string">'a^2'</span>)
|
||||
</code></pre>
|
||||
<p>上述命令会给当前激活的节点插入<code>a^2</code>公式。</p>
|
||||
<p>如果要指定给某个或某些节点插入公式,可以传递第二个参数:</p>
|
||||
<pre class="hljs"><code>mindMap.execCommand(<span class="hljs-string">'INSERT_FORMULA'</span>, <span class="hljs-string">'a^2'</span>, [Node])
|
||||
</code></pre>
|
||||
<p>通过第二个参数传入指定的节点实例即可。</p>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@ -11,12 +11,12 @@
|
||||
- [x] 插件化架构,除核心功能外,其他功能作为插件提供,按需使用,减小打包体积
|
||||
- [x] 支持逻辑结构图、思维导图、组织结构图、目录组织图、时间轴(横向、竖向)、鱼骨图等结构
|
||||
- [x] 内置多种主题,允许高度自定义样式,支持注册新主题
|
||||
- [x] 节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要
|
||||
- [x] 节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要、数学公式
|
||||
- [x] 节点支持拖拽(拖拽移动、自由调整)、多种节点形状,支持使用 DDM 完全自定义节点内容
|
||||
- [x] 支持画布拖动、缩放
|
||||
- [x] 支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式
|
||||
- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`,支持从`json`、`xmind`、`markdown`导入
|
||||
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印
|
||||
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条
|
||||
- [x] 提供丰富的配置,满足各种场景各种使用习惯
|
||||
|
||||
## 仓库目录介绍
|
||||
@ -53,6 +53,8 @@
|
||||
|
||||
[我的第一个Electron应用](https://juejin.cn/post/7233012756314701884)
|
||||
|
||||
[探索如何将html和svg导出为图片](https://juejin.cn/post/7276712861514170409)
|
||||
|
||||
## 特别说明
|
||||
|
||||
本项目可用于学习和参考,用于实际项目时请先深度体验一下是否能满足您的需求。
|
||||
@ -61,7 +63,7 @@
|
||||
|
||||
如果有建议或发现了bug,可以在此提交[issues](https://github.com/wanglin2/mind-map/issues)。
|
||||
|
||||
项目内置的主题和图标来自于:
|
||||
项目内置的主题和图标部分来自于:
|
||||
|
||||
[百度脑图](https://naotu.baidu.com/)
|
||||
|
||||
|
||||
@ -8,16 +8,16 @@
|
||||
</blockquote>
|
||||
<h2>特性</h2>
|
||||
<ul>
|
||||
<li><input type="checkbox" id="checkbox15" checked="true" /><label for="checkbox15">插件化架构,除核心功能外,其他功能作为插件提供,按需使用,减小打包体积</label></li>
|
||||
<li><input type="checkbox" id="checkbox16" checked="true" /><label for="checkbox16">支持逻辑结构图、思维导图、组织结构图、目录组织图、时间轴(横向、竖向)、鱼骨图等结构</label></li>
|
||||
<li><input type="checkbox" id="checkbox17" checked="true" /><label for="checkbox17">内置多种主题,允许高度自定义样式,支持注册新主题</label></li>
|
||||
<li><input type="checkbox" id="checkbox18" checked="true" /><label for="checkbox18">节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要</label></li>
|
||||
<li><input type="checkbox" id="checkbox19" checked="true" /><label for="checkbox19">节点支持拖拽(拖拽移动、自由调整)、多种节点形状,支持使用 DDM 完全自定义节点内容</label></li>
|
||||
<li><input type="checkbox" id="checkbox20" checked="true" /><label for="checkbox20">支持画布拖动、缩放</label></li>
|
||||
<li><input type="checkbox" id="checkbox21" checked="true" /><label for="checkbox21">支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式</label></li>
|
||||
<li><input type="checkbox" id="checkbox22" checked="true" /><label for="checkbox22">支持导出为</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="checkbox23" checked="true" /><label for="checkbox23">支持快捷键、前进后退、关联线、搜索替换、小地图、水印</label></li>
|
||||
<li><input type="checkbox" id="checkbox24" checked="true" /><label for="checkbox24">提供丰富的配置,满足各种场景各种使用习惯</label></li>
|
||||
<li><input type="checkbox" id="checkbox90" checked="true" /><label for="checkbox90">插件化架构,除核心功能外,其他功能作为插件提供,按需使用,减小打包体积</label></li>
|
||||
<li><input type="checkbox" id="checkbox91" checked="true" /><label for="checkbox91">支持逻辑结构图、思维导图、组织结构图、目录组织图、时间轴(横向、竖向)、鱼骨图等结构</label></li>
|
||||
<li><input type="checkbox" id="checkbox92" checked="true" /><label for="checkbox92">内置多种主题,允许高度自定义样式,支持注册新主题</label></li>
|
||||
<li><input type="checkbox" id="checkbox93" checked="true" /><label for="checkbox93">节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要、数学公式</label></li>
|
||||
<li><input type="checkbox" id="checkbox94" checked="true" /><label for="checkbox94">节点支持拖拽(拖拽移动、自由调整)、多种节点形状,支持使用 DDM 完全自定义节点内容</label></li>
|
||||
<li><input type="checkbox" id="checkbox95" checked="true" /><label for="checkbox95">支持画布拖动、缩放</label></li>
|
||||
<li><input type="checkbox" id="checkbox96" checked="true" /><label for="checkbox96">支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式</label></li>
|
||||
<li><input type="checkbox" id="checkbox97" checked="true" /><label for="checkbox97">支持导出为</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="checkbox98" checked="true" /><label for="checkbox98">支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条</label></li>
|
||||
<li><input type="checkbox" id="checkbox99" checked="true" /><label for="checkbox99">提供丰富的配置,满足各种场景各种使用习惯</label></li>
|
||||
</ul>
|
||||
<h2>仓库目录介绍</h2>
|
||||
<p>1.<code>simple-mind-map</code></p>
|
||||
@ -25,11 +25,11 @@
|
||||
<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="checkbox25" checked="true" /><label for="checkbox25">工具栏,支持插入节点、删除节点;编辑节点图片、图标、超链接、备注、标签、概要</label></li>
|
||||
<li><input type="checkbox" id="checkbox26" checked="true" /><label for="checkbox26">侧边栏,基础样式设置面板、节点样式设置面板、大纲面板、主题选择面板、结构选择面板</label></li>
|
||||
<li><input type="checkbox" id="checkbox27" checked="true" /><label for="checkbox27">导入导出功能;数据默认保存在浏览器本地存储,也支持直接创建、打开、编辑电脑本地文件</label></li>
|
||||
<li><input type="checkbox" id="checkbox28" checked="true" /><label for="checkbox28">右键菜单,支持展开、收起、整理布局等操作</label></li>
|
||||
<li><input type="checkbox" id="checkbox29" checked="true" /><label for="checkbox29">底部栏,支持节点数量、字数统计;支持切换编辑和只读模式;支持放大缩小;支持全屏切换;支持小地图</label></li>
|
||||
<li><input type="checkbox" id="checkbox100" checked="true" /><label for="checkbox100">工具栏,支持插入节点、删除节点;编辑节点图片、图标、超链接、备注、标签、概要</label></li>
|
||||
<li><input type="checkbox" id="checkbox101" checked="true" /><label for="checkbox101">侧边栏,基础样式设置面板、节点样式设置面板、大纲面板、主题选择面板、结构选择面板</label></li>
|
||||
<li><input type="checkbox" id="checkbox102" checked="true" /><label for="checkbox102">导入导出功能;数据默认保存在浏览器本地存储,也支持直接创建、打开、编辑电脑本地文件</label></li>
|
||||
<li><input type="checkbox" id="checkbox103" checked="true" /><label for="checkbox103">右键菜单,支持展开、收起、整理布局等操作</label></li>
|
||||
<li><input type="checkbox" id="checkbox104" checked="true" /><label for="checkbox104">底部栏,支持节点数量、字数统计;支持切换编辑和只读模式;支持放大缩小;支持全屏切换;支持小地图</label></li>
|
||||
</ul>
|
||||
<p>提供文档页面服务。</p>
|
||||
<p>3.<code>dist</code></p>
|
||||
@ -40,11 +40,12 @@
|
||||
<p><a href="https://juejin.cn/post/7199666255883927612">当你按下方向键,电视是如何寻找下一个焦点的</a></p>
|
||||
<p><a href="https://juejin.cn/post/7204854015463538744">如何在canvas中模拟css的背景图片样式</a></p>
|
||||
<p><a href="https://juejin.cn/post/7233012756314701884">我的第一个Electron应用</a></p>
|
||||
<p><a href="https://juejin.cn/post/7276712861514170409">探索如何将html和svg导出为图片</a></p>
|
||||
<h2>特别说明</h2>
|
||||
<p>本项目可用于学习和参考,用于实际项目时请先深度体验一下是否能满足您的需求。</p>
|
||||
<p>本项目可能没有完整测试到每一个功能点,所以可能存在bug,另外,当节点数量非常多的时候,性能也存在一些问题,因为每个人能接受的卡顿程度不一样,所以你可以自行测试节点数量上限。</p>
|
||||
<p>如果有建议或发现了bug,可以在此提交<a href="https://github.com/wanglin2/mind-map/issues">issues</a>。</p>
|
||||
<p>项目内置的主题和图标来自于:</p>
|
||||
<p>项目内置的主题和图标部分来自于:</p>
|
||||
<p><a href="https://naotu.baidu.com/">百度脑图</a></p>
|
||||
<p><a href="https://www.zhixi.com/">知犀思维导图</a></p>
|
||||
<p>尊重版权,主题和图标请勿直接用于商业项目。</p>
|
||||
|
||||
@ -56,6 +56,26 @@
|
||||
|
||||
## 方法
|
||||
|
||||
### setOpacity(val)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `val`:透明度,0-1
|
||||
|
||||
设置节点透明度,包括连接线和下级节点。
|
||||
|
||||
### hideChildren()
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
隐藏下级节点。
|
||||
|
||||
### showChildren()
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
显示下级节点。
|
||||
|
||||
### hasCustomStyle()
|
||||
|
||||
> v0.6.2+
|
||||
|
||||
@ -31,6 +31,24 @@
|
||||
</blockquote>
|
||||
<p>节点是否正在拖拽中</p>
|
||||
<h2>方法</h2>
|
||||
<h3>setOpacity(val)</h3>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>val</code>:透明度,0-1</li>
|
||||
</ul>
|
||||
<p>设置节点透明度,包括连接线和下级节点。</p>
|
||||
<h3>hideChildren()</h3>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<p>隐藏下级节点。</p>
|
||||
<h3>showChildren()</h3>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<p>显示下级节点。</p>
|
||||
<h3>hasCustomStyle()</h3>
|
||||
<blockquote>
|
||||
<p>v0.6.2+</p>
|
||||
|
||||
@ -245,6 +245,107 @@ copyNodeTree({}, node)
|
||||
|
||||
判断是否是移动端环境。
|
||||
|
||||
#### getTopAncestorsFomNodeList(list)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `list`:Arrray,节点实例列表。
|
||||
|
||||
从节点实例列表里找出最顶层的节点列表。
|
||||
|
||||
#### checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
参数为两个矩形的位置。
|
||||
|
||||
判断两个矩形是否重叠。
|
||||
|
||||
#### focusInput(el)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `el`:DOM节点,可聚焦的元素,一般为输入框元素。
|
||||
|
||||
聚焦指定输入框。
|
||||
|
||||
#### selectAllInput(el)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `el`:DOM节点,可聚焦的元素,一般为输入框元素。
|
||||
|
||||
聚焦并全选指定输入框。
|
||||
|
||||
#### addDataToAppointNodes(appointNodes, data = {})
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `appointNodes`:节点实例列表,数组类型。
|
||||
|
||||
- `data`:要附加到指定节点实例列表树中所有节点的数据中的数据。
|
||||
|
||||
给指定的节点列表树数据添加附加数据,会修改原数据。
|
||||
|
||||
#### createUidForAppointNodes(appointNodes)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `appointNodes`:节点实例列表,数组类型。
|
||||
|
||||
给指定的节点列表树数据添加uid(如果uid不存在的话),会修改原数据。
|
||||
|
||||
#### getNodeIndex(node)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `node`:节点实例。
|
||||
|
||||
获取节点在同级里的位置索引。
|
||||
|
||||
#### mergerIconList(list)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `list`:要合并到库内部的节点图标数组。
|
||||
|
||||
```js
|
||||
// const data = [
|
||||
// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },
|
||||
// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },
|
||||
// ];
|
||||
|
||||
// mergerIconList(data) 结果
|
||||
|
||||
// [
|
||||
// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },
|
||||
// ]
|
||||
```
|
||||
|
||||
合并图标数组。
|
||||
|
||||
#### generateColorByContent(str)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `str`:字符串。
|
||||
|
||||
根据传入的内容生成颜色,同样的内容会生成同样的颜色。
|
||||
|
||||
#### htmlEscape(str)
|
||||
|
||||
> v0.7.2+
|
||||
|
||||
- `str`:字符串。
|
||||
|
||||
转义传入的字符串,目前会转义如下三个字符:
|
||||
|
||||
```
|
||||
& -> &
|
||||
< -> <
|
||||
> -> >
|
||||
```
|
||||
|
||||
## 在canvas中模拟css的背景属性
|
||||
|
||||
引入:
|
||||
|
||||
@ -174,6 +174,104 @@
|
||||
<p>v0.6.13+</p>
|
||||
</blockquote>
|
||||
<p>判断是否是移动端环境。</p>
|
||||
<h4>getTopAncestorsFomNodeList(list)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>list</code>:Arrray,节点实例列表。</li>
|
||||
</ul>
|
||||
<p>从节点实例列表里找出最顶层的节点列表。</p>
|
||||
<h4>checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<p>参数为两个矩形的位置。</p>
|
||||
<p>判断两个矩形是否重叠。</p>
|
||||
<h4>focusInput(el)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>el</code>:DOM节点,可聚焦的元素,一般为输入框元素。</li>
|
||||
</ul>
|
||||
<p>聚焦指定输入框。</p>
|
||||
<h4>selectAllInput(el)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>el</code>:DOM节点,可聚焦的元素,一般为输入框元素。</li>
|
||||
</ul>
|
||||
<p>聚焦并全选指定输入框。</p>
|
||||
<h4>addDataToAppointNodes(appointNodes, data = {})</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>appointNodes</code>:节点实例列表,数组类型。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>data</code>:要附加到指定节点实例列表树中所有节点的数据中的数据。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>给指定的节点列表树数据添加附加数据,会修改原数据。</p>
|
||||
<h4>createUidForAppointNodes(appointNodes)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>appointNodes</code>:节点实例列表,数组类型。</li>
|
||||
</ul>
|
||||
<p>给指定的节点列表树数据添加uid(如果uid不存在的话),会修改原数据。</p>
|
||||
<h4>getNodeIndex(node)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>node</code>:节点实例。</li>
|
||||
</ul>
|
||||
<p>获取节点在同级里的位置索引。</p>
|
||||
<h4>mergerIconList(list)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>list</code>:要合并到库内部的节点图标数组。</li>
|
||||
</ul>
|
||||
<pre class="hljs"><code><span class="hljs-comment">// const data = [</span>
|
||||
<span class="hljs-comment">// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },</span>
|
||||
<span class="hljs-comment">// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },</span>
|
||||
<span class="hljs-comment">// ];</span>
|
||||
|
||||
<span class="hljs-comment">// mergerIconList(data) 结果</span>
|
||||
|
||||
<span class="hljs-comment">// [</span>
|
||||
<span class="hljs-comment">// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },</span>
|
||||
<span class="hljs-comment">// ]</span>
|
||||
</code></pre>
|
||||
<p>合并图标数组。</p>
|
||||
<h4>generateColorByContent(str)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>str</code>:字符串。</li>
|
||||
</ul>
|
||||
<p>根据传入的内容生成颜色,同样的内容会生成同样的颜色。</p>
|
||||
<h4>htmlEscape(str)</h4>
|
||||
<blockquote>
|
||||
<p>v0.7.2+</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><code>str</code>:字符串。</li>
|
||||
</ul>
|
||||
<p>转义传入的字符串,目前会转义如下三个字符:</p>
|
||||
<pre class="hljs"><code>& -> &amp;
|
||||
< -> &lt;
|
||||
> -> &gt;
|
||||
</code></pre>
|
||||
<h2>在canvas中模拟css的背景属性</h2>
|
||||
<p>引入:</p>
|
||||
<pre class="hljs"><code><span class="hljs-keyword">import</span> drawBackgroundImageToCanvas <span class="hljs-keyword">from</span> <span class="hljs-string">'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user