js-mindmap 项目使用教程
js-mindmapJavaScript Mindmap项目地址:https://gitcode.com/gh_mirrors/js/js-mindmap
1. 项目的目录结构及介绍
js-mindmap 项目的目录结构如下:
js-mindmap/
├── css/
│ └── jsmind.css
├── es6/
│ └── jsmind.js
├── example/
│ ├── example.html
│ └── example.js
├── js/
│ └── jsmind.js
├── src/
│ ├── jsmind.js
│ └── jsmind.css
├── test/
│ └── test.html
├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── package.json
└── package-lock.json
目录介绍
css/
: 包含项目的样式文件jsmind.css
。es6/
: 包含使用 ES6 编写的 JavaScript 文件jsmind.js
。example/
: 包含示例文件example.html
和example.js
,用于展示如何使用 js-mindmap。js/
: 包含传统的 JavaScript 文件jsmind.js
。src/
: 包含源代码文件jsmind.js
和jsmind.css
。test/
: 包含测试文件test.html
。.gitignore
: Git 忽略文件配置。.npmignore
: npm 忽略文件配置。LICENSE
: 项目许可证文件。README.md
: 项目说明文档。package.json
: 项目依赖和脚本配置文件。package-lock.json
: 锁定依赖版本的文件。
2. 项目的启动文件介绍
项目的启动文件主要是 example/example.html
和 example/example.js
。
example.html
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="../css/jsmind.css" />
<script type="text/javascript" src="../js/jsmind.js"></script>
</head>
<body>
<div id="jsmind_container"></div>
<script type="text/javascript" src="example.js"></script>
</body>
</html>
example.js
var mind = {
/* 数据格式 */
};
var options = {
container: 'jsmind_container',
theme: 'orange',
editable: true
};
var jm = new jsMind(options);
jm.show(mind);
3. 项目的配置文件介绍
项目的配置文件主要是 package.json
。
package.json
{
"name": "js-mindmap",
"version": "0.8.5",
"description": "A mind map library built by javascript",
"main": "js/jsmind.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/kennethkufluk/js-mindmap.git"
},
"keywords": [
"mindmap",
"javascript",
"svg",
"canvas"
],
"author": "Kenneth Kufluk",
"license": "BSD",
"bugs": {
"url": "https://github.com/kennethkufluk/js-mindmap/issues"
},
"homepage": "https://github.com/kennethkufluk/js-mindmap#readme"
}
配置文件介绍
name
: 项目名称。version
: 项目版本。description
: 项目描述。main
: 项目的主入口文件。scripts
: 项目脚本命令。repository
: 项目仓库地址。keywords
: 项目关键词。author
: 项目作者。license
: 项目许可证。bugs
: 项目问题追踪地址。homepage
: 项目主页地址。
js-mindmapJavaScript Mindmap项目地址:https://gitcode.com/gh_mirrors/js/js-mindmap