jsmind 0.7.1 → 0.7.2

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://badge.fury.io/js/jsmind.svg)](https://www.npmjs.com/package/jsmind)
4
4
  ![build-test](https://github.com/hizzgdev/jsmind/actions/workflows/node.js.yml/badge.svg)
5
5
 
6
- jsMind 是一个显示/编辑思维导图的纯 javascript 类库,其基于 html5 canvas (和 svg) 进行设计。jsMind 以 [BSD 协议开源](LICENSE),在此基础上你可以在你的项目上任意使用。
6
+ jsMind 是一个显示/编辑思维导图的纯 javascript 类库,其基于 html5 canvas 和 svg 进行设计。jsMind 以 [BSD 协议开源](LICENSE),在此基础上你可以在你的项目上任意使用。
7
7
 
8
8
  jsMind is mind map library built by javascript, it base on html5 canvas and svg. jsMind is released under [the BSD license](LICENSE), you can embed it in any project as long as you abide by the license.
9
9
 
@@ -26,15 +26,15 @@ The ES6 version of jsMind has been launched, and legacy version has been depreca
26
26
  <link
27
27
  type="text/css"
28
28
  rel="stylesheet"
29
- href="//cdn.jsdelivr.net/npm/jsmind@0.7.1/style/jsmind.css"
29
+ href="//cdn.jsdelivr.net/npm/jsmind@0.7.2/style/jsmind.css"
30
30
  />
31
31
  <script
32
32
  type="text/javascript"
33
- src="//cdn.jsdelivr.net/npm/jsmind@0.7.1/es6/jsmind.js"
33
+ src="//cdn.jsdelivr.net/npm/jsmind@0.7.2/es6/jsmind.js"
34
34
  ></script>
35
35
  <!--
36
36
  enable draggable node feature
37
- <script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind@0.7.1/es6/jsmind.draggable-node.js"></script>
37
+ <script type="text/javascript" src="//cdn.jsdelivr.net/npm/jsmind@0.7.2/es6/jsmind.draggable-node.js"></script>
38
38
  -->
39
39
  </head>
40
40
  <body>
@@ -57,6 +57,8 @@ The ES6 version of jsMind has been launched, and legacy version has been depreca
57
57
  </html>
58
58
  ```
59
59
 
60
+ > More samples : https://github.com/hizzgdev/jsmind-samples
61
+
60
62
  > 查阅[文档](docs/zh/1.usage.md)以获取更多关于 CDN 以及版本的知识。 Read the [doc](docs/en/1.usage.md) to learn more knowledge about CDN and version.
61
63
 
62
64
  ## Links
@@ -1,10 +1,11 @@
1
1
  [Table of Contents](index.md)
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
+ * [1. Usage *](1.usage.md)
4
+ * [2. Options](2.options.md)
5
+ * [3. Operation](3.operation.md)
6
+ * [Experimental Features](experimental-features.md)
7
+ * [Contribution](4.contribution.md)
8
+ * [Development Guide](5.development.md)
8
9
 
9
10
  1.1. Basic Framework
10
11
  ===
@@ -12,22 +13,22 @@
12
13
  At first, 2 files (jsmind.css and jsmind.js) are required. Here we link to the resources on the CDN. It is recommended to use the latest version.
13
14
 
14
15
  ```html
15
- <link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.7.1/style/jsmind.css" />
16
+ <link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.7.2/style/jsmind.css" />
16
17
 
17
- <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.1/es6/jsmind.js"></script>
18
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.js"></script>
18
19
 
19
20
  ```
20
21
  > CDN: other available CDNs are [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/), and [the mirror of jsDelivr in China](https://jsd.onmicrosoft.cn/npm/jsmind/). the resource urls would look like:
21
- > - https://unpkg.com/jsmind@0.7.1/es6/jsmind.js
22
- > - https://cdn.jsdelivr.net/npm/jsmind@0.7.1/es6/jsmind.js
23
- > - https://jsd.onmicrosoft.cn/npm/jsmind@0.7.1/es6/jsmind.js
22
+ > - https://unpkg.com/jsmind@0.7.2/es6/jsmind.js
23
+ > - https://cdn.jsdelivr.net/npm/jsmind@0.7.2/es6/jsmind.js
24
+ > - https://jsd.onmicrosoft.cn/npm/jsmind@0.7.2/es6/jsmind.js
24
25
 
25
26
  > Version: the version number appear in the url of CDN. It's strongly recommended that you also specify the version number in your project to avoid the risks that caused by version upgrades. Access the [Release page](https://github.com/hizzgdev/jsmind/releases) to get the latest version number of jsMind.
26
27
 
27
28
  Add script jsmind.draggable-node.js for enabling draggable node feature.
28
29
 
29
30
  ```html
30
- <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.1/es6/jsmind.draggable-node.js"></script>
31
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.draggable-node.js"></script>
31
32
  ```
32
33
 
33
34
  The second, a div element should be in your HTML as container
@@ -1,10 +1,11 @@
1
1
  [Table of Contents](index.md)
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
+ * [1. Usage](1.usage.md)
4
+ * [2. Options *](2.options.md)
5
+ * [3. Operation](3.operation.md)
6
+ * [Experimental Features](experimental-features.md)
7
+ * [Contribution](4.contribution.md)
8
+ * [Development Guide](5.development.md)
8
9
 
9
10
 
10
11
  2.1. Introduction
@@ -1,10 +1,11 @@
1
1
  [Table of Contents](index.md)
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
+ * [1. Usage](1.usage.md)
4
+ * [2. Options](2.options.md)
5
+ * [3. Operation *](3.operation.md)
6
+ * [Experimental Features](experimental-features.md)
7
+ * [Contribution](4.contribution.md)
8
+ * [Development Guide](5.development.md)
8
9
 
9
10
 
10
11
  jsMind object
@@ -1,12 +1,13 @@
1
1
  [Table of Contents](index.md)
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)
8
-
9
- 4.1. contribution code
3
+ * [1. Usage](1.usage.md)
4
+ * [2. Options](2.options.md)
5
+ * [3. Operation](3.operation.md)
6
+ * [Experimental Features](experimental-features.md)
7
+ * [Contribution *](4.contribution.md)
8
+ * [Development Guide](5.development.md)
9
+
10
+ Contribution code
10
11
  ===
11
12
 
12
13
  jsMind still has a lot of room for improvement and optimization. You are welcome to contribute code to jsMind.
@@ -18,14 +19,17 @@ The most convenient way to contribute code is to submit a pull-request to the js
18
19
 
19
20
  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
 
21
- 4.2 ask questions or contribute ideas
22
+ Ask questions or contribute ideas
22
23
  ===
23
24
 
24
25
  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
 
26
27
  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
 
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
+ Customization
30
+ ===
31
+
32
+ JsMind is an open source library with the BSD license, and can be used in commercial production. If there is a need for customization, please contact the author or other developers you trust.
29
33
 
30
34
  copyright notice
31
35
  ===
@@ -1,15 +1,16 @@
1
1
  [Table of Contents](index.md)
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
+ * [1. Usage](1.usage.md)
4
+ * [2. Options](2.options.md)
5
+ * [3. Operation](3.operation.md)
6
+ * [Experimental Features](experimental-features.md)
7
+ * [Contribution](4.contribution.md)
8
+ * [Development Guide *](5.development.md)
8
9
 
9
10
 
10
11
  > First of all, I would like to express my gratitude to you. The open source community is thriving because of you, and jsMind has gained even greater value because of you.
11
12
 
12
- 5.1. contributing process
13
+ Contributing process
13
14
  ===
14
15
 
15
16
  The basic process of contributing code to jsMind is:
@@ -21,7 +22,7 @@ The basic process of contributing code to jsMind is:
21
22
  5. Waiting for review, you may be asked to modify your code during the review
22
23
  6. Merge your pull-request
23
24
 
24
- 5.2. preparation
25
+ Preparation
25
26
  ===
26
27
 
27
28
  **Pull-Request and Fork** : read the github [article of pull-request](https://docs.github.com/cn/pull-requests) to learn how to submit your code using fork and pull-request.
@@ -30,7 +31,7 @@ The basic process of contributing code to jsMind is:
30
31
 
31
32
  **Visual Studio Code** : If your IDE is VS Code, it's recommended to install the plugin `esbenp.prettier-vscode`. In this way, your code will be formatted according to the configuration of jsMind automatically.
32
33
 
33
- 5.3. development
34
+ Development
34
35
  ===
35
36
 
36
37
  jsMind is written in ES6 format, source code is in `/src`. Generally, only the code in it needs to be modified.
@@ -41,7 +42,7 @@ Please remember to format the code at any time during the development process. E
41
42
  npm run format
42
43
  ```
43
44
 
44
- 5.4. unit test
45
+ Unit Test
45
46
  ===
46
47
 
47
48
  The code of unit test is in `/tests/unit`. Please add unit test for the code changes, and make sure all unit tests pass.
@@ -52,7 +53,7 @@ Execute the following command to run the unit tests:
52
53
  npm run test-es6
53
54
  ```
54
55
 
55
- 5.5. packaging and compression
56
+ Packaging and compression
56
57
  ===
57
58
 
58
59
  Execute the following command to package the code into a js file that can work in web browsers:
@@ -63,7 +64,7 @@ npm run build
63
64
 
64
65
  The js file will be generated into `/es6`
65
66
 
66
- 5.6. Local running and debugging
67
+ Local running and debugging
67
68
  ===
68
69
  Execute the following command to start a simple http server
69
70
 
@@ -0,0 +1,63 @@
1
+ [Table of Contents](index.md)
2
+
3
+ * [1. Usage](1.usage.md)
4
+ * [2. Options](2.options.md)
5
+ * [3. Operation](3.operation.md)
6
+ * [Experimental Features *](experimental-features.md)
7
+ * [Contribution](4.contribution.md)
8
+ * [Development Guide](5.development.md)
9
+
10
+ > Special note: These experimental features are not guaranteed to continue to exist in subsequent versions, nor are their API compatibility guaranteed. If experimental features are used in your project, please upgrade jsmind with caution in the future.
11
+
12
+ Export Image/Screenshot
13
+ ===
14
+ This feature can support to export mind maps as png images.
15
+
16
+ ```html
17
+
18
+ <!-- style -->
19
+ <link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.7.2/style/jsmind.css" />
20
+
21
+ <!-- jsMind -->
22
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.js"></script>
23
+
24
+ <!-- dependency of screenshot -->
25
+ <script type="text/javascript" src="https://unpkg.com/dom-to-image@2.6.0/dist/dom-to-image.min.js" ></script>
26
+
27
+ <!-- screenshot plugin -->
28
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.screenshot.js"></script>
29
+
30
+
31
+ <script>
32
+ var jm = new jsMind(options);
33
+ jm.show(mind_data);
34
+ // export current mindmap to an image
35
+ jm.shoot()
36
+ </script>
37
+
38
+ ```
39
+
40
+ If you use npm, please install `jsmind` and `dom-to-image`
41
+
42
+ ```bash
43
+ npm install jsmind
44
+ npm install dom-to-image
45
+ ```
46
+
47
+ And then use it the same way on the page.
48
+
49
+ ```html
50
+ <script>
51
+ import domtoimage from 'dom-to-image';
52
+ import jsMind from 'jsmind'
53
+ import 'jsmind/screenshot'
54
+ import 'jsmind/style/jsmind.css'
55
+
56
+ // ...
57
+
58
+ var jm = new jsMind(options);
59
+ jm.show(mind_data);
60
+ // export current mindmap to an image
61
+ jm.shoot()
62
+ </script>
63
+ ```
package/docs/en/index.md CHANGED
@@ -19,8 +19,9 @@ Table of Contents
19
19
  * 3.5 Setting Style
20
20
  * 3.6 Access to Data
21
21
  * 3.7 Other Operations
22
- * [4. Contribution](4.contribution.md)
23
- * [Attached: Development Guide](5.development.md)
22
+ * [Experimental Features](experimental-features.md)
23
+ * [Contribution](4.contribution.md)
24
+ * [Development Guide](5.development.md)
24
25
 
25
26
  copyright notice
26
27
  ======
package/docs/index.md CHANGED
@@ -4,8 +4,9 @@
4
4
  * [1. 基本用法](zh/1.usage.md)
5
5
  * [2. 选项](zh/2.options.md)
6
6
  * [3. 界面操控](zh/3.operation.md)
7
- * [4. 参与贡献](zh/4.contribution.md)
8
- * [附:贡献代码指南](zh/5.development.md)
7
+ * [实验性功能](zh/experimental-features.md)
8
+ * [参与贡献](zh/4.contribution.md)
9
+ * [贡献代码指南](zh/5.development.md)
9
10
 
10
11
  ## English
11
12
 
@@ -13,5 +14,6 @@
13
14
  * [1. Usage](en/1.usage.md)
14
15
  * [2. Options](en/2.options.md)
15
16
  * [3. API / Operation](en/3.operation.md)
16
- * [4. Contribution](en/4.contribution.md)
17
- * [Attached: Development Guide](en/5.development.md)
17
+ * [Experimental Features](en/experimental-features.md)
18
+ * [Contribution](en/4.contribution.md)
19
+ * [Development Guide](en/5.development.md)
@@ -1,10 +1,11 @@
1
1
  [目录](index.md)
2
2
 
3
- 1. [基本用法 *](1.usage.md)
4
- 2. [选项](2.options.md)
5
- 3. [界面操控](3.operation.md)
6
- 4. [参与贡献](4.contribution.md)
7
- 5. [附:贡献代码指南](5.development.md)
3
+ * [1. 基本用法 *](1.usage.md)
4
+ * [2. 选项](2.options.md)
5
+ * [3. 界面操控](3.operation.md)
6
+ * [实验性功能](experimental-features.md)
7
+ * [参与贡献](4.contribution.md)
8
+ * [贡献代码指南](5.development.md)
8
9
 
9
10
  1.1. 基本框架
10
11
  ===
@@ -13,22 +14,22 @@
13
14
 
14
15
 
15
16
  ```html
16
- <link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.7.1/style/jsmind.css" />
17
+ <link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.7.2/style/jsmind.css" />
17
18
 
18
- <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.1/es6/jsmind.js"></script>
19
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.js"></script>
19
20
  ```
20
21
 
21
22
  > CDN:其它可用的 CDN 还有 [jsDelivr](https://www.jsdelivr.com/package/npm/jsmind/),以及 jsDelivr 的[国内镜像](https://jsd.onmicrosoft.cn/npm/jsmind/)。文件路径大概像这样:
22
- > - https://unpkg.com/jsmind@0.7.1/es6/jsmind.js
23
- > - https://cdn.jsdelivr.net/npm/jsmind@0.7.1/es6/jsmind.js
24
- > - https://jsd.onmicrosoft.cn/npm/jsmind@0.7.1/es6/jsmind.js
23
+ > - https://unpkg.com/jsmind@0.7.2/es6/jsmind.js
24
+ > - https://cdn.jsdelivr.net/npm/jsmind@0.7.2/es6/jsmind.js
25
+ > - https://jsd.onmicrosoft.cn/npm/jsmind@0.7.2/es6/jsmind.js
25
26
 
26
27
  > 版本:上面的示例url中都有版本号,强烈建议你在项目里也指明版本号,以避免版本升级给你的项目带来风险。访问 [Release 页面](https://github.com/hizzgdev/jsmind/releases) 可以获取 jsmind 的最新版本号。
27
28
 
28
29
  如果希望能够通过鼠标拖拽的方式移动节点,需要额外引用 jsmind.draggable-node.js 文件
29
30
 
30
31
  ```html
31
- <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.1/es6/jsmind.draggable-node.js"></script>
32
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.draggable-node.js"></script>
32
33
  ```
33
34
 
34
35
  其次,要为 jsMind 准备一个容器,jsMind 将在这个容器里显示思维导图。可自行定义容器的id、大小及样式。
@@ -1,10 +1,11 @@
1
1
  [目录](index.md)
2
2
 
3
- 1. [基本用法](1.usage.md)
4
- 2. [选项 *](2.options.md)
5
- 3. [界面操控](3.operation.md)
6
- 4. [参与贡献](4.contribution.md)
7
- 5. [附:贡献代码指南](5.development.md)
3
+ * [1. 基本用法](1.usage.md)
4
+ * [2. 选项 *](2.options.md)
5
+ * [3. 界面操控](3.operation.md)
6
+ * [实验性功能](experimental-features.md)
7
+ * [参与贡献](4.contribution.md)
8
+ * [贡献代码指南](5.development.md)
8
9
 
9
10
  2.1. 综述
10
11
  ===
@@ -1,10 +1,11 @@
1
1
  [目录](index.md)
2
2
 
3
- 1. [基本用法](1.usage.md)
4
- 2. [选项](2.options.md)
5
- 3. [界面操控 *](3.operation.md)
6
- 4. [参与贡献](4.contribution.md)
7
- 5. [附:贡献代码指南](5.development.md)
3
+ * [1. 基本用法](1.usage.md)
4
+ * [2. 选项](2.options.md)
5
+ * [3. 界面操控 *](3.operation.md)
6
+ * [实验性功能](experimental-features.md)
7
+ * [参与贡献](4.contribution.md)
8
+ * [贡献代码指南](5.development.md)
8
9
 
9
10
  jsMind 对象
10
11
  ===
@@ -1,12 +1,13 @@
1
1
  [目录](index.md)
2
2
 
3
- 1. [基本用法](1.usage.md)
4
- 2. [选项](2.options.md)
5
- 3. [界面操控](3.operation.md)
6
- 4. [参与贡献 *](4.contribution.md)
7
- 5. [附:贡献代码指南](5.development.md)
8
-
9
- 4.1. 贡献代码
3
+ * [1. 基本用法](1.usage.md)
4
+ * [2. 选项](2.options.md)
5
+ * [3. 界面操控](3.operation.md)
6
+ * [实验性功能](experimental-features.md)
7
+ * [参与贡献 *](4.contribution.md)
8
+ * [贡献代码指南](5.development.md)
9
+
10
+ 贡献代码
10
11
  ===
11
12
 
12
13
  jsMind 还有很多可以完善及优化的地方,欢迎任何人给 jsMind 贡献代码。
@@ -21,14 +22,14 @@ jsMind 还有很多可以完善及优化的地方,欢迎任何人给 jsMind
21
22
  在提交 pull-request 前,请务必做好测试,并在提交 pull-request 时做出详细的说明,包括功能特性介绍、代码变更说明。
22
23
 
23
24
 
24
- 4.2. 提出问题或贡献想法
25
+ 提出问题或贡献想法
25
26
  ===
26
27
 
27
28
  或者您可以将您遇到的问题或想法通过 issue 的方式提出来供大家讨论,希望有能力和精力的朋友共同参与,一起解决问题。
28
29
 
29
30
  对于共性的需求,建议实现后回馈到开源项目中,对于非共性的需求,可 fork 出独立仓库进行定制开发。
30
31
 
31
- 4.3. 需要定制开发
32
+ 需要定制开发
32
33
  ===
33
34
 
34
35
  jsMind 以 BSD 协议开源,并不限制商业使用。如果需要定制开发,请单独联系作者或您依赖的其他开发者。
@@ -1,15 +1,16 @@
1
1
  [目录](index.md)
2
2
 
3
- 1. [基本用法](1.usage.md)
4
- 2. [选项](2.options.md)
5
- 3. [界面操控](3.operation.md)
6
- 4. [参与贡献](4.contribution.md)
7
- 5. [附:贡献代码指南 *](5.development.md)
3
+ * [1. 基本用法](1.usage.md)
4
+ * [2. 选项](2.options.md)
5
+ * [3. 界面操控](3.operation.md)
6
+ * [实验性功能](experimental-features.md)
7
+ * [参与贡献](4.contribution.md)
8
+ * [贡献代码指南 *](5.development.md)
8
9
 
9
10
 
10
11
  > 首先向您表示感谢,开源社区因为有您而生机勃勃,jsMind也因您而有了更大的价值。
11
12
 
12
- 5.1. 基本流程
13
+ 基本流程
13
14
  ===
14
15
 
15
16
  向 jsMind 贡献代码的基本流程是:
@@ -21,7 +22,7 @@
21
22
  5. 等待审查,审查期间可能会请你对您的代码进行修改
22
23
  6. 合并你的 pull-request 到 jsMind 项目中
23
24
 
24
- 5.2. 开发前的准备
25
+ 开发前的准备
25
26
  ===
26
27
 
27
28
  **Pull-Request 及 Fork** : 阅读 github [pull-request 文档](https://docs.github.com/cn/pull-requests), 了解如何通过 fork 及 pull-request 提交你的代码。
@@ -30,7 +31,7 @@
30
31
 
31
32
  **Visual Studio Code** : 如果您使用的 IDE 是 VS Code, 建议您安装这个插件: `esbenp.prettier-vscode` 。这样你的 VS Code 将能自动按 jsMind 的配置对代码进行格式化
32
33
 
33
- 5.3. 开发
34
+ 开发
34
35
  ===
35
36
 
36
37
  jsMind 使用 ES6 编写,代码在 `/src` 目录里,一般情况下只需要改动此目录里的代码。
@@ -40,7 +41,7 @@ jsMind 使用 ES6 编写,代码在 `/src` 目录里,一般情况下只需要
40
41
  npm run format
41
42
  ```
42
43
 
43
- 5.4. 单元测试
44
+ 单元测试
44
45
  ===
45
46
 
46
47
  单元测试的代码位于 `/tests/unit` 目录,请为新代码的代码补充单元测试,并确保所有的单元测试都能通过。
@@ -50,7 +51,7 @@ npm run format
50
51
  npm run test-es6
51
52
  ```
52
53
 
53
- 5.5. 打包及压缩
54
+ 打包及压缩
54
55
  ===
55
56
 
56
57
  在命令行中执行以下命令将代码打包为便于在浏览器中执行的js文件:
@@ -59,7 +60,7 @@ npm run build
59
60
  ```
60
61
  生成的代码位于 `/es6` 目录。
61
62
 
62
- 5.6. 本地预览及调试
63
+ 本地预览及调试
63
64
  ===
64
65
  在命令行中执行以下命令可以在本机启动一个简易的 http server
65
66
  ```
@@ -0,0 +1,64 @@
1
+
2
+ [目录](index.md)
3
+
4
+ * [1. 基本用法](1.usage.md)
5
+ * [2. 选项](2.options.md)
6
+ * [3. 界面操控](3.operation.md)
7
+ * [实验性功能 *](experimental-features.md)
8
+ * [参与贡献](4.contribution.md)
9
+ * [贡献代码指南](5.development.md)
10
+
11
+ > 特别注意:这些实验性功能并不保证在后续的版本中会一直存在,也不保证其 API 的兼容性,若在项目中使用了实验性功能,后续请谨慎升级。
12
+
13
+ 导出图片/截图
14
+ ===
15
+ 此功能可将思维导图导出为 png 格式的图片。
16
+
17
+ ```html
18
+
19
+ <!-- style -->
20
+ <link type="text/css" rel="stylesheet" href="https://unpkg.com/jsmind@0.7.2/style/jsmind.css" />
21
+
22
+ <!-- jsMind -->
23
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.js"></script>
24
+
25
+ <!-- dependency of screenshot -->
26
+ <script type="text/javascript" src="https://unpkg.com/dom-to-image@2.6.0/dist/dom-to-image.min.js" ></script>
27
+
28
+ <!-- screenshot plugin -->
29
+ <script type="text/javascript" src="https://unpkg.com/jsmind@0.7.2/es6/jsmind.screenshot.js"></script>
30
+
31
+
32
+ <script>
33
+ var jm = new jsMind(options);
34
+ jm.show(mind_data);
35
+ // export current mindmap to an image
36
+ jm.shoot()
37
+ </script>
38
+
39
+ ```
40
+
41
+ 如果使用 npm,则需要安装 jsmind 和 dom-to-image
42
+
43
+ ```bash
44
+ npm install jsmind
45
+ npm install dom-to-image
46
+ ```
47
+
48
+ 然后在页面里一样的使用
49
+
50
+ ```html
51
+ <script>
52
+ import domtoimage from 'dom-to-image';
53
+ import jsMind from 'jsmind'
54
+ import 'jsmind/screenshot'
55
+ import 'jsmind/style/jsmind.css'
56
+
57
+ // ...
58
+
59
+ var jm = new jsMind(options);
60
+ jm.show(mind_data);
61
+ // export current mindmap to an image
62
+ jm.shoot()
63
+ </script>
64
+ ```
package/docs/zh/index.md CHANGED
@@ -19,8 +19,9 @@
19
19
  * 3.5. 设置样式
20
20
  * 3.6. 获取数据
21
21
  * 3.7. 其它操作
22
- * [4. 参与贡献](4.contribution.md)
23
- * [附:贡献代码指南](5.development.md)
22
+ * [实验性功能](experimental-features.md)
23
+ * [参与贡献](4.contribution.md)
24
+ * [贡献代码指南](5.development.md)
24
25
 
25
26
  版权声明
26
27
  ======