apexsankey 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +65 -2
- package/README.md +4 -5
- package/apexsankey.es.min.js +1 -1
- package/apexsankey.min.js +1 -1
- package/demo/basic-sankey.html +81 -64
- package/demo/css-theming.html +4 -4
- package/demo/sankey-alternate-node.html +93 -81
- package/demo/sankey-custom-fonts.html +78 -146
- package/demo/sankey-edge-options.html +205 -88
- package/demo/sankey-node-customization.html +83 -90
- package/demo/sankey-node-overlapping.html +158 -409
- package/demo/sankey-path-highlight.html +4 -4
- package/package.json +1 -1
|
@@ -3,426 +3,175 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>
|
|
7
|
-
<link href="https://fonts.googleapis.com
|
|
6
|
+
<title>Dense Layout - University Course Flow</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet" />
|
|
8
10
|
<script src="../apexsankey.min.js"></script>
|
|
11
|
+
<style>
|
|
12
|
+
body {
|
|
13
|
+
max-width: 1000px;
|
|
14
|
+
margin: 0 auto;
|
|
15
|
+
font-family: 'Inter', sans-serif;
|
|
16
|
+
background: #fff;
|
|
17
|
+
padding: 20px 0;
|
|
18
|
+
}
|
|
19
|
+
h2 {
|
|
20
|
+
font-size: 22px;
|
|
21
|
+
font-weight: 700;
|
|
22
|
+
color: #1a1a2e;
|
|
23
|
+
margin: 0 0 4px 0;
|
|
24
|
+
line-height: 1.3;
|
|
25
|
+
}
|
|
26
|
+
.subtitle {
|
|
27
|
+
font-size: 13px;
|
|
28
|
+
color: #888;
|
|
29
|
+
margin-bottom: 16px;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
9
32
|
</head>
|
|
10
33
|
<body>
|
|
11
|
-
<
|
|
34
|
+
<h2>University Course Enrollment Flow</h2>
|
|
35
|
+
<p class="subtitle">
|
|
36
|
+
A dense, many-node layout showing student enrollment across departments, courses, and outcomes (<code
|
|
37
|
+
>spacing: 24</code
|
|
38
|
+
>, <code>fontSize: '11px'</code>)
|
|
39
|
+
</p>
|
|
40
|
+
<div id="svg-sankey"></div>
|
|
12
41
|
<script>
|
|
13
42
|
const data = {
|
|
14
43
|
nodes: [
|
|
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
|
-
title: 'Chai',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: 'Chang',
|
|
53
|
-
title: 'Chang',
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
id: 'Aniseed Syrup',
|
|
57
|
-
title: 'Aniseed Syrup',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "Chef Anton's Cajun Seasoning",
|
|
61
|
-
title: "Chef Anton's Cajun Seasoning",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
id: "Grandma's Boysenberry Spread",
|
|
65
|
-
title: "Grandma's Boysenberry Spread",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
id: "Uncle Bob's Organic Dried Pears",
|
|
69
|
-
title: "Uncle Bob's Organic Dried Pears",
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'Northwoods Cranberry Sauce',
|
|
73
|
-
title: 'Northwoods Cranberry Sauce',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: 'Ikura',
|
|
77
|
-
title: 'Ikura',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'Queso Cabrales',
|
|
81
|
-
title: 'Queso Cabrales',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: 'Queso Manchego La Pastora',
|
|
85
|
-
title: 'Queso Manchego La Pastora',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: 'Konbu',
|
|
89
|
-
title: 'Konbu',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: 'Tofu',
|
|
93
|
-
title: 'Tofu',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: 'Genen Shouyu',
|
|
97
|
-
title: 'Genen Shouyu',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: 'Pavlova',
|
|
101
|
-
title: 'Pavlova',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'Carnarvon Tigers',
|
|
105
|
-
title: 'Carnarvon Tigers',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
id: 'Teatime Chocolate Biscuits',
|
|
109
|
-
title: 'Teatime Chocolate Biscuits',
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
id: "Sir Rodney's Marmalade",
|
|
113
|
-
title: "Sir Rodney's Marmalade",
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
id: "Sir Rodney's Scones",
|
|
117
|
-
title: "Sir Rodney's Scones",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
id: "Gustaf's Knäckebröd",
|
|
121
|
-
title: "Gustaf's Knäckebröd",
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
id: 'Tunnbröd',
|
|
125
|
-
title: 'Tunnbröd',
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
id: 'NuNuCa Nuß-Nougat-Creme',
|
|
129
|
-
title: 'NuNuCa Nuß-Nougat-Creme',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: 'Gumbär Gummibärchen',
|
|
133
|
-
title: 'Gumbär Gummibärchen',
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 'Schoggi Schokolade',
|
|
137
|
-
title: 'Schoggi Schokolade',
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
id: 'Nord-Ost Matjeshering',
|
|
141
|
-
title: 'Nord-Ost Matjeshering',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: 'Gorgonzola Telino',
|
|
145
|
-
title: 'Gorgonzola Telino',
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
id: 'Mascarpone Fabioli',
|
|
149
|
-
title: 'Mascarpone Fabioli',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'Geitost',
|
|
153
|
-
title: 'Geitost',
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: 'Sasquatch Ale',
|
|
157
|
-
title: 'Sasquatch Ale',
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
id: 'Steeleye Stout',
|
|
161
|
-
title: 'Steeleye Stout',
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
id: 'Inlagd Sill',
|
|
165
|
-
title: 'Inlagd Sill',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
id: 'Gravad lax',
|
|
169
|
-
title: 'Gravad lax',
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
id: 'Côte de Blaye',
|
|
173
|
-
title: 'Côte de Blaye',
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
id: 'Chartreuse verte',
|
|
177
|
-
title: 'Chartreuse verte',
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
id: 'Boston Crab Meat',
|
|
181
|
-
title: 'Boston Crab Meat',
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
id: "Jack's New England Clam Chowder",
|
|
185
|
-
title: "Jack's New England Clam Chowder",
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
id: 'Ipoh Coffee',
|
|
189
|
-
title: 'Ipoh Coffee',
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
id: 'Gula Malacca',
|
|
193
|
-
title: 'Gula Malacca',
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
id: 'Rogede sild',
|
|
197
|
-
title: 'Rogede sild',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
id: 'Spegesild',
|
|
201
|
-
title: 'Spegesild',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
id: 'Zaanse koeken',
|
|
205
|
-
title: 'Zaanse koeken',
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
id: 'Chocolade',
|
|
209
|
-
title: 'Chocolade',
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
id: 'Maxilaku',
|
|
213
|
-
title: 'Maxilaku',
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
id: 'Valkoinen suklaa',
|
|
217
|
-
title: 'Valkoinen suklaa',
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
id: 'Manjimup Dried Apples',
|
|
221
|
-
title: 'Manjimup Dried Apples',
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
id: 'Filo Mix',
|
|
225
|
-
title: 'Filo Mix',
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
id: 'Tourtière',
|
|
229
|
-
title: 'Tourtière',
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
id: 'Pâté chinois',
|
|
233
|
-
title: 'Pâté chinois',
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
id: 'Gnocchi di nonna Alice',
|
|
237
|
-
title: 'Gnocchi di nonna Alice',
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
id: 'Ravioli Angelo',
|
|
241
|
-
title: 'Ravioli Angelo',
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
id: 'Escargots de Bourgogne',
|
|
245
|
-
title: 'Escargots de Bourgogne',
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
id: 'Raclette Courdavault',
|
|
249
|
-
title: 'Raclette Courdavault',
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
id: 'Camembert Pierrot',
|
|
253
|
-
title: 'Camembert Pierrot',
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
id: "Sirop d'érable",
|
|
257
|
-
title: "Sirop d'érable",
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
id: 'Tarte au sucre',
|
|
261
|
-
title: 'Tarte au sucre',
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
id: 'Vegie-spread',
|
|
265
|
-
title: 'Vegie-spread',
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
id: 'Wimmers gute Semmelknödel',
|
|
269
|
-
title: 'Wimmers gute Semmelknödel',
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
id: 'Louisiana Fiery Hot Pepper Sauce',
|
|
273
|
-
title: 'Louisiana Fiery Hot Pepper Sauce',
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
id: 'Louisiana Hot Spiced Okra',
|
|
277
|
-
title: 'Louisiana Hot Spiced Okra',
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
id: 'Laughing Lumberjack Lager',
|
|
281
|
-
title: 'Laughing Lumberjack Lager',
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
id: 'Scottish Longbreads',
|
|
285
|
-
title: 'Scottish Longbreads',
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
id: 'Gudbrandsdalsost',
|
|
289
|
-
title: 'Gudbrandsdalsost',
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
id: 'Outback Lager',
|
|
293
|
-
title: 'Outback Lager',
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
id: 'Flotemysost',
|
|
297
|
-
title: 'Flotemysost',
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
id: 'Mozzarella di Giovanni',
|
|
301
|
-
title: 'Mozzarella di Giovanni',
|
|
302
|
-
},
|
|
303
|
-
{
|
|
304
|
-
id: 'Röd Kaviar',
|
|
305
|
-
title: 'Röd Kaviar',
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
id: 'Longlife Tofu',
|
|
309
|
-
title: 'Longlife Tofu',
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
id: 'Rhönbräu Klosterbier',
|
|
313
|
-
title: 'Rhönbräu Klosterbier',
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
id: 'Lakkalikööri',
|
|
317
|
-
title: 'Lakkalikööri',
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
id: 'Original Frankfurter grüne Soße',
|
|
321
|
-
title: 'Original Frankfurter grüne Soße',
|
|
322
|
-
},
|
|
44
|
+
// Departments
|
|
45
|
+
{id: 'CS', title: 'Computer Science', color: '#3B82F6'},
|
|
46
|
+
{id: 'Math', title: 'Mathematics', color: '#8B5CF6'},
|
|
47
|
+
{id: 'Physics', title: 'Physics', color: '#06B6D4'},
|
|
48
|
+
{id: 'Business', title: 'Business', color: '#F59E0B'},
|
|
49
|
+
{id: 'Biology', title: 'Biology', color: '#10B981'},
|
|
50
|
+
{id: 'English', title: 'English', color: '#EC4899'},
|
|
51
|
+
// Courses — CS
|
|
52
|
+
{id: 'Intro to Programming', title: 'Intro to Programming', color: '#60A5FA'},
|
|
53
|
+
{id: 'Data Structures', title: 'Data Structures', color: '#3B82F6'},
|
|
54
|
+
{id: 'Machine Learning', title: 'Machine Learning', color: '#2563EB'},
|
|
55
|
+
{id: 'Web Development', title: 'Web Development', color: '#1D4ED8'},
|
|
56
|
+
// Courses — Math
|
|
57
|
+
{id: 'Calculus', title: 'Calculus', color: '#A78BFA'},
|
|
58
|
+
{id: 'Linear Algebra', title: 'Linear Algebra', color: '#8B5CF6'},
|
|
59
|
+
{id: 'Statistics', title: 'Statistics', color: '#7C3AED'},
|
|
60
|
+
// Courses — Physics
|
|
61
|
+
{id: 'Mechanics', title: 'Mechanics', color: '#22D3EE'},
|
|
62
|
+
{id: 'Electromagnetism', title: 'Electromagnetism', color: '#06B6D4'},
|
|
63
|
+
// Courses — Business
|
|
64
|
+
{id: 'Accounting', title: 'Accounting', color: '#FBBF24'},
|
|
65
|
+
{id: 'Marketing', title: 'Marketing', color: '#F59E0B'},
|
|
66
|
+
{id: 'Finance', title: 'Finance', color: '#D97706'},
|
|
67
|
+
// Courses — Biology
|
|
68
|
+
{id: 'Cell Biology', title: 'Cell Biology', color: '#34D399'},
|
|
69
|
+
{id: 'Genetics', title: 'Genetics', color: '#10B981'},
|
|
70
|
+
// Courses — English
|
|
71
|
+
{id: 'Creative Writing', title: 'Creative Writing', color: '#F472B6'},
|
|
72
|
+
{id: 'Literature', title: 'Literature', color: '#EC4899'},
|
|
73
|
+
// Outcomes
|
|
74
|
+
{id: 'Graduated', title: 'Graduated', color: '#059669'},
|
|
75
|
+
{id: 'Switched Major', title: 'Switched Major', color: '#F97316'},
|
|
76
|
+
{id: 'Dropped', title: 'Dropped', color: '#94A3B8'},
|
|
77
|
+
{id: 'Honors', title: 'Honors', color: '#7C3AED'},
|
|
323
78
|
],
|
|
324
79
|
edges: [
|
|
325
|
-
|
|
326
|
-
{source: '
|
|
327
|
-
{source: '
|
|
328
|
-
{source: '
|
|
329
|
-
{
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
{source: '
|
|
336
|
-
{source: '
|
|
337
|
-
|
|
338
|
-
{
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
},
|
|
343
|
-
{source: '
|
|
344
|
-
|
|
345
|
-
{source: '
|
|
346
|
-
{source: '
|
|
347
|
-
|
|
348
|
-
{source: '
|
|
349
|
-
{source: '
|
|
350
|
-
{source: '
|
|
351
|
-
{source: '
|
|
352
|
-
{source: '
|
|
353
|
-
{source: '
|
|
354
|
-
{source: '
|
|
355
|
-
{source: '
|
|
356
|
-
{source: '
|
|
357
|
-
{source: '
|
|
358
|
-
{source: '
|
|
359
|
-
|
|
360
|
-
{source: '
|
|
361
|
-
{source: '
|
|
362
|
-
{source: '
|
|
363
|
-
{source: '
|
|
364
|
-
{source: '
|
|
365
|
-
{source: '
|
|
366
|
-
{source: '
|
|
367
|
-
{source: '
|
|
368
|
-
{source: '
|
|
369
|
-
|
|
370
|
-
{source: '
|
|
371
|
-
{source: '
|
|
372
|
-
{source: '
|
|
373
|
-
{source: '
|
|
374
|
-
{source: '
|
|
375
|
-
{source: '
|
|
376
|
-
|
|
377
|
-
{source: '
|
|
378
|
-
{source: '
|
|
379
|
-
{source: '
|
|
380
|
-
{source: '
|
|
381
|
-
{source: '
|
|
382
|
-
{source: '
|
|
383
|
-
{source: '
|
|
384
|
-
{source: '
|
|
385
|
-
|
|
386
|
-
{source: '
|
|
387
|
-
{source: '
|
|
388
|
-
{
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
{
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
},
|
|
398
|
-
{source: '
|
|
399
|
-
{source: 'Beverages', target: 'Laughing Lumberjack Lager', value: 52},
|
|
400
|
-
{source: 'Confections', target: 'Scottish Longbreads', value: 6},
|
|
401
|
-
{source: 'Dairy Products', target: 'Gudbrandsdalsost', value: 26},
|
|
402
|
-
{source: 'Beverages', target: 'Outback Lager', value: 15},
|
|
403
|
-
{source: 'Dairy Products', target: 'Flotemysost', value: 26},
|
|
404
|
-
{source: 'Dairy Products', target: 'Mozzarella di Giovanni', value: 14},
|
|
405
|
-
{source: 'Seafood', target: 'Röd Kaviar', value: 101},
|
|
406
|
-
{source: 'Produce', target: 'Longlife Tofu', value: 4},
|
|
407
|
-
{source: 'Beverages', target: 'Rhönbräu Klosterbier', value: 150},
|
|
408
|
-
{source: 'Beverages', target: 'Lakkalikööri', value: 57},
|
|
409
|
-
{
|
|
410
|
-
source: 'Condiments',
|
|
411
|
-
target: 'Original Frankfurter grüne Soße',
|
|
412
|
-
value: 32,
|
|
413
|
-
},
|
|
80
|
+
// CS courses
|
|
81
|
+
{source: 'CS', target: 'Intro to Programming', value: 280},
|
|
82
|
+
{source: 'CS', target: 'Data Structures', value: 190},
|
|
83
|
+
{source: 'CS', target: 'Machine Learning', value: 140},
|
|
84
|
+
{source: 'CS', target: 'Web Development', value: 160},
|
|
85
|
+
// Math courses
|
|
86
|
+
{source: 'Math', target: 'Calculus', value: 220},
|
|
87
|
+
{source: 'Math', target: 'Linear Algebra', value: 130},
|
|
88
|
+
{source: 'Math', target: 'Statistics', value: 170},
|
|
89
|
+
// Physics courses
|
|
90
|
+
{source: 'Physics', target: 'Mechanics', value: 150},
|
|
91
|
+
{source: 'Physics', target: 'Electromagnetism', value: 110},
|
|
92
|
+
// Business courses
|
|
93
|
+
{source: 'Business', target: 'Accounting', value: 180},
|
|
94
|
+
{source: 'Business', target: 'Marketing', value: 200},
|
|
95
|
+
{source: 'Business', target: 'Finance', value: 160},
|
|
96
|
+
// Biology courses
|
|
97
|
+
{source: 'Biology', target: 'Cell Biology', value: 140},
|
|
98
|
+
{source: 'Biology', target: 'Genetics', value: 120},
|
|
99
|
+
// English courses
|
|
100
|
+
{source: 'English', target: 'Creative Writing', value: 110},
|
|
101
|
+
{source: 'English', target: 'Literature', value: 90},
|
|
102
|
+
// CS outcomes
|
|
103
|
+
{source: 'Intro to Programming', target: 'Graduated', value: 180},
|
|
104
|
+
{source: 'Intro to Programming', target: 'Switched Major', value: 60},
|
|
105
|
+
{source: 'Intro to Programming', target: 'Dropped', value: 40},
|
|
106
|
+
{source: 'Data Structures', target: 'Graduated', value: 140},
|
|
107
|
+
{source: 'Data Structures', target: 'Honors', value: 30},
|
|
108
|
+
{source: 'Data Structures', target: 'Dropped', value: 20},
|
|
109
|
+
{source: 'Machine Learning', target: 'Graduated', value: 90},
|
|
110
|
+
{source: 'Machine Learning', target: 'Honors', value: 40},
|
|
111
|
+
{source: 'Machine Learning', target: 'Dropped', value: 10},
|
|
112
|
+
{source: 'Web Development', target: 'Graduated', value: 130},
|
|
113
|
+
{source: 'Web Development', target: 'Dropped', value: 30},
|
|
114
|
+
// Math outcomes
|
|
115
|
+
{source: 'Calculus', target: 'Graduated', value: 150},
|
|
116
|
+
{source: 'Calculus', target: 'Switched Major', value: 40},
|
|
117
|
+
{source: 'Calculus', target: 'Dropped', value: 30},
|
|
118
|
+
{source: 'Linear Algebra', target: 'Graduated', value: 90},
|
|
119
|
+
{source: 'Linear Algebra', target: 'Honors', value: 25},
|
|
120
|
+
{source: 'Linear Algebra', target: 'Dropped', value: 15},
|
|
121
|
+
{source: 'Statistics', target: 'Graduated', value: 120},
|
|
122
|
+
{source: 'Statistics', target: 'Switched Major', value: 30},
|
|
123
|
+
{source: 'Statistics', target: 'Dropped', value: 20},
|
|
124
|
+
// Physics outcomes
|
|
125
|
+
{source: 'Mechanics', target: 'Graduated', value: 100},
|
|
126
|
+
{source: 'Mechanics', target: 'Switched Major', value: 30},
|
|
127
|
+
{source: 'Mechanics', target: 'Dropped', value: 20},
|
|
128
|
+
{source: 'Electromagnetism', target: 'Graduated', value: 70},
|
|
129
|
+
{source: 'Electromagnetism', target: 'Honors', value: 25},
|
|
130
|
+
{source: 'Electromagnetism', target: 'Dropped', value: 15},
|
|
131
|
+
// Business outcomes
|
|
132
|
+
{source: 'Accounting', target: 'Graduated', value: 140},
|
|
133
|
+
{source: 'Accounting', target: 'Dropped', value: 40},
|
|
134
|
+
{source: 'Marketing', target: 'Graduated', value: 160},
|
|
135
|
+
{source: 'Marketing', target: 'Switched Major', value: 25},
|
|
136
|
+
{source: 'Marketing', target: 'Dropped', value: 15},
|
|
137
|
+
{source: 'Finance', target: 'Graduated', value: 110},
|
|
138
|
+
{source: 'Finance', target: 'Honors', value: 30},
|
|
139
|
+
{source: 'Finance', target: 'Dropped', value: 20},
|
|
140
|
+
// Biology outcomes
|
|
141
|
+
{source: 'Cell Biology', target: 'Graduated', value: 100},
|
|
142
|
+
{source: 'Cell Biology', target: 'Switched Major', value: 25},
|
|
143
|
+
{source: 'Cell Biology', target: 'Dropped', value: 15},
|
|
144
|
+
{source: 'Genetics', target: 'Graduated', value: 80},
|
|
145
|
+
{source: 'Genetics', target: 'Honors', value: 25},
|
|
146
|
+
{source: 'Genetics', target: 'Dropped', value: 15},
|
|
147
|
+
// English outcomes
|
|
148
|
+
{source: 'Creative Writing', target: 'Graduated', value: 80},
|
|
149
|
+
{source: 'Creative Writing', target: 'Switched Major', value: 20},
|
|
150
|
+
{source: 'Creative Writing', target: 'Dropped', value: 10},
|
|
151
|
+
{source: 'Literature', target: 'Graduated', value: 65},
|
|
152
|
+
{source: 'Literature', target: 'Honors', value: 15},
|
|
153
|
+
{source: 'Literature', target: 'Dropped', value: 10},
|
|
414
154
|
],
|
|
415
155
|
};
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
156
|
+
|
|
157
|
+
const options = {
|
|
158
|
+
nodeWidth: 14,
|
|
159
|
+
fontFamily: 'Inter, sans-serif',
|
|
160
|
+
fontWeight: '500',
|
|
161
|
+
fontSize: '11px',
|
|
162
|
+
fontColor: '#334155',
|
|
163
|
+
width: '100%',
|
|
164
|
+
height: 680,
|
|
165
|
+
spacing: 24,
|
|
166
|
+
edgeGradientFill: true,
|
|
167
|
+
edgeOpacity: 0.25,
|
|
168
|
+
enableToolbar: true,
|
|
169
|
+
highlightConnectedPath: true,
|
|
170
|
+
dimOpacity: 0.12,
|
|
171
|
+
canvasStyle: 'border: 1px solid #e2e8f0; border-radius: 8px; background: #fafafa; box-sizing: border-box;',
|
|
424
172
|
};
|
|
425
|
-
|
|
173
|
+
|
|
174
|
+
const s = new ApexSankey(document.getElementById('svg-sankey'), options);
|
|
426
175
|
s.render(data);
|
|
427
176
|
</script>
|
|
428
177
|
</body>
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Sankey
|
|
6
|
+
<title>Sankey - Connected Path Highlight on Hover</title>
|
|
7
7
|
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap" rel="stylesheet" />
|
|
8
8
|
<script src="../apexsankey.min.js"></script>
|
|
9
9
|
<style>
|
|
10
10
|
body {
|
|
11
11
|
font-family: 'Quicksand', sans-serif;
|
|
12
|
-
margin: 0;
|
|
12
|
+
margin: 0 auto;
|
|
13
13
|
padding: 24px;
|
|
14
14
|
background: #f5f6fa;
|
|
15
15
|
color: #212121;
|
|
16
|
+
max-width: 1000px;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
h1 {
|
|
@@ -37,7 +38,6 @@
|
|
|
37
38
|
border-radius: 8px;
|
|
38
39
|
padding: 16px 20px;
|
|
39
40
|
margin-bottom: 20px;
|
|
40
|
-
max-width: 860px;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.control-group {
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
fontFamily: 'Quicksand, sans-serif',
|
|
160
160
|
fontWeight: '600',
|
|
161
161
|
height: 520,
|
|
162
|
-
width:
|
|
162
|
+
width: '100%',
|
|
163
163
|
edgeOpacity: 0.4,
|
|
164
164
|
enableToolbar: false,
|
|
165
165
|
highlightConnectedPath: highlightEnabled,
|