Doc: update

This commit is contained in:
wanglin2 2023-08-18 14:51:42 +08:00
parent a4dc9210b3
commit b427a9ed1b
17 changed files with 201 additions and 11 deletions

View File

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

View File

@ -1,5 +1,41 @@
# Changelog
## 0.6.15
新增:
> 1.Export PDF supports pagination export based on image size.
>
> 2.Exporting PDF supports automatic direction adjustment based on aspect ratio.
>
> 3.Optimize the placeholder elements of the expand and collapse buttons: 1. Nodes without child nodes do not render this element; 2. Dynamically update the element based on the existence of child nodes.
>
> 4.Add a configuration that prohibits mouse wheel scaling.
>
> 5.Supports passing error handling functions.
修复:
> 1.Fix the issue of displaying exceptions when node text is empty.
>
> 2.Change the paddingX and paddingY of exported SVG graphics to single sided padding.
>
> 3.Fixed an issue where the mouse is not centered when zooming when the canvas is not 0 from the top left corner of the browser window.
>
> 4.Fix the issue of overlapping node borders.
Demo
> 1.The bottom right corner supports jumping to related links.
>
> 2.Adjust the position of the mini map to solve the problem of being blocked by side buttons.
>
> 3.Fix the issue where the prompt in the upper right corner of the open local file cannot be closed.
>
> 4.Editing the outline separately is no longer linked to the canvas, optimizing the editing experience under large data volume.
>
> 5.The sidebar involves graphical options to increase visualization effects.
## 0.6.14
New:

View File

@ -1,6 +1,30 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.15</h2>
<p>新增</p>
<blockquote>
<p>1.Export PDF supports pagination export based on image size.</p>
<p>2.Exporting PDF supports automatic direction adjustment based on aspect ratio.</p>
<p>3.Optimize the placeholder elements of the expand and collapse buttons: 1. Nodes without child nodes do not render this element; 2. Dynamically update the element based on the existence of child nodes.</p>
<p>4.Add a configuration that prohibits mouse wheel scaling.</p>
<p>5.Supports passing error handling functions.</p>
</blockquote>
<p>修复</p>
<blockquote>
<p>1.Fix the issue of displaying exceptions when node text is empty.</p>
<p>2.Change the paddingX and paddingY of exported SVG graphics to single sided padding.</p>
<p>3.Fixed an issue where the mouse is not centered when zooming when the canvas is not 0 from the top left corner of the browser window.</p>
<p>4.Fix the issue of overlapping node borders.</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.The bottom right corner supports jumping to related links.</p>
<p>2.Adjust the position of the mini map to solve the problem of being blocked by side buttons.</p>
<p>3.Fix the issue where the prompt in the upper right corner of the open local file cannot be closed.</p>
<p>4.Editing the outline separately is no longer linked to the canvas, optimizing the editing experience under large data volume.</p>
<p>5.The sidebar involves graphical options to increase visualization effects.</p>
</blockquote>
<h2>0.6.14</h2>
<p>New:</p>
<blockquote>

View File

