-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo12.html
114 lines (110 loc) · 3.9 KB
/
demo12.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MetricFlow</title>
<style>
</style>
<!-- <script src="metricflow.js"></script>-->
<!-- <script src="../src/components/metricflow-1.2.0.min.js"></script>-->
<script src="../dev/metricflow.js"></script>
<script>
window.onload = function () {
let options = {
"flow":"vertical", //horizontal水平排列 vertical垂直排列
// 'link-width-offset':-1,
// 'link-start-offsetx':0,
'link-color':"lightblue"
};
let metricFlow = MetricFlow("graph",options)
/*定义节点数据*/
let nodes= {
"x":300,
"y":200,
"id":"node1",
"title":{'name':"xx公司"},
"data":[
{'name':'简介:xxxxxxx'},
],
"children":[
{
"id":"node2",
"title":{'name':"xx部门"},
"data":[
{'name':'简介:xxxxxxx'},
],
"children":[
{
"id":"node42",
"title":{'name':"xx中心"},
"data":[
{'name':'简介:xxxxxxx'},
]
},
{
"id":"node413",
"title":{'name':"xx中心"},
"data":[
{'name':'简介:xxxxxxx'},
]
}
]
},
{
"id":"node3",
"title":{'name':"xx部门"},
"data":[
{'name':'简介:xxxxxxx'},
],
"children":[
{
"id":"node4",
"title":{'name':"xx中心"},
"data":[
{'name':'简介:xxxxxxx'},
]
},
{
"id":"node41",
"title":{'name':"xx中心"},
"data":[
{'name':'简介:xxxxxxx'},
]
}
]
},
{
"id":"node223",
"title":{'name':"xx部门"},
"data":[
{'name':'简介:xxxxxxx'},
],
"children":[
{
"id":"node224",
"title":{'name':"xx中心"},
"data":[
{'name':'简介:xxxxxxx'},
]
},
{
"id":"node4221",
"title":{'name':"xx中心"},
"data":[
{'name':'简介:xxxxxxx'},
]
}
]
}
]
};
metricFlow.createNodes(nodes);
}
</script>
</head>
<body>
<!--定义一个画布 graph -->
<div id="graph" height="700px" width="1100px" >
</div>
</body>
</html>