Skip to content

Commit 3718032

Browse files
committed
refactor(json): add json file
1 parent 72a9180 commit 3718032

File tree

3 files changed

+210
-8
lines changed

3 files changed

+210
-8
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"nodes": [
3+
{
4+
"id": "苹果",
5+
"group": 1
6+
},
7+
{
8+
"id": "APPLE",
9+
"group": 2
10+
},
11+
{
12+
"id": "Apple",
13+
"group": 3
14+
},
15+
{
16+
"id": "苹果股份有限公司",
17+
"group": 4
18+
},
19+
{
20+
"id": "Apple, Inc",
21+
"group": 5
22+
},
23+
{
24+
"id": "成立时间",
25+
"group": 6
26+
},
27+
{
28+
"id": "苹果公司发展历程",
29+
"group": 7
30+
},
31+
{
32+
"id": "苹果logo",
33+
"group": 8
34+
},
35+
{
36+
"id": "APPLE市场调查报告",
37+
"group": 9
38+
},
39+
{
40+
"id": "苹果公司简介",
41+
"group": 10
42+
},
43+
{
44+
"id": "苹果公司发展历史及大事记",
45+
"group": 11
46+
}
47+
],
48+
"links": [
49+
{
50+
"source": "APPLE",
51+
"target": "苹果",
52+
"value": 1
53+
},
54+
{
55+
"source": "Apple",
56+
"target": "苹果",
57+
"value": 2
58+
},
59+
{
60+
"source": "苹果股份有限公司",
61+
"target": "苹果",
62+
"value": 3
63+
},
64+
{
65+
"source": "Apple, Inc",
66+
"target": "苹果",
67+
"value": 3
68+
},
69+
{
70+
"source": "成立时间",
71+
"target": "苹果",
72+
"value": 3
73+
},
74+
{
75+
"source": "苹果公司发展历程",
76+
"target": "苹果",
77+
"value": 6
78+
},
79+
{
80+
"source": "苹果logo",
81+
"target": "苹果",
82+
"value": 7
83+
},
84+
{
85+
"source": "APPLE市场调查报告",
86+
"target": "苹果",
87+
"value": 7
88+
},
89+
{
90+
"source": "苹果公司简介",
91+
"target": "苹果",
92+
"value": 7
93+
},
94+
{
95+
"source": "苹果公司发展历史及大事记",
96+
"target": "苹果",
97+
"value": 10
98+
}
99+
]
100+
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"nodes": [
3+
{
4+
"id": "新基建",
5+
"group": 1
6+
},
7+
{
8+
"id": "最新消息",
9+
"group": 2
10+
},
11+
{
12+
"id": "新基建介绍",
13+
"group": 3
14+
},
15+
{
16+
"id": "新基建龙头股",
17+
"group": 4
18+
},
19+
{
20+
"id": "发展历程",
21+
"group": 5
22+
},
23+
{
24+
"id": "存在优势",
25+
"group": 8
26+
},
27+
{
28+
"id": "5G",
29+
"group": 6
30+
},
31+
{
32+
"id": "特高压",
33+
"group": 8
34+
},
35+
{
36+
"id": "人工智能",
37+
"group": 8
38+
},
39+
{
40+
"id": "城际高速铁路",
41+
"group": 8
42+
},
43+
{
44+
"id": "工业互联网",
45+
"group": 8
46+
}
47+
],
48+
"links": [
49+
{
50+
"source": "城际高速铁路",
51+
"target": "新基建",
52+
"value": 1
53+
},
54+
{
55+
"source": "工业互联网",
56+
"target": "新基建",
57+
"value": 1
58+
},
59+
{
60+
"source": "最新消息",
61+
"target": "新基建",
62+
"value": 1
63+
},
64+
{
65+
"source": "新基建介绍",
66+
"target": "新基建",
67+
"value": 2
68+
},
69+
{
70+
"source": "新基建龙头股",
71+
"target": "新基建",
72+
"value": 3
73+
},
74+
{
75+
"source": "发展历程",
76+
"target": "新基建",
77+
"value": 3
78+
},
79+
{
80+
"source": "5G",
81+
"target": "新基建",
82+
"value": 3
83+
},
84+
{
85+
"source": "特高压",
86+
"target": "新基建",
87+
"value": 3
88+
},
89+
{
90+
"source": "人工智能",
91+
"target": "新基建",
92+
"value": 3
93+
},
94+
{
95+
"source": "存在优势",
96+
"target": "新基建",
97+
"value": 7
98+
}
99+
]
100+
}

src/components/ForceBasedLabelPlacementIII.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
<script>
99
import * as d3 from 'd3'
10-
import jsonData from '../assets/json/simple_force_layout.json'
10+
// import jsonData from '../assets/json/simple_force_layout.json'
11+
// import jsonData from '../assets/json/simple_force_layout_2.json' // 金融数据
12+
import jsonData from '../assets/json/simple_force_layout_3.json'
1113
export default {
1214
name: 'ForceBasedLabelPlacement',
1315
data () {
@@ -78,13 +80,13 @@ export default {
7880
7981
this.restart()
8082
81-
setTimeout(() => {
82-
let addData = [{ 'id': 'Four', 'group': 4 }, { 'id': 'Five', 'group': 5 }]
83-
let addLinks = [{ 'source': 'Four', 'target': 'Five', 'value': 3 }, { 'source': 'Five', 'target': 'Feuilly', 'value': 4 }]
84-
this.graph.nodes = [...this.graph.nodes, ...addData]
85-
this.graph.links = [...this.graph.links, ...addLinks]
86-
this.restart()
87-
}, 1000)
83+
// setTimeout(() => {
84+
// let addData = [{ 'id': 'Four', 'group': 4 }, { 'id': 'Five', 'group': 5 }]
85+
// let addLinks = [{ 'source': 'Four', 'target': 'Five', 'value': 3 }, { 'source': 'Five', 'target': 'Feuilly', 'value': 4 }]
86+
// this.graph.nodes = [...this.graph.nodes, ...addData]
87+
// this.graph.links = [...this.graph.links, ...addLinks]
88+
// this.restart()
89+
// }, 1000)
8890
},
8991
methods: {
9092
restart () {

0 commit comments

Comments
 (0)