@ -77,6 +77,8 @@ const mindMap = new MindMap({
| enableAutoEnterTextEditWhenKeydownv0.6.13+ | Boolean | true | Does it automatically enter text editing mode when pressing the Chinese, English, or numeric buttons when there is an activation node?| |
| richTextEditFakeInPlacev0.6.13+ | Boolean | false | Set the rich text node edit box to match the size of the node, creating a pseudo in place editing effect. It should be noted that only when there is only text within the node and the shape is rectangular, can the effect be better | |
| customHandleClipboardTextv0.6.14+ | Function | null | Customize the processing of clipboard text. When pressing ctrl+v to paste, it will read the text and images from the user's clipboard. By default, it will only determine whether the text is regular text and node data in simple mind map format. If you want to process data from other mind maps, such as process, zhixi, etc., you can pass a function that takes the text from the current clipboard as a parameter and returns the processed data, which can be of two types: 1.If a pure text is returned, a child node will be directly created with that text; 2.Returns a node object in the following format: { simpleMindMap: true, data: { data: { text: '' }, children: [] } }, The representative is data in simple bind map format, and the node data is in the same format as the simple bind map node data. If your processing logic has asynchronous logic, you can also return a promise | |
| 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 | |
### Watermark config

View File

@ -399,6 +399,20 @@
<td>Customize the processing of clipboard text. When pressing ctrl+v to paste, it will read the text and images from the user's clipboard. By default, it will only determine whether the text is regular text and node data in simple mind map format. If you want to process data from other mind maps, such as process, zhixi, etc., you can pass a function that takes the text from the current clipboard as a parameter and returns the processed data, which can be of two types: 1.If a pure text is returned, a child node will be directly created with that text; 2.Returns a node object in the following format: { simpleMindMap: true, data: { data: { text: '' }, children: [] } }, The representative is data in simple bind map format, and the node data is in the same format as the simple bind map node data. If your processing logic has asynchronous logic, you can also return a promise</td>
<td></td>
</tr>
<tr>
<td>errorHandlerv0.6.15+</td>
<td>Function</td>
<td></td>
<td>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</td>
<td></td>
</tr>
<tr>
<td>disableMouseWheelZoomv0.6.15+</td>
<td>Boolean</td>
<td>false</td>
<td>Prohibit mouse wheel scaling, you can still use the API for scaling</td>
<td></td>
</tr>
</tbody>
</table>
<h3>Watermark config</h3>

View File

@ -38,12 +38,14 @@ a.download = 'xxx'
a.click()
```
### png(name, transparent = false)
### png(name, transparent = false, rotateWhenWidthLongerThenHeight)
- `name`: Name, optional
- `transparent`: v0.5.7+, Specify whether the background of the exported image is transparent
- `rotateWhenWidthLongerThenHeight`: v0.6.15+Boolean, false, Automatically rotate 90 degrees when the image has a width to height ratio
Exports as `png`.
### svg(name, plusCssText)
@ -66,11 +68,13 @@ svg(
Exports as `svg`.
### pdf(name)
### pdf(name, useMultiPageExport)
> v0.2.1+
`name`File name
- `name`File name
- `useMultiPageExport`: v0.6.15+, Boolean, false, Whether to export multiple pages, default to single page
Export as `pdf`. Unlike other export methods, this method does not return data and directly triggers the download.

View File

@ -27,7 +27,7 @@ a.href = <span class="hljs-string">&#x27;xxx.png&#x27;</span><span class="hljs-c
a.download = <span class="hljs-string">&#x27;xxx&#x27;</span>
a.click()
</code></pre>
<h3>png(name, transparent = false)</h3>
<h3>png(name, transparent = false, rotateWhenWidthLongerThenHeight)</h3>
<ul>
<li>
<p><code>name</code>: Name, optional</p>
@ -35,6 +35,9 @@ a.click()
<li>
<p><code>transparent</code>: v0.5.7+, Specify whether the background of the exported image is transparent</p>
</li>
<li>
<p><code>rotateWhenWidthLongerThenHeight</code>: v0.6.15+Boolean, false, Automatically rotate 90 degrees when the image has a width to height ratio</p>
</li>
</ul>
<p>Exports as <code>png</code>.</p>
<h3>svg(name, plusCssText)</h3>
@ -57,11 +60,18 @@ a.click()
)
</code></pre>
<p>Exports as <code>svg</code>.</p>
<h3>pdf(name)</h3>
<h3>pdf(name, useMultiPageExport)</h3>
<blockquote>
<p>v0.2.1+</p>
</blockquote>
<ul>
<li>
<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>
</li>
</ul>
<p>Export as <code>pdf</code>. Unlike other export methods, this method does not return data and directly triggers the download.</p>
<blockquote>
<p>After v0.6.0, an additional ExportPDF plugin needs to be registered</p>

View File

@ -18,6 +18,8 @@ The principle of this plugin is to use [Quill](https://github.com/quilljs/quill)
`V0.6.13+` version uses [dom-to-image-more](https://github.com/1904labs/dom-to-image-more) Replaced 'html2canvas' to address the issue of ineffective color export for nodes.
> The compatibility of dom to image more is relatively poor, and exported images are empty on many browsers, so you can replace them with html2canvas according to your own needs.
## Register
```js

View File

@ -18,6 +18,9 @@
<p>The version of <code>v0.5.7+</code> directly uses <code>html2canvas</code> to convert the entire <code>svg</code>, which is no longer an issue with speed. However, there is currently a bug where the color of the node does not take effect after export.</p>
</blockquote>
<p><code>V0.6.13+</code> version uses <a href="https://github.com/1904labs/dom-to-image-more">dom-to-image-more</a> Replaced 'html2canvas' to address the issue of ineffective color export for nodes.</p>
<blockquote>
<p>The compatibility of dom to image more is relatively poor, and exported images are empty on many browsers, so you can replace them with html2canvas according to your own needs.</p>
</blockquote>
<h2>Register</h2>
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map&#x27;</span>
<span class="hljs-keyword">import</span> RichText <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/plugins/RichText.js&#x27;</span>

View File

@ -1,5 +1,41 @@
# Changelog
## 0.6.15
新增:
> 1.导出pdf支持根据图片大小分页导出。
>
> 2.导出pdf支持根据长宽比自动调整方向。
>
> 3.优化展开收起按钮的占位元素1.没有子节点的节点不渲染该元素2.根据是否存在子节点动态更新该元素。
>
> 4.新增禁止鼠标滚轮缩放的配置。
>
> 5.支持传递错误处理函数。
修复:
> 1.修复节点文本为空时显示异常问题。
>
> 2.导出svg的图形的paddingX和paddingY改为单侧padding。
>
> 3.修复画布距浏览器窗口左上角不为0时鼠标缩放时不以鼠标为中心的问题。
>
> 4.修复节点边框会重合的问题。
Demo
> 1.右下角支持跳转相关链接。
>
> 2.调整小地图位置,解决被侧边按钮遮挡的问题。
>
> 3.修复打开本地文件右上角的提示无法关闭的问题。
>
> 4.单独编辑大纲不再和画布联动,优化大数据量下的编辑体验。
>
> 5.侧边栏涉及图形的选项增加可视化效果。
## 0.6.14
新增:

View File

@ -1,6 +1,30 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.15</h2>
<p>新增</p>
<blockquote>
<p>1.导出pdf支持根据图片大小分页导出</p>
<p>2.导出pdf支持根据长宽比自动调整方向</p>
<p>3.优化展开收起按钮的占位元素1.没有子节点的节点不渲染该元素2.根据是否存在子节点动态更新该元素</p>
<p>4.新增禁止鼠标滚轮缩放的配置</p>
<p>5.支持传递错误处理函数</p>
</blockquote>
<p>修复</p>
<blockquote>
<p>1.修复节点文本为空时显示异常问题</p>
<p>2.导出svg的图形的paddingX和paddingY改为单侧padding</p>
<p>3.修复画布距浏览器窗口左上角不为0时鼠标缩放时不以鼠标为中心的问题</p>
<p>4.修复节点边框会重合的问题</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.右下角支持跳转相关链接</p>
<p>2.调整小地图位置解决被侧边按钮遮挡的问题</p>
<p>3.修复打开本地文件右上角的提示无法关闭的问题</p>
<p>4.单独编辑大纲不再和画布联动优化大数据量下的编辑体验</p>
<p>5.侧边栏涉及图形的选项增加可视化效果</p>
</blockquote>
<h2>0.6.14</h2>
<p>新增</p>
<blockquote>

View File

@ -77,6 +77,8 @@ const mindMap = new MindMap({
| enableAutoEnterTextEditWhenKeydownv0.6.13+ | Boolean | true | 是否在存在一个激活节点时,当按下中文、英文、数字按键时自动进入文本编辑模式 | |
| richTextEditFakeInPlacev0.6.13+ | Boolean | false | 设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果,需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果 | |
| customHandleClipboardTextv0.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 | |
| errorHandlerv0.6.15+ | Function | | 自定义错误处理函数,目前只会抛出一些异步逻辑出错的情况。可以传递一个函数,会接收两个参数,第一个为错误的类型,第二个为错误对象 | |
| disableMouseWheelZoomv0.6.15+ | Boolean | false | 禁止鼠标滚轮缩放你仍旧可以使用api进行缩放 | |
### 水印配置

View File

@ -399,6 +399,20 @@
<td>自定义对剪贴板文本的处理当按ctrl+v粘贴时会读取用户剪贴板中的文本和图片默认只会判断文本是否是普通文本和simple-mind-map格式的节点数据如果你想处理其他思维导图的数据比如processonzhixi等那么可以传递一个函数接受当前剪贴板中的文本为参数返回处理后的数据可以返回两种类型1.返回一个纯文本那么会直接以该文本创建一个子节点2.返回一个节点对象格式如下{ simpleMindMap: true, data: { data: { text: '' }, children: [] } }代表是simple-mind-map格式的数据节点数据同simple-mind-map节点数据格式如果你的处理逻辑存在异步逻辑也可以返回一个promise</td>
<td></td>
</tr>
<tr>
<td>errorHandlerv0.6.15+</td>
<td>Function</td>
<td></td>
<td>自定义错误处理函数目前只会抛出一些异步逻辑出错的情况可以传递一个函数会接收两个参数第一个为错误的类型第二个为错误对象</td>
<td></td>
</tr>
<tr>
<td>disableMouseWheelZoomv0.6.15+</td>
<td>Boolean</td>
<td>false</td>
<td>禁止鼠标滚轮缩放你仍旧可以使用api进行缩放</td>
<td></td>
</tr>
</tbody>
</table>
<h3>水印配置</h3>

View File

@ -38,12 +38,14 @@ a.download = 'xxx'
a.click()
```
### png(name, transparent = false)
### png(name, transparent = false, rotateWhenWidthLongerThenHeight)
- `name`:名称,可不传
- `transparent`v0.5.7+,指定导出图片的背景是否是透明的
- `rotateWhenWidthLongerThenHeight`: v0.6.15+Boolean, false, 是否在图片宽比高长时自动旋转90度
导出为`png`。
### svg(name, plusCssText)
@ -66,11 +68,13 @@ svg(
导出为`svg`。
### pdf(name)
### pdf(name, useMultiPageExport)
> v0.2.1+
`name`:文件名称
- `name`:文件名称
- `useMultiPageExport`: v0.6.15+Boolean, false, 是否多页导出,默认为单页
导出为`pdf`,和其他导出方法不一样,这个方法不会返回数据,会直接触发下载。

View File

@ -27,7 +27,7 @@ a.href = <span class="hljs-string">&#x27;xxx.png&#x27;</span><span class="hljs-c
a.download = <span class="hljs-string">&#x27;xxx&#x27;</span>
a.click()
</code></pre>
<h3>png(name, transparent = false)</h3>
<h3>png(name, transparent = false, rotateWhenWidthLongerThenHeight)</h3>
<ul>
<li>
<p><code>name</code>名称可不传</p>
@ -35,6 +35,9 @@ a.click()
<li>
<p><code>transparent</code>v0.5.7+指定导出图片的背景是否是透明的</p>
</li>
<li>
<p><code>rotateWhenWidthLongerThenHeight</code>: v0.6.15+Boolean, false, 是否在图片宽比高长时自动旋转90度</p>
</li>
</ul>
<p>导出为<code>png</code></p>
<h3>svg(name, plusCssText)</h3>
@ -57,11 +60,18 @@ a.click()
)
</code></pre>
<p>导出为<code>svg</code></p>
<h3>pdf(name)</h3>
<h3>pdf(name, useMultiPageExport)</h3>
<blockquote>
<p>v0.2.1+</p>
</blockquote>
<ul>
<li>
<p><code>name</code>文件名称</p>
</li>
<li>
<p><code>useMultiPageExport</code>: v0.6.15+Boolean, false, 是否多页导出默认为单页</p>
</li>
</ul>
<p>导出为<code>pdf</code>和其他导出方法不一样这个方法不会返回数据会直接触发下载</p>
<blockquote>
<p>v0.6.0版本以后需要额外注册一个ExportPDF插件</p>

View File

@ -18,6 +18,8 @@
`v0.6.13+`版本使用[dom-to-image-more](https://github.com/1904labs/dom-to-image-more)替换了`html2canvas`,解决了节点的颜色导出后不生效的问题。
> dom-to-image-more兼容性比较差在很多浏览器上导出图片都是空的所以可以根据你自己的需求替换成html2canvas。
## 注册
```js

View File

@ -18,6 +18,9 @@
<p><code>v0.5.7+</code>的版本直接使用<code>html2canvas</code>转换整个<code>svg</code>速度不再是问题但是目前存在一个<code>bug</code>就是节点的颜色导出后不生效</p>
</blockquote>
<p><code>v0.6.13+</code>版本使用<a href="https://github.com/1904labs/dom-to-image-more">dom-to-image-more</a>替换了<code>html2canvas</code>解决了节点的颜色导出后不生效的问题</p>
<blockquote>
<p>dom-to-image-more兼容性比较差在很多浏览器上导出图片都是空的所以可以根据你自己的需求替换成html2canvas</p>
</blockquote>
<h2>注册</h2>
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map&#x27;</span>
<span class="hljs-keyword">import</span> RichText <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/plugins/RichText.js&#x27;</span>