You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
87 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d9fbc"],{"6a50":function(e,t,n){"use strict";n.r(t);var o=function(){var e=this;e._self._c;return e._m(0)},a=[function(){var e=this,t=e._self._c;return t("div",[t("h1",[e._v("Constructor")]),t("h2",[e._v("Basic use")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-tag"},[e._v("<"),t("span",{staticClass:"hljs-name"},[e._v("div")]),e._v(" "),t("span",{staticClass:"hljs-attr"},[e._v("id")]),e._v("="),t("span",{staticClass:"hljs-string"},[e._v('"mindMapContainer"')]),e._v(">")]),t("span",{staticClass:"hljs-tag"},[e._v("</"),t("span",{staticClass:"hljs-name"},[e._v("div")]),e._v(">")]),e._v("\n")])]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" MindMap "),t("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),t("span",{staticClass:"hljs-string"},[e._v('"simple-mind-map"')]),e._v(";\n\n"),t("span",{staticClass:"hljs-keyword"},[e._v("const")]),e._v(" mindMap = "),t("span",{staticClass:"hljs-keyword"},[e._v("new")]),e._v(" MindMap({\n "),t("span",{staticClass:"hljs-attr"},[e._v("el")]),e._v(": "),t("span",{staticClass:"hljs-built_in"},[e._v("document")]),e._v(".getElementById("),t("span",{staticClass:"hljs-string"},[e._v('"mindMapContainer"')]),e._v("),\n "),t("span",{staticClass:"hljs-attr"},[e._v("data")]),e._v(": {\n "),t("span",{staticClass:"hljs-string"},[e._v('"data"')]),e._v(": {\n "),t("span",{staticClass:"hljs-string"},[e._v('"text"')]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v('"Root Node"')]),e._v("\n },\n "),t("span",{staticClass:"hljs-string"},[e._v('"children"')]),e._v(": []\n }\n});\n")])]),t("h2",[e._v("Instantiation options")]),t("h3",[e._v("1.Base")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("el")]),t("td",[e._v("Element")]),t("td"),t("td",[e._v("Container element, must be a DOM element(When the position of container elements on the page has changed but the size has not changed, the 'getElRectInfo()' method must be called to update the relevant information inside the library; When the size also changes, the 'resize()' method must be called, otherwise it will cause some functional exceptions)")]),t("td",[e._v("Yes")])]),t("tr",[t("td",[e._v("data")]),t("td",[e._v("Object 、null")]),t("td"),t("td",[e._v("Mind map data, Please refer to the introduction of 【Data structure】 below. V0.9.9+supports passing empty objects or null, and the canvas will display blank space")]),t("td")]),t("tr",[t("td",[e._v("layout")]),t("td",[e._v("String")]),t("td",[e._v("logicalStructure")]),t("td",[e._v("Layout type, options: logicalStructure (logical structure diagram), mindMap (mind map), catalogOrganization (catalog organization diagram), organizationStructure (organization structure diagram)、timeline(v0.5.4+, timeline)、timeline2(v0.5.4+, up down alternating timeline)、fishbone(v0.5.4+, fishbone diagram)")]),t("td")]),t("tr",[t("td",[e._v("fishboneDeg(v0.5.4+)")]),t("td",[e._v("Number")]),t("td",[e._v("45")]),t("td",[e._v("Set the diagonal angle of the fishbone structure diagram")]),t("td")]),t("tr",[t("td",[e._v("theme")]),t("td",[e._v("String")]),t("td",[e._v("default")]),t("td",[e._v("Theme, options: default, classic, minions, pinkGrape, mint, gold, vitalityOrange, greenLeaf, dark2, skyGreen, classic2, classic3, classic4(v0.2.0+), classicGreen, classicBlue, blueSky, brainImpairedPink, dark, earthYellow, freshGreen, freshRed, romanticPurple, simpleBlack(v0.5.4+), courseGreen(v0.5.4+), coffee(v0.5.4+), redSpirit(v0.5.4+), blackHumour(v0.5.4+), lateNightOffice(v0.5.4+), blackGold(v0.5.4+)、、avocado(v.5.10-fix.2+)、autumn(v.5.10-fix.2+)、orangeJuice(v.5.10-fix.2+)")]),t("td")]),t("tr",[t("td",[e._v("themeConfig")]),t("td",[e._v("Object")]),t("td",[e._v("{}")]),t("td",[e._v("Theme configuration, will be merged with the selected theme, available fields refer to: "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js"}},[e._v("default.js")])]),t("td")]),t("tr",[t("td",[e._v("scaleRatio")]),t("td",[e._v("Number")]),t("td",[e._v("0.1")]),t("td",[e._v("The incremental scaling ratio")]),t("td")]),t("tr",[t("td",[e._v("maxTag")]),t("td",[e._v("Number")]),t("td",[e._v("5")]),t("td",[e._v("The maximum number of tags displayed in the node, any additional tags will be discarded")]),t("td")]),t("tr",[t("td",[e._v("imgTextMargin")]),t("td",[e._v("Number")]),t("td",[e._v("5")]),t("td",[e._v("The spacing between the image and text in the node")]),t("td")]),t("tr",[t("td",[e._v("textContentMargin")]),t("td",[e._v("Number")]),t("td",[e._v("2")]),t("td",[e._v("The spacing between various text information in the node, such as the spacing between the icon and text")]),t("td")]),t("tr",[t("td",[e._v("customNoteContentShow(v0.1.6+)")]),t("td",[e._v("Object")]),t("td",[e._v("null")]),t("td",[e._v("Custom node note content display, object type, structure: {show: (noteContent, left, top, node) => {// your display node note logic. node is a new parameter added in v0.8.1+ version, representing node instances }, hide: () => {// your hide node note logic }}")]),t("td")]),t("tr",[t("td",[e._v("readonly(v0.1.7+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Whether it is read-only mode")]),t("td")]),t("tr",[t("td",[e._v("textAutoWrapWidth(v0.3.4+)")]),t("td",[e._v("Number")]),t("td",[e._v("500")]),t("td",[e._v("Each line of text in the node will wrap automatically when it reaches the width")]),t("td")]),t("tr",[t("td",[e._v("customHandleMousewheel(v0.4.3+)")]),t("td",[e._v("Function")]),t("td",[e._v("null")]),t("td",[e._v("User-defined mouse wheel event processing can pass a function, and the callback parameter is the event object")]),t("td")]),t("tr",[t("td",[e._v("mousewheelAction(v0.4.3+)")]),t("td",[e._v("String")]),t("td",[e._v("zoom(v0.9.1+ default is move)")]),t("td",[e._v("The behavior of the mouse wheel, "),t("code",[e._v("zoom")]),e._v("(Zoom in and out)、"),t("code",[e._v("move")]),e._v("(Move up and down). If "),t("code",[e._v("customHandleMousewheel")]),e._v(" passes a custom function, this property will not take effect")]),t("td")]),t("tr",[t("td",[e._v("mousewheelMoveStep(v0.4.3+)")]),t("td",[e._v("Number")]),t("td",[e._v("100")]),t("td",[e._v("When the "),t("code",[e._v("mousewheelAction")]),e._v(" is set to "),t("code",[e._v("move")]),e._v(", you can use this attribute to control the step length of the view movement when the mouse scrolls. The unit is "),t("code",[e._v("px")])]),t("td")]),t("tr",[t("td",[e._v("mousewheelZoomActionReverse(v0.6.5+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false(v0.9.1+ default is true)")]),t("td",[e._v("When "),t("code",[e._v("mousewheelAction")]),e._v(" is set to "),t("code",[e._v("zoom")]),e._v(", Or when holding down the Ctrl key, the default scrolling forward is to zoom out, and scrolling backward is to zoom in. If this property is set to true, it will be reversed")]),t("td")]),t("tr",[t("td",[e._v("defaultInsertSecondLevelNodeText(v0.4.7+)")]),t("td",[e._v("String")]),t("td",[e._v("二级节点")]),t("td",[e._v("Text of the default inserted secondary node")]),t("td")]),t("tr",[t("td",[e._v("defaultInsertBelowSecondLevelNodeText(v0.4.7+)")]),t("td",[e._v("String")]),t("td",[e._v("分支主题")]),t("td",[e._v("Text for nodes below the second level inserted by default")]),t("td")]),t("tr",[t("td",[e._v("expandBtnStyle(v0.5.0+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ color: '#808080', fill: '#fff', fontSize: 13, strokeColor: '#333333' }")]),t("td",[e._v("Expand the color of the stow button, (The fontSize and strokeColor fields were added in version 0.7.0+to set the text style for displaying the number of nodes when folded)")]),t("td")]),t("tr",[t("td",[e._v("expandBtnIcon(v0.5.0+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ open: '', close: '' }")]),t("td",[e._v("Customize the icon of the expand/collapse button, and you can transfer the svg string of the icon")]),t("td")]),t("tr",[t("td",[e._v("expandBtnNumHandler(v0.7.0+)")]),t("td",[e._v("Function")]),t("td"),t("td",[e._v("Used to customize the content of displaying the number of nodes when folding, receiving a parameter that represents the instance of the folding node, and returning a number or string that represents the final displayed content. For example, when the number is greater than 99, 99 can be displayed+")]),t("td")]),t("tr",[t("td",[e._v("isShowExpandNum(v0.7.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Display the number of folded nodes when they are folded up")]),t("td")]),t("tr",[t("td",[e._v("enableShortcutOnlyWhenMouseInSvg(v0.5.1+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Only respond to shortcut key events when the mouse is inside the canvas")]),t("td")]),t("tr",[t("td",[e._v("enableNodeTransitionMove(v0.5.1+)(v0.6.7+ is remove this feature)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Whether to enable node animation transition")]),t("td")]),t("tr",[t("td",[e._v("nodeTransitionMoveDuration(v0.5.1+)(v0.6.7+ is remove this feature)")]),t("td",[e._v("Number")]),t("td",[e._v("300")]),t("td",[e._v("If node animation transition is enabled, the transition time can be set using this attribute, in milliseconds")]),t("td")]),t("tr",[t("td",[e._v("initRootNodePosition(v0.5.3+)")]),t("td",[e._v("Array")]),t("td",[e._v("null")]),t("td",[e._v("The position of the initial root node can be passed as an array, default is "),t("code",[e._v("['center', 'center']")]),e._v(", Represents the root node at the center of the canvas, In addition to "),t("code",[e._v("center")]),e._v(", keywords can also be set to "),t("code",[e._v("left")]),e._v(", "),t("code",[e._v("top")]),e._v(", "),t("code",[e._v("right")]),e._v(", and "),t("code",[e._v("bottom")]),e._v(", In addition to passing keywords, each item in the array can also pass a number representing a specific pixel, Can pass a percentage string, such as "),t("code",[e._v("['40%', '60%']")]),e._v(", Represents a horizontal position at "),t("code",[e._v("40%")]),e._v(" of the canvas width, and a vertical position at "),t("code",[e._v("60%")]),e._v(" of the canvas height")]),t("td")]),t("tr",[t("td",[e._v("nodeTextEditZIndex(v0.5.5+)")]),t("td",[e._v("Number")]),t("td",[e._v("3000")]),t("td"),t("td",[e._v("z-index of node text edit box elements")])]),t("tr",[t("td",[e._v("nodeNoteTooltipZIndex(v0.5.5+)")]),t("td",[e._v("Number")]),t("td",[e._v("3000")]),t("td",[e._v("z-index of floating layer elements in node comments")]),t("td")]),t("tr",[t("td",[e._v("isEndNodeTextEditOnClickOuter(v0.5.5+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Whether to end the editing status of node text when clicking on an area outside the canvas")]),t("td")]),t("tr",[t("td",[e._v("maxHistoryCount(v0.5.6+)")]),t("td",[e._v("Number")]),t("td",[e._v("1000(v0.9.2+ changed 500)")]),t("td"),t("td",[e._v("Maximum number of history records")])]),t("tr",[t("td",[e._v("alwaysShowExpandBtn(v0.5.8+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Whether to always display the expand and collapse buttons of nodes, which are only displayed when the mouse is moved up and activated by default")]),t("td")]),t("tr",[t("td",[e._v("iconList(v0.5.8+)")]),t("td",[e._v("Array")]),t("td",[e._v("[]")]),t("td",[e._v('The icons that can be inserted into the extension node, and each item in the array is an object. Please refer to the "Icon Configuration" table below for the detailed structure of the object')]),t("td")]),t("tr",[t("td",[e._v("maxNodeCacheCount(v0.5.10+)")]),t("td",[e._v("Number")]),t("td",[e._v("1000")]),t("td",[e._v("The maximum number of cached nodes. To optimize performance, an internal node cache pool is maintained to reuse nodes. This attribute allows you to specify the maximum number of caches in the pool")]),t("td")]),t("tr",[t("td",[e._v("fitPadding(v0.6.0+)")]),t("td",[e._v("Number")]),t("td",[e._v("50")]),t("td",[e._v("The padding of mind mapping when adapting to canvas size, Unit: px")]),t("td")]),t("tr",[t("td",[e._v("enableCtrlKeyNodeSelection(v0.6.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Whether to enable the function of holding down the Ctrl key to select multiple nodes")]),t("td")]),t("tr",[t("td",[e._v("useLeftKeySelectionRightKeyDrag(v0.6.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Setting to left click to select multiple nodes and right click to drag the canvas.")]),t("td")]),t("tr",[t("td",[e._v("beforeTextEdit(v0.6.0+)")]),t("td",[e._v("Function/null")]),t("td",[e._v("null")]),t("td",[e._v("The callback method before the node is about to enter editing. If the method returns a value other than true, the editing will be canceled. The function can return a value or a promise, and the callback parameter is the node instance")]),t("td")]),t("tr",[t("td",[e._v("isUseCustomNodeContent(v0.6.3+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Whether to customize node content")]),t("td")]),t("tr",[t("td",[e._v("customCreateNodeContent(v0.6.3+)")]),t("td",[e._v("Function/null")]),t("td",[e._v("null")]),t("td",[e._v("If "),t("code",[e._v("isUseCustomNodeContent")]),e._v(" is set to "),t("code",[e._v("true")]),e._v(", then this option needs to be used to pass in a method that receives the node instance "),t("code",[e._v("node")]),e._v(" as a parameter (if you want to obtain data for that node, you can use "),t("code",[e._v("node.nodeData.data")]),e._v("). You need to return the custom node content element, which is the DOM node. If a node does not require customization, you can return "),t("code",[e._v("null")])]),t("td")]),t("tr",[t("td",[e._v("mouseScaleCenterUseMousePosition(v0.6.4-fix.1+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Is the mouse zoom centered around the current position of the mouse, otherwise centered around the canvas")]),t("td")]),t("tr",[t("td",[e._v("customInnerElsAppendTo(v0.6.12+)")]),t("td",[e._v("null/HTMLElement")]),t("td",[e._v("null")]),t("td",[e._v("Specify the location where some internal elements (node text editing element, node note display element, associated line text editing element, node image adjustment button element) are added, and default to document.body")]),t("td")]),t("tr",[t("td",[e._v("enableCreateHiddenInput(v0.6.13+)(v0.6.14+ remove this feature)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Is it allowed to create a hidden input box that will be focused when the node is activated for pasting data and automatically entering the text editing state")]),t("td")]),t("tr",[t("td",[e._v("enableAutoEnterTextEditWhenKeydown(v0.6.13+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Does it automatically enter text editing mode when pressing the Chinese, English, or numeric buttons when there is an activation node?")]),t("td")]),t("tr",[t("td",[e._v("customHandleClipboardText(v0.6.14+)")]),t("td",[e._v("Function")]),t("td",[e._v("null")]),t("td",[e._v("Customize the processing of clipboard text. When pressing ctrl+v to paste, it will read the text and images from the user's clipboard. By default, it will only determine whether the text is regular text and node data in simple mind map format. If you want to process data from other mind maps, such as process, zhixi, etc., you can pass a function that takes the text from the current clipboard as a parameter and returns the processed data, which can be of two types: 1.If a pure text is returned, a child node will be directly created with that text; 2.Returns a node object in the following format: { simpleMindMap: true, data: { data: { text: '' }, children: [] } }, The representative is data in simple bind map format, and the node data is in the same format as the simple bind map node data. If your processing logic has asynchronous logic, you can also return a promise")]),t("td")]),t("tr",[t("td",[e._v("errorHandler(v0.6.15+)")]),t("td",[e._v("Function")]),t("td"),t("td",[e._v("Custom error handling functions currently only throw some asynchronous logic errors. Can pass a function that takes two parameters, the first being the wrong type and the second being the wrong object")]),t("td")]),t("tr",[t("td",[e._v("disableMouseWheelZoom(v0.6.15+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Prohibit mouse wheel scaling, you can still use the API for scaling")]),t("td")]),t("tr",[t("td",[e._v("enableDblclickReset(v0.6.17+)(v0.8.0+this attribute has been deleted)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true(v0.7.0+changed to false)")]),t("td",[e._v("Turn on the mouse and double-click to reset the position and zoom of the mind map")]),t("td")]),t("tr",[t("td",[e._v("enableDblclickBackToRootNode(v0.8.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Whether to return to the root node when double clicking with the mouse, that is, to center the display of the root node")]),t("td")]),t("tr",[t("td",[e._v("hoverRectColor(v0.7.0+)")]),t("td",[e._v("String")]),t("td",[e._v("rgb(94, 200, 248)")]),t("td",[e._v("The node mouse hover and the rectangular border color displayed when activated will add a transparency of 0.6 when hovering")]),t("td")]),t("tr",[t("td",[e._v("hoverRectPadding(v0.7.0+)")]),t("td",[e._v("Number")]),t("td",[e._v("2")]),t("td",[e._v("The distance between the node mouse hover and the displayed rectangular border when activated and the node content")]),t("td")]),t("tr",[t("td",[e._v("selectTextOnEnterEditText(v0.7.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Is the text selected by default when double-clicking a node to enter node text editing? By default, it will only be selected when creating a new node")]),t("td")]),t("tr",[t("td",[e._v("deleteNodeActive(v0.7.1+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Enable the function of automatically activating adjacent nodes or parent nodes after deleting nodes")]),t("td")]),t("tr",[t("td",[e._v("fit(v0.7.1-fix.2+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Is the first rendering scaled to fit the canvas size")]),t("td")]),t("tr",[t("td",[e._v("tagsColorMap(v0.7.2+)")]),t("td",[e._v("Object")]),t("td",[e._v("{}")]),t("td",[e._v("The color of a custom node label can be transferred to an object, where key is the label content to be assigned a color, and value is the color of the label content. If not transferred internally, a corresponding color will be generated based on the label content")]),t("td")]),t("tr",[t("td",[e._v("cooperateStyle(v0.7.3+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ avatarSize: 22, fontSize: 12 }")]),t("td",[e._v("The configuration of personnel avatar style during node collaboration editing, with field meanings as follows: avatar size, and if it is a text avatar, the size of the text")]),t("td")]),t("tr",[t("td",[e._v("onlyOneEnableActiveNodeOnCooperate(v0.9.8+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("During collaborative editing, the same node cannot be selected by multiple people at the same time")]),t("td")]),t("tr",[t("td",[e._v("defaultGeneralizationText(v0.8.0+)")]),t("td",[e._v("String")]),t("td",[e._v("概要")]),t("td",[e._v("Insert default text for summary")]),t("td")]),t("tr",[t("td",[e._v("handleIsSplitByWrapOnPasteCreateNewNode(v0.8.0+)")]),t("td",[e._v("Function / null")]),t("td",[e._v("null")]),t("td",[e._v("When creating a new node by pasting text, control whether to automatically split the nodes based on line breaks. If there is a line break, multiple nodes will be created based on the line break. Otherwise, only one node will be created, and a function can be passed to return promise. resolve represents splitting based on line breaks, and reject represents ignoring line breaks")]),t("td")]),t("tr",[t("td",[e._v("addHistoryTime(v0.8.0+)")]),t("td",[e._v("Number")]),t("td",[e._v("100")]),t("td",[e._v("Only one historical record can be added within the specified time to avoid adding unnecessary intermediate states. Unit: ms")]),t("td")]),t("tr",[t("td",[e._v("isDisableDrag(v0.8.1+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Is disable dragging the canvas")]),t("td")]),t("tr",[t("td",[e._v("highlightNodeBoxStyle(v0.9.0+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ stroke: 'rgb(94, 200, 248)', fill: 'transparent' }")]),t("td",[e._v("Highlight box style when the mouse moves into the summary to highlight the node it belongs to")]),t("td")]),t("tr",[t("td",[e._v("createNewNodeBehavior(v0.9.1+)")]),t("td",[e._v("String")]),t("td",[e._v("default")]),t("td",[e._v("Behavior when creating a new node. default(By default, newly created nodes will be activated and enter editing mode. If multiple new nodes are created simultaneously, they will only be activated and will not enter editing mode)、notActive(Do not activate newly created nodes)、activeOnly(Only activate newly created nodes and do not enter editing mode)")]),t("td")]),t("tr",[t("td",[e._v("defaultNodeImage(v0.9.1-fix.2+)")]),t("td",[e._v("String")]),t("td"),t("td",[e._v("Image address, the default image displayed when node image loading fails")]),t("td")]),t("tr",[t("td",[e._v("handleNodePasteImg(v0.9.2+)")]),t("td",[e._v("null or Function")]),t("td",[e._v("null")]),t("td",[e._v("The processing method for pasting images from the clipboard on a node is to convert them into data:URL data and insert them into the node by default. You can use this method to upload image data to the server and save the URL of the image. An asynchronous method can be passed to receive image data of Blob type, and the specified structure needs to be returned: { url, size: {width, height} }")]),t("td")]),t("tr",[t("td",[e._v("isLimitMindMapInCanvas(v0.9.2+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Whether to limit the mind map within the canvas. For example, when dragging to the right, the leftmost part of the mind map graphic will not be able to continue dragging to the right when it reaches the center of the canvas, and the same applies to other things")]),t("td")]),t("tr",[t("td",[e._v("beforeShortcutRun(v0.9.9+)")]),t("td",[e._v("Function、null")]),t("td",[e._v("null")]),t("td",[e._v("The lifecycle function before the shortcut operation is about to be executed, returning true can prevent the operation from executing. The function takes two parameters: key(Shortcut key)、activeNodeList(List of currently activated nodes)")]),t("td")]),t("tr",[t("td",[e._v("resetScaleOnMoveNodeToCenter(v0.9.12+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Whether to reset the scaling level to 100% when moving nodes to the canvas center, returning to the root node, and other operations(The underlying impact is on the moveNodeToCenter method of the render class)")]),t("td")]),t("tr",[t("td",[e._v("createNodePrefixContent(v0.9.12+)")]),t("td",[e._v("Function、null")]),t("td",[e._v("null")]),t("td",[e._v("Add additional node pre content.Pre content refers to the pre content in the area of the same line as the text, excluding the node image section.You can pass a function that takes the parameters of a node instance, Can return objects in {el, width, height} format, el is a DOM node object, width and height represent the width, height, and numerical type of the content. If custom content is not required, null can also be returned")]),t("td")]),t("tr",[t("td",[e._v("createNodePostfixContent(v0.9.12+)")]),t("td",[e._v("Function、null")]),t("td",[e._v("null")]),t("td",[e._v("Add additional node post content.Post content refers to the post content in the area of the same line as the text, excluding the node image section. The usage is the same as createNodePrefixContent")]),t("td")])])]),t("h3",[e._v("1.1Data structure")]),t("p",[e._v("The basic data structure is as follows:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("{\n "),t("span",{staticClass:"hljs-attr"},[e._v("data")]),e._v(": {\n "),t("span",{staticClass:"hljs-attr"},[e._v("text")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// The text of the node can be rich text, which is in HTML format. In this case, richText should be set to true")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("richText")]),e._v(": "),t("span",{staticClass:"hljs-literal"},[e._v("false")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// Is the text of the node in rich text mode")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("expand")]),e._v(": "),t("span",{staticClass:"hljs-literal"},[e._v("true")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// Whether the node is expanded")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("uid")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(","),t("span",{staticClass:"hljs-comment"},[e._v("// The unique ID of the node, which may not be passed, will be generated internally")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("icon")]),e._v(": [], "),t("span",{staticClass:"hljs-comment"},[e._v('// The format of the icon can be found in the "插入和扩展节点图标" section of the tutorial')]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("image")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// URL of the image")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("imageTitle")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// The title of the image can be blank")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("imageSize")]),e._v(": { "),t("span",{staticClass:"hljs-comment"},[e._v("// The size of the image")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("width")]),e._v(": "),t("span",{staticClass:"hljs-number"},[e._v("100")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// The width of the image, mandatory")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("height")]),e._v(": "),t("span",{staticClass:"hljs-number"},[e._v("100")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// The height of the image is mandatory")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("custom")]),e._v(": "),t("span",{staticClass:"hljs-literal"},[e._v("false")]),e._v(" "),t("span",{staticClass:"hljs-comment"},[e._v("// If set to true, the display size of the image is not controlled by the theme, and is based on imageSize.width and imageSize.height")]),e._v("\n },\n "),t("span",{staticClass:"hljs-attr"},[e._v("hyperlink")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// Hyperlink address")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("hyperlinkTitle")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// Title of hyperlink")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("note")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// Content of remarks")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("tag")]),e._v(": [], "),t("span",{staticClass:"hljs-comment"},[e._v("// Tag list")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("generalization")]),e._v(": [{"),t("span",{staticClass:"hljs-comment"},[e._v("// (Arrays are not supported in versions below 0.9.0, and only a single summary data can be set)The summary of the node, if there is no summary, the generalization can be set to null")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("text")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// Summary Text")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("richText")]),e._v(": "),t("span",{staticClass:"hljs-literal"},[e._v("false")]),e._v(", "),t("span",{staticClass:"hljs-comment"},[e._v("// Is the text of the node in rich text mode")]),e._v("\n "),t("span",{staticClass:"hljs-comment"},[e._v("// ...The fields of other ordinary nodes are supported, But it does not support children")]),e._v("\n }],\n "),t("span",{staticClass:"hljs-attr"},[e._v("associativeLineTargets")]),e._v(": ["),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v("],"),t("span",{staticClass:"hljs-comment"},[e._v("// If there are associated lines, then it is the uid list of the target node")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("associativeLineText")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("''")]),e._v(","),t("span",{staticClass:"hljs-comment"},[e._v("// Association Line Text")]),e._v("\n "),t("span",{staticClass:"hljs-comment"},[e._v("// ...For other style fields, please refer to the topic")]),e._v("\n },\n children ["),t("span",{staticClass:"hljs-comment"},[e._v("// Child nodes, with consistent structure and root nodes")]),e._v("\n {\n "),t("span",{staticClass:"hljs-attr"},[e._v("data")]),e._v(": {},\n "),t("span",{staticClass:"hljs-attr"},[e._v("children")]),e._v(": []\n }\n ]\n}\n")])]),t("p",[e._v("If you want to add custom fields, you can add them to the same level as 'data' and 'children'. If you want to add them to the 'data' object, please use the "),t("code",[e._v("_")]),e._v(" Name your custom field at the beginning, and it will be used internally to determine whether it is a custom field.")]),t("h3",[e._v("1.2Icon Configuration")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")])])]),t("tbody",[t("tr",[t("td",[e._v("name")]),t("td",[e._v("String")]),t("td"),t("td",[e._v("The name of the icon group")])]),t("tr",[t("td",[e._v("type")]),t("td",[e._v("String")]),t("td"),t("td",[e._v("Values for icon grouping")])]),t("tr",[t("td",[e._v("list")]),t("td",[e._v("Array")]),t("td"),t("td",[e._v("A list of icons under grouping, with each item in the array being an object, "),t("code",[e._v("{ name: '', icon: '' }")]),e._v(","),t("code",[e._v("name")]),e._v("represents the name of the icon, "),t("code",[e._v("icon")]),e._v("represents the icon, Can be an "),t("code",[e._v("svg")]),e._v(" icon, such as "),t("code",[e._v("<svg ...><path></path></svg>")]),e._v(", also can be a image "),t("code",[e._v("url")]),e._v(", or "),t("code",[e._v("base64")]),e._v(" icon, such as "),t("code",[e._v("data:image/png;base64,...")])])])])]),t("h3",[e._v("2.Export plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("exportPadding")]),t("td",[e._v("Number")]),t("td",[e._v("20")]),t("td",[e._v("The padding for exporting images")]),t("td")]),t("tr",[t("td",[e._v("exportPaddingX(v0.5.5+)")]),t("td",[e._v("Number")]),t("td",[e._v("10")]),t("td",[e._v("Horizontal padding of graphics when exporting PNG, SVG, and PDF")]),t("td")]),t("tr",[t("td",[e._v("exportPaddingY(v0.5.5+)")]),t("td",[e._v("Number")]),t("td",[e._v("10")]),t("td",[e._v("Vertical padding of graphics when exporting PNG, SVG, and PDF")]),t("td")]),t("tr",[t("td",[e._v("resetCss(v0.6.16+)")]),t("td",[e._v("String")]),t("td",[e._v("* { margin: 0; padding: 0; box-sizing: border-box; }")]),t("td",[e._v("When exporting images and SVGs, the default style overlay for rich text node content, which is embedded in HTML nodes in SVGs, will occur. If not overlaid, the node content will be offset")]),t("td")]),t("tr",[t("td",[e._v("minExportImgCanvasScale(v0.7.0+)")]),t("td",[e._v("Number")]),t("td",[e._v("2")]),t("td",[e._v("The scaling factor of canvas when exporting images and PDFs, which is set to the maximum value of window.devicePixelRatio to improve image clarity")]),t("td")]),t("tr",[t("td",[e._v("addContentToHeader(v0.9.9+)")]),t("td",[e._v("Function、null")]),t("td",[e._v("null")]),t("td",[e._v("Add custom content to the header when exporting PNG, SVG, and PDF. Can pass a function that can return null to indicate no content is added, or it can return an object, For a detailed introduction, please refer to section 【How to add custom content when exporting】 below")]),t("td")]),t("tr",[t("td",[e._v("addContentToFooter(v0.9.9+)")]),t("td",[e._v("Function、null")]),t("td",[e._v("null")]),t("td",[e._v("The basic definition is the same as addContentToHeader, adding custom content at the end")]),t("td")])])]),t("h4",[e._v("2.1How to add custom content when exporting")]),t("p",[e._v("The two instantiation options "),t("code",[e._v("addContentToHeader")]),e._v(" and "),t("code",[e._v("addContentToFooter")]),e._v(" can be used to add custom content at the beginning and end when exporting "),t("code",[e._v("png")]),e._v("、"),t("code",[e._v("svg")]),e._v("、"),t("code",[e._v("pdf")]),e._v(", The default value is "),t("code",[e._v("null")]),e._v(", which means no configuration. A function can be passed and can return "),t("code",[e._v("null")]),e._v(", which means no content will be added. If you want to add content, you need to return the following structure:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("{\n el,// Custom DOM node to be added, styles can be inline\n cssText,// Optional, if the style does not want to be inlined, you can pass this value as a CSS string\n height: 50// The height of the returned DOM node must be passed\n}\n")])]),t("p",[e._v("A simple example:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("new")]),e._v(" MindMap({\n "),t("span",{staticClass:"hljs-attr"},[e._v("addContentToFooter")]),e._v(": "),t("span",{staticClass:"hljs-function"},[e._v("() =>")]),e._v(" {\n "),t("span",{staticClass:"hljs-keyword"},[e._v("const")]),e._v(" el = "),t("span",{staticClass:"hljs-built_in"},[e._v("document")]),e._v(".createElement("),t("span",{staticClass:"hljs-string"},[e._v("'div'")]),e._v(")\n el.className = "),t("span",{staticClass:"hljs-string"},[e._v("'footer'")]),e._v("\n el.innerHTML = "),t("span",{staticClass:"hljs-string"},[e._v("'From: simple-mind-map'")]),e._v("\n "),t("span",{staticClass:"hljs-keyword"},[e._v("const")]),e._v(" cssText = "),t("span",{staticClass:"hljs-string"},[e._v("`\n .footer {\n width: 100%;\n height: 30px;\n }\n `")]),e._v("\n "),t("span",{staticClass:"hljs-keyword"},[e._v("return")]),e._v(" {\n el,\n cssText,\n "),t("span",{staticClass:"hljs-attr"},[e._v("height")]),e._v(": "),t("span",{staticClass:"hljs-number"},[e._v("30")]),e._v("\n }\n }\n})\n")])]),t("h3",[e._v("3.Select plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("selectTranslateStep")]),t("td",[e._v("Number")]),t("td",[e._v("3")]),t("td",[e._v("The canvas offset when mouse moves to the edge during multi-select node")]),t("td")]),t("tr",[t("td",[e._v("selectTranslateLimit")]),t("td",[e._v("Number")]),t("td",[e._v("20")]),t("td",[e._v("The distance from the edge when the canvas begins to offset during multi-select node")]),t("td")])])]),t("h3",[e._v("4.Drag plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("enableFreeDrag(v0.2.4+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Enable node free(Free drag means that nodes can be dragged to any position on the canvas. Please note that it is not a function of dragging nodes to become siblings of other nodes. The connection of free drag may have certain problems, so it is best not to use this feature) drag")]),t("td")]),t("tr",[t("td",[e._v("nodeDragPlaceholderMaxSize(v0.6.12+)(v0.10.0+ has been abolished)")]),t("td",[e._v("Number")]),t("td",[e._v("20")]),t("td",[e._v("When dragging an element, the maximum height of the block indicating the new position of the element")]),t("td")]),t("tr",[t("td",[e._v("autoMoveWhenMouseInEdgeOnDrag(v0.7.1+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Whether to enable automatic canvas movement when the mouse moves to the edge of the canvas while dragging nodes")]),t("td")]),t("tr",[t("td",[e._v("dragMultiNodeRectConfig(v0.7.2+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ width: 40, height: 20, fill: 'rgb(94, 200, 248)' }")]),t("td",[e._v("The style configuration of the schematic rectangle that moves with the mouse when dragging multiple nodes, passing an object, and the field meanings are the width, height, and fill color of the rectangle")]),t("td")]),t("tr",[t("td",[e._v("dragPlaceholderRectFill(v0.7.2+)")]),t("td",[e._v("String")]),t("td",[e._v("rgb(94, 200, 248)")]),t("td",[e._v("The filling color of the schematic rectangle for the new position when dragging nodes.")]),t("td")]),t("tr",[t("td",[e._v("dragPlaceholderLineConfig(v0.10.0+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ color: 'rgb(94, 200, 248)', width: 2 }")]),t("td",[e._v("Style configuration of schematic lines for new positions when dragging nodes")]),t("td")]),t("tr",[t("td",[e._v("dragOpacityConfig(v0.7.2+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ cloneNodeOpacity: 0.5, beingDragNodeOpacity: 0.3 }")]),t("td",[e._v("The transparency configuration during node dragging, passing an object, and the field meanings are: the transparency of the cloned node or rectangle that follows the mouse movement, and the transparency of the dragged node")]),t("td")])])]),t("h3",[e._v("5.Watermark plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("watermarkConfig(v0.2.4+)")]),t("td",[e._v("Object")]),t("td"),t("td",[e._v("Watermark config, Please refer to the table 【Watermark config】 below for detailed configuration")]),t("td")])])]),t("h4",[e._v("5.1Watermark config")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")])])]),t("tbody",[t("tr",[t("td",[e._v("text")]),t("td",[e._v("String")]),t("td",[e._v("''")]),t("td",[e._v("Watermark text. If it is an empty string, the watermark will not be displayed")])]),t("tr",[t("td",[e._v("lineSpacing")]),t("td",[e._v("Number")]),t("td",[e._v("100")]),t("td",[e._v("Spacing between watermark lines")])]),t("tr",[t("td",[e._v("textSpacing")]),t("td",[e._v("Number")]),t("td",[e._v("100")]),t("td",[e._v("Spacing between watermarks in the same row")])]),t("tr",[t("td",[e._v("angle")]),t("td",[e._v("Number")]),t("td",[e._v("30")]),t("td",[e._v("Tilt angle of watermark, range: [0, 90]")])]),t("tr",[t("td",[e._v("textStyle")]),t("td",[e._v("Object")]),t("td",[e._v("{color: '#999', opacity: 0.5, fontSize: 14}")]),t("td",[e._v("Watermark text style")])]),t("tr",[t("td",[e._v("onlyExport(v0.9.2+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Is only add watermarks during export")])]),t("tr",[t("td",[e._v("belowNode(v0.10.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Is the watermark displayed below the node")])])])]),t("h3",[e._v("6.AssociativeLine plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("defaultAssociativeLineText(v0.5.11+)")]),t("td",[e._v("String")]),t("td",[e._v("关联")]),t("td",[e._v("Association Line Default Text")]),t("td")]),t("tr",[t("td",[e._v("associativeLineIsAlwaysAboveNode(v0.8.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Is the associated line always displayed above the node? If set to false, it will be at the top level when creating and activating the associated line, and in other cases, it will be below the node")]),t("td")]),t("tr",[t("td",[e._v("associativeLineInitPointsPosition(v0.9.5+)")]),t("td",[e._v("null / { from, to }")]),t("td",[e._v("{ from: '', to: '' }")]),t("td",[e._v("By default, the position of the two endpoints of a newly created association line is calculated based on the relative position of the center points of the two nodes. If you want to fix the position, you can configure it through this option. If neither from nor to is transmitted, they will be automatically calculated. If only one is transmitted, the other will be automatically calculated. from and to optional values")]),t("td")]),t("tr",[t("td",[e._v(":left、top、bottom、right")]),t("td"),t("td"),t("td"),t("td")]),t("tr",[t("td",[e._v("enableAdjustAssociativeLinePoints(v0.9.5+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Is it allowed to adjust the position of the two endpoints of the associated line")]),t("td")])])]),t("h3",[e._v("7.RichText plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("richTextEditFakeInPlace(v0.6.13+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Set the rich text node edit box to match the size of the node, creating a pseudo in place editing effect. It should be noted that only when there is only text within the node and the shape is rectangular, can the effect be better")]),t("td")]),t("tr",[t("td",[e._v("enableEditFormulaInRichTextEdit(v0.10.0+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td"),t("td",[e._v("Whether to enable direct editing of mathematical formulas in rich text editing boxes")])]),t("tr",[t("td",[e._v("transformRichTextOnEnterEdit(v0.10.0+)")]),t("td",[e._v("null、Function")]),t("td",[e._v("null")]),t("td",[e._v("To convert rich text content, you can pass a function that will be called when entering rich text editing. The function receives the rich text content that is about to be edited and needs to return the processed rich text content")]),t("td")]),t("tr",[t("td",[e._v("beforeHideRichTextEdit(v0.10.0+)")]),t("td",[e._v("null、Function")]),t("td",[e._v("null")]),t("td",[e._v("You can pass a function that will be executed before the end of rich text editing. The function receives a richText instance, so you can update the kill document data at this time")]),t("td")])])]),t("h3",[e._v("8.TouchEvent plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("disableTouchZoom(v0.8.1+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Prohibit double finger scaling, you can still use the API for scaling, which takes effect on the TouchEvent plugin")]),t("td")])])]),t("h3",[e._v("9.Scrollbar plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("isLimitMindMapInCanvasWhenHasScrollbar(v0.9.2+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("When registering the Scrollbar plugin, will the mind map be limited to the canvas and the isLimitMindMapInCanvas configuration no longer work")]),t("td")])])]),t("h3",[e._v("10.Search plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("isOnlySearchCurrentRenderNodes(v0.9.8+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("false")]),t("td",[e._v("Is it necessary to only search for the current rendered node, and nodes that have been collapsed will not be searched for")]),t("td")])])]),t("h3",[e._v("11.Cooperate plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("beforeCooperateUpdate(v0.9.8+)")]),t("td",[e._v("Function、null")]),t("td",[e._v("null")]),t("td",[e._v("During collaborative editing, node operations are about to be updated to the lifecycle functions of other clients. The function takes an object as a parameter:{ type: 【createOrUpdate(Create or update nodes)、delete(Delete node)】, list: 【Array type, 1.When type=createOrUpdate, it represents the node data that has been created or updated, which will be synchronized to other clients, so you can modify the data; 2.When type=delete, represents the deleted node data】 }")]),t("td")])])]),t("h3",[e._v("12.RainbowLines plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("rainbowLinesConfig(v0.9.9+)")]),t("td",[e._v("Object")]),t("td",[e._v("{ open: false, colorsList: [] }")]),t("td",[e._v("Rainbow line configuration requires registering the RainbowLines plugin first. Object type, Structure: { open: false【Is turn on rainbow lines】, colorsList: []【Customize the color list for rainbow lines. If not set, the default color list will be used】 }")]),t("td")])])]),t("h3",[e._v("13.Demonstrate plugin")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")]),t("th",[e._v("Required")])])]),t("tbody",[t("tr",[t("td",[e._v("demonstrateConfig(v0.9.11+)")]),t("td",[e._v("Object、null")]),t("td",[e._v("null")]),t("td",[e._v("Demonstration plugin configuration. If not transmitted, the default configuration will be used. An object can be transmitted. If only a certain property is configured, only that property can be set. Other properties that have not been set will also use the default configuration. For complete configuration, please refer to the 【Demonstration Plugin Configuration】 section below")]),t("td")])])]),t("h4",[e._v("13.1Demonstration Plugin Configuration")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Field Name")]),t("th",[e._v("Type")]),t("th",[e._v("Default Value")]),t("th",[e._v("Description")])])]),t("tbody",[t("tr",[t("td",[e._v("boxShadowColor")]),t("td",[e._v("String")]),t("td",[e._v("rgba(0, 0, 0, 0.8)")]),t("td",[e._v("The color of the area around the highlighted box")])]),t("tr",[t("td",[e._v("borderRadius")]),t("td",[e._v("String")]),t("td",[e._v("5px")]),t("td",[e._v("The size of the rounded corners of the highlighted box")])]),t("tr",[t("td",[e._v("transition")]),t("td",[e._v("String")]),t("td",[e._v("all 0.3s ease-out")]),t("td",[e._v("Transition properties of highlight box animation and CSS transition properties")])]),t("tr",[t("td",[e._v("zIndex")]),t("td",[e._v("Number")]),t("td",[e._v("9999")]),t("td",[e._v("The hierarchy of highlighted box elements")])]),t("tr",[t("td",[e._v("padding")]),t("td",[e._v("Number")]),t("td",[e._v("20")]),t("td",[e._v("The inner margin of the highlighted box")])]),t("tr",[t("td",[e._v("margin")]),t("td",[e._v("Number")]),t("td",[e._v("50")]),t("td",[e._v("The outer margin of the highlighted box")])]),t("tr",[t("td",[e._v("openBlankMode(v0.9.12+)")]),t("td",[e._v("Boolean")]),t("td",[e._v("true")]),t("td",[e._v("Is enable fill in the blank mode, where underlined text is not displayed by default and only displayed sequentially by pressing the enter key")])])])]),t("h2",[e._v("Static methods")]),t("h3",[e._v("defineTheme(name, config)")]),t("blockquote",[t("p",[e._v("v0.2.23+")])]),t("p",[e._v("Define new theme.")]),t("p",[t("code",[e._v("name")]),e._v(":New theme name")]),t("p",[t("code",[e._v("config")]),e._v(":New theme config")]),t("p",[t("code",[e._v("Simple-mind-map ")]),e._v(" Built-in many themes. In addition, you can register new theme. It is recommended to register before instantiation, so that you can directly use the newly registered theme during instantiation. Use example:")]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-keyword"},[e._v("import")]),e._v(" MindMap "),t("span",{staticClass:"hljs-keyword"},[e._v("from")]),e._v(" "),t("span",{staticClass:"hljs-string"},[e._v("'simple-mind-map'")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// 注册新主题")]),e._v("\nMindMap.defineTheme("),t("span",{staticClass:"hljs-string"},[e._v("'Theme name'")]),e._v(", {})\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// 1.实例化时使用新注册的主题")]),e._v("\n"),t("span",{staticClass:"hljs-keyword"},[e._v("const")]),e._v(" mindMap = "),t("span",{staticClass:"hljs-keyword"},[e._v("new")]),e._v(" MindMap({\n "),t("span",{staticClass:"hljs-attr"},[e._v("theme")]),e._v(": "),t("span",{staticClass:"hljs-string"},[e._v("'Theme name'")]),e._v("\n})\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// 2.动态切换新主题")]),e._v("\nmindMap.setTheme("),t("span",{staticClass:"hljs-string"},[e._v("'Theme name'")]),e._v(")\n")])]),t("p",[e._v("For all configurations of theme, please refer to "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/default.js"}},[e._v("Default Topic")]),e._v(". The "),t("code",[e._v("defineTheme")]),e._v("method will merge the configuration you passed in with the default configuration. Most of the themes do not need custom many parts. For a typical customized theme configuration, please refer to "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/themes/blueSky.js"}},[e._v("blueSky")]),e._v(".")]),t("h3",[e._v("usePlugin(plugin, opt = {})")]),t("blockquote",[t("p",[e._v("v0.3.0+")])]),t("ul",[t("li",[t("code",[e._v("opt")]),e._v(":v0.4.0+,Plugin options. If a plugin supports custom options, it can be passed in through this parameter.")])]),t("p",[e._v("If you need to use some non-core functions, such as mini map, watermark, etc, you can register plugin through this method. Can be called in chain.")]),t("p",[e._v("Note: The plugin needs to be registered before instantiating "),t("code",[e._v("MindMap")]),e._v(".")]),t("h3",[e._v("hasPlugin(plugin)")]),t("blockquote",[t("p",[e._v("v0.4.0+")])]),t("p",[e._v("Get whether a plugin is registered, The index of the plugin in the registered plugin list is returned, If it is "),t("code",[e._v("-1")]),e._v(", it means that the plugin is not registered.")]),t("h2",[e._v("Static props")]),t("h3",[e._v("pluginList")]),t("blockquote",[t("p",[e._v("v0.3.0+")])]),t("p",[e._v("List of all currently registered plugins.")]),t("h2",[e._v("Instance props")]),t("h3",[e._v("el")]),t("p",[e._v("Container element.")]),t("h3",[e._v("opt")]),t("p",[e._v("Config options object.")]),t("h3",[e._v("svg")]),t("blockquote",[t("p",[e._v("@svgdotjs/svg.js library calls the node instance returned by the SVG() method")])]),t("p",[e._v("Canvas SVG element.")]),t("h3",[e._v("draw")]),t("blockquote",[t("p",[e._v("@svgdotjs/svg.js library calls the node instance returned by the group() method")]),t("p",[e._v("Child node of SVG node")])]),t("p",[e._v("Container element, used to carry content such as nodes and connections.")]),t("h3",[e._v("lineDraw")]),t("blockquote",[t("p",[e._v("v0.8.0+")]),t("p",[e._v("@svgdotjs/svg.js library calls the node instance returned by the group() method")]),t("p",[e._v("Child node of draw node")])]),t("p",[e._v("Container for node wiring elements.")]),t("h3",[e._v("nodeDraw")]),t("blockquote",[t("p",[e._v("v0.8.0+")]),t("p",[e._v("@svgdotjs/svg.js library calls the node instance returned by the group() method")]),t("p",[e._v("Child node of draw node")])]),t("p",[e._v("Container for node elements.")]),t("h3",[e._v("associativeLineDraw")]),t("blockquote",[t("p",[e._v("v0.8.0+")]),t("p",[e._v("@svgdotjs/svg.js library calls the node instance returned by the group() method")]),t("p",[e._v("Available when the associated line plugin is registered")]),t("p",[e._v("Child node of draw node")])]),t("p",[e._v("Container for associative line content.")]),t("h3",[e._v("otherDraw")]),t("blockquote",[t("p",[e._v("v0.8.0+")]),t("p",[e._v("@svgdotjs/svg.js library calls the node instance returned by the group() method")]),t("p",[e._v("Child node of draw node")])]),t("p",[e._v("Container for other content.")]),t("h3",[e._v("elRect")]),t("p",[e._v("The size and position information of the container element 'el'. The return result of calling the 'getBoundingClientRect()' method.")]),t("h3",[e._v("width")]),t("p",[e._v("The width of the container element 'el'.")]),t("h3",[e._v("height")]),t("p",[e._v("The height of the container element 'el'.")]),t("h3",[e._v("themeConfig")]),t("p",[e._v("Current Theme Configuration.")]),t("h2",[e._v("Instance methods")]),t("h3",[e._v("getElRectInfo()")]),t("p",[e._v("Update the position and size information of container elements. Be sure to call this method to update information when the position of container elements on the page changes. If the size of container elements has also changed, please call the 'resize' method.")]),t("h3",[e._v("updateData(data)")]),t("blockquote",[t("p",[e._v("v0.9.9+")])]),t("p",[e._v("Update canvas data. If the new data is formed by adding, deleting, modifying, and querying based on the current canvas node data, this method can be used to update the canvas data. The performance will be better, and not all nodes will be recreated, but rather reused as much as possible.")]),t("h3",[e._v("clearDraw()")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Clear "),t("code",[e._v("lineDraw")]),e._v("、"),t("code",[e._v("associativeLineDraw")]),e._v("、"),t("code",[e._v("nodeDraw")]),e._v("、"),t("code",[e._v("otherDraw")]),e._v(" containers.")]),t("h3",[e._v("destroy()")]),t("blockquote",[t("p",[e._v("v0.6.0+")])]),t("p",[e._v("Destroy mind maps. It will remove registered plugins, remove listening events, and delete all nodes on the canvas.")]),t("h3",[e._v("getSvgData({ paddingX = 0, paddingY = 0, ignoreWatermark = false, addContentToHeader, addContentToFooter, node })")]),t("blockquote",[t("p",[e._v("v0.3.0+")])]),t("p",[t("code",[e._v("paddingX")]),e._v(": Padding x")]),t("p",[t("code",[e._v("paddingY")]),e._v(": Padding y")]),t("p",[t("code",[e._v("ignoreWatermark")]),e._v(":v0.8.0+, Do not draw watermarks. If you do not need to draw watermarks, you can pass 'true' because drawing watermarks is very slow")]),t("p",[t("code",[e._v("addContentToHeader")]),e._v(":v0.9.9+, Function, You can return the custom content to be added to the header, as detailed in the configuration in 【Instantiation options】")]),t("p",[t("code",[e._v("addContentToFooter")]),e._v(":v0.9.9+, Function, You can return the custom content to be added to the tail, as detailed in the configuration in 【Instantiation options】")]),t("p",[t("code",[e._v("node")]),e._v(": v0.9.11+, Node instance, if passed, only export the content of that node")]),t("p",[e._v("Get the "),t("code",[e._v("svg")]),e._v(" data and return an object. The detailed structure is as follows:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("{\n svg, "),t("span",{staticClass:"hljs-comment"},[e._v("// Element, the overall svg element of the mind map graphics, including: svg (canvas container), g (actual mind map group)")]),e._v("\n svgHTML, "),t("span",{staticClass:"hljs-comment"},[e._v("// String, svg string, i.e. html string, can be directly rendered to the small map container you prepared")]),e._v("\n "),t("span",{staticClass:"hljs-attr"},[e._v("rect")]),e._v(": "),t("span",{staticClass:"hljs-comment"},[e._v("// Object, position, size, etc. of mind map graphics before zoom")]),e._v("\n origWidth, "),t("span",{staticClass:"hljs-comment"},[e._v("// Number, canvas width")]),e._v("\n origHeight, "),t("span",{staticClass:"hljs-comment"},[e._v("// Number, canvas height")]),e._v("\n scaleX, "),t("span",{staticClass:"hljs-comment"},[e._v("// Number, horizontal zoom value of mind map graphics")]),e._v("\n scaleY, "),t("span",{staticClass:"hljs-comment"},[e._v("// Number, vertical zoom value of mind map graphics")]),e._v("\n clipData"),t("span",{staticClass:"hljs-comment"},[e._v("// v0.9.11+,If node is passed, that is, the content of the specified node is exported, then this field will be returned, Represents the position coordinate data of the node region cropped from the complete image")]),e._v("\n}\n")])]),t("h3",[e._v("render(callback)")]),t("ul",[t("li",[t("code",[e._v("callback")]),e._v(": "),t("code",[e._v("v0.3.2+")]),e._v(", "),t("code",[e._v("Function")]),e._v(", Called when the re-rendering is complete")])]),t("p",[e._v("Triggers a full rendering, which will reuse nodes for better performance. If only the node positions have changed, this method can be called to "),t("code",[e._v("reRender")]),e._v(".")]),t("h3",[e._v("reRender(callback)")]),t("ul",[t("li",[t("code",[e._v("callback")]),e._v(": "),t("code",[e._v("v0.3.2+")]),e._v(", "),t("code",[e._v("Function")]),e._v(", Called when the re-rendering is complete")])]),t("p",[e._v("Performs a full re-render, clearing the canvas and creating new nodes. This has poor performance and should be used sparingly.")]),t("h3",[e._v("resize()")]),t("p",[e._v("After the container size has changed, this method should be called to adjust.")]),t("h3",[e._v("setMode(mode)")]),t("blockquote",[t("p",[e._v("v0.1.7+")])]),t("p",[e._v("Switches between readonly and edit mode.")]),t("p",[t("code",[e._v("mode")]),e._v(":readonly、edit")]),t("h3",[e._v("on(event, fn)")]),t("p",[e._v("Listen to an event. Event list:")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Event Name")]),t("th",[e._v("Description")]),t("th",[e._v("Callback Parameters")])])]),t("tbody",[t("tr",[t("td",[e._v("data_change")]),t("td",[e._v("Tree rendering data change, listen to this method to get the latest data")]),t("td",[e._v("data (current tree rendering data)")])]),t("tr",[t("td",[e._v("view_data_change(v0.1.1+)")]),t("td",[e._v("View change data, such as when dragging or zooming")]),t("td",[e._v("data (current view state data)")])]),t("tr",[t("td",[e._v("back_forward")]),t("td",[e._v("Forward or backward")]),t("td",[e._v("activeHistoryIndex (current index in the history data array), length (current length of the history data array)")])]),t("tr",[t("td",[e._v("draw_click")]),t("td",[e._v("Canvas click event")]),t("td",[e._v("e (event object)")])]),t("tr",[t("td",[e._v("svg_mousedown")]),t("td",[e._v("svg canvas mouse down event")]),t("td",[e._v("e (event object)")])]),t("tr",[t("td",[e._v("mousedown")]),t("td",[e._v("el element mouse down event")]),t("td",[e._v("e (event object), this (Event event class instance)")])]),t("tr",[t("td",[e._v("mousemove")]),t("td",[e._v("el element mouse move event")]),t("td",[e._v("e (event object), this (Event event class instance)")])]),t("tr",[t("td",[e._v("drag")]),t("td",[e._v("If it is a drag event while holding down the left button")]),t("td",[e._v("e (event object), this (Event event class instance)")])]),t("tr",[t("td",[e._v("mouseup")]),t("td",[e._v("el element mouse up event")]),t("td",[e._v("e (event object), this (Event event class instance)")])]),t("tr",[t("td",[e._v("mousewheel")]),t("td",[e._v("Mouse scroll event")]),t("td",[e._v("e (event object), dir (up or down scroll. v0.9.2+ changed to dirs, array type, which supports saving multiple directions simultaneously), this (Event event class instance) 、isTouchPad(v0.6.1+, Is it an event triggered by the touchpad)")])]),t("tr",[t("td",[e._v("contextmenu")]),t("td",[e._v("svg canvas right mouse button menu event")]),t("td",[e._v("e (event object)")])]),t("tr",[t("td",[e._v("node_click")]),t("td",[e._v("Node click event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("node_mousedown")]),t("td",[e._v("Node mouse down event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("node_mouseup")]),t("td",[e._v("node mouseup event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("node_mouseup")]),t("td",[e._v("Node mouseup event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("node_dblclick")]),t("td",[e._v("Node double-click event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("node_contextmenu")]),t("td",[e._v("Node right-click menu event")]),t("td",[e._v("e (event object), this (node instance)")])]),t("tr",[t("td",[e._v("node_mouseenter(v0.4.1+)")]),t("td",[e._v("Node mouseenter event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("node_mouseleave(v0.4.1+)")]),t("td",[e._v("Node mouseleave event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("before_node_active")]),t("td",[e._v("Event before node activation")]),t("td",[e._v("this (node instance), activeNodeList (current list of active nodes)")])]),t("tr",[t("td",[e._v("node_active")]),t("td",[e._v("Node activation event")]),t("td",[e._v("this (node instance), activeNodeList (current list of active nodes)")])]),t("tr",[t("td",[e._v("expand_btn_click")]),t("td",[e._v("Node expand or collapse event")]),t("td",[e._v("this (node instance)")])]),t("tr",[t("td",[e._v("before_show_text_edit")]),t("td",[e._v("Event before node text edit box opens")]),t("td")]),t("tr",[t("td",[e._v("hide_text_edit")]),t("td",[e._v("Node text edit box close event")]),t("td",[e._v("textEditNode (text edit box DOM node), activeNodeList (current list of active nodes)")])]),t("tr",[t("td",[e._v("scale")]),t("td",[e._v("Canvas zoom event")]),t("td",[e._v("scale (zoom ratio)")])]),t("tr",[t("td",[e._v("translate(v0.9.10+)")]),t("td",[e._v("Canvas movement event")]),t("td",[e._v("x(translate x)、y(translate y)")])]),t("tr",[t("td",[e._v("node_img_dblclick(v0.2.15+)")]),t("td",[e._v("Node image double-click event")]),t("td",[e._v("this (node instance), e (event object)")])]),t("tr",[t("td",[e._v("node_img_mouseenter(v0.6.5+)")]),t("td",[e._v("Node image mouseenter event")]),t("td",[e._v("this(node instance)、imgNode(img node)、e(event object)")])]),t("tr",[t("td",[e._v("node_img_mouseleave(v0.6.5+)")]),t("td",[e._v("Node image mouseleave event")]),t("td",[e._v("this(node instance)、imgNode(img node)、e(event object)")])]),t("tr",[t("td",[e._v("node_img_mousemove(v0.6.5+)")]),t("td",[e._v("Node image mousemove event")]),t("td",[e._v("this(node instance)、imgNode(img node)、e(event object)")])]),t("tr",[t("td",[e._v("node_tree_render_end(v0.2.16+)")]),t("td",[e._v("Node tree render end event")]),t("td")]),t("tr",[t("td",[e._v("node_tree_render_start(v0.10.0+)")]),t("td",[e._v("Node tree start rendering event")]),t("td")]),t("tr",[t("td",[e._v("rich_text_selection_change(v0.4.0+)")]),t("td",[e._v("Available when the "),t("code",[e._v("RichText")]),e._v(" plugin is registered. Triggered when the text selection area changes when the node is edited")]),t("td",[e._v("hasRange(Whether there is a selection)、rectInfo(Size and location information of the selected area)、formatInfo(Text formatting information of the selected area)")])]),t("tr",[t("td",[e._v("transforming-dom-to-images(v0.4.0+)")]),t("td",[e._v("Available when the "),t("code",[e._v("RichText")]),e._v(" plugin is registered. When there is a "),t("code",[e._v("DOM")]),e._v(" node in "),t("code",[e._v("svg")]),e._v(", the "),t("code",[e._v("DOM")]),e._v(" node will be converted to an image when exporting to an image. This event will be triggered during the conversion process. You can use this event to prompt the user about the node to which you are currently converting")]),t("td",[e._v("index(Index of the node currently converted to)、len(Total number of nodes to be converted)")])]),t("tr",[t("td",[e._v("node_dragging(v0.4.5+)")]),t("td",[e._v("Triggered when a node is dragged")]),t("td",[e._v("node(The currently dragged node)")])]),t("tr",[t("td",[e._v("node_dragend(v0.4.5+)")]),t("td",[e._v("Triggered when the node is dragged and ends")]),t("td",[e._v("{ overlapNodeUid, prevNodeUid, nextNodeUid }(v0.6.12+,The node uid to which the node is moved this time, for example, if it is moved to node A, then the overlayNodeUid is the uid of node A. If it is moved to the front of node B, then the nextNodeUid is the uid of node B. You can obtain the node instance through the mindMap. extender.findNodeByUid(uid) method)")])]),t("tr",[t("td",[e._v("associative_line_click(v0.4.5+)")]),t("td",[e._v("Triggered when an associated line is clicked")]),t("td",[e._v("path(Connector node)、clickPath(Invisible click line node)、node(Start node)、toNode(Target node)")])]),t("tr",[t("td",[e._v("svg_mouseenter(v0.5.1+)")]),t("td",[e._v("Triggered when the mouse moves into the SVG canvas")]),t("td",[e._v("e(event object)")])]),t("tr",[t("td",[e._v("svg_mouseleave(v0.5.1+)")]),t("td",[e._v("Triggered when the mouse moves out of the SVG canvas")]),t("td",[e._v("e(event object)")])]),t("tr",[t("td",[e._v("node_icon_click(v0.6.10+)")]),t("td",[e._v("Triggered when clicking on an icon within a node")]),t("td",[e._v("this(node instance)、item(Click on the icon name)、e(event object)、node(Icon node, v0.9.9+)")])]),t("tr",[t("td",[e._v("node_icon_mouseenter(v0.9.9+)")]),t("td",[e._v("Triggered when the mouse moves into an icon within a node")]),t("td",[e._v("this(node instance)、item(Click on the icon name)、e(event object)、node(Icon node)")])]),t("tr",[t("td",[e._v("node_icon_mouseleave(v0.9.9+)")]),t("td",[e._v("Triggered when the mouse moves out of the icon within the node")]),t("td",[e._v("this(node instance)、item(Click on the icon name)、e(event object)、node(Icon node)")])]),t("tr",[t("td",[e._v("view_theme_change(v0.6.12+)")]),t("td",[e._v("Triggered after calling the setTheme method to set the theme")]),t("td",[e._v("theme(theme name)")])]),t("tr",[t("td",[e._v("set_data(v0.7.3+)")]),t("td",[e._v("Triggered when the setData method is called to dynamically set mind map data")]),t("td",[e._v("data(New Mind Map Data)")])]),t("tr",[t("td",[e._v("resize(v0.8.0+)")]),t("td",[e._v("Triggered after the container size changes, actually when the 'resize' method of the mind map instance is called")]),t("td")]),t("tr",[t("td",[e._v("beforeDestroy(v0.9.0+)")]),t("td",[e._v("Triggered before destroying the mind map, i.e. triggered by calling the destroy method")]),t("td")]),t("tr",[t("td",[e._v("body_mousedown(v0.9.2+)")]),t("td",[e._v("Mousedown event of document.body")]),t("td",[e._v("e(event object)")])]),t("tr",[t("td",[e._v("body_click")]),t("td",[e._v("Click event of document.body")]),t("td",[e._v("e(event object)")])]),t("tr",[t("td",[e._v("data_change_detail(v0.9.3+)")]),t("td",[e._v("The detailed changes in rendering tree data will return an array, with each item representing an update point and each item being an object, There is a 'type' attribute that represents the type of detail, Including 'create' (create node), 'update' (update node), 'delete' (delete node), There is a 'data' attribute that represents the current updated node data. If it is of the 'update' type, there will also be an 'oldData' attribute that saves the data of the node before the update")]),t("td",[e._v("arr(Detail data)")])]),t("tr",[t("td",[e._v("layout_change(v0.9.4+)")]),t("td",[e._v("Triggered when modifying the structure, i.e. when the mindMap.setLayout() method is called")]),t("td",[e._v("layout(New layout)")])]),t("tr",[t("td",[e._v("node_cooperate_avatar_click(v0.9.9+)")]),t("td",[e._v("Triggered when the mouse clicks on a person's avatar during collaborative editing")]),t("td",[e._v("userInfo(User info)、 this(Current node instance)、 node(Avatar node)、 e(Event Object)")])]),t("tr",[t("td",[e._v("node_cooperate_avatar_mouseenter(v0.9.9+)")]),t("td",[e._v("Triggered when the mouse moves over a person's avatar during collaborative editing")]),t("td",[e._v("userInfo(User info)、 this(Current node instance)、 node(Avatar node)、 e(Event Object)")])]),t("tr",[t("td",[e._v("node_cooperate_avatar_mouseleave(v0.9.9+)")]),t("td",[e._v("Triggered when removing personnel avatars with the mouse during collaborative editing")]),t("td",[e._v("userInfo(User info)、 this(Current node instance)、 node(Avatar node)、 e(Event Object)")])]),t("tr",[t("td",[e._v("exit_demonstrate(v0.9.11+)")]),t("td",[e._v("Triggered when exiting demonstration mode")]),t("td")]),t("tr",[t("td",[e._v("demonstrate_jump(v0.9.11+)")]),t("td",[e._v("Trigger when switching steps in demonstration mode")]),t("td",[e._v("currentStepIndex(The index of the steps currently played, counting from 0)、stepLength(Total number of playback steps)")])]),t("tr",[t("td",[e._v("node_tag_click(v0.9.12+)")]),t("td",[e._v("Click events on node labels")]),t("td",[e._v("this(Current node instance)、item(Content of clicked tags)")])])])]),t("h3",[e._v("emit(event, ...args)")]),t("p",[e._v("Trigger an event, which can be one of the events listed above or a custom event.")]),t("h3",[e._v("off(event, fn)")]),t("p",[e._v("Unbind an event.")]),t("h3",[e._v("setTheme(theme, notRender = false)")]),t("ul",[t("li",[t("code",[e._v("notRender")]),e._v(": v0.8.0+, Is not call the render method to update the canvas.")])]),t("p",[e._v("Switches the theme. Available themes can be found in the options table above.")]),t("h3",[e._v("getTheme()")]),t("p",[e._v("Gets the current theme.")]),t("h3",[e._v("setThemeConfig(config, notRender = false)")]),t("ul",[t("li",[t("code",[e._v("notRender")]),e._v(": v0.8.0+, Is not call the render method to update the canvas.")])]),t("p",[e._v("Sets the theme configuration. "),t("code",[e._v("config")]),e._v(" is the same as the "),t("code",[e._v("themeConfig")]),e._v(" option in the options table above.")]),t("h3",[e._v("getCustomThemeConfig()")]),t("p",[e._v("Gets the custom theme configuration.")]),t("h3",[e._v("getThemeConfig(prop)")]),t("p",[e._v("Gets the value of a specific theme configuration property.")]),t("h3",[e._v("getConfig("),t("em",[e._v("prop")]),e._v(")")]),t("blockquote",[t("p",[e._v("0.2.24+")])]),t("p",[t("code",[e._v("prop")]),e._v(":Get the value of the specified configuration, and return the entire configuration if not passed")]),t("p",[e._v("Get config, That is, "),t("code",[e._v("opt")]),e._v(" of "),t("code",[e._v("new MindMap (opt)")])]),t("h3",[e._v("updateConfig("),t("em",[e._v("opt")]),e._v(" = {})")]),t("blockquote",[t("p",[e._v("0.2.24+")])]),t("p",[t("code",[e._v("opt")]),e._v(":Configuration to update")]),t("p",[e._v("Update config,That is update "),t("code",[e._v("opt")]),e._v(" of "),t("code",[e._v("new MindMap(opt)")]),e._v(",You can only update some data, such as:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("mindMap.updateConfig({\n "),t("span",{staticClass:"hljs-attr"},[e._v("enableFreeDrag")]),e._v(": "),t("span",{staticClass:"hljs-literal"},[e._v("true")]),t("span",{staticClass:"hljs-comment"},[e._v("// 开启节点自由拖拽")]),e._v("\n})\n")])]),t("p",[e._v("This method only updates the configuration and has no other side effects, such as triggering canvas re-rendering")]),t("h3",[e._v("getLayout()")]),t("p",[e._v("Gets the current layout structure.")]),t("h3",[e._v("setLayout(layout, notRender = false)")]),t("ul",[t("li",[t("code",[e._v("notRender")]),e._v(": v0.8.0+, Is not call the render method to update the canvas.")])]),t("p",[e._v("Sets the layout structure. Available values can be found in the "),t("code",[e._v("layout")]),e._v(" field in the options table above.")]),t("h3",[e._v("execCommand(name, ...args)")]),t("p",[e._v("Executes a command, which will add a record to the history stack for undo or redo. All commands are as follows:")]),t("table",[t("thead",[t("tr",[t("th",[e._v("Command name")]),t("th",[e._v("Description")]),t("th",[e._v("Parameters")])])]),t("tbody",[t("tr",[t("td",[e._v("SELECT_ALL")]),t("td",[e._v("Select all")]),t("td")]),t("tr",[t("td",[e._v("BACK")]),t("td",[e._v("Go back a specified number of steps")]),t("td",[e._v("step (the number of steps to go back, default is 1)")])]),t("tr",[t("td",[e._v("FORWARD")]),t("td",[e._v("Go forward a specified number of steps")]),t("td",[e._v("step (the number of steps to go forward, default is 1)")])]),t("tr",[t("td",[e._v("INSERT_NODE")]),t("td",[e._v("Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective(v0.7.2+Supports simultaneous insertion of sibling nodes into multiple active nodes)")]),t("td",[e._v("openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is "),t("code",[e._v("true")]),e._v(") 、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js"}},[e._v("exampleData.js")]),e._v(" )、 appointChildren(v0.6.14+, Optional, Specify the child nodes of the newly created node, array type)")])]),t("tr",[t("td",[e._v("INSERT_CHILD_NODE")]),t("td",[e._v("Insert a child node, the active node or appoint node will be the operation node")]),t("td",[e._v("openEdit(v0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is "),t("code",[e._v("true")]),e._v(")、 appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)、 appointData(Optional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js"}},[e._v("exampleData.js")]),e._v(" )、 appointChildren(v0.6.14+, Optional, Specify the child nodes of the newly created node, array type)")])]),t("tr",[t("td",[e._v("UP_NODE")]),t("td",[e._v("Move node up, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the first node in the list will be invalid")]),t("td")]),t("tr",[t("td",[e._v("DOWN_NODE")]),t("td",[e._v("Move node down, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the last node in the list will be invalid")]),t("td")]),t("tr",[t("td",[e._v("REMOVE_NODE")]),t("td",[e._v("Remove node, the active node or appoint node will be the operation node")]),t("td",[e._v("appointNodes(v0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array)")])]),t("tr",[t("td",[e._v("PASTE_NODE")]),t("td",[e._v("Paste node to a node, the active node will be the operation node")]),t("td",[e._v("data (the node data to paste, usually obtained through the renderer.copyNode() and renderer.cutNode() methods)")])]),t("tr",[t("td",[e._v("SET_NODE_STYLE")]),t("td",[e._v("Modify node single style")]),t("td",[e._v("node (the node to set the style of), prop (style property), value (style property value), isActive (v0.7.0+has been abandoned, boolean, whether the style being set is for the active state)")])]),t("tr",[t("td",[e._v("SET_NODE_STYLEs(v0.6.12+)")]),t("td",[e._v("Modify multiple styles of nodes")]),t("td",[e._v("node(the node to set the style of)、style(Style object,key is style prop,value is style value)、isActive(v0.7.0+has been abandoned, boolean, whether the style being set is for the active state)")])]),t("tr",[t("td",[e._v("SET_NODE_ACTIVE")]),t("td",[e._v("Set whether the node is active")]),t("td",[e._v("node (the node to set), active (boolean, whether to activate)")])]),t("tr",[t("td",[e._v("CLEAR_ACTIVE_NODE")]),t("td",[e._v("Clear the active state of the currently active node(s), the active node will be the operation node")]),t("td")]),t("tr",[t("td",[e._v("SET_NODE_EXPAND")]),t("td",[e._v("Set whether the node is expanded")]),t("td",[e._v("node (the node to set), expand (boolean, whether to expand)")])]),t("tr",[t("td",[e._v("EXPAND_ALL")]),t("td",[e._v("Expand all nodes")]),t("td")]),t("tr",[t("td",[e._v("UNEXPAND_ALL")]),t("td",[e._v("Collapse all nodes")]),t("td",[e._v("isSetRootNodeCenter(v0.9.11+,default is true,Will the root node be moved to the center after retracting all nodes)")])]),t("tr",[t("td",[e._v("UNEXPAND_TO_LEVEL (v0.2.8+)")]),t("td",[e._v("Expand to a specified level")]),t("td",[e._v("level (the level to expand to, 1, 2, 3...)")])]),t("tr",[t("td",[e._v("SET_NODE_DATA")]),t("td",[e._v("Update node data, that is, update the data in the data object of the node data object. Note that this command will not trigger view updates")]),t("td",[e._v("node (the node to set), data (object, the data to update, e.g. "),t("code",[e._v("{expand: true}")]),e._v(")")])]),t("tr",[t("td",[e._v("SET_NODE_TEXT")]),t("td",[e._v("Set node text")]),t("td",[e._v("node (the node to set), text (the new text for the node), richText(v0.4.0+, If you want to set a rich text character, you need to set it to "),t("code",[e._v("true")]),e._v(")、resetRichText(v0.6.10+Do you want to reset rich text? The default is false. If true is passed, the style of the rich text node will be reset)")])]),t("tr",[t("td",[e._v("SET_NODE_IMAGE")]),t("td",[e._v("Set Node Image")]),t("td",[e._v("node (node to set), imgData (object, image information, structured as: "),t("code",[e._v("{url, title, width, height}")]),e._v(", the width and height of the image must be passed)")])]),t("tr",[t("td",[e._v("SET_NODE_ICON")]),t("td",[e._v("Set Node Icon")]),t("td",[e._v("node (node to set), icons (array, predefined image names array, available icons can be obtained in the nodeIconList list in the "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/svg/icons.js"}},[e._v("icons.js")]),e._v(" file, icon name is type_name, such as ['priority_1'])")])]),t("tr",[t("td",[e._v("SET_NODE_HYPERLINK")]),t("td",[e._v("Set Node Hyperlink")]),t("td",[e._v("node (node to set), link (hyperlink address), title (hyperlink name, optional)")])]),t("tr",[t("td",[e._v("SET_NODE_NOTE")]),t("td",[e._v("Set Node Note")]),t("td",[e._v("node (node to set), note (note text)")])]),t("tr",[t("td",[e._v("SET_NODE_ATTACHMENT(v0.9.10+)")]),t("td",[e._v("Set node attachment")]),t("td",[e._v("node(node to set)、url(attachment url)、name(attachment name, optional)")])]),t("tr",[t("td",[e._v("SET_NODE_TAG")]),t("td",[e._v("Set Node Tag")]),t("td",[e._v("node (node to set), tag (string array, built-in color information can be obtained in "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/constants/constant.js"}},[e._v("constant.js")]),e._v(")")])]),t("tr",[t("td",[e._v("INSERT_AFTER (v0.1.5+)")]),t("td",[e._v("Move Node to After Another Node")]),t("td",[e._v("node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node)")])]),t("tr",[t("td",[e._v("INSERT_BEFORE (v0.1.5+)")]),t("td",[e._v("Move Node to Before Another Node")]),t("td",[e._v("node (node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), exist (target node)")])]),t("tr",[t("td",[e._v("MOVE_NODE_TO (v0.1.5+)")]),t("td",[e._v("Move a node as a child of another node")]),t("td",[e._v("node (the node to move, (v0.7.2+supports passing node arrays to move multiple nodes simultaneously)), toNode (the target node)")])]),t("tr",[t("td",[e._v("ADD_GENERALIZATION (v0.2.0+)")]),t("td",[e._v("Add a node summary")]),t("td",[e._v("data (the data for the summary, in object format, all numerical fields of the node are supported, default is "),t("code",[e._v("{text: 'summary'}")]),e._v(")、openEdit(v0.9.11+,Default is true,Whether to enter text editing status by default)")])]),t("tr",[t("td",[e._v("REMOVE_GENERALIZATION (v0.2.0+)")]),t("td",[e._v("Remove a node summary")]),t("td")]),t("tr",[t("td",[e._v("SET_NODE_CUSTOM_POSITION (v0.2.0+)")]),t("td",[e._v("Set a custom position for a node")]),t("td",[e._v("node (the node to set), left (custom x coordinate, default is undefined), top (custom y coordinate, default is undefined)")])]),t("tr",[t("td",[e._v("RESET_LAYOUT (v0.2.0+)")]),t("td",[e._v("Arrange layout with one click")]),t("td")]),t("tr",[t("td",[e._v("SET_NODE_SHAPE (v0.2.4+)")]),t("td",[e._v("Set the shape of a node")]),t("td",[e._v("node (the node to set), shape (the shape, all shapes: "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/render/node/Shape.js"}},[e._v("Shape.js")]),e._v(")")])]),t("tr",[t("td",[e._v("GO_TARGET_NODE(v0.6.7+)")]),t("td",[e._v("Navigate to a node, and if the node is collapsed, it will automatically expand to that node")]),t("td",[e._v("node(Node instance or node uid to locate)、callback(v0.6.9+, Callback function after positioning completion, v0.9.8+receives a parameter representing the target node instance)")])]),t("tr",[t("td",[e._v("INSERT_MULTI_NODE(v0.7.2+)")]),t("td",[e._v("Insert multiple sibling nodes into the specified node at the same time, with the operating node being the currently active node or the specified node")]),t("td",[e._v("appointNodes(Optional, specify nodes, specify multiple nodes to pass an array), nodeList(Data list of newly inserted nodes, array type)")])]),t("tr",[t("td",[e._v("INSERT_MULTI_CHILD_NODE(v0.7.2+)")]),t("td",[e._v("Insert multiple child nodes into the specified node simultaneously, with the operation node being the currently active node or the specified node")]),t("td",[e._v("appointNodes(Optional, specify nodes, specify multiple nodes to pass an array), childList(Data list of newly inserted nodes, array type)")])]),t("tr",[t("td",[e._v("INSERT_FORMULA(v0.7.2+)")]),t("td",[e._v("Insert mathematical formulas into nodes, operate on the currently active node or specified node")]),t("td",[e._v("formula(Mathematical formula to insert, LaTeX syntax), appointNodes(Optional, specify the node to insert the formula into. Multiple nodes can be passed as arrays, otherwise it defaults to the currently active node)")])]),t("tr",[t("td",[e._v("INSERT_PARENT_NODE(v0.8.0+)")]),t("td",[e._v("Insert a parent node into the specified node, with the operation node being the currently active node or the specified node")]),t("td",[e._v("openEdit(Activate the newly inserted node and enter editing mode, default to 'true'`)、 appointNodes(Optional, specify the node to insert into the parent node, and specify that multiple nodes can pass an array)、 appointData(Optional, specify the data for the newly created node, such as {text: 'xxx', ...}, Detailed structure can be referenced "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js"}},[e._v("exampleData.js")]),e._v(")")])]),t("tr",[t("td",[e._v("REMOVE_CURRENT_NODE(v0.8.0+)")]),t("td",[e._v("Delete only the current node, operate on the currently active node or specified node")]),t("td",[e._v("appointNodes(Optional, specify the nodes to be deleted, and multiple nodes can be passed as an array)")])]),t("tr",[t("td",[e._v("MOVE_UP_ONE_LEVEL(v0.9.6+)")]),t("td",[e._v("Move the specified node up one level")]),t("td",[e._v("node(Optional, specify the node to move up the hierarchy, if not passed, it will be the first node in the current active node)")])]),t("tr",[t("td",[e._v("REMOVE_CUSTOM_STYLES(v0.9.7+)")]),t("td",[e._v("One click removal of custom styles for a node")]),t("td",[e._v("node(Optional, specify the node to clear the custom style, otherwise it will be the first one in the current active node)")])]),t("tr",[t("td",[e._v("REMOVE_ALL_NODE_CUSTOM_STYLES(v0.9.7+)")]),t("td",[e._v("One click removal of multiple nodes or custom styles for all nodes")]),t("td",[e._v("appointNodes(Optional, node instance array, specifying multiple nodes to remove custom styles from. If not passed, the custom styles of all nodes on the current canvas will be removed)")])])])]),t("h3",[e._v("setData(data)")]),t("p",[e._v("Dynamic setting of mind map data, pure node data")]),t("p",[t("code",[e._v("data")]),e._v(": mind map structure data. V0.9.9+ supports passing empty objects or null, and the canvas will display blank space.")]),t("h3",[e._v("setFullData("),t("em",[e._v("data")]),e._v(")")]),t("blockquote",[t("p",[e._v("v0.2.7+")])]),t("p",[e._v("Dynamic setting of mind map data, including node data, layout, theme, view")]),t("p",[t("code",[e._v("data")]),e._v(": complete data, structure can refer to "),t("a",{attrs:{href:"https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exportFullData.json"}},[e._v("exportFullData")])]),t("h3",[e._v("getData(withConfig)")]),t("blockquote",[t("p",[e._v("v0.2.9+")])]),t("p",[e._v("Gets mind map data")]),t("p",[t("code",[e._v("withConfig")]),e._v(": "),t("code",[e._v("Boolean")]),e._v(", default is "),t("code",[e._v("false")]),e._v(", that is, the obtained data only includes the node tree, if "),t("code",[e._v("true")]),e._v(" is passed, it will also include theme, layout, view, etc. data")]),t("h3",[e._v("export(type, isDownload, fileName)")]),t("blockquote",[t("p",[e._v("You need to register the "),t("code",[e._v("Export")]),e._v(" plugin first")])]),t("p",[e._v("Export")]),t("p",[t("code",[e._v("type")]),e._v(": the type to be exported, optional values: png, svg, json, pdf (v0.2.1+), smm (essentially also json)")]),t("p",[t("code",[e._v("isDownload")]),e._v(": whether to directly trigger download, Boolean value, default is "),t("code",[e._v("false")])]),t("p",[t("code",[e._v("fileName")]),e._v(": (v0.1.6+) the name of the exported file, default is "),t("code",[e._v("思维导图")]),e._v(" (mind map).")]),t("p",[e._v("If it is exported as "),t("code",[e._v("png")]),e._v(", the fourth parameter can be passed:")]),t("p",[t("code",[e._v("transparent")]),e._v(": v0.5.7+, "),t("code",[e._v("Boolean")]),e._v(", default is "),t("code",[e._v("false")]),e._v(", Specify whether the background of the exported image is transparent")]),t("p",[e._v("If it is exported as "),t("code",[e._v("svg")]),e._v(", the fourth parameter can be passed:")]),t("p",[t("code",[e._v("plusCssText")]),e._v(": Additional "),t("code",[e._v("CSS")]),e._v(" style. If there is a "),t("code",[e._v("dom")]),e._v(" node in "),t("code",[e._v("svg")]),e._v(", you can pass in some styles specific to the node through this parameter")]),t("p",[e._v("If it is exported as "),t("code",[e._v("json")]),e._v(" or "),t("code",[e._v("smm")]),e._v(", the fourth parameter can be passed:")]),t("p",[t("code",[e._v("withConfig")]),e._v(": "),t("code",[e._v("Boolean")]),e._v(", default is "),t("code",[e._v("true")]),e._v(", Specify whether the exported data includes configuration data, otherwise only pure node tree data will be exported")]),t("h3",[e._v("toPos(x, y)")]),t("blockquote",[t("p",[e._v("v0.1.5+")])]),t("p",[e._v("Convert the coordinates of the browser's visible window to coordinates relative to the canvas.")]),t("h3",[e._v("addPlugin(plugin, opt)")]),t("blockquote",[t("p",[e._v("v0.4.0+")])]),t("p",[e._v("Register plugin, Use "),t("code",[e._v("MindMap.usePlugin")]),e._v(" to register plugin only before instantiation, The registered plugin will not take effect after instantiation, So if you want to register the plugin after instantiation, you can use the "),t("code",[e._v("addPlugin")]),e._v(" method of the instance.")]),t("h3",[e._v("removePlugin(plugin)")]),t("blockquote",[t("p",[e._v("v0.4.0+")])]),t("p",[e._v("Remove registered plugin, Plugins registered through the "),t("code",[e._v("usePlugin")]),e._v(" or "),t("code",[e._v("addPlugin")]),e._v(" methods can be removed.")])])}],d={},i=d,s=n("2877"),r=Object(s["a"])(i,o,a,!1,null,null,null);t["default"]=r.exports}}]);