diff --git a/index.html b/index.html index c55465f5..960e63dd 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
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.
Fix: 1.Fix the issue of adjusting the image size incorrectly while zooming.
+v0.6.6+, an additional ExportXMind plugin needs to be registered +
v0.6.6+, an additional ExportXMind plugin needs to be registered
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.
xmind
Promise
data:url
zip
data
v0.5.9+
Convert blob data to data:url data.
blob
+v0.6.6+ +
v0.6.6+
Parse data:url data, return:
{ + type,// file type of data + base64// base64 data +} +
src
Get the size of image, return:
{ + width, + height +} +
Import:
import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas' diff --git a/web/src/pages/Doc/en/xmind/index.md b/web/src/pages/Doc/en/xmind/index.md index 28556fb4..63181372 100644 --- a/web/src/pages/Doc/en/xmind/index.md +++ b/web/src/pages/Doc/en/xmind/index.md @@ -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 \ No newline at end of file +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. \ No newline at end of file diff --git a/web/src/pages/Doc/en/xmind/index.vue b/web/src/pages/Doc/en/xmind/index.vue index c8bc7f05..713a5782 100644 --- a/web/src/pages/Doc/en/xmind/index.vue +++ b/web/src/pages/Doc/en/xmind/index.vue @@ -4,7 +4,7 @@ v0.2.7+ -Provides methods for importing XMind files. +Provides methods for importing and export XMind files. Import import xmind from 'simple-mind-map/src/parse/xmind.js' @@ -19,6 +19,9 @@ mindMap.setData(data) to render the returned data to the canvas. file: File object 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 @@ -34,6 +37,19 @@ package 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 +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. diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md index e16211be..1318fbf1 100644 --- a/web/src/pages/Doc/zh/changelog/index.md +++ b/web/src/pages/Doc/zh/changelog/index.md @@ -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.修复在缩放情况下调整图片大小不正确的问题。 diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue index 0c2ae343..3e43e1d5 100644 --- a/web/src/pages/Doc/zh/changelog/index.vue +++ b/web/src/pages/Doc/zh/changelog/index.vue @@ -1,6 +1,10 @@ Changelog +0.6.6 +新增:1.支持导出为Xmind新版文件。2.导入Xmind新版文件支持导入节点中的图片。 3.新增竖向时间轴结构。 +修复:1.TouchEvent插件不再派发click事件,解决移动端点击超链接会打开两个窗口的问题。 2.修复拖拽移动一个节点成为另一个节点的子节点时该节点的父节点指向未更新的问题。 3.修复二级节点拖拽成三级节点时节点边框样式未更新的问题。 4.修复向右生长的结构外其他结构鼠标移入展开收起按钮位置时不会触发按钮显示的问题。 +优化:1.优化触控板缩放画布时幅度过大的问题。2.刚创建的节点默认全选方便删除默认文本。 0.6.5-fix.1 修复:1.修复在缩放情况下调整图片大小不正确的问题。 0.6.5 diff --git a/web/src/pages/Doc/zh/course11/index.md b/web/src/pages/Doc/zh/course11/index.md index 462f19de..c96dea81 100644 --- a/web/src/pages/Doc/zh/course11/index.md +++ b/web/src/pages/Doc/zh/course11/index.md @@ -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(鱼骨图)、verticalTimeline(v0.6.6+竖向时间轴)。 可以在实例化`simple-mind-map`时通过选项指定使用的结构: diff --git a/web/src/pages/Doc/zh/course11/index.vue b/web/src/pages/Doc/zh/course11/index.vue index 94b1db73..a7705939 100644 --- a/web/src/pages/Doc/zh/course11/index.vue +++ b/web/src/pages/Doc/zh/course11/index.vue @@ -1,7 +1,7 @@ 结构 -simple-mind-map目前支持四种结构:logicalStructure(逻辑结构图)、mindMap(思维导图)、organizationStructure(组织结构图)、catalogOrganization(目录组织图)、timeline(时间轴)、timeline2(时间轴2)、fishbone(鱼骨图)。 +simple-mind-map目前支持四种结构:logicalStructure(逻辑结构图)、mindMap(思维导图)、organizationStructure(组织结构图)、catalogOrganization(目录组织图)、timeline(时间轴)、timeline2(时间轴2)、fishbone(鱼骨图)、verticalTimeline(v0.6.6+竖向时间轴)。 可以在实例化simple-mind-map时通过选项指定使用的结构: new MindMap({ // ... diff --git a/web/src/pages/Doc/zh/course17/index.md b/web/src/pages/Doc/zh/course17/index.md index ffbfba7e..4a1a881f 100644 --- a/web/src/pages/Doc/zh/course17/index.md +++ b/web/src/pages/Doc/zh/course17/index.md @@ -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`格式的文件导入。 diff --git a/web/src/pages/Doc/zh/course17/index.vue b/web/src/pages/Doc/zh/course17/index.vue index 92520b32..90eef0f0 100644 --- a/web/src/pages/Doc/zh/course17/index.vue +++ b/web/src/pages/Doc/zh/course17/index.vue @@ -5,7 +5,7 @@ 要使用导出功能需要使用导出插件。 -目前支持导出为.smm、.json、.svg、.png、.pdf、.md文件。 +目前支持导出为.smm、.json、.svg、.png、.pdf、.md、.xmind文件。 .smm是simple-mind-map自己定义的一种文件,其实就是json文件,换了一个扩展名而已。 导出直接调用export方法即可: mindMap.export(type, isDownload, fileName, ...) @@ -62,6 +62,16 @@ mindMap.export('pdf', mindMap.export('md', true, '文件名') +导出为xmind + +v0.6.6+ + + +需要注册ExportXMind插件 + +导出为Xmind新版文件。 +mindMap.export('xmind', '文件名') + 导入 目前支持从.smm、.json、.xmind、.xlsx、.md格式的文件导入。 导入smm、json diff --git a/web/src/pages/Doc/zh/doExport/index.md b/web/src/pages/Doc/zh/doExport/index.md index 4ff7adff..6e36f810 100644 --- a/web/src/pages/Doc/zh/doExport/index.md +++ b/web/src/pages/Doc/zh/doExport/index.md @@ -108,4 +108,15 @@ MindMap.usePlugin(ExportPDF) node// svg节点 str// svg字符串 } -``` \ No newline at end of file +``` + +### 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`数据,可以直接下载。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/doExport/index.vue b/web/src/pages/Doc/zh/doExport/index.vue index 155596d0..e80bf36f 100644 --- a/web/src/pages/Doc/zh/doExport/index.vue +++ b/web/src/pages/Doc/zh/doExport/index.vue @@ -87,6 +87,14 @@ MindMap.usePlugin(ExportPDF) str// svg字符串 } +xmind(name) + +v0.6.6+,需要额外注册一个ExportXMind插件 + +import ExportXMind from 'simple-mind-map/src/plugins/ExportXMind.js' +MindMap.usePlugin(ExportXMind) + +导出为xmind文件类型,异步方法,返回一个Promise实例,返回的数据为一个zip压缩包的data:url数据,可以直接下载。 diff --git a/web/src/pages/Doc/zh/utils/index.md b/web/src/pages/Doc/zh/utils/index.md index 57988fcc..6266c589 100644 --- a/web/src/pages/Doc/zh/utils/index.md +++ b/web/src/pages/Doc/zh/utils/index.md @@ -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的背景属性 引入: diff --git a/web/src/pages/Doc/zh/utils/index.vue b/web/src/pages/Doc/zh/utils/index.vue index 9e90611e..5c2b8244 100644 --- a/web/src/pages/Doc/zh/utils/index.vue +++ b/web/src/pages/Doc/zh/utils/index.vue @@ -93,6 +93,29 @@ v0.5.9+ 将blob数据转成data:url数据。 +parseDataUrl(data) + +v0.6.6+ + +解析data:url数据,返回: +{ + type,// 数据的文件类型 + base64// base64数据 +} + +getImageSize(src) + +v0.6.6+ + + +src:图片的url + +获取图片的大小。返回: +{ + width, + height +} + 在canvas中模拟css的背景属性 引入: import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas' diff --git a/web/src/pages/Doc/zh/xmind/index.md b/web/src/pages/Doc/zh/xmind/index.md index 3cddc765..10f25302 100644 --- a/web/src/pages/Doc/zh/xmind/index.md +++ b/web/src/pages/Doc/zh/xmind/index.md @@ -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`文件内容 \ No newline at end of file +`content`:`.xmind`压缩包内的`content.xml`文件内容 + +### transformToXmind(data, name) + +> v0.6.6+ + +- `data`:`simple-mind-map`思维导图数据,可以通过`mindMap.getData()`方法获取。 + +- `name`:要导出的文件名。 + +将`simple-mind-map`数据转为`xmind`文件。该方法为异步方法,返回一个`Promise`实例,返回的数据是一个`blob`类型的`zip`压缩包数据,你可以自行下载为文件。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/xmind/index.vue b/web/src/pages/Doc/zh/xmind/index.vue index 31bba7a9..d5b58a3a 100644 --- a/web/src/pages/Doc/zh/xmind/index.vue +++ b/web/src/pages/Doc/zh/xmind/index.vue @@ -4,7 +4,7 @@ v0.2.7+ -提供导入XMind文件的方法。 +提供导入和导出XMind文件的方法。 引入 import xmind from 'simple-mind-map/src/parse/xmind.js' @@ -18,6 +18,9 @@ 解析.xmind文件,返回解析后的数据,可以使用mindMap.setData(data)来将返回的数据渲染到画布上 file:File对象 xmind.transformXmind(content) + +v0.6.6+版本该方法改为异步方法,返回一个Promise实例 + 转换xmind数据,.xmind文件本质上是一个压缩包,改成zip后缀可以解压缩,里面存在一个content.json文件,如果你自己解析出了这个文件,那么可以把这个文件内容传递给这个方法进行转换,转换后的数据,可以使用mindMap.setData(data)来将返回的数据渲染到画布上 content:.xmind压缩包内的content.json文件内容 xmind.transformOldXmind(content) @@ -26,6 +29,19 @@ 针对xmind8版本的数据解析,因为该版本的.xmind文件内没有content.json,对应的是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压缩包数据,你可以自行下载为文件。 diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index 047ffcf6..dea28a8b 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -27,6 +27,7 @@ import MiniMap from 'simple-mind-map/src/plugins/MiniMap.js' import Watermark from 'simple-mind-map/src/plugins/Watermark.js' import KeyboardNavigation from 'simple-mind-map/src/plugins/KeyboardNavigation.js' import ExportPDF from 'simple-mind-map/src/plugins/ExportPDF.js' +import ExportXMind from 'simple-mind-map/src/plugins/ExportXMind.js' import Export from 'simple-mind-map/src/plugins/Export.js' import Drag from 'simple-mind-map/src/plugins/Drag.js' import Select from 'simple-mind-map/src/plugins/Select.js' @@ -66,6 +67,7 @@ MindMap .usePlugin(Drag) .usePlugin(KeyboardNavigation) .usePlugin(ExportPDF) + .usePlugin(ExportXMind) .usePlugin(Export) .usePlugin(Select) .usePlugin(AssociativeLine) diff --git a/web/src/pages/Edit/components/Import.vue b/web/src/pages/Edit/components/Import.vue index e79cdd84..e936066d 100644 --- a/web/src/pages/Edit/components/Import.vue +++ b/web/src/pages/Edit/components/Import.vue @@ -150,7 +150,6 @@ export default { async handleXmind(file) { try { let data = await xmind.parseXmindFile(file.raw) - console.log(data); this.$bus.$emit('setData', data) this.$message.success('导入成功') } catch (error) {
v0.2.7+
Provides methods for importing XMind files.
XMind
Provides methods for importing and export XMind files.
import xmind from 'simple-mind-map/src/parse/xmind.js'
mindMap.setData(data)
file: File object
file
File
+V0.6.6+version changes the method to asynchronous and returns a Promise instance +
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 @@ -34,6 +37,19 @@ package
.xmind
content.json
content.xml
content: the contents of the content.xml file within the .xmind zip package
content
data: simple-mind-map data, you can get it by mindMap.getData() method.
simple-mind-map
mindMap.getData()
name: The file name to export.
name
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.
simple mind map
新增:1.支持导出为Xmind新版文件。2.导入Xmind新版文件支持导入节点中的图片。 3.新增竖向时间轴结构。
修复:1.TouchEvent插件不再派发click事件,解决移动端点击超链接会打开两个窗口的问题。 2.修复拖拽移动一个节点成为另一个节点的子节点时该节点的父节点指向未更新的问题。 3.修复二级节点拖拽成三级节点时节点边框样式未更新的问题。 4.修复向右生长的结构外其他结构鼠标移入展开收起按钮位置时不会触发按钮显示的问题。
优化:1.优化触控板缩放画布时幅度过大的问题。2.刚创建的节点默认全选方便删除默认文本。
修复:1.修复在缩放情况下调整图片大小不正确的问题。
simple-mind-map目前支持四种结构:logicalStructure(逻辑结构图)、mindMap(思维导图)、organizationStructure(组织结构图)、catalogOrganization(目录组织图)、timeline(时间轴)、timeline2(时间轴2)、fishbone(鱼骨图)。
simple-mind-map目前支持四种结构:logicalStructure(逻辑结构图)、mindMap(思维导图)、organizationStructure(组织结构图)、catalogOrganization(目录组织图)、timeline(时间轴)、timeline2(时间轴2)、fishbone(鱼骨图)、verticalTimeline(v0.6.6+竖向时间轴)。
可以在实例化simple-mind-map时通过选项指定使用的结构:
new MindMap({ // ... diff --git a/web/src/pages/Doc/zh/course17/index.md b/web/src/pages/Doc/zh/course17/index.md index ffbfba7e..4a1a881f 100644 --- a/web/src/pages/Doc/zh/course17/index.md +++ b/web/src/pages/Doc/zh/course17/index.md @@ -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`格式的文件导入。 diff --git a/web/src/pages/Doc/zh/course17/index.vue b/web/src/pages/Doc/zh/course17/index.vue index 92520b32..90eef0f0 100644 --- a/web/src/pages/Doc/zh/course17/index.vue +++ b/web/src/pages/Doc/zh/course17/index.vue @@ -5,7 +5,7 @@ 要使用导出功能需要使用导出插件。 -目前支持导出为.smm、.json、.svg、.png、.pdf、.md文件。 +目前支持导出为.smm、.json、.svg、.png、.pdf、.md、.xmind文件。 .smm是simple-mind-map自己定义的一种文件,其实就是json文件,换了一个扩展名而已。 导出直接调用export方法即可: mindMap.export(type, isDownload, fileName, ...) @@ -62,6 +62,16 @@ mindMap.export('pdf', mindMap.export('md', true, '文件名') +导出为xmind + +v0.6.6+ + + +需要注册ExportXMind插件 + +导出为Xmind新版文件。 +mindMap.export('xmind', '文件名') + 导入 目前支持从.smm、.json、.xmind、.xlsx、.md格式的文件导入。 导入smm、json diff --git a/web/src/pages/Doc/zh/doExport/index.md b/web/src/pages/Doc/zh/doExport/index.md index 4ff7adff..6e36f810 100644 --- a/web/src/pages/Doc/zh/doExport/index.md +++ b/web/src/pages/Doc/zh/doExport/index.md @@ -108,4 +108,15 @@ MindMap.usePlugin(ExportPDF) node// svg节点 str// svg字符串 } -``` \ No newline at end of file +``` + +### 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`数据,可以直接下载。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/doExport/index.vue b/web/src/pages/Doc/zh/doExport/index.vue index 155596d0..e80bf36f 100644 --- a/web/src/pages/Doc/zh/doExport/index.vue +++ b/web/src/pages/Doc/zh/doExport/index.vue @@ -87,6 +87,14 @@ MindMap.usePlugin(ExportPDF) str// svg字符串 }
要使用导出功能需要使用导出插件。
目前支持导出为.smm、.json、.svg、.png、.pdf、.md文件。
.smm
.json
.svg
.png
.pdf
.md
目前支持导出为.smm、.json、.svg、.png、.pdf、.md、.xmind文件。
.smm是simple-mind-map自己定义的一种文件,其实就是json文件,换了一个扩展名而已。
json
导出直接调用export方法即可:
export
mindMap.export(type, isDownload, fileName, ...) @@ -62,6 +62,16 @@ mindMap.export('pdf', mindMap.export('md', true, '文件名')
mindMap.export('md', true, '文件名')
+需要注册ExportXMind插件 +
需要注册ExportXMind插件
ExportXMind
导出为Xmind新版文件。
Xmind
mindMap.export('xmind', '文件名') +
目前支持从.smm、.json、.xmind、.xlsx、.md格式的文件导入。
.xlsx
+v0.6.6+,需要额外注册一个ExportXMind插件 +
v0.6.6+,需要额外注册一个ExportXMind插件
导出为xmind文件类型,异步方法,返回一个Promise实例,返回的数据为一个zip压缩包的data:url数据,可以直接下载。
将blob数据转成data:url数据。
解析data:url数据,返回:
{ + type,// 数据的文件类型 + base64// base64数据 +} +
获取图片的大小。返回:
引入:
import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas' diff --git a/web/src/pages/Doc/zh/xmind/index.md b/web/src/pages/Doc/zh/xmind/index.md index 3cddc765..10f25302 100644 --- a/web/src/pages/Doc/zh/xmind/index.md +++ b/web/src/pages/Doc/zh/xmind/index.md @@ -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`文件内容 \ No newline at end of file +`content`:`.xmind`压缩包内的`content.xml`文件内容 + +### transformToXmind(data, name) + +> v0.6.6+ + +- `data`:`simple-mind-map`思维导图数据,可以通过`mindMap.getData()`方法获取。 + +- `name`:要导出的文件名。 + +将`simple-mind-map`数据转为`xmind`文件。该方法为异步方法,返回一个`Promise`实例,返回的数据是一个`blob`类型的`zip`压缩包数据,你可以自行下载为文件。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/xmind/index.vue b/web/src/pages/Doc/zh/xmind/index.vue index 31bba7a9..d5b58a3a 100644 --- a/web/src/pages/Doc/zh/xmind/index.vue +++ b/web/src/pages/Doc/zh/xmind/index.vue @@ -4,7 +4,7 @@ v0.2.7+ -提供导入XMind文件的方法。 +提供导入和导出XMind文件的方法。 引入 import xmind from 'simple-mind-map/src/parse/xmind.js' @@ -18,6 +18,9 @@ 解析.xmind文件,返回解析后的数据,可以使用mindMap.setData(data)来将返回的数据渲染到画布上 file:File对象 xmind.transformXmind(content) + +v0.6.6+版本该方法改为异步方法,返回一个Promise实例 + 转换xmind数据,.xmind文件本质上是一个压缩包,改成zip后缀可以解压缩,里面存在一个content.json文件,如果你自己解析出了这个文件,那么可以把这个文件内容传递给这个方法进行转换,转换后的数据,可以使用mindMap.setData(data)来将返回的数据渲染到画布上 content:.xmind压缩包内的content.json文件内容 xmind.transformOldXmind(content) @@ -26,6 +29,19 @@ 针对xmind8版本的数据解析,因为该版本的.xmind文件内没有content.json,对应的是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压缩包数据,你可以自行下载为文件。
提供导入XMind文件的方法。
提供导入和导出XMind文件的方法。
解析.xmind文件,返回解析后的数据,可以使用mindMap.setData(data)来将返回的数据渲染到画布上
file:File对象
+v0.6.6+版本该方法改为异步方法,返回一个Promise实例 +
v0.6.6+版本该方法改为异步方法,返回一个Promise实例
转换xmind数据,.xmind文件本质上是一个压缩包,改成zip后缀可以解压缩,里面存在一个content.json文件,如果你自己解析出了这个文件,那么可以把这个文件内容传递给这个方法进行转换,转换后的数据,可以使用mindMap.setData(data)来将返回的数据渲染到画布上
content:.xmind压缩包内的content.json文件内容
针对xmind8版本的数据解析,因为该版本的.xmind文件内没有content.json,对应的是content.xml。
xmind8
content:.xmind压缩包内的content.xml文件内容
data:simple-mind-map思维导图数据,可以通过mindMap.getData()方法获取。
name:要导出的文件名。
将simple-mind-map数据转为xmind文件。该方法为异步方法,返回一个Promise实例,返回的数据是一个blob类型的zip压缩包数据,你可以自行下载为文件。