Doc: update

This commit is contained in:
wanglin2 2023-10-17 11:13:06 +08:00
parent 4dedaaea3b
commit 2a49dd9140
28 changed files with 2263 additions and 80 deletions

View File

@ -88,3 +88,15 @@ Deletes the currently active associative line. Clicking on an associated line is
### clearActiveLine()
Clears the active state of the currently active association line.
### front()
> v0.8.0+
The top-level display of the associated line.
### back()
> v0.8.0+
The associated line returns to its original level.

View File

@ -66,6 +66,16 @@ MindMap.usePlugin(AssociativeLine)
<p>Deletes the currently active associative line. Clicking on an associated line is considered active.</p>
<h3>clearActiveLine()</h3>
<p>Clears the active state of the currently active association line.</p>
<h3>front()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>The top-level display of the associated line.</p>
<h3>back()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>The associated line returns to its original level.</p>
</div>
</template>

View File

@ -1,5 +1,51 @@
# Changelog
## 0.8.0
Breaking change: Greatly optimize some of the code and slightly improve performance, mainly by using the 'render' class to remove useless logic, adjust unreasonable implementations, and extract duplicate code; Modify function names, functions, etc.
Fix:
> Fix the issue of the arrow of the associated line disappearing when exporting images and SVGs.
>
> Fix the issue of abnormal operation returning to the root node after resizing the container.
>
> Fix that the shortcut key operations for inserting summary, moving up, down, and organizing layout with one click did not trigger data_ The issue with the change event.
New:
> Optimize the canvas DOM structure and render nodes, lines, and associated lines in layers.
>
> Optimize the watermark plugin.
>
> The setTheme, setThemeConfig, and setLayout functions add parameters that do not trigger re rendering.
>
> Add a command to insert a parent node.
>
> Add a command to only delete the current node.
>
> Automatically expand child nodes when inserting a summary.
>
> Clear the current active node when right-clicking on the canvas.
>
> The folded active nodes are synchronously deleted from the list of active nodes.
>
> Pasting text with line breaks supports controlling whether nodes are split by line breaks.
Demo:
> Modify the method and copy to return to the root node.
>
> Fix the issue of ineffective first switching when switching themes in overlay mode.
>
> The right-click menu adds the function of inserting parent nodes and deleting only the current node.
>
> The top toolbar supports automatic folding into more according to the window width.
>
> Support manual input of zoom factor.
>
> Improve the English translation of the interface.
## 0.7.3-fix.2
Fix some issues with collaborative editing:

View File

@ -1,6 +1,35 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.8.0</h2>
<p>Breaking change: Greatly optimize some of the code and slightly improve performance, mainly by using the 'render' class to remove useless logic, adjust unreasonable implementations, and extract duplicate code; Modify function names, functions, etc.</p>
<p>Fix:</p>
<blockquote>
<p>Fix the issue of the arrow of the associated line disappearing when exporting images and SVGs.</p>
<p>Fix the issue of abnormal operation returning to the root node after resizing the container.</p>
<p>Fix that the shortcut key operations for inserting summary, moving up, down, and organizing layout with one click did not trigger data_ The issue with the change event.</p>
</blockquote>
<p>New:</p>
<blockquote>
<p>Optimize the canvas DOM structure and render nodes, lines, and associated lines in layers.</p>
<p>Optimize the watermark plugin.</p>
<p>The setTheme, setThemeConfig, and setLayout functions add parameters that do not trigger re rendering.</p>
<p>Add a command to insert a parent node.</p>
<p>Add a command to only delete the current node.</p>
<p>Automatically expand child nodes when inserting a summary.</p>
<p>Clear the current active node when right-clicking on the canvas.</p>
<p>The folded active nodes are synchronously deleted from the list of active nodes.</p>
<p>Pasting text with line breaks supports controlling whether nodes are split by line breaks.</p>
</blockquote>
<p>Demo:</p>
<blockquote>
<p>Modify the method and copy to return to the root node.</p>
<p>Fix the issue of ineffective first switching when switching themes in overlay mode.</p>
<p>The right-click menu adds the function of inserting parent nodes and deleting only the current node.</p>
<p>The top toolbar supports automatic folding into more according to the window width.</p>
<p>Support manual input of zoom factor.</p>
<p>Improve the English translation of the interface.</p>
</blockquote>
<h2>0.7.3-fix.2</h2>
<p>Fix some issues with collaborative editing:</p>
<p>1.The position of the new node is incorrect when inserting peer nodes;</p>

View File

