Doc: update

This commit is contained in:
街角小林 2023-12-26 18:26:45 +08:00
parent 06ad8cfbf6
commit 5739fae4f7
21 changed files with 284 additions and 35 deletions

View File

@ -220,7 +220,6 @@ class Export {
const { str } = await this.getSvgData()
const svgUrl = await this.fixSvgStrAndToBlob(str)
const res = await this.svgToPng(svgUrl, transparent)
console.log(res)
return res
}

View File

@ -13,6 +13,24 @@ Fix:
> 4.Fix the issue of the canvas moving in the opposite direction when scrolling horizontally with the mouse or touchpad.
>
> 5.Fix the issue where the mouse in flag is not reset when a node is destroyed.
>
> 6.Fix the issue of incorrect position calculation in the scrollbar plugin when the 'initRootNodePosition' configuration is not set to the default '[center, center]'.
>
> 7.Fix the issue where dragging the canvas cannot stop when the mouse is released on the node.
>
> 8.Fix the issue of errors in the position calculated by the view. fit method when the canvas container is not 0 from the top left corner of the browser window.
>
> 9.Fix the issue where the watermark in the exported image does not fully cover the entire image when there are a large number of nodes.
>
> 10.Fix the issue of inserting formula errors.
>
> 11.Fix the issue of losing the selected text status when the mouse moves out of the editing box while selecting text in the node text editing state.
>
> 12.When repairing node rich text editing, Fix the issue 'rich_text_selection_change' event is not triggered when the text selection range is 'null'.
>
> 13.Fix the issue of no 'node' instance in the 'node_dragging' event callback.
>
> 14.Fix the issue of too many nodes and the canvas size being too large to export PNG.
New:
@ -21,6 +39,28 @@ New:
> 2.The TextEdit class adds the isShowTextEdit method to determine whether the current node is in an editing state.
>
> 3.Change the paste method of the render class to support pasting clipboard data.
>
> 4.Add a configuration option to restrict mind map graphics within the canvas.
>
> 5.When registering the scrollbar plugin, it supports configuring whether to restrict the mind map within the canvas.
>
> 6.Folding all nodes will move the mind map root node to the center of the canvas.
>
> 7.Support the configuration option of displaying watermarks only during export.
>
> 8.When pasting images from the clipboard at a node, custom processing functions are supported to upload the images to your server.
>
> 9.Refactoring the export logic of the PDF, the exported PDF size is no longer a fixed A4, but the size of the mind map, while deleting the configuration for pagination export.
>
> 10.Node connections support displaying arrows as a field for the theme.
>
> 11.The maximum number of historical records is adjusted to 500 by default.
Demo
> 1.Support configuration to display watermarks only during export.
>
> 2.Basic style configuration line supports displaying arrows.
## 0.9.1-fix.2

View File

@ -9,12 +9,34 @@
<p>3.Fix the issue of duplicate rendering of nodes caused by forward and backward when the number of nodes exceeds the maximum number of cache pools.</p>
<p>4.Fix the issue of the canvas moving in the opposite direction when scrolling horizontally with the mouse or touchpad.</p>
<p>5.Fix the issue where the mouse in flag is not reset when a node is destroyed.</p>
<p>6.Fix the issue of incorrect position calculation in the scrollbar plugin when the 'initRootNodePosition' configuration is not set to the default '[center, center]'.</p>
<p>7.Fix the issue where dragging the canvas cannot stop when the mouse is released on the node.</p>
<p>8.Fix the issue of errors in the position calculated by the view. fit method when the canvas container is not 0 from the top left corner of the browser window.</p>
<p>9.Fix the issue where the watermark in the exported image does not fully cover the entire image when there are a large number of nodes.</p>
<p>10.Fix the issue of inserting formula errors.</p>
<p>11.Fix the issue of losing the selected text status when the mouse moves out of the editing box while selecting text in the node text editing state.</p>
<p>12.When repairing node rich text editing, Fix the issue 'rich_text_selection_change' event is not triggered when the text selection range is 'null'.</p>
<p>13.Fix the issue of no 'node' instance in the 'node_dragging' event callback.</p>
<p>14.Fix the issue of too many nodes and the canvas size being too large to export PNG.</p>
</blockquote>
<p>New:</p>
<blockquote>
<p>1.Modify the mousewheel event, change the dir flag to dirs, support storing multiple directions, and optimize the dual finger movement operation of the touchpad.</p>
<p>2.The TextEdit class adds the isShowTextEdit method to determine whether the current node is in an editing state.</p>
<p>3.Change the paste method of the render class to support pasting clipboard data.</p>
<p>4.Add a configuration option to restrict mind map graphics within the canvas.</p>
<p>5.When registering the scrollbar plugin, it supports configuring whether to restrict the mind map within the canvas.</p>
<p>6.Folding all nodes will move the mind map root node to the center of the canvas.</p>
<p>7.Support the configuration option of displaying watermarks only during export.</p>
<p>8.When pasting images from the clipboard at a node, custom processing functions are supported to upload the images to your server.</p>
<p>9.Refactoring the export logic of the PDF, the exported PDF size is no longer a fixed A4, but the size of the mind map, while deleting the configuration for pagination export.</p>
<p>10.Node connections support displaying arrows as a field for the theme.</p>
<p>11.The maximum number of historical records is adjusted to 500 by default.</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.Support configuration to display watermarks only during export.</p>
<p>2.Basic style configuration line supports displaying arrows.</p>
</blockquote>
<h2>0.9.1-fix.2</h2>
<p>Fix:</p>

