-
-
Notifications
You must be signed in to change notification settings - Fork 898
Expand file tree
/
Copy path1_basic_cn.html
More file actions
77 lines (72 loc) · 2.77 KB
/
1_basic_cn.html
File metadata and controls
77 lines (72 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jsMind</title>
<link
type="text/css"
rel="stylesheet"
href="//jsd.onmicrosoft.cn/npm/jsmind@0.9.1/style/jsmind.css"
/>
<style type="text/css">
#jsmind_container {
width: 800px;
height: 500px;
border: solid 1px #ccc;
background: #f4f4f4;
}
</style>
</head>
<body>
<div id="jsmind_container"></div>
<script src="//jsd.onmicrosoft.cn/npm/jsmind@0.9.1/es6/jsmind.js"></script>
<script src="//jsd.onmicrosoft.cn/npm/jsmind@0.9.1/es6/jsmind.draggable-node.js"></script>
<script type="text/javascript">
function load_jsmind() {
var mind = {
meta: {
name: 'demo',
author: 'hizzgdev@163.com',
version: '0.2',
},
format: 'node_array',
data: [
{ id: 'root', isroot: true, topic: 'jsMind' },
{
'id': 'sub1',
'parentid': 'root',
'topic': 'sub1',
'background-color': '#0000ff',
},
{ id: 'sub11', parentid: 'sub1', topic: 'sub11' },
{ id: 'sub12', parentid: 'sub1', topic: 'sub12' },
{ id: 'sub13', parentid: 'sub1', topic: 'sub13' },
{ id: 'sub2', parentid: 'root', topic: 'sub2' },
{ id: 'sub21', parentid: 'sub2', topic: 'sub21' },
{
'id': 'sub22',
'parentid': 'sub2',
'topic': 'sub22',
'foreground-color': '#33ff33',
},
{ id: 'sub3', parentid: 'root', topic: 'sub3' },
],
};
var options = {
container: 'jsmind_container',
editable: true,
theme: 'primary',
};
var jm = new jsMind(options);
jm.show(mind);
// jm.set_readonly(true);
// var mind_data = jm.get_data();
// alert(mind_data);
jm.add_node('sub2', 'sub23', 'new node', { 'background-color': 'red' });
jm.set_node_color('sub21', 'green', '#ccc');
}
load_jsmind();
</script>
</body>
</html>