This commit is contained in:
街角小林 2024-01-26 14:37:59 +08:00
commit ed252f64ea
221 changed files with 3983 additions and 29617 deletions

View File

@ -2,12 +2,12 @@
[![npm-version](https://img.shields.io/npm/v/simple-mind-map)](https://www.npmjs.com/package/simple-mind-map)
![npm download](https://img.shields.io/npm/dm/simple-mind-map)
[![GitHub stars](https://img.shields.io/github/stars/wanglin2/mind-map)](https://github.com/wanglin2/mind-map/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/wanglin2/mind-map)](https://github.com/wanglin2/mind-map/issues)
[![GitHub forks](https://img.shields.io/github/forks/wanglin2/mind-map)](https://github.com/wanglin2/mind-map/network/members)
![license](https://img.shields.io/npm/l/express.svg)
[![GitHub stars](https://img.shields.io/github/stars/wanglin2/mind-map)](https://github.com/wanglin2/mind-map/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/wanglin2/mind-map)](https://github.com/wanglin2/mind-map/network/members)
> 一个简单&强大的Web思维导图
> 中文名:思绪思维导图。一个简单&强大的 Web 思维导图
本项目包含两部分:
@ -35,7 +35,7 @@ Github[releases](https://github.com/wanglin2/mind-map/releases)。
- [x] 节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要、数学公式
- [x] 节点支持拖拽(拖拽移动、自由调整)、多种节点形状,支持使用 DDM 完全自定义节点内容
- [x] 支持画布拖动、缩放
- [x] 支持鼠标按键拖动选择和Ctrl+左键两种多选节点方式
- [x] 支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式
- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`,支持从`json`、`xmind`、`markdown`导入
- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条
- [x] 提供丰富的配置,满足各种场景各种使用习惯
@ -49,7 +49,7 @@ npm i simple-mind-map
# 使用
提供一个宽高不为0的容器元素
提供一个宽高不为 0 的容器元素:
```html
<div id="mindMapContainer"></div>
@ -70,13 +70,13 @@ npm i simple-mind-map
import MindMap from "simple-mind-map";
const mindMap = new MindMap({
el: document.getElementById('mindMapContainer'),
el: document.getElementById("mindMapContainer"),
data: {
"data": {
"text": "根节点"
data: {
text: "根节点",
},
"children": []
}
children: [],
},
});
```
@ -88,6 +88,8 @@ const mindMap = new MindMap({
[MIT](./LICENSE)
保留`mind-map`版权声明的情况下可随意商用。
# 微信交流群
群聊人数较多,无法通过二维码入群,可以微信添加`wanglinguanfang`拉你入群。
@ -242,4 +244,32 @@ const mindMap = new MindMap({
<img src="./web/src/assets/avatar/继龙.jpg" style="width: 50px;height: 50px;" />
<span>继龙</span>
</span>
</p>
<span>
<img src="./web/src/assets/avatar/欣.jpg" style="width: 50px;height: 50px;" />
<span></span>
</span>
<span>
<img src="./web/src/assets/avatar/default.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/default.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/default.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>
</p>

File diff suppressed because one or more lines are too long

BIN
dist/fonts/KaTeX_AMS-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_AMS-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_AMS-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Caligraphic-Bold.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Caligraphic-Bold.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Caligraphic-Bold.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Caligraphic-Regular.ttf vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
dist/fonts/KaTeX_Fraktur-Bold.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Fraktur-Bold.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Fraktur-Bold.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Fraktur-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Fraktur-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Fraktur-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Bold.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Bold.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Bold.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-BoldItalic.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-BoldItalic.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-BoldItalic.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Italic.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Italic.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Italic.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Main-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Math-BoldItalic.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Math-BoldItalic.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Math-BoldItalic.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Math-Italic.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Math-Italic.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Math-Italic.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Bold.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Bold.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Bold.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Italic.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Italic.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Italic.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_SansSerif-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Script-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Script-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Script-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size1-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size1-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size1-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size2-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size2-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size2-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size3-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size3-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size4-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size4-Regular.woff vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Size4-Regular.woff2 vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Typewriter-Regular.ttf vendored Normal file

Binary file not shown.

BIN
dist/fonts/KaTeX_Typewriter-Regular.woff vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
dist/img/classic6.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
dist/img/classic7.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
dist/img/国发.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
dist/img/慕智打印-兰兰.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

BIN
dist/img/手绘风格.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 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: 347 KiB

2
dist/js/app.js vendored

File diff suppressed because one or more lines are too long

1
dist/js/chunk-02258ed0.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

1
dist/js/chunk-1c3bec15.js vendored Normal file

File diff suppressed because one or more lines are too long

83
dist/js/chunk-2c94741a.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

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

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

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

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-2d21e399"],{d53e:function(s,a,t){"use strict";t.r(a);var _=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("Formula 插件")]),a("blockquote",[a("p",[s._v("v0.7.2+")])]),a("blockquote",[a("p",[s._v("该插件仅在富文本模式下支持所以需要在注册了RichText插件的前提下使用")])]),a("p",[s._v("该插件用于支持给节点插入公式。")]),a("blockquote",[a("p",[s._v("注意:公式是通过"),a("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[s._v("KaTeX")]),s._v("库实现的,"),a("code",[s._v("KaTeX")]),s._v("提供了一些配置,插件默认的一个配置是:")])]),a("pre",{staticClass:"hljs"},[a("code",[s._v("{\n "),a("span",{staticClass:"hljs-attr"},[s._v("output")]),s._v(": "),a("span",{staticClass:"hljs-string"},[s._v("'mathml'")]),s._v("\n}\n")])]),a("blockquote",[a("p",[s._v("这在少数浏览器上公式可能无法成功渲染,如果你需要兼容这部分浏览器,你可以考虑把该配置改为"),a("code",[s._v("html")]),s._v(",详细文档可以参考:"),a("a",{attrs:{href:"https://katex.org/docs/options"}},[s._v("Options")]),s._v("。使用这个配置可能还需要再引入"),a("code",[s._v("KaTeX")]),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(" Formula "),a("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),a("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Formula.js'")]),s._v("\n\nMindMap.usePlugin(Formula)\n")])]),a("p",[s._v("注册完且实例化"),a("code",[s._v("MindMap")]),s._v("后可通过"),a("code",[s._v("mindMap.formula")]),s._v("获取到该实例。")]),a("h2",[s._v("使用")]),a("p",[s._v("注册了该插件后,可以使用命令"),a("code",[s._v("INSERT_FORMULA")]),s._v("来给节点插入指定公式:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.execCommand("),a("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),a("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(")\n")])]),a("p",[s._v("上述命令会给当前激活的节点插入"),a("code",[s._v("a^2")]),s._v("公式。")]),a("p",[s._v("如果要指定给某个或某些节点插入公式,可以传递第二个参数:")]),a("pre",{staticClass:"hljs"},[a("code",[s._v("mindMap.execCommand("),a("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),a("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(", [Node])\n")])]),a("p",[s._v("通过第二个参数传入指定的节点实例即可。")])])}],n={},l=n,e=t("2877"),i=Object(e["a"])(l,_,v,!1,null,null,null);a["default"]=i.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21e399"],{d53e:function(s,_,t){"use strict";t.r(_);var a=function(){var s=this;s._self._c;return s._m(0)},v=[function(){var s=this,_=s._self._c;return _("div",[_("h1",[s._v("Formula 插件")]),_("blockquote",[_("p",[s._v("v0.7.2+")])]),_("blockquote",[_("p",[s._v("该插件仅在富文本模式下支持所以需要在注册了RichText插件的前提下使用")])]),_("p",[s._v("该插件用于支持给节点插入公式。")]),_("blockquote",[_("p",[s._v("注意:公式是通过"),_("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[s._v("KaTeX")]),s._v("库实现的,"),_("code",[s._v("KaTeX")]),s._v("提供了一些配置,插件默认的一个配置是:")])]),_("pre",{staticClass:"hljs"},[_("code",[s._v("{\n "),_("span",{staticClass:"hljs-attr"},[s._v("output")]),s._v(": "),_("span",{staticClass:"hljs-string"},[s._v("'mathml'")]),s._v("\n}\n")])]),_("blockquote",[_("p",[s._v("这在少数浏览器上公式可能无法成功渲染,如果你需要兼容这部分浏览器,你可以考虑把该配置改为"),_("code",[s._v("html")]),s._v(",详细文档可以参考:"),_("a",{attrs:{href:"https://katex.org/docs/options"}},[s._v("Options")]),s._v("。使用这个配置可能还需要再引入"),_("code",[s._v("KaTeX")]),s._v("的样式文件,你可以自行测试。")])]),_("blockquote",[_("p",[s._v("v.0.9.3+版本内部会判断当前浏览器的Chrome内核版本是否低于100是的话会自动将"),_("code",[s._v("output")]),s._v("由"),_("code",[s._v("mathml")]),s._v("转为"),_("code",[s._v("html")]),s._v(",此时需要引入"),_("code",[s._v("KaTeX")]),s._v("的样式文件,库内部没有引入,所以需要你手动在项目中引入。如果你是通过"),_("code",[s._v("npm")]),s._v("方式引入"),_("code",[s._v("simple-mind-map")]),s._v(",那么你可以这么引入:")]),_("pre",{staticClass:"hljs"},[_("code",[_("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" "),_("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/node_modules/katex/dist/katex.min.css'")]),s._v("\n")])]),_("p",[s._v("如果你使用的是"),_("code",[s._v(".umd.js")]),s._v("、"),_("code",[s._v(".esm.js")]),s._v("之类的打包后的文件那么可以通过在线的CDN服务来引入比如"),_("code",[s._v("https://unpkg.com/browse/katex@0.16.9/dist/")]),s._v(",当然,最好是把"),_("code",[s._v("katex")]),s._v("的"),_("code",[s._v("css")]),s._v("文件,以及对应的"),_("code",[s._v("fonts")]),s._v("目录下的字体文件上传到你自己的服务器上。")])]),_("h2",[s._v("注册")]),_("pre",{staticClass:"hljs"},[_("code",[_("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" MindMap "),_("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),_("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map'")]),s._v("\n"),_("span",{staticClass:"hljs-keyword"},[s._v("import")]),s._v(" Formula "),_("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),_("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Formula.js'")]),s._v("\n\nMindMap.usePlugin(Formula)\n")])]),_("p",[s._v("注册完且实例化"),_("code",[s._v("MindMap")]),s._v("后可通过"),_("code",[s._v("mindMap.formula")]),s._v("获取到该实例。")]),_("h2",[s._v("使用")]),_("p",[s._v("注册了该插件后,可以使用命令"),_("code",[s._v("INSERT_FORMULA")]),s._v("来给节点插入指定公式:")]),_("pre",{staticClass:"hljs"},[_("code",[s._v("mindMap.execCommand("),_("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),_("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(")\n")])]),_("p",[s._v("上述命令会给当前激活的节点插入"),_("code",[s._v("a^2")]),s._v("公式。")]),_("p",[s._v("如果要指定给某个或某些节点插入公式,可以传递第二个参数:")]),_("pre",{staticClass:"hljs"},[_("code",[s._v("mindMap.execCommand("),_("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),_("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(", [Node])\n")])]),_("p",[s._v("通过第二个参数传入指定的节点实例即可。")]),_("h2",[s._v("方法")]),_("h3",[s._v("getKatexConfig()")]),_("p",[s._v("获取当前传递给"),_("code",[s._v("Katex")]),s._v("的配置。")])])}],e={},o=e,n=t("2877"),c=Object(n["a"])(o,a,v,!1,null,null,null);_["default"]=c.exports}}]);

View File

@ -1 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d229d67"],{dec3:function(s,t,e){"use strict";e.r(t);var a=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("Formula plugin")]),t("blockquote",[t("p",[s._v("v0.7.2+")])]),t("blockquote",[t("p",[s._v("This plugin is only supported in rich text mode, so it needs to be used after registering the RichText plugin")])]),t("p",[s._v("This plugin is used to support inserting formulas into nodes.")]),t("blockquote",[t("p",[s._v("注意:公式是通过"),t("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[s._v("KaTeX")]),s._v("库实现的,"),t("code",[s._v("KaTeX")]),s._v("提供了一些配置,插件默认的一个配置是:")])]),t("blockquote",[t("p",[s._v("Note: The formula is implemented through the "),t("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[s._v("KaTeX")]),s._v(" library, and 'KaTeX' provides some configurations. The default configuration for the plugin is:")])]),t("pre",{staticClass:"hljs"},[t("code",[s._v("{\n "),t("span",{staticClass:"hljs-attr"},[s._v("output")]),s._v(": "),t("span",{staticClass:"hljs-string"},[s._v("'mathml'")]),s._v("\n}\n")])]),t("blockquote",[t("p",[s._v("This formula may not render successfully on a few browsers. If you need to be compatible with these browsers, you can consider changing the configuration to 'HTML'. For detailed documentation, please refer to "),t("a",{attrs:{href:"https://katex.org/docs/options"}},[s._v("Options")]),s._v(". Using this configuration may require the introduction of a 'KaTeX' style file, which you can test on your own.")])]),t("h2",[s._v("Register")]),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(" Formula "),t("span",{staticClass:"hljs-keyword"},[s._v("from")]),s._v(" "),t("span",{staticClass:"hljs-string"},[s._v("'simple-mind-map/src/plugins/Formula.js'")]),s._v("\n\nMindMap.usePlugin(Formula)\n")])]),t("p",[s._v("After registration and instantiation of "),t("code",[s._v("MindMap")]),s._v(", the instance can be obtained through "),t("code",[s._v("mindMap.formula")]),s._v(".")]),t("h2",[s._v("Usage")]),t("p",[s._v("After registering the plugin, you can use the command 'INSERT_FORMULA' to insert the specified formula for the node:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),t("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(")\n")])]),t("p",[s._v("The above command will insert the 'a^2' formula into the currently active node.")]),t("p",[s._v("If you want to assign a formula to a node or nodes, you can pass the second parameter:")]),t("pre",{staticClass:"hljs"},[t("code",[s._v("mindMap.execCommand("),t("span",{staticClass:"hljs-string"},[s._v("'INSERT_FORMULA'")]),s._v(", "),t("span",{staticClass:"hljs-string"},[s._v("'a^2'")]),s._v(", [Node])\n")])]),t("p",[s._v("Pass in the specified node instance through the second parameter.")])])}],o={},i=o,r=e("2877"),l=Object(r["a"])(i,a,n,!1,null,null,null);t["default"]=l.exports}}]);
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d229d67"],{dec3:function(t,e,s){"use strict";s.r(e);var o=function(){var t=this;t._self._c;return t._m(0)},a=[function(){var t=this,e=t._self._c;return e("div",[e("h1",[t._v("Formula plugin")]),e("blockquote",[e("p",[t._v("v0.7.2+")])]),e("blockquote",[e("p",[t._v("This plugin is only supported in rich text mode, so it needs to be used after registering the RichText plugin")])]),e("p",[t._v("This plugin is used to support inserting formulas into nodes.")]),e("blockquote",[e("p",[t._v("注意:公式是通过"),e("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[t._v("KaTeX")]),t._v("库实现的,"),e("code",[t._v("KaTeX")]),t._v("提供了一些配置,插件默认的一个配置是:")])]),e("blockquote",[e("p",[t._v("Note: The formula is implemented through the "),e("a",{attrs:{href:"https://github.com/KaTeX/KaTeX"}},[t._v("KaTeX")]),t._v(" library, and 'KaTeX' provides some configurations. The default configuration for the plugin is:")])]),e("pre",{staticClass:"hljs"},[e("code",[t._v("{\n "),e("span",{staticClass:"hljs-attr"},[t._v("output")]),t._v(": "),e("span",{staticClass:"hljs-string"},[t._v("'mathml'")]),t._v("\n}\n")])]),e("blockquote",[e("p",[t._v("This formula may not render successfully on a few browsers. If you need to be compatible with these browsers, you can consider changing the configuration to 'HTML'. For detailed documentation, please refer to "),e("a",{attrs:{href:"https://katex.org/docs/options"}},[t._v("Options")]),t._v(". Using this configuration may require the introduction of a 'KaTeX' style file, which you can test on your own.")])]),e("blockquote",[e("p",[t._v("v0.9.3+will internally determine whether the current Chrome kernel version of the browser is lower than 100, If so, it will automatically convert 'output' from 'mathml' to 'html', At this point, the style file for 'KaTeX' needs to be imported, but it is not imported within the library, so you need to manually import it in the project. If you introduced 'simple-mind-map' through the 'npm' method, you can introduce it as follows:")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-keyword"},[t._v("import")]),t._v(" "),e("span",{staticClass:"hljs-string"},[t._v("'simple-mind-map/node_modules/katex/dist/katex.min.css'")]),t._v("\n")])]),e("p",[t._v("If you are using packaged files such as '.umd.js' or '.esm.js', you can import them through online CDN services, such as "),e("code",[t._v("https://unpkg.com/browse/katex@0.16.9/dist/")]),t._v(", Of course, it is best to upload the 'css' file of the 'katex' and the corresponding font files in the 'fonts' directory to your own server.")])]),e("h2",[t._v("Register")]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-keyword"},[t._v("import")]),t._v(" MindMap "),e("span",{staticClass:"hljs-keyword"},[t._v("from")]),t._v(" "),e("span",{staticClass:"hljs-string"},[t._v("'simple-mind-map'")]),t._v("\n"),e("span",{staticClass:"hljs-keyword"},[t._v("import")]),t._v(" Formula "),e("span",{staticClass:"hljs-keyword"},[t._v("from")]),t._v(" "),e("span",{staticClass:"hljs-string"},[t._v("'simple-mind-map/src/plugins/Formula.js'")]),t._v("\n\nMindMap.usePlugin(Formula)\n")])]),e("p",[t._v("After registration and instantiation of "),e("code",[t._v("MindMap")]),t._v(", the instance can be obtained through "),e("code",[t._v("mindMap.formula")]),t._v(".")]),e("h2",[t._v("Usage")]),e("p",[t._v("After registering the plugin, you can use the command 'INSERT_FORMULA' to insert the specified formula for the node:")]),e("pre",{staticClass:"hljs"},[e("code",[t._v("mindMap.execCommand("),e("span",{staticClass:"hljs-string"},[t._v("'INSERT_FORMULA'")]),t._v(", "),e("span",{staticClass:"hljs-string"},[t._v("'a^2'")]),t._v(")\n")])]),e("p",[t._v("The above command will insert the 'a^2' formula into the currently active node.")]),e("p",[t._v("If you want to assign a formula to a node or nodes, you can pass the second parameter:")]),e("pre",{staticClass:"hljs"},[e("code",[t._v("mindMap.execCommand("),e("span",{staticClass:"hljs-string"},[t._v("'INSERT_FORMULA'")]),t._v(", "),e("span",{staticClass:"hljs-string"},[t._v("'a^2'")]),t._v(", [Node])\n")])]),e("p",[t._v("Pass in the specified node instance through the second parameter.")]),e("h2",[t._v("Methods")]),e("h3",[t._v("getKatexConfig()")]),e("p",[t._v("Get the current configuration passed to "),e("code",[t._v("Katex")]),t._v(".")])])}],n={},i=n,r=s("2877"),l=Object(r["a"])(i,o,a,!1,null,null,null);e["default"]=l.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-792bedf8.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/js/chunk-9d289278.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

File diff suppressed because one or more lines are too long

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