@ -82,7 +82,8 @@ const mindMap = new MindMap({
| errorHandlerv0.6.15+ | Function | | Custom error handling functions currently only throw some asynchronous logic errors. Can pass a function that takes two parameters, the first being the wrong type and the second being the wrong object | |
| disableMouseWheelZoomv0.6.15+ | Boolean | false | Prohibit mouse wheel scaling, you can still use the API for scaling | |
| resetCssv0.6.16+ | String | * { margin: 0; padding: 0; box-sizing: border-box; } | When exporting images and SVGs, the default style overlay for rich text node content, which is embedded in HTML nodes in SVGs, will occur. If not overlaid, the node content will be offset | |
| enableDblclickResetv0.6.17+ | Boolean | true(v0.7.0+changed to false) | Turn on the mouse and double-click to reset the position and zoom of the mind map | |
| enableDblclickResetv0.6.17+(v0.8.0+this attribute has been deleted) | Boolean | true(v0.7.0+changed to false) | Turn on the mouse and double-click to reset the position and zoom of the mind map | |
| enableDblclickBackToRootNodev0.8.0+ | Boolean | false | Whether to return to the root node when double clicking with the mouse, that is, to center the display of the root node | |
| minExportImgCanvasScalev0.7.0+ | Number | 2 | The scaling factor of canvas when exporting images and PDFs, which is set to the maximum value of window.devicePixelRatio to improve image clarity | |
| hoverRectColorv0.7.0+ | String | rgb(94, 200, 248) | The node mouse hover and the rectangular border color displayed when activated will add a transparency of 0.6 when hovering | |
| hoverRectPaddingv0.7.0+ | Number | 2 | The distance between the node mouse hover and the displayed rectangular border when activated and the node content | |
@ -95,6 +96,9 @@ const mindMap = new MindMap({
| dragOpacityConfigv0.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 | |
| tagsColorMapv0.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 | |
| cooperateStylev0.7.3+ | Object | { avatarSize: 22, fontSize: 12 } | The configuration of personnel avatar style during node collaboration editing, with field meanings as follows: avatar size, and if it is a text avatar, the size of the text | |
| associativeLineIsAlwaysAboveNodev0.8.0+ | Boolean | true | Is the associated line always displayed above the node? If set to false, it will be at the top level when creating and activating the associated line, and in other cases, it will be below the node | |
| defaultGeneralizationTextv0.8.0+ | String | 概要 | Insert default text for summary | |
| handleIsSplitByWrapOnPasteCreateNewNodev0.8.0+ | Function | null | null | When creating a new node by pasting text, control whether to automatically split the nodes based on line breaks. If there is a line break, multiple nodes will be created based on the line break. Otherwise, only one node will be created, and a function can be passed to return promise. resolve represents splitting based on line breaks, and reject represents ignoring line breaks | |
### Data structure
@ -210,10 +214,96 @@ Get whether a plugin is registered, The index of the plugin in the registered pl
List of all currently registered plugins.
## Instance props
### el
Container element.
### opt
Config options object.
### svg
> @svgdotjs/svg.js library calls the node instance returned by the SVG() method
Canvas SVG element.
### draw
> @svgdotjs/svg.js library calls the node instance returned by the group() method
>
> Child node of SVG node
Container element, used to carry content such as nodes and connections.
### lineDraw
> v0.8.0+
>
> @svgdotjs/svg.js library calls the node instance returned by the group() method
>
> Child node of draw node
Container for node wiring elements.
### nodeDraw
> v0.8.0+
>
> @svgdotjs/svg.js library calls the node instance returned by the group() method
>
> Child node of draw node
Container for node elements.
### associativeLineDraw
> v0.8.0+
>
> @svgdotjs/svg.js library calls the node instance returned by the group() method
>
> Available when the associated line plugin is registered
>
> Child node of draw node
Container for associative line content.
### otherDraw
> v0.8.0+
>
> @svgdotjs/svg.js library calls the node instance returned by the group() method
>
> Child node of draw node
Container for other content.
### elRect
The size and position information of the container element 'el'. The return result of calling the 'getBoundingClientRect()' method.
### width
The width of the container element 'el'.
### height
The height of the container element 'el'.
### themeConfig
Current Theme Configuration.
## Instance methods
### clearDraw()
> v0.8.0+
Clear `lineDraw`、`associativeLineDraw`、`nodeDraw`、`otherDraw` containers.
### destroy()
> v0.6.0+
@ -323,7 +413,9 @@ Trigger an event, which can be one of the events listed above or a custom event.
Unbind an event.
### setTheme(theme)
### setTheme(theme, notRender = false)
- `notRender`: v0.8.0+, Is not call the render method to update the canvas.
Switches the theme. Available themes can be found in the options table above.
@ -331,7 +423,9 @@ Switches the theme. Available themes can be found in the options table above.
Gets the current theme.
### setThemeConfig(config)
### setThemeConfig(config, notRender = false)
- `notRender`: v0.8.0+, Is not call the render method to update the canvas.
Sets the theme configuration. `config` is the same as the `themeConfig` option
in the options table above.
@ -372,7 +466,9 @@ This method only updates the configuration and has no other side effects, such a
Gets the current layout structure.
### setLayout(layout)
### setLayout(layout, notRender = false)
- `notRender`: v0.8.0+, Is not call the render method to update the canvas.
Sets the layout structure. Available values can be found in the `layout` field
in the options table above.
@ -420,6 +516,8 @@ redo. All commands are as follows:
| INSERT_MULTI_NODEv0.7.2+ | Insert multiple sibling nodes into the specified node at the same time, with the operating node being the currently active node or the specified node | appointNodesOptional, specify nodes, specify multiple nodes to pass an array, nodeListData list of newly inserted nodes, array type |
| INSERT_MULTI_CHILD_NODEv0.7.2+ | Insert multiple child nodes into the specified node simultaneously, with the operation node being the currently active node or the specified node | appointNodesOptional, specify nodes, specify multiple nodes to pass an array, childListData list of newly inserted nodes, array type |
| INSERT_FORMULAv0.7.2+ | Insert mathematical formulas into nodes, operate on the currently active node or specified node | formulaMathematical formula to insert, LaText syntax, appointNodesOptional, specify the node to insert the formula into. Multiple nodes can be passed as arrays, otherwise it defaults to the currently active node |
| INSERT_PARENT_NODEv0.8.0+ | Insert a parent node into the specified node, with the operation node being the currently active node or the specified node | openEditActivate the newly inserted node and enter editing mode, default to 'true'`)、 appointNodesOptional, specify the node to insert into the parent node, and specify that multiple nodes can pass an array、 appointDataOptional, specify the data for the newly created node, such as {text: 'xxx', ...}, Detailed structure can be referenced [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) |
| REMOVE_CURRENT_NODEv0.8.0+ | Delete only the current node, operate on the currently active node or specified node | appointNodesOptional, specify the nodes to be deleted, and multiple nodes can be passed as an array |
### setData(data)

File diff suppressed because it is too large Load Diff

View File

@ -56,6 +56,14 @@ Whether the node is currently being dragged
## Methods
### updateNodeByActive(active)
> v0.8.0+
- `active`Boolean, active status.
Update nodes based on whether they are activated or not. The main task is to update the display and hiding of the expand and collapse buttons for nodes.
### setOpacity(val)
> v0.7.2+

View File

@ -31,6 +31,14 @@
</blockquote>
<p>Whether the node is currently being dragged</p>
<h2>Methods</h2>
<h3>updateNodeByActive(active)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<ul>
<li><code>active</code>Boolean, active status.</li>
</ul>
<p>Update nodes based on whether they are activated or not. The main task is to update the display and hiding of the expand and collapse buttons for nodes.</p>
<h3>setOpacity(val)</h3>
<blockquote>
<p>v0.7.2+</p>

View File

@ -7,14 +7,20 @@ accessed through `mindMap.renderer`.
### activeNodeList
Gets the current list of active nodes
Gets the current list of active nodes.
### root
Gets the root node of the node tree
Gets the root node of the node tree.
## Methods
### setRootNodeCenter()
> v0.8.0+
Return to the central theme, that is, set the root node to the center of the canvas.
### setData(data)
> v0.7.3+
@ -23,49 +29,81 @@ Dynamically set mind map data.
### clearActive()
Clears the currently active node
> v0.8.0+ abandoned
Clears the currently active node.
### clearAllActive()
Clears all currently active nodes and triggers the `node_active` event
> v0.8.0+ abandoned
Clears all currently active nodes and triggers the `node_active` event.
### clearActiveNode()
> v0.8.0+
Clears all currently active nodes and triggers the `node_active` event.
### clearActiveNodeList()
> v0.8.0+
Clears all currently active nodes but not triggers the `node_active` event.
### startTextEdit()
> v0.1.6+
If there is a text editing requirement, this method can be called to
disable the enter key and delete key related shortcuts to prevent conflicts
disable the enter key and delete key related shortcuts to prevent conflicts.
### endTextEdit()
> v0.1.6+
End text editing, restore enter key and delete key related shortcuts
End text editing, restore enter key and delete key related shortcuts.
### addActiveNode(node)
Add a node to the active list
> v0.8.0+ abandoned
Add a node to the active list.
### addNodeToActiveList(node)
> v0.8.0+
Add a node to the active list.
### removeActiveNode(node)
Remove a node from the active list
> v0.8.0+ abandoned
Remove a node from the active list.
### removeNodeFromActiveList(node)
> v0.8.0+
Remove a node from the active list.
### findActiveNodeIndex(node)
Search for the index of a node in the active list
Search for the index of a node in the active list.
### getNodeIndex(node)
Get the position index of a node among its siblings
Get the position index of a node among its siblings.
### removeOneNode(node)
Delete a specific node
Delete a specific node.
### copyNode()
Copy a node, the active node is the node to be operated on, if there are
multiple active nodes, only the first node will be operated on
multiple active nodes, only the first node will be operated on.
### setNodeDataRender(node, data, notRender)
@ -73,25 +111,25 @@ multiple active nodes, only the first node will be operated on
Set node `data`, i.e. the data in the data field, and will determine whether the
node needs to be re-rendered based on whether the node size has changed, `data`
is an object, e.g. `{text: 'I am new text'}`
is an object, e.g. `{text: 'I am new text'}`.
### moveNodeTo(node, toNode)
> v0.1.5+
Move a node as a child of another node
Move a node as a child of another node.
### insertBefore(node, exist)
> v0.1.5+
Move a node in front of another node
Move a node in front of another node.
### insertAfter(node, exist)
> v0.1.5+
Move a node behind another node
Move a node behind another node.
### moveNodeToCenter(node)

View File

@ -5,65 +5,102 @@
accessed through <code>mindMap.renderer</code>.</p>
<h2>Properties</h2>
<h3>activeNodeList</h3>
<p>Gets the current list of active nodes</p>
<p>Gets the current list of active nodes.</p>
<h3>root</h3>
<p>Gets the root node of the node tree</p>
<p>Gets the root node of the node tree.</p>
<h2>Methods</h2>
<h3>setRootNodeCenter()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Return to the central theme, that is, set the root node to the center of the canvas.</p>
<h3>setData(data)</h3>
<blockquote>
<p>v0.7.3+</p>
</blockquote>
<p>Dynamically set mind map data.</p>
<h3>clearActive()</h3>
<p>Clears the currently active node</p>
<blockquote>
<p>v0.8.0+ abandoned</p>
</blockquote>
<p>Clears the currently active node.</p>
<h3>clearAllActive()</h3>
<p>Clears all currently active nodes and triggers the <code>node_active</code> event</p>
<blockquote>
<p>v0.8.0+ abandoned</p>
</blockquote>
<p>Clears all currently active nodes and triggers the <code>node_active</code> event.</p>
<h3>clearActiveNode()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Clears all currently active nodes and triggers the <code>node_active</code> event.</p>
<h3>clearActiveNodeList()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Clears all currently active nodes but not triggers the <code>node_active</code> event.</p>
<h3>startTextEdit()</h3>
<blockquote>
<p>v0.1.6+</p>
</blockquote>
<p>If there is a text editing requirement, this method can be called to
disable the enter key and delete key related shortcuts to prevent conflicts</p>
disable the enter key and delete key related shortcuts to prevent conflicts.</p>
<h3>endTextEdit()</h3>
<blockquote>
<p>v0.1.6+</p>
</blockquote>
<p>End text editing, restore enter key and delete key related shortcuts</p>
<p>End text editing, restore enter key and delete key related shortcuts.</p>
<h3>addActiveNode(node)</h3>
<p>Add a node to the active list</p>
<blockquote>
<p>v0.8.0+ abandoned</p>
</blockquote>
<p>Add a node to the active list.</p>
<h3>addNodeToActiveList(node)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Add a node to the active list.</p>
<h3>removeActiveNode(node)</h3>
<p>Remove a node from the active list</p>
<blockquote>
<p>v0.8.0+ abandoned</p>
</blockquote>
<p>Remove a node from the active list.</p>
<h3>removeNodeFromActiveList(node)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Remove a node from the active list.</p>
<h3>findActiveNodeIndex(node)</h3>
<p>Search for the index of a node in the active list</p>
<p>Search for the index of a node in the active list.</p>
<h3>getNodeIndex(node)</h3>
<p>Get the position index of a node among its siblings</p>
<p>Get the position index of a node among its siblings.</p>
<h3>removeOneNode(node)</h3>
<p>Delete a specific node</p>
<p>Delete a specific node.</p>
<h3>copyNode()</h3>
<p>Copy a node, the active node is the node to be operated on, if there are
multiple active nodes, only the first node will be operated on</p>
multiple active nodes, only the first node will be operated on.</p>
<h3>setNodeDataRender(node, data, notRender)</h3>
<ul>
<li><code>notRender</code>: v0.6.9+, <code>Boolean</code>, Default is <code>false</code>, Do not trigger rendering.</li>
</ul>
<p>Set node <code>data</code>, i.e. the data in the data field, and will determine whether the
node needs to be re-rendered based on whether the node size has changed, <code>data</code>
is an object, e.g. <code>{text: 'I am new text'}</code></p>
is an object, e.g. <code>{text: 'I am new text'}</code>.</p>
<h3>moveNodeTo(node, toNode)</h3>
<blockquote>
<p>v0.1.5+</p>
</blockquote>
<p>Move a node as a child of another node</p>
<p>Move a node as a child of another node.</p>
<h3>insertBefore(node, exist)</h3>
<blockquote>
<p>v0.1.5+</p>
</blockquote>
<p>Move a node in front of another node</p>
<p>Move a node in front of another node.</p>
<h3>insertAfter(node, exist)</h3>
<blockquote>
<p>v0.1.5+</p>
</blockquote>
<p>Move a node behind another node</p>
<p>Move a node behind another node.</p>
<h3>moveNodeToCenter(node)</h3>
<blockquote>
<p>v0.2.17+</p>

View File

@ -68,6 +68,14 @@ Replace the built-in font size list during rich text editing. The built-in list
## Method
### setNotActiveNodeStyle(node, style)
> v0.8.0+
- `style`Object, style object.
Set rich text style for inactive nodes.
### selectAll()
Select All. When the node is being edited, you can select all the text in the node through this method.

View File

@ -56,6 +56,14 @@ MindMap.usePlugin(RichText, opt?)
<pre class="hljs"><code>[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, ..<span class="hljs-number">.100</span>]
</code></pre>
<h2>Method</h2>
<h3>setNotActiveNodeStyle(node, style)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<ul>
<li><code>style</code>Object, style object.</li>
</ul>
<p>Set rich text style for inactive nodes.</p>
<h3>selectAll()</h3>
<p>Select All. When the node is being edited, you can select all the text in the node through this method.</p>
<h3>focus()</h3>

View File

@ -363,6 +363,45 @@ Generate colors based on incoming content, and the same content will generate th
Determine whether two objects are the same, only handling objects or arrays.
#### getNodeDataIndex(node)
> v0.8.0+
Gets the position index of a node within its sibling nodes.
#### getNodeIndexInNodeList(node, nodeList)
> v0.8.0+
Find the index of a node from a list of nodes.
#### setDataToClipboard(data)
> v0.8.0+
- `data`Object | Array
Set data to the user clipboard.
#### getDataFromClipboard()
> v0.8.0+
Reading text and images from the user's clipboard returns:
```js
{
text,
img
}
```
#### removeFromParentNodeData(node)
> v0.8.0+
Remove the data of a node from its parent node's `nodeData.children` list.
## Simulate CSS background in Canvas
Import:

View File

@ -295,6 +295,39 @@ and copying the <code>data</code> of the data object, example:</p>
<li><code>a</code><code>b</code>: Object | Array, Two objects to compare</li>
</ul>
<p>Determine whether two objects are the same, only handling objects or arrays.</p>
<h4>getNodeDataIndex(node)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Gets the position index of a node within its sibling nodes.</p>
<h4>getNodeIndexInNodeList(node, nodeList)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Find the index of a node from a list of nodes.</p>
<h4>setDataToClipboard(data)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<ul>
<li><code>data</code>Object | Array</li>
</ul>
<p>Set data to the user clipboard.</p>
<h4>getDataFromClipboard()</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Reading text and images from the user's clipboard returns:</p>
<pre class="hljs"><code>{
text,
img
}
</code></pre>
<h4>removeFromParentNodeData(node)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>Remove the data of a node from its parent node's <code>nodeData.children</code> list.</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">&#x27;simple-mind-map/src/utils/simulateCSSBackgroundInCanvas&#x27;</span>

View File

@ -87,4 +87,16 @@ MindMap.usePlugin(AssociativeLine)
### clearActiveLine()
清除当前激活的关联线的激活状态。
清除当前激活的关联线的激活状态。
### front()
> v0.8.0+
关联线顶层显示。
### back()
> v0.8.0+
关联线回到原有层级。

View File

@ -66,6 +66,16 @@ MindMap.usePlugin(AssociativeLine)
<p>删除当前激活的关联线点击某条关联线则视为激活</p>
<h3>clearActiveLine()</h3>
<p>清除当前激活的关联线的激活状态</p>
<h3>front()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>关联线顶层显示</p>
<h3>back()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>关联线回到原有层级</p>
</div>
</template>

View File

@ -1,5 +1,51 @@
# Changelog
## 0.8.0
破坏性更新:大幅优化部分代码,小幅提升性能,主要是`render`类,删除无用逻辑、调整不合理的实现、提取重复代码;修改函数名称、函数功能等。
修复:
> 修复导出图片和svg时关联线的箭头消失的问题。
>
> 修复调整容器大小后回到根节点的操作异常的问题。
>
> 修复插入概要、上移、下移、一键整理布局的快捷键操作没有触发data_change事件的问题。
新增:
> 优化画布DOM结构将节点、连线、关联线分层渲染。
>
> 优化水印插件。
>
> setTheme、setThemeConfig、setLayout函数增加不触发重新渲染的参数。
>
> 新增插入父节点的命令。
>
> 新增仅删除当前节点的命令。
>
> 插入概要时自动展开子节点。
>
> 鼠标右键单击画布时清除当前激活节点。
>
> 被收起的激活节点同步从激活节点列表里删除。
>
> 粘贴带换行的文本支持控制是否按换行分割节点。
Demo
> 修改回到根节点的方法及文案。
>
> 修复覆盖方式切换主题时第一次切换不生效的问题。
>
> 右键菜单新增插入父节点和仅删除当前节点的功能。
>
> 顶部工具栏支持根据窗口宽度自动收起到更多中。
>
> 支持手动输入缩放倍数。
>
> 完善界面英文翻译。
## 0.7.3-fix.2
修复协同编辑的一些问题:

View File

@ -1,6 +1,35 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.8.0</h2>
<p>破坏性更新大幅优化部分代码小幅提升性能主要是<code>render</code>删除无用逻辑调整不合理的实现提取重复代码修改函数名称函数功能等</p>
<p>修复</p>
<blockquote>
<p>修复导出图片和svg时关联线的箭头消失的问题</p>
<p>修复调整容器大小后回到根节点的操作异常的问题</p>
<p>修复插入概要上移下移一键整理布局的快捷键操作没有触发data_change事件的问题</p>
</blockquote>
<p>新增</p>
<blockquote>
<p>优化画布DOM结构将节点连线关联线分层渲染</p>
<p>优化水印插件</p>
<p>setThemesetThemeConfigsetLayout函数增加不触发重新渲染的参数</p>
<p>新增插入父节点的命令</p>
<p>新增仅删除当前节点的命令</p>
<p>插入概要时自动展开子节点</p>
<p>鼠标右键单击画布时清除当前激活节点</p>
<p>被收起的激活节点同步从激活节点列表里删除</p>
<p>粘贴带换行的文本支持控制是否按换行分割节点</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>修改回到根节点的方法及文案</p>
<p>修复覆盖方式切换主题时第一次切换不生效的问题</p>
<p>右键菜单新增插入父节点和仅删除当前节点的功能</p>
<p>顶部工具栏支持根据窗口宽度自动收起到更多中</p>
<p>支持手动输入缩放倍数</p>
<p>完善界面英文翻译</p>
</blockquote>
<h2>0.7.3-fix.2</h2>
<p>修复协同编辑的一些问题</p>
<p>1.插入同级节点时新节点位置不正确</p>

View File

@ -82,7 +82,8 @@ const mindMap = new MindMap({
| errorHandlerv0.6.15+ | Function | | 自定义错误处理函数,目前只会抛出一些异步逻辑出错的情况。可以传递一个函数,会接收两个参数,第一个为错误的类型,第二个为错误对象 |
| disableMouseWheelZoomv0.6.15+ | Boolean | false | 禁止鼠标滚轮缩放你仍旧可以使用api进行缩放 |
| resetCssv0.6.16+ | String | * { margin: 0; padding: 0; box-sizing: border-box; } | 设置导出图片和svg时针对富文本节点内容也就是嵌入到svg中的html节点的默认样式覆盖如果不覆盖节点内容会发生偏移 |
| enableDblclickResetv0.6.17+ | Boolean | truev0.7.0+改为false | 开启鼠标双击复位思维导图位置及缩放 |
| enableDblclickResetv0.6.17+v0.8.0+已删除该属性) | Boolean | truev0.7.0+改为false | 开启鼠标双击复位思维导图位置及缩放 |
| enableDblclickBackToRootNodev0.8.0+ | Boolean | false | 是否在鼠标双击时回到根节点,也就是让根节点居中显示 |
| minExportImgCanvasScalev0.7.0+ | Number | 2 | 导出图片和pdf时canvas的缩放倍数该配置会和window.devicePixelRatio值取最大值用于提升图片清晰度 |
| hoverRectColorv0.7.0+ | String | rgb(94, 200, 248) | 节点鼠标hover和激活时显示的矩形边框颜色hover时会添加0.6的透明度 |
| hoverRectPaddingv0.7.0+ | Number | 2 | 节点鼠标hover和激活时显示的矩形边框距节点内容的距离 |
@ -95,6 +96,9 @@ const mindMap = new MindMap({
| dragOpacityConfigv0.7.2+ | Object | { cloneNodeOpacity: 0.5, beingDragNodeOpacity: 0.3 } | 节点拖拽时的透明度配置,传递一个对象,字段含义分别为:跟随鼠标移动的克隆节点或矩形的透明度、被拖拽节点的透明度 |
| tagsColorMapv0.7.2+ | Object | {} | 自定义节点标签的颜色可传一个对象key为要指定颜色的标签内容value为该标签内容的颜色如果不传内部会根据标签内容生成对应的颜色 |
| cooperateStylev0.7.3+ | Object | { avatarSize: 22, fontSize: 12 } | 节点协作编辑时的人员头像样式配置,字段含义分别为:头像大小、如果是文字头像,那么文字的大小 |
| associativeLineIsAlwaysAboveNodev0.8.0+ | Boolean | true | 关联线是否始终显示在节点上层如果设为false那么创建关联线和激活关联线时处于最顶层其他情况下处于节点下方 |
| defaultGeneralizationTextv0.8.0+ | String | 概要 | 插入概要的默认文本 |
| handleIsSplitByWrapOnPasteCreateNewNodev0.8.0+ | Function | null | null | 粘贴文本的方式创建新节点时控制是否按换行自动分割节点即如果存在换行那么会根据换行创建多个节点否则只会创建一个节点可以传递一个函数返回promiseresolve代表根据换行分割reject代表忽略换行 |
### 数据结构
@ -210,8 +214,96 @@ mindMap.setTheme('主题名称')
当前注册的所有插件列表。
## 实例属性
### el
容器元素。
### opt
配置选项对象。
### svg
> @svgdotjs/svg.js库调用SVG()方法返回的节点实例
画布svg元素。
### draw
> @svgdotjs/svg.js库调用group()方法返回的节点实例
>
> svg节点的子节点
容器元素,用于承载节点、连线等内容。
### lineDraw
> v0.8.0+
>
> @svgdotjs/svg.js库调用group()方法返回的节点实例
>
> draw节点的子节点
节点连线元素的容器。
### nodeDraw
> v0.8.0+
>
> @svgdotjs/svg.js库调用group()方法返回的节点实例
>
> draw节点的子节点
节点元素的容器。
### associativeLineDraw
> v0.8.0+
>
> @svgdotjs/svg.js库调用group()方法返回的节点实例
>
> 在注册了关联线插件的情况下可用
>
> draw节点的子节点
关联线内容的容器。
### otherDraw
> v0.8.0+
>
> @svgdotjs/svg.js库调用group()方法返回的节点实例
>
> draw节点的子节点
其他内容的容器。
### elRect
容器元素`el`的尺寸、位置信息。调用`getBoundingClientRect()`方法的返回结果。
### width
容器元素`el`的宽度。
### height
容器元素`el`的高度。
### themeConfig
当前主题配置。
## 实例方法
### clearDraw()
> v0.8.0+
清空`lineDraw`、`associativeLineDraw`、`nodeDraw`、`otherDraw`容器。
### destroy()
> v0.6.0+
@ -318,7 +410,9 @@ mindMap.setTheme('主题名称')
解绑事件
### setTheme(theme)
### setTheme(theme, notRender = false)
- `notRender`v0.8.0+是否不要调用render方法更新画布。
切换主题,可选主题见上面的选项表格
@ -326,7 +420,9 @@ mindMap.setTheme('主题名称')
获取当前主题
### setThemeConfig(config)
### setThemeConfig(config, notRender = false)
- `notRender`v0.8.0+是否不要调用render方法更新画布。
设置主题配置,`config`同上面选项表格里的选项`themeConfig`
@ -366,7 +462,9 @@ mindMap.updateConfig({
获取当前的布局结构
### setLayout(layout)
### setLayout(layout, notRender = false)
- `notRender`v0.8.0+是否不要调用render方法更新画布。
设置布局结构,可选值见上面选项表格的`layout`字段
@ -413,6 +511,8 @@ mindMap.updateConfig({
| INSERT_MULTI_NODEv0.7.2+ | 给指定的节点同时插入多个同级节点,操作节点为当前激活的节点或指定节点 | appointNodes可选指定节点指定多个节点可以传一个数组, nodeList新插入节点的数据列表数组类型 |
| INSERT_MULTI_CHILD_NODEv0.7.2+ | 给指定的节点同时插入多个子节点,操作节点为当前激活的节点或指定节点 | appointNodes可选指定节点指定多个节点可以传一个数组, childList新插入节点的数据列表数组类型 |
| INSERT_FORMULAv0.7.2+ | 给节点插入数学公式,操作节点为当前激活的节点或指定节点 | formula要插入的数学公式LaText语法, appointNodes可选指定要插入公式的节点多个节点可以传数组否则默认为当前激活的节点 |
| INSERT_PARENT_NODEv0.8.0+ | 给指定的节点插入父节点,操作节点为当前激活的节点或指定节点 | openEdit是否激活新插入的节点并进入编辑模式默认为`true`)、 appointNodes可选指定要插入父节点的节点指定多个节点可以传一个数组、 appointData可选指定新创建节点的数据比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) |
| REMOVE_CURRENT_NODEv0.8.0+ | 仅删除当前节点,操作节点为当前激活的节点或指定节点 | appointNodes可选指定要删除的节点指定多个节点可以传一个数组 |
### setData(data)

View File

@ -376,12 +376,18 @@
<td>设置导出图片和svg时针对富文本节点内容也就是嵌入到svg中的html节点的默认样式覆盖如果不覆盖节点内容会发生偏移</td>
</tr>
<tr>
<td>enableDblclickResetv0.6.17+</td>
<td>enableDblclickResetv0.6.17+v0.8.0+已删除该属性</td>
<td>Boolean</td>
<td>truev0.7.0+改为false</td>
<td>开启鼠标双击复位思维导图位置及缩放</td>
</tr>
<tr>
<td>enableDblclickBackToRootNodev0.8.0+</td>
<td>Boolean</td>
<td>false</td>
<td>是否在鼠标双击时回到根节点也就是让根节点居中显示</td>
</tr>
<tr>
<td>minExportImgCanvasScalev0.7.0+</td>
<td>Number</td>
<td>2</td>
@ -453,6 +459,24 @@
<td>{ avatarSize: 22, fontSize: 12 }</td>
<td>节点协作编辑时的人员头像样式配置字段含义分别为头像大小如果是文字头像那么文字的大小</td>
</tr>
<tr>
<td>associativeLineIsAlwaysAboveNodev0.8.0+</td>
<td>Boolean</td>
<td>true</td>
<td>关联线是否始终显示在节点上层如果设为false那么创建关联线和激活关联线时处于最顶层其他情况下处于节点下方</td>
</tr>
<tr>
<td>defaultGeneralizationTextv0.8.0+</td>
<td>String</td>
<td>概要</td>
<td>插入概要的默认文本</td>
</tr>
<tr>
<td>handleIsSplitByWrapOnPasteCreateNewNodev0.8.0+</td>
<td>Function</td>
<td>null</td>
<td>null</td>
</tr>
</tbody>
</table>
<h3>数据结构</h3>
@ -607,7 +631,65 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
<p>v0.3.0+</p>
</blockquote>
<p>当前注册的所有插件列表</p>
<h2>实例属性</h2>
<h3>el</h3>
<p>容器元素</p>
<h3>opt</h3>
<p>配置选项对象</p>
<h3>svg</h3>
<blockquote>
<p>@svgdotjs/svg.js库调用SVG()方法返回的节点实例</p>
</blockquote>
<p>画布svg元素</p>
<h3>draw</h3>
<blockquote>
<p>@svgdotjs/svg.js库调用group()方法返回的节点实例</p>
<p>svg节点的子节点</p>
</blockquote>
<p>容器元素用于承载节点连线等内容</p>
<h3>lineDraw</h3>
<blockquote>
<p>v0.8.0+</p>
<p>@svgdotjs/svg.js库调用group()方法返回的节点实例</p>
<p>draw节点的子节点</p>
</blockquote>
<p>节点连线元素的容器</p>
<h3>nodeDraw</h3>
<blockquote>
<p>v0.8.0+</p>
<p>@svgdotjs/svg.js库调用group()方法返回的节点实例</p>
<p>draw节点的子节点</p>
</blockquote>
<p>节点元素的容器</p>
<h3>associativeLineDraw</h3>
<blockquote>
<p>v0.8.0+</p>
<p>@svgdotjs/svg.js库调用group()方法返回的节点实例</p>
<p>在注册了关联线插件的情况下可用</p>
<p>draw节点的子节点</p>
</blockquote>
<p>关联线内容的容器</p>
<h3>otherDraw</h3>
<blockquote>
<p>v0.8.0+</p>
<p>@svgdotjs/svg.js库调用group()方法返回的节点实例</p>
<p>draw节点的子节点</p>
</blockquote>
<p>其他内容的容器</p>
<h3>elRect</h3>
<p>容器元素<code>el</code>的尺寸位置信息调用<code>getBoundingClientRect()</code>方法的返回结果</p>
<h3>width</h3>
<p>容器元素<code>el</code>的宽度</p>
<h3>height</h3>
<p>容器元素<code>el</code>的高度</p>
<h3>themeConfig</h3>
<p>当前主题配置</p>
<h2>实例方法</h2>
<h3>clearDraw()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>清空<code>lineDraw</code><code>associativeLineDraw</code><code>nodeDraw</code><code>otherDraw</code>容器</p>
<h3>destroy()</h3>
<blockquote>
<p>v0.6.0+</p>
@ -860,11 +942,17 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
<p>触发事件可以是上面表格里的事件也可以是自定义事件</p>
<h3>off(event, fn)</h3>
<p>解绑事件</p>
<h3>setTheme(theme)</h3>
<h3>setTheme(theme, notRender = false)</h3>
<ul>
<li><code>notRender</code>v0.8.0+是否不要调用render方法更新画布</li>
</ul>
<p>切换主题可选主题见上面的选项表格</p>
<h3>getTheme()</h3>
<p>获取当前主题</p>
<h3>setThemeConfig(config)</h3>
<h3>setThemeConfig(config, notRender = false)</h3>
<ul>
<li><code>notRender</code>v0.8.0+是否不要调用render方法更新画布</li>
</ul>
<p>设置主题配置<code>config</code>同上面选项表格里的选项<code>themeConfig</code></p>
<h3>getCustomThemeConfig()</h3>
<p>获取自定义主题配置</p>
@ -889,7 +977,10 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
<p>该方法只做更新配置的事情没有其他副作用比如触发画布重新渲染之类的</p>
<h3>getLayout()</h3>
<p>获取当前的布局结构</p>
<h3>setLayout(layout)</h3>
<h3>setLayout(layout, notRender = false)</h3>
<ul>
<li><code>notRender</code>v0.8.0+是否不要调用render方法更新画布</li>
</ul>
<p>设置布局结构可选值见上面选项表格的<code>layout</code>字段</p>
<h3>execCommand(name, ...args)</h3>
<p>执行命令每执行一个命令就会在历史堆栈里添加一条记录用于回退或前进所有命令如下</p>
@ -1087,6 +1178,16 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
<td>给节点插入数学公式操作节点为当前激活的节点或指定节点</td>
<td>formula要插入的数学公式LaText语法, appointNodes可选指定要插入公式的节点多个节点可以传数组否则默认为当前激活的节点</td>
</tr>
<tr>
<td>INSERT_PARENT_NODEv0.8.0+</td>
<td>给指定的节点插入父节点操作节点为当前激活的节点或指定节点</td>
<td>openEdit是否激活新插入的节点并进入编辑模式默认为<code>true</code> appointNodes可选指定要插入父节点的节点指定多个节点可以传一个数组 appointData可选指定新创建节点的数据比如{text: 'xxx', ...}详细结构可以参考<a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a></td>
</tr>
<tr>
<td>REMOVE_CURRENT_NODEv0.8.0+</td>
<td>仅删除当前节点操作节点为当前激活的节点或指定节点</td>
<td>appointNodes可选指定要删除的节点指定多个节点可以传一个数组</td>
</tr>
</tbody>
</table>
<h3>setData(data)</h3>

View File

@ -56,6 +56,14 @@
## 方法
### updateNodeByActive(active)
> v0.8.0+
- `active`Boolean激活状态。
根据是否激活更新节点。主要是更新节点的展开收起按钮的显示隐藏。
### setOpacity(val)
> v0.7.2+

View File

@ -31,6 +31,14 @@
</blockquote>
<p>节点是否正在拖拽中</p>
<h2>方法</h2>
<h3>updateNodeByActive(active)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<ul>
<li><code>active</code>Boolean激活状态</li>
</ul>
<p>根据是否激活更新节点主要是更新节点的展开收起按钮的显示隐藏</p>
<h3>setOpacity(val)</h3>
<blockquote>
<p>v0.7.2+</p>

View File

@ -1,19 +1,25 @@
# Render实例
`render`实例负载整个渲染过程,可通过`mindMap.renderer`获取到
`render`实例负载整个渲染过程,可通过`mindMap.renderer`获取到
## 属性
### activeNodeList
获取当前激活的节点列表
获取当前激活的节点列表
### root
获取节点树的根节点
获取节点树的根节点
## 方法
### setRootNodeCenter()
> v0.8.0+
回到中心主题,即设置根节点到画布中心。
### setData(data)
> v0.7.3+
@ -22,67 +28,103 @@
### clearActive()
清除当前激活的节点
> v0.8.0+已废弃
清除当前激活的节点。
### clearAllActive()
清除当前所有激活节点,并会触发`node_active`事件
> v0.8.0+已废弃
清除当前所有激活节点,并会触发`node_active`事件 。
### clearActiveNode()
> v0.8.0+
清除当前所有激活节点,并会触发`node_active`事件 。
### clearActiveNodeList()
> v0.8.0+
清除当前激活的节点列表。不会触发`node_active`事件 。
### startTextEdit()
v0.1.6+)若有文字编辑需求可调用该方法,会禁用回车键和删除键相关快捷键防止冲突
> v0.1.6+
若有文字编辑需求可调用该方法,会禁用回车键和删除键相关快捷键防止冲突 。
### endTextEdit()
v0.1.6+)结束文字编辑,会恢复回车键和删除键相关快捷键
> v0.1.6+
结束文字编辑,会恢复回车键和删除键相关快捷键。
### addActiveNode(node)
添加节点到激活列表里
> v0.8.0+已废弃
添加节点到激活列表里。
### addNodeToActiveList(node)
> v0.8.0+
添加节点到激活列表里。
### removeActiveNode(node)
在激活列表里移除某个节点
> v0.8.0+已废弃
在激活列表里移除某个节点。
### removeNodeFromActiveList(node)
> v0.8.0+
在激活列表里移除某个节点。
### findActiveNodeIndex(node)
检索某个节点在激活列表里的索引
检索某个节点在激活列表里的索引
### getNodeIndex(node)
获取节点在同级里的位置索引
获取节点在同级里的位置索引
### removeOneNode(node)
删除某个指定节点
删除某个指定节点
### copyNode()
复制节点,操作节点为当前激活节点,有多个激活节点只会操作第一个节点
复制节点,操作节点为当前激活节点,有多个激活节点只会操作第一个节点
### setNodeDataRender(node, data, notRender)
- `notRender`v0.6.9+`Boolean`,默认为`false`,是否不要触发渲染。
设置节点数据,即`data`字段的数据,并会根据节点大小是否变化来判断是否需要重新渲染该节点,`data`为对象,如:`{text: '我是新文本'}`
设置节点数据,即`data`字段的数据,并会根据节点大小是否变化来判断是否需要重新渲染该节点,`data`为对象,如:`{text: '我是新文本'}`
### moveNodeTo(node, toNode)
> v0.1.5+
移动一个节点作为另一个节点的子节点
移动一个节点作为另一个节点的子节点
### insertBefore(node, exist)
> v0.1.5+
将节点移动到另一个节点的前面
将节点移动到另一个节点的前面
### insertAfter(node, exist)
> v0.1.5+
将节点移动到另一个节点的后面
将节点移动到另一个节点的后面
### moveNodeToCenter(node)

View File

@ -1,58 +1,101 @@
<template>
<div>
<h1>Render实例</h1>
<p><code>render</code>实例负载整个渲染过程可通过<code>mindMap.renderer</code>获取到</p>
<p><code>render</code>实例负载整个渲染过程可通过<code>mindMap.renderer</code>获取到</p>
<h2>属性</h2>
<h3>activeNodeList</h3>
<p>获取当前激活的节点列表</p>
<p>获取当前激活的节点列表</p>
<h3>root</h3>
<p>获取节点树的根节点</p>
<p>获取节点树的根节点</p>
<h2>方法</h2>
<h3>setRootNodeCenter()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>回到中心主题即设置根节点到画布中心</p>
<h3>setData(data)</h3>
<blockquote>
<p>v0.7.3+</p>
</blockquote>
<p>动态设置思维导图数据</p>
<h3>clearActive()</h3>
<p>清除当前激活的节点</p>
<blockquote>
<p>v0.8.0+已废弃</p>
</blockquote>
<p>清除当前激活的节点</p>
<h3>clearAllActive()</h3>
<p>清除当前所有激活节点并会触发<code>node_active</code>事件</p>
<blockquote>
<p>v0.8.0+已废弃</p>
</blockquote>
<p>清除当前所有激活节点并会触发<code>node_active</code>事件 </p>
<h3>clearActiveNode()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>清除当前所有激活节点并会触发<code>node_active</code>事件 </p>
<h3>clearActiveNodeList()</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>清除当前激活的节点列表不会触发<code>node_active</code>事件 </p>
<h3>startTextEdit()</h3>
<p>v0.1.6+若有文字编辑需求可调用该方法会禁用回车键和删除键相关快捷键防止冲突</p>
<blockquote>
<p>v0.1.6+</p>
</blockquote>
<p>若有文字编辑需求可调用该方法会禁用回车键和删除键相关快捷键防止冲突 </p>
<h3>endTextEdit()</h3>
<p>v0.1.6+结束文字编辑会恢复回车键和删除键相关快捷键</p>
<blockquote>
<p>v0.1.6+</p>
</blockquote>
<p>结束文字编辑会恢复回车键和删除键相关快捷键</p>
<h3>addActiveNode(node)</h3>
<p>添加节点到激活列表里</p>
<blockquote>
<p>v0.8.0+已废弃</p>
</blockquote>
<p>添加节点到激活列表里</p>
<h3>addNodeToActiveList(node)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>添加节点到激活列表里</p>
<h3>removeActiveNode(node)</h3>
<p>在激活列表里移除某个节点</p>
<blockquote>
<p>v0.8.0+已废弃</p>
</blockquote>
<p>在激活列表里移除某个节点</p>
<h3>removeNodeFromActiveList(node)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>在激活列表里移除某个节点</p>
<h3>findActiveNodeIndex(node)</h3>
<p>检索某个节点在激活列表里的索引</p>
<p>检索某个节点在激活列表里的索引</p>
<h3>getNodeIndex(node)</h3>
<p>获取节点在同级里的位置索引</p>
<p>获取节点在同级里的位置索引</p>
<h3>removeOneNode(node)</h3>
<p>删除某个指定节点</p>
<p>删除某个指定节点</p>
<h3>copyNode()</h3>
<p>复制节点操作节点为当前激活节点有多个激活节点只会操作第一个节点</p>
<p>复制节点操作节点为当前激活节点有多个激活节点只会操作第一个节点</p>
<h3>setNodeDataRender(node, data, notRender)</h3>
<ul>
<li><code>notRender</code>v0.6.9+<code>Boolean</code>默认为<code>false</code>是否不要触发渲染</li>
</ul>
<p>设置节点数据<code>data</code>字段的数据并会根据节点大小是否变化来判断是否需要重新渲染该节点<code>data</code>为对象<code>{text: '我是新文本'}</code></p>
<p>设置节点数据<code>data</code>字段的数据并会根据节点大小是否变化来判断是否需要重新渲染该节点<code>data</code>为对象<code>{text: '我是新文本'}</code></p>
<h3>moveNodeTo(node, toNode)</h3>
<blockquote>
<p>v0.1.5+</p>
</blockquote>
<p>移动一个节点作为另一个节点的子节点</p>
<p>移动一个节点作为另一个节点的子节点</p>
<h3>insertBefore(node, exist)</h3>
<blockquote>
<p>v0.1.5+</p>
</blockquote>
<p>将节点移动到另一个节点的前面</p>
<p>将节点移动到另一个节点的前面</p>
<h3>insertAfter(node, exist)</h3>
<blockquote>
<p>v0.1.5+</p>
</blockquote>
<p>将节点移动到另一个节点的后面</p>
<p>将节点移动到另一个节点的后面</p>
<h3>moveNodeToCenter(node)</h3>
<blockquote>
<p>v0.2.17+</p>

View File

@ -68,6 +68,14 @@ MindMap.usePlugin(RichText, opt?)
## 方法
### setNotActiveNodeStyle(node, style)
> v0.8.0+
- `style`Object样式对象。
给未激活的节点设置富文本样式。
### selectAll()
选中全部。当节点正在编辑中可以通过该方法选中节点内的所有文本。

View File

@ -56,6 +56,14 @@ MindMap.usePlugin(RichText, opt?)
<pre class="hljs"><code>[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, ..<span class="hljs-number">.100</span>]
</code></pre>
<h2>方法</h2>
<h3>setNotActiveNodeStyle(node, style)</h3>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<ul>
<li><code>style</code>Object样式对象</li>
</ul>
<p>给未激活的节点设置富文本样式</p>
<h3>selectAll()</h3>
<p>选中全部当节点正在编辑中可以通过该方法选中节点内的所有文本</p>
<h3>focus()</h3>

View File

@ -358,6 +358,45 @@ copyNodeTree({}, node)
判断两个对象是否相同,只处理对象或数组。
#### getNodeDataIndex(node)
> v0.8.0+
获取节点在兄弟节点中的位置索引。
#### getNodeIndexInNodeList(node, nodeList)
> v0.8.0+
从一个节点列表里找出某个节点的索引。
#### setDataToClipboard(data)
> v0.8.0+
- `data`Object | Array
将数据设置到用户剪切板中。
#### getDataFromClipboard()
> v0.8.0+
从用户剪贴板中读取文字和图片,返回:
```js
{
text,
img
}
```
#### removeFromParentNodeData(node)
> v0.8.0+
从节点的父节点的`nodeData.children`列表中移除该节点的数据。
## 在canvas中模拟css的背景属性
引入:

View File

@ -290,6 +290,39 @@
<li><code>a</code><code>b</code>Object | Array, 要进行对比的两个对象</li>
</ul>
<p>判断两个对象是否相同只处理对象或数组</p>
<h4>getNodeDataIndex(node)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>获取节点在兄弟节点中的位置索引</p>
<h4>getNodeIndexInNodeList(node, nodeList)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>从一个节点列表里找出某个节点的索引</p>
<h4>setDataToClipboard(data)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<ul>
<li><code>data</code>Object | Array</li>
</ul>
<p>将数据设置到用户剪切板中</p>
<h4>getDataFromClipboard()</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>从用户剪贴板中读取文字和图片返回</p>
<pre class="hljs"><code>{
text,
img
}
</code></pre>
<h4>removeFromParentNodeData(node)</h4>
<blockquote>
<p>v0.8.0+</p>
</blockquote>
<p>从节点的父节点的<code>nodeData.children</code>列表中移除该节点的数据</p>
<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">&#x27;simple-mind-map/src/utils/simulateCSSBackgroundInCanvas&#x27;</span>