Doc: update

This commit is contained in:
wanglin2 2023-07-06 10:37:02 +08:00
parent 80c7ec0fac
commit 0db2f47133
20 changed files with 254 additions and 12 deletions

View File

@ -1,5 +1,13 @@
# Changelog
## 0.6.6
New: 1.Support exporting to Xmind new version files. 2.Importing the new version of Xmind file supports importing images from nodes. 3.Add a vertical timeline structure.
Fix: 1.The TouchEvent plugin no longer sends click events, solving the problem of two windows opening when clicking on a hyperlink on the mobile end. 2.Fix the issue of dragging and moving a node to become a child node of another node, where the parent node of that node points to not being updated. 3.Fixed an issue where the node border style was not updated when dragging a second level node into a third level node. 4.Fix the issue where the mouse will not trigger the button display when moving into the unfolded or retracted button position, except for the structure growing to the right.
optimization: 1.The issue of excessive amplitude when optimizing the touchpad to scale the canvas. 2.The newly created node defaults to selecting all for easy deletion of default text.
## 0.6.5-fix.1
Fix: 1.Fix the issue of adjusting the image size incorrectly while zooming.

View File

@ -1,6 +1,10 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.6</h2>
<p>New: 1.Support exporting to Xmind new version files. 2.Importing the new version of Xmind file supports importing images from nodes. 3.Add a vertical timeline structure.</p>
<p>Fix: 1.The TouchEvent plugin no longer sends click events, solving the problem of two windows opening when clicking on a hyperlink on the mobile end. 2.Fix the issue of dragging and moving a node to become a child node of another node, where the parent node of that node points to not being updated. 3.Fixed an issue where the node border style was not updated when dragging a second level node into a third level node. 4.Fix the issue where the mouse will not trigger the button display when moving into the unfolded or retracted button position, except for the structure growing to the right.</p>
<p>optimization: 1.The issue of excessive amplitude when optimizing the touchpad to scale the canvas. 2.The newly created node defaults to selecting all for easy deletion of default text.</p>
<h2>0.6.5-fix.1</h2>
<p>Fix: 1.Fix the issue of adjusting the image size incorrectly while zooming.</p>
<h2>0.6.5</h2>

View File

@ -104,4 +104,15 @@ Gets `svg` data, an async method that returns an object:
node // svg node
str // svg string
}
```
```
### xmind(name)
> v0.6.6+, an additional ExportXMind plugin needs to be registered
```js
import ExportXMind from 'simple-mind-map/src/plugins/ExportXMind.js'
MindMap.usePlugin(ExportXMind)
```
Export as an `xmind` file type, asynchronous method, returns a `Promise` instance, and the returned data is the `data:url` data of a `zip` compressed package, which can be directly downloaded.

View File

@ -85,6 +85,14 @@ MindMap.usePlugin(ExportPDF)
str <span class="hljs-comment">// svg string</span>
}
</code></pre>
<h3>xmind(name)</h3>
<blockquote>
<p>v0.6.6+, an additional ExportXMind plugin needs to be registered</p>
</blockquote>
<pre class="hljs"><code><span class="hljs-keyword">import</span> ExportXMind <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/plugins/ExportXMind.js&#x27;</span>
MindMap.usePlugin(ExportXMind)
</code></pre>
<p>Export as an <code>xmind</code> file type, asynchronous method, returns a <code>Promise</code> instance, and the returned data is the <code>data:url</code> data of a <code>zip</code> compressed package, which can be directly downloaded.</p>
</div>
</template>

View File

@ -153,6 +153,34 @@ Extract plain text content from an HTML string.
Convert `blob` data to `data:url` data.
#### parseDataUrl(data)
> v0.6.6+
Parse `data:url` data, return:
```js
{
type,// file type of data
base64// base64 data
}
```
#### getImageSize(src)
> v0.6.6+
- `src`: The url of img
Get the size of image, return:
```js
{
width,
height
}
```
## Simulate CSS background in Canvas
Import:

View File

