-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelationBetweenMoods.html
135 lines (115 loc) · 16 KB
/
relationBetweenMoods.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
width:1050px;
margin:50px auto;
margin-left: auto;
font: 13px sans-serif;
background: #252722;
}
.chord path {
fill-opacity: .67;
stroke: #fff;
stroke-width: .1px;
}
p {
margin-left: auto;
color: #fff;
font: 16px sans-serif;
}
</style>
<body>
<script src="/media/js/d3.v3.min.js"></script>
<script>
var matrix = [[0, 89, 0, 40, 0, 0, 0, 100, 0, 0, 0, 0, 0, 58, 0, 99, 165, 0, 0, 0, 0, 64, 0, 59, 0, 0, 0, 0, 0, 0, 0, 0], [89, 0, 116, 256, 0, 2, 33, 95, 0, 0, 35, 0, 0, 249, 0, 84, 0, 0, 0, 15, 0, 306, 46, 57, 110, 0, 26, 35, 124, 70, 123, 0], [0, 116, 0, 321, 0, 0, 0, 0, 0, 0, 0, 19, 0, 198, 0, 32, 0, 0, 0, 0, 134, 269, 0, 0, 146, 0, 26, 0, 0, 25, 7, 0], [40, 256, 321, 0, 33, 0, 0, 0, 0, 0, 0, 55, 0, 42, 22, 100, 0, 0, 0, 0, 80, 420, 35, 0, 92, 0, 0, 0, 212, 52, 0, 0], [0, 0, 0, 33, 0, 70, 0, 83, 148, 213, 0, 0, 106, 0, 78, 57, 45, 149, 0, 0, 156, 0, 0, 68, 0, 182, 0, 0, 1, 2, 0, 117], [0, 2, 0, 0, 70, 0, 0, 0, 262, 285, 119, 22, 111, 32, 0, 1, 0, 113, 161, 0, 69, 0, 0, 118, 0, 131, 32, 26, 66, 0, 0, 0], [0, 33, 0, 0, 0, 0, 0, 0, 0, 62, 1, 85, 0, 74, 0, 72, 0, 0, 0, 147, 49, 159, 0, 0, 125, 27, 85, 0, 9, 0, 0, 5], [100, 95, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 55, 13, 55, 13, 95, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 20, 0, 72, 62, 0], [0, 0, 0, 0, 148, 262, 0, 0, 0, 185, 0, 0, 151, 0, 0, 0, 0, 257, 0, 0, 0, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 505], [0, 0, 0, 0, 213, 285, 62, 0, 185, 0, 87, 77, 332, 46, 0, 58, 0, 83, 97, 27, 50, 0, 0, 0, 0, 126, 7, 0, 1, 0, 0, 83], [0, 35, 0, 0, 0, 119, 1, 0, 0, 87, 0, 0, 94, 36, 0, 91, 0, 27, 0, 0, 1, 0, 0, 7, 0, 5, 0, 0, 7, 0, 0, 0], [0, 0, 19, 55, 0, 22, 85, 0, 0, 77, 0, 0, 131, 121, 0, 0, 0, 36, 0, 0, 45, 0, 0, 0, 96, 0, 54, 5, 22, 0, 0, 36], [0, 0, 0, 0, 106, 111, 0, 55, 151, 332, 94, 131, 0, 20, 55, 0, 217, 56, 232, 0, 0, 0, 0, 282, 0, 264, 0, 0, 168, 1, 0, 307], [58, 249, 198, 42, 0, 32, 74, 13, 0, 46, 36, 121, 20, 0, 0, 217, 0, 0, 0, 0, 27, 37, 75, 0, 183, 0, 102, 0, 78, 0, 73, 0], [0, 0, 0, 22, 78, 0, 0, 55, 0, 0, 0, 0, 55, 0, 0, 0, 56, 0, 0, 62, 24, 30, 0, 0, 0, 0, 0, 0, 6, 27, 0, 0], [99, 84, 32, 100, 57, 1, 72, 13, 0, 58, 91, 0, 0, 217, 0, 0, 0, 0, 0, 0, 32, 138, 62, 0, 68, 1, 26, 0, 188, 154, 0, 0], [165, 0, 0, 0, 45, 0, 0, 95, 0, 0, 0, 0, 217, 0, 56, 0, 0, 0, 2, 70, 0, 93, 0, 256, 0, 0, 0, 82, 198, 141, 0, 0], [0, 0, 0, 0, 149, 113, 0, 0, 257, 83, 27, 36, 56, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 111, 0, 0, 0, 0, 0, 234], [0, 0, 0, 0, 0, 161, 0, 0, 0, 97, 0, 0, 232, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 37, 0, 73, 0, 35, 0, 0, 0, 0], [0, 15, 0, 0, 0, 0, 147, 0, 0, 27, 0, 0, 0, 0, 62, 0, 70, 0, 0, 0, 0, 63, 0, 0, 25, 27, 27, 0, 20, 0, 0, 0], [0, 0, 134, 80, 156, 69, 49, 0, 0, 50, 1, 45, 0, 27, 24, 32, 0, 32, 0, 0, 0, 45, 0, 0, 29, 32, 2, 0, 0, 0, 0, 54], [64, 306, 269, 420, 0, 0, 159, 7, 0, 0, 0, 0, 0, 37, 30, 138, 93, 0, 0, 63, 45, 0, 51, 0, 196, 0, 59, 101, 51, 263, 30, 0], [0, 46, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 0, 62, 0, 0, 0, 0, 0, 51, 0, 0, 23, 0, 8, 0, 0, 0, 46, 0], [59, 57, 0, 0, 68, 118, 0, 0, 0, 0, 7, 0, 282, 0, 0, 0, 256, 0, 37, 0, 0, 0, 0, 0, 0, 91, 0, 79, 107, 0, 0, 0], [0, 110, 146, 92, 0, 0, 125, 0, 0, 0, 0, 96, 0, 183, 0, 68, 0, 0, 0, 25, 29, 196, 23, 0, 0, 0, 111, 0, 0, 0, 0, 0], [0, 0, 0, 0, 182, 131, 27, 0, 104, 126, 5, 0, 264, 0, 0, 1, 0, 111, 73, 27, 32, 0, 0, 91, 0, 0, 0, 0, 1, 0, 0, 156], [0, 26, 26, 0, 0, 32, 85, 0, 0, 7, 0, 54, 0, 102, 0, 26, 0, 0, 0, 27, 2, 59, 8, 0, 111, 0, 0, 0, 12, 0, 0, 0], [0, 35, 0, 0, 0, 26, 0, 20, 0, 0, 0, 5, 0, 0, 0, 0, 82, 0, 35, 0, 0, 101, 0, 79, 0, 0, 0, 0, 0, 46, 6, 0], [0, 124, 0, 212, 1, 66, 9, 0, 0, 1, 7, 22, 168, 78, 6, 188, 198, 0, 0, 20, 0, 51, 0, 107, 0, 1, 12, 0, 0, 293, 16, 0], [0, 70, 25, 52, 2, 0, 0, 72, 0, 0, 0, 0, 1, 0, 27, 154, 141, 0, 0, 0, 0, 263, 0, 0, 0, 0, 0, 46, 293, 0, 25, 0], [0, 123, 7, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0, 0, 30, 46, 0, 0, 0, 0, 6, 16, 25, 0, 0], [0, 0, 0, 0, 117, 0, 5, 0, 505, 83, 0, 36, 307, 0, 0, 0, 0, 234, 0, 0, 54, 0, 0, 0, 0, 156, 0, 0, 0, 0, 0, 0]];
var labels = ['sweet', 'lush', 'sad', 'introspective', 'raw', 'cocky', 'spacey', 'sprightly', 'aggressive', 'visceral', 'sexual', 'cold', 'energetic', 'nocturnal', 'earthy', 'seductive', 'happy', 'trashy', 'motivational', 'trippy', 'gloomy', 'mellow', 'soothing', 'celebratory', 'atmospheric', 'rowdy', 'hypnotic', 'campy', 'funky', 'warm', 'classy', 'angsty']
var percentage = ['0.25', '0.08', '0.10', '0.00', '0.18', '0.23', '0.03', '0.56', '0.10', '0.03', '0.31', '0.14', '0.13', '0.00', '0.44', '0.23', '0.21', '0.00', '0.21', '0.46', '0.00', '0.26', '0.41', '0.10', '0.02', '0.29', '0.06', '0.18', '0.34', '0.26', '0.05', '0.25']
var mutualpercentage = [['0.25', '0.16', '0.00', '0.07', '0.00', '0.00', '0.00', '0.18', '0.00', '0.00', '0.00', '0.00', '0.00', '0.10', '0.00', '0.18', '0.29', '0.00', '0.00', '0.00', '0.00', '0.11', '0.00', '0.11', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00'], ['0.10', '0.08', '0.13', '0.28', '0.00', '0.00', '0.04', '0.10', '0.00', '0.00', '0.04', '0.00', '0.00', '0.27', '0.00', '0.09', '0.00', '0.00', '0.00', '0.02', '0.00', '0.33', '0.05', '0.06', '0.12', '0.00', '0.03', '0.04', '0.14', '0.08', '0.13', '0.00'], ['0.00', '0.16', '0.10', '0.43', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.03', '0.00', '0.27', '0.00', '0.04', '0.00', '0.00', '0.00', '0.00', '0.18', '0.36', '0.00', '0.00', '0.20', '0.00', '0.04', '0.00', '0.00', '0.03', '0.01', '0.00'], ['0.04', '0.28', '0.35', '0.00', '0.04', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.06', '0.00', '0.05', '0.02', '0.11', '0.00', '0.00', '0.00', '0.00', '0.09', '0.45', '0.04', '0.00', '0.10', '0.00', '0.00', '0.00', '0.23', '0.06', '0.00', '0.00'], ['0.00', '0.00', '0.00', '0.04', '0.18', '0.08', '0.00', '0.09', '0.16', '0.23', '0.00', '0.00', '0.12', '0.00', '0.09', '0.06', '0.05', '0.16', '0.00', '0.00', '0.17', '0.00', '0.00', '0.07', '0.00', '0.20', '0.00', '0.00', '0.00', '0.00', '0.00', '0.13'], ['0.00', '0.00', '0.00', '0.00', '0.06', '0.23', '0.00', '0.00', '0.21', '0.23', '0.09', '0.02', '0.09', '0.03', '0.00', '0.00', '0.00', '0.09', '0.13', '0.00', '0.05', '0.00', '0.00', '0.09', '0.00', '0.10', '0.03', '0.02', '0.05', '0.00', '0.00', '0.00'], ['0.00', '0.07', '0.00', '0.00', '0.00', '0.00', '0.03', '0.00', '0.00', '0.14', '0.00', '0.19', '0.00', '0.17', '0.00', '0.16', '0.00', '0.00', '0.00', '0.33', '0.11', '0.36', '0.00', '0.00', '0.28', '0.06', '0.19', '0.00', '0.02', '0.00', '0.00', '0.01'], ['0.10', '0.09', '0.00', '0.00', '0.08', '0.00', '0.00', '0.56', '0.00', '0.00', '0.00', '0.00', '0.05', '0.01', '0.05', '0.01', '0.09', '0.00', '0.00', '0.00', '0.00', '0.01', '0.00', '0.00', '0.00', '0.00', '0.00', '0.02', '0.00', '0.07', '0.06', '0.00'], ['0.00', '0.00', '0.00', '0.00', '0.15', '0.26', '0.00', '0.00', '0.10', '0.18', '0.00', '0.00', '0.15', '0.00', '0.00', '0.00', '0.00', '0.26', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.10', '0.00', '0.00', '0.00', '0.00', '0.00', '0.50'], ['0.00', '0.00', '0.00', '0.00', '0.23', '0.31', '0.07', '0.00', '0.20', '0.03', '0.09', '0.08', '0.36', '0.05', '0.00', '0.06', '0.00', '0.09', '0.10', '0.03', '0.05', '0.00', '0.00', '0.00', '0.00', '0.14', '0.01', '0.00', '0.00', '0.00', '0.00', '0.09'], ['0.00', '0.11', '0.00', '0.00', '0.00', '0.38', '0.00', '0.00', '0.00', '0.28', '0.31', '0.00', '0.30', '0.12', '0.00', '0.29', '0.00', '0.09', '0.00', '0.00', '0.00', '0.00', '0.00', '0.02', '0.00', '0.02', '0.00', '0.00', '0.02', '0.00', '0.00', '0.00'], ['0.00', '0.00', '0.04', '0.11', '0.00', '0.04', '0.17', '0.00', '0.00', '0.15', '0.00', '0.14', '0.26', '0.24', '0.00', '0.00', '0.00', '0.07', '0.00', '0.00', '0.09', '0.00', '0.00', '0.00', '0.19', '0.00', '0.11', '0.01', '0.04', '0.00', '0.00', '0.07'], ['0.00', '0.00', '0.00', '0.00', '0.06', '0.06', '0.00', '0.03', '0.08', '0.18', '0.05', '0.07', '0.13', '0.01', '0.03', '0.00', '0.12', '0.03', '0.13', '0.00', '0.00', '0.00', '0.00', '0.15', '0.00', '0.14', '0.00', '0.00', '0.09', '0.00', '0.00', '0.17'], ['0.08', '0.36', '0.28', '0.06', '0.00', '0.05', '0.11', '0.02', '0.00', '0.07', '0.05', '0.17', '0.03', '0.00', '0.00', '0.31', '0.00', '0.00', '0.00', '0.00', '0.04', '0.05', '0.11', '0.00', '0.26', '0.00', '0.15', '0.00', '0.11', '0.00', '0.10', '0.00'], ['0.00', '0.00', '0.00', '0.05', '0.18', '0.00', '0.00', '0.13', '0.00', '0.00', '0.00', '0.00', '0.13', '0.00', '0.44', '0.00', '0.13', '0.00', '0.00', '0.14', '0.05', '0.07', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.01', '0.06', '0.00', '0.00'], ['0.10', '0.08', '0.03', '0.10', '0.06', '0.00', '0.07', '0.01', '0.00', '0.06', '0.09', '0.00', '0.00', '0.21', '0.00', '0.23', '0.00', '0.00', '0.00', '0.00', '0.03', '0.13', '0.06', '0.00', '0.07', '0.00', '0.03', '0.00', '0.18', '0.15', '0.00', '0.00'], ['0.15', '0.00', '0.00', '0.00', '0.04', '0.00', '0.00', '0.08', '0.00', '0.00', '0.00', '0.00', '0.19', '0.00', '0.05', '0.00', '0.21', '0.00', '0.00', '0.06', '0.00', '0.08', '0.00', '0.23', '0.00', '0.00', '0.00', '0.07', '0.17', '0.12', '0.00', '0.00'], ['0.00', '0.00', '0.00', '0.00', '0.34', '0.26', '0.00', '0.00', '0.59', '0.19', '0.06', '0.08', '0.13', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.07', '0.00', '0.00', '0.00', '0.00', '0.25', '0.00', '0.00', '0.00', '0.00', '0.00', '0.54'], ['0.00', '0.00', '0.00', '0.00', '0.00', '0.29', '0.00', '0.00', '0.00', '0.18', '0.00', '0.00', '0.42', '0.00', '0.00', '0.00', '0.00', '0.00', '0.21', '0.00', '0.00', '0.00', '0.00', '0.07', '0.00', '0.13', '0.00', '0.06', '0.00', '0.00', '0.00', '0.00'], ['0.00', '0.03', '0.00', '0.00', '0.00', '0.00', '0.27', '0.00', '0.00', '0.05', '0.00', '0.00', '0.00', '0.00', '0.12', '0.00', '0.13', '0.00', '0.00', '0.46', '0.00', '0.12', '0.00', '0.00', '0.05', '0.05', '0.05', '0.00', '0.04', '0.00', '0.00', '0.00'], ['0.00', '0.00', '0.34', '0.20', '0.40', '0.18', '0.12', '0.00', '0.00', '0.13', '0.00', '0.11', '0.00', '0.07', '0.06', '0.08', '0.00', '0.08', '0.00', '0.00', '0.00', '0.11', '0.00', '0.00', '0.07', '0.08', '0.01', '0.00', '0.00', '0.00', '0.00', '0.14'], ['0.04', '0.19', '0.17', '0.26', '0.00', '0.00', '0.10', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.02', '0.02', '0.09', '0.06', '0.00', '0.00', '0.04', '0.03', '0.26', '0.03', '0.00', '0.12', '0.00', '0.04', '0.06', '0.03', '0.17', '0.02', '0.00'], ['0.00', '0.13', '0.00', '0.10', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.22', '0.00', '0.18', '0.00', '0.00', '0.00', '0.00', '0.00', '0.15', '0.41', '0.00', '0.07', '0.00', '0.02', '0.00', '0.00', '0.00', '0.13', '0.00'], ['0.07', '0.07', '0.00', '0.00', '0.08', '0.14', '0.00', '0.00', '0.00', '0.00', '0.01', '0.00', '0.33', '0.00', '0.00', '0.00', '0.30', '0.00', '0.04', '0.00', '0.00', '0.00', '0.00', '0.10', '0.00', '0.11', '0.00', '0.09', '0.12', '0.00', '0.00', '0.00'], ['0.00', '0.21', '0.28', '0.18', '0.00', '0.00', '0.24', '0.00', '0.00', '0.00', '0.00', '0.18', '0.00', '0.35', '0.00', '0.13', '0.00', '0.00', '0.00', '0.05', '0.06', '0.38', '0.04', '0.00', '0.02', '0.00', '0.21', '0.00', '0.00', '0.00', '0.00', '0.00'], ['0.00', '0.00', '0.00', '0.00', '0.17', '0.12', '0.03', '0.00', '0.10', '0.12', '0.00', '0.00', '0.25', '0.00', '0.00', '0.00', '0.00', '0.10', '0.07', '0.03', '0.03', '0.00', '0.00', '0.09', '0.00', '0.29', '0.00', '0.00', '0.00', '0.00', '0.00', '0.15'], ['0.00', '0.13', '0.13', '0.00', '0.00', '0.16', '0.43', '0.00', '0.00', '0.04', '0.00', '0.27', '0.00', '0.52', '0.00', '0.13', '0.00', '0.00', '0.00', '0.14', '0.01', '0.30', '0.04', '0.00', '0.56', '0.00', '0.06', '0.00', '0.06', '0.00', '0.00', '0.00'], ['0.00', '0.09', '0.00', '0.00', '0.00', '0.07', '0.00', '0.05', '0.00', '0.00', '0.00', '0.01', '0.00', '0.00', '0.00', '0.00', '0.22', '0.00', '0.09', '0.00', '0.00', '0.27', '0.00', '0.21', '0.00', '0.00', '0.00', '0.18', '0.00', '0.12', '0.02', '0.00'], ['0.00', '0.08', '0.00', '0.13', '0.00', '0.04', '0.01', '0.00', '0.00', '0.00', '0.00', '0.01', '0.11', '0.05', '0.00', '0.12', '0.12', '0.00', '0.00', '0.01', '0.00', '0.03', '0.00', '0.07', '0.00', '0.00', '0.01', '0.00', '0.34', '0.18', '0.01', '0.00'], ['0.00', '0.07', '0.02', '0.05', '0.00', '0.00', '0.00', '0.07', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.03', '0.15', '0.14', '0.00', '0.00', '0.00', '0.00', '0.26', '0.00', '0.00', '0.00', '0.00', '0.00', '0.05', '0.29', '0.26', '0.02', '0.00'], ['0.00', '0.59', '0.03', '0.00', '0.00', '0.00', '0.00', '0.30', '0.00', '0.00', '0.00', '0.00', '0.00', '0.35', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', '0.14', '0.22', '0.00', '0.00', '0.00', '0.00', '0.03', '0.08', '0.12', '0.05', '0.00'], ['0.00', '0.00', '0.00', '0.00', '0.10', '0.00', '0.00', '0.00', '0.45', '0.07', '0.00', '0.03', '0.27', '0.00', '0.00', '0.00', '0.00', '0.21', '0.00', '0.00', '0.05', '0.00', '0.00', '0.00', '0.00', '0.14', '0.00', '0.00', '0.00', '0.00', '0.00', '0.25']];
var chord = d3.layout.chord()
.padding(.05)
.sortSubgroups(d3.descending)
.matrix(matrix);
var width = 960,
height = 800,
r1 = height/2,
innerRadius = Math.min(width, height) * .38,
ratio = 1.05;
outerRadius = innerRadius * ratio;
var fill = d3.scale.category10()
.domain(d3.range(100));
var svg = d3.select("body").append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
svg.append("g")
.attr("class", "columns")
.selectAll("path")
.data(chord.groups)
.enter().append("path")
.style("fill", function(d) { return fill(d.index); })
.style("stroke", function(d) { return fill(d.index); })
.attr("d", d3.svg.arc().innerRadius(innerRadius).outerRadius(outerRadius))
.on("mouseover", fade(.1))
.on("mouseout", fade(1));
var texts = svg.append("g")
.attr("class", "texts")
.selectAll("text")
.data(chord.groups)
.enter().append("text")
.attr("dy", ".35em")
.attr("text-anchor", function(d) { return ((d.startAngle + d.endAngle) / 2) > Math.PI ? "end" : null; })
.attr("transform", function(d) {
return "rotate(" + (((d.startAngle + d.endAngle) / 2) * 180 / Math.PI - 90) + ")"
+ "translate(" + (r1 - 95) + ")"
+ (((d.startAngle + d.endAngle) / 2) > Math.PI ? "rotate(180)" : "");
})
.text(function(d) {
return labels[d.index] + ' ' + percentage[d.index];
})
.attr('fill', '#fff')
.style("font-size", "12px")
.on("mouseover", fade(.1))
.on("mouseout", fade(1));
svg.append("g")
.attr("class", "chord")
.selectAll("path")
.data(chord.chords)
.enter().append("path")
.attr("d", d3.svg.chord().radius(innerRadius))
.style("fill", function(d) { return fill(d.target.index); })
.style("opacity", 1);
// Returns an event handler for fading a given chord group.
function fade(opacity) {
return function(g, i) {
// chords part
svg.selectAll(".chord path")
.filter(function(d) { return d.source.index != i && d.target.index != i; })
.transition()
.style("opacity", opacity);
// labels part
svg.selectAll(".texts text")
.text(function(d, j) {
if (opacity == .1) {
return labels[j] + ' ' + mutualpercentage[i][j];
}
if (opacity == 1) {
return labels[j] + ' ' + percentage[j];
}
});
// columns part
var scale = d3.scale.linear().domain([0, 1]).range([innerRadius * 1.05, innerRadius * 1.5]);
svg.selectAll(".columns path").transition()
.attr("d", d3.svg.arc().innerRadius(innerRadius).outerRadius(function(d, j) {
if (opacity == .1) {
return scale(parseFloat(mutualpercentage[i][j]));
}
if (opacity == 1) {
return innerRadius * 1.05;
}
}));
};
}
</script>
<p>This is a visualization on relations between emotion labels of a song. Numbers on other labels reveal the frequency of co-occurance, when two labels occur in the same song. And the number appearing next to its own emotion label, reveals the frequency of independently occur in one song.</p>