diff --git a/README.md b/README.md index dd269b3a..04935180 100644 --- a/README.md +++ b/README.md @@ -169,4 +169,8 @@ const mindMap = new MindMap({ 布林 + + + 南风 +

\ No newline at end of file diff --git a/web/src/assets/avatar/南风.jpg b/web/src/assets/avatar/南风.jpg new file mode 100644 index 00000000..562987e9 Binary files /dev/null and b/web/src/assets/avatar/南风.jpg differ diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js index b14774f4..f98610d9 100644 --- a/web/src/pages/Doc/catalogList.js +++ b/web/src/pages/Doc/catalogList.js @@ -11,7 +11,7 @@ let langList = [ } ] let StartList = ['introduction', 'start', 'deploy', 'client', 'translate', 'changelog'] -let CourseList = new Array(22).fill(0).map((_, index) => { +let CourseList = new Array(24).fill(0).map((_, index) => { return 'course' + (index + 1) }) let APIList = [ @@ -34,6 +34,7 @@ let APIList = [ 'nodeImgAdjust', 'search', 'painter', + 'scrollbar', 'xmind', 'markdown', 'utils' diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md index 2122c69f..19a4a42d 100644 --- a/web/src/pages/Doc/en/changelog/index.md +++ b/web/src/pages/Doc/en/changelog/index.md @@ -1,5 +1,55 @@ # Changelog +## 0.7.0 + +Breaking change: Removed the section of node activation style in the theme file, Setting the activation style of nodes is no longer supported, and the activation effect has been changed to a unified node outer border style, while also supporting the mouse hover effect. + +Fix: + +> 1.Fix rendering anomalies when the node border size is relatively large. +> +> 2.Fixed an issue where the node style of the associated line will not be updated when switching themes. +> +> 3.Fix that selecting all did not trigger node_ The issue with active events. + +新增: + +> 1.When folding nodes, displays the number of collapsed nodes. +> +> 2.Support the position of the endpoint of the associated line to follow mouse drag changes. +> +> 3.Add a scrollbar plugin. +> +> 4.Support opening specified online files through fileURL query parameters in URLs. +> +> 5.The fishbone diagram supports setting node margins. +> +> 6.By default, double-click to reset the canvas. +> +> 7.Modify the parameters of the export image method, and when exporting PDF, if the size of the mind map is smaller than A4 paper, do not rotate the direction. +> +> 8.Improve the clarity of exported images and PDFs on high-definition screens. +> +> 9.Add a pre destruction lifecycle function to the plugin to address the issue of some side effects that were not cleared during the destruction of the mind map. +> +> 10.Optimize the settings of the basic style and do not trigger full rendering when modifying theme attributes that do not affect size. +> +> 11.Prohibit triggering node right-click menu events when multiple node selections are completed, to avoid triggering the right-click menu display. +> +> 12.Optimize the Select plugin so that if multiple selected nodes do not change, the activation event is not triggered. +> +> 13.The activation node list thrown by event node_active no longer directly references the internal activation list. +> +> 14.Optimize the logic of mouse button down node events, and support dragging the canvas by holding down the root node with the right mouse button in the right-click drag and drop canvas mode. + +Demo: + +> 1.Do not directly reference the internal activation node list to optimize performance. +> +> 2.Support configuring whether to display scrollbars. +> +> 3.Delete the active node configuration in the sidebar node style configuration section. + ## 0.6.17 Fix: diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue index e0c5e977..cdcf02fe 100644 --- a/web/src/pages/Doc/en/changelog/index.vue +++ b/web/src/pages/Doc/en/changelog/index.vue @@ -1,6 +1,37 @@ diff --git a/web/src/pages/Doc/en/node/index.md b/web/src/pages/Doc/en/node/index.md index 74d54d3a..60bd459e 100644 --- a/web/src/pages/Doc/en/node/index.md +++ b/web/src/pages/Doc/en/node/index.md @@ -110,17 +110,21 @@ Get the final style value applied to this node `root`: whether it is the root node, default `false` -`isActive`: whether the value being fetched is the active state style value, +`isActive`: v0.7.0+has been abandoned, whether the value being fetched is the active state style value, default `false` ### setStyle(prop, value, isActive) +- `isActive`: v0.7.0+has been abandoned + Modify a style of the node, a shortcut method for the `SET_NODE_STYLE` command ### setStyles(style, isActive) > v0.6.12+ +- `isActive`: v0.7.0+has been abandoned + Modify multiple styles of nodes, a shortcut method for the `SET_NODE_STYLES` command ### getData(key) diff --git a/web/src/pages/Doc/en/node/index.vue b/web/src/pages/Doc/en/node/index.vue index eb479570..fc5f1ed9 100644 --- a/web/src/pages/Doc/en/node/index.vue +++ b/web/src/pages/Doc/en/node/index.vue @@ -64,14 +64,20 @@

Get the final style value applied to this node

prop: the style property to get

root: whether it is the root node, default false

-

isActive: whether the value being fetched is the active state style value, +

isActive: v0.7.0+has been abandoned, whether the value being fetched is the active state style value, default false

setStyle(prop, value, isActive)

+

Modify a style of the node, a shortcut method for the SET_NODE_STYLE command

setStyles(style, isActive)

v0.6.12+

+

Modify multiple styles of nodes, a shortcut method for the SET_NODE_STYLES command

getData(key)

Get the specified value in the data object of the node's real data nodeData, diff --git a/web/src/pages/Doc/en/scrollbar/index.md b/web/src/pages/Doc/en/scrollbar/index.md new file mode 100644 index 00000000..10974f51 --- /dev/null +++ b/web/src/pages/Doc/en/scrollbar/index.md @@ -0,0 +1,64 @@ +# Scrollbar plugin + +> v0.7.0+ + +This plugin is used to help develop the functionality of horizontal and vertical scrollbar. + +## Register + +```js +import MindMap from 'simple-mind-map' +import Scrollbar from 'simple-mind-map/src/plugins/Scrollbar.js' +MindMap.usePlugin(Scrollbar) +``` + +After registration and instantiation of `MindMap`, the instance can be obtained through `mindMap.scrollbar`. + +## Event + +#### scrollbar_change + +Triggered when the scrollbar data changes, you can listen to this event to update the position and size of the scrollbar. + +## Method + +### setScrollBarWrapSize(width, height) + +- `width`: Number, The width of your scrollbar container element. + +- `height`: Number, The height of your scrollbar container element. + +Set the size of the scroll bar container, which is the width of the container for horizontal scrollbars and the height of the container for vertical scrollbars. When your scrollbar container size changes, you need to call this method again. + +### calculationScrollbar() + +> You need to first call the setScrollBarWrapSize method to set the width and height of the scroll bar container element. +> +> Generally, it is necessary to monitor scrollbar_change event, and then call it to update the scroll bar. + +Return value: + +```js +{ + // Vertical scrollbar + vertical: { + top, + height + }, + // Horizontal scrollbar + horizontal: { + left, + width + } +} +``` + +Obtain the size and position of the scroll bar, and you can set it to the scroll bar element based on the return value to achieve the effect of rendering and caring about the scroll bar. + +### onMousedown(e, type) + +- `e`: The event object for the mouse down event. + +- `type`: The type of scroll bar pressed, vertical(Vertical scrollbar)、horizontal(Horizontal scrollbar)。 + +This method needs to be called when the mouse press event of the scrollbar element occurs. \ No newline at end of file diff --git a/web/src/pages/Doc/en/scrollbar/index.vue b/web/src/pages/Doc/en/scrollbar/index.vue new file mode 100644 index 00000000..d5851f33 --- /dev/null +++ b/web/src/pages/Doc/en/scrollbar/index.vue @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file diff --git a/web/src/pages/Doc/en/search/index.md b/web/src/pages/Doc/en/search/index.md index 215917f6..8ba3235b 100644 --- a/web/src/pages/Doc/en/search/index.md +++ b/web/src/pages/Doc/en/search/index.md @@ -12,7 +12,7 @@ import Search from 'simple-mind-map/src/plugins/Search.js' MindMap.usePlugin(Search) ``` -After registration and instantiation of `MindMap`, the instance can be obtained through `mindMap.Search`. +After registration and instantiation of `MindMap`, the instance can be obtained through `mindMap.search`. ## Event diff --git a/web/src/pages/Doc/en/search/index.vue b/web/src/pages/Doc/en/search/index.vue index c47b9d40..26f7d4e9 100644 --- a/web/src/pages/Doc/en/search/index.vue +++ b/web/src/pages/Doc/en/search/index.vue @@ -10,7 +10,7 @@ import Search from 'simple-mind-map/src/plugins/Search.js' MindMap.usePlugin(Search) -

After registration and instantiation of MindMap, the instance can be obtained through mindMap.Search.

+

After registration and instantiation of MindMap, the instance can be obtained through mindMap.search.

Event

search_info_change

You can listen to 'search_info_change' event to get the number of current search results and the index currently located.

diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js index 578b9aa2..88f8964b 100644 --- a/web/src/pages/Doc/routerList.js +++ b/web/src/pages/Doc/routerList.js @@ -29,6 +29,8 @@ export default [ { path: 'course20', title: '如何自定义节点内容' }, { path: 'course21', title: '如何复制、剪切、粘贴' }, { path: 'course22', title: '如何实现搜索、替换' }, + { path: 'course23', title: '如何渲染滚动条' }, + { path: 'course24', title: '如何开发一个插件' }, { path: 'doExport', title: 'Export 插件' }, { path: 'drag', title: 'Drag插件' }, { path: 'introduction', title: '简介' }, @@ -52,7 +54,8 @@ export default [ { path: 'nodeImgAdjust', title: 'NodeImgAdjust插件' }, { path: 'search', title: 'Search插件' }, { path: 'painter', title: 'Painter插件' }, - { path: 'help1', title: '概要/关联线' }, + { path: 'painter', title: 'Painter插件' }, + { path: 'scrollbar', title: 'Scrollbar插件' }, { path: 'help2', title: '客户端' } ] }, @@ -85,7 +88,8 @@ export default [ { path: 'touchEvent', title: 'TouchEvent plugin' }, { path: 'nodeImgAdjust', title: 'NodeImgAdjust plugin' }, { path: 'search', title: 'Search plugin' }, - { path: 'painter', title: 'Painter plugin' } + { path: 'painter', title: 'Painter plugin' }, + { path: 'scrollbar', title: 'Scrollbar plugin' } ] } ] diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md index 213a6609..32722852 100644 --- a/web/src/pages/Doc/zh/changelog/index.md +++ b/web/src/pages/Doc/zh/changelog/index.md @@ -1,5 +1,55 @@ # Changelog +## 0.7.0 + +破坏性更新:删除了主题文件中节点激活样式的部分,不再支持设置节点的激活样式,激活效果改为统一的节点外边框样式,同时支持鼠标hover效果。 + +修复: + +> 1.修复节点边框尺寸比较大的情况下的的渲染异常问题。 +> +> 2.修复切换主题时存在关联线的节点样式不会更新的问题。 +> +> 3.修复全选没有触发node_active事件的问题。 + +新增: + +> 1.收起节点时,显示折叠的节点数量。 +> +> 2.支持关联线端点的位置跟随鼠标拖拽变化。 +> +> 3.新增滚动条插件。 +> +> 4.支持在url中通过fileURL查询参数打开指定的在线文件。 +> +> 5.鱼骨图支持设置节点margin。 +> +> 6.默认关闭双击复位画布。 +> +> 7.修改导出图片方法的参数,导出pdf时如果思维导图尺寸小于a4纸那么不旋转方向。 +> +> 8.提升导出的图片和pdf在高清屏的清晰度。 +> +> 9.插件新增销毁前生命周期函数,解决销毁思维导图时插件的一些副作用没有清除的问题。 +> +> 10.优化基础样式的设置,修改不影响大小的主题属性时不触发全量渲染。 +> +> 11.右键多选节点结束时禁止触发节点右键菜单事件,避免触发右键菜单显示。 +> +> 12.优化Select插件,如果多选节点没有变化,那么不触发激活激活事件。 +> +> 13.node_active事件抛出的激活节点列表不再直接引用内部激活列表。 +> +> 14.优化鼠标按下节点事件逻辑,在右键拖拽画布模式下支持右键按住根节点拖拽画布。 + +Demo: + +> 1.不直接引用内部激活节点列表,优化性能。 +> +> 2.支持配置是否显示滚动条。 +> +> 3.删除侧边栏节点样式配置部分的激活节点配置。 + ## 0.6.17 修复: diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue index a98e89cd..73cfeb0f 100644 --- a/web/src/pages/Doc/zh/changelog/index.vue +++ b/web/src/pages/Doc/zh/changelog/index.vue @@ -1,6 +1,37 @@ diff --git a/web/src/pages/Doc/zh/node/index.md b/web/src/pages/Doc/zh/node/index.md index dd7ea6a9..67706eb7 100644 --- a/web/src/pages/Doc/zh/node/index.md +++ b/web/src/pages/Doc/zh/node/index.md @@ -110,16 +110,20 @@ `root`:是否是根节点,默认`false` -`isActive`:获取的是否是激活状态的样式值,默认`false` +`isActive`:v0.7.0+已废弃,获取的是否是激活状态的样式值,默认`false` ### setStyle(prop, value, isActive) +`isActive`:v0.7.0+已废弃 + 修改节点的某个样式,`SET_NODE_STYLE`命令的快捷方法 ### setStyles(style, isActive) > v0.6.12+ +`isActive`:v0.7.0+已废弃 + 修改节点多个样式,`SET_NODE_STYLES`命令的快捷方法 ### getData(key) diff --git a/web/src/pages/Doc/zh/node/index.vue b/web/src/pages/Doc/zh/node/index.vue index ffc2a5cc..8642a410 100644 --- a/web/src/pages/Doc/zh/node/index.vue +++ b/web/src/pages/Doc/zh/node/index.vue @@ -64,13 +64,15 @@

获取某个最终应用到该节点的样式值

prop:要获取的样式属性

root:是否是根节点,默认false

-

isActive:获取的是否是激活状态的样式值,默认false

+

isActive:v0.7.0+已废弃,获取的是否是激活状态的样式值,默认false

setStyle(prop, value, isActive)

+

isActive:v0.7.0+已废弃

修改节点的某个样式,SET_NODE_STYLE命令的快捷方法

setStyles(style, isActive)

v0.6.12+

+

isActive:v0.7.0+已废弃

修改节点多个样式,SET_NODE_STYLES命令的快捷方法

getData(key)

获取该节点真实数据nodeDatadata对象里的指定值,key不传返回这个data对象

diff --git a/web/src/pages/Doc/zh/scrollbar/index.md b/web/src/pages/Doc/zh/scrollbar/index.md new file mode 100644 index 00000000..49a20d1e --- /dev/null +++ b/web/src/pages/Doc/zh/scrollbar/index.md @@ -0,0 +1,64 @@ +# Scrollbar 插件 + +> v0.7.0+ + +该插件用于帮助开发水平和垂直滚动条的功能。 + +## 注册 + +```js +import MindMap from 'simple-mind-map' +import Scrollbar from 'simple-mind-map/src/plugins/Scrollbar.js' +MindMap.usePlugin(Scrollbar) +``` + +注册完且实例化`MindMap`后可通过`mindMap.scrollbar`获取到该实例。 + +## 事件 + +#### scrollbar_change + +当滚动条数据发生改变时触发,你可以监听该事件来更新滚动条位置和大小。 + +## 方法 + +### setScrollBarWrapSize(width, height) + +- `width`:Number,你的滚动条容器元素的宽度。 + +- `height`: Number,你的滚动条容器元素的高度。 + +设置滚动条容器的大小,对于水平滚动条,即容器的宽度,对于垂直滚动条,即容器的高度。当你的滚动条容器尺寸改变时需要再次调用该方法。 + +### calculationScrollbar() + +> 需要先调用setScrollBarWrapSize方法设置滚动条容器元素的宽高。 +> +> 一般需要监听scrollbar_change事件,然后调用该方法更新滚动条。 + +返回值: + +```js +{ + // 垂直滚动条 + vertical: { + top, + height + }, + // 水平滚动条 + horizontal: { + left, + width + } +} +``` + +获取滚动条大小和位置,你可以根据返回值来设置到滚动条元素上,达到渲染和关心滚动条的效果。 + +### onMousedown(e, type) + +- `e`:鼠标按下事件的事件对象。 + +- `type`:按下的滚动条类型,vertical(垂直滚动条)、horizontal(水平滚动条)。 + +滚动条元素的鼠标按下事件时需要调用该方法。 \ No newline at end of file diff --git a/web/src/pages/Doc/zh/scrollbar/index.vue b/web/src/pages/Doc/zh/scrollbar/index.vue new file mode 100644 index 00000000..fc06ba0f --- /dev/null +++ b/web/src/pages/Doc/zh/scrollbar/index.vue @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file