@ -98,6 +98,29 @@ and copying the <code>data</code> of the data object, example:</p>
<p>v0.5.9+</p>
</blockquote>
<p>Convert <code>blob</code> data to <code>data:url</code> data.</p>
<h4>parseDataUrl(data)</h4>
<blockquote>
<p>v0.6.6+</p>
</blockquote>
<p>Parse <code>data:url</code> data, return:</p>
<pre class="hljs"><code>{
type,<span class="hljs-comment">// file type of data</span>
base64<span class="hljs-comment">// base64 data</span>
}
</code></pre>
<h4>getImageSize(src)</h4>
<blockquote>
<p>v0.6.6+</p>
</blockquote>
<ul>
<li><code>src</code>: The url of img</li>
</ul>
<p>Get the size of image, return:</p>
<pre class="hljs"><code>{
width,
height
}
</code></pre>
<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

@ -2,7 +2,7 @@
> v0.2.7+
Provides methods for importing `XMind` files.
Provides methods for importing and export `XMind` files.
## Import
@ -31,6 +31,8 @@ Parsing the `.xmind` file and returning the parsed data. You can use
### xmind.transformXmind(content)
> V0.6.6+version changes the method to asynchronous and returns a Promise instance
Convert `xmind` data. The `.xmind` file is essentially a `zip` file that can be
decompressed by changing the suffix to zip. Inside, there is a `content.json`
file. If you have parsed this file yourself, you can pass the contents of this
@ -48,4 +50,14 @@ For data parsing of the `xmind8` version, because the `.xmind` file in this
version does not have a `content.json`, it corresponds to `content.xml`.
`content`: the contents of the `content.xml` file within the `.xmind` zip
package
package
### transformToXmind(data, name)
> v0.6.6+
- `data`: `simple-mind-map` data, you can get it by `mindMap.getData()` method.
- `name`: The file name to export.
Convert the `simple mind map` data to an `xmind` file. This method is asynchronous and returns an instance of `Promise`. The returned data is a `blob` type `zip` compressed package data, which you can download as a file yourself.

View File

@ -4,7 +4,7 @@
<blockquote>
<p>v0.2.7+</p>
</blockquote>
<p>Provides methods for importing <code>XMind</code> files.</p>
<p>Provides methods for importing and export <code>XMind</code> files.</p>
<h2>Import</h2>
<pre class="hljs"><code><span class="hljs-keyword">import</span> xmind <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/parse/xmind.js&#x27;</span>
</code></pre>
@ -19,6 +19,9 @@
<code>mindMap.setData(data)</code> to render the returned data to the canvas.</p>
<p><code>file</code>: <code>File</code> object</p>
<h3>xmind.transformXmind(content)</h3>
<blockquote>
<p>V0.6.6+version changes the method to asynchronous and returns a Promise instance</p>
</blockquote>
<p>Convert <code>xmind</code> data. The <code>.xmind</code> file is essentially a <code>zip</code> file that can be
decompressed by changing the suffix to zip. Inside, there is a <code>content.json</code>
file. If you have parsed this file yourself, you can pass the contents of this
@ -34,6 +37,19 @@ package</p>
version does not have a <code>content.json</code>, it corresponds to <code>content.xml</code>.</p>
<p><code>content</code>: the contents of the <code>content.xml</code> file within the <code>.xmind</code> zip
package</p>
<h3>transformToXmind(data, name)</h3>
<blockquote>
<p>v0.6.6+</p>
</blockquote>
<ul>
<li>
<p><code>data</code>: <code>simple-mind-map</code> data, you can get it by <code>mindMap.getData()</code> method.</p>
</li>
<li>
<p><code>name</code>: The file name to export.</p>
</li>
</ul>
<p>Convert the <code>simple mind map</code> data to an <code>xmind</code> file. This method is asynchronous and returns an instance of <code>Promise</code>. The returned data is a <code>blob</code> type <code>zip</code> compressed package data, which you can download as a file yourself.</p>
</div>
</template>

View File

