jsmind 0.4.6 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +45 -31
- package/docs/en/1.usage.md +11 -11
- package/docs/en/2.options.md +213 -1
- package/docs/en/3.operation.md +137 -1
- package/docs/en/4.contribution.md +35 -0
- package/docs/en/5.development.md +18 -0
- package/docs/en/index.md +23 -12
- package/docs/zh/1.usage.md +22 -20
- package/docs/zh/2.options.md +54 -8
- package/docs/zh/3.operation.md +35 -21
- package/docs/zh/4.contribution.md +41 -0
- package/docs/zh/5.development.md +78 -0
- package/docs/zh/index.md +2 -1
- package/es6/jsmind.draggable-node.js +9 -0
- package/es6/jsmind.draggable-node.js.map +1 -0
- package/es6/jsmind.js +9 -0
- package/es6/jsmind.js.map +1 -0
- package/es6/jsmind.screenshot.js +9 -0
- package/es6/jsmind.screenshot.js.map +1 -0
- package/js/{jsmind.draggable.js → jsmind.draggable-node.js} +128 -122
- package/js/jsmind.js +1211 -1064
- package/js/jsmind.screenshot.js +139 -137
- package/package.json +51 -31
- package/style/jsmind.css +357 -114
- package/example/1_basic.html +0 -62
- package/example/2_features.html +0 -526
- package/example/ant.png +0 -0
- package/example/data_example.json +0 -48
- package/example/demo.html +0 -102
- package/features/jsmind.shell.js +0 -116
- package/screenshots/jsmind.png +0 -0
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2014-
|
|
1
|
+
Copyright (c) 2014-2022, ZHANG ZHIGANG <hizzgdev@163.com>
|
|
2
2
|
All rights reserved.
|
|
3
3
|
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
@@ -11,7 +11,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
版权所有 (c) 2014-
|
|
14
|
+
版权所有 (c) 2014-2022, 张志刚 <hizzgdev@163.com>
|
|
15
15
|
保留一切权利。
|
|
16
16
|
|
|
17
17
|
在满足下列条件的前提下,授予使用者使用及再发布本软件的源代码或二进制形式的权利,无论是否修改皆然:
|
package/README.md
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
|
-
jsMind
|
|
2
|
-
======
|
|
1
|
+
# jsMind
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+

