-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
78 lines (73 loc) · 1.96 KB
/
app.js
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
function init() {
Tabletop.init({
key: 'https://docs.google.com/spreadsheets/d/1ELUpVIezX2hjvnh0cc71MjMOfWASTWwaC0kw-XpL2Zo/edit?usp=sharing',
simpleSheet: true
}
).then(function (data, tabletop) {
const entries = data.map(d => {
return {
"label": d.name,
"quadrant": getQuadrant(d.quadrant),
"ring": getRing(d.ring),
"link": d.link,
"moved": 0
}
})
console.log(entries);
renderVisualization(entries);
})
}
window.addEventListener('DOMContentLoaded', init)
function getQuadrant(q) {
q = q.trim();
if (q === 'Languages & Frameworks') {
return 2;
} else if (q === 'Tools and Techniques') {
return 3;
} else if (q === 'Data Management') {
return 1;
} else if (q === 'Infrastructure & Platform') {
return 0;
}else{
console.log('Unable to find ',q);
return 5;
}
}
function getRing(r) {
if (r === 'Adopt') {
return 0;
} else if (r === 'Trial') {
return 1;
} else if (r === 'Assess') {
return 2;
} else {
return 3;
}
}
function renderVisualization(entries) {
radar_visualization({
svg_id: "radar",
width: 1450,
height: 1000,
colors: {
background: "#fff",
grid: "#bbb",
inactive: "#ddd"
},
title: "Xebia Tech Radar - 2020.10",
quadrants: [
{ name: "Infrastructure & Platform" },
{ name: "Data Management" },
{ name: "Languages & Frameworks" },
{ name: "Tools and Techniques" }
],
rings: [
{ name: "ADOPT", color: "#799351" },
{ name: "TRIAL", color: "#ebdc87" },
{ name: "ASSESS", color: "#ffa36c" },
{ name: "HOLD", color: "#d54062" }
],
print_layout: true,
entries: entries
});
}