@ -1,5 +1,13 @@
# Changelog
## 0.6.6
新增1.支持导出为Xmind新版文件。2.导入Xmind新版文件支持导入节点中的图片。 3.新增竖向时间轴结构。
修复1.TouchEvent插件不再派发click事件解决移动端点击超链接会打开两个窗口的问题。 2.修复拖拽移动一个节点成为另一个节点的子节点时该节点的父节点指向未更新的问题。 3.修复二级节点拖拽成三级节点时节点边框样式未更新的问题。 4.修复向右生长的结构外其他结构鼠标移入展开收起按钮位置时不会触发按钮显示的问题。
优化1.优化触控板缩放画布时幅度过大的问题。2.刚创建的节点默认全选方便删除默认文本。
## 0.6.5-fix.1
修复1.修复在缩放情况下调整图片大小不正确的问题。

View File

@ -1,6 +1,10 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.6</h2>
<p>新增1.支持导出为Xmind新版文件2.导入Xmind新版文件支持导入节点中的图片 3.新增竖向时间轴结构</p>
<p>修复1.TouchEvent插件不再派发click事件解决移动端点击超链接会打开两个窗口的问题 2.修复拖拽移动一个节点成为另一个节点的子节点时该节点的父节点指向未更新的问题 3.修复二级节点拖拽成三级节点时节点边框样式未更新的问题 4.修复向右生长的结构外其他结构鼠标移入展开收起按钮位置时不会触发按钮显示的问题</p>
<p>优化1.优化触控板缩放画布时幅度过大的问题2.刚创建的节点默认全选方便删除默认文本</p>
<h2>0.6.5-fix.1</h2>
<p>修复1.修复在缩放情况下调整图片大小不正确的问题</p>
<h2>0.6.5</h2>

View File

@ -1,6 +1,6 @@
# 结构
`simple-mind-map`目前支持四种结构logicalStructure逻辑结构图、mindMap思维导图、organizationStructure组织结构图、catalogOrganization目录组织图、timeline时间轴、timeline2时间轴2、fishbone鱼骨图
`simple-mind-map`目前支持四种结构logicalStructure逻辑结构图、mindMap思维导图、organizationStructure组织结构图、catalogOrganization目录组织图、timeline时间轴、timeline2时间轴2、fishbone鱼骨图、verticalTimelinev0.6.6+竖向时间轴)
可以在实例化`simple-mind-map`时通过选项指定使用的结构:

View File