|
|
5
4
|
|
|
6
|
-
jsMind
|
|
5
|
+
jsMind 是一个显示/编辑思维导图的纯 javascript 类库,其基于 html5 canvas (和 svg) 进行设计。jsMind 以 BSD 协议开源,在此基础上你可以在你的项目上任意使用。你可以在此浏览[适用于 jsMind 的 BSD 许可协议(中英文版本)][3]。
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
jsMind is a pure javascript library for mindmap, it base on html5 canvas and svg. jsMind was released under BSD license, you can embed it in any project, if only you observe the license. You can read [the BSD license agreement for jsMind in English and Chinese version][3] here.
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* App : <http://jsmind.sinaapp.com>
|
|
13
|
-
* Home : <http://hizzgdev.github.io/jsmind/developer.html>
|
|
14
|
-
* Demo :
|
|
15
|
-
* <http://hizzgdev.github.io/jsmind/example/1_basic.html>
|
|
16
|
-
* <http://hizzgdev.github.io/jsmind/example/2_features.html>
|
|
17
|
-
* Documents :
|
|
18
|
-
* [简体中文][1]
|
|
19
|
-
* [English(draft)][2]
|
|
20
|
-
* Wiki :
|
|
21
|
-
* [邮件列表 Mailing List](../../wiki/MailingList)
|
|
22
|
-
* [热点问题 Hot Topics](../../wiki/HotTopics)
|
|
23
|
-
* Donate :
|
|
24
|
-
* [资助本项目的开发][4]
|
|
25
|
-
|
|
26
|
-
Get Started:
|
|
9
|
+
## Get Started
|
|
27
10
|
|
|
28
11
|
```html
|
|
29
12
|
<html>
|
|
@@ -31,8 +14,8 @@ Get Started:
|
|
|
31
14
|
<link type="text/css" rel="stylesheet" href="style/jsmind.css" />
|
|
32
15
|
<script type="text/javascript" src="js/jsmind.js"></script>
|
|
33
16
|
<!--
|
|
34
|
-
enable
|
|
35
|
-
<script type="text/javascript" src="js/jsmind.draggable.js"></script>
|
|
17
|
+
enable draggable node feature
|
|
18
|
+
<script type="text/javascript" src="js/jsmind.draggable-node.js"></script>
|
|
36
19
|
-->
|
|
37
20
|
</head>
|
|
38
21
|
<body>
|
|
@@ -44,9 +27,9 @@ Get Started:
|
|
|
44
27
|
// see Documents for more information
|
|
45
28
|
};
|
|
46
29
|
var options = {
|
|
47
|
-
container:'jsmind_container',
|
|
48
|
-
theme:'orange',
|
|
49
|
-
editable:true
|
|
30
|
+
container: 'jsmind_container',
|
|
31
|
+
theme: 'orange',
|
|
32
|
+
editable: true,
|
|
50
33
|
};
|
|
51
34
|
var jm = new jsMind(options);
|
|
52
35
|
jm.show(mind);
|
|
@@ -55,7 +38,38 @@ Get Started:
|
|
|
55
38
|
</html>
|
|
56
39
|
```
|
|
57
40
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
41
|
+
## Links
|
|
42
|
+
|
|
43
|
+
- App : <http://jsmind.sinaapp.com>
|
|
44
|
+
- Home : <http://hizzgdev.github.io/jsmind/developer.html>
|
|
45
|
+
- npm : <https://www.npmjs.com/package/jsmind>
|
|
46
|
+
- Demo :
|
|
47
|
+
- <http://hizzgdev.github.io/jsmind/example/1_basic.html>
|
|
48
|
+
- <http://hizzgdev.github.io/jsmind/example/2_features.html>
|
|
49
|
+
- <http://hizzgdev.github.io/jsmind/example/3_mathjax.html>
|
|
50
|
+
- Documents :
|
|
51
|
+
- [简体中文][1]
|
|
52
|
+
- [English][2]
|
|
53
|
+
- Wiki :
|
|
54
|
+
- [邮件列表 Mailing List](../../wiki/MailingList)
|
|
55
|
+
- [热点问题 Hot Topics](../../wiki/HotTopics)
|
|
56
|
+
- Donate :
|
|
57
|
+
- [Become a sponsor][4]
|
|
58
|
+
- [资助本项目的开发][5]
|
|
59
|
+
|
|
60
|
+
## ES6 Pilot Version
|
|
61
|
+
|
|
62
|
+
- 目前处于测试阶段,欢迎试用找 bug, ES6 代码位于 `/src`, 可运行于浏览器的 js 文件位于 `/es6`
|
|
63
|
+
- Currently it's in the testing stage, You are welcome to serve as a guinea pig, the ES6 code is located in `/src`, and the js files that can run in browsers are located in `/es6`
|
|
64
|
+
- Demo <http://hizzgdev.github.io/jsmind/example/2_features_es6.html>
|
|
65
|
+
|
|
66
|
+
## Maintainer
|
|
67
|
+
|
|
68
|
+
- [张志刚 | Zhigang Zhang](https://hizzgdev.github.io)
|
|
69
|
+
- hizzgdev@163.com
|
|
70
|
+
|
|
71
|
+
[1]: docs/zh/index.md
|
|
72
|
+
[2]: docs/en/index.md
|
|
73
|
+
[3]: LICENSE
|
|
74
|
+
[4]: https://github.com/sponsors/hizzgdev
|
|
75
|
+
[5]: http://hizzgdev.github.io/sponsor.html
|
package/docs/en/1.usage.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
[Contents](index.md)
|
|
2
2
|
|
|
3
|
-
1.
|
|
3
|
+
1. [Usage *](1.usage.md)
|
|
4
4
|
2. [Options](2.options.md)
|
|
5
5
|
3. [Operation](3.operation.md)
|
|
6
|
-
|
|
6
|
+
4. [Contribution](4.contribution.md)
|
|
7
|
+
5. [Attached: Development Guide](5.development.md)
|
|
7
8
|
|
|
8
9
|
1.1. Basic Framework
|
|
9
10
|
===
|
|
@@ -15,10 +16,10 @@ At first, 2 files (jsmind.css and jsmind.js) are required.
|
|
|
15
16
|
<script type="text/javascript" src="js/jsmind.js"></script>
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
add script jsmind.draggable.js for enabling
|
|
19
|
+
add script jsmind.draggable-node.js for enabling draggable node feature.
|
|
19
20
|
|
|
20
21
|
```html
|
|
21
|
-
<script type="text/javascript" src="js/jsmind.draggable.js"></script>
|
|
22
|
+
<script type="text/javascript" src="js/jsmind.draggable-node.js"></script>
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
The second, a div element should be in your HTML as container
|
|
@@ -65,7 +66,6 @@ Three formats are supported by jsMind: `node-tree format`,`node-array format`,`f
|
|
|
65
66
|
These are simple demo for the 3 data format:
|
|
66
67
|
|
|
67
68
|
A. node-tree format
|
|
68
|
-
---
|
|
69
69
|
|
|
70
70
|
```javascript
|
|
71
71
|
var mind = {
|
|
@@ -100,7 +100,6 @@ var mind = {
|
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
B. node-array format
|
|
103
|
-
---
|
|
104
103
|
|
|
105
104
|
```javascript
|
|
106
105
|
var mind = {
|
|
@@ -132,7 +131,6 @@ var mind = {
|
|
|
132
131
|
```
|
|
133
132
|
|
|
134
133
|
C. freemind format
|
|
135
|
-
---
|
|
136
134
|
|
|
137
135
|
```javascript
|
|
138
136
|
var mind = {
|
|
@@ -147,7 +145,7 @@ var mind = {
|
|
|
147
145
|
```
|
|
148
146
|
|
|
149
147
|
1.3. Themes
|
|
150
|
-
|
|
148
|
+
===
|
|
151
149
|
|
|
152
150
|
15 themes were supported in jsmind, you can preview those themes by visiting [feature-demo](http://hizzgdev.github.io/jsmind/example/2_features.html).
|
|
153
151
|
|
|
@@ -179,8 +177,10 @@ jmnodes.theme-greensea jmexpander{}
|
|
|
179
177
|
jmnodes.theme-greensea jmexpander:hover{}
|
|
180
178
|
```
|
|
181
179
|
|
|
182
|
-
|
|
183
|
-
COPYRIGHT
|
|
180
|
+
copyright notice
|
|
184
181
|
===
|
|
185
|
-
|
|
182
|
+
|
|
183
|
+
Reproduction and deduction are prohibited.
|
|
184
|
+
|
|
185
|
+
The jsMind project is still being updated and the corresponding documentation is updated at the same time as the version is updated. In order to avoid confusion to the user, it is forbidden to reprint this document without written permission and to make changes of any kind to this document.
|
|
186
186
|
|
package/docs/en/2.options.md
CHANGED
|
@@ -1,3 +1,215 @@
|
|
|
1
|
+
[Contents](index.md)
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
1. [Usage](1.usage.md)
|
|
4
|
+
2. [Options *](2.options.md)
|
|
5
|
+
3. [Operation](3.operation.md)
|
|
6
|
+
4. [Contribution](4.contribution.md)
|
|
7
|
+
5. [Attached: Development Guide](5.development.md)
|
|
3
8
|
|
|
9
|
+
|
|
10
|
+
2.1. Introduction
|
|
11
|
+
===
|
|
12
|
+
|
|
13
|
+
The options object for jsMind was briefly mentioned in the example in the previous chapter:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
var options = {
|
|
17
|
+
container:'jsmind_container', // [required] ID of the container
|
|
18
|
+
editable:true, // [Optional] Whether to enable editing
|
|
19
|
+
theme:'orange' // [optional] theme
|
|
20
|
+
};
|
|
21
|
+
var jm = new jsMind(options);
|
|
22
|
+
````
|
|
23
|
+
|
|
24
|
+
But that's only a small part of it, and the full definition of the options object for jsMind is shown below:
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
options = {
|
|
28
|
+
container : '', // [required] ID of the container
|
|
29
|
+
editable : false, // Is editing enabled?
|
|
30
|
+
theme : null, // theme
|
|
31
|
+
mode :'full', // display mode
|
|
32
|
+
support_html : true, // Does it support HTML elements in the node?
|
|
33
|
+
view:{
|
|
34
|
+
engine: 'canvas', // engine for drawing lines between nodes in the mindmap
|
|
35
|
+
hmargin:100, // Minimum horizontal distance of the mindmap from the outer frame of the container
|
|
36
|
+
vmargin:50, // Minimum vertical distance of the mindmap from the outer frame of the container
|
|
37
|
+
line_width:2, // thickness of the mindmap line
|
|
38
|
+
line_color:'#555', // Thought mindmap line color
|
|
39
|
+
draggable: false, // Drag the mind map with your mouse, when it's larger that the container
|
|
40
|
+
hide_scrollbars_when_draggable: false // Hide container scrollbars, when mind map is larger than container and draggable option is true.
|
|
41
|
+
},
|
|
42
|
+
layout:{
|
|
43
|
+
hspace:30, // horizontal spacing between nodes
|
|
44
|
+
vspace:20, // vertical spacing between nodes
|
|
45
|
+
pspace:13 // Horizontal spacing between node and connection line (to place node expander)
|
|
46
|
+
},
|
|
47
|
+
shortcut:{
|
|
48
|
+
enable:true, // whether to enable shortcut
|
|
49
|
+
handles:{}, // Named shortcut key event processor
|
|
50
|
+
mapping:{ // shortcut key mapping
|
|
51
|
+
addchild : 45, // <Insert>
|
|
52
|
+
addbrother : 13, // <Enter>
|
|
53
|
+
editnode : 113, // <F2>
|
|
54
|
+
delnode : 46, // <Delete>
|
|
55
|
+
toggle : 32, // <Space>
|
|
56
|
+
left : 37, // <Left>
|
|
57
|
+
up : 38, // <Up>
|
|
58
|
+
right : 39, // <Right>
|
|
59
|
+
down : 40, // <Down>
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The above options are the default options for jsMind and you can add the appropriate options to override these default options.
|
|
66
|
+
|
|
67
|
+
Except the container, there are all optional.
|
|
68
|
+
|
|
69
|
+
These options are described in more detail below.
|
|
70
|
+
|
|
71
|
+
2.2 Conventional Options
|
|
72
|
+
===
|
|
73
|
+
|
|
74
|
+
**container** : (string) [required] ID of the container
|
|
75
|
+
|
|
76
|
+
> This parameter is not default when instantiating a jsMind. jsMind uses this parameter to find a page element and output a mindmap to that element. For easy control of the size and position of the mind map, use [block element][1] as a container for the mind map, such as `<div>`.
|
|
77
|
+
|
|
78
|
+
> You can give the element retouching, but generally limited to setting its size, position, border, etc.; if you want to change the font, font size, background color, foreground color, etc. of the mindmap, it is recommended to add custom themes by way of processing.
|
|
79
|
+
|
|
80
|
+
**editable** : (bool) Enable editing or not
|
|
81
|
+
|
|
82
|
+
> If this parameter is set to true, you can use the API to do the above operations, otherwise the API will not take effect. By default, the value of this parameter is false .
|
|
83
|
+
|
|
84
|
+
> Note that jsMind only provides an editing interface and a small amount of shortcut key support, not full editing functionality, and this parameter is only used to limit the use of these APIs.
|
|
85
|
+
|
|
86
|
+
**theme** : (string) subject
|
|
87
|
+
|
|
88
|
+
> Specify the theme name of jsMind. (look in jsMind.css)
|
|
89
|
+
|
|
90
|
+
**mode** : (string) display mode
|
|
91
|
+
|
|
92
|
+
> jsMind now supports two display modes:
|
|
93
|
+
|
|
94
|
+
> * full - child nodes are dynamically distributed on both sides of the root node [default]
|
|
95
|
+
> * side - child nodes are distributed only to the right of the root node
|
|
96
|
+
|
|
97
|
+
**support_html** : (bool) Does it support HTML elements in nodes?
|
|
98
|
+
|
|
99
|
+
> The default value of this parameter is true, meaning that it allows HTML code to be used in the node's header, and you can even insert a table `<table>` in the node's header if you wish. If you want only plain text in the title, set this parameter to false .
|
|
100
|
+
|
|
101
|
+
> Note that in freemind, the style of the node is controlled using the HTML language, and it is recommended to set this parameter to true if you are using data in freemind format.
|
|
102
|
+
|
|
103
|
+
**log_level** : (string) log level
|
|
104
|
+
|
|
105
|
+
> There are 5 levels: `debug`/`info`/`warn`/`error`/`disable`, default level is `info`. if it set to `disable`, all the logs will be closed.
|
|
106
|
+
|
|
107
|
+
2.3 Layout Options
|
|
108
|
+
===
|
|
109
|
+
|
|
110
|
+
**view.engine** : (string) engine for drawing lines between nodes in a mindmap
|
|
111
|
+
|
|
112
|
+
> jsMind now supports two line drawing engines:
|
|
113
|
+
|
|
114
|
+
> * CANVAS - Draw the lines on the canvas [default]
|
|
115
|
+
> * SVG - Using SVG to draw lines, when there are a lot of nodes and a huge area in the mind map, using this mode can bring significant performance improvements
|
|
116
|
+
|
|
117
|
+
**view.hmargin** : (number) Minimum horizontal distance (in pixels) of the mindmap from the container frame
|
|
118
|
+
**view.vmargin** : (number) Minimum vertical distance (in pixels) of the mindmap from the outer container frame
|
|
119
|
+
|
|
120
|
+
> These two parameters determine how close the mindmap can be to the border of the container. These two parameters are similar to the margin(css) property of the object if you consider the thought map itself as an object. For aesthetic purposes, the default setting is 100 pixels in the horizontal direction and 50 pixels in the vertical direction.
|
|
121
|
+
|
|
122
|
+
**view.line_width** : (number) Thickness of the mindmap line (pixels)
|
|
123
|
+
**view.line_color** : (string) color of the mindmap line (color representation in HTML)
|
|
124
|
+
|
|
125
|
+
> These two parameters determine the style of the lines in the mindmap. By default, the lines are 2px in thickness and dark gray in color (#555).
|
|
126
|
+
|
|
127
|
+
**view.draggable** : (bool) Do you want whole mind map draggable inside container?
|
|
128
|
+
|
|
129
|
+
> The default value of this parameter is false, as it keep the default behavior with vertical and horizontal scrollbars on the container when mind map is bigger than the container.
|
|
130
|
+
|
|
131
|
+
**view.hide_scrollbars_when_draggable** : (bool) Do you want to hide container scrollbars?
|
|
132
|
+
|
|
133
|
+
> Rely on draggable option activation, as otherwise it wouldn't be possible to explore the whole mind map when it's bigger than the container.
|
|
134
|
+
> The default value of this parameter is false, as it keep the default behavior with vertical and horizontal scrollbars on the container when mind map is bigger than the container.
|
|
135
|
+
> Otherwise, if true, there is no more scrollbars, and instead you can drag the mind map with your mouse, while button is down. It should be noted that in this case, the user will not be able to explore the mind map by rolling the mouse wheel.
|
|
136
|
+
|
|
137
|
+
**layout.hspace** : horizontal distance (pixels) between (number) nodes
|
|
138
|
+
**layout.vspace** : vertical spacing (pixels) between (number) nodes
|
|
139
|
+
|
|
140
|
+
> These two parameters are equivalent to the margin(css) property of the node object, which defaults to 30 pixels in the horizontal direction and 20 pixels in the vertical direction.
|
|
141
|
+
|
|
142
|
+
**layout.pspace** : (number) size of node expander (pixels)
|
|
143
|
+
|
|
144
|
+
> If a node (other than the root node) has a subordinate node, the outside of this node shows the controller for the shrinking/expanding subordinate node, which is used to set the size (width and height) of this controller, the default value is 13 pixels.
|
|
145
|
+
|
|
146
|
+
2.4. Shortcuts
|
|
147
|
+
===
|
|
148
|
+
|
|
149
|
+
**shortcut.enable** : (bool) Whether to enable shortcut keys
|
|
150
|
+
|
|
151
|
+
> This parameter is used to control whether you can use keyboard shortcuts to edit (or otherwise manipulate) a mindmap in the jsMind interface, the default value is true, i.e. shortcuts are enabled.
|
|
152
|
+
|
|
153
|
+
**shortcut.handles** : (object{string : function}) Named shortcut event handler
|
|
154
|
+
|
|
155
|
+
> jsMind provides some common event handler for manipulating mindmaps (see next section), and this parameter provides the ability to define additional event handler.
|
|
156
|
+
> This parameter is a collection of string->function(jsmind,event), string specifies the name of the event handler, and function is the logic to be executed by the event handler, in the next section of shortcut.mapping configuration, the name of the processor will be bound to the specific keys for the purpose of shortcut operation. For example, the following code defines a processor.
|
|
157
|
+
|
|
158
|
+
```javascript
|
|
159
|
+
handles : {
|
|
160
|
+
'dosomething' : function(jm,e){
|
|
161
|
+
// do something...
|
|
162
|
+
},
|
|
163
|
+
'dosomeotherthing' : function(jm,e){
|
|
164
|
+
// do some other things
|
|
165
|
+
}
|
|
166
|
+
...
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**shortcut.mapping** : (object{string : number}) Shortcut mapping configuration
|
|
171
|
+
|
|
172
|
+
> This parameter is used to configure the correspondence between a specific key and the event handler, this code shows the correspondence by default, e.g. the code for the [Insert] key is 45 and can be used to add a child node, while 112 represents the [F1] key for dosomething.
|
|
173
|
+
|
|
174
|
+
```javascript
|
|
175
|
+
mapping:{ // handle mapping.
|
|
176
|
+
addchild : 45, // <Insert>
|
|
177
|
+
addbrother : 13, // <Enter>
|
|
178
|
+
editnode : 113, // <F2>
|
|
179
|
+
delnode : 46, // <Delete>
|
|
180
|
+
toggle : 32, // <Space>
|
|
181
|
+
left : 37, // <Left>
|
|
182
|
+
up : 38, // <Up>
|
|
183
|
+
right : 39, // <Right>
|
|
184
|
+
down : 40, // <Down>
|
|
185
|
+
|
|
186
|
+
// Examples
|
|
187
|
+
dosomething: 112, // <F1>
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
> In addition to the single-key scenario described above, jsMind has added support for combination keys, where the code of the combination shortcut is the code of the regular key plus the identification code of the function key.
|
|
192
|
+
> Four function keys are currently supported, and the corresponding identification codes are.
|
|
193
|
+
|
|
194
|
+
> * Meta : 8192 (jsMind.key.meta)
|
|
195
|
+
> * Ctrl : 4096 (jsMind.key.ctrl)
|
|
196
|
+
> * ALT : 2048 (jsMind.key.alt)
|
|
197
|
+
> * SHIFT : 1024 (jsMind.key.shift)
|
|
198
|
+
|
|
199
|
+
> The following are some examples.
|
|
200
|
+
|
|
201
|
+
```javascript
|
|
202
|
+
mapping:{
|
|
203
|
+
addchild : jsMind.key.ctrl + 73, // <Ctrl> + <I>
|
|
204
|
+
delnode : jsMind.key.ctrl + jsMind.key.alt + 68, // <Ctrl> + <ALT> + <D>
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
copyright notice
|
|
209
|
+
===
|
|
210
|
+
|
|
211
|
+
Reproduction and deduction are prohibited.
|
|
212
|
+
|
|
213
|
+
The jsMind project is still being updated and the corresponding documentation is updated at the same time as the version is updated. In order to avoid confusion to the user, it is forbidden to reprint this document without written permission and to make changes of any kind to this document.
|
|
214
|
+
|
|
215
|
+
[1]:http://www.nowamagic.net/librarys/veda/detail/1190 "CSS Block Level Element, Inline Element Concept"
|
package/docs/en/3.operation.md
CHANGED
|
@@ -1,3 +1,139 @@
|
|
|
1
|
+
[Contents](index.md)
|
|
1
2
|
|
|
2
|
-
|
|
3
|
+
1. [Usage](1.usage.md)
|
|
4
|
+
2. [Options](2.options.md)
|
|
5
|
+
3. [Operation *](3.operation.md)
|
|
6
|
+
4. [Contribution](4.contribution.md)
|
|
7
|
+
5. [Attached: Development Guide](5.development.md)
|
|
3
8
|
|
|
9
|
+
|
|
10
|
+
jsMind object
|
|
11
|
+
===
|
|
12
|
+
|
|
13
|
+
jsMind provides a set of APIs for manipulating the mindmap, all of which are based on the `jsMind` object processing, which can be obtained using the following code.
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
/*
|
|
17
|
+
Method 1.
|
|
18
|
+
jsMind objects are available when you create a mindmap
|
|
19
|
+
*/
|
|
20
|
+
var jm = new jsMind(options);
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
Method 2.
|
|
24
|
+
This jsMind object can be obtained directly if a mindmap already exists on the current page
|
|
25
|
+
When multiple jsMind are created on a page, this method gets the last object created
|
|
26
|
+
*/
|
|
27
|
+
var jm = jsMind.current;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3.1 Displaying a mindmap
|
|
31
|
+
===
|
|
32
|
+
|
|
33
|
+
Use the `jm.show(mind)` method to display a mindmap, see [1.1. Basic framework](1.usage.md) for specific usage.
|
|
34
|
+
|
|
35
|
+
3.2. Finding Nodes
|
|
36
|
+
===
|
|
37
|
+
|
|
38
|
+
**Get root** : Use `jm.get_root()` to get the root of the current mindmap.
|
|
39
|
+
|
|
40
|
+
**Find node by id** : Use the `jm.get_node(node_id)` method to find the node specified in the current mind map by id, and return `null` if it is not found.
|
|
41
|
+
|
|
42
|
+
**Get selected node** : Use `jm.get_selected_node()` to get the currently selected node and return `null` if there is no selected node.
|
|
43
|
+
|
|
44
|
+
**Find adjacent nodes** : Use `jm.find_node_before(node|node_id)` and `find_node_after(node|node_id)` to get the previous or next node of the specified node, and return `null` if there is no previous or next one.
|
|
45
|
+
|
|
46
|
+
**Fetch parent** : Use `node.parent` to get the parent node, the parent of the root node is `null`.
|
|
47
|
+
|
|
48
|
+
**Fetching a collection of child nodes** : A collection of child nodes can be obtained using `node.children`.
|
|
49
|
+
|
|
50
|
+
Tips
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
A mindmap diagram is composed of multiple nodes and connections between nodes, a mindmap diagram has a root node, the root node can have multiple child nodes on the periphery, and the child node can have multiple child nodes. Each node contains more than one of the following attributes.
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
node {
|
|
57
|
+
id, // : string node id
|
|
58
|
+
index, // : integer node number
|
|
59
|
+
topic, // : string node topic
|
|
60
|
+
isroot, // : boolean indicates whether this node is root or not
|
|
61
|
+
parent, // : node The parent of this node, the parent program of the root node is null, but please do not judge whether this node is the root node based on this property.
|
|
62
|
+
direction, // : enum(left,center,right) The distribution position of the node
|
|
63
|
+
children, // : array of node The combination of children of the node
|
|
64
|
+
expanded, // : boolean Is the next level of the node expanded or not
|
|
65
|
+
data, // : object{string,object} Other additional data for this node
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
3.3 Operation on Nodes
|
|
70
|
+
===
|
|
71
|
+
|
|
72
|
+
**Select node** : Use the `jm.select_node(node)` method to select the specified node.
|
|
73
|
+
|
|
74
|
+
**Collapse child nodes** : Use the `jm.collapse_node(node|node_id)` method to collapse the child nodes of the node.
|
|
75
|
+
|
|
76
|
+
**Expand Child Node** : Use the `jm.expand_node(node|node_id)` method to expand the child node of this node.
|
|
77
|
+
|
|
78
|
+
**Collapse or expand child nodes** : Use the `jm.toggle_node(node|node_id)` method to automatically expand or collapse child nodes.
|
|
79
|
+
|
|
80
|
+
**Expand all child nodes** : All child nodes can be expanded using the `jm.expand_all()` method.
|
|
81
|
+
|
|
82
|
+
**Expand to level** : Use the `jm.expand_to_depth(depth)` method to expand to a specified level.
|
|
83
|
+
|
|
84
|
+
**Move Node** : Use the `jm.move_node(node|node_id,before_id)` method to move the node to before_id node, and set before_id to `_first_` or `_last_` to move the node to first or last of the adjacent node.
|
|
85
|
+
|
|
86
|
+
**Enable editing** : Use the `jm.enable_edit()` method to enable editing of the current mindmap.
|
|
87
|
+
|
|
88
|
+
**Disable_edit** : Use the `jm.disable_edit()` method to disable editing of the current mindmap.
|
|
89
|
+
|
|
90
|
+
**Edit Node** : The node can be adjusted to edit using the `jm.begin_edit(node|node_id)` method.
|
|
91
|
+
|
|
92
|
+
**Stop editing** : The node can be adjusted to read-only using the `jm.end_edit()` method.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
3.4. Editing Nodes
|
|
96
|
+
===
|
|
97
|
+
|
|
98
|
+
**Add Node** : A node can be added using the `jm.add_node(parent_node, node_id, topic, data)` method.
|
|
99
|
+
|
|
100
|
+
**Insert node before specified location** : The `jm.insert_node_before(node_before, node_id, topic, data)` method can be used to insert a node before a node_before node.
|
|
101
|
+
|
|
102
|
+
**Insert node after specified location** : Node can be inserted after node_after using `jm.insert_node_after(node_after, node_id, topic, data)` method.
|
|
103
|
+
|
|
104
|
+
**Delete Node** : Use the `jm.remove_node(node|node_id)` method to delete a specified node and all its children.
|
|
105
|
+
|
|
106
|
+
**Update node** : Use the `jm.update_node(node_id, topic)` method to update the topic of the specified node.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
3.5 Setting Style
|
|
110
|
+
===
|
|
111
|
+
|
|
112
|
+
**Set the theme** : Use the `jm.set_theme(theme)` method to set the theme of the mind map.
|
|
113
|
+
|
|
114
|
+
**Set background / foreground color** : Use the `jm.set_node_color(node_id, bg_color, fg_color)` method to set the background and foreground color of the specified node.
|
|
115
|
+
|
|
116
|
+
**Set Font** : Use the `jm.set_node_font_style(node_id, size, weight, style)` method to set the font of the specified node.
|
|
117
|
+
|
|
118
|
+
**Set background image** : Use the `jm.set_node_background_image(node_id, image, width, height)` method to set the background image of the specified node.
|
|
119
|
+
|
|
120
|
+
3.6 Access to Data
|
|
121
|
+
===
|
|
122
|
+
|
|
123
|
+
**Get metadata** : Use the `jm.get_meta()` method to get metadata for the current mindmap.
|
|
124
|
+
|
|
125
|
+
**Get Data** : The `jm.get_data(data_format)` method is used to get the data text in the specified format of the current mindmap.
|
|
126
|
+
|
|
127
|
+
3.7 Other Operations
|
|
128
|
+
===
|
|
129
|
+
|
|
130
|
+
**Clear selection of nodes** : Use the `jm.select_clear()` method to clear the current selected state.
|
|
131
|
+
|
|
132
|
+
**Determine if the node is visible** : Use the `jm.is_node_visible(node)` method to determine if this node is visible.
|
|
133
|
+
|
|
134
|
+
copyright notice
|
|
135
|
+
===
|
|
136
|
+
|
|
137
|
+
Reproduction and deduction are prohibited.
|
|
138
|
+
|
|
139
|
+
The jsMind project is still being updated and the corresponding documentation is updated at the same time as the version is updated. In order to avoid confusion to the user, it is forbidden to reprint this document without written permission and to make changes of any kind to this document.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[Contents](index.md)
|
|
2
|
+
|
|
3
|
+
1. [Usage](1.usage.md)
|
|
4
|
+
2. [Options](2.options.md)
|
|
5
|
+
3. [Operation](3.operation.md)
|
|
6
|
+
4. [Contribution *](4.contribution.md)
|
|
7
|
+
5. [Attached: Development Guide](5.development.md)
|
|
8
|
+
|
|
9
|
+
4.1. contribution code
|
|
10
|
+
===
|
|
11
|
+
|
|
12
|
+
jsMind still has a lot of room for improvement and optimization. You are welcome to contribute code to jsMind.
|
|
13
|
+
|
|
14
|
+
The most convenient way to contribute code is to submit a pull-request to the jsMind project, which can be done in the github help documentation.
|
|
15
|
+
|
|
16
|
+
* [Creating a pull request from a fork](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork)
|
|
17
|
+
* [Working with forks] (https://help.github.com/en/articles/working-with-forks)
|
|
18
|
+
|
|
19
|
+
Before submitting a pull-request, be sure to test it well and make a detailed note when submitting the pull-request, including feature descriptions, code change notes.
|
|
20
|
+
|
|
21
|
+
4.2 ask questions or contribute ideas
|
|
22
|
+
===
|
|
23
|
+
|
|
24
|
+
Or you can bring up a problem or need you've encountered via an issue for discussion, and hopefully a friend who has the ability and energy to join in and solve the problem together.
|
|
25
|
+
|
|
26
|
+
For common requirements, it is recommended to implement post-implementation feedback to the open source project, for non-common requirements, you can fork out a separate warehouse for custom development.
|
|
27
|
+
|
|
28
|
+
It is important to note that open source does not mean free. jsMind itself doesn't restrict commercial use, but it's only right to be paid for custom development.
|
|
29
|
+
|
|
30
|
+
copyright notice
|
|
31
|
+
===
|
|
32
|
+
|
|
33
|
+
Reproduction and deduction are prohibited.
|
|
34
|
+
|
|
35
|
+
The jsMind project is still being updated and the corresponding documentation is updated at the same time as the version is updated. In order to avoid confusion to the user, it is forbidden to reprint this document without written permission and to make changes of any kind to this document.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
[Contents](index.md)
|
|
2
|
+
|
|
3
|
+
1. [Usage](1.usage.md)
|
|
4
|
+
2. [Options](2.options.md)
|
|
5
|
+
3. [Operation](3.operation.md)
|
|
6
|
+
4. [Contribution](4.contribution.md)
|
|
7
|
+
5. [Attached: Development Guide *](5.development.md)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
WIP
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
copyright notice
|
|
14
|
+
===
|
|
15
|
+
|
|
16
|
+
Reproduction and deduction are prohibited.
|
|
17
|
+
|
|
18
|
+
The jsMind project is still being updated and the corresponding documentation is updated at the same time as the version is updated. In order to avoid confusion to the user, it is forbidden to reprint this document without written permission and to make changes of any kind to this document.
|
package/docs/en/index.md
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
Contents
|
|
1
|
+
Contents.
|
|
2
2
|
======
|
|
3
3
|
|
|
4
|
-
**Sorry, documents in English have not been completed.**
|
|
5
|
-
|
|
6
|
-
**Thank you for helping us complete (or revise) it.**
|
|
7
|
-
|
|
8
4
|
* [1. Usage](1.usage.md)
|
|
9
|
-
* 1.1
|
|
10
|
-
* 1.2
|
|
11
|
-
* 1.3
|
|
5
|
+
* 1.1 Basic Framework
|
|
6
|
+
* 1.2 Data Format
|
|
7
|
+
* 1.3 Themes
|
|
12
8
|
* [2. Options](2.options.md)
|
|
13
|
-
*
|
|
9
|
+
* 2.1 Introduction
|
|
10
|
+
* 2.2 Conventional Options
|
|
11
|
+
* 2.3 Layout Options
|
|
12
|
+
* 2.4 Shortcuts
|
|
13
|
+
* [3. API / Operation](3.operation.md)
|
|
14
|
+
* 3.1 Displaying a Mindmap
|
|
15
|
+
* 3.2 Finding Nodes
|
|
16
|
+
* 3.3 Operation on Nodes
|
|
17
|
+
* 3.4 Editing Nodes
|
|
18
|
+
* 3.5 Setting Style
|
|
19
|
+
* 3.6 Access to Data
|
|
20
|
+
* 3.7 Other Operations
|
|
21
|
+
* [4. Contribution](4.contribution.md)
|
|
22
|
+
* [Attached: Development Guide](5.development.md)
|
|
23
|
+
|
|
24
|
+
copyright notice
|
|
25
|
+
======
|
|
14
26
|
|
|
15
|
-
|
|
16
|
-
===
|
|
17
|
-
No reproduction, No derivatives.
|
|
27
|
+
Reproduction and deduction are prohibited.
|
|
18
28
|
|
|
29
|
+
The jsMind project is still being updated and the corresponding documentation is updated at the same time as the version is updated. In order to avoid confusion to the user, it is forbidden to reprint this document without written permission and to make changes of any kind to this document.
|