View File

@ -61,7 +61,7 @@ const mindMap = new MindMap({
| nodeTextEditZIndexv0.5.5+ | Number | 3000 | | z-index of node text edit box elements |
| nodeNoteTooltipZIndexv0.5.5+ | Number | 3000 | z-index of floating layer elements in node comments | |
| isEndNodeTextEditOnClickOuterv0.5.5+ | Boolean | true | Whether to end the editing status of node text when clicking on an area outside the canvas | |
| maxHistoryCountv0.5.6+ | Number | 1000 | | Maximum number of history records |
| maxHistoryCountv0.5.6+ | Number | 1000v0.9.2+ changed 500 | | Maximum number of history records |
| alwaysShowExpandBtnv0.5.8+ | Boolean | false | Whether to always display the expand and collapse buttons of nodes, which are only displayed when the mouse is moved up and activated by default | |
| iconListv0.5.8+ | Array | [] | The icons that can be inserted into the extension node, and each item in the array is an object. Please refer to the "Icon Configuration" table below for the detailed structure of the object | |
| maxNodeCacheCountv0.5.10+ | Number | 1000 | The maximum number of cached nodes. To optimize performance, an internal node cache pool is maintained to reuse nodes. This attribute allows you to specify the maximum number of caches in the pool | |
@ -105,6 +105,9 @@ const mindMap = new MindMap({
| highlightNodeBoxStylev0.9.0+ | Object | { stroke: 'rgb(94, 200, 248)', fill: 'transparent' } | Highlight box style when the mouse moves into the summary to highlight the node it belongs to | |
| createNewNodeBehaviorv0.9.1+ | String | default | Behavior when creating a new node. defaultBy default, newly created nodes will be activated and enter editing mode. If multiple new nodes are created simultaneously, they will only be activated and will not enter editing mode、notActiveDo not activate newly created nodes、activeOnlyOnly activate newly created nodes and do not enter editing mode | |
| defaultNodeImagev0.9.1-fix.2+ | String | | Image address, the default image displayed when node image loading fails | |
| handleNodePasteImgv0.9.2+ | null or Function | null | The processing method for pasting images from the clipboard on a node is to convert them into data:URL data and insert them into the node by default. You can use this method to upload image data to the server and save the URL of the image. An asynchronous method can be passed to receive image data of Blob type, and the specified structure needs to be returned: { url, size: {width, height} } | |
| isLimitMindMapInCanvasv0.9.2+ | Boolean | false | Whether to limit the mind map within the canvas. For example, when dragging to the right, the leftmost part of the mind map graphic will not be able to continue dragging to the right when it reaches the center of the canvas, and the same applies to other things |
| isLimitMindMapInCanvasWhenHasScrollbarv0.9.2+ | Boolean | true | When registering the Scrollbar plugin, will the mind map be limited to the canvas and the isLimitMindMapInCanvas configuration no longer work |
### Data structure
@ -156,6 +159,7 @@ If you want to add custom fields, you can add them to the same level as 'data' a
| textSpacing | Number | 100 | Spacing between watermarks in the same row |
| angle | Number | 30 | Tilt angle of watermark, range: [0, 90] |
| textStyle | Object | {color: '#999', opacity: 0.5, fontSize: 14} | Watermark text style |
| onlyExportv0.9.2+ | Boolean | false | Is only add watermarks during export |
### Icon Configuration
@ -414,6 +418,8 @@ Listen to an event. Event list:
| set_datav0.7.3+ | Triggered when the setData method is called to dynamically set mind map data | dataNew Mind Map Data |
| resizev0.8.0+ | Triggered after the container size changes, actually when the 'resize' method of the mind map instance is called | |
| beforeDestroyv0.9.0+ | Triggered before destroying the mind map, i.e. triggered by calling the destroy method | |
| body_mousedownv0.9.2+ | Mousedown event of document.body | eevent object |
| body_click | Click event of document.body | eevent object |
### emit(event, ...args)
@ -507,7 +513,7 @@ redo. All commands are as follows:
| EXPAND_ALL | Expand all nodes | |
| UNEXPAND_ALL | Collapse all nodes | |
| UNEXPAND_TO_LEVEL (v0.2.8+) | Expand to a specified level | level (the level to expand to, 1, 2, 3...) |
| SET_NODE_DATA | Update node data, that is, update the data in the data object of the node data object | node (the node to set), data (object, the data to update, e.g. `{expand: true}`) |
| SET_NODE_DATA | Update node data, that is, update the data in the data object of the node data object. Note that this command will not trigger view updates | node (the node to set), data (object, the data to update, e.g. `{expand: true}`) |
| SET_NODE_TEXT | Set node text | node (the node to set), text (the new text for the node), richTextv0.4.0+, If you want to set a rich text character, you need to set it to `true`、resetRichTextv0.6.10+Do you want to reset rich text? The default is false. If true is passed, the style of the rich text node will be reset |
| SET_NODE_IMAGE | Set Node Image | node (node to set), imgData (object, image information, structured as: `{url, title, width, height}`, the width and height of the image must be passed) |
| SET_NODE_ICON | Set Node Icon | node (node to set), icons (array, predefined image names array, available icons can be obtained in the nodeIconList list in the [icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js) file, icon name is type_name, such as ['priority_1']) |

View File

@ -290,7 +290,7 @@
<tr>
<td>maxHistoryCountv0.5.6+</td>
<td>Number</td>
<td>1000</td>
<td>1000v0.9.2+ changed 500</td>
<td></td>
<td>Maximum number of history records</td>
</tr>
@ -595,6 +595,27 @@
<td>Image address, the default image displayed when node image loading fails</td>
<td></td>
</tr>
<tr>
<td>handleNodePasteImgv0.9.2+</td>
<td>null or Function</td>
<td>null</td>
<td>The processing method for pasting images from the clipboard on a node is to convert them into data:URL data and insert them into the node by default. You can use this method to upload image data to the server and save the URL of the image. An asynchronous method can be passed to receive image data of Blob type, and the specified structure needs to be returned: { url, size: {width, height} }</td>
<td></td>
</tr>
<tr>
<td>isLimitMindMapInCanvasv0.9.2+</td>
<td>Boolean</td>
<td>false</td>
<td>Whether to limit the mind map within the canvas. For example, when dragging to the right, the leftmost part of the mind map graphic will not be able to continue dragging to the right when it reaches the center of the canvas, and the same applies to other things</td>
<td></td>
</tr>
<tr>
<td>isLimitMindMapInCanvasWhenHasScrollbarv0.9.2+</td>
<td>Boolean</td>
<td>true</td>
<td>When registering the Scrollbar plugin, will the mind map be limited to the canvas and the isLimitMindMapInCanvas configuration no longer work</td>
<td></td>
</tr>
</tbody>
</table>
<h3>Data structure</h3>
@ -674,6 +695,12 @@
<td>{color: '#999', opacity: 0.5, fontSize: 14}</td>
<td>Watermark text style</td>
</tr>
<tr>
<td>onlyExportv0.9.2+</td>
<td>Boolean</td>
<td>false</td>
<td>Is only add watermarks during export</td>
</tr>
</tbody>
</table>
<h3>Icon Configuration</h3>
@ -1072,6 +1099,16 @@ poor performance and should be used sparingly.</p>
<td>Triggered before destroying the mind map, i.e. triggered by calling the destroy method</td>
<td></td>
</tr>
<tr>
<td>body_mousedownv0.9.2+</td>
<td>Mousedown event of document.body</td>
<td>eevent object</td>
</tr>
<tr>
<td>body_click</td>
<td>Click event of document.body</td>
<td>eevent object</td>
</tr>
</tbody>
</table>
<h3>emit(event, ...args)</h3>
@ -1219,7 +1256,7 @@ redo. All commands are as follows:</p>
</tr>
<tr>
<td>SET_NODE_DATA</td>
<td>Update node data, that is, update the data in the data object of the node data object</td>
<td>Update node data, that is, update the data in the data object of the node data object. Note that this command will not trigger view updates</td>
<td>node (the node to set), data (object, the data to update, e.g. <code>{expand: true}</code>)</td>
</tr>
<tr>

View File

@ -48,9 +48,9 @@ a.click()
- `rotateWhenWidthLongerThenHeight`: v0.6.15+, V0.7.0+abandoned, Boolean, false, Automatically rotate 90 degrees when the image has a width to height ratio
- `checkRotate`: v0.7.0+, Function, You can pass a function that takes two parameters, the width and height of the image, and returns true or false. True represents that the image needs to be rotated by 90 degrees
- `checkRotate`: v0.7.0+, (v0.9.2+obsolete), Function, You can pass a function that takes two parameters, the width and height of the image, and returns true or false. True represents that the image needs to be rotated by 90 degrees
- `compress`v0.8.1+null | { width, height }, The parameter for compressing images. In some cases, the length and width of the exported image may be very large. If you want to reduce it, you can use this parameter to control it. Only one width or height can be provided, and it will be scaled proportionally
- `compress`v0.8.1+, (v0.9.2+obsolete)null | { width, height }, The parameter for compressing images. In some cases, the length and width of the exported image may be very large. If you want to reduce it, you can use this parameter to control it. Only one width or height can be provided, and it will be scaled proportionally
Exports as `png`.
@ -74,15 +74,19 @@ svg(
Exports as `svg`.
### pdf(name, useMultiPageExport, maxImageWidth)
### pdf(name, transparent = false)
> v0.8.1pdf(name, useMultiPageExport, maxImageWidth)
> v0.2.1+
- `name`File name
- `useMultiPageExport`: v0.6.15+, Boolean, false, Whether to export multiple pages, default to single page
- `useMultiPageExport`: v0.6.15+, (v0.9.2+obsolete), Boolean, false, Whether to export multiple pages, default to single page
- `maxImageWidth`v0.8.1+null | NumberThe default is twice the width of A4 paper, which is a parameter for compressing images. In some cases, the length and width of the image may be very large, resulting in a very large PDF volume. Therefore, if you want to reduce the volume, you can use this parameter to control the maximum width of the image
- `maxImageWidth`v0.8.1+, (v0.9.2+obsolete)null | NumberThe default is twice the width of A4 paper, which is a parameter for compressing images. In some cases, the length and width of the image may be very large, resulting in a very large PDF volume. Therefore, if you want to reduce the volume, you can use this parameter to control the maximum width of the image
- `transparent`v0.9.2+Booleandefault is falseSpecify whether the background of the exported image is transparent
Export as `pdf`. Unlike other export methods, this method does not return data and directly triggers the download.

View File

@ -42,10 +42,10 @@ a.click()
<p><code>rotateWhenWidthLongerThenHeight</code>: v0.6.15+, V0.7.0+abandoned, Boolean, false, Automatically rotate 90 degrees when the image has a width to height ratio</p>
</li>
<li>
<p><code>checkRotate</code>: v0.7.0+, Function, You can pass a function that takes two parameters, the width and height of the image, and returns true or false. True represents that the image needs to be rotated by 90 degrees</p>
<p><code>checkRotate</code>: v0.7.0+, (v0.9.2+obsolete), Function, You can pass a function that takes two parameters, the width and height of the image, and returns true or false. True represents that the image needs to be rotated by 90 degrees</p>
</li>
<li>
<p><code>compress</code>v0.8.1+null | { width, height }, The parameter for compressing images. In some cases, the length and width of the exported image may be very large. If you want to reduce it, you can use this parameter to control it. Only one width or height can be provided, and it will be scaled proportionally</p>
<p><code>compress</code>v0.8.1+, (v0.9.2+obsolete)null | { width, height }, The parameter for compressing images. In some cases, the length and width of the exported image may be very large. If you want to reduce it, you can use this parameter to control it. Only one width or height can be provided, and it will be scaled proportionally</p>
</li>
</ul>
<p>Exports as <code>png</code>.</p>
@ -69,7 +69,10 @@ a.click()
)
</code></pre>
<p>Exports as <code>svg</code>.</p>
<h3>pdf(name, useMultiPageExport, maxImageWidth)</h3>
<h3>pdf(name, transparent = false)</h3>
<blockquote>
<p>v0.8.1pdf(name, useMultiPageExport, maxImageWidth)</p>
</blockquote>
<blockquote>
<p>v0.2.1+</p>
</blockquote>
@ -78,10 +81,13 @@ a.click()
<p><code>name</code>File name</p>
</li>
<li>
<p><code>useMultiPageExport</code>: v0.6.15+, Boolean, false, Whether to export multiple pages, default to single page</p>
<p><code>useMultiPageExport</code>: v0.6.15+, (v0.9.2+obsolete), Boolean, false, Whether to export multiple pages, default to single page</p>
</li>
<li>
<p><code>maxImageWidth</code>v0.8.1+null | NumberThe default is twice the width of A4 paper, which is a parameter for compressing images. In some cases, the length and width of the image may be very large, resulting in a very large PDF volume. Therefore, if you want to reduce the volume, you can use this parameter to control the maximum width of the image</p>
<p><code>maxImageWidth</code>v0.8.1+, (v0.9.2+obsolete)null | NumberThe default is twice the width of A4 paper, which is a parameter for compressing images. In some cases, the length and width of the image may be very large, resulting in a very large PDF volume. Therefore, if you want to reduce the volume, you can use this parameter to control the maximum width of the image</p>
</li>
<li>
<p><code>transparent</code>v0.9.2+Booleandefault is falseSpecify whether the background of the exported image is transparent</p>
</li>
</ul>
<p>Export as <code>pdf</code>. Unlike other export methods, this method does not return data and directly triggers the download.</p>

View File

@ -217,7 +217,7 @@ if `key` is not passed, return the `data` object
### setData(data)
Set the value of the specified key in the data object of the node's real data
nodeData, `SET_NODE_DATA` command's shortcut method
nodeData, `SET_NODE_DATA` command's shortcut method. This method and command will not update the view, so if you want to modify the text, use the 'setText' method or use the command pointing to the text.
### setText(text, richText)

View File

@ -161,7 +161,7 @@ default <code>false</code></p>
if <code>key</code> is not passed, return the <code>data</code> object</p>
<h3>setData(data)</h3>
<p>Set the value of the specified key in the data object of the node's real data
nodeData, <code>SET_NODE_DATA</code> command's shortcut method</p>
nodeData, <code>SET_NODE_DATA</code> command's shortcut method. This method and command will not update the view, so if you want to modify the text, use the 'setText' method or use the command pointing to the text.</p>
<h3>setText(text, richText)</h3>
<ul>
<li>

View File

@ -48,4 +48,10 @@ mindMap.watermark.updateWatermark({
> v0.3.2+
Gets whether the watermark exists.
Gets whether the watermark exists.
### clear()
> v0.9.2+
Clear watermark.

View File

@ -37,6 +37,11 @@ MindMap.usePlugin(Watermark)
<p>v0.3.2+</p>
</blockquote>
<p>Gets whether the watermark exists.</p>
<h3>clear()</h3>
<blockquote>
<p>v0.9.2+</p>
</blockquote>
<p>Clear watermark.</p>
</div>
</template>

View File

@ -13,6 +13,25 @@
> 4.修复鼠标或触控板水平滚动时画布移动方向相反的问题。
>
> 5.修复节点被销毁时鼠标移入标志没有复位的问题。
>
> 6.修复滚动条插件在initRootNodePosition配置不为默认的[center,center]时位置计算错误的问题。
>
> 7.修复拖拽画布时鼠标在节点上面松开时拖拽无法停止的问题。
>
> 8.修复当画布容器距浏览器窗口左上角不为0时view.fit方法计算出来的位置有误差的问题。
>
> 9.修复当节点数量比较多时,导出的图片中水印没有完全覆盖整个图片的问题。
>
> 10.修复插入公式报错的问题。
>
> 11.修复节点文本编辑状态中鼠标选择文本时移出编辑框,文字选中状态会丢失的问题。
>
> 12.修复节点富文本编辑时文本选中范围为null时没有触发rich_text_selection_change事件的问题。
>
> 13.修复node_dragging事件回参里没有node实例的问题。
>
> 14.修复节点数量过多画布尺寸过大无法导出png的问题。
新增:
@ -21,6 +40,28 @@
> 2.TextEdit类增加isShowTextEdit方法判断当前是否处在节点编辑状态。
>
> 3.Render类的paste方法改为支持粘贴剪贴板的数据。
>
> 4.新增将思维导图图形限制在画布内的配置选项。
>
> 5.注册了滚动条插件的情况下,支持配置是否将思维导图限制在画布内。
>
> 6.收起所有节点操作会将思维导图根节点移至画布中心。
>
> 7.支持仅在导出时显示水印的配置选项。
>
> 8.在节点粘贴剪贴板中的图片时,支持自定义处理函数,可以将图片上传到你的服务器。
>
> 9.重构pdf的导出逻辑导出的pdf尺寸不再是固定的a4而是思维导图的尺寸同时删除分页导出的配置。
>
> 10.节点连线支持显示箭头,作为主题的一个字段。
>
> 11.最大历史记录数量默认调整为500。
Demo
> 1.支持配置仅在导出时显示水印。
>
> 2.基础样式配置连线支持显示箭头。
## 0.9.1-fix.2

View File

@ -9,12 +9,34 @@
<p>3.修复当节点数量超出了缓存池的最大数量时前进回退会导致节点重复渲染的问题</p>
<p>4.修复鼠标或触控板水平滚动时画布移动方向相反的问题</p>
<p>5.修复节点被销毁时鼠标移入标志没有复位的问题</p>
<p>6.修复滚动条插件在initRootNodePosition配置不为默认的[center,center]时位置计算错误的问题</p>
<p>7.修复拖拽画布时鼠标在节点上面松开时拖拽无法停止的问题</p>
<p>8.修复当画布容器距浏览器窗口左上角不为0时view.fit方法计算出来的位置有误差的问题</p>
<p>9.修复当节点数量比较多时导出的图片中水印没有完全覆盖整个图片的问题</p>
<p>10.修复插入公式报错的问题</p>
<p>11.修复节点文本编辑状态中鼠标选择文本时移出编辑框文字选中状态会丢失的问题</p>
<p>12.修复节点富文本编辑时文本选中范围为null时没有触发rich_text_selection_change事件的问题</p>
<p>13.修复node_dragging事件回参里没有node实例的问题</p>
<p>14.修复节点数量过多画布尺寸过大无法导出png的问题</p>
</blockquote>
<p>新增</p>
<blockquote>
<p>1.修改mousewheel事件,dir标志修改为dirs,支持存储多个方向,优化触控板的双指移动操作</p>
<p>2.TextEdit类增加isShowTextEdit方法判断当前是否处在节点编辑状态</p>
<p>3.Render类的paste方法改为支持粘贴剪贴板的数据</p>
<p>4.新增将思维导图图形限制在画布内的配置选项</p>
<p>5.注册了滚动条插件的情况下支持配置是否将思维导图限制在画布内</p>
<p>6.收起所有节点操作会将思维导图根节点移至画布中心</p>
<p>7.支持仅在导出时显示水印的配置选项</p>
<p>8.在节点粘贴剪贴板中的图片时支持自定义处理函数可以将图片上传到你的服务器</p>
<p>9.重构pdf的导出逻辑导出的pdf尺寸不再是固定的a4而是思维导图的尺寸同时删除分页导出的配置</p>
<p>10.节点连线支持显示箭头作为主题的一个字段</p>
<p>11.最大历史记录数量默认调整为500</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.支持配置仅在导出时显示水印</p>
<p>2.基础样式配置连线支持显示箭头</p>
</blockquote>
<h2>0.9.1-fix.2</h2>
<p>修复</p>

View File

@ -61,7 +61,7 @@ const mindMap = new MindMap({
| nodeTextEditZIndexv0.5.5+ | Number | 3000 | 节点文本编辑框元素的z-index |
| nodeNoteTooltipZIndexv0.5.5+ | Number | 3000 | 节点备注浮层元素的z-index |
| isEndNodeTextEditOnClickOuterv0.5.5+ | Boolean | true | 是否在点击了画布外的区域时结束节点文本的编辑状态 |
| maxHistoryCountv0.5.6+ | Number | 1000 | 最大历史记录数 |
| maxHistoryCountv0.5.6+ | Number | 1000v0.9.2+改为500 | 最大历史记录数 |
| alwaysShowExpandBtnv0.5.8+ | Boolean | false | 是否一直显示节点的展开收起按钮,默认为鼠标移上去和激活时才显示 |
| iconListv0.5.8+ | Array | [] | 扩展节点可插入的图标,数组的每一项为一个对象,对象详细结构请参考下方【图标配置】表格 |
| maxNodeCacheCountv0.5.10+ | Number | 1000 | 节点最大缓存数量。为了优化性能,内部会维护一个节点缓存池,用来复用节点,通过该属性可以指定池的最大缓存数量 |
@ -105,6 +105,9 @@ const mindMap = new MindMap({
| highlightNodeBoxStylev0.9.0+ | Object | { stroke: 'rgb(94, 200, 248)', fill: 'transparent' } | 鼠标移入概要高亮所属节点时的高亮框样式 |
| createNewNodeBehaviorv0.9.1+ | String | default | 创建新节点时的行为。default默认会激活新创建的节点并且进入编辑模式。如果同时创建了多个新节点那么只会激活而不会进入编辑模式、notActive不激活新创建的节点、activeOnly只激活新创建的节点不进入编辑模式 |
| defaultNodeImagev0.9.1-fix.2+ | String | | 图片地址,当节点图片加载失败时显示的默认图片 |
| handleNodePasteImgv0.9.2+ | null 或 Function | null | 在节点上粘贴剪贴板中的图片的处理方法默认是转换为data:url数据插入到节点中你可以通过该方法来将图片数据上传到服务器实现保存图片的url。可以传递一个异步方法接收Blob类型的图片数据需要返回指定结构{ url, size: {width, height} } |
| isLimitMindMapInCanvasv0.9.2+ | Boolean | false | 是否将思维导图限制在画布内。比如向右拖动时,思维导图图形的最左侧到达画布中心时将无法继续向右拖动,其他同理 |
| isLimitMindMapInCanvasWhenHasScrollbarv0.9.2+ | Boolean | true | 当注册了滚动条插件Scrollbar是否将思维导图限制在画布内isLimitMindMapInCanvas配置不再起作用 |
### 数据结构
@ -156,6 +159,7 @@ const mindMap = new MindMap({
| textSpacing | Number | 100 | 同一行水印之间的间距 |
| angle | Number | 30 | 水印的倾斜角度,范围:[0, 90] |
| textStyle | Object | {color: '#999', opacity: 0.5, fontSize: 14} | 水印文字样式 |
| onlyExportv0.9.2+ | Boolean | false | 是否仅在导出时添加水印 |
### 图标配置
@ -411,6 +415,8 @@ mindMap.setTheme('主题名称')
| set_datav0.7.3+ | 调用了setData方法动态设置思维导图数据时触发 | data新的思维导图数据 |
| resizev0.8.0+ | 容器尺寸改变后触发,实际上是当思维导图实例的`resize`方法被调用后触发 | |
| beforeDestroyv0.9.0+ | 思维导图销毁前触发即调用了destroy方法触发 | |
| body_mousedownv0.9.2+ | document.body的鼠标按下事件 | e事件对象 |
| body_click | document.body的点击事件 | e事件对象 |
### emit(event, ...args)
@ -502,7 +508,7 @@ mindMap.updateConfig({
| EXPAND_ALL | 展开所有节点 | |
| UNEXPAND_ALL | 收起所有节点 | |
| UNEXPAND_TO_LEVELv0.2.8+ | 展开到指定层级 | level要展开到的层级1、2、3... |
| SET_NODE_DATA | 更新节点数据,即更新节点数据对象里`data`对象的数据 | node要设置的节点、data对象要更新的数据如`{expand: true}` |
| SET_NODE_DATA | 更新节点数据,即更新节点数据对象里`data`对象的数据,注意这个命令不会触发视图的更新 | node要设置的节点、data对象要更新的数据如`{expand: true}` |
| SET_NODE_TEXT | 设置节点文本 | node要设置的节点、text要设置的文本字符串换行可以使用`\n`、richTextv0.4.0+,如果要设置的是富文本字符,需要设为`true`、resetRichTextv0.6.10+是否要复位富文本默认为false如果传true那么会重置富文本节点的样式 |
| SET_NODE_IMAGE | 设置节点图片 | node要设置的节点、imgData对象图片信息结构为`{url, title, width, height}`,图片的宽高必须要传) |
| SET_NODE_ICON | 设置节点图标 | node要设置的节点、icons数组预定义的图片名称组成的数组可用图标可在[icons.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js)文件里的`nodeIconList`列表里获取到,图标名称为`type_name`,如`['priority_1']` |

View File

@ -252,7 +252,7 @@
<tr>
<td>maxHistoryCountv0.5.6+</td>
<td>Number</td>
<td>1000</td>
<td>1000v0.9.2+改为500</td>
<td>最大历史记录数</td>
</tr>
<tr>
@ -513,6 +513,24 @@
<td></td>
<td>图片地址当节点图片加载失败时显示的默认图片</td>
</tr>
<tr>
<td>handleNodePasteImgv0.9.2+</td>
<td>null Function</td>
<td>null</td>
<td>在节点上粘贴剪贴板中的图片的处理方法默认是转换为data:url数据插入到节点中你可以通过该方法来将图片数据上传到服务器实现保存图片的url可以传递一个异步方法接收Blob类型的图片数据需要返回指定结构{ url, size: {width, height} }</td>
</tr>
<tr>
<td>isLimitMindMapInCanvasv0.9.2+</td>
<td>Boolean</td>
<td>false</td>
<td>是否将思维导图限制在画布内比如向右拖动时思维导图图形的最左侧到达画布中心时将无法继续向右拖动其他同理</td>
</tr>
<tr>
<td>isLimitMindMapInCanvasWhenHasScrollbarv0.9.2+</td>
<td>Boolean</td>
<td>true</td>
<td>当注册了滚动条插件Scrollbar是否将思维导图限制在画布内isLimitMindMapInCanvas配置不再起作用</td>
</tr>
</tbody>
</table>
<h3>数据结构</h3>
@ -592,6 +610,12 @@
<td>{color: '#999', opacity: 0.5, fontSize: 14}</td>
<td>水印文字样式</td>
</tr>
<tr>
<td>onlyExportv0.9.2+</td>
<td>Boolean</td>
<td>false</td>
<td>是否仅在导出时添加水印</td>
</tr>
</tbody>
</table>
<h3>图标配置</h3>
@ -983,6 +1007,16 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
<td>思维导图销毁前触发即调用了destroy方法触发</td>
<td></td>
</tr>
<tr>
<td>body_mousedownv0.9.2+</td>
<td>document.body的鼠标按下事件</td>
<td>e事件对象</td>
</tr>
<tr>
<td>body_click</td>
<td>document.body的点击事件</td>
<td>e事件对象</td>
</tr>
</tbody>
</table>
<h3>emit(event, ...args)</h3>
@ -1132,7 +1166,7 @@ mindMap.setTheme(<span class="hljs-string">&#x27;主题名称&#x27;</span>)
</tr>
<tr>
<td>SET_NODE_DATA</td>
<td>更新节点数据即更新节点数据对象里<code>data</code>对象的数据</td>
<td>更新节点数据即更新节点数据对象里<code>data</code>对象的数据注意这个命令不会触发视图的更新</td>
<td>node要设置的节点data对象要更新的数据<code>{expand: true}</code></td>
</tr>
<tr>

View File

@ -48,9 +48,9 @@ a.click()
- `rotateWhenWidthLongerThenHeight`: v0.6.15+v0.7.0+已废弃Boolean, false, 是否在图片宽比高长时自动旋转90度
- `checkRotate`v0.7.0+Function可以传递一个函数接收图片的宽度和高度两个参数返回true或falsetrue代表图片需要旋转90度
- `checkRotate`v0.7.0+v0.9.2+已废弃),Function可以传递一个函数接收图片的宽度和高度两个参数返回true或falsetrue代表图片需要旋转90度
- `compress`v0.8.1+null | { width, height }, 压缩图片的参数,某些情况下导出的图片长宽可能非常大,如果希望减小,那么可以通过该参数来控制,宽或高只提供一个即可,会按比例缩放
- `compress`v0.8.1+v0.9.2+已废弃),null | { width, height }, 压缩图片的参数,某些情况下导出的图片长宽可能非常大,如果希望减小,那么可以通过该参数来控制,宽或高只提供一个即可,会按比例缩放
导出为`png`。
@ -74,15 +74,19 @@ svg(
导出为`svg`。
### pdf(name, useMultiPageExport, maxImageWidth)
### pdf(name, transparent = false)
> v0.8.1pdf(name, useMultiPageExport, maxImageWidth)
> v0.2.1+
- `name`:文件名称
- `useMultiPageExport`: v0.6.15+Boolean, false, 是否多页导出,默认为单页
- `useMultiPageExport`: v0.6.15+v0.9.2+已废弃),Boolean, false, 是否多页导出,默认为单页
- `maxImageWidth`v0.8.1+null | Number默认为a4纸的宽度的2倍, 压缩图片的参数某些情况下图片的长宽可能非常大导致pdf体积也非常大所以如果希望减小体积那么可以通过该参数来控制图片的最大宽度
- `maxImageWidth`v0.8.1+v0.9.2+已废弃null | Number默认为a4纸的宽度的2倍, 压缩图片的参数某些情况下图片的长宽可能非常大导致pdf体积也非常大所以如果希望减小体积那么可以通过该参数来控制图片的最大宽度
- `transparent`v0.9.2+Boolean默认为false指定导出图片的背景是否是透明的
导出为`pdf`,和其他导出方法不一样,这个方法不会返回数据,会直接触发下载。

View File

@ -42,10 +42,10 @@ a.click()
<p><code>rotateWhenWidthLongerThenHeight</code>: v0.6.15+v0.7.0+已废弃Boolean, false, 是否在图片宽比高长时自动旋转90度</p>
</li>
<li>
<p><code>checkRotate</code>v0.7.0+Function可以传递一个函数接收图片的宽度和高度两个参数返回true或falsetrue代表图片需要旋转90度</p>
<p><code>checkRotate</code>v0.7.0+v0.9.2+已废弃Function可以传递一个函数接收图片的宽度和高度两个参数返回true或falsetrue代表图片需要旋转90度</p>
</li>
<li>
<p><code>compress</code>v0.8.1+null | { width, height }, 压缩图片的参数某些情况下导出的图片长宽可能非常大如果希望减小那么可以通过该参数来控制宽或高只提供一个即可会按比例缩放</p>
<p><code>compress</code>v0.8.1+v0.9.2+已废弃null | { width, height }, 压缩图片的参数某些情况下导出的图片长宽可能非常大如果希望减小那么可以通过该参数来控制宽或高只提供一个即可会按比例缩放</p>
</li>
</ul>
<p>导出为<code>png</code></p>
@ -69,7 +69,10 @@ a.click()
)
</code></pre>
<p>导出为<code>svg</code></p>
<h3>pdf(name, useMultiPageExport, maxImageWidth)</h3>
<h3>pdf(name, transparent = false)</h3>
<blockquote>
<p>v0.8.1pdf(name, useMultiPageExport, maxImageWidth)</p>
</blockquote>
<blockquote>
<p>v0.2.1+</p>
</blockquote>
@ -78,10 +81,13 @@ a.click()
<p><code>name</code>文件名称</p>
</li>
<li>
<p><code>useMultiPageExport</code>: v0.6.15+Boolean, false, 是否多页导出默认为单页</p>
<p><code>useMultiPageExport</code>: v0.6.15+v0.9.2+已废弃Boolean, false, 是否多页导出默认为单页</p>
</li>
<li>
<p><code>maxImageWidth</code>v0.8.1+null | Number默认为a4纸的宽度的2倍, 压缩图片的参数某些情况下图片的长宽可能非常大导致pdf体积也非常大所以如果希望减小体积那么可以通过该参数来控制图片的最大宽度</p>
<p><code>maxImageWidth</code>v0.8.1+v0.9.2+已废弃null | Number默认为a4纸的宽度的2倍, 压缩图片的参数某些情况下图片的长宽可能非常大导致pdf体积也非常大所以如果希望减小体积那么可以通过该参数来控制图片的最大宽度</p>
</li>
<li>
<p><code>transparent</code>v0.9.2+Boolean默认为false指定导出图片的背景是否是透明的</p>
</li>
</ul>
<p>导出为<code>pdf</code>和其他导出方法不一样这个方法不会返回数据会直接触发下载</p>

View File

@ -214,7 +214,7 @@
### setData(data)
设置节点数据,`SET_NODE_DATA`命令的快捷方法
设置节点数据,`SET_NODE_DATA`命令的快捷方法,这个方法和命令不会更新视图,所以如果你要修改文本,就使用`setText`方法,或者用手指文本的命令。
### setText(text, richText, resetRichText)

View File

@ -154,7 +154,7 @@
<h3>getData(key)</h3>
<p>获取该节点真实数据<code>nodeData</code><code>data</code>对象里的指定值<code>key</code>不传返回这个<code>data</code>对象</p>
<h3>setData(data)</h3>
<p>设置节点数据<code>SET_NODE_DATA</code>命令的快捷方法</p>
<p>设置节点数据<code>SET_NODE_DATA</code>命令的快捷方法这个方法和命令不会更新视图所以如果你要修改文本就使用<code>setText</code>方法或者用手指文本的命令</p>
<h3>setText(text, richText, resetRichText)</h3>
<ul>
<li>

View File

@ -48,4 +48,10 @@ mindMap.watermark.updateWatermark({
> v0.3.2+
获取是否存在水印。
获取是否存在水印。
### clear()
> v0.9.2+
清除水印。

View File

@ -37,6 +37,11 @@ MindMap.usePlugin(Watermark)
<p>v0.3.2+</p>
</blockquote>
<p>获取是否存在水印</p>
<h3>clear()</h3>
<blockquote>
<p>v0.9.2+</p>
</blockquote>
<p>清除水印</p>
</div>
</template>