forked from txsun1997/nlp-paradigm-shift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sankey.html
215 lines (208 loc) · 8.32 KB
/
sankey.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!-- Sankey -->
<head>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-core.min.js"></script>
<script src="https://cdn.anychart.com/releases/v8/js/anychart-sankey.min.js"></script>
<style type="text/css">
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="container"></div>
<script>
anychart.onDocumentReady(function(){
//creating the data
var data = [
{from: 'Seq2ASeq (2012)', to: 'Seq2ASeq (2013)', value: 100},
{from: 'Seq2Seq (2013)', to: 'Seq2Seq (2014)', value: 100},
{from: 'Class (2012)', to: 'Class (2013)', value: 100},
{from: 'Class (2013)', to: 'Class (2014)', value: 100},
{from: 'Matching (2012)', to: 'Matching (2013)', value: 100},
{from: 'Matching (2013)', to: 'Matching (2014)', value: 100},
{from: 'SeqLab (2012)', to: 'SeqLab (2013)', value: 100},
{from: 'SeqLab (2013)', to: 'SeqLab (2014)', value: 100},
{from: 'MRC (2012)', to: 'MRC (2013)', value: 100},
{from: 'MRC (2013)', to: 'MRC (2014)', value: 100},
{from: 'Seq2Seq (2012)', to: 'Seq2Seq (2013)', value: 100},
{from: 'Seq2ASeq (2013)', to: 'Seq2ASeq (2014)', value: 100},
{from: '(M)LM (2012)', to: '(M)LM (2013)', value: 100},
{from: '(M)LM (2013)', to: '(M)LM (2014)', value: 100},
{from: 'Class (2014)', to: 'Class (2015)', value: 100},
{from: 'Matching (2014)', to: 'Matching (2015)', value: 100},
{from: 'SeqLab (2014)', to: 'SeqLab (2015)', value: 100},
{from: 'MRC (2014)', to: 'MRC (2015)', value: 100},
{from: 'Seq2Seq (2014)', to: 'Seq2Seq (2015)', value: 100},
{from: 'Seq2ASeq (2014)', to: 'Seq2Seq (2015)', value: 20},
{from: 'Seq2ASeq (2014)', to: 'Seq2ASeq (2015)', value: 80},
{from: '(M)LM (2014)', to: '(M)LM (2015)', value: 100},
{from: 'Class (2015)', to: 'Class (2016)', value: 100},
{from: 'Matching (2015)', to: 'Matching (2016)', value: 100},
{from: 'SeqLab (2015)', to: 'SeqLab (2016)', value: 100},
{from: 'MRC (2015)', to: 'MRC (2016)', value: 100},
{from: 'Seq2Seq (2015)', to: 'Seq2Seq (2016)', value: 120},
{from: 'Seq2ASeq (2015)', to: '(M)LM (2016)', value: 20},
{from: 'Seq2ASeq (2015)', to: 'Seq2ASeq (2016)', value: 60},
{from: '(M)LM (2015)', to: '(M)LM (2016)', value: 100},
{from: '(M)LM (2016)', to: '(M)LM (2017)', value: 120},
{from: 'Class (2016)', to: 'Class (2017)', value: 88},
{from: 'Class (2016)', to: 'MRC (2017)', value: 12},
{from: 'Matching (2016)', to: 'Matching (2017)', value: 100},
{from: 'SeqLab (2016)', to: 'SeqLab (2017)', value: 100},
{from: 'MRC (2016)', to: 'MRC (2017)', value: 100},
{from: 'Seq2Seq (2016)', to: 'Seq2Seq (2017)', value: 120},
{from: 'Seq2ASeq (2016)', to: 'Seq2ASeq (2017)', value: 60},
{from: 'Class (2017)', to: 'Class (2018)', value: 76},
{from: 'Class (2017)', to: 'Seq2Seq (2018)', value: 12},
{from: 'Matching (2017)', to: 'Matching (2018)', value: 75},
{from: 'Matching (2017)', to: 'Seq2Seq (2018)', value: 25},
{from: 'SeqLab (2017)', to: 'SeqLab (2018)', value: 83},
{from: 'SeqLab (2017)', to: 'Seq2Seq (2018)', value: 17},
{from: 'MRC (2017)', to: 'MRC (2018)', value: 112},
{from: 'Seq2Seq (2017)', to: 'Seq2Seq (2018)', value: 120},
{from: 'Seq2ASeq (2017)', to: 'SeqLab (2018)', value: 20},
{from: 'Seq2ASeq (2017)', to: 'Seq2ASeq (2018)', value: 40},
{from: '(M)LM (2017)', to: '(M)LM (2018)', value: 120},
{from: 'MRC (2018)', to: 'MRC (2019)', value: 112},
{from: 'SeqLab (2018)', to: 'SeqLab (2019)', value: 103},
{from: 'Class (2018)', to: 'Matching (2019)', value: 15},
{from: 'Class (2018)', to: 'Class (2019)', value: 61},
{from: 'Matching (2018)', to: 'Matching (2019)', value: 50},
{from: 'Matching (2018)', to: 'Class (2019)', value: 25},
{from: 'Seq2Seq (2018)', to: 'Seq2Seq (2019)', value: 174},
{from: 'Seq2ASeq (2018)', to: 'Seq2ASeq (2019)', value: 40},
{from: '(M)LM (2018)', to: '(M)LM (2019)', value: 120},
{from: 'Matching (2019)', to: 'Matching (2020)', value: 40},
{from: 'Matching (2019)', to: '(M)LM (2020)', value: 25},
{from: 'Class (2019)', to: 'Class (2020)', value: 34},
{from: 'Class (2019)', to: 'MRC (2020)', value: 13},
{from: 'Class (2019)', to: 'Matching (2020)', value: 13},
{from: 'Class (2019)', to: 'SeqLab (2020)', value: 13},
{from: 'Class (2019)', to: '(M)LM (2020)', value: 13},
{from: 'SeqLab (2019)', to: 'Class (2020)', value: 16},
{from: 'SeqLab (2019)', to: 'MRC (2020)', value: 16},
{from: 'SeqLab (2019)', to: 'Matching (2020)', value: 16},
{from: 'SeqLab (2019)', to: 'SeqLab (2020)', value: 55},
{from: 'MRC (2019)', to: 'MRC (2020)', value: 62},
{from: 'MRC (2019)', to: '(M)LM (2020)', value: 50},
{from: 'Seq2Seq (2019)', to: '(M)LM (2020)', value: 50},
{from: 'Seq2Seq (2019)', to: 'Seq2Seq (2020)', value: 124},
{from: 'Seq2ASeq (2019)', to: 'Seq2ASeq (2020)', value: 40},
{from: '(M)LM (2019)', to: '(M)LM (2020)', value: 120},
{from: 'Class (2020)', to: 'Seq2Seq (2021)', value: 12},
{from: 'Class (2020)', to: 'MRC (2021)', value: 12},
{from: 'Class (2020)', to: 'Class (2021)', value: 14},
{from: 'Class (2020)', to: '(M)LM (2021)', value: 12},
{from: 'MRC (2020)', to: 'MRC (2021)', value: 91},
{from: 'Matching (2020)', to: 'Matching (2021)', value: 69},
{from: 'SeqLab (2020)', to: 'Seq2Seq (2021)', value: 17},
{from: 'SeqLab (2020)', to: 'SeqLab (2021)', value: 35},
{from: 'SeqLab (2020)', to: '(M)LM (2021)', value: 16},
{from: '(M)LM (2020)', to: '(M)LM (2021)', value: 258},
{from: 'Seq2Seq (2020)', to: 'Seq2Seq (2021)', value: 124},
{from: 'Seq2ASeq (2020)', to: 'MRC (2021)', value: 20},
{from: 'Seq2ASeq (2020)', to: 'Seq2ASeq (2021)', value: 20},
];
var nodeColors = {
'Seq2ASeq (2012)': '#37719c',
'Seq2Seq (2013)': '#4bc053',
'Class (2012)': '#19cdbb',
'Class (2013)': '#19cdbb',
'Matching (2012)': '#9a4c8c',
'Matching (2013)': '#9a4c8c',
'SeqLab (2012)': '#807a35',
'SeqLab (2013)': '#807a35',
'MRC (2012)': '#ee7e56',
'MRC (2013)': '#ee7e56',
'Seq2Seq (2012)': '#4bc053',
'Seq2ASeq (2013)': '#37719c',
'(M)LM (2012)': '#e6353c',
'(M)LM (2013)': '#e6353c',
'Class (2014)': '#19cdbb',
'Matching (2014)': '#9a4c8c',
'SeqLab (2014)': '#807a35',
'MRC (2014)': '#ee7e56',
'Seq2Seq (2014)': '#4bc053',
'Seq2ASeq (2014)': '#37719c',
'(M)LM (2014)': '#e6353c',
'Class (2015)': '#19cdbb',
'Matching (2015)': '#9a4c8c',
'SeqLab (2015)': '#807a35',
'MRC (2015)': '#ee7e56',
'Seq2Seq (2015)': '#4bc053',
'Seq2ASeq (2015)': '#37719c',
'(M)LM (2015)': '#e6353c',
'(M)LM (2016)': '#e6353c',
'Class (2016)': '#19cdbb',
'Matching (2016)': '#9a4c8c',
'SeqLab (2016)': '#807a35',
'MRC (2016)': '#ee7e56',
'Seq2Seq (2016)': '#4bc053',
'Seq2ASeq (2016)': '#37719c',
'Class (2017)': '#19cdbb',
'Matching (2017)': '#9a4c8c',
'SeqLab (2017)': '#807a35',
'MRC (2017)': '#ee7e56',
'Seq2Seq (2017)': '#4bc053',
'Seq2ASeq (2017)': '#37719c',
'(M)LM (2017)': '#e6353c',
'MRC (2018)': '#ee7e56',
'SeqLab (2018)': '#807a35',
'Class (2018)': '#19cdbb',
'Matching (2018)': '#9a4c8c',
'Seq2Seq (2018)': '#4bc053',
'Seq2ASeq (2018)': '#37719c',
'(M)LM (2018)': '#e6353c',
'Matching (2019)': '#9a4c8c',
'Class (2019)': '#19cdbb',
'SeqLab (2019)': '#807a35',
'MRC (2019)': '#ee7e56',
'Seq2Seq (2019)': '#4bc053',
'Seq2ASeq (2019)': '#37719c',
'(M)LM (2019)': '#e6353c',
'Class (2020)': '#19cdbb',
'MRC (2020)': '#ee7e56',
'Matching (2020)': '#9a4c8c',
'SeqLab (2020)': '#807a35',
'(M)LM (2020)': '#e6353c',
'Seq2Seq (2020)': '#4bc053',
'Seq2ASeq (2020)': '#37719c',
'Seq2Seq (2021)': '#4bc053',
'MRC (2021)': '#ee7e56',
'Class (2021)': '#19cdbb',
'Matching (2021)': '#9a4c8c',
'SeqLab (2021)': '#807a35',
'Seq2ASeq (2021)': '#37719c',
'(M)LM (2021)': '#e6353c',
}
//calling the Sankey function
var sankey_chart = anychart.sankey(data);
sankey_chart.node().normal().stroke("#455a64", 2);
sankey_chart.node().normal().fill(function() {
return nodeColors[this.name] || this.sourceColor;
});
sankey_chart.node().hovered().fill(function() {
return anychart.color.darken(nodeColors[this.name]) || this.sourceColor;
});
//customizing the visual appearance of flows
sankey_chart.flow().normal().fill("#ffa000 0.5");
sankey_chart.flow().hovered().fill(anychart.color.darken("#ffa000"));
sankey_chart.flow().hovered().stroke("#455a63");
sankey_chart.node().labels().enabled(true).fontColor('Black').fontSize(10);
sankey_chart.tooltip().enabled(true);
//customizing the width of the nodes
sankey_chart.nodeWidth("30%");
//setting the chart title
sankey_chart.title("Paradigm Shift in NLP");
//customizing the vertical padding of the nodes
sankey_chart.nodePadding(20);
//setting the container id
sankey_chart.container("container");
//initiating drawing the Sankey diagram
sankey_chart.draw();
});
</script>
</body>