forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
48 lines (47 loc) · 1.69 KB
/
example.js
File metadata and controls
48 lines (47 loc) · 1.69 KB
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
function loadDiagramm() {
d3.select('#energychart').selectAll("*").remove();
$.getJSON("spiderwebData.php", function (data) {
var labels = [], values = [];
$.each(data, function (leveli, subdimension) {
$.each(subdimension, function (dimensionName, level) {
$.each(level, function (subdimensionName, data) {
labels.push(replaceSubdimensionName(subdimensionName));
if (data['selected'] == 0) {
values.push(0);
} else {
values.push(100 / data['count'] * data['selected']);
}
});
});
});
var countSubdimensions = 17;
var chart = circularHeatChart()
.segmentHeight(40)
.innerRadius(170)
.numSegments(countSubdimensions)
.radialLabels(["Maturity 1", "Maturity 2", "Maturity 3", "Maturity 4"])
.segmentLabels(labels)
.range(["white", "green"])
d3.select('#energychart')
.selectAll('svg')
.data([values])
.enter()
.append('svg')
.call(chart);
});
$('html,body').scrollTop(0);
}
function replaceSubdimensionName(name) {
return name
.replace("for applications", "app")
.replace("Hardening", "Hard.")
.replace("Implementation", "Impl.")
.replace("Guidance", "Guid.")
.replace("for infrastructure", "infra")
.replace("Dynamic", "Dyn.")
.replace("Infrastructure", "Infra.")
.replace("Application", "App.")
.replace("Education", "Edu.")
.replace("Management", "Mgmt.")
;
}