Merge branch 'wanglin2:main' into main

This commit is contained in:
lxr-cel 2024-01-04 22:33:31 +08:00 committed by GitHub
commit c50f278ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
218 changed files with 2124 additions and 2606 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
node_modules
.DS_Store
dist_electron
simple-mind-map/dist
simple-mind-map/dist
simple-mind-map/types

View File

@ -27,6 +27,8 @@ Github[releases](https://github.com/wanglin2/mind-map/releases)。
> 客户端版本会落后于在线版本,尝试最新功能请优先使用在线版。
> 如果访问github比较慢可以使用http://lxqnsys.com/simple-mind-map/#/index
# 特性
- [x] 插件化架构,除核心功能外,其他功能作为插件提供,按需使用,减小打包体积
@ -86,7 +88,7 @@ const mindMap = new MindMap({
# License
[MIT](./LICENSE)
请尽情享受开源:[MIT](./LICENSE)
# 微信交流群
@ -230,4 +232,16 @@ const mindMap = new MindMap({
<img src="./web/src/assets/avatar/张扬.png" style="width: 50px;height: 50px;" />
<span>张扬</span>
</span>
<span>
<img src="./web/src/assets/avatar/长沙利奥软件.jpg" style="width: 50px;height: 50px;" />
<span>长沙利奥软件</span>
</span>
<span>
<img src="./web/src/assets/avatar/HaHN.jpg" style="width: 50px;height: 50px;" />
<span>HaHN</span>
</span>
<span>
<img src="./web/src/assets/avatar/继龙.jpg" style="width: 50px;height: 50px;" />
<span>继龙</span>
</span>
</p>

File diff suppressed because one or more lines are too long

BIN
dist/img/HaHN.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

1
dist/img/图片加载失败.svg vendored Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1702344017086" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1621" width="128" height="128" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M776 328m-72 0a72 72 0 1 0 144 0 72 72 0 1 0-144 0Z" p-id="1622" fill="#bfbfbf"></path><path d="M999.904 116.608a32 32 0 0 0-21.952-10.912l-456.192-31.904a31.552 31.552 0 0 0-27.2 11.904l-92.192 114.848a32 32 0 0 0 0.672 40.896l146.144 169.952-147.456 194.656 36.48-173.376a32 32 0 0 0-11.136-31.424L235.616 245.504l79.616-125.696a32 32 0 0 0-29.28-49.024l-240.192 16.768a32 32 0 0 0-29.696 34.176l55.808 798.016a32.064 32.064 0 0 0 34.304 29.696l176.512-13.184c17.632-1.312 30.848-16.672 29.504-34.272s-16.576-31.04-34.304-29.536l-144.448 10.784-6.432-92.512 125.312-12.576a32 32 0 0 0 28.672-35.04 32.16 32.16 0 0 0-35.04-28.672l-123.392 12.416L82.144 149.184l145.152-10.144-60.96 96.224a32 32 0 0 0 6.848 41.952l198.4 161.344-58.752 279.296a30.912 30.912 0 0 0 0.736 14.752 31.68 31.68 0 0 0 1.408 11.04l51.52 154.56a31.968 31.968 0 0 0 27.456 21.76l523.104 47.552a32.064 32.064 0 0 0 34.848-29.632L1007.68 139.84a32.064 32.064 0 0 0-7.776-23.232z m-98.912 630.848l-412.576-39.648a31.52 31.52 0 0 0-34.912 28.768 32 32 0 0 0 28.8 34.912l414.24 39.808-6.272 89.536-469.728-42.72-39.584-118.72 234.816-310.016a31.936 31.936 0 0 0-1.248-40.192L468.896 219.84l65.088-81.056 407.584 28.48-40.576 580.192z" p-id="1623" fill="#bfbfbf"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
dist/img/继龙.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
dist/img/长沙利奥软件.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

2
dist/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0abe0f"],{"16c7":function(t,e,o){"use strict";o.r(e);var a=function(){var t=this;t._self._c;return t._m(0)},n=[function(){var t=this,e=t._self._c;return e("div",[e("h1",[t._v("View instance")]),e("p",[t._v("The "),e("code",[t._v("view")]),t._v(" instance is responsible for view operations, and can be obtained through "),e("code",[t._v("mindMap.view")])]),e("h2",[t._v("Methods")]),e("h3",[t._v("fit()")]),e("blockquote",[e("p",[t._v("v0.6.0+")])]),e("p",[t._v("Zoom the mind map to fit the canvas.")]),e("h3",[t._v("translateX(step)")]),e("p",[t._v("Translate in the "),e("code",[t._v("x")]),t._v(" direction, "),e("code",[t._v("step")]),t._v(": number of pixels to translate")]),e("h3",[t._v("translateY(step)")]),e("p",[t._v("Translate in the "),e("code",[t._v("y")]),t._v(" direction, "),e("code",[t._v("step")]),t._v(": number of pixels to translate")]),e("h3",[t._v("translateXTo(x)")]),e("blockquote",[e("p",[t._v("v0.2.11+")])]),e("p",[t._v("Translate the "),e("code",[t._v("x")]),t._v(" direction to a specific position")]),e("h3",[t._v("translateYTo(y)")]),e("blockquote",[e("p",[t._v("v0.2.11+")])]),e("p",[t._v("Translate the "),e("code",[t._v("y")]),t._v(" direction to a specific position")]),e("h3",[t._v("reset()")]),e("p",[t._v("Revert to the default transformation")]),e("h3",[t._v("narrow(cx, cy)")]),e("ul",[e("li",[e("p",[e("code",[t._v("cx")]),t._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])]),e("li",[e("p",[e("code",[t._v("cy")]),t._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])])]),e("p",[t._v("Zoom out")]),e("h3",[t._v("enlarge(cx, cy)")]),e("ul",[e("li",[e("p",[e("code",[t._v("cx")]),t._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])]),e("li",[e("p",[e("code",[t._v("cy")]),t._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])])]),e("p",[t._v("Zoom in")]),e("h3",[t._v("getTransformData()")]),e("blockquote",[e("p",[t._v("v0.1.1+")])]),e("p",[t._v("Get the current transform data, can be used for display")]),e("h3",[t._v("setTransformData(data)")]),e("blockquote",[e("p",[t._v("v0.1.1+")])]),e("p",[t._v('Dynamically set transform data, transform data can be obtained through the getTransformData method"')]),e("h3",[t._v("setScale(scale, cx, cy)")]),e("blockquote",[e("p",[t._v("v0.2.17+")])]),e("ul",[e("li",[e("p",[e("code",[t._v("cx")]),t._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])]),e("li",[e("p",[e("code",[t._v("cy")]),t._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])])]),e("p",[t._v("Setting Zoom")])])}],v={},c=v,i=o("2877"),s=Object(i["a"])(c,a,n,!1,null,null,null);e["default"]=s.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0abe0f"],{"16c7":function(e,t,o){"use strict";o.r(t);var a=function(){var e=this;e._self._c;return e._m(0)},n=[function(){var e=this,t=e._self._c;return t("div",[t("h1",[e._v("View instance")]),t("p",[e._v("The "),t("code",[e._v("view")]),e._v(" instance is responsible for view operations, and can be obtained through "),t("code",[e._v("mindMap.view")])]),t("h2",[e._v("Methods")]),t("h3",[e._v("fit()")]),t("blockquote",[t("p",[e._v("v0.6.0+")])]),t("p",[e._v("Zoom the mind map to fit the canvas.")]),t("p",[e._v("Note that this method cannot be called immediately after calling the 'setData' and 'setFullData' methods, and needs to listen to the 'node_tree_render_end' event calls 'fit'.")]),t("h3",[e._v("translateX(step)")]),t("p",[e._v("Translate in the "),t("code",[e._v("x")]),e._v(" direction, "),t("code",[e._v("step")]),e._v(": number of pixels to translate")]),t("h3",[e._v("translateY(step)")]),t("p",[e._v("Translate in the "),t("code",[e._v("y")]),e._v(" direction, "),t("code",[e._v("step")]),e._v(": number of pixels to translate")]),t("h3",[e._v("translateXTo(x)")]),t("blockquote",[t("p",[e._v("v0.2.11+")])]),t("p",[e._v("Translate the "),t("code",[e._v("x")]),e._v(" direction to a specific position")]),t("h3",[e._v("translateYTo(y)")]),t("blockquote",[t("p",[e._v("v0.2.11+")])]),t("p",[e._v("Translate the "),t("code",[e._v("y")]),e._v(" direction to a specific position")]),t("h3",[e._v("reset()")]),t("p",[e._v("Revert to the default transformation")]),t("h3",[e._v("narrow(cx, cy)")]),t("ul",[t("li",[t("p",[t("code",[e._v("cx")]),e._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])]),t("li",[t("p",[t("code",[e._v("cy")]),e._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])])]),t("p",[e._v("Zoom out")]),t("h3",[e._v("enlarge(cx, cy)")]),t("ul",[t("li",[t("p",[t("code",[e._v("cx")]),e._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])]),t("li",[t("p",[t("code",[e._v("cy")]),e._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])])]),t("p",[e._v("Zoom in")]),t("h3",[e._v("getTransformData()")]),t("blockquote",[t("p",[e._v("v0.1.1+")])]),t("p",[e._v("Get the current transform data, can be used for display")]),t("h3",[e._v("setTransformData(data)")]),t("blockquote",[t("p",[e._v("v0.1.1+")])]),t("p",[e._v('Dynamically set transform data, transform data can be obtained through the getTransformData method"')]),t("h3",[e._v("setScale(scale, cx, cy)")]),t("blockquote",[t("p",[e._v("v0.2.17+")])]),t("ul",[t("li",[t("p",[t("code",[e._v("cx")]),e._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])]),t("li",[t("p",[t("code",[e._v("cy")]),e._v(":v0.6.4+Zoom to the specified position on the canvas, default to the center point of the canvas")])])]),t("p",[e._v("Setting Zoom")])])}],v={},i=v,c=o("2877"),s=Object(c["a"])(i,a,n,!1,null,null,null);t["default"]=s.exports}}]);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b361e"],{"27ad":function(s,a,t){"use strict";t.r(a);var e=function(){var s=this;s._self._c;return s._m(0)},n=[function(){var s=this,a=s._self._c;return a("div",[a("h1",[s._v("Watermark plugin")]),a("blockquote",[a("p",[s._v("0.2.24+")])]),a("p",[a("code",[s._v("Watermark")]),s._v(" instance is responsible for displaying the watermark.")]),a("p",[s._v("Please refer to the "),a("a",{attrs:{href:"/mind-map/#/doc/zh/constructor"}},[s._v("Instantiation Options")]),s._v(" of the "),a("code",[s._v("MindMap")]),s._v(" class for configuration.")]),a("h2",[s._v("Register")]),a("pre",{staticClass:"hljs"},[a("code",[a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" Watermark "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Watermark.js'")]),s._v("\n"),a("span",{staticClass:"hljs-comment"},[s._v("// import Watermark from 'simple-mind-map/src/Watermark.js' Use this path for versions below v0.6.0")]),s._v("\n\nMindMap.usePlugin(Watermark)\n")])]),a("p",[s._v("After registration and instantiation of "),a("code",[s._v("MindMap")]),s._v(", the instance can be obtained through "),a("code",[s._v("mindMap.watermark")]),s._v(".")]),a("h2",[s._v("Methods")]),a("h3",[s._v("draw()")]),a("p",[s._v("Redraw the watermark.")]),a("p",[s._v("Note: For imprecise rendering, some watermarks beyond the visible area will be drawn. If you have extreme performance requirements, it is recommended to develop the watermark function yourself.")]),a("h3",[s._v("updateWatermark(config)")]),a("p",[s._v("Update watermark config. Example:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.watermark.updateWatermark({\n "),a("span",{staticClass:"hljs-attr"},[s._v("text")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'Watermark text'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("angle")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("50")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textStyle")]),s._v(": {\n "),a("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#000'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("opacity")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("1")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("20")]),s._v("\n }\n})\n")])]),a("h3",[s._v("hasWatermark()")]),a("blockquote",[a("p",[s._v("v0.3.2+")])]),a("p",[s._v("Gets whether the watermark exists.")])])}],r={},i=r,l=t("2877"),v=Object(l["a"])(i,e,n,!1,null,null,null);a["default"]=v.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b361e"],{"27ad":function(s,a,t){"use strict";t.r(a);var e=function(){var s=this;s._self._c;return s._m(0)},r=[function(){var s=this,a=s._self._c;return a("div",[a("h1",[s._v("Watermark plugin")]),a("blockquote",[a("p",[s._v("0.2.24+")])]),a("p",[a("code",[s._v("Watermark")]),s._v(" instance is responsible for displaying the watermark.")]),a("p",[s._v("Please refer to the "),a("a",{attrs:{href:"/mind-map/#/doc/zh/constructor"}},[s._v("Instantiation Options")]),s._v(" of the "),a("code",[s._v("MindMap")]),s._v(" class for configuration.")]),a("h2",[s._v("Register")]),a("pre",{staticClass:"hljs"},[a("code",[a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" Watermark "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Watermark.js'")]),s._v("\n"),a("span",{staticClass:"hljs-comment"},[s._v("// import Watermark from 'simple-mind-map/src/Watermark.js' Use this path for versions below v0.6.0")]),s._v("\n\nMindMap.usePlugin(Watermark)\n")])]),a("p",[s._v("After registration and instantiation of "),a("code",[s._v("MindMap")]),s._v(", the instance can be obtained through "),a("code",[s._v("mindMap.watermark")]),s._v(".")]),a("h2",[s._v("Methods")]),a("h3",[s._v("draw()")]),a("p",[s._v("Redraw the watermark.")]),a("p",[s._v("Note: For imprecise rendering, some watermarks beyond the visible area will be drawn. If you have extreme performance requirements, it is recommended to develop the watermark function yourself.")]),a("h3",[s._v("updateWatermark(config)")]),a("p",[s._v("Update watermark config. Example:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.watermark.updateWatermark({\n "),a("span",{staticClass:"hljs-attr"},[s._v("text")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'Watermark text'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("angle")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("50")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textStyle")]),s._v(": {\n "),a("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#000'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("opacity")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("1")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("20")]),s._v("\n }\n})\n")])]),a("h3",[s._v("hasWatermark()")]),a("blockquote",[a("p",[s._v("v0.3.2+")])]),a("p",[s._v("Gets whether the watermark exists.")]),a("h3",[s._v("clear()")]),a("blockquote",[a("p",[s._v("v0.9.2+")])]),a("p",[s._v("Clear watermark.")])])}],n={},i=n,l=t("2877"),v=Object(l["a"])(i,e,r,!1,null,null,null);a["default"]=v.exports}}]);

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b9b64"],{"33b0":function(t,s,a){"use strict";a.r(s);var n=function(){var t=this;t._self._c;return t._m(0)},i=[function(){var t=this,s=t._self._c;return s("div",[s("h1",[t._v("结构")]),s("p",[s("code",[t._v("simple-mind-map")]),t._v("目前支持四种结构logicalStructure逻辑结构图、mindMap思维导图、organizationStructure组织结构图、catalogOrganization目录组织图、timeline时间轴、timeline2时间轴2、fishbone鱼骨图、verticalTimelinev0.6.6+竖向时间轴)。")]),s("p",[t._v("可以在实例化"),s("code",[t._v("simple-mind-map")]),t._v("时通过选项指定使用的结构:")]),s("pre",{staticClass:"hljs"},[s("code",[s("span",{staticClass:"hljs-keyword"},[t._v("new")]),t._v(" MindMap({\n "),s("span",{staticClass:"hljs-comment"},[t._v("// ...")]),t._v("\n "),s("span",{staticClass:"hljs-attr"},[t._v("layout")]),t._v(": "),s("span",{staticClass:"hljs-string"},[t._v("'logicalStructure'")]),t._v("\n})\n")])]),s("p",[t._v("也可以动态切换结构:")]),s("pre",{staticClass:"hljs"},[s("code",[t._v("mindMap.setLayout("),s("span",{staticClass:"hljs-string"},[t._v("'organizationStructure'")]),t._v(")\n")])]),s("p",[t._v("获取当前使用的结构可以使用"),s("code",[t._v("getLayout")]),t._v("方法:")]),s("pre",{staticClass:"hljs"},[s("code",[s("span",{staticClass:"hljs-keyword"},[t._v("const")]),t._v(" layout = mindMap.getLayout()\n")])]),s("h2",[t._v("完整示例")]),s("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVVtrFDEU/iuHiMxWtrNb8Gndlnp7EFqR+tgUSWfS3WgmGSaZXiwLUgrWS0Hpg6Ag6os++ChCW8Q/0+72Z3iymZkd2z745sIsk3P5vpOc72S2yc00DddzTjqka6JMpBYMt3k6R5VIUp1Z2IaMrzVBq0WdK8vjJpg+k1JvLPE1GMBaphMIECGoMhaFihdZ6l2UGDRLPp2gdTphKSVUAVAluQVnc5GzoHIpvb3VgtNfB6cv9oe/nw1/HI/e75693BntHJ7uvTv7/I2qSCtjgUVWrPP7OuYGsycVNZZXpqjyKHvPh/tfRscHw4+7ZVrUZ6rHF7aYzi3mNaZgdg62HXFRSoi7X2Bb6G4EOusxJZ4yK7R6aLM8snnGA4QfOIbqQBoXUdyG+EZ5EI2xC4DLDsQ6yhOubNjj9q7k7vXW1r24ERSZt7WyTCieBVNNnxUzyzoe3f0ocQZKaiZvtnzTOjMlw0+H/sj8UbvfoABzgVFfyDjjygUvTzDOwV3Kcp7p5Oj16OjrebK/CS8hXZn46nH/qYLytbCVeUIJu6S1dRp7oI1wKsDMQPI1GzQhiLB12KaVIlyORdOBQOqeiJicCMb5B1M3vLoBUJmjD29P33z3RXuVnxy9Ojn+WdehVo1AIfUjr3RkbLhlE9z/gjB2IjqoT0O4zmTOnQCLOE+PosWn2/IzjtONC8txMJnluALoxmIdIsmMmaWkKOIOTzQlY3cRIOKJt5IqhnRb6K0HlkhWa7nKXIh3Uttdza3VCuYjKaInGFKfSYyrj2235YNL5IqlfOu2apvApbFb0u9nvriMKAlb/gYqpjHkJgkjYyipWhLW9lse6YaIbb8DM+321XEcQFqJIOPIiAc+doz1454r58+lhJokslWjZW59ImoGpdSBdrGyOp0sLtL3uej1Mfx6u51ulsyX814rmROW9QTylqgpi2OheqWhKj0s2vSPFc+UFRRFV2sERImNe0CaxHfA3fnhY6MVfmLG8LRwYAeq4aYEvyB+osMWvoYZXq0i4a5Z06uZ3jA8QxBKimm75Kvicy+22mUVtQ3I4A+xm1Zg"}})])}],e={},l=e,o=a("2877"),r=Object(o["a"])(l,n,i,!1,null,null,null);s["default"]=r.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b9b64"],{"33b0":function(t,s,a){"use strict";a.r(s);var n=function(){var t=this;t._self._c;return t._m(0)},i=[function(){var t=this,s=t._self._c;return s("div",[s("h1",[t._v("结构")]),s("p",[s("code",[t._v("simple-mind-map")]),t._v("目前支持结构logicalStructure逻辑结构图、mindMap思维导图、organizationStructure组织结构图、catalogOrganization目录组织图、timeline时间轴、timeline2时间轴2、fishbone鱼骨图、verticalTimelinev0.6.6+竖向时间轴)。")]),s("p",[t._v("可以在实例化"),s("code",[t._v("simple-mind-map")]),t._v("时通过选项指定使用的结构:")]),s("pre",{staticClass:"hljs"},[s("code",[s("span",{staticClass:"hljs-keyword"},[t._v("new")]),t._v(" MindMap({\n "),s("span",{staticClass:"hljs-comment"},[t._v("// ...")]),t._v("\n "),s("span",{staticClass:"hljs-attr"},[t._v("layout")]),t._v(": "),s("span",{staticClass:"hljs-string"},[t._v("'logicalStructure'")]),t._v("\n})\n")])]),s("p",[t._v("也可以动态切换结构:")]),s("pre",{staticClass:"hljs"},[s("code",[t._v("mindMap.setLayout("),s("span",{staticClass:"hljs-string"},[t._v("'organizationStructure'")]),t._v(")\n")])]),s("p",[t._v("获取当前使用的结构可以使用"),s("code",[t._v("getLayout")]),t._v("方法:")]),s("pre",{staticClass:"hljs"},[s("code",[s("span",{staticClass:"hljs-keyword"},[t._v("const")]),t._v(" layout = mindMap.getLayout()\n")])]),s("h2",[t._v("完整示例")]),s("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVVtrFDEU/iuHiMxWtrNb8Gndlnp7EFqR+tgUSWfS3WgmGSaZXiwLUgrWS0Hpg6Ag6os++ChCW8Q/0+72Z3iymZkd2z745sIsk3P5vpOc72S2yc00DddzTjqka6JMpBYMt3k6R5VIUp1Z2IaMrzVBq0WdK8vjJpg+k1JvLPE1GMBaphMIECGoMhaFihdZ6l2UGDRLPp2gdTphKSVUAVAluQVnc5GzoHIpvb3VgtNfB6cv9oe/nw1/HI/e75693BntHJ7uvTv7/I2qSCtjgUVWrPP7OuYGsycVNZZXpqjyKHvPh/tfRscHw4+7ZVrUZ6rHF7aYzi3mNaZgdg62HXFRSoi7X2Bb6G4EOusxJZ4yK7R6aLM8snnGA4QfOIbqQBoXUdyG+EZ5EI2xC4DLDsQ6yhOubNjj9q7k7vXW1r24ERSZt7WyTCieBVNNnxUzyzoe3f0ocQZKaiZvtnzTOjMlw0+H/sj8UbvfoABzgVFfyDjjygUvTzDOwV3Kcp7p5Oj16OjrebK/CS8hXZn46nH/qYLytbCVeUIJu6S1dRp7oI1wKsDMQPI1GzQhiLB12KaVIlyORdOBQOqeiJicCMb5B1M3vLoBUJmjD29P33z3RXuVnxy9Ojn+WdehVo1AIfUjr3RkbLhlE9z/gjB2IjqoT0O4zmTOnQCLOE+PosWn2/IzjtONC8txMJnluALoxmIdIsmMmaWkKOIOTzQlY3cRIOKJt5IqhnRb6K0HlkhWa7nKXIh3Uttdza3VCuYjKaInGFKfSYyrj2235YNL5IqlfOu2apvApbFb0u9nvriMKAlb/gYqpjHkJgkjYyipWhLW9lse6YaIbb8DM+321XEcQFqJIOPIiAc+doz1454r58+lhJokslWjZW59ImoGpdSBdrGyOp0sLtL3uej1Mfx6u51ulsyX814rmROW9QTylqgpi2OheqWhKj0s2vSPFc+UFRRFV2sERImNe0CaxHfA3fnhY6MVfmLG8LRwYAeq4aYEvyB+osMWvoYZXq0i4a5Z06uZ3jA8QxBKimm75Kvicy+22mUVtQ3I4A+xm1Zg"}})])}],e={},l=e,o=a("2877"),r=Object(o["a"])(l,n,i,!1,null,null,null);s["default"]=r.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0dddce"],{"82ca":function(v,_,e){"use strict";e.r(_);var c=function(){var v=this;v._self._c;return v._m(0)},o=[function(){var v=this,_=v._self._c;return _("div",[_("h1",[v._v("View实例")]),_("p",[_("code",[v._v("view")]),v._v("实例负责视图操作,可通过"),_("code",[v._v("mindMap.view")]),v._v("获取到该实例")]),_("h2",[v._v("方法")]),_("h3",[v._v("fit()")]),_("blockquote",[_("p",[v._v("v0.6.0+")])]),_("p",[v._v("缩放思维导图至适应画布。")]),_("h3",[v._v("translateX(step)")]),_("p",[_("code",[v._v("x")]),v._v("方向进行平移,"),_("code",[v._v("step")]),v._v(":要平移的像素")]),_("h3",[v._v("translateY(step)")]),_("p",[_("code",[v._v("y")]),v._v("方向进行平移,"),_("code",[v._v("step")]),v._v(":要平移的像素")]),_("h3",[v._v("translateXTo(x)")]),_("blockquote",[_("p",[v._v("v0.2.11+")])]),_("p",[v._v("平移"),_("code",[v._v("x")]),v._v("方向到指定位置")]),_("h3",[v._v("translateYTo(y)")]),_("blockquote",[_("p",[v._v("v0.2.11+")])]),_("p",[v._v("平移"),_("code",[v._v("y")]),v._v("方向到指定位置")]),_("h3",[v._v("reset()")]),_("p",[v._v("恢复到默认的变换")]),_("h3",[v._v("narrow(cx, cy)")]),_("ul",[_("li",[_("p",[_("code",[v._v("cx")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])]),_("li",[_("p",[_("code",[v._v("cy")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])])]),_("p",[v._v("缩小")]),_("h3",[v._v("enlarge(cx, cy)")]),_("ul",[_("li",[_("p",[_("code",[v._v("cx")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])]),_("li",[_("p",[_("code",[v._v("cy")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])])]),_("p",[v._v("放大")]),_("h3",[v._v("getTransformData()")]),_("blockquote",[_("p",[v._v("v0.1.1+")])]),_("p",[v._v("获取当前变换数据,可用于回显")]),_("h3",[v._v("setTransformData(data)")]),_("blockquote",[_("p",[v._v("v0.1.1+")])]),_("p",[v._v("动态设置变换数据可以通过getTransformData方法获取变换数据")]),_("h3",[v._v("setScale(scale, cx, cy)")]),_("blockquote",[_("p",[v._v("v0.2.17+")])]),_("ul",[_("li",[_("p",[_("code",[v._v("cx")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])]),_("li",[_("p",[_("code",[v._v("cy")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])])]),_("p",[v._v("设置缩放")])])}],t={},p=t,a=e("2877"),l=Object(a["a"])(p,c,o,!1,null,null,null);_["default"]=l.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0dddce"],{"82ca":function(v,_,e){"use strict";e.r(_);var c=function(){var v=this;v._self._c;return v._m(0)},t=[function(){var v=this,_=v._self._c;return _("div",[_("h1",[v._v("View实例")]),_("p",[_("code",[v._v("view")]),v._v("实例负责视图操作,可通过"),_("code",[v._v("mindMap.view")]),v._v("获取到该实例")]),_("h2",[v._v("方法")]),_("h3",[v._v("fit()")]),_("blockquote",[_("p",[v._v("v0.6.0+")])]),_("p",[v._v("缩放思维导图至适应画布。")]),_("p",[v._v("注意该方法不能在"),_("code",[v._v("setData")]),v._v("、"),_("code",[v._v("setFullData")]),v._v("方法调用后立即调用,需要监听"),_("code",[v._v("node_tree_render_end")]),v._v("事件调用"),_("code",[v._v("fit")]),v._v("。")]),_("h3",[v._v("translateX(step)")]),_("p",[_("code",[v._v("x")]),v._v("方向进行平移,"),_("code",[v._v("step")]),v._v(":要平移的像素")]),_("h3",[v._v("translateY(step)")]),_("p",[_("code",[v._v("y")]),v._v("方向进行平移,"),_("code",[v._v("step")]),v._v(":要平移的像素")]),_("h3",[v._v("translateXTo(x)")]),_("blockquote",[_("p",[v._v("v0.2.11+")])]),_("p",[v._v("平移"),_("code",[v._v("x")]),v._v("方向到指定位置")]),_("h3",[v._v("translateYTo(y)")]),_("blockquote",[_("p",[v._v("v0.2.11+")])]),_("p",[v._v("平移"),_("code",[v._v("y")]),v._v("方向到指定位置")]),_("h3",[v._v("reset()")]),_("p",[v._v("恢复到默认的变换")]),_("h3",[v._v("narrow(cx, cy)")]),_("ul",[_("li",[_("p",[_("code",[v._v("cx")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])]),_("li",[_("p",[_("code",[v._v("cy")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])])]),_("p",[v._v("缩小")]),_("h3",[v._v("enlarge(cx, cy)")]),_("ul",[_("li",[_("p",[_("code",[v._v("cx")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])]),_("li",[_("p",[_("code",[v._v("cy")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])])]),_("p",[v._v("放大")]),_("h3",[v._v("getTransformData()")]),_("blockquote",[_("p",[v._v("v0.1.1+")])]),_("p",[v._v("获取当前变换数据,可用于回显")]),_("h3",[v._v("setTransformData(data)")]),_("blockquote",[_("p",[v._v("v0.1.1+")])]),_("p",[v._v("动态设置变换数据可以通过getTransformData方法获取变换数据")]),_("h3",[v._v("setScale(scale, cx, cy)")]),_("blockquote",[_("p",[v._v("v0.2.17+")])]),_("ul",[_("li",[_("p",[_("code",[v._v("cx")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])]),_("li",[_("p",[_("code",[v._v("cy")]),v._v("v0.6.4+)以画布指定位置进行缩放,默认为画布中心点")])])]),_("p",[v._v("设置缩放")])])}],o={},a=o,p=e("2877"),l=Object(p["a"])(a,c,t,!1,null,null,null);_["default"]=l.exports}}]);

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0de01b"],{"848a":function(s,a,t){"use strict";t.r(a);var n=function(){var s=this;s._self._c;return s._m(0)},v=[function(){var s=this,a=s._self._c;return a("div",[a("h1",[s._v("Watermark插件")]),a("blockquote",[a("p",[s._v("0.2.24+")])]),a("p",[a("code",[s._v("Watermark")]),s._v("插件负责显示水印。")]),a("p",[s._v("配置请参考"),a("code",[s._v("MindMap")]),s._v("类的"),a("a",{attrs:{href:"/mind-map/#/doc/zh/constructor"}},[s._v("实例化选项")]),s._v("。")]),a("h2",[s._v("注册")]),a("pre",{staticClass:"hljs"},[a("code",[a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" Watermark "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Watermark.js'")]),s._v("\n"),a("span",{staticClass:"hljs-comment"},[s._v("// import Watermark from 'simple-mind-map/src/Watermark.js' v0.6.0以下版本使用该路径")]),s._v("\n\nMindMap.usePlugin(Watermark)\n")])]),a("p",[s._v("注册完且实例化"),a("code",[s._v("MindMap")]),s._v("后可通过"),a("code",[s._v("mindMap.watermark")]),s._v("获取到该实例。")]),a("h2",[s._v("方法")]),a("h3",[s._v("draw()")]),a("p",[s._v("重新绘制水印。")]),a("p",[s._v("注意:非精确绘制,会绘制一些超出可视区域的水印,如果对性能有极致要求,推荐自行开发水印功能。")]),a("h3",[s._v("updateWatermark(config)")]),a("p",[s._v("更新水印配置。示例:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.watermark.updateWatermark({\n "),a("span",{staticClass:"hljs-attr"},[s._v("text")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'水印文字'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("angle")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("50")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textStyle")]),s._v(": {\n "),a("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#000'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("opacity")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("1")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("20")]),s._v("\n }\n})\n")])]),a("h3",[s._v("hasWatermark()")]),a("blockquote",[a("p",[s._v("v0.3.2+")])]),a("p",[s._v("获取是否存在水印。")])])}],_={},r=_,l=t("2877"),i=Object(l["a"])(r,n,v,!1,null,null,null);a["default"]=i.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0de01b"],{"848a":function(s,a,t){"use strict";t.r(a);var n=function(){var s=this;s._self._c;return s._m(0)},v=[function(){var s=this,a=s._self._c;return a("div",[a("h1",[s._v("Watermark插件")]),a("blockquote",[a("p",[s._v("0.2.24+")])]),a("p",[a("code",[s._v("Watermark")]),s._v("插件负责显示水印。")]),a("p",[s._v("配置请参考"),a("code",[s._v("MindMap")]),s._v("类的"),a("a",{attrs:{href:"/mind-map/#/doc/zh/constructor"}},[s._v("实例化选项")]),s._v("。")]),a("h2",[s._v("注册")]),a("pre",{staticClass:"hljs"},[a("code",[a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),a("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" Watermark "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Watermark.js'")]),s._v("\n"),a("span",{staticClass:"hljs-comment"},[s._v("// import Watermark from 'simple-mind-map/src/Watermark.js' v0.6.0以下版本使用该路径")]),s._v("\n\nMindMap.usePlugin(Watermark)\n")])]),a("p",[s._v("注册完且实例化"),a("code",[s._v("MindMap")]),s._v("后可通过"),a("code",[s._v("mindMap.watermark")]),s._v("获取到该实例。")]),a("h2",[s._v("方法")]),a("h3",[s._v("draw()")]),a("p",[s._v("重新绘制水印。")]),a("p",[s._v("注意:非精确绘制,会绘制一些超出可视区域的水印,如果对性能有极致要求,推荐自行开发水印功能。")]),a("h3",[s._v("updateWatermark(config)")]),a("p",[s._v("更新水印配置。示例:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.watermark.updateWatermark({\n "),a("span",{staticClass:"hljs-attr"},[s._v("text")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'水印文字'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("lineSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textSpacing")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("angle")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("50")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("textStyle")]),s._v(": {\n "),a("span",{staticClass:"hljs-attr"},[s._v("color")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'#000'")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("opacity")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("1")]),s._v(",\n "),a("span",{staticClass:"hljs-attr"},[s._v("fontSize")]),s._v(": "),a("span",{staticClass:"hljs-number"},[s._v("20")]),s._v("\n }\n})\n")])]),a("h3",[s._v("hasWatermark()")]),a("blockquote",[a("p",[s._v("v0.3.2+")])]),a("p",[s._v("获取是否存在水印。")]),a("h3",[s._v("clear()")]),a("blockquote",[a("p",[s._v("v0.9.2+")])]),a("p",[s._v("清除水印。")])])}],_={},r=_,l=t("2877"),p=Object(l["a"])(r,n,v,!1,null,null,null);a["default"]=p.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/js/chunk-2d0f0784.js vendored Normal file
View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f0784"],{"9d03":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this;e._self._c;return e._m(0)},d=[function(){var e=this,t=e._self._c;return t("div",[t("h1",[e._v("TextEdit instance")]),t("p",[e._v("Node text editing instance. It can be obtained through "),t("code",[e._v("mindMap.renderer.textEdit")]),e._v(".")]),t("h2",[e._v("Methods")]),t("h3",[e._v("isShowTextEdit()")]),t("p",[e._v("Get whether the current text editing box is in a display state, that is, whether it is in a text editing state.")]),t("h3",[e._v("hideEditTextBox()")]),t("p",[e._v("Hiding the text editing box will set the content of the current text editing box as node text.")]),t("h3",[e._v("registerTmpShortcut()")]),t("p",[e._v("Register temporary shortcut keys, which means editing can be completed through the Enter and Tab keys.")]),t("h3",[e._v("show({ node})")]),t("ul",[t("li",[t("code",[e._v("node")]),e._v("Node instance to enter for editing")])]),t("p",[e._v("Manually enable node editing. By default, it will enter node editing when double clicking or pressing F2 on the node.")])])}],o={},h=o,r=n("2877"),s=Object(r["a"])(h,i,d,!1,null,null,null);t["default"]=s.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d20ff53"],{b69b:function(s,t,a){"use strict";a.r(t);var n=function(){var s=this;s._self._c;return s._m(0)},e=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("修改鼠标滚轮的行为")]),t("p",[s._v("鼠标滚轮的行为支持放大缩小画布和上下移动画布,可以在实例化时通过配置指定:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("mousewheelAction")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'zoom'")]),t("span",{staticClass:"hljs-comment"},[s._v("// zoom放大缩小、move上下移动")]),s._v("\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 当mousewheelAction设为move时可以通过该属性控制鼠标滚动一下视图移动的步长单位px")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("mousewheelMoveStep")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n})\n")])]),t("p",[s._v("如果需要动态的切换行为可以使用"),t("code",[s._v("updateConfig")]),s._v("方法:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.updateConfig({\n "),t("span",{staticClass:"hljs-attr"},[s._v("mousewheelAction")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'move'")]),s._v("\n})\n")])]),t("p",[s._v("此外也支持让你自行处理鼠标滚轮事件:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("customHandleMousewheel")]),s._v(": "),t("span",{staticClass:"hljs-function"},[s._v("("),t("span",{staticClass:"hljs-params"},[s._v("e")]),s._v(") =>")]),s._v(" {\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 你的自定义逻辑")]),s._v("\n }\n})\n")])]),t("p",[s._v("当传了"),t("code",[s._v("customHandleMousewheel")]),s._v("选项,"),t("code",[s._v("mousewheelAction")]),s._v("选项将不生效。")]),t("h2",[s._v("完整示例")]),t("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVU+P20QU/ypPRshZlNipxCkkpeXPAYlFqNedFXLsSTJlPGM842SXyBKqkFpKK4FAQiqXLZcWCXFCiO628GU2yfIteOPxON6QAzciOZp57/fe7828P7P0bmdZMC+oN/CGKs5ZpkFRXWQ3iWBpJnMNS8jppAtSHMpCaJp0Qc0izuXiDp1ACZNcpuCjB7+xOGQiOYwyqyKeQjGnvRSlvTTKiEcEABGcajAygxyBKDi38jCE1avvVl89Xv/1xfq3i82TL68e3tvce7F68MPV0+dExFIoDVGs2Zx+JBOq0HobUefo+IAIh4qLPKdC30awFIjDk3T8z6VM/QpkqB7cXz/+6e+XZ+uz++uLJ1evfr16+ujyj3PnQcvplFM8uqKLGaW8cdU5gNFNWJqYr7EE84gXFAF7paMRWH54G/xUzqkPg1piPNX3ERRZEmn6rhQTNu1UHKjbiWGwjwFPpUs8W2mO16Ss0wq2deV04VLlOCgfQCLjIkW3wZTq9zk1y3dOP0g6fm2JUemICZr7B11rhbFGA+vd/IhnBMRriaxY0xNtxMRbn72wSbXFYH5l7cwA4xnjCR7NgI+2Pnbc7WXZZbo8f7Q5f7ZLdp1wD+nxVtfG/U8RuGUtc3ZMMH1HSm264GOpmK2KI5/Tifa74MeYOkzTcQUvD96y/QWAZb/58dvVN7/YoGyfXZ5/fXnxe7sIpej4Al1/YnsNPXbMtgvm/0Om9LaooN2PTQc4nKXHosRvGNopg/MFN5riaMBKxx3AMGFziHmk1Ih4dRDv0VQSr1LXAJZstU0pImQYorYNdJ60lHwcGYhVEj0cF1pjE9+KOYs/rSD7mhwtlsvdEXKtge3wwGmxeXaxevi86uWt7OXP6+//9KEsh6EldNE1kbrVMGxdBG6VPuX2Tm7VI5V4QWjnaN2xAVVpECtFvCatQevOXFoWLNGzAdzo91+vcABZUyg5RUZMWqWoasx8r+3erXO1NYzGSvJCW0MAU24D6Nc7LbPt5t/0M8qmM4S/2e9nJ455P+8bjjmN8ilDXuc1i5KEiakTNKEHdar/Y8Q3XAR10M0eHWKZVjnwup7NgHm5grtKCnwoK/ekVmAGmgFAPHwHbdcHIS6DHMcvS6lJVm+cy4WiOTohXt3Ae95GYzvTOlODMOQnnwl1qgKpVC8WvTFld/HYQcTZaSFiFcQyDbHGqVZ7asPQ1IcpvfIftRG5qQ=="}})])}],l={},v=l,c=a("2877"),i=Object(c["a"])(v,n,e,!1,null,null,null);t["default"]=i.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d20ff53"],{b69b:function(s,t,a){"use strict";a.r(t);var e=function(){var s=this;s._self._c;return s._m(0)},n=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("修改鼠标滚轮的行为")]),t("p",[s._v("鼠标滚轮的行为支持放大缩小画布和上下移动画布,可以在实例化时通过配置指定:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("mousewheelAction")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'move'")]),t("span",{staticClass:"hljs-comment"},[s._v("// zoom放大缩小、move上下移动")]),s._v("\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 当mousewheelAction设为move时可以通过该属性控制鼠标滚动一下视图移动的步长单位px")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("mousewheelMoveStep")]),s._v(": "),t("span",{staticClass:"hljs-number"},[s._v("100")]),s._v(",\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 鼠标缩放是否以鼠标当前位置为中心点,否则以画布中心点")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("mouseScaleCenterUseMousePosition")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v(",\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 当mousewheelAction设为zoom时或者按住Ctrl键时默认向前滚动是缩小向后滚动是放大如果该属性设为true那么会反过来")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("mousewheelZoomActionReverse")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v(",\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 禁止鼠标滚轮缩放你仍旧可以使用api进行缩放")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("disableMouseWheelZoom")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("false")]),s._v(",\n})\n")])]),t("p",[s._v("如果需要动态的切换行为可以使用"),t("code",[s._v("updateConfig")]),s._v("方法:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.updateConfig({\n "),t("span",{staticClass:"hljs-attr"},[s._v("mousewheelAction")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'zoom'")]),s._v("\n})\n")])]),t("p",[s._v("此外也支持让你自行处理鼠标滚轮事件:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("customHandleMousewheel")]),s._v(": "),t("span",{staticClass:"hljs-function"},[s._v("("),t("span",{staticClass:"hljs-params"},[s._v("e")]),s._v(") =>")]),s._v(" {\n "),t("span",{staticClass:"hljs-comment"},[s._v("// 你的自定义逻辑")]),s._v("\n }\n})\n")])]),t("p",[s._v("当传了"),t("code",[s._v("customHandleMousewheel")]),s._v("选项,"),t("code",[s._v("mousewheelAction")]),s._v("选项将不生效。")]),t("h2",[s._v("完整示例")]),t("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVU+P20QU/ypPRshZlNipxCkkpeXPAYlFqNedFXLsSTJlPGM842SXyBKqkFpKK4FAQiqXLZcWCXFCiO628GU2yfIteOPxON6QAzciOZp57/fe7828P7P0bmdZMC+oN/CGKs5ZpkFRXWQ3iWBpJnMNS8jppAtSHMpCaJp0Qc0izuXiDp1ACZNcpuCjB7+xOGQiOYwyqyKeQjGnvRSlvTTKiEcEABGcajAygxyBKDi38jCE1avvVl89Xv/1xfq3i82TL68e3tvce7F68MPV0+dExFIoDVGs2Zx+JBOq0HobUefo+IAIh4qLPKdC30awFIjDk3T8z6VM/QpkqB7cXz/+6e+XZ+uz++uLJ1evfr16+ujyj3PnQcvplFM8uqKLGaW8cdU5gNFNWJqYr7EE84gXFAF7paMRWH54G/xUzqkPg1piPNX3ERRZEmn6rhQTNu1UHKjbiWGwjwFPpUs8W2mO16Ss0wq2deV04VLlOCgfQCLjIkW3wZTq9zk1y3dOP0g6fm2JUemICZr7B11rhbFGA+vd/IhnBMRriaxY0xNtxMRbn72wSbXFYH5l7cwA4xnjCR7NgI+2Pnbc7WXZZbo8f7Q5f7ZLdp1wD+nxVtfG/U8RuGUtc3ZMMH1HSm264GOpmK2KI5/Tifa74MeYOkzTcQUvD96y/QWAZb/58dvVN7/YoGyfXZ5/fXnxe7sIpej4Al1/YnsNPXbMtgvm/0Om9LaooN2PTQc4nKXHosRvGNopg/MFN5riaMBKxx3AMGFziHmk1Ih4dRDv0VQSr1LXAJZstU0pImQYorYNdJ60lHwcGYhVEj0cF1pjE9+KOYs/rSD7mhwtlsvdEXKtge3wwGmxeXaxevi86uWt7OXP6+//9KEsh6EldNE1kbrVMGxdBG6VPuX2Tm7VI5V4QWjnaN2xAVVpECtFvCatQevOXFoWLNGzAdzo91+vcABZUyg5RUZMWqWoasx8r+3erXO1NYzGSvJCW0MAU24D6Nc7LbPt5t/0M8qmM4S/2e9nJ455P+8bjjmN8ilDXuc1i5KEiakTNKEHdar/Y8Q3XAR10M0eHWKZVjnwup7NgHm5grtKCnwoK/ekVmAGmgFAPHwHbdcHIS6DHMcvS6lJVm+cy4WiOTohXt3Ae95GYzvTOlODMOQnnwl1qgKpVC8WvTFld/HYQcTZaSFiFcQyDbHGqVZ7asPQ1IcpvfIftRG5qQ=="}})])}],l={},v=l,c=a("2877"),i=Object(c["a"])(v,e,n,!1,null,null,null);t["default"]=i.exports}}]);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216037"],{c13f:function(s,t,n){"use strict";n.r(t);var a=function(){var s=this;s._self._c;return s._m(0)},e=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("开启节点自由拖拽")]),t("p",[s._v("节点支持自由拖拽,也就是可以把它拖动到你指定的位置,默认是不开启的,如果需要开启可以在实例化"),t("code",[s._v("simple-mind-map")]),s._v("时传入开启的选项:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v("\n})\n")])]),t("p",[s._v("也可以动态切换是否开启:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.updateConfig({\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),t("span",{staticClass:"hljs-comment"},[s._v("// false")]),s._v("\n})\n")])]),t("p",[s._v("自由拖拽很容器将节点拖的乱七八糟,所以也可以通过命令回到默认的位置:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'RESET_LAYOUT'")]),s._v(")\n")])]),t("p",[s._v("也可以使用快捷键"),t("code",[s._v("Ctrl + L")]),s._v("来恢复。")]),t("h2",[s._v("完整示例")]),t("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVd1uG0UUfpVhEVoH2buuxJVxSksbJKSEolAuUDeqxrtje8rszLIzm8SyVgoF1EKIFASiFdxAVQFCQFWBEE2oeJmsnb4FZ3b2L44veldLa82c853znZnzM1PrchQ52wmxelZf+jGNFJJEJdFFj9MwErFCUxSTYRsJviESrkjQRnKMGRM7m2SIUjSMRYhs8GBXFhuUBxs4MirPkiBmpBOCtBPiyLM8jpDHGVFIyzRyFfGEMSN3XZQ9/Tr7/GD2397sr+P5d5+efnF7fvtJdvfe6Y+/eNwXXCqEfUW3yTsiIBKs64haN7ZWPF6iqLwWEf5WTMjVGI8ACEdpDTGTJAdpqrt3ZgcPZvcfZYc/Zf/uZYePTu/8Ov/m8Wz/29n+09KPEqMRIw0/rRW0ehFNdcRnOZxtzBICiJeWyTW+OLOTRAFW5IrgQzpq5Z4QIhwPap7eUt8QuEoh/LQ4wezjB9nDg2fH90//eJj980n2eK+MOiaQynU8EYk6G3IZAtkl/hURhpgHLXtz7b216zfXL39w7f3rdum/ynrrvLnOGtkps10dgfVQIPwkJFw5I6LWGNHLNydvA0dhCYdWmHIS2yttYwVXgXvGu/55lhZ4VkNkxIrsKi32rNkPT0xdmHrSv7RwpoH+mLIgJlyDb9Q+FtwtZVlkOjn6cn708yLZWcIlpFu1rol7QRGUy0JW2lFO1aYQSjfSu0JSRQUHS5uRobLbyPYhdZCmrQK+WJ95K2lVuvK66V6EoCTn33+VHf5m4jVdfHK0f3L8d7P2BG/ZHFhvmk4GspbetpH+X6dS1fWGmt1eNViJM/RQr/D1XTPDYHrBRhEYPNBjsEOoH9Bt5DMs5apnFUFcJaHwrFxdAGhQa6sqBUjfBW0TWHpSQrAB1hCj9FR/kCglOLrkM+p/mEOawwOQ0+niYHoD2dlnfz6793tz+NioB+JzM8lGadp3DUlBCjEtkjZ6HxjPz4gFD/X5ylXfbVwfbKWaMHOTl4ox71mOa2Z7MQIcIkPHl9KzqmJwGjddJnOHBmrcQxe63VdyHEJRVXkxAUZIda7Ii1Z/Ly9mpHRVG+KBFCxRxhAhXb891C12SkT15jz9mNDRGOCvdbvRbsm8nPfVkjnE8YgCb+k1wkFAObSEEVShO0WBPGfEF8oIiqCrPTiE4s5zYLUtkwH9mjq3pODweOfuvUIBGagmimfB22zGiOPC0olhntOQ6GR1BrHYkSQGJ55VtPiS91rbjpWKZM912e5HXE6kI6Ts+LwzIPQWHNvBjE4S7kvHF6ELnUGUXFIbmqY4TGql/wPpBfrv"}})])}],l={},r=l,i=n("2877"),p=Object(i["a"])(r,a,e,!1,null,null,null);t["default"]=p.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216037"],{c13f:function(s,t,n){"use strict";n.r(t);var a=function(){var s=this;s._self._c;return s._m(0)},e=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("开启节点自由拖拽")]),t("blockquote",[t("p",[s._v("节点自由拖拽的连线可能不会符合你的预期,这个问题基本上不会改,所以自由拖拽功能不建议使用。")])]),t("p",[s._v("节点支持自由拖拽,也就是可以把它拖动到你指定的位置,默认是不开启的,如果需要开启可以在实例化"),t("code",[s._v("simple-mind-map")]),s._v("时传入开启的选项:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("new")]),s._v(" MindMap({\n "),t("span",{staticClass:"hljs-comment"},[s._v("// ...")]),s._v("\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v("\n})\n")])]),t("p",[s._v("也可以动态切换是否开启:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.updateConfig({\n "),t("span",{staticClass:"hljs-attr"},[s._v("enableFreeDrag")]),s._v(": "),t("span",{staticClass:"hljs-literal"},[s._v("true")]),t("span",{staticClass:"hljs-comment"},[s._v("// false")]),s._v("\n})\n")])]),t("p",[s._v("自由拖拽很容器将节点拖的乱七八糟,所以也可以通过命令回到默认的位置:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'RESET_LAYOUT'")]),s._v(")\n")])]),t("p",[s._v("也可以使用快捷键"),t("code",[s._v("Ctrl + L")]),s._v("来恢复。")]),t("h2",[s._v("完整示例")]),t("iframe",{staticStyle:{width:"100%",height:"455px",border:"none"},attrs:{src:"https://wanglin2.github.io/playground/#eNrFVd1uG0UUfpVhEVoH2buuxJVxSksbJKSEolAuUDeqxrtje8rszLIzm8SyVgoF1EKIFASiFdxAVQFCQFWBEE2oeJmsnb4FZ3b2L44veldLa82c853znZnzM1PrchQ52wmxelZf+jGNFJJEJdFFj9MwErFCUxSTYRsJviESrkjQRnKMGRM7m2SIUjSMRYhs8GBXFhuUBxs4MirPkiBmpBOCtBPiyLM8jpDHGVFIyzRyFfGEMSN3XZQ9/Tr7/GD2397sr+P5d5+efnF7fvtJdvfe6Y+/eNwXXCqEfUW3yTsiIBKs64haN7ZWPF6iqLwWEf5WTMjVGI8ACEdpDTGTJAdpqrt3ZgcPZvcfZYc/Zf/uZYePTu/8Ov/m8Wz/29n+09KPEqMRIw0/rRW0ehFNdcRnOZxtzBICiJeWyTW+OLOTRAFW5IrgQzpq5Z4QIhwPap7eUt8QuEoh/LQ4wezjB9nDg2fH90//eJj980n2eK+MOiaQynU8EYk6G3IZAtkl/hURhpgHLXtz7b216zfXL39w7f3rdum/ynrrvLnOGtkps10dgfVQIPwkJFw5I6LWGNHLNydvA0dhCYdWmHIS2yttYwVXgXvGu/55lhZ4VkNkxIrsKi32rNkPT0xdmHrSv7RwpoH+mLIgJlyDb9Q+FtwtZVlkOjn6cn708yLZWcIlpFu1rol7QRGUy0JW2lFO1aYQSjfSu0JSRQUHS5uRobLbyPYhdZCmrQK+WJ95K2lVuvK66V6EoCTn33+VHf5m4jVdfHK0f3L8d7P2BG/ZHFhvmk4GspbetpH+X6dS1fWGmt1eNViJM/RQr/D1XTPDYHrBRhEYPNBjsEOoH9Bt5DMs5apnFUFcJaHwrFxdAGhQa6sqBUjfBW0TWHpSQrAB1hCj9FR/kCglOLrkM+p/mEOawwOQ0+niYHoD2dlnfz6793tz+NioB+JzM8lGadp3DUlBCjEtkjZ6HxjPz4gFD/X5ylXfbVwfbKWaMHOTl4ox71mOa2Z7MQIcIkPHl9KzqmJwGjddJnOHBmrcQxe63VdyHEJRVXkxAUZIda7Ii1Z/Ly9mpHRVG+KBFCxRxhAhXb891C12SkT15jz9mNDRGOCvdbvRbsm8nPfVkjnE8YgCb+k1wkFAObSEEVShO0WBPGfEF8oIiqCrPTiE4s5zYLUtkwH9mjq3pODweOfuvUIBGagmimfB22zGiOPC0olhntOQ6GR1BrHYkSQGJ55VtPiS91rbjpWKZM912e5HXE6kI6Ts+LwzIPQWHNvBjE4S7kvHF6ELnUGUXFIbmqY4TGql/wPpBfrv"}})])}],l={},r=l,i=n("2877"),p=Object(i["a"])(r,a,e,!1,null,null,null);t["default"]=p.exports}}]);

File diff suppressed because one or more lines are too long

1
dist/js/chunk-2d216f87.js vendored Normal file
View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d216f87"],{c576:function(e,t,n){"use strict";n.r(t);var _=function(){var e=this;e._self._c;return e._m(0)},v=[function(){var e=this,t=e._self._c;return t("div",[t("h1",[e._v("TextEdit 实例")]),t("p",[e._v("节点文本编辑实例。可以通过"),t("code",[e._v("mindMap.renderer.textEdit")]),e._v("获取到。")]),t("h2",[e._v("方法")]),t("h3",[e._v("isShowTextEdit()")]),t("p",[e._v("获取当前文本编辑框是否处于显示状态,也就是是否处在文本编辑状态。")]),t("h3",[e._v("hideEditTextBox()")]),t("p",[e._v("隐藏文本编辑框,会将当前文本编辑框中的内容设置为节点文本。")]),t("h3",[e._v("registerTmpShortcut()")]),t("p",[e._v("注册临时快捷键,也就是可以通过 Enter 键和 Tab 键完成编辑。")]),t("h3",[e._v("show({ node})")]),t("ul",[t("li",[t("code",[e._v("node")]),e._v(":要进入编辑的节点实例")])]),t("p",[e._v("手动开启节点编辑。默认会在节点双击、按 F2 时进入节点编辑。")])])}],i={},r=i,d=n("2877"),o=Object(d["a"])(r,_,v,!1,null,null,null);t["default"]=o.exports}}]);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21d064"],{d013:function(s,a,t){"use strict";t.r(a);var n=function(){var s=this;s._self._c;return s._m(0)},_=[function(){var s=this,a=s._self._c;return a("div",[a("h1",[s._v("如何实现搜索替换")]),a("blockquote",[a("p",[s._v("需要先注册 Search 插件")])]),a("p",[s._v("要实现搜索替换很简单,你只要先创建两个输入框,两个按钮,然后调用相关方法即可。")]),a("p",[s._v("第一个输入框用于搜索,可以绑定一个回车事件,然后调用如下方法:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.search.search("),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".searchText, "),a("span",{staticClass:"hljs-function"},[s._v("() =>")]),s._v(" {\n "),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".$refs.searchInputRef.focus()\n})\n")])]),a("p",[a("code",[s._v("search")]),s._v("方法调用一次就会跳转到下一个匹配的节点,当搜索文本改变后再调用,默认会重新搜索从头开始。")]),a("p",[a("code",[s._v("search")]),s._v("方法第二个参数是一个回调函数,当本次搜索完成,即在跳转到节点后调用,一般需要在这个回调函数里重新让你的输入框聚焦,因为激活节点会拿走焦点,所以你需要把焦点拿回来。")]),a("p",[s._v("第二个输入框用于替换,替换支持单个替换和全部替换,需要注意的是要先在调用了"),a("code",[s._v("search")]),s._v("方法后才能调用这两个方法,单个替换只需要调用如下方法:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.search.replace("),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".replaceText, "),a("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v(")\n")])]),a("p",[s._v("第二个参数传"),a("code",[s._v("true")]),s._v("会在替换完成后自动跳转到下一个匹配的节点,这样可以进行连续替换。")]),a("p",[s._v("要进行全部替换可以调用如下方法:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.search.replaceAll("),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".replaceText)\n")])]),a("p",[s._v("最后你可以通过监听"),a("code",[s._v("search_info_change")]),s._v("方法来获取匹配的节点数量和当前定位到的索引:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.on("),a("span",{staticClass:"hljs-string"},[s._v("'search_info_change'")]),s._v(", "),a("span",{staticClass:"hljs-function"},[a("span",{staticClass:"hljs-params"},[s._v("data")]),s._v(" =>")]),s._v(" {\n "),a("span",{staticClass:"hljs-built_in"},[s._v("console")]),s._v(".log("),a("span",{staticClass:"hljs-string"},[s._v("'当前所在:'")]),s._v("+ (data.currentIndex + "),a("span",{staticClass:"hljs-number"},[s._v("1")]),s._v("), "),a("span",{staticClass:"hljs-string"},[s._v("'匹配总数:'")]),s._v(" + data.total)\n})\n")])])])}],c={},l=c,e=t("2877"),i=Object(e["a"])(l,n,_,!1,null,null,null);a["default"]=i.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21d064"],{d013:function(s,a,t){"use strict";t.r(a);var n=function(){var s=this;s._self._c;return s._m(0)},_=[function(){var s=this,a=s._self._c;return a("div",[a("h1",[s._v("如何实现搜索替换")]),a("blockquote",[a("p",[s._v("需要先注册 Search 插件")])]),a("p",[s._v("要实现搜索替换很简单,你只要先创建两个输入框,两个按钮,然后调用相关方法即可。")]),a("p",[s._v("第一个输入框用于搜索,可以绑定一个回车事件,然后调用如下方法:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.search.search("),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".searchText, "),a("span",{staticClass:"hljs-function"},[s._v("() =>")]),s._v(" {\n "),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".$refs.searchInputRef.focus()\n})\n")])]),a("p",[a("code",[s._v("search")]),s._v("方法调用一次就会跳转到下一个匹配的节点,当搜索文本改变后再调用,默认会重新搜索从头开始。")]),a("p",[a("code",[s._v("search")]),s._v("方法第二个参数是一个回调函数,当本次搜索完成,即在跳转到节点后调用,一般需要在这个回调函数里重新让你的输入框聚焦,因为激活节点会拿走焦点,所以你需要把焦点拿回来。")]),a("p",[s._v("第二个输入框用于替换,替换支持单个替换和全部替换,需要注意的是要先在调用了"),a("code",[s._v("search")]),s._v("方法后才能调用这两个方法,单个替换只需要调用如下方法:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.search.replace("),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".replaceText, "),a("span",{staticClass:"hljs-literal"},[s._v("true")]),s._v(")\n")])]),a("p",[s._v("第二个参数传"),a("code",[s._v("true")]),s._v("会在替换完成后自动跳转到下一个匹配的节点,这样可以进行连续替换。")]),a("p",[s._v("要进行全部替换可以调用如下方法:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.search.replaceAll("),a("span",{staticClass:"hljs-built_in"},[s._v("this")]),s._v(".replaceText)\n")])]),a("p",[s._v("最后你可以通过监听"),a("code",[s._v("search_info_change")]),s._v("方法来获取匹配的节点数量和当前定位到的索引:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.on("),a("span",{staticClass:"hljs-string"},[s._v("'search_info_change'")]),s._v(", "),a("span",{staticClass:"hljs-function"},[a("span",{staticClass:"hljs-params"},[s._v("data")]),s._v(" =>")]),s._v(" {\n "),a("span",{staticClass:"hljs-built_in"},[s._v("console")]),s._v(".log("),a("span",{staticClass:"hljs-string"},[s._v("'当前所在:'")]),s._v("+ (data.currentIndex + "),a("span",{staticClass:"hljs-number"},[s._v("1")]),s._v("), "),a("span",{staticClass:"hljs-string"},[s._v("'匹配总数:'")]),s._v(" + data.total)\n})\n")])]),a("p",[s._v("如果是只读模式下搜索,搜索匹配到的节点不会被激活,而是被高亮。")])])}],c={},l=c,e=t("2877"),i=Object(e["a"])(l,n,_,!1,null,null,null);a["default"]=i.exports}}]);

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221c76"],{cc99:function(s,t,i){"use strict";i.r(t);var n=function(){var s=this;s._self._c;return s._m(0)},a=[function(){var s=this,t=s._self._c;return t("div",[t("h1",[s._v("开启节点富文本编辑")]),t("p",[s._v("默认节点编辑是不支持富文本模式的,如果要开启需要使用富文本编辑插件,但是富文本编辑模式目前存在缺陷,详情可以阅读"),t("a",{attrs:{href:"https://wanglin2.github.io/mind-map/#/doc/zh/richText"}},[s._v("richText")]),s._v("。")]),t("p",[s._v("富文本编辑的优势就是可以对一个节点内的部分文本设置样式所以通常来说还需要搭配一个悬浮的工具栏这个功能默认也是没有的涉及到UI的功能一般都不提供,所以也需要你自行开发,如何渲染这个悬浮工具栏可以阅读"),t("a",{attrs:{href:"https://wanglin2.github.io/mind-map/#/doc/zh/course16"}},[s._v("如何渲染富文本的悬浮工具栏")]),s._v("。")]),t("p",[s._v("如果也你需要动态切换是否开启富文本编辑的功能可以参考如下代码:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),t("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),t("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),t("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" RichText "),t("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),t("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/RichText.js'")]),s._v("\n"),t("span",{staticClass:"hljs-comment"},[s._v("// import RichText from 'simple-mind-map/src/RichText.js' v0.6.0以下版本使用该路径")]),s._v("\n\n"),t("span",{staticClass:"hljs-comment"},[s._v("// 动态开启富文本编辑")]),s._v("\nmindMap.addPlugin(RichText)\n\n"),t("span",{staticClass:"hljs-comment"},[s._v("// 动态关闭富文本编辑")]),s._v("\nmindMap.removePlugin(RichText)\n")])]),t("p",[s._v("如果你使用的是"),t("code",[s._v("simpleMindMap.umd.js")]),s._v("或"),t("code",[s._v("simpleMindMap.esm.js")]),s._v("这种打包后的完整版,那么是不支持切换的,默认是就是开启的,如有相关需求可以提"),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/issues"}},[s._v("issue")]),s._v("。")])])}],c={},e=c,p=i("2877"),l=Object(p["a"])(e,n,a,!1,null,null,null);t["default"]=l.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221c76"],{cc99:function(s,n,t){"use strict";t.r(n);var i=function(){var s=this;s._self._c;return s._m(0)},a=[function(){var s=this,n=s._self._c;return n("div",[n("h1",[s._v("开启节点富文本编辑")]),n("p",[s._v("默认节点编辑是不支持富文本模式的,如果要开启需要使用富文本编辑插件。")]),n("p",[s._v("富文本编辑的优势就是可以对一个节点内的部分文本设置样式所以通常来说还需要搭配一个悬浮的工具栏这个功能默认也是没有的涉及到UI的功能都不提供,所以也需要你自行开发,如何渲染这个悬浮工具栏可以阅读"),n("a",{attrs:{href:"https://wanglin2.github.io/mind-map/#/doc/zh/course16"}},[s._v("如何渲染富文本的悬浮工具栏")]),s._v("。")]),n("p",[s._v("如果也你需要动态切换是否开启富文本编辑的功能可以参考如下代码:")]),n("pre",{staticClass:"hljs"},[n("code",[n("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),n("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),n("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),n("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" RichText "),n("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),n("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/RichText.js'")]),s._v("\n"),n("span",{staticClass:"hljs-comment"},[s._v("// import RichText from 'simple-mind-map/src/RichText.js' v0.6.0以下版本使用该路径")]),s._v("\n\n"),n("span",{staticClass:"hljs-comment"},[s._v("// 动态开启富文本编辑")]),s._v("\nmindMap.addPlugin(RichText)\n\n"),n("span",{staticClass:"hljs-comment"},[s._v("// 动态关闭富文本编辑")]),s._v("\nmindMap.removePlugin(RichText)\n")])]),n("p",[s._v("如果你使用的是"),n("code",[s._v("simpleMindMap.umd.js")]),s._v("或"),n("code",[s._v("simpleMindMap.esm.js")]),s._v("这种打包后的完整版,那么是不支持切换的,默认是就是开启的。")])])}],c={},p=c,l=t("2877"),e=Object(l["a"])(p,i,a,!1,null,null,null);n["default"]=e.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/js/chunk-3b7380d1.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/js/chunk-740c1d05.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><link rel="icon" href="dist/logo.ico"><title>思绪思维导图</title><script>//
window.externalPublicPath = './dist/'
// 接管应用
window.takeOverApp = false</script><link href="dist/css/chunk-vendors.css?7820598bfce2a2653e5c" rel="stylesheet"><link href="dist/css/app.css?7820598bfce2a2653e5c" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>const getDataFromBackend = () => {
window.takeOverApp = false</script><link href="dist/css/chunk-vendors.css?21d0155a2ffb08384a8e" rel="stylesheet"><link href="dist/css/app.css?21d0155a2ffb08384a8e" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>const getDataFromBackend = () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve({
@ -66,4 +66,4 @@
// 可以通过window.$bus.$on()来监听应用的一些事件
// 实例化页面
window.initApp()
}</script><script src="dist/js/chunk-vendors.js?7820598bfce2a2653e5c"></script><script src="dist/js/app.js?7820598bfce2a2653e5c"></script></body></html>
}</script><script src="dist/js/chunk-vendors.js?21d0155a2ffb08384a8e"></script><script src="dist/js/app.js?21d0155a2ffb08384a8e"></script></body></html>

View File

@ -162,19 +162,16 @@ class MindMap {
render(callback, source = '') {
this.batchExecution.push('render', () => {
this.initTheme()
this.renderer.reRender = false
this.renderer.render(callback, source)
})
}
// 重新渲染
reRender(callback, source = '') {
this.batchExecution.push('render', () => {
this.clearDraw()
this.initTheme()
this.renderer.reRender = true
this.renderer.render(callback, source)
})
this.renderer.reRender = true // 标记为重新渲染
this.renderer.clearCache() // 清空节点缓存池
this.clearDraw() // 清空画布
this.render(callback, (source = ''))
}
// 获取或更新容器尺寸位置信息
@ -410,20 +407,34 @@ class MindMap {
draw.translate(-rect.x + elRect.left, -rect.y + elRect.top)
// 克隆一份数据
let clone = svg.clone()
// 如果实际图形宽高超出了屏幕宽高,且存在水印的话需要重新绘制水印,否则会出现超出部分没有水印的问题
if (
!ignoreWatermark &&
(rect.width > origWidth || rect.height > origHeight) &&
this.watermark &&
this.watermark.hasWatermark()
) {
this.width = rect.width
this.height = rect.height
this.watermark.draw()
clone = svg.clone()
this.width = origWidth
this.height = origHeight
this.watermark.draw()
// 是否存在水印
const hasWatermark = this.watermark && this.watermark.hasWatermark()
if (!ignoreWatermark && hasWatermark) {
this.watermark.isInExport = true
// 是否是仅导出时需要水印
const { onlyExport } = this.opt.watermarkConfig
// 是否需要重新绘制水印
const needReDrawWatermark =
rect.width > origWidth || rect.height > origHeight
// 如果实际图形宽高超出了屏幕宽高,且存在水印的话需要重新绘制水印,否则会出现超出部分没有水印的问题
if (needReDrawWatermark) {
this.width = rect.width
this.height = rect.height
this.watermark.onResize()
clone = svg.clone()
this.width = origWidth
this.height = origHeight
this.watermark.onResize()
} else if (onlyExport) {
// 如果是仅导出时需要水印,那么需要进行绘制
this.watermark.onResize()
clone = svg.clone()
}
// 如果是仅导出时需要水印,需要清除
if (onlyExport) {
this.watermark.clear()
}
this.watermark.isInExport = false
}
// 添加必要的样式
clone.add(SVG(`<style>${cssContent}</style>`))
@ -495,7 +506,10 @@ class MindMap {
}
// 移除插件
;[...MindMap.pluginList].forEach(plugin => {
if (this[plugin.instanceName].beforePluginDestroy) {
if (
this[plugin.instanceName] &&
this[plugin.instanceName].beforePluginDestroy
) {
this[plugin.instanceName].beforePluginDestroy()
}
this[plugin.instanceName] = null

View File

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

View File

@ -328,13 +328,8 @@ export const ERROR_TYPES = {
CUSTOM_HANDLE_CLIPBOARD_TEXT_ERROR: 'custom_handle_clipboard_text_error',
LOAD_CLIPBOARD_IMAGE_ERROR: 'load_clipboard_image_error',
BEFORE_TEXT_EDIT_ERROR: 'before_text_edit_error',
EXPORT_ERROR: 'export_error'
}
// a4纸的宽高
export const a4Size = {
width: 592.28,
height: 841.89
EXPORT_ERROR: 'export_error',
EXPORT_LOAD_IMAGE_ERROR: 'export_load_image_error'
}
// css

View File

@ -40,6 +40,7 @@ export const defaultOpt = {
enableFreeDrag: false,
// 水印配置
watermarkConfig: {
onlyExport: false,// 是否仅在导出时添加水印
text: '',
lineSpacing: 100,
textSpacing: 100,
@ -97,7 +98,7 @@ export const defaultOpt = {
// 是否在点击了画布外的区域时结束节点文本的编辑状态
isEndNodeTextEditOnClickOuter: true,
// 最大历史记录数
maxHistoryCount: 1000,
maxHistoryCount: 500,
// 是否一直显示节点的展开收起按钮,默认为鼠标移上去和激活时才显示
alwaysShowExpandBtn: false,
// 扩展节点可插入的图标
@ -236,5 +237,24 @@ export const defaultOpt = {
NOT_ACTIVE : 不激活新创建的节点
ACTIVE_ONLY : 只激活新创建的节点不进入编辑模式
*/
createNewNodeBehavior: CONSTANTS.CREATE_NEW_NODE_BEHAVIOR.DEFAULT
createNewNodeBehavior: CONSTANTS.CREATE_NEW_NODE_BEHAVIOR.DEFAULT,
// 当节点图片加载失败时显示的默认图片
defaultNodeImage: '',
// 是否将思维导图限制在画布内
// 比如向右拖动时,思维导图图形的最左侧到达画布中心时将无法继续向右拖动,其他同理
isLimitMindMapInCanvas: false,
// 当注册了滚动条插件Scrollbar是否将思维导图限制在画布内isLimitMindMapInCanvas不再起作用
isLimitMindMapInCanvasWhenHasScrollbar: true,
// 在节点上粘贴剪贴板中的图片的处理方法默认是转换为data:url数据插入到节点中你可以通过该方法来将图片数据上传到服务器实现保存图片的url
// 可以传递一个异步方法接收Blob类型的图片数据需要返回如下结构
/*
{
url, // 图片url
size: {
width, // 图片的宽度
height //图片的高度
}
}
*/
handleNodePasteImg: null
}

View File

@ -44,13 +44,10 @@ export default class KeyCommand {
this.isInSvg = true
})
this.mindMap.on('svg_mouseleave', () => {
if (this.mindMap.richText && this.mindMap.richText.showTextEdit) {
return
}
if (this.mindMap.renderer.textEdit.isShowTextEdit()) return
if (
this.mindMap.renderer.textEdit.showTextEdit ||
(this.mindMap.associativeLine &&
this.mindMap.associativeLine.showTextEdit)
this.mindMap.associativeLine &&
this.mindMap.associativeLine.showTextEdit
) {
return
}

View File

@ -29,11 +29,13 @@ class Event extends EventEmitter {
// 绑定函数上下文
bindFn() {
this.onBodyMousedown = this.onBodyMousedown.bind(this)
this.onBodyClick = this.onBodyClick.bind(this)
this.onDrawClick = this.onDrawClick.bind(this)
this.onMousedown = this.onMousedown.bind(this)
this.onMousemove = this.onMousemove.bind(this)
this.onMouseup = this.onMouseup.bind(this)
this.onNodeMouseup = this.onNodeMouseup.bind(this)
this.onMousewheel = this.onMousewheel.bind(this)
this.onContextmenu = this.onContextmenu.bind(this)
this.onSvgMousedown = this.onSvgMousedown.bind(this)
@ -44,12 +46,14 @@ class Event extends EventEmitter {
// 绑定事件
bind() {
document.body.addEventListener('mousedown', this.onBodyMousedown)
document.body.addEventListener('click', this.onBodyClick)
this.mindMap.svg.on('click', this.onDrawClick)
this.mindMap.el.addEventListener('mousedown', this.onMousedown)
this.mindMap.svg.on('mousedown', this.onSvgMousedown)
window.addEventListener('mousemove', this.onMousemove)
window.addEventListener('mouseup', this.onMouseup)
this.on('node_mouseup', this.onNodeMouseup)
this.mindMap.el.addEventListener('wheel', this.onMousewheel)
this.mindMap.svg.on('contextmenu', this.onContextmenu)
this.mindMap.svg.on('mouseenter', this.onMouseenter)
@ -59,11 +63,13 @@ class Event extends EventEmitter {
// 解绑事件
unbind() {
document.body.removeEventListener('mousedown', this.onBodyMousedown)
document.body.removeEventListener('click', this.onBodyClick)
this.mindMap.svg.off('click', this.onDrawClick)
this.mindMap.el.removeEventListener('mousedown', this.onMousedown)
window.removeEventListener('mousemove', this.onMousemove)
window.removeEventListener('mouseup', this.onMouseup)
this.off('node_mouseup', this.onNodeMouseup)
this.mindMap.el.removeEventListener('wheel', this.onMousewheel)
this.mindMap.svg.off('contextmenu', this.onContextmenu)
this.mindMap.svg.off('mouseenter', this.onMouseenter)
@ -76,6 +82,11 @@ class Event extends EventEmitter {
this.emit('draw_click', e)
}
// 页面的鼠标按下事件
onBodyMousedown(e) {
this.emit('body_mousedown', e)
}
// 页面的单击事件
onBodyClick(e) {
this.emit('body_click', e)
@ -122,28 +133,33 @@ class Event extends EventEmitter {
// 鼠标松开事件
onMouseup(e) {
this.isLeftMousedown = false
this.isRightMousedown = false
this.isMiddleMousedown = false
this.onNodeMouseup()
this.emit('mouseup', e, this)
}
// 鼠标滚动
// 节点鼠标松开事件
onNodeMouseup() {
this.isLeftMousedown = false
this.isRightMousedown = false
this.isMiddleMousedown = false
}
// 鼠标滚动/触控板滑动
onMousewheel(e) {
e.stopPropagation()
e.preventDefault()
let dir
if (e.deltaY < 0) dir = CONSTANTS.DIR.UP
if (e.deltaY > 0) dir = CONSTANTS.DIR.DOWN
if (e.deltaX < 0) dir = CONSTANTS.DIR.LEFT
if (e.deltaX > 0) dir = CONSTANTS.DIR.RIGHT
const dirs = []
if (e.deltaY < 0) dirs.push(CONSTANTS.DIR.UP)
if (e.deltaY > 0) dirs.push(CONSTANTS.DIR.DOWN)
if (e.deltaX < 0) dirs.push(CONSTANTS.DIR.LEFT)
if (e.deltaX > 0) dirs.push(CONSTANTS.DIR.RIGHT)
// 判断是否是触控板
let isTouchPad = false
// mac、windows
if (e.wheelDeltaY === e.deltaY * -3 || Math.abs(e.wheelDeltaY) <= 10) {
isTouchPad = true
}
this.emit('mousewheel', e, dir, this, isTouchPad)
this.emit('mousewheel', e, dirs, this, isTouchPad)
}
// 鼠标右键菜单事件

View File

@ -276,9 +276,6 @@ class Render {
})
// 插入同级节点
this.mindMap.keyCommand.addShortcut('Enter', () => {
if (this.textEdit.showTextEdit) {
return
}
this.mindMap.execCommand('INSERT_NODE')
})
// 插入父节点
@ -323,16 +320,18 @@ class Render {
this.mindMap.keyCommand.addShortcut('Control+Down', () => {
this.mindMap.execCommand('DOWN_NODE')
})
// 复制节点、剪切节点、粘贴节点的快捷键需开发者自行注册实现可参考demo
// 复制节点、
this.mindMap.keyCommand.addShortcut('Control+c', () => {
this.copy()
})
this.mindMap.keyCommand.addShortcut('Control+v', () => {
this.onPaste()
})
// 剪切节点
this.mindMap.keyCommand.addShortcut('Control+x', () => {
this.cut()
})
// 粘贴节点
this.mindMap.keyCommand.addShortcut('Control+v', () => {
this.paste()
})
// 根节点居中显示
this.mindMap.keyCommand.addShortcut('Control+Enter', () => {
this.setRootNodeCenter()
@ -387,6 +386,13 @@ class Render {
this.mindMap.keyCommand.restore()
}
// 清空节点缓存池
clearCache() {
this.layout.lru.clear()
this.nodeCache = {}
this.lastNodeCache = {}
}
// 渲染
render(callback = () => {}, source) {
// 如果当前还没有渲染完毕,不再触发渲染
@ -431,6 +437,9 @@ class Render {
this.waitRenderingParams = []
this.render(...params)
} else {
if (this.reRender) {
this.reRender = false
}
// 触发一次保存,因为修改了渲染树的数据
if (
this.mindMap.richText &&
@ -866,6 +875,7 @@ class Render {
// 复制节点
copy() {
this.beingCopyData = this.copyNode()
if (!this.beingCopyData) return
setDataToClipboard({
simpleMindMap: true,
data: this.beingCopyData
@ -883,17 +893,13 @@ class Render {
})
}
// 粘贴节点
paste() {
if (this.beingCopyData) {
this.mindMap.execCommand('PASTE_NODE', this.beingCopyData)
}
}
// 粘贴事件
async onPaste() {
const { errorHandler, handleIsSplitByWrapOnPasteCreateNewNode } =
this.mindMap.opt
// 粘贴
async paste() {
const {
errorHandler,
handleIsSplitByWrapOnPasteCreateNewNode,
handleNodePasteImg
} = this.mindMap.opt
// 读取剪贴板的文字和图片
let text = null
let img = null
@ -996,7 +1002,13 @@ class Render {
// 存在图片,则添加到当前激活节点
if (img) {
try {
let imgData = await loadImage(img)
let imgData = null
// 自定义图片处理函数
if (handleNodePasteImg && typeof handleNodePasteImg === 'function') {
imgData = await handleNodePasteImg(img)
} else {
imgData = await loadImage(img)
}
if (this.activeNodeList.length > 0) {
this.activeNodeList.forEach(node => {
this.mindMap.execCommand('SET_NODE_IMAGE', node, {
@ -1013,7 +1025,9 @@ class Render {
}
} else {
// 粘贴节点数据
this.paste()
if (this.beingCopyData) {
this.mindMap.execCommand('PASTE_NODE', this.beingCopyData)
}
}
}
@ -1205,7 +1219,7 @@ class Render {
// 复制节点
copyNode() {
if (this.activeNodeList.length <= 0) {
return
return null
}
const nodeList = getTopAncestorsFomNodeList(this.activeNodeList)
return nodeList.map(node => {
@ -1363,7 +1377,7 @@ class Render {
0
)
this.mindMap.render(() => {
this.mindMap.view.reset()
this.setRootNodeCenter()
})
}

View File

@ -21,6 +21,7 @@ export default class TextEdit {
this.showTextEdit = false
// 如果编辑过程中缩放画布了,那么缓存当前编辑的内容
this.cacheEditingText = ''
this.hasBodyMousedown = false
this.bindEvent()
}
@ -38,7 +39,12 @@ export default class TextEdit {
// 隐藏文本编辑框
this.hideEditTextBox()
})
this.mindMap.on('body_mousedown', () => {
this.hasBodyMousedown = true
})
this.mindMap.on('body_click', () => {
if (!this.hasBodyMousedown) return
this.hasBodyMousedown = false
// 隐藏文本编辑框
if (this.mindMap.opt.isEndNodeTextEditOnClickOuter) {
this.hideEditTextBox()
@ -126,6 +132,14 @@ export default class TextEdit {
})
}
// 获取当前文本编辑框是否处于显示状态,也就是是否处在文本编辑状态
isShowTextEdit() {
if (this.mindMap.richText) {
return this.mindMap.richText.showTextEdit
}
return this.showTextEdit
}
// 显示文本编辑框
// isInserting是否是刚创建的节点
// isFromKeyDown是否是在按键事件进入的编辑

View File

@ -167,6 +167,11 @@ class Node {
this.top = 0
}
// 节点被删除时需要复位的数据
resetWhenDelete() {
this._isMouseenter = false
}
// 处理数据
handleData(data) {
data.data.expand = data.data.expand === false ? false : true
@ -181,10 +186,15 @@ class Node {
let { isUseCustomNodeContent, customCreateNodeContent } = this.mindMap.opt
if (isUseCustomNodeContent && customCreateNodeContent) {
this._customNodeContent = customCreateNodeContent(this)
this._customNodeContent.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml')
}
// 如果没有返回内容,那么还是使用内置的节点内容
if (this._customNodeContent) return
if (this._customNodeContent) {
this._customNodeContent.setAttribute(
'xmlns',
'http://www.w3.org/1999/xhtml'
)
return
}
this._imgData = this.createImgNode()
this._iconData = this.createIconNode()
this._textData = this.createTextNode()
@ -700,6 +710,7 @@ class Node {
// 销毁节点,不但会从画布删除,而且原节点直接置空,后续无法再插回画布
destroy() {
if (!this.group) return
this.resetWhenDelete()
this.group.remove()
this.removeGeneralization()
this.removeLine()
@ -831,9 +842,9 @@ class Node {
this.renderer.layout.renderLine(
this,
this._lines,
(line, node) => {
(...args) => {
// 添加样式
this.styleLine(line, node)
this.styleLine(...args)
},
this.style.getStyle('lineStyle', true)
)
@ -888,19 +899,26 @@ class Node {
}
// 设置连线样式
styleLine(line, node) {
let width =
node.getSelfInhertStyle('lineWidth') || node.getStyle('lineWidth', true)
let color =
node.getSelfInhertStyle('lineColor') || node.getStyle('lineColor', true)
let dasharray =
node.getSelfInhertStyle('lineDasharray') ||
node.getStyle('lineDasharray', true)
this.style.line(line, {
width,
color,
dasharray
})
styleLine(line, childNode, enableMarker) {
const width =
childNode.getSelfInhertStyle('lineWidth') ||
childNode.getStyle('lineWidth', true)
const color =
childNode.getSelfInhertStyle('lineColor') ||
childNode.getStyle('lineColor', true)
const dasharray =
childNode.getSelfInhertStyle('lineDasharray') ||
childNode.getStyle('lineDasharray', true)
this.style.line(
line,
{
width,
color,
dasharray
},
enableMarker,
childNode
)
}
// 移除连线

View File

@ -56,6 +56,9 @@ class Style {
// 构造函数
constructor(ctx) {
this.ctx = ctx
// 箭头图标
this._markerPath = null
this._marker = null
}
// 合并样式
@ -207,8 +210,38 @@ class Style {
}
// 连线
line(node, { width, color, dasharray } = {}) {
node.stroke({ width, color, dasharray }).fill({ color: 'none' })
line(line, { width, color, dasharray } = {}, enableMarker, childNode) {
line.stroke({ color, dasharray, width }).fill({ color: 'none' })
// 可以显示箭头
if (enableMarker) {
const showMarker = this.merge('showLineMarker', true)
const childNodeStyle = childNode.style
// 显示箭头
if (showMarker) {
// 创建子节点箭头标记
childNodeStyle._marker =
childNodeStyle._marker || childNodeStyle.createMarker()
// 设置样式
childNodeStyle._markerPath.stroke({ color }).fill({ color })
line.marker('end', childNodeStyle._marker)
} else if (childNodeStyle._marker) {
// 不显示箭头,则删除该子节点的箭头标记
line.attr('marker-end', '')
childNodeStyle._marker.remove()
childNodeStyle._marker = null
}
}
}
// 创建箭头
createMarker() {
return this.ctx.lineDraw.marker(20, 20, add => {
add.ref(8, 5)
add.size(20, 20)
add.attr('markerUnits', 'userSpaceOnUse')
add.attr('orient', 'auto-start-reverse')
this._markerPath = add.path('M0,0 L2,5 L0,10 L10,5 Z')
})
}
// 概要连线

View File

@ -6,18 +6,35 @@ import {
checkIsRichText,
isUndef
} from '../../../utils'
import { Image, SVG, A, G, Rect, Text, ForeignObject } from '@svgdotjs/svg.js'
import {
Image as SVGImage,
SVG,
A,
G,
Rect,
Text,
ForeignObject
} from '@svgdotjs/svg.js'
import iconsSvg from '../../../svg/icons'
import { CONSTANTS, commonCaches } from '../../../constants/constant'
// 创建图片节点
function createImgNode() {
let img = this.getData('image')
const img = this.getData('image')
if (!img) {
return
}
let imgSize = this.getImgShowSize()
let node = new Image().load(img).size(...imgSize)
const imgSize = this.getImgShowSize()
const node = new SVGImage().load(img).size(...imgSize)
// 如果指定了加载失败显示的图片,那么加载一下图片检测是否失败
const { defaultNodeImage } = this.mindMap.opt
if (defaultNodeImage) {
const imgEl = new Image()
imgEl.onerror = () => {
node.load(defaultNodeImage)
}
imgEl.src = img
}
if (this.getData('imageTitle')) {
node.attr('title', this.getData('imageTitle'))
}
@ -71,7 +88,7 @@ function createIconNode() {
node = SVG(src)
} else {
// 图片图标
node = new Image().load(src)
node = new SVGImage().load(src)
}
node.size(iconSize, iconSize)
node.on('click', e => {
@ -101,8 +118,8 @@ function createRichTextNode() {
recoverText = true
}
}
if (recoverText) {
let text = this.getData('text')
let text = this.getData('text')
if (recoverText && !isUndef(text)) {
// 判断节点内容是否是富文本
let isRichText = checkIsRichText(text)
// 样式字符串
@ -140,6 +157,7 @@ function createRichTextNode() {
let elTmp = div.children[0]
elTmp.classList.add('smm-richtext-node-wrap')
height = elTmp.getBoundingClientRect().height
div.innerHTML = html
}
width = Math.ceil(width) + 1 // 修复getBoundingClientRect方法对实际宽度是小数的元素获取到的值是整数导致宽度不够文本发生换行的问题
height = Math.ceil(height)

View File

@ -37,7 +37,7 @@ class View {
this.mindMap.event.on('drag', (e, event) => {
// 按住ctrl键拖动为多选
// 禁用拖拽
if (e.ctrlKey || this.mindMap.opt.isDisableDrag) {
if (e.ctrlKey || this.mindMap.opt.isDisableDrag) {
return
}
if (this.firstDrag) {
@ -55,8 +55,8 @@ class View {
this.firstDrag = true
})
// 放大缩小视图
this.mindMap.event.on('mousewheel', (e, dir, event, isTouchPad) => {
let {
this.mindMap.event.on('mousewheel', (e, dirs, event, isTouchPad) => {
const {
customHandleMousewheel,
mousewheelAction,
mouseScaleCenterUseMousePosition,
@ -71,55 +71,61 @@ class View {
) {
return customHandleMousewheel(e)
}
// 鼠标滚轮事件控制缩放
// 1.鼠标滚轮事件控制缩放
if (mousewheelAction === CONSTANTS.MOUSE_WHEEL_ACTION.ZOOM || e.ctrlKey) {
if (disableMouseWheelZoom) return
const { x: clientX, y: clientY } = this.mindMap.toPos(
e.clientX,
e.clientY
)
let cx = mouseScaleCenterUseMousePosition ? clientX : undefined
let cy = mouseScaleCenterUseMousePosition ? clientY : undefined
switch (dir) {
const cx = mouseScaleCenterUseMousePosition ? clientX : undefined
const cy = mouseScaleCenterUseMousePosition ? clientY : undefined
// 如果来自触控板,那么过滤掉左右的移动
if (
isTouchPad &&
(dirs.includes(CONSTANTS.DIR.LEFT) ||
dirs.includes(CONSTANTS.DIR.RIGHT))
) {
dirs = dirs.filter(dir => {
return ![CONSTANTS.DIR.LEFT, CONSTANTS.DIR.RIGHT].includes(dir)
})
}
switch (true) {
// 鼠标滚轮,向上和向左,都是缩小
case CONSTANTS.DIR.UP:
case CONSTANTS.DIR.LEFT:
case dirs.includes(CONSTANTS.DIR.UP || CONSTANTS.DIR.LEFT):
mousewheelZoomActionReverse
? this.enlarge(cx, cy, isTouchPad)
: this.narrow(cx, cy, isTouchPad)
break
// 鼠标滚轮,向下和向右,都是放大
case CONSTANTS.DIR.DOWN:
case CONSTANTS.DIR.RIGHT:
case dirs.includes(CONSTANTS.DIR.DOWN || CONSTANTS.DIR.RIGHT):
mousewheelZoomActionReverse
? this.narrow(cx, cy, isTouchPad)
: this.enlarge(cx, cy, isTouchPad)
break
}
} else {
// 鼠标滚轮事件控制画布移动
let step = mousewheelMoveStep
if (isTouchPad) {
step = 5
// 2.鼠标滚轮事件控制画布移动
const step = isTouchPad ? 5 : mousewheelMoveStep
let mx = 0
let my = 0
// 上移
if (dirs.includes(CONSTANTS.DIR.DOWN)) {
my = -step
}
switch (dir) {
// 上移
case CONSTANTS.DIR.DOWN:
this.translateY(-step)
break
// 下移
case CONSTANTS.DIR.UP:
this.translateY(step)
break
// 右移
case CONSTANTS.DIR.LEFT:
this.translateX(-step)
break
// 左移
case CONSTANTS.DIR.RIGHT:
this.translateX(step)
break
// 下移
if (dirs.includes(CONSTANTS.DIR.UP)) {
my = step
}
// 右移
if (dirs.includes(CONSTANTS.DIR.LEFT)) {
mx = step
}
// 左移
if (dirs.includes(CONSTANTS.DIR.RIGHT)) {
mx = -step
}
this.translateXY(mx, my)
}
})
}
@ -188,6 +194,9 @@ class View {
// 应用变换
transform() {
try {
this.limitMindMapInCanvas()
} catch (error) {}
this.mindMap.draw.transform({
origin: [0, 0],
scale: this.scale,
@ -254,18 +263,17 @@ class View {
// 适应画布大小
fit() {
let { fitPadding } = this.mindMap.opt
let draw = this.mindMap.draw
let origTransform = draw.transform()
let rect = draw.rbox()
let drawWidth = rect.width / origTransform.scaleX
let drawHeight = rect.height / origTransform.scaleY
let drawRatio = drawWidth / drawHeight
let { width: elWidth, height: elHeight } =
this.mindMap.elRect
const { fitPadding } = this.mindMap.opt
const draw = this.mindMap.draw
const origTransform = draw.transform()
const rect = draw.rbox()
const drawWidth = rect.width / origTransform.scaleX
const drawHeight = rect.height / origTransform.scaleY
const drawRatio = drawWidth / drawHeight
let { width: elWidth, height: elHeight } = this.mindMap.elRect
elWidth = elWidth - fitPadding * 2
elHeight = elHeight - fitPadding * 2
let elRatio = elWidth / elHeight
const elRatio = elWidth / elHeight
let newScale = 0
let flag = ''
if (drawWidth <= elWidth && drawHeight <= elHeight) {
@ -286,7 +294,10 @@ class View {
newScale = newWidth / drawWidth
}
this.setScale(newScale)
let newRect = draw.rbox()
const newRect = draw.rbox()
// 需要考虑画布容器距浏览器窗口左上角的距离
newRect.x -= this.mindMap.elRect.left
newRect.y -= this.mindMap.elRect.top
let newX = 0
let newY = 0
if (flag === 1) {
@ -301,6 +312,73 @@ class View {
}
this.translateXY(newX, newY)
}
// 将思维导图限制在画布内
limitMindMapInCanvas() {
const { isLimitMindMapInCanvasWhenHasScrollbar, isLimitMindMapInCanvas } =
this.mindMap.opt
// 如果注册了滚动条插件那么使用isLimitMindMapInCanvasWhenHasScrollbar配置
if (this.mindMap.scrollbar) {
if (!isLimitMindMapInCanvasWhenHasScrollbar) return
} else {
// 否则使用isLimitMindMapInCanvas配置
if (!isLimitMindMapInCanvas) return
}
let { scale, left, top, right, bottom } = this.getPositionLimit()
// 如果缩放值改变了
const scaleRatio = this.scale / scale
left *= scaleRatio
right *= scaleRatio
top *= scaleRatio
bottom *= scaleRatio
// 加上画布中心点距离
const centerX = this.mindMap.width / 2
const centerY = this.mindMap.height / 2
const scaleOffset = this.scale - 1
left -= scaleOffset * centerX
right -= scaleOffset * centerX
top -= scaleOffset * centerY
bottom -= scaleOffset * centerY
// 判断是否超出边界
if (this.x > left) {
this.x = left
}
if (this.x < right) {
this.x = right
}
if (this.y > top) {
this.y = top
}
if (this.y < bottom) {
this.y = bottom
}
}
// 计算图形四个方向的位置边界值
getPositionLimit() {
const { scaleX, scaleY } = this.mindMap.draw.transform()
const drawRect = this.mindMap.draw.rbox()
const rootRect = this.mindMap.renderer.root.group.rbox()
const rootCenterOffset = this.mindMap.renderer.layout.getRootCenterOffset(
rootRect.width,
rootRect.height
)
const left = rootRect.x - drawRect.x - rootCenterOffset.x * scaleX
const right = rootRect.x - drawRect.x2 - rootCenterOffset.x * scaleX
const top = rootRect.y - drawRect.y - rootCenterOffset.y * scaleY
const bottom = rootRect.y - drawRect.y2 - rootCenterOffset.y * scaleY
return {
scale: scaleX,
left,
right,
top,
bottom
}
}
}
export default View

View File

@ -17,6 +17,8 @@ class Base {
// 根节点
this.root = null
this.lru = new Lru(this.mindMap.opt.maxNodeCacheCount)
// 当initRootNodePosition不为默认的值时根节点的位置距默认的配置时根节点距离的差值
this.rootNodeCenterOffset = null
}
// 计算节点位置
@ -41,7 +43,7 @@ class Base {
cacheNode(uid, node) {
// 记录本次渲染时的节点
this.renderer.nodeCache[uid] = node
// 记录所有渲染时的节点
// 缓存所有渲染过的节点
this.lru.add(uid, node)
}
@ -70,11 +72,12 @@ class Base {
// 创建节点实例
createNode(data, parent, isRoot, layerIndex) {
// 创建节点
const uid = data.data.uid
let newNode = null
// 数据上保存了节点引用,那么直接复用节点
if (data && data._node && !this.renderer.reRender) {
newNode = data._node
let isLayerTypeChange = this.checkIsLayerTypeChange(
const isLayerTypeChange = this.checkIsLayerTypeChange(
newNode.layerIndex,
layerIndex
)
@ -87,43 +90,49 @@ class Base {
newNode.getSize()
newNode.needLayout = true
}
} else if (this.lru.has(data.data.uid) && !this.renderer.reRender) {
// 数据上没有保存节点引用但是通过uid找到了缓存的节点也可以复用
newNode = this.lru.get(data.data.uid)
} else if (
(this.lru.has(uid) || this.renderer.lastNodeCache[uid]) &&
!this.renderer.reRender
) {
// 节点数据上没有节点实例
// 但是通过uid在节点缓存池中找到了缓存的节点
// 或者在上一次渲染缓存对象中找到了节点
// 也可以直接复用
newNode = this.lru.get(uid) || this.renderer.lastNodeCache[uid]
// 保存该节点上一次的数据
let lastData = JSON.stringify(newNode.getData())
let isLayerTypeChange = this.checkIsLayerTypeChange(
const lastData = JSON.stringify(newNode.getData())
const isLayerTypeChange = this.checkIsLayerTypeChange(
newNode.layerIndex,
layerIndex
)
newNode.reset()
newNode.nodeData = newNode.handleData(data || {})
newNode.layerIndex = layerIndex
this.cacheNode(data.data.uid, newNode)
this.cacheNode(uid, newNode)
this.checkIsLayoutChangeRerenderExpandBtnPlaceholderRect(newNode)
data._node = newNode
// 主题或主题配置改变了需要重新计算节点大小和布局
let isResizeSource = this.checkIsNeedResizeSources()
const isResizeSource = this.checkIsNeedResizeSources()
// 节点数据改变了需要重新计算节点大小和布局
let isNodeDataChange = lastData !== JSON.stringify(data.data)
const isNodeDataChange = lastData !== JSON.stringify(data.data)
if (isResizeSource || isNodeDataChange || isLayerTypeChange) {
newNode.getSize()
newNode.needLayout = true
}
} else {
// 创建新节点
let uid = data.data.uid || createUid()
const newUid = uid || createUid()
newNode = new Node({
data,
uid,
uid: newUid,
renderer: this.renderer,
mindMap: this.mindMap,
draw: this.draw,
layerIndex
})
// uid保存到数据上为了节点复用
data.data.uid = uid
this.cacheNode(uid, newNode)
data.data.uid = newUid
this.cacheNode(newUid, newNode)
// 数据关联实际节点
data._node = newNode
if (data.data.isActive) {
@ -161,17 +170,21 @@ class Base {
}
}
// 定位节点到画布中间
setNodeCenter(node) {
let { initRootNodePosition } = this.mindMap.opt
let { CENTER } = CONSTANTS.INIT_ROOT_NODE_POSITION
if (
!initRootNodePosition ||
!Array.isArray(initRootNodePosition) ||
initRootNodePosition.length < 2
) {
initRootNodePosition = [CENTER, CENTER]
// 规范initRootNodePosition配置
formatInitRootNodePosition(pos) {
const { CENTER } = CONSTANTS.INIT_ROOT_NODE_POSITION
if (!pos || !Array.isArray(pos) || pos.length < 2) {
pos = [CENTER, CENTER]
}
return pos
}
// 定位节点到画布中间
setNodeCenter(node, position) {
let { initRootNodePosition } = this.mindMap.opt
initRootNodePosition = this.formatInitRootNodePosition(
position || initRootNodePosition
)
node.left = this.formatPosition(
initRootNodePosition[0],
this.mindMap.width,
@ -184,6 +197,42 @@ class Base {
)
}
// 当initRootNodePosition配置不为默认的['center','center']时,计算当前配置和默认配置情况下,根节点位置的差值
getRootCenterOffset(width, height) {
// 因为根节点的大小不会影响这个差值,所以计算一次就足够了
if (this.rootNodeCenterOffset) return this.rootNodeCenterOffset
let { initRootNodePosition } = this.mindMap.opt
const { CENTER } = CONSTANTS.INIT_ROOT_NODE_POSITION
initRootNodePosition = this.formatInitRootNodePosition(initRootNodePosition)
if (
initRootNodePosition[0] === CENTER &&
initRootNodePosition[1] === CENTER
) {
// 如果initRootNodePosition是默认的那么不需要计算
this.rootNodeCenterOffset = {
x: 0,
y: 0
}
} else {
// 否则需要计算当前配置和默认配置的差值
const tmpNode = {
width: width,
height: height
}
const tmpNode2 = {
width: width,
height: height
}
this.setNodeCenter(tmpNode, [CENTER, CENTER])
this.setNodeCenter(tmpNode2)
this.rootNodeCenterOffset = {
x: tmpNode2.left - tmpNode.left,
y: tmpNode2.top - tmpNode.top
}
}
return this.rootNodeCenterOffset
}
// 更新子节点属性
updateChildren(children, prop, offset) {
children.forEach(item => {
@ -394,6 +443,12 @@ class Base {
getNodeActChildrenLength(node) {
return node.nodeData.children && node.nodeData.children.length
}
// 设置连线样式
setLineStyle(style, line, path, childNode) {
line.plot(path)
style && style(line, childNode, true)
}
}
export default Base

View File

@ -233,8 +233,7 @@ class CatalogOrganization extends Base {
`M ${x2},${y1 + s1} L ${x2},${y1 + s1 > y2 ? y2 + item.height : y2}` +
nodeUseLineStylePath
// 竖线
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
minx = Math.min(minx, x1)
maxx = Math.max(maxx, x1)
@ -302,8 +301,7 @@ class CatalogOrganization extends Base {
}`
: ''
path += nodeUseLineStylePath
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
// 竖线
if (len > 0) {

View File

@ -300,8 +300,7 @@ class Fishbone extends Base {
// 水平线
if (node.layerIndex > 1) {
let path = `M ${x},${y} L ${item.left},${y}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
}
})
// 斜线

View File

@ -181,8 +181,7 @@ class LogicalStructure extends Base {
let path = `M ${x1},${y1} L ${x1 + s1},${y1} L ${x1 + s1},${y2} L ${
x2 + nodeUseLineStyleOffset
},${y2}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}
@ -209,8 +208,7 @@ class LogicalStructure extends Base {
? ` L ${item.left + item.width},${y2}`
: ''
let path = `M ${x1},${y1} L ${x2},${y2}` + nodeUseLineStylePath
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}
@ -242,8 +240,7 @@ class LogicalStructure extends Base {
} else {
path = this.cubicBezierPath(x1, y1, x2, y2) + nodeUseLineStylePath
}
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}

View File

@ -116,11 +116,7 @@ class MindMap extends Base {
this.root,
null,
(node, parent, isRoot, layerIndex) => {
if (
node.getData('expand') &&
node.children &&
node.children.length
) {
if (node.getData('expand') && node.children && node.children.length) {
let marginY = this.getMarginY(layerIndex + 1)
let baseTop = node.top + node.height / 2 + marginY
// 第一个子节点的top值 = 该节点中心的top值 - 子节点的高度之和的一半
@ -247,8 +243,7 @@ class MindMap extends Base {
let path = `M ${x1},${y1} L ${x1 + _s},${y1} L ${x1 + _s},${y2} L ${
x2 + nodeUseLineStyleOffset
},${y2}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}
@ -287,8 +282,7 @@ class MindMap extends Base {
}
}
let path = `M ${x1},${y1} L ${x2},${y2}` + nodeUseLineStylePath
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}
@ -332,8 +326,7 @@ class MindMap extends Base {
} else {
path = this.cubicBezierPath(x1, y1, x2, y2) + nodeUseLineStylePath
}
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}
@ -384,7 +377,8 @@ class MindMap extends Base {
x +
(isLeft ? -generalizationNodeMargin : generalizationNodeMargin) -
(isLeft ? item.generalizationNode.width : 0)
item.generalizationNode.top = top + (bottom - top - item.generalizationNode.height) / 2
item.generalizationNode.top =
top + (bottom - top - item.generalizationNode.height) / 2
})
}

View File

@ -78,11 +78,7 @@ class OrganizationStructure extends Base {
this.root,
null,
(node, parent, isRoot, layerIndex) => {
if (
node.getData('expand') &&
node.children &&
node.children.length
) {
if (node.getData('expand') && node.children && node.children.length) {
let marginX = this.getMarginY(layerIndex + 1)
// 第一个子节点的left值 = 该节点中心的left值 - 子节点的宽度之和的一半
let left = node.left + node.width / 2 - node.childrenAreaWidth / 2
@ -175,8 +171,7 @@ class OrganizationStructure extends Base {
? ` L ${item.left},${y2} L ${item.left + item.width},${y2}`
: ''
let path = `M ${x1},${y1} L ${x2},${y2}` + nodeUseLineStylePath
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}
@ -210,8 +205,7 @@ class OrganizationStructure extends Base {
? ` L ${item.left},${y2} L ${item.left + item.width},${y2}`
: ''
let path = `M ${x2},${y1 + s1} L ${x2},${y2}` + nodeUseLineStylePath
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
minx = Math.min(x1, minx)
maxx = Math.max(x1, maxx)
@ -261,9 +255,9 @@ class OrganizationStructure extends Base {
let path = `M ${x1},${y1} Q ${cx},${cy} ${x2},${y2}`
item.generalizationLine.plot(path)
item.generalizationNode.top = bottom + generalizationNodeMargin
item.generalizationNode.left = left + (right - left - item.generalizationNode.width) / 2
item.generalizationNode.left =
left + (right - left - item.generalizationNode.width) / 2
})
}
// 渲染展开收起按钮的隐藏占位元素

View File

@ -245,8 +245,7 @@ class Timeline extends Base {
let x2 = item.left
let y = node.top + node.height / 2
let path = `M ${x1},${y} L ${x2},${y}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
prevBother = item
})
} else {
@ -264,8 +263,7 @@ class Timeline extends Base {
}
// 水平线
let path = `M ${x},${y} L ${item.left},${y}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
// 竖线
if (len > 0) {

View File

@ -246,8 +246,7 @@ class VerticalTimeline extends Base {
let y2 = item.top
let x = node.left + node.width / 2
let path = `M ${x},${y1} L ${x},${y2}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
prevBother = item
})
} else {
@ -265,8 +264,7 @@ class VerticalTimeline extends Base {
L ${nodeRight + offset},${nodeYCenter}
L ${nodeRight + offset},${itemYCenter}
L ${itemLeft},${itemYCenter}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
} else {
let nodeLeft = node.left
@ -281,8 +279,7 @@ class VerticalTimeline extends Base {
L ${nodeLeft - offset},${nodeYCenter}
L ${nodeLeft - offset},${itemYCenter}
L ${itemRight},${itemYCenter}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
})
}
}
@ -306,8 +303,7 @@ class VerticalTimeline extends Base {
let y2 = item.top
let x = node.left + node.width / 2
let path = `M ${x},${y1} L ${x},${y2}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
prevBother = item
})
} else {
@ -322,8 +318,7 @@ class VerticalTimeline extends Base {
: item.left
let y2 = item.top + item.height / 2
let path = `M ${x1},${y1} L ${x2},${y2}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
}
})
}
@ -346,8 +341,7 @@ class VerticalTimeline extends Base {
let y2 = item.top
let x = node.left + node.width / 2
let path = `M ${x},${y1} L ${x},${y2}`
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
prevBother = item
})
} else {
@ -362,8 +356,7 @@ class VerticalTimeline extends Base {
: item.left
let y2 = item.top + item.height / 2
let path = this.cubicBezierPath(x1, y1, x2, y2)
lines[index].plot(path)
style && style(lines[index], item)
this.setLineStyle(style, lines[index], path, item)
}
})
}

View File

@ -59,43 +59,70 @@ class AssociativeLine {
// 监听事件
bindEvent() {
// 节点树渲染完毕后渲染连接线
this.renderAllLines = this.renderAllLines.bind(this)
this.onDrawClick = this.onDrawClick.bind(this)
this.onNodeClick = this.onNodeClick.bind(this)
this.removeLine = this.removeLine.bind(this)
this.addLine = this.addLine.bind(this)
this.onMousemove = this.onMousemove.bind(this)
this.onNodeDragging = this.onNodeDragging.bind(this)
this.onNodeDragend = this.onNodeDragend.bind(this)
this.onControlPointMouseup = this.onControlPointMouseup.bind(this)
// 节点树渲染完毕后渲染连接线
this.mindMap.on('node_tree_render_end', this.renderAllLines)
// 状态改变后重新渲染连接线
this.mindMap.on('data_change', this.renderAllLines)
// 监听画布和节点点击事件,用于清除当前激活的连接线
this.mindMap.on('draw_click', () => {
if (this.isControlPointMousedown) {
return
}
this.clearActiveLine()
})
this.mindMap.on('node_click', node => {
if (this.isCreatingLine) {
this.completeCreateLine(node)
} else {
this.clearActiveLine()
}
})
this.mindMap.on('draw_click', this.onDrawClick)
this.mindMap.on('node_click', this.onNodeClick)
// 注册删除快捷键
this.mindMap.keyCommand.addShortcut(
'Del|Backspace',
this.removeLine.bind(this)
)
this.mindMap.keyCommand.addShortcut('Del|Backspace', this.removeLine)
// 注册添加连接线的命令
this.mindMap.command.add('ADD_ASSOCIATIVE_LINE', this.addLine.bind(this))
this.mindMap.command.add('ADD_ASSOCIATIVE_LINE', this.addLine)
// 监听鼠标移动事件
this.mindMap.on('mousemove', this.onMousemove.bind(this))
this.mindMap.on('mousemove', this.onMousemove)
// 节点拖拽事件
this.mindMap.on('node_dragging', this.onNodeDragging.bind(this))
this.mindMap.on('node_dragend', this.onNodeDragend.bind(this))
this.mindMap.on('node_dragging', this.onNodeDragging)
this.mindMap.on('node_dragend', this.onNodeDragend)
// 拖拽控制点
this.mindMap.on('mouseup', this.onControlPointMouseup.bind(this))
this.mindMap.on('mouseup', this.onControlPointMouseup)
// 缩放事件
this.mindMap.on('scale', this.onScale)
}
// 解绑事件
unBindEvent() {
this.mindMap.off('node_tree_render_end', this.renderAllLines)
this.mindMap.off('data_change', this.renderAllLines)
this.mindMap.off('draw_click', this.onDrawClick)
this.mindMap.off('node_click', this.onNodeClick)
this.mindMap.keyCommand.removeShortcut('Del|Backspace', this.removeLine)
this.mindMap.command.remove('ADD_ASSOCIATIVE_LINE', this.addLine)
this.mindMap.off('mousemove', this.onMousemove)
this.mindMap.off('node_dragging', this.onNodeDragging)
this.mindMap.off('node_dragend', this.onNodeDragend)
this.mindMap.off('mouseup', this.onControlPointMouseup)
this.mindMap.off('scale', this.onScale)
}
// 画布点击事件
onDrawClick() {
if (this.isControlPointMousedown) {
return
}
this.clearActiveLine()
}
// 节点点击事件
onNodeClick(node) {
if (this.isCreatingLine) {
this.completeCreateLine(node)
} else {
this.clearActiveLine()
}
}
// 创建箭头
createMarker() {
return this.associativeLineDraw.marker(20, 20, add => {
@ -544,6 +571,16 @@ class AssociativeLine {
this.associativeLineDraw.back() // 最底层
this.associativeLineDraw.forward() // 连线层上面
}
// 插件被移除前做的事情
beforePluginRemove() {
this.unBindEvent()
}
// 插件被卸载前做的事情
beforePluginDestroy() {
this.unBindEvent()
}
}
AssociativeLine.instanceName = 'associativeLine'

View File

@ -55,51 +55,68 @@ class Drag extends Base {
// 绑定事件
bindEvent() {
this.checkOverlapNode = throttle(this.checkOverlapNode, 300, this)
this.mindMap.on('node_mousedown', (node, e) => {
// 只读模式、不是鼠标左键按下、按下的是概要节点或根节点直接返回
if (
this.mindMap.opt.readonly ||
e.which !== 1 ||
node.isGeneralization ||
node.isRoot
) {
return
}
e.preventDefault()
this.isMousedown = true
// 记录鼠标按下时的节点
this.mousedownNode = node
// 记录鼠标按下的坐标
const { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseDownX = x
this.mouseDownY = y
})
this.mindMap.on('mousemove', e => {
if (this.mindMap.opt.readonly || !this.isMousedown) {
return
}
e.preventDefault()
const { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseMoveX = x
this.mouseMoveY = y
// 还没开始移动时鼠标位移过小不认为是拖拽
if (
!this.isDragging &&
Math.abs(x - this.mouseDownX) <= this.checkDragOffset &&
Math.abs(y - this.mouseDownY) <= this.checkDragOffset
) {
return
}
this.mindMap.emit('node_dragging')
this.handleStartMove()
this.onMove(x, y, e)
})
this.onNodeMousedown = this.onNodeMousedown.bind(this)
this.onMousemove = this.onMousemove.bind(this)
this.onMouseup = this.onMouseup.bind(this)
this.checkOverlapNode = throttle(this.checkOverlapNode, 300, this)
this.mindMap.on('node_mousedown', this.onNodeMousedown)
this.mindMap.on('mousemove', this.onMousemove)
this.mindMap.on('node_mouseup', this.onMouseup)
this.mindMap.on('mouseup', this.onMouseup)
}
// 解绑事件
unBindEvent() {
this.mindMap.off('node_mousedown', this.onNodeMousedown)
this.mindMap.off('mousemove', this.onMousemove)
this.mindMap.off('node_mouseup', this.onMouseup)
this.mindMap.off('mouseup', this.onMouseup)
}
// 节点鼠标按下事件
onNodeMousedown(node, e) {
// 只读模式、不是鼠标左键按下、按下的是概要节点或根节点直接返回
if (
this.mindMap.opt.readonly ||
e.which !== 1 ||
node.isGeneralization ||
node.isRoot
) {
return
}
e.preventDefault()
this.isMousedown = true
// 记录鼠标按下时的节点
this.mousedownNode = node
// 记录鼠标按下的坐标
const { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseDownX = x
this.mouseDownY = y
}
// 鼠标移动事件
onMousemove(e) {
if (this.mindMap.opt.readonly || !this.isMousedown) {
return
}
e.preventDefault()
const { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseMoveX = x
this.mouseMoveY = y
// 还没开始移动时鼠标位移过小不认为是拖拽
if (
!this.isDragging &&
Math.abs(x - this.mouseDownX) <= this.checkDragOffset &&
Math.abs(y - this.mouseDownY) <= this.checkDragOffset
) {
return
}
this.mindMap.emit('node_dragging', this.mousedownNode)
this.handleStartMove()
this.onMove(x, y, e)
}
// 鼠标松开事件
onMouseup(e) {
if (!this.isMousedown) {
@ -685,6 +702,16 @@ class Drag extends Base {
return item.uid === node.uid || item.isAncestor(node)
})
}
// 插件被移除前做的事情
beforePluginRemove() {
this.unBindEvent()
}
// 插件被卸载前做的事情
beforePluginDestroy() {
this.unBindEvent()
}
}
Drag.instanceName = 'drag'

View File

@ -9,7 +9,7 @@ import {
import { SVG } from '@svgdotjs/svg.js'
import drawBackgroundImageToCanvas from '../utils/simulateCSSBackgroundInCanvas'
import { transformToMarkdown } from '../parse/toMarkdown'
import { a4Size } from '../constants/constant'
import { ERROR_TYPES } from '../constants/constant'
// 导出插件
class Export {
@ -47,7 +47,8 @@ class Export {
// 获取svg数据
async getSvgData() {
let { exportPaddingX, exportPaddingY } = this.mindMap.opt
let { exportPaddingX, exportPaddingY, errorHandler, resetCss } =
this.mindMap.opt
let { svg, svgHTML } = this.mindMap.getSvgData({
paddingX: exportPaddingX,
paddingY: exportPaddingY
@ -66,15 +67,17 @@ class Export {
return item.attr('src')
})
const taskList = [...task1, ...task2]
await Promise.all(taskList)
try {
await Promise.all(taskList)
} catch (error) {
errorHandler(ERROR_TYPES.EXPORT_LOAD_IMAGE_ERROR, error)
}
// 开启了节点富文本编辑,需要增加一些样式
let isAddResetCss
if (this.mindMap.richText) {
const foreignObjectList = svg.find('foreignObject')
if (foreignObjectList.length > 0) {
foreignObjectList[0].add(
SVG(`<style>${this.mindMap.opt.resetCss}</style>`)
)
foreignObjectList[0].add(SVG(`<style>${resetCss}</style>`))
isAddResetCss = true
}
}
@ -89,14 +92,7 @@ class Export {
}
// svg转png
svgToPng(
svgSrc,
transparent,
checkRotate = () => {
return false
},
compress
) {
svgToPng(svgSrc, transparent) {
return new Promise((resolve, reject) => {
const img = new Image()
// 跨域图片需要添加这个属性,否则画布被污染了无法导出图片
@ -110,36 +106,27 @@ class Export {
)
let imgWidth = img.width
let imgHeight = img.height
// 压缩图片
if (compress) {
const compressedSize = resizeImgSize(
imgWidth,
imgHeight,
compress.width,
compress.height
)
imgWidth = compressedSize[0]
imgHeight = compressedSize[1]
}
// 如果宽比高长那么旋转90度
const needRotate = checkRotate(imgWidth, imgHeight)
if (needRotate) {
canvas.width = imgHeight * dpr
canvas.height = imgWidth * dpr
canvas.style.width = imgHeight + 'px'
canvas.style.height = imgWidth + 'px'
} else {
canvas.width = imgWidth * dpr
canvas.height = imgHeight * dpr
canvas.style.width = imgWidth + 'px'
canvas.style.height = imgHeight + 'px'
// 检查是否超出canvas支持的像素上限
const maxSize = 16384 / dpr
const maxArea = maxSize * maxSize
if (imgWidth * imgHeight > maxArea) {
let newWidth = null
let newHeight = null
if (imgWidth > maxSize) {
newWidth = maxArea / imgHeight
} else if (imgHeight > maxSize) {
newHeight = maxArea / imgWidth
}
const res = resizeImgSize(imgWidth, imgHeight, newWidth, newHeight)
imgWidth = res[0]
imgHeight = res[1]
}
canvas.width = imgWidth * dpr
canvas.height = imgHeight * dpr
canvas.style.width = imgWidth + 'px'
canvas.style.height = imgHeight + 'px'
const ctx = canvas.getContext('2d')
ctx.scale(dpr, dpr)
if (needRotate) {
ctx.rotate(0.5 * Math.PI)
ctx.translate(0, -imgHeight)
}
// 绘制背景
if (!transparent) {
await this.drawBackgroundToCanvas(ctx, imgWidth, imgHeight)
@ -229,31 +216,20 @@ class Export {
* 方法1.把svg的图片都转化成data:url格式再转换
* 方法2.把svg的图片提取出来再挨个绘制到canvas里最后一起转换
*/
async png(name, transparent = false, checkRotate, compress) {
async png(name, transparent = false) {
const { str } = await this.getSvgData()
const svgUrl = await this.fixSvgStrAndToBlob(str)
// 绘制到canvas上
const res = await this.svgToPng(svgUrl, transparent, checkRotate, compress)
const res = await this.svgToPng(svgUrl, transparent)
return res
}
// 导出为pdf
async pdf(name, useMultiPageExport, maxImageWidth) {
async pdf(name, transparent = false) {
if (!this.mindMap.doExportPDF) {
throw new Error('请注册ExportPDF插件')
}
const img = await this.png(
'',
false,
(width, height) => {
if (width <= a4Size.width && height && a4Size.height) return false
return width / height > 1
},
{
width: maxImageWidth || a4Size.width * 2
}
)
await this.mindMap.doExportPDF.pdf(name, img, useMultiPageExport)
const img = await this.png(name, transparent)
await this.mindMap.doExportPDF.pdf(name, img)
}
// 导出为xmind

View File

@ -1,5 +1,4 @@
import JsPDF from '../utils/jspdf'
import { a4Size } from '../constants/constant'
// 导出PDF插件需要通过Export插件使用
class ExportPDF {
@ -9,46 +8,20 @@ class ExportPDF {
}
// 导出为pdf
async pdf(name, img, useMultiPageExport = false) {
if (useMultiPageExport) {
await this.multiPageExport(name, img)
} else {
await this.onePageExport(name, img)
}
}
// 单页导出
onePageExport(name, img) {
async pdf(name, img) {
return new Promise((resolve, reject) => {
let pdf = new JsPDF('', 'pt', 'a4')
let a4Ratio = a4Size.width / a4Size.height
let image = new Image()
const image = new Image()
image.onload = () => {
let imageWidth = image.width
let imageHeight = image.height
let imageRatio = imageWidth / imageHeight
let w, h
if (imageWidth <= a4Size.width && imageHeight <= a4Size.height) {
// 使用图片原始宽高
w = imageWidth
h = imageHeight
} else if (a4Ratio > imageRatio) {
// 以a4Height为高度缩放图片宽度
w = imageRatio * a4Size.height
h = a4Size.height
} else {
// 以a4Width为宽度缩放图片高度
w = a4Size.width
h = a4Size.width / imageRatio
}
pdf.addImage(
img,
'PNG',
(a4Size.width - w) / 2,
(a4Size.height - h) / 2,
w,
h
)
const imageWidth = image.width
const imageHeight = image.height
const pdf = new JsPDF({
unit: 'px',
format: [imageWidth, imageHeight],
compress: true,
hotfixes: ['px_scaling'],
orientation: imageWidth > imageHeight ? 'landscape' : 'portrait'
})
pdf.addImage(img, 'PNG', 0, 0, imageWidth, imageHeight)
pdf.save(name)
resolve()
}
@ -58,56 +31,6 @@ class ExportPDF {
image.src = img
})
}
// 多页导出
multiPageExport(name, img) {
return new Promise((resolve, reject) => {
let image = new Image()
image.onload = () => {
let imageWidth = image.width
let imageHeight = image.height
// 一页pdf显示高度
let pageHeight = (imageWidth / a4Size.width) * a4Size.height
// 未生成pdf的高度
let leftHeight = imageHeight
// 偏移
let position = 0
// a4纸的尺寸[595.28,841.89]图片在pdf中图片的宽高
let imgWidth = a4Size.width
let imgHeight = (a4Size.width / imageWidth) * imageHeight
let pdf = new JsPDF('', 'pt', 'a4')
// 有两个高度需要区分一个是图片的实际高度和生成pdf的页面高度(841.89)
// 当内容未超过pdf一页显示的范围无需分页
if (leftHeight < pageHeight) {
pdf.addImage(
img,
'PNG',
(a4Size.width - imgWidth) / 2,
(a4Size.height - imgHeight) / 2,
imgWidth,
imgHeight
)
} else {
// 分页
while (leftHeight > 0) {
pdf.addImage(img, 'PNG', 0, position, imgWidth, imgHeight)
leftHeight -= pageHeight
position -= a4Size.height
// 避免添加空白页
if (leftHeight > 0) {
pdf.addPage()
}
}
}
pdf.save(name)
resolve()
}
image.onerror = (e) => {
reject(e)
}
image.src = img
})
}
}
ExportPDF.instanceName = 'doExportPDF'

View File

@ -37,7 +37,7 @@ class Formula {
// 给指定的节点插入指定公式
insertFormulaToNode(node, formula) {
let richTextPlugin = this.mindMap.richText
richTextPlugin.showEditText(node)
richTextPlugin.showEditText({ node })
richTextPlugin.quill.insertEmbed(
richTextPlugin.quill.getLength() - 1,
'formula',

View File

@ -7,19 +7,61 @@ class KeyboardNavigation {
constructor(opt) {
this.opt = opt
this.mindMap = opt.mindMap
this.onKeyup = this.onKeyup.bind(this)
this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.LEFT, () => {
this.onKeyup(CONSTANTS.KEY_DIR.LEFT)
})
this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.UP, () => {
this.onKeyup(CONSTANTS.KEY_DIR.UP)
})
this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.RIGHT, () => {
this.onKeyup(CONSTANTS.KEY_DIR.RIGHT)
})
this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.DOWN, () => {
this.onKeyup(CONSTANTS.KEY_DIR.DOWN)
})
this.addShortcut()
}
addShortcut() {
this.onLeftKeyUp = this.onLeftKeyUp.bind(this)
this.onUpKeyUp = this.onUpKeyUp.bind(this)
this.onRightKeyUp = this.onRightKeyUp.bind(this)
this.onDownKeyUp = this.onDownKeyUp.bind(this)
this.mindMap.keyCommand.addShortcut(
CONSTANTS.KEY_DIR.LEFT,
this.onLeftKeyUp
)
this.mindMap.keyCommand.addShortcut(CONSTANTS.KEY_DIR.UP, this.onUpKeyUp)
this.mindMap.keyCommand.addShortcut(
CONSTANTS.KEY_DIR.RIGHT,
this.onRightKeyUp
)
this.mindMap.keyCommand.addShortcut(
CONSTANTS.KEY_DIR.DOWN,
this.onDownKeyUp
)
}
removeShortcut() {
this.mindMap.keyCommand.removeShortcut(
CONSTANTS.KEY_DIR.LEFT,
this.onLeftKeyUp
)
this.mindMap.keyCommand.removeShortcut(CONSTANTS.KEY_DIR.UP, this.onUpKeyUp)
this.mindMap.keyCommand.removeShortcut(
CONSTANTS.KEY_DIR.RIGHT,
this.onRightKeyUp
)
this.mindMap.keyCommand.removeShortcut(
CONSTANTS.KEY_DIR.DOWN,
this.onDownKeyUp
)
}
onLeftKeyUp() {
this.onKeyup(CONSTANTS.KEY_DIR.LEFT)
}
onUpKeyUp() {
this.onKeyup(CONSTANTS.KEY_DIR.UP)
}
onRightKeyUp() {
this.onKeyup(CONSTANTS.KEY_DIR.RIGHT)
}
onDownKeyUp() {
this.onKeyup(CONSTANTS.KEY_DIR.DOWN)
}
// 处理按键事件
@ -228,6 +270,16 @@ class KeyboardNavigation {
y: (top + bottom) / 2
}
}
// 插件被移除前做的事情
beforePluginRemove() {
this.removeShortcut()
}
// 插件被卸载前做的事情
beforePluginDestroy() {
this.removeShortcut()
}
}
KeyboardNavigation.instanceName = 'keyboardNavigation'

View File

@ -96,8 +96,13 @@ class RichText {
border: none;
}
.smm-richtext-node-wrap {
word-break: break-all;
}
.smm-richtext-node-wrap p {
font-family: auto;
}
.smm-richtext-node-edit-wrap p {
@ -238,17 +243,24 @@ class RichText {
this.textEditNode.style.borderRadius = (node.height || 50) + 'px'
}
}
if (!node.getData('richText')) {
// 还不是富文本的情况
let text = ''
if (!isUndef(node.getData('text'))) {
text = String(node.getData('text')).split(/\n/gim).join('<br>')
}
// 节点文本内容
const nodeText = node.getData('text')
// 是否是空文本
const isEmptyText = isUndef(nodeText)
// 是否是非空的非富文本
const noneEmptyNoneRichText = !node.getData('richText') && !isEmptyText
// 如果是空文本,那么设置为丢失样式状态,否则输入不会带上样式
if (isEmptyText) {
this.lostStyle = true
}
if (noneEmptyNoneRichText) {
// 还不是富文本
let text = String(nodeText).split(/\n/gim).join('<br>')
let html = `<p>${text}</p>`
this.textEditNode.innerHTML = this.cacheEditingText || html
} else {
this.textEditNode.innerHTML =
this.cacheEditingText || node.getData('text')
// 已经是富文本
this.textEditNode.innerHTML = this.cacheEditingText || nodeText
}
this.initQuillEditor()
document.querySelector('.ql-editor').style.minHeight = originHeight + 'px'
@ -258,7 +270,7 @@ class RichText {
this.focus(
isInserting || (selectTextOnEnterEditText && !isFromKeyDown) ? 0 : null
)
if (!node.getData('richText')) {
if (noneEmptyNoneRichText) {
// 如果是非富文本的情况,需要手动应用文本样式
this.setTextStyleIfNotRichText(node)
}
@ -364,6 +376,8 @@ class RichText {
rectInfo,
formatInfo
)
} else {
this.mindMap.emit('rich_text_selection_change', false, null, null)
}
})
this.quill.on('text-change', () => {

View File

@ -171,6 +171,10 @@ class Scrollbar {
const t = this.mindMap.draw.transform()
const drawRect = this.mindMap.draw.rbox()
const rootRect = this.mindMap.renderer.root.group.rbox()
const rootCenterOffset = this.mindMap.renderer.layout.getRootCenterOffset(
rootRect.width,
rootRect.height
)
if (type === CONSTANTS.SCROLL_BAR_DIR.VERTICAL) {
// 滚动条新位置
let oy = offset
@ -178,7 +182,7 @@ class Scrollbar {
if (oy <= 0) {
oy = 0
}
let max =
const max =
((100 - scrollbarData.vertical.height) / 100) *
this.scrollbarWrapSize.height
if (oy >= max) {
@ -193,7 +197,12 @@ class Scrollbar {
// 内边距
const paddingY = this.mindMap.height / 2
// 图形新位置
let chartTop = oyPx + yOffset - paddingY * t.scaleY + paddingY
const chartTop =
oyPx +
yOffset -
paddingY * t.scaleY +
paddingY -
rootCenterOffset.y * t.scaleY
this.mindMap.view.translateYTo(chartTop)
this.emitEvent({
horizontal: scrollbarData.horizontal,
@ -209,7 +218,7 @@ class Scrollbar {
if (ox <= 0) {
ox = 0
}
let max =
const max =
((100 - scrollbarData.horizontal.width) / 100) *
this.scrollbarWrapSize.width
if (ox >= max) {
@ -217,14 +226,19 @@ class Scrollbar {
}
// 转换成百分比
const oxPercentage = (ox / this.scrollbarWrapSize.width) * 100
// 转换成相对于图形度的距离
// 转换成相对于图形度的距离
const oxPx = (-oxPercentage / 100) * this.chartWidth
// 节点中心点到图形最左边的距离
const xOffset = rootRect.x - drawRect.x
// 内边距
const paddingX = this.mindMap.width / 2
// 图形新位置
let chartLeft = oxPx + xOffset - paddingX * t.scaleX + paddingX
const chartLeft =
oxPx +
xOffset -
paddingX * t.scaleX +
paddingX -
rootCenterOffset.x * t.scaleX
this.mindMap.view.translateXTo(chartLeft)
this.emitEvent({
vertical: scrollbarData.vertical,
@ -247,6 +261,11 @@ class Scrollbar {
this.updateMindMapView(type, offset)
}
// 插件被移除前做的事情
beforePluginRemove() {
this.unBindEvent()
}
// 插件被卸载前做的事情
beforePluginDestroy() {
this.unBindEvent()

View File

@ -22,10 +22,19 @@ class Search {
this.notResetSearchText = false
// 是否自动跳转下一个匹配节点
this.isJumpNext = false
this.bindEvent()
}
bindEvent() {
this.onDataChange = this.onDataChange.bind(this)
this.mindMap.on('data_change', this.onDataChange)
}
unBindEvent() {
this.mindMap.off('data_change', this.onDataChange)
}
// 节点数据改变了,需要重新搜索
onDataChange() {
if (this.isJumpNext) {
@ -177,6 +186,16 @@ class Search {
total: this.matchNodeList.length
})
}
// 插件被移除前做的事情
beforePluginRemove() {
this.unBindEvent()
}
// 插件被卸载前做的事情
beforePluginDestroy() {
this.unBindEvent()
}
}
Search.instanceName = 'search'

View File

@ -18,82 +18,99 @@ class Select {
// 绑定事件
bindEvent() {
this.checkInNodes = throttle(this.checkInNodes, 300, this)
this.mindMap.on('mousedown', e => {
if (this.mindMap.opt.readonly) {
return
}
let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt
if (
!e.ctrlKey &&
(useLeftKeySelectionRightKeyDrag ? e.which !== 1 : e.which !== 3)
) {
return
}
e.preventDefault()
this.isMousedown = true
this.cacheActiveList = [...this.mindMap.renderer.activeNodeList]
let { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseDownX = x
this.mouseDownY = y
this.createRect(x, y)
})
this.mindMap.on('mousemove', e => {
if (this.mindMap.opt.readonly) {
return
}
if (!this.isMousedown) {
return
}
let { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseMoveX = x
this.mouseMoveY = y
if (
Math.abs(x - this.mouseDownX) <= 10 &&
Math.abs(y - this.mouseDownY) <= 10
) {
return
}
this.clearAutoMoveTimer()
this.onMove(
e.clientX,
e.clientY,
() => {
this.isSelecting = true
// 绘制矩形
this.rect.plot([
[this.mouseDownX, this.mouseDownY],
[this.mouseMoveX, this.mouseDownY],
[this.mouseMoveX, this.mouseMoveY],
[this.mouseDownX, this.mouseMoveY]
])
this.checkInNodes()
},
(dir, step) => {
switch (dir) {
case 'left':
this.mouseDownX += step
break
case 'top':
this.mouseDownY += step
break
case 'right':
this.mouseDownX -= step
break
case 'bottom':
this.mouseDownY -= step
break
default:
break
}
}
)
})
this.onMousedown = this.onMousedown.bind(this)
this.onMousemove = this.onMousemove.bind(this)
this.onMouseup = this.onMouseup.bind(this)
this.checkInNodes = throttle(this.checkInNodes, 300, this)
this.mindMap.on('mousedown', this.onMousedown)
this.mindMap.on('mousemove', this.onMousemove)
this.mindMap.on('mouseup', this.onMouseup)
this.mindMap.on('node_mouseup', this.onMouseup)
}
// 解绑事件
unBindEvent() {
this.mindMap.off('mousedown', this.onMousedown)
this.mindMap.off('mousemove', this.onMousemove)
this.mindMap.off('mouseup', this.onMouseup)
this.mindMap.off('node_mouseup', this.onMouseup)
}
// 鼠标按下
onMousedown(e) {
if (this.mindMap.opt.readonly) {
return
}
let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt
if (
!e.ctrlKey &&
(useLeftKeySelectionRightKeyDrag ? e.which !== 1 : e.which !== 3)
) {
return
}
e.preventDefault()
this.isMousedown = true
this.cacheActiveList = [...this.mindMap.renderer.activeNodeList]
let { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseDownX = x
this.mouseDownY = y
this.createRect(x, y)
}
// 鼠标移动
onMousemove(e) {
if (this.mindMap.opt.readonly) {
return
}
if (!this.isMousedown) {
return
}
let { x, y } = this.mindMap.toPos(e.clientX, e.clientY)
this.mouseMoveX = x
this.mouseMoveY = y
if (
Math.abs(x - this.mouseDownX) <= 10 &&
Math.abs(y - this.mouseDownY) <= 10
) {
return
}
this.clearAutoMoveTimer()
this.onMove(
e.clientX,
e.clientY,
() => {
this.isSelecting = true
// 绘制矩形
this.rect.plot([
[this.mouseDownX, this.mouseDownY],
[this.mouseMoveX, this.mouseDownY],
[this.mouseMoveX, this.mouseMoveY],
[this.mouseDownX, this.mouseMoveY]
])
this.checkInNodes()
},
(dir, step) => {
switch (dir) {
case 'left':
this.mouseDownX += step
break
case 'top':
this.mouseDownY += step
break
case 'right':
this.mouseDownX -= step
break
case 'bottom':
this.mouseDownY -= step
break
default:
break
}
}
)
}
// 结束框选
onMouseup() {
if (this.mindMap.opt.readonly) {
@ -233,6 +250,16 @@ class Select {
hasSelectRange() {
return this.isSelecting
}
// 插件被移除前做的事情
beforePluginRemove() {
this.unBindEvent()
}
// 插件被卸载前做的事情
beforePluginDestroy() {
this.unBindEvent()
}
}
Select.instanceName = 'select'

View File

@ -12,6 +12,7 @@ class Watermark {
this.text = '' // 水印文字
this.textStyle = {} // 水印文字样式
this.watermarkDraw = null // 容器
this.isInExport = false // 是否是在导出过程中
this.maxLong = this.getMaxLong()
this.updateWatermark(this.mindMap.opt.watermarkConfig || {})
this.bindEvent()
@ -72,11 +73,18 @@ class Watermark {
this.textStyle = Object.assign(this.textStyle, textStyle || {})
}
// 清除水印
clear() {
if (this.watermarkDraw) this.watermarkDraw.clear()
}
// 绘制水印
// 非精确绘制,会绘制一些超出可视区域的水印
draw() {
// 清空之前的水印
if (this.watermarkDraw) this.watermarkDraw.clear()
this.clear()
// 如果是仅导出需要水印,那么非导出中不渲染
const { onlyExport } = this.mindMap.opt.watermarkConfig
if (onlyExport && !this.isInExport) return
// 如果没有水印数据,那么水印容器也删除掉
if (!this.hasWatermark()) {
this.removeContainer()

View File

@ -20,6 +20,8 @@ export default {
lineStyle: 'straight', // 针对logicalStructure、mindMap两种结构。曲线curve、直线straight、直连direct
// 曲线连接时,根节点和其他节点的连接线样式保持统一,默认根节点为 ( 型,其他节点为 { 型设为true后都为 { 型
rootLineKeepSameInCurve: true,
// 连线尾部是否显示标记,目前只支持箭头
showLineMarker: false,
// 概要连线的粗细
generalizationLineWidth: 1,
// 概要连线的颜色
@ -171,7 +173,8 @@ const nodeSizeIndependenceList = [
'backgroundRepeat',
'backgroundPosition',
'backgroundSize',
'rootLineKeepSameInCurve'
'rootLineKeepSameInCurve',
'showLineMarker'
]
export const checkIsNodeSizeIndependenceConfig = config => {
let keys = Object.keys(config)

View File

@ -7,16 +7,24 @@ export default class Lru {
}
add(key, value) {
const isExist = this.has(key)
// 如果该key之前不存在并且现在数量已经超出最大值则不再继续添加
if (!isExist && this.size >= this.max) {
return false
}
// 已经存在则可以更新,因为不影响数量
// 如果该key是否已经存在则先删除
this.delete(key)
// 添加
this.pool.set(key, value)
this.size++
// 如果数量超出最大值,则删除最早的
if (this.size > this.max) {
let keys = this.pool.keys()
let last = keys.next()
this.delete(last.value)
}
// 删除最早的没啥意义详见https://github.com/wanglin2/mind-map/issues/467
// if (this.size > this.max) {
// let keys = this.pool.keys()
// let last = keys.next()
// this.delete(last.value)
// }
return true
}
delete(key) {
@ -35,4 +43,9 @@ export default class Lru {
return this.pool.get(key)
}
}
clear() {
this.size = 0
this.pool = new Map()
}
}

View File

@ -1,195 +0,0 @@
export default MindMap;
declare class MindMap {
/**
*
* @param {defaultOpt} opt
*/
constructor(opt?: {
readonly: boolean;
layout: string;
fishboneDeg: number;
theme: string;
themeConfig: {};
scaleRatio: number;
mouseScaleCenterUseMousePosition: boolean;
maxTag: number;
expandBtnSize: number;
imgTextMargin: number;
textContentMargin: number;
selectTranslateStep: number;
selectTranslateLimit: number;
customNoteContentShow: any;
enableFreeDrag: boolean;
watermarkConfig: {
text: string;
lineSpacing: number;
textSpacing: number;
angle: number;
textStyle: {
color: string;
opacity: number;
fontSize: number;
};
};
textAutoWrapWidth: number;
customHandleMousewheel: any;
mousewheelAction: string;
mousewheelMoveStep: number;
mousewheelZoomActionReverse: boolean;
defaultInsertSecondLevelNodeText: string;
defaultInsertBelowSecondLevelNodeText: string;
expandBtnStyle: {
color: string;
fill: string;
fontSize: number;
strokeColor: string;
};
expandBtnIcon: {
open: string;
close: string;
};
expandBtnNumHandler: (num: any) => any;
isShowExpandNum: boolean;
enableShortcutOnlyWhenMouseInSvg: boolean;
initRootNodePosition: any;
exportPaddingX: number;
exportPaddingY: number;
nodeTextEditZIndex: number;
nodeNoteTooltipZIndex: number;
isEndNodeTextEditOnClickOuter: boolean;
maxHistoryCount: number;
alwaysShowExpandBtn: boolean;
iconList: any[];
maxNodeCacheCount: number;
defaultAssociativeLineText: string;
fitPadding: number;
enableCtrlKeyNodeSelection: boolean;
useLeftKeySelectionRightKeyDrag: boolean;
beforeTextEdit: any;
isUseCustomNodeContent: boolean;
customCreateNodeContent: any;
customInnerElsAppendTo: any;
nodeDragPlaceholderMaxSize: number;
enableAutoEnterTextEditWhenKeydown: boolean;
richTextEditFakeInPlace: boolean;
customHandleClipboardText: any;
disableMouseWheelZoom: boolean;
disableTouchZoom: boolean;
errorHandler: (code: any, error: any) => void;
resetCss: string;
enableDblclickBackToRootNode: boolean;
minExportImgCanvasScale: number;
hoverRectColor: string;
hoverRectPadding: number;
selectTextOnEnterEditText: boolean;
deleteNodeActive: boolean;
autoMoveWhenMouseInEdgeOnDrag: boolean;
fit: boolean;
dragMultiNodeRectConfig: {
width: number;
height: number;
fill: string;
};
dragPlaceholderRectFill: string;
dragOpacityConfig: {
cloneNodeOpacity: number;
beingDragNodeOpacity: number;
};
tagsColorMap: {};
cooperateStyle: {
avatarSize: number;
fontSize: number;
};
associativeLineIsAlwaysAboveNode: boolean;
defaultGeneralizationText: string;
handleIsSplitByWrapOnPasteCreateNewNode: any;
addHistoryTime: number;
isDisableDrag: boolean;
highlightNodeBoxStyle: {
stroke: string;
fill: string;
};
createNewNodeBehavior: string;
});
opt: any;
el: any;
cssEl: HTMLStyleElement;
event: Event;
keyCommand: KeyCommand;
command: Command;
renderer: Render;
view: View;
batchExecution: BatchExecution;
handleOpt(opt: any): any;
initContainer(): void;
associativeLineDraw: any;
svg: any;
draw: any;
lineDraw: any;
nodeDraw: any;
otherDraw: any;
clearDraw(): void;
addCss(): void;
removeCss(): void;
render(callback: any, source?: string): void;
reRender(callback: any, source?: string): void;
getElRectInfo(): void;
elRect: any;
width: any;
height: any;
resize(): void;
on(event: any, fn: any): void;
emit(event: any, ...args: any[]): void;
off(event: any, fn: any): void;
initCache(): void;
initTheme(): void;
themeConfig: any;
setTheme(theme: any, notRender?: boolean): void;
getTheme(): any;
setThemeConfig(config: any, notRender?: boolean): void;
getCustomThemeConfig(): any;
getThemeConfig(prop: any): any;
getConfig(prop: any): any;
updateConfig(opt?: {}): void;
getLayout(): any;
setLayout(layout: any, notRender?: boolean): void;
execCommand(...args: any[]): void;
setData(data: any): void;
setFullData(data: any): void;
getData(withConfig: any): any;
export(...args: any[]): Promise<any>;
toPos(x: any, y: any): {
x: number;
y: number;
};
setMode(mode: any): void;
getSvgData({ paddingX, paddingY, ignoreWatermark }?: {
paddingX?: number;
paddingY?: number;
ignoreWatermark?: boolean;
}): {
svg: any;
svgHTML: any;
rect: any;
origWidth: any;
origHeight: any;
scaleX: any;
scaleY: any;
};
addPlugin(plugin: any, opt: any): void;
removePlugin(plugin: any): void;
initPlugin(plugin: any): void;
destroy(): void;
}
declare namespace MindMap {
const pluginList: any[];
function usePlugin(plugin: any, opt?: {}): typeof MindMap;
function hasPlugin(plugin: any): number;
function defineTheme(name: any, config?: {}): Error;
}
import Event from "./src/core/event/Event";
import KeyCommand from "./src/core/command/KeyCommand";
import Command from "./src/core/command/Command";
import Render from "./src/core/render/Render";
import View from "./src/core/view/View";
import BatchExecution from "./src/utils/BatchExecution";

View File

@ -1,115 +0,0 @@
export const themeList: {
name: string;
value: string;
dark: boolean;
}[];
export namespace CONSTANTS {
const CHANGE_THEME: string;
const CHANGE_LAYOUT: string;
const SET_DATA: string;
const TRANSFORM_TO_NORMAL_NODE: string;
namespace MODE {
const READONLY: string;
const EDIT: string;
}
namespace LAYOUT {
const LOGICAL_STRUCTURE: string;
const MIND_MAP: string;
const ORGANIZATION_STRUCTURE: string;
const CATALOG_ORGANIZATION: string;
const TIMELINE: string;
const TIMELINE2: string;
const FISHBONE: string;
const VERTICAL_TIMELINE: string;
}
namespace DIR {
const UP: string;
const LEFT: string;
const DOWN: string;
const RIGHT: string;
}
namespace KEY_DIR {
const LEFT_1: string;
export { LEFT_1 as LEFT };
const UP_1: string;
export { UP_1 as UP };
const RIGHT_1: string;
export { RIGHT_1 as RIGHT };
const DOWN_1: string;
export { DOWN_1 as DOWN };
}
namespace SHAPE {
const RECTANGLE: string;
const DIAMOND: string;
const PARALLELOGRAM: string;
const ROUNDED_RECTANGLE: string;
const OCTAGONAL_RECTANGLE: string;
const OUTER_TRIANGULAR_RECTANGLE: string;
const INNER_TRIANGULAR_RECTANGLE: string;
const ELLIPSE: string;
const CIRCLE: string;
}
namespace MOUSE_WHEEL_ACTION {
const ZOOM: string;
const MOVE: string;
}
namespace INIT_ROOT_NODE_POSITION {
const LEFT_2: string;
export { LEFT_2 as LEFT };
export const TOP: string;
const RIGHT_2: string;
export { RIGHT_2 as RIGHT };
export const BOTTOM: string;
export const CENTER: string;
}
namespace LAYOUT_GROW_DIR {
const LEFT_3: string;
export { LEFT_3 as LEFT };
const TOP_1: string;
export { TOP_1 as TOP };
const RIGHT_3: string;
export { RIGHT_3 as RIGHT };
const BOTTOM_1: string;
export { BOTTOM_1 as BOTTOM };
}
namespace PASTE_TYPE {
const CLIP_BOARD: string;
const CANVAS: string;
}
namespace SCROLL_BAR_DIR {
const VERTICAL: string;
const HORIZONTAL: string;
}
namespace CREATE_NEW_NODE_BEHAVIOR {
const DEFAULT: string;
const NOT_ACTIVE: string;
const ACTIVE_ONLY: string;
}
}
export const initRootNodePositionMap: {
[x: string]: number;
};
export const layoutList: {
name: string;
value: string;
}[];
export const layoutValueList: string[];
export const nodeDataNoStylePropList: string[];
export namespace commonCaches {
const measureCustomNodeContentSizeEl: any;
const measureRichtextNodeTextSizeEl: any;
}
export namespace ERROR_TYPES {
const READ_CLIPBOARD_ERROR: string;
const PARSE_PASTE_DATA_ERROR: string;
const CUSTOM_HANDLE_CLIPBOARD_TEXT_ERROR: string;
const LOAD_CLIPBOARD_IMAGE_ERROR: string;
const BEFORE_TEXT_EDIT_ERROR: string;
const EXPORT_ERROR: string;
}
export namespace a4Size {
const width: number;
const height: number;
}
export const cssContent: "\n /* 鼠标hover和激活时渲染的矩形 */\n .smm-hover-node{\n display: none;\n opacity: 0.6;\n stroke-width: 1;\n }\n\n .smm-node:not(.smm-node-dragging):hover .smm-hover-node{\n display: block;\n }\n\n .smm-node.active .smm-hover-node{\n display: block;\n opacity: 1;\n stroke-width: 2;\n }\n";
export const selfCloseTagList: string[];

View File

@ -1,112 +0,0 @@
export namespace defaultOpt {
const readonly: boolean;
const layout: string;
const fishboneDeg: number;
const theme: string;
const themeConfig: {};
const scaleRatio: number;
const mouseScaleCenterUseMousePosition: boolean;
const maxTag: number;
const expandBtnSize: number;
const imgTextMargin: number;
const textContentMargin: number;
const selectTranslateStep: number;
const selectTranslateLimit: number;
const customNoteContentShow: any;
const enableFreeDrag: boolean;
namespace watermarkConfig {
const text: string;
const lineSpacing: number;
const textSpacing: number;
const angle: number;
namespace textStyle {
const color: string;
const opacity: number;
const fontSize: number;
}
}
const textAutoWrapWidth: number;
const customHandleMousewheel: any;
const mousewheelAction: string;
const mousewheelMoveStep: number;
const mousewheelZoomActionReverse: boolean;
const defaultInsertSecondLevelNodeText: string;
const defaultInsertBelowSecondLevelNodeText: string;
namespace expandBtnStyle {
const color_1: string;
export { color_1 as color };
export const fill: string;
const fontSize_1: number;
export { fontSize_1 as fontSize };
export const strokeColor: string;
}
namespace expandBtnIcon {
const open: string;
const close: string;
}
function expandBtnNumHandler(num: any): any;
const isShowExpandNum: boolean;
const enableShortcutOnlyWhenMouseInSvg: boolean;
const initRootNodePosition: any;
const exportPaddingX: number;
const exportPaddingY: number;
const nodeTextEditZIndex: number;
const nodeNoteTooltipZIndex: number;
const isEndNodeTextEditOnClickOuter: boolean;
const maxHistoryCount: number;
const alwaysShowExpandBtn: boolean;
const iconList: any[];
const maxNodeCacheCount: number;
const defaultAssociativeLineText: string;
const fitPadding: number;
const enableCtrlKeyNodeSelection: boolean;
const useLeftKeySelectionRightKeyDrag: boolean;
const beforeTextEdit: any;
const isUseCustomNodeContent: boolean;
const customCreateNodeContent: any;
const customInnerElsAppendTo: any;
const nodeDragPlaceholderMaxSize: number;
const enableAutoEnterTextEditWhenKeydown: boolean;
const richTextEditFakeInPlace: boolean;
const customHandleClipboardText: any;
const disableMouseWheelZoom: boolean;
const disableTouchZoom: boolean;
function errorHandler(code: any, error: any): void;
const resetCss: string;
const enableDblclickBackToRootNode: boolean;
const minExportImgCanvasScale: number;
const hoverRectColor: string;
const hoverRectPadding: number;
const selectTextOnEnterEditText: boolean;
const deleteNodeActive: boolean;
const autoMoveWhenMouseInEdgeOnDrag: boolean;
const fit: boolean;
namespace dragMultiNodeRectConfig {
export const width: number;
export const height: number;
const fill_1: string;
export { fill_1 as fill };
}
const dragPlaceholderRectFill: string;
namespace dragOpacityConfig {
const cloneNodeOpacity: number;
const beingDragNodeOpacity: number;
}
const tagsColorMap: {};
namespace cooperateStyle {
export const avatarSize: number;
const fontSize_2: number;
export { fontSize_2 as fontSize };
}
const associativeLineIsAlwaysAboveNode: boolean;
const defaultGeneralizationText: string;
const handleIsSplitByWrapOnPasteCreateNewNode: any;
const addHistoryTime: number;
const isDisableDrag: boolean;
namespace highlightNodeBoxStyle {
export const stroke: string;
const fill_2: string;
export { fill_2 as fill };
}
const createNewNodeBehavior: string;
}

View File

@ -1,19 +0,0 @@
export default Command;
declare class Command {
constructor(opt?: {});
opt: {};
mindMap: any;
commands: {};
history: any[];
activeHistoryIndex: number;
addHistory(): void;
clearHistory(): void;
registerShortcutKeys(): void;
exec(name: any, ...args: any[]): void;
add(name: any, fn: any): void;
remove(name: any, fn: any): void;
back(step?: number): any;
forward(step?: number): any;
getCopyData(): any;
removeDataUid(data: any): any;
}

View File

@ -1,28 +0,0 @@
export default class KeyCommand {
constructor(opt: any);
opt: any;
mindMap: any;
shortcutMap: {};
shortcutMapCache: {};
isPause: boolean;
isInSvg: boolean;
pause(): void;
recovery(): void;
save(): void;
restore(): void;
bindEvent(): void;
onKeydown(e: any): void;
unBindEvent(): void;
checkKey(e: any, key: any): boolean;
getOriginEventCodeArr(e: any): any[];
hasCombinationKey(e: any): any;
getKeyCodeArr(key: any): any[];
/**
* Enter
* Tab | Insert
* Shift + a
*/
addShortcut(key: any, fn: any): void;
removeShortcut(key: any, fn: any): void;
getShortcutFn(key: any): any[];
}

View File

@ -1,42 +0,0 @@
export const keyMap: {
Backspace: number;
Tab: number;
Enter: number;
Shift: number;
Control: number;
Alt: number;
CapsLock: number;
Esc: number;
Spacebar: number;
PageUp: number;
PageDown: number;
End: number;
Home: number;
Insert: number;
Left: number;
Up: number;
Right: number;
Down: number;
Del: number;
NumLock: number;
Cmd: number;
CmdFF: number;
F1: number;
F2: number;
F3: number;
F4: number;
F5: number;
F6: number;
F7: number;
F8: number;
F9: number;
F10: number;
F11: number;
F12: number;
'`': number;
'=': number;
'-': number;
'/': number;
'.': number;
};
export function isKey(e: any, key: any): boolean;

View File

@ -1,35 +0,0 @@
export default Event;
declare class Event {
constructor(opt?: {});
opt: {};
mindMap: any;
isLeftMousedown: boolean;
isRightMousedown: boolean;
isMiddleMousedown: boolean;
mousedownPos: {
x: number;
y: number;
};
mousemovePos: {
x: number;
y: number;
};
mousemoveOffset: {
x: number;
y: number;
};
bindFn(): void;
onBodyClick(e: any): void;
onDrawClick(e: any): void;
onMousedown(e: any): void;
onMousemove(e: any): void;
onMouseup(e: any): void;
onMousewheel(e: any): void;
onContextmenu(e: any): void;
onSvgMousedown(e: any): void;
onKeyup(e: any): void;
onMouseenter(e: any): void;
onMouseleave(e: any): void;
bind(): void;
unbind(): void;
}

View File

@ -1,109 +0,0 @@
export default Render;
declare class Render {
constructor(opt?: {});
opt: {};
mindMap: any;
themeConfig: any;
renderTree: any;
reRender: boolean;
isRendering: boolean;
hasWaitRendering: boolean;
waitRenderingParams: any[];
nodeCache: {};
lastNodeCache: {};
renderSource: string;
activeNodeList: any[];
root: any;
textEdit: TextEdit;
lastBeingCopyData: any;
beingCopyData: any;
beingPasteText: string;
beingPasteImgSize: number;
currentBeingPasteType: string;
highlightBoxNode: any;
lastActiveNode: any;
lastActiveNodeList: any[];
setLayout(): void;
layout: MindMap | CatalogOrganization | OrganizationStructure | Timeline | VerticalTimeline;
setData(data: any): void;
bindEvent(): void;
registerCommands(): void;
selectAll(): void;
back(step: any): void;
forward(step: any): void;
insertNode(openEdit?: boolean, appointNodes?: any[], appointData?: any, appointChildren?: any[]): void;
insertMultiNode(appointNodes: any, nodeList: any): void;
insertChildNode(openEdit?: boolean, appointNodes?: any[], appointData?: any, appointChildren?: any[]): void;
insertMultiChildNode(appointNodes: any, childList: any): void;
insertParentNode(openEdit: boolean, appointNodes: any, appointData: any): void;
upNode(): void;
downNode(): void;
insertAfter(node: any, exist: any): void;
insertBefore(node: any, exist: any): void;
moveNodeTo(node: any, toNode: any): void;
removeNode(appointNodes?: any[]): void;
removeCurrentNode(appointNodes?: any[]): void;
pasteNode(data: any): void;
cutNode(callback: any): void;
setNodeStyle(node: any, prop: any, value: any): void;
setNodeStyles(node: any, style: any): void;
setNodeActive(node: any, active: any): void;
clearActiveNode(): void;
setNodeExpand(node: any, expand: any): void;
expandAllNode(): void;
unexpandAllNode(): void;
expandToLevel(level: any): void;
setNodeData(node: any, data: any): void;
setNodeText(node: any, text: any, richText: any, resetRichText: any): void;
setNodeImage(node: any, data: any): void;
setNodeIcon(node: any, icons: any): void;
setNodeHyperlink(node: any, link: any, title?: string): void;
setNodeNote(node: any, note: any): void;
setNodeTag(node: any, tag: any): void;
insertFormula(formula: any, appointNodes?: any[]): void;
addGeneralization(data: any): void;
removeGeneralization(): void;
setNodeCustomPosition(node: any, left?: any, top?: any): void;
resetLayout(): void;
setNodeShape(node: any, shape: any): void;
goTargetNode(node: any, callback?: () => void): void;
registerShortcutKeys(): void;
toggleActiveExpand(): void;
emitNodeActiveEvent(node?: any, activeNodeList?: any[]): void;
clearActiveNodeListOnDrawClick(e: any, eventType: any): void;
startTextEdit(): void;
endTextEdit(): void;
render(callback: () => void, source: any): void;
clearActiveNodeList(): void;
addNodeToActiveList(node: any): void;
removeNodeFromActiveList(node: any): void;
findActiveNodeIndex(node: any): any;
backForward(type: any, step: any): void;
getNewNodeBehavior(openEdit?: boolean, handleMultiNodes?: boolean): {
focusNewNode: boolean;
inserting: boolean;
};
copy(): void;
cut(): void;
paste(): void;
onPaste(): Promise<void>;
insertTo(node: any, exist: any, dir?: string): void;
checkNodeLayerChange(node: any, toNode: any): void;
deleteNodeGeneralization(node: any): void;
getNextActiveNode(): any;
copyNode(): any;
toggleNodeExpand(node: any): void;
setNodeDataRender(node: any, data: any, notRender?: boolean): void;
moveNodeToCenter(node: any): void;
setRootNodeCenter(): void;
expandToNodeUid(uid: any, callback?: () => void): void;
findNodeByUid(uid: any): any;
highlightNode(node: any, range: any): void;
closeHighlightNode(): void;
}
import TextEdit from "./TextEdit";
import MindMap from "../../layouts/MindMap";
import CatalogOrganization from "../../layouts/CatalogOrganization";
import OrganizationStructure from "../../layouts/OrganizationStructure";
import Timeline from "../../layouts/Timeline";
import VerticalTimeline from "../../layouts/VerticalTimeline";

View File

@ -1,30 +0,0 @@
export default class TextEdit {
constructor(renderer: any);
renderer: any;
mindMap: any;
currentNode: any;
textEditNode: HTMLDivElement;
showTextEdit: boolean;
cacheEditingText: string;
bindEvent(): void;
show({ node, isInserting, isFromKeyDown, isFromScale }: {
node: any;
isInserting?: boolean;
isFromKeyDown?: boolean;
isFromScale?: boolean;
}): Promise<void>;
onScale(): void;
onKeydown(e: any): void;
unBindEvent(): void;
checkIsAutoEnterTextEditKey(e: any): boolean;
registerTmpShortcut(): void;
showEditTextBox({ node, rect, isInserting, isFromKeyDown, isFromScale }: {
node: any;
rect: any;
isInserting: any;
isFromKeyDown: any;
isFromScale: any;
}): void;
getEditText(): any;
hideEditTextBox(): any;
}

View File

@ -1,136 +0,0 @@
export default Node;
declare class Node {
constructor(opt?: {});
nodeData: any;
uid: any;
mindMap: any;
renderer: any;
draw: any;
nodeDraw: any;
lineDraw: any;
style: Style;
shapeInstance: Shape;
shapePadding: {
paddingX: number;
paddingY: number;
};
isRoot: any;
isGeneralization: any;
generalizationBelongNode: any;
layerIndex: any;
width: any;
height: any;
_left: any;
_top: any;
customLeft: any;
customTop: any;
isDrag: boolean;
parent: any;
children: any;
userList: any[];
group: any;
shapeNode: any;
hoverNode: any;
_customNodeContent: any;
_imgData: any;
_iconData: any;
_textData: any;
_hyperlinkData: any;
_tagData: any;
_noteData: any;
noteEl: any;
noteContentIsShow: boolean;
_expandBtn: any;
_lastExpandBtnType: any;
_showExpandBtn: boolean;
_openExpandNode: any;
_closeExpandNode: any;
_fillExpandNode: any;
_userListGroup: any;
_lines: any[];
_generalizationList: any[];
_unVisibleRectRegionNode: any;
_isMouseenter: boolean;
_rectInfo: {
imgContentWidth: number;
imgContentHeight: number;
textContentWidth: number;
textContentHeight: number;
};
_generalizationNodeWidth: number;
_generalizationNodeHeight: number;
textContentItemMargin: any;
blockContentMargin: any;
expandBtnSize: any;
isMultipleChoice: boolean;
needLayout: boolean;
isHide: boolean;
set left(arg: any);
get left(): any;
set top(arg: any);
get top(): any;
reset(): void;
handleData(data: any): any;
createNodeData(): void;
getSize(): boolean;
getNodeRect(): {
width: any;
height: any;
};
layout(): void;
bindGroupEvent(): void;
active(e: any): void;
update(): void;
getNodePosInClient(_left: any, _top: any): {
left: any;
top: any;
};
reRender(): boolean;
updateNodeActiveClass(): void;
updateNodeByActive(active: any): void;
render(callback?: () => void): void;
remove(): void;
destroy(): void;
hide(): void;
show(): void;
setOpacity(val: any): void;
hideChildren(): void;
showChildren(): void;
startDrag(): void;
endDrag(): void;
renderLine(deep?: boolean): void;
getShape(): any;
hasCustomPosition(): boolean;
ancestorHasCustomPosition(): boolean;
ancestorHasGeneralization(): boolean;
addChildren(node: any): void;
styleLine(line: any, node: any): void;
removeLine(): void;
isAncestor(node: any): boolean;
isParent(node: any): boolean;
isBrother(node: any): any;
getIndexInBrothers(): any;
getPaddingVale(): {
paddingX: any;
paddingY: any;
};
getStyle(prop: any, root: any): any;
getSelfStyle(prop: any): any;
getParentSelfStyle(prop: any): any;
getSelfInhertStyle(prop: any): any;
getBorderWidth(): any;
getData(key: any): any;
getPureData(removeActiveState?: boolean, removeId?: boolean): any;
hasCustomStyle(): boolean;
getRect(): any;
getRectInSvg(): {
left: any;
right: any;
top: any;
bottom: any;
width: number;
height: number;
};
}
import Style from "./Style";
import Shape from "./Shape";

View File

@ -1,23 +0,0 @@
export default class Shape {
constructor(node: any);
node: any;
getShapePadding(width: any, height: any, paddingX: any, paddingY: any): {
paddingX: number;
paddingY: number;
};
createShape(): any;
getNodeSize(): {
width: any;
height: any;
};
createRect(): any;
createDiamond(): any;
createParallelogram(): any;
createRoundedRectangle(): any;
createOctagonalRectangle(): any;
createOuterTriangularRectangle(): any;
createInnerTriangularRectangle(): any;
createEllipse(): any;
createCircle(): any;
}
export const shapeList: string[];

View File

@ -1,36 +0,0 @@
export default Style;
declare class Style {
static setBackgroundStyle(el: any, themeConfig: any): void;
static removeBackgroundStyle(el: any): void;
constructor(ctx: any);
ctx: any;
merge(prop: any, root: any): any;
getStyle(prop: any, root: any): any;
getSelfStyle(prop: any): any;
rect(node: any): void;
shape(node: any): void;
text(node: any): void;
createStyleText(): string;
getTextFontStyle(): {
italic: boolean;
bold: any;
fontSize: any;
fontFamily: any;
};
domText(node: any, fontSizeScale: number, isMultiLine: any): void;
tagText(node: any): void;
tagRect(node: any, text: any, color: any): void;
iconNode(node: any): void;
line(node: any, { width, color, dasharray }?: {
width: any;
color: any;
dasharray: any;
}): void;
generalizationLine(node: any): void;
iconBtn(node: any, node2: any, fillNode: any): void;
hasCustomStyle(): boolean;
hoverNode(node: any): void;
}
declare namespace Style {
const cacheStyle: any;
}

View File

@ -1,23 +0,0 @@
declare namespace _default {
export { setData };
export { setText };
export { setImage };
export { setIcon };
export { setHyperlink };
export { setNote };
export { setTag };
export { setShape };
export { setStyle };
export { setStyles };
}
export default _default;
declare function setData(data?: {}): void;
declare function setText(text: any, richText: any, resetRichText: any): void;
declare function setImage(imgData: any): void;
declare function setIcon(icons: any): void;
declare function setHyperlink(link: any, title: any): void;
declare function setNote(note: any): void;
declare function setTag(tag: any): void;
declare function setShape(shape: any): void;
declare function setStyle(prop: any, value: any): void;
declare function setStyles(style: any): void;

View File

@ -1,18 +0,0 @@
declare namespace _default {
export { createUserListNode };
export { updateUserListNode };
export { createTextAvatar };
export { createImageAvatar };
export { addUser };
export { removeUser };
}
export default _default;
declare function createUserListNode(): void;
declare class createUserListNode {
_userListGroup: any;
}
declare function updateUserListNode(): void;
declare function createTextAvatar(item: any): any;
declare function createImageAvatar(item: any): any;
declare function addUser(userInfo: any): void;
declare function removeUser(userInfo: any): void;

View File

@ -1,50 +0,0 @@
declare namespace _default {
export { createImgNode };
export { getImgShowSize };
export { createIconNode };
export { createRichTextNode };
export { createTextNode };
export { createHyperlinkNode };
export { createTagNode };
export { createNoteNode };
export { getNoteContentPosition };
export { measureCustomNodeContentSize };
export { isUseCustomNodeContent };
}
export default _default;
declare function createImgNode(): {
node: any;
width: any;
height: any;
};
declare function getImgShowSize(): any;
declare function createIconNode(): any;
declare function createRichTextNode(): {
node: any;
width: any;
height: any;
};
declare function createTextNode(): any;
declare function createHyperlinkNode(): {
node: any;
width: any;
height: any;
};
declare function createTagNode(): any[];
declare function createNoteNode(): {
node: any;
width: any;
height: any;
};
declare class createNoteNode {
noteEl: HTMLDivElement;
}
declare function getNoteContentPosition(): {
left: any;
top: any;
};
declare function measureCustomNodeContentSize(content: any): {
width: any;
height: any;
};
declare function isUseCustomNodeContent(): boolean;

View File

@ -1,34 +0,0 @@
declare namespace _default {
export { createExpandNodeContent };
export { updateExpandBtnNode };
export { updateExpandBtnPos };
export { renderExpandBtn };
export { removeExpandBtn };
export { showExpandBtn };
export { hideExpandBtn };
export { sumNode };
}
export default _default;
declare function createExpandNodeContent(): void;
declare class createExpandNodeContent {
_openExpandNode: any;
_closeExpandNode: any;
_fillExpandNode: any;
}
declare function updateExpandBtnNode(): void;
declare class updateExpandBtnNode {
_lastExpandBtnType: boolean;
}
declare function updateExpandBtnPos(): void;
declare function renderExpandBtn(): void;
declare class renderExpandBtn {
_expandBtn: any;
_showExpandBtn: boolean;
}
declare function removeExpandBtn(): void;
declare class removeExpandBtn {
_showExpandBtn: boolean;
}
declare function showExpandBtn(): void;
declare function hideExpandBtn(): void;
declare function sumNode(data?: any[]): any;

View File

@ -1,18 +0,0 @@
declare namespace _default {
export { renderExpandBtnPlaceholderRect };
export { clearExpandBtnPlaceholderRect };
export { updateExpandBtnPlaceholderRect };
}
export default _default;
declare function renderExpandBtnPlaceholderRect(): void;
declare class renderExpandBtnPlaceholderRect {
_unVisibleRectRegionNode: any;
}
declare function clearExpandBtnPlaceholderRect(): void;
declare class clearExpandBtnPlaceholderRect {
_unVisibleRectRegionNode: any;
}
declare function updateExpandBtnPlaceholderRect(): void;
declare class updateExpandBtnPlaceholderRect {
needRerenderExpandBtnPlaceholderRect: boolean;
}

View File

@ -1,38 +0,0 @@
declare namespace _default {
export { formatGetGeneralization };
export { checkHasGeneralization };
export { checkHasSelfGeneralization };
export { getGeneralizationNodeIndex };
export { createGeneralizationNode };
export { updateGeneralization };
export { updateGeneralizationData };
export { renderGeneralization };
export { removeGeneralization };
export { hideGeneralization };
export { showGeneralization };
export { setGeneralizationOpacity };
export { handleGeneralizationMouseenter };
export { handleGeneralizationMouseleave };
}
export default _default;
declare function formatGetGeneralization(): any[];
declare function checkHasGeneralization(): boolean;
declare function checkHasSelfGeneralization(): boolean;
declare function getGeneralizationNodeIndex(node: any): any;
declare function createGeneralizationNode(): void;
declare class createGeneralizationNode {
_generalizationNodeWidth: number;
_generalizationNodeHeight: number;
}
declare function updateGeneralization(): void;
declare function updateGeneralizationData(): void;
declare function renderGeneralization(): void;
declare function removeGeneralization(): void;
declare class removeGeneralization {
_generalizationList: any[];
}
declare function hideGeneralization(): void;
declare function showGeneralization(): void;
declare function setGeneralizationOpacity(val: any): void;
declare function handleGeneralizationMouseenter(): void;
declare function handleGeneralizationMouseleave(): void;

View File

@ -1,36 +0,0 @@
export default View;
declare class View {
constructor(opt?: {});
opt: {};
mindMap: any;
scale: number;
sx: number;
sy: number;
x: number;
y: number;
firstDrag: boolean;
bind(): void;
getTransformData(): {
transform: any;
state: {
scale: number;
x: number;
y: number;
sx: number;
sy: number;
};
};
setTransformData(viewData: any): void;
translateXY(x: any, y: any): void;
translateX(step: any): void;
translateXTo(x: any): void;
translateY(step: any): void;
translateYTo(y: any): void;
transform(): void;
reset(): void;
narrow(cx: any, cy: any, isTouchPad: any): void;
enlarge(cx: any, cy: any, isTouchPad: any): void;
scaleInCenter(scale: any, cx: any, cy: any): void;
setScale(scale: any, cx: any, cy: any): void;
fit(): void;
}

View File

@ -1,60 +0,0 @@
export default Base;
declare class Base {
constructor(renderer: any);
renderer: any;
mindMap: any;
draw: any;
lineDraw: any;
root: any;
lru: Lru;
doLayout(): void;
renderLine(): void;
renderExpandBtn(): void;
renderGeneralization(): void;
cacheNode(uid: any, node: any): void;
checkIsNeedResizeSources(): boolean;
checkIsLayerTypeChange(oldIndex: any, newIndex: any): boolean;
checkIsLayoutChangeRerenderExpandBtnPlaceholderRect(node: any): void;
createNode(data: any, parent: any, isRoot: any, layerIndex: any): any;
formatPosition(value: any, size: any, nodeSize: any): number;
setNodeCenter(node: any): void;
updateChildren(children: any, prop: any, offset: any): void;
updateChildrenPro(children: any, props: any): void;
getNodeAreaWidth(node: any, withGeneralization?: boolean): number;
quadraticCurvePath(x1: any, y1: any, x2: any, y2: any): string;
cubicBezierPath(x1: any, y1: any, x2: any, y2: any): string;
getMarginX(layerIndex: any): any;
getMarginY(layerIndex: any): any;
getNodeWidthWithGeneralization(node: any): number;
getNodeHeightWithGeneralization(node: any): number;
/**
* dirhv
* isLeft
*/
getNodeBoundaries(node: any, dir: any): {
left: any;
right: any;
top: any;
bottom: any;
generalizationLineMargin: any;
generalizationNodeMargin: any;
};
getChildrenBoundaries(node: any, dir: any, startIndex: number, endIndex: any): {
left: number;
right: number;
top: number;
bottom: number;
generalizationLineMargin: any;
generalizationNodeMargin: any;
};
getNodeGeneralizationRenderBoundaries(item: any, dir: any): {
left: any;
right: any;
top: any;
bottom: any;
generalizationLineMargin: any;
generalizationNodeMargin: any;
};
getNodeActChildrenLength(node: any): any;
}
import Lru from "../utils/Lru";

View File

@ -1,11 +0,0 @@
export default CatalogOrganization;
declare class CatalogOrganization extends Base {
constructor(opt?: {});
computedBaseValue(): void;
computedLeftTopValue(): void;
adjustLeftTopValue(): void;
updateBrothersLeft(node: any, addWidth: any): void;
updateBrothersTop(node: any, addHeight: any): void;
renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void;
}
import Base from "./Base";

View File

@ -1,15 +0,0 @@
export default Fishbone;
declare class Fishbone extends Base {
constructor(opt?: {});
indent: number;
childIndent: number;
computedBaseValue(): void;
computedLeftTopValue(): void;
adjustLeftTopValue(): void;
getNodeAreaHeight(node: any): number;
updateBrothersLeft(node: any): void;
updateBrothersTop(node: any, addHeight: any): void;
checkIsTop(node: any): boolean;
renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void;
}
import Base from "./Base";

View File

@ -1,13 +0,0 @@
export default LogicalStructure;
declare class LogicalStructure extends Base {
constructor(opt?: {});
computedBaseValue(): void;
computedTopValue(): void;
adjustTopValue(): void;
updateBrothers(node: any, addHeight: any): void;
renderLineStraight(node: any, lines: any, style: any): any[];
renderLineDirect(node: any, lines: any, style: any): any[];
renderLineCurve(node: any, lines: any, style: any): any[];
renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void;
}
import Base from "./Base";

View File

@ -1,13 +0,0 @@
export default MindMap;
declare class MindMap extends Base {
constructor(opt?: {});
computedBaseValue(): void;
computedTopValue(): void;
adjustTopValue(): void;
updateBrothers(node: any, leftAddHeight: any, rightAddHeight: any): void;
renderLineStraight(node: any, lines: any, style: any): any[];
renderLineDirect(node: any, lines: any, style: any): any[];
renderLineCurve(node: any, lines: any, style: any): any[];
renderExpandBtnRect(rect: any, expandBtnSize: any, width: any, height: any, node: any): void;
}
import Base from "./Base";

Some files were not shown because too many files have changed in this diff Show More