@ -1,7 +1,7 @@
<template>
<div>
<h1>结构</h1>
<p><code>simple-mind-map</code>目前支持四种结构logicalStructure逻辑结构图mindMap思维导图organizationStructure组织结构图catalogOrganization目录组织图timeline时间轴timeline2时间轴2fishbone鱼骨图</p>
<p><code>simple-mind-map</code>目前支持四种结构logicalStructure逻辑结构图mindMap思维导图organizationStructure组织结构图catalogOrganization目录组织图timeline时间轴timeline2时间轴2fishbone鱼骨图verticalTimelinev0.6.6+竖向时间轴</p>
<p>可以在实例化<code>simple-mind-map</code>时通过选项指定使用的结构</p>
<pre class="hljs"><code><span class="hljs-keyword">new</span> MindMap({
<span class="hljs-comment">// ...</span>

View File

@ -4,7 +4,7 @@
> 要使用导出功能需要使用导出插件。
目前支持导出为`.smm``.json``.svg``.png``.pdf``.md`文件。
目前支持导出为`.smm``.json``.svg``.png``.pdf``.md``.xmind`文件。
`.smm``simple-mind-map`自己定义的一种文件,其实就是`json`文件,换了一个扩展名而已。
@ -94,6 +94,18 @@ mindMap.export(
mindMap.export('md', true, '文件名')
```
### 导出为xmind
> v0.6.6+
> 需要注册`ExportXMind`插件
导出为`Xmind`新版文件。
```js
mindMap.export('xmind', '文件名')
```
## 导入
目前支持从`.smm``.json``.xmind``.xlsx``.md`格式的文件导入。

View File

@ -5,7 +5,7 @@
<blockquote>
<p>要使用导出功能需要使用导出插件</p>
</blockquote>
<p>目前支持导出为<code>.smm</code><code>.json</code><code>.svg</code><code>.png</code><code>.pdf</code><code>.md</code>文件</p>
<p>目前支持导出为<code>.smm</code><code>.json</code><code>.svg</code><code>.png</code><code>.pdf</code><code>.md</code><code>.xmind</code>文件</p>
<p><code>.smm</code><code>simple-mind-map</code>自己定义的一种文件其实就是<code>json</code>文件换了一个扩展名而已</p>
<p>导出直接调用<code>export</code>方法即可</p>
<pre class="hljs"><code>mindMap.export(type, isDownload, fileName, ...)
@ -62,6 +62,16 @@ mindMap.export(<span class="hljs-string">&#x27;pdf&#x27;</span>, <span class="hl
<p>导出为<code>markdown</code>文件只要传递默认的三个参数即可</p>
<pre class="hljs"><code>mindMap.export(<span class="hljs-string">&#x27;md&#x27;</span>, <span class="hljs-literal">true</span>, <span class="hljs-string">&#x27;文件名&#x27;</span>)
</code></pre>
<h3>导出为xmind</h3>
<blockquote>
<p>v0.6.6+</p>
</blockquote>
<blockquote>
<p>需要注册<code>ExportXMind</code>插件</p>
</blockquote>
<p>导出为<code>Xmind</code>新版文件</p>
<pre class="hljs"><code>mindMap.export(<span class="hljs-string">&#x27;xmind&#x27;</span>, <span class="hljs-string">&#x27;文件名&#x27;</span>)
</code></pre>
<h2>导入</h2>
<p>目前支持从<code>.smm</code><code>.json</code><code>.xmind</code><code>.xlsx</code><code>.md</code>格式的文件导入</p>
<h3>导入smmjson</h3>

View File

@ -108,4 +108,15 @@ MindMap.usePlugin(ExportPDF)
node// svg节点
str// svg字符串
}
```
```
### xmind(name)
> v0.6.6+需要额外注册一个ExportXMind插件
```js
import ExportXMind from 'simple-mind-map/src/plugins/ExportXMind.js'
MindMap.usePlugin(ExportXMind)
```
导出为`xmind`文件类型,异步方法,返回一个`Promise`实例,返回的数据为一个`zip`压缩包的`data:url`数据,可以直接下载。

View File

@ -87,6 +87,14 @@ MindMap.usePlugin(ExportPDF)
str<span class="hljs-comment">// svg</span>
}
</code></pre>
<h3>xmind(name)</h3>
<blockquote>
<p>v0.6.6+需要额外注册一个ExportXMind插件</p>
</blockquote>
<pre class="hljs"><code><span class="hljs-keyword">import</span> ExportXMind <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/plugins/ExportXMind.js&#x27;</span>
MindMap.usePlugin(ExportXMind)
</code></pre>
<p>导出为<code>xmind</code>文件类型异步方法返回一个<code>Promise</code>实例返回的数据为一个<code>zip</code>压缩包的<code>data:url</code>数据可以直接下载</p>
</div>
</template>

View File

@ -148,6 +148,34 @@ copyNodeTree({}, node)
`blob`数据转成`data:url`数据。
#### parseDataUrl(data)
> v0.6.6+
解析`data:url`数据,返回:
```js
{
type,// 数据的文件类型
base64// base64数据
}
```
#### getImageSize(src)
> v0.6.6+
- `src`图片的url
获取图片的大小。返回:
```js
{
width,
height
}
```
## 在canvas中模拟css的背景属性
引入:

View File

@ -93,6 +93,29 @@
<p>v0.5.9+</p>
</blockquote>
<p><code>blob</code>数据转成<code>data:url</code>数据</p>
<h4>parseDataUrl(data)</h4>
<blockquote>
<p>v0.6.6+</p>
</blockquote>
<p>解析<code>data:url</code>数据返回</p>
<pre class="hljs"><code>{
type,<span class="hljs-comment">// </span>
base64<span class="hljs-comment">// base64</span>
}
</code></pre>
<h4>getImageSize(src)</h4>
<blockquote>
<p>v0.6.6+</p>
</blockquote>
<ul>
<li><code>src</code>图片的url</li>
</ul>
<p>获取图片的大小返回</p>
<pre class="hljs"><code>{
width,
height
}
</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">&#x27;simple-mind-map/src/utils/simulateCSSBackgroundInCanvas&#x27;</span>

View File

@ -2,7 +2,7 @@
> v0.2.7+
提供导入`XMind`文件的方法。
提供导入和导出`XMind`文件的方法。
## 引入
@ -30,6 +30,8 @@ simpleMindMap.xmind
### xmind.transformXmind(content)
> v0.6.6+版本该方法改为异步方法返回一个Promise实例
转换`xmind`数据,`.xmind`文件本质上是一个压缩包,改成`zip`后缀可以解压缩,里面存在一个`content.json`文件,如果你自己解析出了这个文件,那么可以把这个文件内容传递给这个方法进行转换,转换后的数据,可以使用`mindMap.setData(data)`来将返回的数据渲染到画布上
`content``.xmind`压缩包内的`content.json`文件内容
@ -40,4 +42,14 @@ simpleMindMap.xmind
针对`xmind8`版本的数据解析,因为该版本的`.xmind`文件内没有`content.json`,对应的是`content.xml`
`content``.xmind`压缩包内的`content.xml`文件内容
`content``.xmind`压缩包内的`content.xml`文件内容
### transformToXmind(data, name)
> v0.6.6+
- `data``simple-mind-map`思维导图数据,可以通过`mindMap.getData()`方法获取。
- `name`:要导出的文件名。
`simple-mind-map`数据转为`xmind`文件。该方法为异步方法,返回一个`Promise`实例,返回的数据是一个`blob`类型的`zip`压缩包数据,你可以自行下载为文件。

View File

@ -4,7 +4,7 @@
<blockquote>
<p>v0.2.7+</p>
</blockquote>
<p>提供导入<code>XMind</code>文件的方法</p>
<p>提供导入和导出<code>XMind</code>文件的方法</p>
<h2>引入</h2>
<pre class="hljs"><code><span class="hljs-keyword">import</span> xmind <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/parse/xmind.js&#x27;</span>
</code></pre>
@ -18,6 +18,9 @@
<p>解析<code>.xmind</code>文件返回解析后的数据可以使用<code>mindMap.setData(data)</code>来将返回的数据渲染到画布上</p>
<p><code>file</code><code>File</code>对象</p>
<h3>xmind.transformXmind(content)</h3>
<blockquote>
<p>v0.6.6+版本该方法改为异步方法返回一个Promise实例</p>
</blockquote>
<p>转换<code>xmind</code>数据<code>.xmind</code>文件本质上是一个压缩包改成<code>zip</code>后缀可以解压缩里面存在一个<code>content.json</code>文件如果你自己解析出了这个文件那么可以把这个文件内容传递给这个方法进行转换转换后的数据可以使用<code>mindMap.setData(data)</code>来将返回的数据渲染到画布上</p>
<p><code>content</code><code>.xmind</code>压缩包内的<code>content.json</code>文件内容</p>
<h3>xmind.transformOldXmind(content)</h3>
@ -26,6 +29,19 @@
</blockquote>
<p>针对<code>xmind8</code>版本的数据解析因为该版本的<code>.xmind</code>文件内没有<code>content.json</code>对应的是<code>content.xml</code></p>
<p><code>content</code><code>.xmind</code>压缩包内的<code>content.xml</code>文件内容</p>
<h3>transformToXmind(data, name)</h3>
<blockquote>
<p>v0.6.6+</p>
</blockquote>
<ul>
<li>
<p><code>data</code><code>simple-mind-map</code>思维导图数据可以通过<code>mindMap.getData()</code>方法获取</p>
</li>
<li>
<p><code>name</code>要导出的文件名</p>
</li>
</ul>
<p><code>simple-mind-map</code>数据转为<code>xmind</code>文件该方法为异步方法返回一个<code>Promise</code>实例返回的数据是一个<code>blob</code>类型的<code>zip</code>压缩包数据你可以自行下载为文件</p>
</div>
</template>